Repository navigation
Match 26 small US functions (4 net, 6 game, 2 core, 14 overlay) - #138
Open
GarfTornion wants to merge 6 commits into
Open
GarfTornion wants to merge 6 commits into
GarfTornion wants to merge 6 commits into
Conversation
Landed, each re-checked in place by tools/try_func.py and exact in tools/audit_matches.py: func_01EB4DD0 net func_01EACEF0 net func_L00_00519CF0 level 00 overlay func_L00_00709290 level 00 overlay func_L00_00709980 level 00 overlay func_L00_00753158 level 00 overlay func_L01_003C90CC shared overlay (46 levels) func_L11_003C5088 shared overlay func_L15_004E38C4 shared overlay Two of them are decided by the compiler choice rather than by the C: -fno-schedule-insns -fno-schedule-insns2 and @ee296 -O2 -G0, found by sweeping the batch's near misses over 21 flag sets (private/tools/flagsweep.py). Both files carry the cflags line that matters. The 24 functions that did not match are staged in nonmatching/ with the verdict each reached, three of them at a better flag set than their first attempt. config/us/map.tsv, config/pal/map.tsv and both progress reports regenerated with this src/: US 7,168 of 18,170 functions, PAL 7,642 of 18,134. tools/progress.py --check passes for both discs; tools/audit_relocs.py reports none of the nine among its pre-existing mismatches. Co-Authored-By: Cline <noreply@cline.bot>
Landed, each EXACT through tools/try_func.py, exact in tools/audit_matches.py
and absent from tools/audit_relocs.py's mismatches:
func_00154010 core, the byte-table lookup
func_00547E00 game, halfword getter of the 0x44-stride slots
func_00548078 game, word getter of the same slots
func_00547DC8 game, halfword setter of the same slots
func_00548040 game, word setter of the same slots
func_L00_00710750 level 00 overlay, the constructor
Two levers decided this batch. The lookups came from the flag sweep: 21 sets
plus @sn107/@sn114/-G2 left them at 1-2 bytes, and func_00154010 closed when the
loop counter became u32 (sltiu, not slti) under @ee296 -O2 -G0. The four slot
accessors came from OpenRAC's permuter (profile rac4/ntsc-win), which needed its
compile step build/cc_win.sh back (git-ignored, missing in this checkout) and
candidates without file-scope declarations; its hint is the address of the
clamped index (`s32 *index = &a1;`), which keeps the index in $a1 as retail
does. The permuter's asm-pass output for the setters was rejected by tools/wave.py
("refused: inline assembly") and reproduced by hand in plain C instead.
The five functions that did not match are staged in nonmatching/ with the verdict
each reached.
config/us/map.tsv, config/pal/map.tsv and both progress reports regenerated with
this src/: 5,905,00 of 5,781,432 US bytes (7,192 functions), PAL 725,320 of
5,810,856. tools/progress.py --check passes for both discs.
Co-Authored-By: Cline <noreply@cline.bot>
Co-Authored-By: Cline <noreply@cline.bot>
Co-Authored-By: Cline <noreply@cline.bot>
Co-Authored-By: Cline <noreply@cline.bot>
Co-Authored-By: Cline <noreply@cline.bot>
ByteMatch progress reportSCES_532.85
✅ Newly matched (18)
📈 Improved (2)
📉 Worse (4)
SCUS_974.65
✅ Newly matched (22)
📈 Improved (2)
📉 Worse (4)
Commit 6672aa1 · Ratchet: Deadlocked on ByteMatch |
GarfTornion
marked this pull request as ready for review
November 9, 2026 18:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Matches 26 US functions of reservation batch 52: 4 in
net.text, 6 ingame, 2 incore, and 14 in overlays (7l00_multiplayer_menu, 7 shared/L11/L15). All are small (16-128 bytes). The first commit also stages 24 near misses innonmatching/with their measured verdicts; three are updated by later commits.func_01EACEF0,func_01EB4DD0,func_01EA8BD0,func_01EDA958(net);func_00547DC8,func_00547E00,func_00548040,func_00548078,func_00548DA0,func_00501988(game);func_00154010,func_0012E8C8(core);func_L00_00519CF0,func_L00_00709290,func_L00_00709980,func_L00_00710750,func_L00_00753158,func_L00_007099A0,func_L00_0077A2F8(l00 overlay);func_L01_003C90CC,func_L01_0043C180,func_L01_0048AD68,func_L01_004BDD78,func_L01_00573B60,func_L11_003C5088,func_L15_004E38C4(shared overlays).How they were matched
func_01EACEF0(@ee296 -O2 -G0),func_L11_003C5088(-fno-schedule-insns -fno-schedule-insns2), andfunc_01EB4DD0,func_L00_00519CF0,func_L00_00709290,func_L00_00709980,func_L00_00753158,func_L01_003C90CC,func_L15_004E38C4from their drafts.0x44-stride accessor familyfunc_00547DC8,func_00547E00,func_00548040,func_00548078(C written asT *p = ¶m;on a clamped index, which is what the allocator needs), plusfunc_00154010(@ee296 -O2 -G0with au32counter forsltiu) andfunc_L00_00710750(store order).func_00548DA0(permuter hint rewritten as plain C),func_01EA8BD0(the 16-byte argument slots turned out to be the 8-byte-aggregate ABI ofsrc/net/01EB4DE8.c, and the handler is read as a struct member),func_L01_0043C180.func_01EDA958andfunc_00501988build with@ee296 -O2 -G8, the only compiler that emits the R5900sllv/div.slatency nops retail carries (-G0moves the globals off$gpand does not match);func_01EDA958also needs au32counter copied from itsu16parameter, otherwise GCC re-truncates inside the loop.func_L00_007099A0is a statement order (the unconditional store before the finalif),func_L00_0077A2F8a store order (the pairwise reverse of retail's).func_L01_004BDD78(comparing the masked value signedly blocks GCC's single-bitsra+andifold),func_0012E8C8(the function returns 0 - retail'sdaddu $v0,$zero,$zero- and the tail written as an array index keeps%hiin a register;@ee29 -O2 -G0like its neighbours),func_L01_00573B60(amode(TI)16-byte copy),func_L01_0048AD68(u128 tmp[1]homes a TImode local on the stack, which a scalar does not).No
#definealiases,volatile, inline asm or hard-coded addresses.Verification
upstream/mainat0bddadfdis merged in (the merge commit regenerates the derived files), and the branch tip is6672aa1a:tools/build.sh: 8,414 objects;tools/audit_matches.py: 5,650 exact, 164 pre-existing non-exact; no line names any of the 26;tools/audit_relocs.py: 27 records and no unresolved target, none of them ours;config/us/map.tsv7,741 match,config/pal/map.tsv8,327 match;tools/progress.py --checkfor US and PAL: US 7,695 of 18,170 functions / 745,840 of 5,781,432 bytes (12.90%), PAL 8,062 of 18,134 / 850,424 of 5,810,856 (14.64%).Reserved in #112. Independent of #121 and #137 (no file in common).
The remaining 24 functions of the reservation stay in
nonmatching/with their measurements: 6 are not functions (four catalogue fragments, a shared entry point and a hardware-register routine), 10 are closed by measured compiler or layout behaviour, and 8 are one register-allocation choice away from exact.