Skip to content

fix(nonmatching): repair five large actor and loader reconstructions - #390

Merged
llesieur99 merged 1 commit into
masterfrom
match/largest-five-solo-20261101
Nov 2, 2026
Merged

llesieur99 merged 1 commit into
masterfrom
match/largest-five-solo-20261101

Conversation

@llesieur99

Copy link
Copy Markdown
Collaborator

What

Repair retained C for the five largest available unfinished USA v1.01 routines
(58,424 retail bytes). No complete function matches, no matching credit is added,
and none of these drafts is enabled in the functional manifest.

  • func_L22_0039D708: recover three float-to-int conversions, the canonical
    collision and animation callees, all five collision arguments, complete byte
    addresses, and real vector/matrix scratch storage. The old draft silently used
    zero for unsupported operations and split vector fields into unrelated locals.
  • func_L11_00420C88: preserve separate projectile paths, the shared hero-state
    object, strict angle comparisons, and selector/mount transition order.
  • func_L00_00300618: use an explicit C loop that preserves the four source-cursor
    advances. Its complete 24-word record-copy sequence now equals retail at all
    27 USA placements, without changing the compiler.
  • func_L00_003AE900: use normal aligned template assignments with the current
    compiler, preserve the state reload following the collision call, and describe
    the actual voice-record layout. Both template-copy loops agree at all 54 USA
    v1.01/v2.00 placements; the rest of the function still differs.
  • func_L08_003CDF98: correct the voice-active byte and record stride, capture
    copy inputs, restore the diagnostic argument and use an absolute hero-pointer
    load. Its inherited fast-math profile remains provisional.

Keep known helper return contracts even when ignored, and retain the command
packer's 64-bit argument widths. These were checked against the matched callee
definitions and recompiled; they do not produce a complete match.

Function Previous draft Retained draft Retail
func_L22_0039D708 15,396 15,528 16,068
func_L11_00420C88 15,384 15,772 15,832
func_L00_00300618 11,272 11,280 11,348
func_L00_003AE900 8,412 8,432 8,440
func_L08_003CDF98 6,624 6,632 6,736

Size is diagnostic only. The updated source headers, nonmatching index and existing
compiler/blocker notes record the remaining differences and useful next experiments.
Production sources, flags, catalogues, the functional manifest and progress reports
are unchanged. No game data or generated evidence is included.

Checked

Validation:

  • tools/build.py all --strict --version us: 28 programs OK, zero C fallbacks.
  • tools/build.py all --strict --version us2: 28 programs OK, zero C fallbacks.
  • tools/build.py all --strict --version pal: 28 programs OK, zero C fallbacks.
  • python3 -m unittest discover -s tests: 339 tests passed.
  • tests/check_repository.py and tools/progress.py --check for all three releases passed.
  • All 7,567 qualified production inputs agree with the host checkout; LF/diff checks passed.
  • Candidate checks: 0/87 complete placements. No functional replay or gameplay test.

Candidate checks still reject all 87 applicable placements. Only func_L00_003AE900
has the same identity in USA v2.00; all five identities are absent from PAL. This
does not claim that related gameplay code is absent from those releases.

tools/regalloc.py func_L00_003AE900 --json confirms that diagnostic and normal
objects agree. No functional capture replay or native gameplay test was run; the
strict production builds above do not qualify code retained in nonmatching/.

Retain useful corrections to the five largest available USA v1.01 routines
without promoting any of their 58,424 retail bytes to matching C.

Recover the orbit controller's float conversions, canonical collision and
animation callees, byte addresses and complete shared scratch storage. Keep
Joba's projectile branches separate, model its common hero object, and preserve
the strict angle clamp and selector/mount transition order.

The level loader's explicit C loop reproduces its 24-word record-copy sequence
at all 27 USA placements without a compiler patch. Normal aligned template
assignments reproduce both robot copy loops at 54 USA v1.01/v2.00 placements.
Correct the robot's collision-state reload and voice layout, and the shared
hero NPC's voice-active byte, captured copy inputs and diagnostic argument.

Preserve actual helper return contracts even when discarded, plus the render
command packer's 64-bit argument widths. Update the existing nonmatching index
and compiler/blocker notes with the measurements and remaining obstructions.

All five complete functions remain nonmatching and are not functional-gated.
Production sources, flags, catalogues, the functional manifest and progress
reports are unchanged. Private disassembly, objects and trial evidence are not
included.

Validation:
- tools/build.py all --strict --version us: 28 programs OK, zero C fallbacks.
- tools/build.py all --strict --version us2: 28 programs OK, zero C fallbacks.
- tools/build.py all --strict --version pal: 28 programs OK, zero C fallbacks.
- python3 -m unittest discover -s tests: 339 tests passed.
- tests/check_repository.py and tools/progress.py --check for all three releases passed.
- All 7,567 qualified production inputs agree with the host checkout; LF/diff checks passed.
- Candidate checks: 0/87 complete placements. No functional replay or gameplay test.
@bytematchdev

bytematchdev Bot commented Nov 2, 2026

Copy link
Copy Markdown

ByteMatch progress report

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.

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

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 abcc1a4 · Ratchet & Clank: Going Commando on ByteMatch

@llesieur99
llesieur99 merged commit ea1ff27 into master Nov 2, 2026
2 checks passed
Veradictus added a commit that referenced this pull request Nov 2, 2026
Rebase the functional row on the retained draft of #390. Selector 10's angle
clamp now uses retail's strict compares (c.lt.s on both bounds), so an
unordered angle is stored unchanged where the earlier C stored +pi/2. The
other changes of the draft (hero globals as one object, separate projectile
arms in cases 38/39, selector 0's branch order) do the same as before.

Case 23 keeps this row's WORD(state, 0x56c) for the func_002B6228 path,
which retail reads at 0x4231B8 and 0x4231E0; the draft still has 0x54c.

Gate: fcheck SAME on 4 calls; fcheck cover runs 171 of 3,958 retail
instructions, and neither selector 10 nor case 23 is among them, so both
changes rest on reading retail.
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