Skip to content

Match 165 PAL functions - #96

Open
Shaar-games wants to merge 45 commits into
OpenRAC:mainfrom
Shaar-games:codex/pal-solver-matches
Open

Shaar-games wants to merge 45 commits into
OpenRAC:mainfrom
Shaar-games:codex/pal-solver-matches

Conversation

@Shaar-games

@Shaar-games Shaar-games commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Adds 165 matching PAL functions (+26,488 code bytes). Shared source helpers retain one owner for each marker; matching grouped functions use their genuine function sections at their retail addresses.

Matching functions

  • func_0012C680

  • func_0014DE80

  • func_004A3180

  • func_004A3968

  • func_004A3B38

  • func_004B0398

  • func_004C09B0

  • func_004C1E20

  • func_004C3010

  • func_004CFDB8

  • func_004CFE50

  • func_004D2D48

  • func_004F4BE0

  • func_00501A90

  • func_00505C28

  • func_00505E00

  • func_005064A8

  • func_00506978

  • func_0050AAC8

  • func_0050AC20

  • func_0050AD58

  • func_0050B488

  • func_0050BB78

  • func_0050C250

  • func_0054B628

  • func_L00_00520988

  • func_L00_00521390

  • func_L00_00541ED8

  • func_L00_0059A318

  • func_L00_005ABA00

  • func_L00_00621DEC

  • func_L00_0062D8B0

  • func_L00_00641BE8

  • func_L00_00641C08

  • func_L00_0065A198

  • func_L00_0065D090

  • func_L00_0069F6B8

  • func_L00_0069F7B8

  • func_L00_0069F870

  • func_L00_0069F928

  • func_L00_0069F9D0

  • func_L00_0069FA78

  • func_L00_0069FB20

  • func_L00_0069FC18

  • func_L00_0069FD10

  • func_L00_0069FE88

  • func_L00_0069FF88

  • func_L00_006A0070

  • func_L00_006A0168

  • func_L00_006A0250

  • func_L00_006A0340

  • func_L00_006A0428

  • func_L00_006A0520

  • func_L00_006A0618

  • func_L00_006A0710

  • func_L00_006A0AF8

  • func_L00_006A0BE8

  • func_L00_006A0CD0

  • func_L00_006A0DB8

  • func_L00_006A0EA0

  • func_L00_006A10A0

  • func_L00_006A1230

  • func_L00_006A1328

  • func_L00_006A1898

  • func_L00_006A1960

  • func_L00_006A2048

  • func_L00_006A2108

  • func_L00_006A21F8

  • func_L00_006A22C0

  • func_L00_006A3750

  • func_L00_006A3840

  • func_L00_006A3C40

  • func_L00_006A4060

  • func_L00_006A4188

  • func_L00_006A4370

  • func_L00_006A4488

  • func_L00_006A4598

  • func_L00_006A47D0

  • func_L00_006A49D0

  • func_L00_006A4AF8

  • func_L00_006A4C98

  • func_L00_006A4E10

  • func_L00_006A4EF8

  • func_L00_006A5008

  • func_L00_006A5298

  • func_L00_006A5700

  • func_L00_006A5858

  • func_L00_006A5990

  • func_L00_006A60C0

  • func_L00_006A6230

  • func_L00_006A67B0

  • func_L00_006A6B00

  • func_L00_006A6E88

  • func_L00_006A7390

  • func_L00_006A75B8

  • func_L00_006A7720

  • func_L00_0070F328

  • func_L00_007139B0

  • func_L00_00725A48

  • func_L00_007292F8

  • func_L00_00761C88

  • func_L00_00776DE8

  • func_L00_00783270

  • func_L00_007834D0

  • func_L01_003C9D50

  • func_L01_003CB420

  • func_L01_003CC998

  • func_L01_004133F0

  • func_L01_00435C00

  • func_L01_004909D8

  • func_L01_00494EE0

  • func_L01_00498F80

  • func_L01_004AFF80

  • func_L01_004C0048

  • func_L01_004FC530

  • func_L02_004CCE90

  • func_L04_004A0DD0

  • func_L04_004A20B0

  • func_L05_004663D8

  • func_L05_004942B8

  • func_L05_004E17E0

  • func_L08_004CE858

  • func_L10_004D5E10

  • func_L15_00499000

  • func_L15_004A2140

  • func_L15_004D8970

  • func_L15_00502480

  • func_L41_003E3480

  • func_L41_00412548

  • func_L41_00446E50

  • func_L41_00447490

  • func_L41_00449C08

  • func_L41_00449D88

  • func_L41_0044DA48

  • func_00159718

  • func_01EE98D8

  • func_L00_005AC338

  • func_L00_006212B0

  • func_L00_006213D8

  • func_L00_00621410

  • func_L00_0068B1F8

  • func_L00_007145E0

  • func_L01_00453E78

  • func_L01_00453EB0

  • func_L01_00576370

  • func_L01_005763B8

  • func_L01_00589E38

  • func_L01_00594170

  • func_L01_00599FA8

  • func_L02_0049EA00

  • func_L02_004C7578

  • func_L02_004CDEE0

  • func_L02_004E5C18

  • func_L05_0048A078

  • func_L05_00494310

  • func_L05_004E1C30

  • func_L01_005A3798

  • func_L01_005A3878

  • func_01EF0604

  • func_01F088BC

  • func_L01_0049AA70

  • func_L02_004CCEA0

  • func_L02_005056F8

  • func_L05_004C3820

  • func_L05_003E2AD0

