Commit Graph

137 Commits

Author SHA1 Message Date
Drew T 6a96a62f27 feat(decomp): main in-tree gate — 2 fn(s)
main  func_8001DA34
  main  func_80021D38
2026-09-01 04:53:15 -06:00
Drew T c794091725 feat(decomp): main in-tree gate — 8 fn(s)
main  func_80020A28
  main  func_80021284
  main  func_800221A8
  main  func_8002374C
  main  func_80026514
  main  func_8002D904
  main  func_800377D8
  main  func_8003DC90
2026-09-01 04:51:47 -06:00
Drew T c6f6f668ba feat(decomp): main/func_80036D58 — the narrow-param decl-sync completes the §378 chain
A no-proto decl is ILLEGAL against a definition whose parameter is affected by
the default argument promotions (s16 here): C89 requires the parameter types be
promotion-stable when one declaration has no prototype. So fix_arity_callers'
--any-proto cannot reach this case (it skips it as 'narrow-param').

With the call sites already cast (§378) the decls emit no code, so syncing them
to the draft's exact signature is byte-neutral: 3 decls in src/800.c rewritten to
extern void func_80036D58(s16). Byte-identical, main.
2026-08-31 23:51:19 -06:00
Drew T 72d3f61dcd chore(integration): self-caller casts for the 27 remaining §376 candidates (pre-gate) 2026-08-31 23:36:59 -06:00
Drew T da32350873 feat(decomp): main in-tree gate — 1 fn(s)
main  func_80013B64
2026-08-31 22:18:35 -06:00
Drew T 0dacc7b3f9 feat(decomp): main in-tree gate — 0 fn(s) 2026-08-31 18:50:44 -06:00
Drew T 86918184da feat(decomp): main in-tree gate — 0 fn(s) 2026-08-31 18:47:29 -06:00
Drew T f7fee7fcde feat(decomp): main banks again — 3 fns (func_80012B58, func_800241C0, func_800242D0)
The first main banks since the two harness defects were fixed. All three were
proven byte-perfect in the real link by the Fable investigation BEFORE any fix,
and reported {banked:0, near:3} purely because:
  * gate_stage compared main against ov_SC01_077's SHA (build/main/main never
    exists, config/check.main.sha never exists, DEF_SHA took over), and
  * psyq_integrate dropped 'firstfile = 0x80061FA8;' on every incremental relink,
    so main's BASELINE was already 2 bytes red before a draft was spliced.

func_800242D0 additionally needed one reconcile: it declared 'extern u16
D_80063870' while the just-banked func_800241C0 declares 'extern s16
D_80063870[]' at file scope. gcc-2.7.2 rejects the conflicting redeclaration at
file scope AND at block scope (the block-scope shadow was tried and also
rejected), so the draft now matches the banked spelling and takes the address by
array decay. Only the address is used (t4 is a 'register s16 *'), so the element
type never reaches codegen -- and the whole-binary SHA proves it.

harvest_verify in the main tree: verified 3 / failed 0, final SHA
143dbb89f34491258bbc27810d0a12ec8b43a8dd BYTE-IDENTICAL. main 1048 -> 1045 stubs.

NOTE for the next session: parallel_gate's WORKTREE still cannot gate main (its
generated-input staging covers the 3 Makefile-named files but main's link needs
more). main is one binary, so gate it in the main tree with harvest_verify --
there is no parallelism to lose.
2026-08-31 17:08:32 -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 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 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 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 481cb5dff1 feat(decomp): main batch-gate batch 0 — 143dbb89 byte-identical 2026-08-30 20:14:04 -06:00
Drew T caa220806c feat(decomp): main batch-gate batch 0 — 143dbb89 byte-identical 2026-08-30 18:07:37 -06:00
Drew T e403eac964 feat(decomp): main batch-gate batch 0 — 143dbb89 byte-identical 2026-08-30 16:47:07 -06:00
Drew T 743065e4be feat(decomp): main batch-gate batch 0 — 143dbb89 byte-identical 2026-08-30 15:34:45 -06:00
Drew T e485cc8559 feat(decomp): main batch-gate — +1 fn (143dbb89 byte-identical)
Batched main gating (batches of 8, per the measured lesson that batch-40 strands good drafts in
chunks the bounded bisect abandons). Both batches' bisects CONVERGED this time — batch 0: 3 of 7 in
13 rebuilds; batch 1: 1 of 3 in 5 rebuilds — no BISECT ABORTED, so nothing was stranded.

