Commit Graph

2201 Commits

Author SHA1 Message Date
Drew T 61335ad18e feat(decomp): -O0 whale bank — ov_MAIN_012 func_80144B9C (770) + func_801457A4 (79), BINARY COMPLETE
Replaced the carve's generated _o0d.c wholesale with the minimal fleet-standard
whale TU. Keeping the generated §8b carried decl layer was NOT an option: it
conflicts with shared/func_80144B9C.h on 7 symbols (func_80015978 void*/s32,
func_800CF854 void/s32, func_801336E8, D_801274C8/CC/D0). Legitimate to drop it
here because the region holds ONLY these two functions (0xD44 = 0xC08 + 0x13C
exactly), so nothing in the TU needs the carried decls.

func_801457A4 remapped from ov_SC01_077_o0b.c: its 79 instructions differ across
overlays by exactly ONE data symbol (D_80186AD0 -> D_8017E338).

Byte-identical: d6b3e8b971cdd6c53aea8c4f265afb82b363283c == config/check.ov_MAIN_012.sha.
corpus.stubs(ov_MAIN_012) = 0 -- the binary has no open stubs left.

NOT via rollout_o0: its stub_file_of() skips any basename containing _o0, and the
carve moved BOTH stubs into _o0d.c, so the driver is structurally blind to them
and would have reported 'no-stub / already banked?' and banked nothing.
2026-08-31 16:21:13 -06:00
Drew T ff524cd07e feat(config): -O0 whale carve step 1 — split 0x80144B9C..0x801458E0 out of ov_MAIN_012_jr_8013F350
o0_subsplit: 2 unmatched stubs (func_80144B9C 770 ins + func_801457A4 79 ins), 0
already-matched islands interleaved, so K=0 and one -O0 region is correct. carve
repoints (none); config/overlays.mk UNCHANGED (the whale object owns no .rodata
carve anywhere in the fleet: 0 of 213 splat yamls carve .rodata to an _o0b).

BYTE-NEUTRAL, which is the whole claim of a carve:
  build d6b3e8b971cdd6c53aea8c4f265afb82b363283c == config/check.ov_MAIN_012.sha
interleave_check ALIGNED. Derived AND carved under .run/auto/gate.ov_MAIN_012.lock
(the commit:2791 rule: a plan derived outside the lock can describe a tree state that
never existed).
2026-08-31 16:20:38 -06:00
Drew T dd608ce5fd feat(decomp): parallel gate — 5 fns across 5 binaries (6 workers)
md_SC04_027    func_801EB014
  ov_SC07_007    func_8013DD68
  md_MAIN_003    func_800D1E9C
  ov_SC03_105    func_801824CC
  ov_SC06_029    func_80181DF8
2026-08-31 16:19:19 -06:00
Drew T ed53a68f18 feat(p31 s68): deferred propagation done honestly (2 banked) + seed_ref was offering DEAD TEXT
The S67 FINAL-3 OPEN item, plus the two defects found while doing it.

* fix(dedup_propagate): the tool could not run AT ALL. S67's -j patch wrote
  `os.environ` at module level in the one module that imports `os as _os`, so
  every invocation died with NameError before doing any work. Propagation was
  not deferred, it was impossible. Import-checked the other 7 -j-patched tools.

* propagation, honestly scoped: the real closable set is 11, not 32, derived two
  independent ways that agree (seed_ref exact+same_addr, and a direct corpus
  derivation). The 3,161-entry --auto-from plan over 53 overlays is dedup
  hygiene over already-matched code and closes almost no open stub.
  Applied: 2 banked byte-green (ov_SC04_018 func_80181270, func_80182AF8);
  3 gate-refused and cleanly reverted; 6 blocked with named blockers
  (3 CARRY-FIXABLE, 3 func_80144B9C not-inline-def -> needs the o0 whale carve).
  R22 clean fleet: extract 212/212, check 213 passed 0 failed of 213, rc 0/0/0.
  Frontier 453 -> 451.

* fix(seed_ref): REFUSE targets in LINKED subsegs. The playbook calls this tool
  "the fleet-wide answer" and it reported 82 open stubs with a banked twin --
  43 of them main stubs whose TUs the linker script never references. Any C
  written there compiles, links and leaves the SHA1 green WHETHER OR NOT IT IS
  CORRECT, so a mechanical twin lane fed from that list could have minted up to
  43 gate-green FALSE matches the byte gate cannot see. draw_waves has refused
  these since S66; this oracle did not. The refusal is counted and printed, not
  silent. NC: guarded 39 subset of raw 82, all 43 dropped are main, the non-main
  population is identical.

* wave drawn: .run/S68o1 (24 opus 187-770 ins) + .run/S68m1 (30 main), cards +
  packs + wave_args asserted, queue of 53. Drafting opened at concurrency 5.
2026-08-31 15:59:01 -06:00
Drew T 51abe2d174 feat(decomp): parallel gate — 19 fns across 14 binaries (8 workers)
ov_SC03_110    func_8018035C
  ov_SC04_000    func_8017F98C
  ov_SC04_015    func_8017E520
  ov_SC03_121    func_8017D8D4 func_80180E64
  ov_SC04_011    func_801827DC
  ov_SC03_007    func_801810E4 func_80184AFC
  ov_SC03_105    func_8017F55C func_801831E0
  ov_SC02_003    func_8017F62C
  ov_SC06_024    func_8017E1F0
  ov_SC05_001    func_80183C9C
  ov_SC06_030    func_8017F268 func_80181164
  ov_SC05_010    func_8018340C func_8018388C
  ov_SC04_016    func_8017D118
  ov_SC06_022    func_8017EBE8
2026-08-31 15:19:41 -06:00
Drew T a732097c37 Revert "feat(decomp): parallel gate — 19 fns across 14 binaries (8 workers)"
This reverts commit commit:3394.
2026-08-31 15:09:32 -06:00
Drew T c26ddf136d feat(decomp): parallel gate — 19 fns across 14 binaries (8 workers)
ov_SC04_000    func_8017F98C
  ov_SC04_015    func_8017E520
  ov_SC03_121    func_8017D8D4 func_80180E64
  ov_SC03_110    func_8018035C
  ov_SC04_011    func_801827DC
  ov_SC03_007    func_801810E4 func_80184AFC
  ov_SC03_105    func_8017F55C func_801831E0
  ov_SC02_003    func_8017F62C
  ov_SC05_001    func_80183C9C
  ov_SC06_024    func_8017E1F0
  ov_SC06_030    func_8017F268 func_80181164
  ov_SC05_010    func_8018340C func_8018388C
  ov_SC04_016    func_8017D118
  ov_SC06_022    func_8017EBE8
2026-08-31 14:53:41 -06:00
Drew T dfc5d5b3c5 feat(decomp): parallel gate — 13 fns across 13 binaries (12 workers)
md_SC07_004    func_801A3180
  ov_SC01_080    func_801809E4
  ov_SC03_006    func_801823B8
  ov_SC01_001    func_801810A4
  ov_SC02_005    func_80190538
  ov_SC02_031    func_80183458
  ov_SC01_084    func_80181A7C
  ov_SC03_092    func_8017E780
  ov_SC04_008    func_8017D3F8
  ov_SC03_102    func_80180C38
  ov_SC03_107    func_8017CF48
  ov_SC07_006    func_8013DD68
  ov_SC07_002    func_80181394
2026-08-31 14:45:51 -06:00
Drew T 389d7d6197 feat(decomp): wave gate — +1 fns x0 propagated (fleet 99.2%) 2026-08-31 14:41:41 -06:00
Drew T d989ed08ae feat(decomp): parallel gate — 14 fns across 11 binaries (6 workers)
md_SC07_003    func_801A38E4
  md_MAIN_027    func_800CB4A4
  ov_SC02_037    func_8013DD68
  ov_SC02_003    func_8018046C
  ov_SC01_084    func_8017EA98 func_80181F80 func_80184138
  ov_SC03_107    func_8013DD68
  ov_SC05_003    func_8017E380
  ov_SC05_008    func_8017DF68 func_8017EBB8
  ov_SC05_010    func_8017FAF4
  ov_SC06_032    func_80190D70
  ov_SC06_025    func_8017EA74
2026-08-31 13:43:44 -06:00
Drew T 21a2212ae3 feat(decomp): S67 main r2 — 1 banked (main 89 -> 88) + §332/§332a toolchain-wall findings
Wave s67m2_1: 7 sonnet agents, 1 MATCH banked, 6 NEAR — but 4 of the 7 are NOT drafting failures:
* func_8005FA94 / func_8005D244 — oracle_reorder.py bypass gives 0/55 and 0/62 diffs: the C is
  byte-correct, the pinned as -O1 cannot emit the §188 epilogue. func_8005D244 is additionally
  libpad pdent3.o, an SDK object owned by psyq_integrate.py — it should never have been drawn.
* func_80062144 / func_8005DBD8 — §332, traced to the compiler sources: gcc-2.7.2 emits a symbolic
  la as ONE atomic length-2 insn (no HIGH/LO_SUM split in this backend), eligible_for_delay requires
  length==1, so it can never fill a jump delay slot; the retail split is ASPSX macro-hopping that
  maspsx does not replicate. Byte-verified by running maspsx over cc1's raw -dS output.
  6 such functions fleet-wide, NONE banked.

§332a records the draw-policy consequence: main's cheap population is spent and the residual is
ENRICHED in toolchain walls, so main's apparent match rate is contamination, not a model signal.
Wall ledger at .run/S67_walls.txt for the --exclude mechanism.
2026-08-31 13:21:01 -06:00
Drew T b94af95740 feat(decomp): parallel gate — 1 fns across 1 binaries (2 workers)
ov_SC03_118    func_80184F18
2026-08-31 12:40:21 -06:00
Drew T 96f4e0ed5d feat(decomp): S67-wave-jtbl gate — +1 fns x2 propagated (fleet 99.2%) 2026-08-31 12:23:50 -06:00
Drew T 026bca9be8 feat(decomp): parallel gate — 4 fns across 4 binaries (4 workers)
ov_SC04_016    func_8017DA50
  ov_SC07_006    func_8018984C
  ov_SC03_119    func_80184F18
  ov_SC03_031    func_8017F428
2026-08-31 12:15:45 -06:00
Drew T 253f5c9d44 feat(decomp): S67-wave gate — +1 fns x0 propagated (fleet 99.2%) 2026-08-31 11:32:42 -06:00
Drew T 7e9bfa37f7 feat(decomp): S67-wave gate — +1 fns x0 propagated (fleet 99.2%) 2026-08-31 11:28:51 -06:00
Drew T 4ced908c08 feat(decomp): S67-wave gate — +1 fns x7 propagated (fleet 99.2%) 2026-08-31 11:25:39 -06:00
Drew T e23492e3bc feat(decomp): S67-wave gate — +1 fns x6 propagated (fleet 99.2%) 2026-08-31 11:22:50 -06:00
Drew T 098cb932ef feat(decomp): S67-wave gate — +2 fns x0 propagated (fleet 99.2%) 2026-08-31 11:20:02 -06:00
Drew T 274057d132 feat(decomp): S67-wave gate — +2 fns x8 propagated (fleet 99.2%) 2026-08-31 10:34:40 -06:00
Drew T 257b9d8a3b feat(decomp): S67-wave gate — +2 fns x1 propagated (fleet 99.2%) 2026-08-31 10:31:15 -06:00
Drew T 1a4d725a15 feat(decomp): S67-wave gate — +1 fns x0 propagated (fleet 99.2%) 2026-08-31 10:25:27 -06:00
Drew T 9dfc91ba6d feat(decomp): S67-wave gate — +1 fns x1 propagated (fleet 99.2%) 2026-08-31 10:22:41 -06:00
Drew T 89ede18c22 feat(decomp): S67-wave gate — +1 fns x0 propagated (fleet 99.2%) 2026-08-31 10:21:36 -06:00
Drew T 9673373d97 feat(decomp): S67 main wave — 5 of 7 banked (main 94 -> 89), byte-identical 143dbb89
Wave s67m1: 7 sonnet agents, 0 errors. 5 MATCH banked after bisection in 9 rebuilds;
the 2 NEAR drafts rejected exactly as their agents predicted (func_80013154 close=12,
func_8005ECC0 close=6).

One draft's declaration refused the whole batch first: func_8002A088 declared
`extern s32 func_8002A108(void);` while src/800.c DEFINES it as (s32) at line 15270.
Fixed with the no-proto half of cookbook §324 (`extern s32 func_8002A108();`) — a
no-prototype decl is compatible with a promotion-safe definition and leaves the 0-arg
call unchecked, byte-neutral for the emitted jal. Argues for wiring §324 into the ladder
rather than hand-applying it; it cost a full main gate cycle.

NOTE for the ledger: func_8005E8E8 and func_8005EC00 are verbatim file-scope __asm__
transcriptions, not decompiled C — both hit the §188 wall (2 callee-saved regs with
jr $ra + addiu $sp in the delay slot, unreachable from cc1 under the pinned as -O1),
and both follow established in-TU precedent (func_8005E79C, func_8005EB28).