Source integration

The table lookup and insertion routines share their marker in one translation unit. Shared headers avoid repeating the eight-slot and three-slot probe/insertion bodies. Object dispatch and bounds helpers likewise share their proved views and lookup contracts. Both functions and the complete allocated data are independently linked and compared; relocation-masked equality alone is not accepted. The newly added PAL rows describe their canonical selected program placement; equivalent catalogue copies in other overlays are not claimed as separately linked C builds.

Existing callers now agree with the reconstructed callee declarations, including explicit raw-address conversions, the status/output-buffer contract, and the release-wrapper pointer argument. These declaration corrections retain their complete executable code and allocated data. Shared record headers expose only proved fields while retaining the existing opaque regions and layout. The request routine shares its existing context owner; all eight profile consumers and the separate dialog caller now use the same checked contracts. Their complete existing code/data and relocations are preserved; only the new routine adds coverage. An existing PAL method also now uses the correct scalar global declaration: its former array declaration produced 28 linked byte differences; the corrected complete 100-byte function passes strict verification. This does not add another matched-map row. The RAC3-derived allocation wrapper identifies its original donor file, function and pinned upstream commit in the source comment. THIRD_PARTY_NOTICES.md is unchanged.

Why the Python tools change

The original readers assumed every function belonged to .text. With -ffunction-sections, .text may be empty and several executable sections may each contain a function at offset zero. That assumption loses functions or applies another section's relocations.

  • tools/elf_layout.py resolves symbols through st_shndx, checks section bounds and keeps relocation ownership distinct. It supports section-relative relocatable objects and linked virtual addresses.
  • Compile/diff/variant/draft readers, match-map generation and audits reuse that layout. Existing NOP checks inspect the owning executable section; this adds no instruction-byte rewriting rule.
  • match_map.py --update-native checks selected native source files while preserving unrelated baseline rows, including US other rows for PAL-only sources. It rejects duplicate/moved definitions and mismatches.
  • Native launchers write LF scripts and resolve host Bash from the supplied environment; Docker retains its own literal bash.
  • docs/WORKFLOW.md documents the generic metadata command with placeholder paths.

The standalone solver, agent orchestration, benchmarks and private workflow are outside this PR.

Validation

  • Public section/layout, relocation, NOP, launcher and metadata regression controls pass, including a real nonzero-address ET_REL object.
  • Every final changed function was rebuilt through native and stock shell routes with byte-identical complete objects. Independent linking checks complete selected PAL function bytes and every allocated initialized/BSS byte. Grouped objects also verify their preserved lookup functions and single marker owner.
  • The earlier baseline rebuilt 6,242 translation units and audited all 6,167 non-library PAL matched rows; later additions have their own fresh full linking proofs.
  • Both versions' map/progress checks pass. PAL matched functions increase from 6,032 to 6,188, code bytes from 497,616 to 523,712. US progress is unchanged.
  • US binary/relocation audits could not run because the corresponding US dumps are unavailable locally. No linked whole-game C build or runtime test is claimed.

The November 5 continuation adds 22 PAL functions from its frozen 50-target cohort (1,020 further code bytes). The last two overlay routines were rebuilt independently with strict native/stock object equality, no byte differences after linking and both PAL/US map-progress checks passing. No additional public support code was required for those two. The standalone full build is presently blocked on Windows by CRLF parsing in the existing tools/cc.sh (pipefail\r); per-function independent proofs remain complete.

The latest frozen 50-function PAL cohort is complete: 30 isolated strict matches; 20 have been integrated and published in its lifetime (1,100 canonical PAL code bytes). This commit adds two 28-byte L01 wrappers, returning the observed 64-bit caller result after forwarding the original 128-bit value. Both pass native/stock object identity and full linked checks, with no allocated data. Ten other isolated matches remain withheld pending shared overlay data ownership; remaining failures keep their retained evidence.

The November 5, 14:00 PAL cohort completed 50/50 solver evaluations: 44 compiled, 25 passed isolated strict linking (1,524 bytes). This integration adds 7 newly reviewed, canonical PAL functions (336 bytes). All 7 were rebuilt from final source paths with warning-free native/stock shell object equality, complete linked code/data checks, and refreshed PAL/US maps and progress checks. Existing libm ownership blocked one otherwise isolated strict candidate, and shared-overlay data ownership blocked three; neither was published. No public support code was needed for this batch.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T13:59:07.354976Z a6c59dd New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@bytematchdev

bytematchdev Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

ByteMatch progress report

SCES_532.85

Code matched 9.03% (+0.47%) · 525.15 KB of 5.81 MB
Fuzzy match 9.52% (+0.47%)
Functions 6,215 (+183) / 18,113
Units complete 3,300 (+30) / 3,359
✅ Newly matched (183)
  • func_L00_00776DE8 (1,076 bytes)
  • func_004C3010 (680 bytes)
  • func_004F4BE0 (556 bytes)
  • func_0012C680 (520 bytes)
  • func_004B0398 (520 bytes)
  • func_L00_0059A318 (516 bytes)
  • func_004A3180 (496 bytes)
  • func_L00_00725A48 (456 bytes)
  • func_L00_007292F8 (456 bytes)
  • func_L01_003C9D50 (428 bytes)
  • func_L01_004133F0 (340 bytes)
  • func_L15_004D8970 (340 bytes)
  • func_L00_00761C88 (328 bytes)
  • func_00505E00 (244 bytes)
  • func_00506978 (244 bytes)
  • func_L00_0069F6B8 (244 bytes)
  • func_L00_0069FB20 (244 bytes)
  • func_L00_0069FC18 (244 bytes)
  • func_L00_0069FD10 (244 bytes)
  • func_L00_0069FE88 (244 bytes)
  • func_L00_006A0070 (244 bytes)
  • func_L00_006A0428 (244 bytes)
  • func_L00_006A0520 (244 bytes)
  • func_L00_006A0618 (244 bytes)
  • func_L00_006A0710 (244 bytes)
  • func_L00_006A10A0 (244 bytes)
  • func_L00_006A1230 (244 bytes)
  • func_0050AAC8 (232 bytes)
  • func_0050B488 (232 bytes)
  • func_0050BB78 (232 bytes)
  • …and 153 more

SCUS_974.65

Code matched 7.17% · 414.34 KB of 5.78 MB
Fuzzy match 7.73%
Functions 5,435 / 18,085
Units complete 2,839 / 2,899

No function changes.

Commit a6c59dd · Ratchet: Deadlocked on ByteMatch

@Shaar-games Shaar-games changed the title Match PAL func_L00_0065A198 Match 2 PAL functions Nov 4, 2026
@Shaar-games Shaar-games changed the title Match 2 PAL functions Match 3 PAL functions Nov 4, 2026
@Shaar-games Shaar-games changed the title Match 3 PAL functions Match 4 PAL functions Nov 4, 2026
@Shaar-games Shaar-games changed the title Match 4 PAL functions Match 12 PAL functions Nov 4, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 361872b7d6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/match_map.py
Comment on lines +581 to +584
row = native_row(name, path, built, table)
if row[2] not in ("match", "other"):
raise ValueError("native bytes or object definition differ: %s" % name)
replacements[name] = serialize_row(row)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve frontbin placements when updating native US rows

For an existing native US menu source such as src/game/00406838.c, this replaces its two-placement baseline row with the single canonical placement returned by native_row(). The existing frontbin:.text:004065B8:16 match disappears even when the compiled bytes are unchanged. Unlike the full writer, which explicitly records the second link, this path consequently removes that function's verified extent from inventory.proven_extents('frontbin'). Revalidate secondary placements, or reject rows requiring the full workflow, rather than silently discarding them.

Useful? React with 👍 / 👎.

@Shaar-games Shaar-games changed the title Match 12 PAL functions Match 14 PAL functions Nov 4, 2026
@Shaar-games Shaar-games changed the title Match 14 PAL functions Match 49 PAL functions Nov 5, 2026
@Shaar-games Shaar-games changed the title Match 49 PAL functions Match 60 PAL functions Nov 5, 2026
@Shaar-games Shaar-games changed the title Match 60 PAL functions Match 80 PAL functions Nov 5, 2026
@Shaar-games Shaar-games changed the title Match 80 PAL functions Match 133 PAL functions Nov 5, 2026
@Shaar-games Shaar-games changed the title Match 133 PAL functions Match 134 PAL functions Nov 5, 2026
@Shaar-games Shaar-games changed the title Match 134 PAL functions Match 165 PAL functions Nov 5, 2026
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