BUG IN MY WRAPPER (R42): gate_main --apply re-extracts and re-splices main on every invocation, so
running batch 1 REVERTED batch 0's three banks. Only batch 1's survived to the tree. The wrapper
must COMMIT between batches; re-running batch 0 to recover them.
2026-08-30 15:28:52 -06:00
Drew T 11b818d6c3 feat(decomp): gate_main pass 2 — +2 main game-code fns (143dbb89 byte-identical)
Auto-reconcile loop dropped 1 batch-aborting draft (func_8005E8E8), then bisected 40 candidates in
24 full-EXE rebuilds: 7 explicitly rejected, 5 chunks unresolved when the bisect hit its own bounded
step limit. gate_main reported 'BANKED 3'; corpus.stubs('main') went 132 -> 130, so 2. SECOND
instance of gate_main over-reporting its bank count by one (R14) — trust the oracle, not the tool.
2026-08-30 10:52:24 -06:00
Drew T 96bc363c19 feat(decomp): gate_main — main game code banked from the S66 m1/m2/m3 waves
gate_main.py clean-rebuild gate over the 41 compatible drafts of the 54 drawn (11 dropped for
in-TU decl conflicts, 3 more dropped as batch-aborting compile conflicts by the auto-reconcile
loop). Bisect stopped itself after 24 full-EXE rebuilds with 3 chunks unresolved -- a bounded
failure by design. Final: 143dbb89f34491258bbc27810d0a12ec8b43a8dd BYTE-IDENTICAL.
Explicitly rejected: func_80013154, func_8001AAD0, func_8001BC6C, func_80021174, func_800241C0,
func_80031988.
2026-08-30 10:06:39 -06:00
Drew T b1a0d49a52 feat(t5): main mini-wave — 9 banked of 11 never-drafted (func_80029B4C/BC8/DB4, func_8002A108/354/5C4, func_80030634, SYS_OBJ_202C, SYS_OBJ_2264); gate_main clean rebuild, main SHA 143dbb89 byte-identical (P31 S63 T5.7) 2026-08-26 21:26:50 -06:00
Drew T 252dc930cb feat(decomp): main lane n02 — 1 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_80028694
2026-08-26 12:06:33 -06:00
Drew T d7142f224d feat(decomp): main lane n02 — 3 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  FGO_01_OBJ_CC
  func_800331D4
  func_8005D33C
2026-08-26 12:01:09 -06:00
Drew T 37a7f5b055 feat(decomp): main lane n02aa — 1 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_800268D0
2026-08-26 11:43:24 -06:00
Drew T 96afb09c59 feat(decomp): main lane n02 — 3 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_80012B04
  func_800130D0
  main
2026-08-26 11:29:32 -06:00
Drew T 0828f12df3 feat(decomp): main lane n00 — 9 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  ReturnFromException
  SetIR0
  SysDeqIntRP
  func_80012DBC
  func_80012FC8
  func_8002AE60
  func_8003FA54
  func_80049610
  func_800626DC
2026-08-26 11:13:57 -06:00
Drew T ece1584f40 feat(decomp): main lane m74 — 15 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  DeliverEvent
  FGO_02_OBJ_CC
  FGO_03_OBJ_CC
  OpenEvent
  SetDrawArea
  func_80010A08
  func_800116E0
  func_80011818
  func_80015AD0
  func_80018918
  func_8001C14C
  func_80029C44
  func_8002AB64
  func_80037EA0
  func_80037F3C
2026-08-26 08:39:53 -06:00
Drew T aa08a94241 feat(decomp): main lane m74b — 13 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  FGO_01_OBJ_64
  FGO_02_OBJ_68
  FGO_03_OBJ_64
  RotMatrixX
  RotMatrixY
  RotMatrixYXZ
  RotMatrixZ
  SYS_OBJ_1BC4
  func_80012E0C
  func_80014588
  func_800153CC
  func_8004978C
  func_80049CAC
2026-08-26 08:33:27 -06:00
Drew T d42cb94484 feat(decomp): main lane m74ab — 8 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_800112C8
  func_80011998
  func_80011CFC
  func_800120DC
  func_80012A60
  func_80012F74
  func_8001534C
  func_8005E188
2026-08-26 08:29:10 -06:00
Drew T df75110f0d feat(decomp): main lane m74aaba — 2 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_80011D54
  func_80012C6C
