Skip to content

feat(src): match func_L26_003D4590 and repair six copies of one catalogue entry - #392

Merged
Veradictus merged 4 commits into
OpenRAC:masterfrom
Fromnowheree:match/l26-003d4590
Nov 2, 2026
Merged

Veradictus merged 4 commits into
OpenRAC:masterfrom
Fromnowheree:match/l26-003d4590

Conversation

@Fromnowheree

Copy link
Copy Markdown
Contributor

What

Matches 7 functions: the two level-26 functions, and the five other copies of one of them, which had the same catalogue defect.

func_L26_003D4590 (928 bytes; USA v1.01 and v2.00, not in PAL)

  • Moves to L26_003D4590-g8.c with -O2 -G8 -ffunction-sections -frac2-zero-ti-por, the retained draft's profile. The draft was already the right size.
  • What closes it: the two random-range upper bounds, D_L26_001B0464 and D_L26_001B045C, are declared volatile MACRO_ADDR, as D_L02_001B00FC is in the level-2 state machine (L02_003C43F0-state-g8.c). Each range reads its upper bound absolutely, before the lower bound, and each is read once. Either declaration alone leaves it unmatched.
  • D_L26_001B1748 is the int frame word that L26_003D4930-g8.c and L26_004070F8.c declare, tested through its low byte (the draft read it as a byte).
  • Its functional draft and nonmatching/functional.tsv row go too, as tests/check_repository.py requires.

func_L26_003547D8 and its five copies (272-byte bodies, all three releases)

Function Placements Pointer to the real start
func_L26_003547D8 26 26:00286D80
func_L04_00378838 4 and 10 (shared) 04:0029FE90, 10:0029F960
func_L05_00367340 5 05:0029D4F0
func_L12_0035A838 12 12:00288180
func_L14_0035F510 14 14:0028D180
func_L20_0036AE68 20 20:00292390
  • The defect: each catalogue extent began with the previous body's 16-byte tail (sw $t3,0x40($v1); nop; addiu $sp,$sp,0x20; nop). docs/MATCHING-BLOCKERS.md recorded it for the level 5, 12 and 20 rows. The repair was left unapplied there only because the PAL and v2.00 catalogues had to be carried. In every placement a data word points to the real start, and nothing points to the four leading words.
  • The repair: named FUNCTION_ENTRY_OFFSETS entries, (288, 16) each, move the entries and keep the names and ends.
    • Regenerating the USA catalogue and running tools/carry.py --entries for PAL and v2.00 changes exactly these six rows in each release.
    • The catalogues are stable on replay.
  • The C: each body equals func_L00_00354DF8's (whose level-0 entry was corrected the same way) up to linker-filled addresses. So each is that function's C with its level's own tables, in a -g8 file of its own beside its old unit, at the default flags. The shared row names level 4's tables.
  • Cleanup: the drafts for the level-26, level-4 and level-14 rows and their README rows are removed. docs/MATCHING-BLOCKERS.md records the repair.

Worth a look:

  • The two volatile declarations in func_L26_003D4590. An independent review disassembled the object: retail's lui $at/lwc1 for each upper bound comes before the lower bound's $gp load in the call's delay slot, and each upper bound is read once, so the qualifier invents no access.
  • The catalogue edits. They touch only these six rows, in all three releases, through the existing tools.

Checked

On 7c3ea917 (on fe9a7138), on the compiler rebuilt with tools/compiler/build.sh (no compiler changes since), on all three releases:

  • python3 tools/build.py all --strict with --version us, pal and us2: 28 programs OK on each.
  • python3 tools/check.py <func> --version us|pal|us2 for all seven: every place matches in each release that has the function (func_L04_00378838: 2 of 2 on USA; func_L26_003D4590 is not in PAL).
  • python3 tools/levels.py check: all 28 dumps equal config/programs.tsv.
  • python -m unittest discover -s tests: 339 tests OK.
  • python tests/check_repository.py: passed.
  • python tools/progress.py --check: passed; the reports of us, pal and us2 agree.

progress/ and the README table are not touched.

Fromnowheree and others added 4 commits November 2, 2026 17:19
func_L26_003D4590 moves to L26_003D4590-g8.c with
-O2 -G8 -ffunction-sections -frac2-zero-ti-por, the draft's profile.
It is the retained draft with its two random-range upper bounds,
D_L26_001B0464 and D_L26_001B045C, declared volatile MACRO_ADDR: as in
the level-2 state machine (L02_003C43F0-state-g8.c), each range reads its
upper bound absolutely before the lower bound, and each is read once.
Either declaration alone leaves the function unmatched. D_L26_001B1748
is the int frame word that L26_003D4930-g8.c and L26_004070F8.c declare,
tested through its low byte.

Its draft and nonmatching/README.md row are removed.

