Commit Graph

2303 Commits

Author SHA1 Message Date
Drew T cbf5bae043 feat(main): unblock main's switch functions — the rodata span carve + derived jtbl pads
main's gate could only ever say "got X want Y". S71 read 7 such verdicts as body
rejects and recorded 11 functions as "PROVEN gate-rejects, §376 in its purest form".
They are not: all 11 are switch functions, and the blocker is that main has had
exactly ONE rodata carve since Phase 7 (LZSS's jtbl_80072A38). Every other main jump
table stayed raw in the tail data, so a drafted switch DOUBLE-EMITTED its table, the
image grew (+28/+52/+76/+84 measured), and all 238 symbols above 0x80072A4C shifted.

* tools/main_diff_locate.py (NEW) — turns a red image into a named list of divergent
  symbols via the linker map; per-byte attribution, self-test flips a byte at a known
  address and asserts the containing symbol (plus the identical-pair direction).
* gate_main.py — PRESERVES the red image + map before the R40 baseline control
  rebuilds over it, and auto-localizes: BODY REJECT vs PLUMBING REJECT vs MIXED. Also
  -j on the build (was single-threaded) and the §376 drop list written to
  .run/gate_main_dropped.json with the reconciliation chain.
* splat.us.exe.yaml — the .rodata carve extends from the LZSS table alone to the whole
  contiguous game-jtbl span 0x80072A38-0x80072C70 (12 tables, one 800.o run).
  Byte-neutral with no drafts substituted (probed first).
* jtbl_rodata_pads.py — --derive now works for main: one file-0-vram expression makes
  both address->bytes and yaml-piece->address correct for the EXE's 0x800 header and
  leaves flat overlays unchanged. Makefile arms it for BINARY=main.

Banked byte-identical: func_8001A114, func_8001AAD0, func_8001AF34 — three of the
eleven. 25 of main's 59 frontier functions (6,215 of 12,912 instructions) are in this
class; the remaining spans need src/800.c split at the TU boundaries the spans reveal.
2026-09-02 11:56:35 -06:00
Drew T 9c7b1e053b feat(decomp): parallel gate — 2 fns across 2 binaries (10 workers)
ov_SC01_084    func_80180E74
  ov_SC07_006    func_801890FC
2026-09-02 11:09:14 -06:00
Drew T 9a94d0593d feat(decomp): main +1 - func_8005FA94 via §265 verbatim asm (gate_main, BYTE-IDENTICAL)
A §332 delay-slot wall the pinned triple cannot emit from C; banked the verbatim-asm way,
verified by one clean rebuild at 143dbb89f34491258bbc27810d0a12ec8b43a8dd. Bank confirmed
from the source (stub gone), not from the tool's own count.
2026-09-02 10:16:01 -06:00
Drew T b5f4bff5b2 feat(decomp): parallel gate — 4 fns across 4 binaries (10 workers)
ov_SC04_000    func_80180020
  ov_SC05_010    func_8017F15C
  ov_SC07_002    func_80183458
  ov_SC06_029    func_8017F330
2026-09-02 10:14:15 -06:00
Drew T e167c9c3cc feat(decomp): main +5 via gate_main - four §265 verbatim-asm walls and one ordinary body
The main lane, run the ONLY way main can be gated (§414): substitute the whole slate ->
make extract -> make build -> compare SHA1, with a bisect when the batch fails.
Baseline asserted green first (143dbb89...), batch of 6 failed, bisect isolated
func_8002C410 in 7 rebuilds, and the remaining 5 banked BYTE-IDENTICAL.

Four of the five are §265 verbatim-asm bodies for functions on the §332/§188 toolchain
wall list - the accepted route for a function the pinned triple cannot emit from C, the
same way func_800D0B1C banked overnight. Candidates came from scoring every stored draft
for main's 53 non-rejected open functions with match_one: 6 of 53 at closeness 0.
2026-09-02 10:05:39 -06:00
Drew T 38faa55a56 feat(decomp): parallel gate — 2 fns across 2 binaries (10 workers)
ov_SC03_105    func_801803A0
  ov_SC06_033    func_80190E64
2026-09-02 10:00:36 -06:00
Drew T 1baa5ec405 feat(decomp): parallel gate — 2 fns across 2 binaries (10 workers)
ov_SC03_092    func_8017FA74
  ov_SC03_028    func_80181000
2026-09-02 09:35:36 -06:00
Drew T f778dd3f6a feat(decomp): parallel gate — 3 fns across 3 binaries (10 workers)
md_SC07_003    func_801A293C
  ov_SC01_001    func_8017FEE0
  ov_SC03_105    func_80187A30
2026-09-02 05:50:05 -06:00
Drew T 24d5017039 feat(decomp): parallel gate — 4 fns across 4 binaries (4 workers)
ov_SC03_107    func_8016AB6C
  ov_SC07_011    func_8016AB6C
  ov_SC07_010    func_8016AB6C
  ov_SC07_007    func_8016AB6C
2026-09-02 05:37:23 -06:00
Drew T c0e8731947 feat(decomp): parallel gate — 5 fns across 5 binaries (10 workers)
ov_SC03_010    func_8017F6C0
  ov_SC03_029    func_80186A34
  ov_SC03_013    func_801806F8
  ov_SC03_092    func_8017FE88
  ov_SC07_000    func_8017F8B8
2026-09-02 05:33:39 -06:00
Drew T ca813cb5ab feat(decomp): parallel gate — 2 fns across 2 binaries (10 workers)
ov_SC01_000    func_8017DD04
  ov_SC03_028    func_80180B44
2026-09-02 05:18:24 -06:00
Drew T e1f6c5cdd9 feat(decomp): parallel gate — 2 fns across 2 binaries (10 workers)
ov_SC04_016    func_8017DF8C
  ov_SC07_006    func_80183374
2026-09-02 05:01:22 -06:00
Drew T 7b256d1c35 feat(decomp): parallel gate — 3 fns across 3 binaries (10 workers)
ov_SC01_009    func_8017FFD0
  ov_SC03_013    func_8017E6F4
  ov_SC07_007    func_80182184
2026-09-02 04:45:11 -06:00
Drew T 6d21bed9db feat(decomp): parallel gate — 4 fns across 4 binaries (10 workers)
ov_SC01_084    func_80181310
  ov_SC01_080    func_80180D54
  ov_SC03_030    func_80181A60
  ov_SC06_000    func_80183398
2026-09-02 04:31:28 -06:00
Drew T 0fb99b763b feat(decomp): parallel gate — 2 fns across 2 binaries (10 workers)
ov_SC02_011    func_80182714
  ov_SC04_011    func_80180B24
2026-09-02 02:10:07 -06:00
Drew T 6fbdfdb361 revert(main): commit:3586's 11 banks — main did not build from clean, and was not byte-identical
The R22 clean-fleet verify came back 212/213. The failure is main, and `git log -L` puts
all four conflicting declaration lines in commit:3586 — this session's own main re-gate:

  src/800.c:24519  extern int  func_8004355C(s32, void *);   vs :24396 (s32, u8 *)
  src/800.c:26395  extern void func_80038FFC();              vs the s32 definition below

Reconciling both declarations (byte-neutral, §376) made main COMPILE, and it was then
still not byte-identical — so the commit was wrong on both counts, not merely unbuildable.
The gate reported "11 banked" against a tree that cannot compile from clean.

src/800.c restored to commit:3586^; `make extract BINARY=main && make build BINARY=main`
now gives sha1 143dbb89f34491258bbc27810d0a12ec8b43a8dd BYTE-IDENTICAL. The 11 bodies are
kept at .run/S71_main_suspect/800.c.banked11 for a per-function re-gate — this revert is
about restoring a green fleet, not a verdict on every one of them.
2026-09-02 01:41:34 -06:00
Drew T 27cc083de9 feat(decomp): parallel gate — 5 fns across 5 binaries (12 workers)
md_MAIN_028    func_800CB8A0
  md_MAIN_003    func_800D24D0
  ov_SC01_006    func_8017F9F8
  ov_SC07_000    func_8017F69C
  ov_SC07_002    func_8017FCA8
2026-09-02 01:31:10 -06:00
Drew T 7bcb3e51ec feat(carve): §323 blocker 2 cleared — jr-isolate ov_SC03_029 for func_80186A34, byte-identical
The type-name scan matched `}\s*(\w+)\s*;`, which reads `__attribute__` as the name
and fails on the following `((` — so a packed file-local typedef never entered the
carried set, every decl naming it read as an unknown type, and the isolate refused the
whole overlay. Stripping attributes before the scan is the entire fix.
2026-09-02 01:25:06 -06:00
Drew T 93bfa45561 feat(carve): §323 blocker 2 cleared — jr-isolate ov_SC07_000 for func_8017F8B8, byte-identical
The type-name scan matched `}\s*(\w+)\s*;`, which reads `__attribute__` as the name
and fails on the following `((` — so a packed file-local typedef never entered the
carried set, every decl naming it read as an unknown type, and the isolate refused the
whole overlay. Stripping attributes before the scan is the entire fix.
2026-09-02 01:24:53 -06:00
Drew T ad0d883810 feat(carve): jr-isolate ov_SC03_092 for func_8017FE88 — byte-identical, carve refusal cleared 2026-09-02 01:21:49 -06:00
Drew T f0512ff9ee feat(carve): jr-isolate ov_SC03_013 for func_801806F8 — byte-identical, carve refusal cleared 2026-09-02 01:21:36 -06:00
Drew T 49c41094a6 feat(carve): jr_isolate_all places file-local statics — ov_SC03_010's carve refusal cleared
The CARVE-REFUSED class (10 of the frontier's gate failures) has one dominant cause:
"subseg <ov>_jr_<addr> would host NON-CONTIGUOUS .rodata carves", whose named remedy
is jr_isolate_all. The isolate itself then refused 4 of the 6 affected overlays over a
file-local `static inline` helper (bandsetup, setup_80188D90) that has no address BY
CONSTRUCTION — §82.1 helpers exist to shape their caller's code and emit no symbol.

* jr_isolate_all now places such a definition with the ONE region that uses it, and
  refuses loudly if two regions do (two copies of a used static is a byte change, R43).
* overlay_src_split._proto_from_lines no longer prefixes `extern` to a declaration that
  already has a storage class — `extern static inline void f(...)` is "multiple storage
  classes" to cc1. The two changes are inseparable: placing statics is what first made
  the tool emit a prototype for one.

Byte-gated on ov_SC03_010: extract + build rc=0,
sha1 cacaf7c2c08037e6934f9d02c0ae5d7c78cf2463 BYTE-IDENTICAL. jtbl_carve --probe then
moves from `plan-refused` to `tail — standard §8a carve at gate time`.
2026-09-02 01:20:44 -06:00
Drew T 2064b5beee feat(decomp): parallel gate — 6 fns across 5 binaries (12 workers)
ov_SC04_015    func_8017EB78
  ov_SC05_008    func_8017E464
  ov_SC06_032    func_80185F4C
  ov_SC06_029    func_8017EF34 func_80185D44
  ov_SC07_010    func_80180E68
2026-09-02 01:17:20 -06:00
Drew T c97ccee98d feat(decomp): parallel gate — 9 fns across 7 binaries (12 workers)
ov_SC02_005    func_80180610
  md_MAIN_003    func_800D0B1C
  ov_SC01_005    func_8017F9F8
  ov_SC03_105    func_801829CC func_80182BD8 func_80182DCC
  ov_SC04_011    func_8018FE20
  ov_SC05_010    func_80183098
  ov_SC06_010    func_8017FAAC
2026-09-02 01:04:04 -06:00
Drew T e76f82e31f feat(decomp): parallel gate — 2 fns across 2 binaries (11 workers)
ov_SC03_007    func_8018611C
  ov_SC01_009    func_80182438
2026-09-02 00:55:11 -06:00
Drew T 588208d50f feat(decomp): parallel gate — 11 fns across 1 binaries (1 workers)
main           func_8001A114 func_8001AAD0 func_8001AF34 func_8002EED8 func_8002F248 func_800316F8 func_80031988 func_8003602C func_80036260 func_80038FFC func_80039C70
2026-09-02 00:27:07 -06:00
Drew T 23ffa6082f feat(decomp): parallel gate — 12 fns across 2 binaries (12 workers)
main           func_8001A114 func_8001AAD0 func_8001AF34 func_8002EED8 func_8002F248 func_800316F8 func_80031988 func_8003602C func_80036260 func_80038FFC func_80039C70
  ov_SC07_006    func_8016AB6C
2026-09-02 00:23:34 -06:00
Drew T 2e87d246fb feat(decomp): parallel gate — 2 fns across 2 binaries (10 workers)
md_SC07_004    func_801A3798
  ov_SC07_007    func_8017DFB8
2026-09-01 23:34:53 -06:00
Drew T 9df00e71f8 feat(decomp): parallel gate — 11 fns across 9 binaries (10 workers)
md_SC07_003    func_801A2EC8
  ov_SC02_003    func_80185840
  ov_SC01_077    func_8017DAEC
  ov_SC01_080    func_8017E724 func_8018230C
  ov_SC03_029    func_80180B84
  ov_SC03_030    func_80180054
  ov_SC03_105    func_80183DA0
  ov_SC06_030    func_8017DF70
  ov_SC07_002    func_8017D920 func_8017E7E8
2026-09-01 23:23:02 -06:00
Drew T 027f4f2d2b feat(decomp): parallel gate — 31 fns across 23 binaries (10 workers)
md_MAIN_044    func_800CD2EC
  ov_SC02_026    func_8017D508
  md_SC07_003    func_801A079C
  ov_SC01_084    func_80180000
  ov_SC02_005    func_8017F898
  ov_SC01_080    func_80181410 func_80181D98
  ov_SC03_007    func_801850B4
  ov_SC03_117    func_8017FED8
  ov_SC03_105    func_8017E180 func_8018423C
  ov_SC04_012    func_8017D4CC
  ov_SC05_005    func_8017EAEC
  ov_SC05_008    func_8017E6A4 func_8017F288
  ov_SC04_011    func_80186020
  ov_SC05_011    func_8017D610
  ov_SC05_018    func_801810B0
  ov_SC06_006    func_8017EEA4
  ov_SC06_008    func_8017E37C
  ov_SC07_001    func_8018088C
  ov_SC07_000    func_8017E658 func_8018006C func_801805C0
  ov_SC07_006    func_801826E0
  ov_SC06_032    func_8017DABC func_80183940 func_8018FB5C
  ov_SC07_007    func_801827E0
  ov_SC07_010    func_8017E5B8 func_8017F860
2026-09-01 23:11:26 -06:00
Drew T 69d6c76a3b feat(decomp): parallel gate — 23 fns across 21 binaries (10 workers)
md_MAIN_034    func_800CAE88
  md_SC07_004    func_801A2F34
  ov_SC02_016    func_80181AE8
  ov_SC02_011    func_80187E08
  ov_SC02_017    func_80182FD0
  ov_SC01_000    func_8017E210
  ov_SC02_003    func_80183FC8 func_80186AE4
  md_SC07_003    func_801A4268
  ov_SC02_028    func_80180C04
  ov_SC02_035    func_8017D3F4
  ov_SC03_112    func_8017E160 func_8017EE48
  ov_SC03_092    func_8017F8D8
  ov_SC03_001    func_801859AC
  ov_SC03_010    func_8017EB58
  ov_SC04_011    func_80190264
  ov_SC04_020    func_8017EE50
  ov_SC05_010    func_8017EFC8
  ov_SC06_011    func_8017FAB4
  ov_SC06_024    func_80180594
  ov_SC06_029    func_8017DDE0
  ov_SC06_033    func_8017E224
2026-09-01 23:01:37 -06:00
Drew T 2ad58ddc38 feat(decomp): parallel gate — 31 fns across 24 binaries (10 workers)
ov_SC01_000    func_8017E1A8
  md_MAIN_003    func_800CFEB4 func_800D0664 func_800D30D0
  ov_SC01_080    func_80181854
  ov_SC02_016    func_8017F4DC
  ov_SC02_000    func_80185840
  ov_SC02_027    func_8017F2B8
  ov_SC02_011    func_801852B0
  md_SC07_004    func_801AB818
  ov_SC01_001    func_80183748
  ov_SC03_118    func_801831D0
  ov_SC03_028    func_80182B3C
  ov_SC03_117    func_80180064
  ov_SC03_105    func_801870E8
  ov_SC03_124    func_8017EDE8 func_8017F63C func_801816C8
  ov_SC04_011    func_80180970 func_801835B0 func_8018489C
  ov_SC05_008    func_8017D214
  ov_SC04_019    func_8017F35C
  ov_SC06_018    func_8018AD74
  ov_SC05_010    func_801854B8 func_80185570
  ov_SC07_000    func_8018000C
  ov_SC05_017    func_801843E0
  ov_SC06_022    func_8017CDE4
  ov_SC05_018    func_801808AC
  ov_SC06_029    func_80185214
2026-09-01 22:46:44 -06:00
Drew T 481a282be5 feat(decomp): parallel gate — 2 fns across 2 binaries (8 workers)
ov_SC02_003    func_8017F950
  ov_SC06_011    func_8017EEEC
2026-09-01 21:59:32 -06:00
Drew T f1cdd21134 fix(jtbl_carve): consult island_probe before the LEADING-ISLAND refusal — +1 bank, unblocks the carve route
`migrated_tables()` can flag a function whose table is actually in the DATA TAIL,
and the §154-A island branch then refused the whole batch with "a tail carve cannot
help ... the carve model covers jump tables only, not an island of mixed included
data". That reads as a permanent toolchain wall. It is a ROUTING error: island_probe
classifies the same function 'tail', and its own detail says "standard §8a carve at
gate time" -- i.e. it names the ordinary lane as the owner (R43: each probe kind
names the lane that owns it). The refusal was about the branch we entered, not the
function.

Consult the probe first and let a 'tail' function fall through to build_carve.

Byte-proven immediately: ov_SC02_000/func_8017F950 -- three full parallel_gate
passes had booked it CARVE-REFUSED -- now reports `[jtbl] carved func_8017F950`,
`verified 1 / failed 0`, BYTE-IDENTICAL, and corpus.stubs confirms it banked. No
config change was needed: its carve was already committed and merely PENDING an
owner (the class identified while fixing jr_inventory), so banking the function
completed the 1:1 ownership the assertion wanted.

This was blocker 3 of 3 on the §322b route; 1 and 2 were cleared earlier in S70.
2026-09-01 21:54:17 -06:00
Drew T cafaa7ac30 feat(decomp): §332b reorder island — +3 main fns (func_8005D244, func_8005DBD8, func_80061FA8) 2026-09-01 20:36:02 -06:00
Drew T f5e81b72d7 feat(decomp): parallel gate — 20 fns across 1 binaries (8 workers)
ov_SC06_011    func_8017F09C func_8017F0D8 func_8017F240 func_8017F278 func_8017F2A0 func_8017F2DC func_8017F324 func_8017F364 func_8017F38C func_8017F4D0 func_8017F6CC func_8017F760 func_8017F8AC func_8017FA00 func_8017FCC0 func_8017FF58 func_8017FF7C func_8017FFF0 func_8018015C func_80180298
2026-09-01 17:40:37 -06:00
Drew T 55c263d591 feat(decomp): S70 main — +1 fn (func_8002B0B4) from the standalone-match sweep 2026-09-01 17:11:59 -06:00
Drew T 45cc5cbdf8 feat(decomp): parallel gate — 3 fns across 3 binaries (8 workers)
md_MAIN_025    func_800CB300
  ov_SC03_028    func_80181EBC
  ov_SC07_010    func_80180138
2026-09-01 16:47:10 -06:00
Drew T 4e35b8406c feat(decomp): S70-standalone gate — +3 fns x0 propagated (fleet 99.4%) 2026-09-01 16:30:37 -06:00
Drew T ac5aede5ac feat(decomp): S70-standalone gate — +15 fns x0 propagated (fleet 99.4%) 2026-09-01 16:23:11 -06:00
Drew T 7272fec47d feat(decomp): parallel gate — 2 fns across 2 binaries (2 workers)
ov_SC07_001    func_8017E4DC
  ov_SC02_017    func_8018347C
2026-09-01 15:41:25 -06:00
Drew T 4fd757dc44 fix(carve): commit 8 carve-created TU files that parallel_gate could not add
`parallel_gate` commits with `git add -u src/`, which updates TRACKED files and
cannot add NEW ones. A jtbl carve SPLITS a TU, creating `src/<bin>/<bin>_jr_<addr>.c`
— so every carve landed its yaml change (tracked) while leaving the new source
file UNTRACKED.

Why this mattered: `config/splat.<bin>.yaml` is committed and names the subseg
(`- [0x577f8, c, ov_SC02_000_jr_8017F950]`), and 31 sibling `_jr_` files in that
same binary are tracked — so these are source by convention, not build artifacts.
R22 passed locally only because they exist on disk. A fresh clone, or Drew's
push, would have the yaml without the file.

Found because parallel_gate REFUSED to run with an unclean tree (rc=1) and listed
them — the guard did its job; the earlier `REFUSED 8 (main tree moved under them)`
line in the carve gate was the same eight files.

TODO for the tool: parallel_gate's commit step must add NEW files under
src/<binary>/ that its own carve produced (narrowly, per-binary — never a blanket
`git add src/`, per the carve-state discipline).
2026-09-01 15:19:53 -06:00
Drew T d33596713f feat(decomp): parallel gate — 1 fns across 1 binaries (1 workers)
ov_SC03_028    func_80183264
2026-09-01 15:00:52 -06:00
Drew T 432b4445a4 feat(decomp): parallel gate — 1 fns across 1 binaries (1 workers)
ov_SC07_001    func_8017EDC0
2026-09-01 14:56:34 -06:00
Drew T 3111affb2e feat(decomp): parallel gate — 3 fns across 3 binaries (12 workers)
md_MAIN_013    func_800CB56C
  ov_SC04_003    func_80180FB8
  ov_SC04_005    func_80187548
2026-09-01 14:54:46 -06:00
Drew T 68eac2722c feat(decomp): parallel gate — 1 fns across 1 binaries (1 workers)
ov_SC03_028    func_80184C90
2026-09-01 14:45:07 -06:00
Drew T 2de045a8ad feat(decomp): parallel gate — 1 fns across 1 binaries (1 workers)
ov_SC03_111    func_80180A10
2026-09-01 14:42:18 -06:00
Drew T 0b67876247 feat(decomp): parallel gate — 5 fns across 5 binaries (5 workers)
ov_SC06_020    func_80183FD0
  ov_SC06_024    func_8018A3CC
  ov_SC06_033    func_801888E8
  ov_SC06_018    func_8017D4DC
  ov_SC06_032    func_80184C04
2026-09-01 14:38:29 -06:00
Drew T 85b90967e4 chore(integration): sync stale decls for the ov_SC06 reach-6 cluster (extract+build verified) 2026-09-01 14:36:43 -06:00
Drew T 975fab9e70 feat(decomp): parallel gate — 1 fns across 1 binaries (1 workers)
ov_SC02_005    func_8018074C
2026-09-01 14:29:03 -06:00