WALL LEDGER candidates: func_8005ECC0's epilogue tail is proven unreachable via
oracle_reorder.py; only idx24-26 (a beq delay-slot steal) remains open there, and it has
now resisted 8 prior wave attempts plus 3 today.
2026-08-31 10:20:25 -06:00
Drew T bac7537564 fix(p31 s67): repair ov_SC04_018 — dedup_propagate deleted a decl layer the surviving bodies needed
R22 caught it: 212/213 after the S67-cc1 gate run. `ov_SC04_018` was RED.

ROOT CAUSE (from the diff, not inferred). Commit commit:3354's propagation replaced three bodies in
`ov_SC04_018_jr_80135D20.c` with DEFINE_func_*() instantiations and deleted the 981 lines they
occupied — INCLUDING the TU's file-scope declaration layer, which the two surviving non-deduped
bodies still referenced. A duplicate copy of those decls survived at line 225, BELOW the function
that uses them at line 42, so C89 ordering made it fatal (`D_8018D7A4' undeclared).

THE STRUCTURAL GAP: gate_stage byte-gates the SOURCE binary, then propagation writes to N OTHER
binaries and nothing re-verifies them. "fleet 99.2%" in the commit subject is a metric, not a gate.
This is the blind spot R50 exists for, and only the periodic whole-fleet R22 could see it.

REPAIR: restored src/ov_SC04_018 to commit:3354^, re-extracted (banking had pruned the .s stubs the
restored INCLUDE_ASM lines need), rebuilt rc=0 at the locked SHA fe9b413f. dedup-check clean
(2193 validated, 0 failed, C1 255302/255302). Cost: the 2 banks in that binary.

NEW tools/restore_dropped_decls.py — compiler-driven recovery for this failure mode: build, read
which identifiers cc1 calls undeclared, look each one up in the pre-deletion git ref, insert it
above the leading #include block, repeat. Two defects found and fixed in it while using it:
  * anchoring after "the last extern in the first 400 lines" inserts BELOW the point of use, so the
    build fails identically and the loop re-inserts forever (measured: 25 rounds, 100 dead decls).
    The only safe anchor is the top of the file.
  * a no-progress guard now REFUSES when a round asks for what the last round already inserted.
It also correctly refused when the failure changed class (link-level undefined references), which
is how the wider damage was found rather than papered over.

NOT a defect of the S67 §8d rung: scope_demote_drafts only ever writes draft dirs under .run/.

FLEET: make clean + extract-all + check-all = 213 passed, 0 failed of 213.
FRONTIER: 530 -> 526 (4 functions closed this session, measured from corpus.stubs).
2026-08-31 09:44:50 -06:00
Drew T 1c21f0a1e2 feat(decomp): S67-cc1 gate — +1 fns x3 propagated (fleet 99.2%) 2026-08-31 04:10:27 -06:00
Drew T 29cb504546 feat(decomp): S67-cc1 gate — +1 fns x4 propagated (fleet 99.2%) 2026-08-31 03:53:22 -06:00
Drew T 4daf41702a feat(decomp): S67-cc1 gate — +1 fns x19 propagated (fleet 99.2%) 2026-08-31 03:40:23 -06:00
Drew T 91197e1b51 feat(decomp): S67-cc1 gate — +1 fns x2 propagated (fleet 99.2%) 2026-08-31 02:02:48 -06:00
Drew T dc989bc283 feat(decomp): parallel gate — 1 fns across 1 binaries (1 workers)
ov_SC02_000    func_80188C0C
2026-08-30 23:04:51 -06:00
Drew T ba49d7e829 feat(decomp): parallel gate — 15 fns across 12 binaries (10 workers)
md_MAIN_031    func_800CB1CC
  md_MAIN_044    func_800CCDB0
  md_MAIN_047    func_800CCBC0
  md_MAIN_046    func_800CD5CC
  md_MAIN_003    func_800D2A24
  ov_SC02_017    func_80181E98
  ov_SC02_003    func_801888F4 func_80188C0C
  ov_SC01_080    func_80180728
  ov_SC02_005    func_8017E798 func_80185A88
  ov_SC02_011    func_80185098
  ov_SC01_074    func_8017E07C
  ov_SC02_027    func_801806FC func_80180A54
2026-08-30 22:58:29 -06:00
Drew T f8d790c51e feat(decomp): main batch-gate batch 0 — 143dbb89 byte-identical 2026-08-30 22:50:31 -06:00
Drew T dfaec94e51 fix(main): declare the 3 return-type-flip fns s32, not void — byte-neutral, unblocks their drafts
src/800.c declares func_8002A544/func_8002A2D4/func_8002A7B4 as `extern void f(s32)`, but each
body genuinely materializes a value in $v0 on both exits (asm-proven). Under a true void signature
gcc-2.7.2 dead-codes exactly those materializations, so the byte-correct s32 body can never compile
in this TU — cookbook §43's 'return-type flip pair', which §183 records as TU-edit-required.

All three call sites discard the result (`func_8002A544(0x32);` as a bare statement), so widening
the declaration cannot change a caller. NEGATIVE CONTROL, run twice: with the edit applied and NO
draft substituted, main still builds 143dbb89f34491258bbc27810d0a12ec8b43a8dd, identical to
config/check.us.sha. The edit is byte-neutral by measurement, not by argument.

Committing it SEPARATELY because gate_main snapshots and restores the TU between passes: an
uncommitted edit is reverted before the gate ever sees it (measured — the first attempt banked 4 of
7 and left all three of these as stubs).

Note for the record: the S66 overlay reconcile lane proved this class also has DRAFT-ONLY escapes
that need no TU edit at all — §202's asm-label alias (`s32 aF800CCBC0(void) __asm__("func_800CCBC0")`,
used byte-proven on func_800CCBC0 and func_800D30D0) and a new register-$2 + input-barrier + shared
goto-exit lever (func_800D2A24). Those are the smaller blast radius and should be preferred where
the TU is shared; this edit is kept because it is proven neutral and these three drafts already
exist in s32 form.
2026-08-30 22:49:42 -06:00
Drew T ce4c7eaae1 feat(decomp): main batch-gate batch 0 — 143dbb89 byte-identical 2026-08-30 22:47:31 -06:00
Drew T 360af57e3f feat(decomp): parallel gate — 4 fns across 4 binaries (4 workers)
md_MAIN_044    func_800CCF58
  md_MAIN_016    func_800CAF84
  md_SC07_004    func_801A8E34
  ov_SC06_033    func_8017E0E4
2026-08-30 22:36:48 -06:00
Drew T 6f51dbf267 feat(decomp): worker gate — +1 fns x0 propagated (fleet 99.2%) 2026-08-30 22:15:26 -06:00
Drew T 21d7d8675d feat(decomp): worker gate — +1 fns x0 propagated (fleet 99.2%) 2026-08-30 22:04:56 -06:00
Drew T f0af912c17 feat(decomp): worker gate — +1 fns x0 propagated (fleet 99.2%) 2026-08-30 22:03:25 -06:00
Drew T 578c638b9e feat(decomp): worker gate — +1 fns x0 propagated (fleet 99.2%) 2026-08-30 22:01:59 -06:00
Drew T c359fc1804 feat(decomp): worker gate — +1 fns x0 propagated (fleet 99.2%) 2026-08-30 22:00:27 -06:00
Drew T 0649108ec9 feat(decomp): worker gate — +1 fns x0 propagated (fleet 99.2%) 2026-08-30 21:58:55 -06:00
Drew T c297dc1235 feat(decomp): worker gate — +2 fns x0 propagated (fleet 99.2%) 2026-08-30 21:56:49 -06:00
Drew T 90cfb678d9 feat(decomp): worker gate — +1 fns x0 propagated (fleet 99.1%) 2026-08-30 21:55:32 -06:00
Drew T f930be4167 feat(decomp): worker gate — +1 fns x0 propagated (fleet 99.1%) 2026-08-30 21:54:28 -06:00
Drew T ccc7f64401 feat(decomp): worker gate — +1 fns x0 propagated (fleet 99.1%) 2026-08-30 21:51:18 -06:00
Drew T 6425a810f3 feat(decomp): worker gate — +1 fns x0 propagated (fleet 99.1%) 2026-08-30 21:50:06 -06:00
Drew T 67a48ebca1 feat(decomp): worker gate — +1 fns x0 propagated (fleet 99.1%) 2026-08-30 21:46:12 -06:00
Drew T 573d8f0493 feat(decomp): worker gate — +1 fns x0 propagated (fleet 99.1%) 2026-08-30 21:44:49 -06:00
Drew T a367d3f15a feat(decomp): worker gate — +1 fns x0 propagated (fleet 99.1%) 2026-08-30 21:41:13 -06:00