Skip to content

Match 16 USA functions and repair reload/padding accounting - #423

Merged
llesieur99 merged 2 commits into
masterfrom
match/usa-twenty-20261105
Nov 5, 2026
Merged

llesieur99 merged 2 commits into
masterfrom
match/usa-twenty-20261105

Conversation

@llesieur99

@llesieur99 llesieur99 commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

What

Match 16 functions present in USA v1.01: 10,000 distinct code bytes and 849 verified C placements across their carrying releases.

Function USA bytes USA places US2 places PAL places
func_00115E28 16 1 1 1
func_00115E38 48 1 1 1
func_001185E8 1,496 1 1 1
func_00294420 456 28 28 28
func_002E7338 568 28 28 28
func_002EEBC8 320 1 1 28
func_002F0FA0 108 28 28 28
func_00316E08 1,220 28 28 28
func_00337210 2,500 28 28 28
func_L00_00418230 1,276 27 27 27
func_L00_00424F98 380 27 27 absent
func_L00_0042A4E8 8 27 27 27
func_L00_0042A4F0 8 27 27 27
func_L00_0042A4F8 8 27 27 27
func_L03_002ECF08 1,008 2 2 absent
func_L05_00419CC8 580 4 4 absent

The maintained generator separates the abort/assertion entries and the three empty callbacks only after checking complete bodies, bounds and real entry witnesses. The callback family uses camera dispatch in 26 levels and object dispatch in Boldan. Stale-report validation accepts only the union of those independently verified splits; unknown gaps and old matching credit still fail.

Correct four bounded cases in existing compiler mechanisms:

  • Snapshot the initial non-spill exclusion before reload allocations add their own marks, retaining other reload lifetime checks.
  • Count nops inserted before an already-visited loop branch so a later back edge does not add them twice.
  • Count the selected known non-PIC GP expansion once in the division-label distance.
  • Count ordinary unannounced external SI loads/addresses as their two emitted words. Preserve scheduler lengths, prior declarations/definitions, explicit SDATA aliases, PIC/buffering exclusions and delay-slot handling.

Authored positive and negative controls cover these cases. No correction selects a game function/address or rewrites its operations/registers. The existing museum brightness routine keeps its calculation, clamp and store on one debug source line to preserve retail's division boundary; it adds no matching credit.

The C uses complete quad, matrix, UV, camera and menu-table owners, actual call interfaces, and the full cache owner for its real -1 sentinel. The formatter separates its integer-digit budget from the decimal exponent and groups the actual character encoding/store. Retire superseded drafts and preserve useful near misses and their reopening conditions. Distinct native-oriented variants retain their bodies with targeted interface repairs.

Explicit holds and limits: the otherwise exact Joba renderer remains nonmatching because its qcopy_nc form violates the helper's memory-dependency contract. The unresolved counter-display draft is removed from the functional registry and retained for analysis. The trail packet's untouched word and the formatter's low-word dispatch/unbounded scratch are retail behavior. A pre-existing uninitialized scalar in the floor/fmod word macros is documented and unchanged; no native-safety claim is made.

Checked

  • python3 tools/build.py all --strict --jobs 6 --version us, then us2 and pal: 28 programs OK each on the fifteen-function integration with the final compiler.
  • After adding the formatter, tools/build.py boot --strict --version ... passed for all three releases, with its C placement checked.
  • Final verification rechecked all 84 complete loaded images, zero C fallbacks and all 849 C placements. The 81 level inputs are unchanged; the core parent's complete object is byte-identical and the formatter is absent from level catalogues.
  • python3 -m unittest discover -s tests: 415 tests, OK (one conditional GCC-source harness skipped in discovery). That harness ran successfully against prepared GCC during the compiler build.
  • python3 tests/check_repository.py: passed with real Git metadata.
  • python3 tools/progress.py --check --version us, us2, and pal: passed. README and report bytes are unchanged.
  • Edited public text is UTF-8/LF. No game assets, generated evidence or proprietary tools are included.

No native gameplay or emulator session was run. The PR is ready for review and has not been merged.

Replace eight renderer, effect, input and cache markers with complete C owners,
and recover the separately entered abort/assertion bodies from the old 64-byte
boot row. The ten USA v1.01 functions add 8,052 distinct code bytes and occupy
489 verified C placements across the three carrying releases.