Commands run:
  python3 tools/check.py func_L26_003D4590 --version us|us2  (1 of 1 places match; not in pal)
  python3 tools/build.py all --strict --version us|pal|us2     (28 programs OK each)
  python -m unittest discover -s tests      (339 tests OK)
  python tests/check_repository.py          (passed)
  python tools/progress.py --check          (passed)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
func_L26_003547D8's catalogue extent began with the previous body's
16-byte tail (sw $t3,0x40($v1); nop; addiu $sp,$sp,0x20; nop), the
defect docs/MATCHING-BLOCKERS.md records for this body in levels 5, 12
and 20. The word at 26:00286D80 points to 0x003547E8 and nothing points
to the four leading words. A named FUNCTION_ENTRY_OFFSETS entry,
(288, 16), moves the entry and keeps the name and the end; regenerating
the USA catalogue and carrying it with tools/carry.py --entries changes
exactly that row in each release (272 bytes from 0x003547E8, PAL's
0x00356CD8 and v2.00's 0x003559A8), and the catalogues are stable on
replay.

The body is level 26's copy of func_L00_00354DF8, whose level-0 entry
was corrected the same way: its C, with the level's own tables
(D_L26_0028B320, D_L26_00286DD0, D_L26_0021CCB0, D_L26_001AA7F0,
D_L26_001C9160), moves to L26_003547D8-g8.c. The draft that described
the defect and its README row are removed, and docs/MATCHING-BLOCKERS.md
notes the repair for the other five rows.

Commands run:
  python3 tools/levels.py catalogue; python3 tools/carry.py --version pal|us2 --entries
  python3 tools/levels.py check             (all 28 dumps equal config/programs.tsv)
  python3 tools/check.py func_L26_003547D8 --version us|pal|us2  (1 of 1 places match)
  python3 tools/build.py all --strict --version us|pal|us2     (28 programs OK each)
  python -m unittest discover -s tests      (339 tests OK)
  python tests/check_repository.py          (passed)
  python tools/progress.py --check          (passed)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its functional draft and nonmatching/functional.tsv row go now that the
function has matching C in L26_003D4590-g8.c, as tests/check_repository.py
requires.

Commands run:
  python tests/check_repository.py          (passed)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
func_L04_00378838 (levels 4 and 10), func_L05_00367340,
func_L12_0035A838, func_L14_0035F510 and func_L20_0036AE68 had the same
catalogue defect as func_L26_003547D8: each extent began with the
previous body's 16-byte tail, and a data word points to the real start
in every placement (04:0029FE90, 10:0029F960, 05:0029D4F0, 12:00288180,
14:0028D180, 20:00292390) while nothing points to the leading words.
Named FUNCTION_ENTRY_OFFSETS entries, (288, 16) each, move the entries
and keep names and ends; regenerating the USA catalogue and carrying it
with tools/carry.py --entries changes exactly those five rows in each
release, and the catalogues are stable on replay.

Each body equals func_L00_00354DF8's up to linker-filled addresses, so
each is that function's C with its level's own tables, in a -g8 file of
its own beside its old unit; the shared one names level 4's tables. The
drafts for the level-4 and level-14 rows and the level-14 README row are
removed, and docs/MATCHING-BLOCKERS.md records the repair.

Commands run:
  python3 tools/levels.py catalogue; python3 tools/carry.py --version pal|us2 --entries
  python3 tools/levels.py check             (all 28 dumps equal config/programs.tsv)
  python3 tools/check.py <each function> --version us|pal|us2  (every place matches)
  python3 tools/build.py all --strict --version us|pal|us2     (28 programs OK each)
  python -m unittest discover -s tests      (339 tests OK)
  python tests/check_repository.py          (passed)
  python tools/progress.py --check          (passed)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bytematchdev

bytematchdev Bot commented Nov 2, 2026

Copy link
Copy Markdown

ByteMatch progress report

SCES_516.07

Code matched 54.15% · 3.09 MB of 5.70 MB
Fuzzy match 54.15%
Functions 6,996 / 8,672
Data matched 0.00%
Units complete 958 / 1,196

No function changes.

SCUS_972.68_v2

Code matched 81.01% · 4.52 MB of 5.58 MB
Fuzzy match 81.01%
Functions 7,595 / 8,634
Data matched 0.00%
Units complete 973 / 1,156

No function changes.

SCUS_972.68

Code matched 84.74% · 4.68 MB of 5.53 MB
Fuzzy match 84.74%
Functions 7,760 / 8,579
Data matched 0.00%
Units complete 924 / 1,018

No function changes.

Commit 7c3ea91 · Ratchet & Clank: Going Commando on ByteMatch

@Veradictus
Veradictus merged commit 1ac67be into OpenRAC:master Nov 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants