Commit Graph

3370 Commits

Author SHA1 Message Date
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 b2256e3700 docs(phase-31): S67 FINAL checkpoint — 4 closed (530 -> 526), fleet 213/213, propagation found unverified 2026-08-31 09:45:55 -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 c4380c19e4 feat(p31 s67): stranded-draft census + honest jtbl probe — the frontier's biggest class is carve plumbing
MEASURED (denominators in .run/S67_findings.md):
* 193 of the 530 open functions ALREADY have a draft on disk (1,885 wave targets seen,
  1,521 banked, 171 open-no-draft, 166 never drawn). Classified in their real TUs:
  37 MATCH / 67 NEAR / 89 CC1-FAIL.
* 159 open functions (30% of the frontier) reference a jump table; 96 are PLAN-REFUSED
  by build_carve (non-contiguous same-subseg .rodata), 75 non-main across 38 subsegs.
  Not a codegen wall and not a decl wall — carve plumbing.

NEW
* tools/strand_census.py — coverage-asserted census + rtu_match classifier + draft staging.
  Keys binary:fn (R48); classifies each pair once after merging every manifest's view.
* tools/o0_detect.py — the -O0 prologue tell extracted from match_one (which parses argv at
  import and therefore cannot be imported). match_one re-exports it; ONE definition (R33).
  Wiring it into the classifier turned md_MAIN_003 from 8 NEAR (7 of them >20) into 6 MATCH.
  Negative-controlled both directions.
* tools/scope_demote_drafts.py — §8d as an _xform-contract gate rung. NOT yet exercised.

FIXED
* jtbl_carve --probe now runs build_carve (a pure planner) and reports plan-refused. It
  previously called only island_probe, which answers a necessary-not-sufficient question —
  every blocked function probed "carveable", and S66 priced 32 of them as free on that.
* blocker_probe.macro_scope selects the LAST #define per macro name, matching cpp.
  engine_core.h has 1,037 duplicate DEFINE_func_ names and 4 with DIFFERENT bodies.

NOT VALIDATED — DO NOT SCALE
* jr_isolate_all: two real defects fixed (carried types deduped by name; header-provided
  types no longer re-emitted) but ov_SC02_000 STILL fails the byte gate after them.
  Open lead: file_scope_types carries a block without its enclosing #if guard. 20 of 35
  blocked overlays dry-run clean and that number means nothing until one round-trips.

0 functions banked this session. tools-health has ONE pre-existing cdecl defect
(1 of 74,749 declarations, func_8017EE08_p55352/struct ZnRec) — cdecl.py and its inputs
are byte-identical to HEAD, so it is not from this change.

Knowledge banked: cookbook §322/§323/§323a/§323b, decision-log pivot, accelerators #13/#14.
2026-08-31 01:46:16 -06:00
Drew T b4d8f06363 docs(phase-31): S66 FINAL checkpoint — 416 fns closed (946 -> 530), fleet 213/213, 99.2% weighted
Written after the last harvest, per the rule that the checkpoint is always last. Supersedes the
interim S66 block. Machine quiesced, tree clean at commit:3350.

Leads with the three things a fresh session must not re-learn: main is ~94 open not 1,099 (and
drafting into a LINKED subseg would gate GREEN while wrong); the family era is over so integration
is the whole game (147 of 591 open fns already had byte-correct drafts stranded on four blockers);
and 'independent' means a different INSTRUMENT — two refusals from parallel_gate were one instrument
twice, after which the serial gate banked 16/32 of that class.

Also records that ~56 of the 416 banks came from ZERO drafting agents, purely from work already on
disk, and Drew's binding harvest-then-toolify-before-the-next-wave rule.
2026-08-31 00:01:43 -06:00
Drew T d343892b4c chore: --only-main draw mode + progress/backlog refresh after the S66 gates
draw_waves.py gains --only-main (the main lane draws main and nothing else; implies --main so the
LINKED refusal still applies). Progress/backlog regenerated: fleet 99.2% instruction-weighted,
98.1% distinct.
2026-08-31 00:00:37 -06:00
Drew T 7f75442b67 docs(cookbook): S66 round 6 — §320 breaks the §43/§183 'return-type flip' wall, §321 typedef identity
From the two cast-at-use reconcile lanes (27 agents on drafts the gate DROPPED for in-TU decl
conflicts, not codegen). 24 reconciled to MATCH, 19 banked.

§320 — §43 and §183 item 4 both record the return-type flip pair (TU says void, body materializes
$v0 on every exit) as TU-EDIT-REQUIRED IMMOVABLE. It is not: three agents broke it three ways in a
single lane, each byte-proven.
  1. §202 asm-label alias — s32 aF800CCBC0(void) __asm__("func_800CCBC0") — TU untouched
     (func_800CCBC0 138/138 first try; func_800D30D0 76/76).
  2. register $2 + input-only asm barrier before a bare return, with the early exit routed through
     a goto to a SHARED label — measured bound: inline in the if body is NEAR closeness 10, shared
     exit is MATCH (func_800D2A24).
  3. Adopt the TU's own old-style K&R decl rather than writing a prototype (func_800CB1CC 47/47).
Plus: when every caller discards the result a TU void->s32 widening IS byte-neutral, but MEASURE it
(null-draft rebuild must still give 143dbb89…) — done twice here. And the process trap that cost a
pass: gate_main snapshots and RESTORES the TU between passes, so an uncommitted TU edit is reverted
before the gate sees it.

§321 — two anonymous struct typedefs are distinct types to gcc-2.7.2 even when spelled identically,
so a file-scope duplicate is fatal while the SAME TEXT at block scope is only a warning and is
codegen-neutral. Three dials, all byte-proven: demote to block scope; or hoist and delete the local
copy; or name a local typedef for its OWN address (SVEC_8017E07C, not a neighbour's SVEC_8017E158).
Not a cast-at-use case — the conflict is type IDENTITY, not width.
2026-08-31 00:00:08 -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 3a2533c602 docs(phase-31): S66 checkpoint — 390 fns closed (946 -> 556), fleet 213/213, 99.2% weighted
Written for a fresh session. Headlines: main is ~100 open not 1,099 (960 stubs are LINKED dead text,
and drafting into them would gate GREEN while wrong); families are spent (84-93% singletons, twin
pool dry); integration is now the whole game (147 of 591 open fns already had byte-correct drafts
stranded on four blockers). Records Drew's binding rule — harvest, then toolify, BEFORE the next
wave — and the F18 retraction: two refusals from parallel_gate were one instrument twice, not two
independent tests; the serial gate then banked 16/32 of that class.
2026-08-30 22:34:34 -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
Drew T 8a58d2c633 feat(decomp): worker gate — +1 fns x0 propagated (fleet 99.1%) 2026-08-30 21:39:13 -06:00
Drew T 035f2bafd9 feat(decomp): main batch-gate batch 2 — 143dbb89 byte-identical 2026-08-30 21:27:19 -06:00
Drew T c9029b18fd feat(decomp): main batch-gate batch 1 — 143dbb89 byte-identical 2026-08-30 21:27:06 -06:00
Drew T 9184ab9c8d feat(decomp): main batch-gate batch 0 — 143dbb89 byte-identical 2026-08-30 21:26:52 -06:00
Drew T 27f52da6f6 feat(decomp): parallel gate — 1 fns across 1 binaries (7 workers)
ov_SC03_024    func_801838CC
2026-08-30 21:26:03 -06:00
Drew T 95d6ef6c38 feat(decomp): parallel gate — 1 fns across 1 binaries (1 workers)
ov_SC03_107    func_8016D1D8
2026-08-30 20:35:26 -06:00