Repository navigation
Match 57 NTSC-U functions - #92
Merged
Merged
Conversation
ByteMatch progress reportSCES_532.85
✅ Newly matched (51)
SCUS_974.65
✅ Newly matched (57)
Commit 4349a29 · Ratchet: Deadlocked on ByteMatch |
Clank700
force-pushed
the
claude/rac4-us-90-matches
branch
from
November 3, 2026 22:14
df1eff5 to
5c7d8a5
Compare
Clank700
marked this pull request as draft
November 3, 2026 22:14
57 resident-menu, game and overlay functions now match the US disc, one C file each (one of them replaces its near miss in nonmatching/). The C is built with each file's own flags: 28 files use the defaults, 23 the Sony EE GCC 2.9 route already used by the repository (@ee29) and 6 a -fno-schedule-insns variant, each stated in the file header. Every function is new on both discs: none has a src/pal/ source on main, so no existing source or its credit moves. Main program and levels: 5,435 -> 5,492 functions on US (414,340 -> 418,508 bytes), 6,032 -> 6,083 on PAL. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Clank700
force-pushed
the
claude/rac4-us-90-matches
branch
from
November 4, 2026 17:47
5c7d8a5 to
4349a29
Compare
Clank700
marked this pull request as ready for review
November 4, 2026 17:51
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.
What
57 NTSC-U (SCUS_974.65) functions move from unmatched to matched, one C file each; one of them (
func_L00_00528810) replaces its near miss innonmatching/. US matched functions 5,435 → 5,492 (414,340 → 418,508 bytes), PAL 6,032 → 6,083 (497,616 → 501,564 bytes).config/us/map.tsv,config/pal/map.tsv, both progress reports and the README table are regenerated with the repository tools; only the rows of the new sources changed.Every function here is new on both discs: none has a
src/pal/source on main, so no existing source or its credit moves (compared function by function inprogress/report.jsonandprogress/pal/report.json, per unit: no function name appears in two units with different percentages, and none of the existing functions gets worse or disappears).This branch is rebased on current main (c78d917, after #90) and mergeable.
Compiler: 29 of the 57 files carry their own compiler flags
The default route (SN GCC 2.95.3,
-O2 -G8 -fopt-stack) builds 28 of the files. The other 29 only match with a per-file header, which is how this repository already handles it (tools/build.shreads/* cflags: ... */from the first lines; nothing in the build scripts changes):@ee29, the Sony EE GCC 2.9 route. Not all of RAC4 was built with one compiler: besides the SN compiler, part of the library-like and glue code comes out of Sony'see-gcc2.9 (2.9-ee-991111). This repository already supports that whole-file route (commit ddfe94d,tools/cc.sh, docs/TOOLCHAIN.md "Sony EE GCC 2.9 route"); the token@ee29in the first-linecflagsselects it and defaults to-O2 -G0(one file adds-O2 -G0explicitly). These 23 functions do not match under the SN route at all, and match byte for byte under the Sony route. Supporting evidence from our own objects (not from the disc): all 23 start withsdsaves of callee-saved registers, 21 of them at ascending 16-byte spacing (offsets 0, 0x10, 0x20, ...), which is the Sony 2.9 prologue style; SN 2.95.3 with-fopt-stacksaves with 8-byte slots.-fno-schedule-insnsvariants (5 ×-fno-schedule-insns, 1 ×-fno-schedule-insns -fno-schedule-insns2), which the repository already uses in other sources; they turn off one or both instruction-scheduling passes of the SN compiler.How we checked that the flag is actually needed: we compiled the 29 files again without their
cflagsline (default SN route) and ran the same strict comparison; all 29 fail (bytes differ at every one of their 40 placements). With their own header all 29 are exact.A caveat we want to be honest about: matching under an alternative whole-file profile shows the code is compatible with that profile; it does not prove the historical flag set. The per-file header only states what reproduces the bytes.
How the C was found
Reconstructed from the retail code of this repository (our assembly, m2c) and made to match by compiling with the file's own flags (above). Plain C only: no inline assembly,
registerdeclarations ordo { } while (0)shaping, and no source adapted from another project.Checks (clean build of every source of this exact head, 4349a29, on top of main c78d917)
src/libgccandsrc/libm) compiled with each file's own flags, every compile's exit code logged: 0 non-zero. 6,292 objects come from a clean full build of the previous head of this branch (the sources of the head are identical to that tree except the 6 PAL files that main added since, which were compiled fresh);build/libgccandbuild/libmare copied from an earlier full build, sincesrc/changes do not affect them.tools/audit_matches.py: exit 0, 4,032 exact, 3 not exact (the same 3 as on main:func_00161890,func_00547A98,func_L01_004F3100).tools/audit_relocs.py(with the overlay ELFs): exit 1, 80 mismatches in 43 functions, 3 unresolved. This is not new: the same lines are reported on main without this change (diffed line by line against a build of 60818dd; only the count of checked functions differs), and none of the 57 functions appears in them. CONTRIBUTING asks for 0, so we do not call this gate clean; the existing entries (54 call targets, 25 GPREL16, 1 HI16/LO16, in sources this PR does not touch) need a separate fix.tools/match_map.py --checkandtools/progress.py --check, for US and--version pal: all exit 0.config/*/map.tsvalso flips some unrelated rows (libm rows, becausebuild/libmwas not rebuilt here); those rows were restored to main's values, so the map diff contains only the new functions.tools/match_map.py --write/tools/progress.pyrun again.🤖 Generated with Claude Code