Correct three existing compiler mechanisms: snapshot the initial non-spill
exclusion before a reload marks its own register; count nops inserted before
an already-visited loop branch; and count the chosen known non-PIC expansion
when measuring the division-label distance. Add authored controls, including
negative checks against the old behavior, without opcode/register rewriting
or function-specific compiler cases. Keep the existing museum brightness
update on one debug source line so its unchanged operations retain retail's
division boundary.

Use full UV, quad, matrix and menu-table owners, preserve real return and
callback contracts, and represent the cache's -1 slot inside the full table
owner. Document the original untouched trail-packet word. Hold the otherwise
exact Joba renderer in nonmatching because its nc-copy spelling violates the
helper's memory-dependency contract. Preserve useful variants privately and
retire only the superseded matching/functional drafts.

Validation on the complete staged production inputs:
- tools/build.py all --strict --jobs 6 --version us: 28 programs OK.
- The same strict command for us2 and pal: 28 programs OK each.
- All 84 loaded images equal retail, zero C fallbacks; all 489 new C placements
  and the three existing museum controls checked in placed.json.
- unittest discovery: 405 tests, OK (one source-dependent harness skipped in
  discovery; it ran successfully against prepared GCC during the compiler build).
- Real-Git check_repository.py and progress.py --check for all three versions pass.
- README and progress report bytes are unchanged. No native gameplay test run.
@bytematchdev

bytematchdev Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

ByteMatch progress report

SCES_516.07

Code matched 56.58% · 3.23 MB of 5.70 MB
Fuzzy match 56.58%
Functions 7,242 / 8,677
Data matched 0.00%
Units complete 990 / 1,217

No function changes.

SCUS_972.68

Code matched 91.80% · 5.07 MB of 5.53 MB
Fuzzy match 91.80%
Functions 8,173 / 8,584
Data matched 0.00%
Units complete 983 / 1,069

No function changes.

SCUS_972.68_v2

Code matched 86.02% · 4.80 MB of 5.58 MB
Fuzzy match 86.02%
Functions 7,932 / 8,639
Data matched 0.00%
Units complete 1,017 / 1,190

No function changes.

Commit 3b8cf1d · Ratchet & Clank: Going Commando on ByteMatch

Complete the current matching lot with the 1,496-byte floating formatter,
the RPC-buffer initializer and record-reset loop, and three independently
entered empty callbacks. These six bodies add 1,948 distinct USA bytes and
360 C placements. Together with the first commit, the PR contains sixteen
USA v1.01 functions, 10,000 distinct bytes and 849 verified C placements.

Count the two-word expansion of an unannounced external SI load/address
only in the existing post-delay-slot padding pass. Preserve scheduler
lengths, instructions, register choices, prior metadata, explicit GP views,
PIC/buffering exclusions and delay-slot behavior. Track definitions at G0
without changing emitted assembly. Seven authored controls pass; the prior
compiler fails the three positive cases and passes the four controls.

Validate every callback entry through the actual dispatch table: cameras
in 26 levels and objects in Boldan, in every release. Keep complete-body,
overlap and replay guards. Allow only the union of independently verified
boot and level splits when checking stale reports; unknown gaps still fail.

Separate the formatter's real integer-digit budget and decimal exponent,
and group the character encoding/store. Preserve and document retail's
low-word dispatch and unbounded scratch behavior. Record the pre-existing
floor/fmod word-construction issue without claiming it was repaired.

Retain measured interface/owner corrections and bounded negative results.
Preserve distinct native-oriented variants with targeted ABI corrections;
remove the unresolved counter-display draft from the functional registry
while keeping its C in nonmatching. No failed trial earns matching credit.

Validation:
- All 84 programs passed tools/build.py all --strict on the fifteen-body
  integration with the final compiler. All three boot programs were rebuilt
  strictly after adding the formatter, and its C placement was verified.
- Rechecked all 84 complete loaded images and all 849 C placements. The 81
  level inputs are unchanged; the modified core parent's complete object is
  byte-identical, and the new formatter has no level placement.
- 415 unit tests: OK (one conditional source harness skipped in discovery;
  it passed during the compiler build). Real-Git repository check and all
  three progress checks pass. README/report bytes remain unchanged.
- Public edited text is UTF-8/LF. No native gameplay session was run.
@llesieur99 llesieur99 changed the title Match ten USA functions and correct reload/padding accounting Match 16 USA functions and repair reload/padding accounting Nov 5, 2026
@llesieur99
llesieur99 merged commit cfc6830 into master Nov 5, 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.

1 participant