2026-08-26 08:28:37 -06:00
Drew T 585f4bac3f feat(decomp): main lane m74aaa — 5 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  SYS_OBJ_1B78
  func_80010A98
  func_800119F0
  func_80012ABC
  func_8003819C
2026-08-26 08:28:04 -06:00
Drew T 64c3f0e17a feat(decomp): main lane m74 — 39 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  GetGraphDebug
  GetGraphType
  SYS_OBJ_1964
  SYS_OBJ_1A30
  SYS_OBJ_1AF0
  SYS_OBJ_2F7C
  SetDQA
  SetDQB
  SetData32
  SetVertex1
  SetVertex2
  _96_remove
  _SsSndPlay
  func_8001096C
  func_80010B10
  func_80010D60
  func_80010DE0
  func_80010E14
  func_80010E48
  func_80011220
  func_800112A8
  func_80011320
  func_80011350
  func_80011DF4
  func_8001311C
  func_800191BC
  func_800388E8
  func_80039F14
  func_8003A098
  func_8003A404
  func_8003D424
  func_8005AB58
  func_8005AC24
  func_8005CF08
  func_8005CF18
  func_8005E194
  func_8005F384
  func_80062394
  func_800626C8
2026-08-26 08:26:19 -06:00
Drew T b82a070c49 feat(decomp): main lane m74 — 3 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  DisableEvent
  func_80011EB4
  func_8002F80C
2026-08-26 08:22:33 -06:00
Drew T 2cdbda9268 feat(decomp): main lane m74a — 9 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  CloseEvent
  WaitEvent
  func_80010ED4
  func_80011778
  func_80011A3C
  func_80011ADC
  func_80012D0C
  func_80013028
  func_80041448
2026-08-26 08:09:49 -06:00
Drew T 24c94e82b9 feat(decomp): main lane m74 — 19 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  FlushCache
  InitHeap
  SYS_OBJ_191C
  SYS_OBJ_1C28
  func_80010C7C
  func_800110CC
  func_800118AC
  func_80011928
  func_80011C10
  func_80011C8C
  func_8001B710
  func_80029690
  func_80031D70
  func_80031E94
  func_80031FC8
  func_80034650
  func_800347C8
  func_800348A8
  func_8003916C
2026-08-26 08:03:15 -06:00
Drew T b365e3e370 feat(decomp): main lane m67a — 1 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_8003350C
2026-08-26 06:39:06 -06:00
Drew T f216915333 feat(decomp): main lane m54a — 1 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_8001C214
2026-08-26 03:21:03 -06:00
Drew T d483988b09 feat(decomp): main lane m53aab — 1 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_80028D58
2026-08-26 02:58:59 -06:00
Drew T c6b836cb04 feat(decomp): main lane m52a — 1 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_8001C4A4
2026-08-26 02:45:50 -06:00
Drew T f5fe011d73 feat(decomp): main lane m51aaa — 1 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_80028D9C
2026-08-26 02:17:43 -06:00
Drew T e353b1faa6 feat(decomp): main lane m50a — 2 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_8001C810
  func_80028DE0
2026-08-26 01:47:07 -06:00
Drew T c6918cef6f feat(decomp): main lane m49aab — 1 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_8001C320
2026-08-25 22:30:35 -06:00
Drew T 23567bf5ca feat(decomp): main lane m46a — 3 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_8001C5B8
  func_80028E24
  func_8005D0D8
2026-08-25 19:36:28 -06:00
Drew T 348eb2808a feat(decomp): main lane m45a — 3 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_800189A8
  func_80028E68
  func_8005D0F8
2026-08-25 18:50:13 -06:00
Drew T c271c499fc feat(decomp): main lane m43aaa — 1 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_80028EAC
2026-08-25 17:46:03 -06:00
Drew T 389c0c1065 feat(decomp): main lane m40a — 3 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_80028EF0
  func_80031CC8
  func_8005D118
2026-08-25 15:20:38 -06:00
Drew T 9b407f5441 feat(decomp): main lane m37a — 1 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  func_80028F78
2026-08-25 14:37:29 -06:00
Drew T d0da3f24f7 feat(decomp): main lane m36 — 4 banked
One clean whole-EXE rebuild verified the batch (gate_main), and main re-checked
BYTE-IDENTICAL against config/check.us.sha before anything was credited.

  SYS_OBJ_1F64
  SsGetMute
  func_80028F34
  func_80031DEC
2026-08-25 14:23:25 -06:00