Commit Graph

202 Commits

Author SHA1 Message Date
Drew T 7381156213 src(phase-37): T4 batch t4_D9 — restruct: batch t4_D9 rung D — 300 files (TUs; 3878 drawable) · 551 declaration units: 53 canonical / 0 promoted / 11 K&R marked / 2 aliases typed / 0 __builtin_abs → abs / 34 kept · compiles 102 in 65 s wall · final 300/300 identical · written 6 files | R22 check-all: 218 passed, 0 failed of 218 | (census skipped) (restruct_cycle) 2026-09-12 11:16:49 -06:00
Drew T d4e91f60d4 phase-36: S105 s105_f1_minlever — func_80015D4C banked at 0 through the whole-object gate + propagated — f1 minimum-lever 3 → 1 (a local-alloc priority contest the plain body loses by 6/44 vs 6/56) 2026-09-11 12:34:45 -06:00
Drew T 0afcea1ddc phase-36: S105 s105_f1_minlever — func_80029D3C banked at 0 through the whole-object gate + propagated — f1 minimum-lever 2 → 1 (the $4 pin is the function's own missing parameter — a parked signature change) 2026-09-11 12:34:24 -06:00
Drew T a91f4efffd phase-36: S105 s105_f1 — func_80025504 banked at 0 through the whole-object gate + propagated — f1 plain C (walk the parameter / a local copy per the giv init) 2026-09-11 12:34:04 -06:00
Drew T a4038d5da1 phase-36: S105 s105_f1 — func_80016638 banked at 0 through the whole-object gate + propagated — f1 plain C (the P_TAG bitfield store) 2026-09-11 12:33:43 -06:00
Drew T c2dba59cb8 phase-36: S104 s104_e29 — func_8002AAB4 banked at 0 through the whole-object gate + propagated — 4 pins → 0: four call results + (a+b+c+d)/4 (expmed.c:2979-2995) + one table index with the loop-test load in thr (loop.c:4341) 2026-09-11 04:08:21 -06:00
Drew T 12222c562c phase-36: S104 s104_e29 — func_8002AF70 banked at 0 through the whole-object gate + propagated — 3 levers → 0: the copy loop as ONE struct assignment of 0x2DC bytes (expand_block_move mips.c:2330ff; block_move_loop :2222) 2026-09-11 04:07:57 -06:00
Drew T b5b7017505 phase-36: S104 s104_e25 — func_800277DC banked at 0 through the whole-object gate + propagated — 2 levers → 0: field accesses through local struct views, the scratch words in one aggregate, a local walker 2026-09-11 03:28:05 -06:00
Drew T aa0564d72d phase-36: S104 s104_e25 — func_800279AC banked at 0 through the whole-object gate + propagated — 2 levers → 0: the GTE scratch words as one local struct (sched.c:834-836) + walk a local copy of the parameter (loop.c:4120-4146) 2026-09-11 03:27:38 -06:00
Drew T 8116845157 phase-36: S104 s104_e25 — func_80013B64 banked at 0 through the whole-object gate + propagated — 3 levers → 0: the flattened GTE asm as Sony's macros + u16 v1 (sched.c:2477) 2026-09-11 03:27:08 -06:00
Drew T 70d1ad8826 phase-36: S104 s104_e25 — func_800167F0 banked at 0 through the whole-object gate + propagated — 3 levers → 0: the store in each arm (sched.c:776; jump.c:2371), a u16 copy of the parameter, a set-once mask, the clamp as an if/else (jump.c:725-830; local-alloc.c:1773) 2026-09-11 03:26:32 -06:00
Drew T 51fe62d2c8 phase-36: S104 s104_e20 — func_8001C5B8 banked at 0 through the whole-object gate + propagated — pin + launder → 0: func_8001C320's text ported (a byte-twin) 2026-09-11 03:02:39 -06:00
Drew T 4e53e4af6f phase-36: S104 s104_e20 — func_8001C320 banked at 0 through the whole-object gate + propagated — pin + launder → 0: Sony's TMD walk (cse.c:5582-5665) + the call at its real arity (global.c:594-607) 2026-09-11 03:02:08 -06:00
Drew T 18e3c5734d phase-36: S104 s104_e20 — func_8001A114 banked at 0 through the whole-object gate + propagated — 2 launders → 0: one variable per case (birthing_insn_p sched.c:2469-2490) 2026-09-11 03:01:39 -06:00
Drew T c5b4db1e67 phase-36: S104 s104_e20 — func_800168C4 banked at 0 through the whole-object gate + propagated — pin + barrier → 0: the store sunk into both arms (sched.c:421-433/776-779) + an && … return 1 tail (jump.c:725-830) 2026-09-11 03:01:13 -06:00
Drew T 03b8ee4000 phase-36: S104 s104_e15 — func_80025818 banked at 0 through the whole-object gate + propagated — launder → 0: walk a local copy of the parameter (loop.c:4120 valid_initial_value_p) 2026-09-11 02:42:16 -06:00
Drew T c4834ca814 phase-36: S104 s104_e15 — func_80015760 banked at 0 through the whole-object gate + propagated — 2 pins → 0: set counts steer REG_EQUIV (local-alloc.c:1016-1064), loop.c's hoist (loop.c:705) and sched1 births (sched.c:2465-2543) 2026-09-11 02:41:56 -06:00
Drew T bd6c98069d phase-36: S104 s104_e15 — func_800166E8 banked at 0 through the whole-object gate + propagated — 2 levers + a pad → 0: while (n-- != 0) with an int counter (fold-const.c:4399/3149) 2026-09-11 02:41:36 -06:00
Drew T 26aea28138 phase-36: S104 s104_e15 — func_80013694 banked at 0 through the whole-object gate + propagated — 2 levers → 0: the fused GTE asm split into Sony's macros + one variable for two values (local-alloc.c:472) 2026-09-11 02:41:16 -06:00
Drew T c37ef9c15c phase-36: S104 s104_e10 — func_80021174 banked at 0 through the whole-object gate + propagated — 4 levers → 0: if (c1 && … && cn) return 1; return 0; (jump1 hoists a hard $2 = 0, jump.c:725-830) + the shared GTE macros 2026-09-11 02:04:52 -06:00
Drew T 7e7d9c523a phase-36: S104 s104_e10 — func_80015208 banked at 0 through the whole-object gate + propagated — launder → 0: the flag the jump reads (jump.c:805) + the mask hoisted above the early return (sched.c:2465-2490) 2026-09-11 02:04:31 -06:00
Drew T 7f80f66827 phase-36: S104 s104_e10 — func_80020598 banked at 0 through the whole-object gate + propagated — $8 pin → 0: parameters straight to the GTE macros (reload's spill register, reload1.c:2331-2352), the pad deleted 2026-09-11 02:04:10 -06:00
Drew T 1f997967f4 phase-36: S104 s104_e10 — func_80014DEC banked at 0 through the whole-object gate + propagated — $2 pin → 0: the multiply as a0 * 76 (a twice-dying chain variable is refused, local-alloc.c:472) 2026-09-11 02:03:49 -06:00
Drew T 65b0855c1c phase-36: S104 part-3 bank resumed — 6 of 38 MATCH rows banked (the rest banked before the timeout); e1–e5 TU-batch packs; R22 follows 2026-09-11 00:32:13 -06:00
Drew T 93e2a9170c phase-36: S104 banks — the R23(case-label)/R34/R35/R36 pass: 915 classes in 1,757 s, MATCH 16 (bank line above); d20's minimum-lever func_80180324 (8 → 2 marked dead branches) PARKED for Drew — an invented always-false condition is not covered by ruling (a) 2026-09-10 23:50:01 -06:00
Drew T 72153b4af1 phase-36: S104 sweep banks part 2 — 39 of 44 MATCH rows (R27 ports 21, R7 do-while marked 7, R8/R18/R12/R19/R20/R9) + 35 siblings, each IDENTICAL through the whole-object gate; R22 follows 2026-09-10 22:11:30 -06:00
Drew T 5603a114c2 phase-36: T7 sweeps s2/s3 — the constant-holder census corrected (537 of 17,302, not 284 of 10,958) and 10 bodies closed; the propagate namespace bug fixed
- s2 (the head, with R16/R17 added): search: 0 of 140 exemplars matched lever-free in 0.24 h (0 of 7,085 bodies behind
  them; 23,689 compiles). The two new generators closed nothing on the head; recorded as measured.
- agent a2's "284 constant-holder pins of 10,958" verified against the source rather than believed (R14), and my first
  instrument was wrong (R40): asking R16 directly answered 33, because R16 only fires on a split declaration while most
  pins carry their value as an initialiser. R3 converts one form to the other, so the reachable family is R3+R16.
  Corrected, both figures derived: 537 constant-holder pin sites of 17,302, in 510 bodies (152 initialiser, 385 separate
  assignment; by register $2 282, $20 136, $3 28).
- s3 drew exactly those 99 function names and closed 10 bodies before crashing with
  AttributeError: 'Namespace' object has no attribute 'allow_residue'
  in propagate — the a2 fix read the flag off the caller's namespace and the search engine builds its own Namespace for
  that in-process call. Fixed with getattr(a, "allow_residue", False): a library must not assume its caller's namespace
  shape (R43).
- the ten banks were real, proven by gating the tree the crash left:
  check-all: 218 passed, 0 failed of 218
  lever_census --check: 29,533 pin/asm sites, 29,533 marked !FAKE, 0 UNMARKED — OK
- by first move the ten are R15 x3, R6 x4, R7 x2, R9 x1 — the draw was right about the family even though R16 did not fire.
- snapshot row 13; s3 re-runs from the top with the fix.
2026-09-10 02:49:05 -06:00
Drew T 7b2200edad phase-36: the tail pass g6 + g6b (47 + 63 of 400 small classes; 186/191 siblings propagated), R22 218/218; 30,806 → 30,358 sites; --try (a candidate scored without a tree write), delever_pack.py (the 57 T7 packs + PROMPT.md), --restore refuses an empty snapshot; the checkpoint: T7 as one agent at a time, approved, starts in the fresh session 2026-09-09 23:32:57 -06:00
Drew T 5b6e1a2fe7 phase-36: T5 — the consolidation applied (644 files: 8,951 per-TU GTE definitions gone, 629 clobber variants byte-identical without the clobber, 70 kept as marked levers, 575 direct statements → canonical calls, 85 header-bound homonyms kept) + the marker repair (scrub 344 misplaced, re-mark 349); four instrument fixes: scoped renames, header-bound homonyms kept, object-like macros, the canonical table stable (the header's definitions in the inventory) and the census cache keyed on the tables; R22 218/218; the number 34,090 (33,625 + 465 GTE levers) all marked, 0 orphans, --check OK; kit corpus; log entry 2026-09-09 06:29:00 -06:00
Drew T 145ab77194 src(phase-36): T5 batch gte1 — gte_consolidate: batch gte1 — 400 files: 400 consolidated, 0 defs-only, 0 unchanged, 0 refused, 0 no-recipe · definitions deleted 8056 / renamed as lever variants 5 (variant trials: 416 freed, 5 kept) · header-bound definitions kept 80 · use renames 930 · direct statements → calls 460 / lever 252 / unmatched 185 · markers 276 · compiles 1146 · final 400/400 identical | R22 check-all: 218 passed, 0 failed of 218 | census: THE PHASE'S NUMBER (pins + asm statements, GTE excluded): 33,901 sites in 12,601 bodies (1,756 distinct) · marked !FAKE 33,665 · UNMARKED 236 (delever_cycle) 2026-09-09 05:55:45 -06:00
Drew T aa70308cf1 src(phase-36): T4 batch tus9 — delever: batch tus9 — 300 files (TUs; 383 drawable) · 1901 bodies: 454 lever-free, 1430 residue, 8 refused · sites removed 2244 / needed 2937 / refused 42 / deferred 9 · replays 522 (0 disagreed) · compiles 5262 in 294 s wall · final 300/300 identical · written 297 files | R22 check-all: 218 passed, 0 failed of 218 | census: THE PHASE'S NUMBER (pins + asm statements, GTE excluded): 34,459 sites in 12,656 bodies (1,909 distinct) · marked !FAKE 32,473 · UNMARKED 1,986 (delever_cycle) 2026-09-09 04:15:14 -06:00
Drew T a8457663fc src(phase-35): T4 finalize — engine_core.h, ov_setters.h and clearTbl40.h deleted; the legacy sites converted (clearTbl40 as the SHARED_FN parameterized control in src/800_c.c; the three SC01_005 accessors as headers), the whale header moved under ov/ with every -O0 includer rewritten, 7 alias-form bodies given their own __asm__ binding, the registry's source/func lines text-edited by id, three non-shared headers rewritten; --verify OK (0 macro sites, no macro header); R22 clean fleet check-all: 218 passed, 0 failed of 218 in 145 s; dedup-check 2220/0; audit-binaries OK; the census 362,389/362,389 with 0 macro sites; SETUP + dictionary rows; kit corpus 2026-09-08 18:06:04 -06:00
Drew T b47bc2ea0b feat(phase-32): T4b (5) — main: func_80020DA4 (100 ins) BANKED byte-identical 143dbb89 via gate_main — a pinned WALL falls: the $6 pin on e0 FORBADE $a2 at reload's retry_global_alloc (regs_ever_live seeds bad_spill_regs), so the product took $t0; unpinned + two zero-byte launders steer local-alloc's qty_compare to the target's allocation (Fable agent)
- pinned since S79 as "mflo destination $t0 vs $a2 (REGALLOC-PERM), pinning regresses to 79"; 5 attempts 51->20->14->8->2 +
  permuter_ils null (S80); T4 re-probed DIFF 2; the S83 hand pass measured the variable-reuse form at 80
- mechanism (dumps + source): the mult results are GLOBAL allocnos (mulsi3_internal '=l', mips.md:848; 'pref LO_REG');
  global.c parks m3/m8/m13 in LO, reload spills LO ("Spilling reg 65") and retries via retry_global_alloc (reload1.c:3497)
  with losers = forbidden_regs, seeded from bad_spill_regs = regs_explicitly_used = regs_ever_live at reload entry
  (reload1.c:486, 3651-3660, 709) — the S76 `register s32 e0 __asm__("$6")` made $a2 ever-live, so m13's retry could not
  take it and first-fit gave $t0 ("Register 102 now in 8")
- fix: unpin e0; `__asm__("" : "=r"(e1) : "0"(e1))` immediately before `dst[6] = -e1` (e1's qty 6666 -> 8750, allocated
  before e0's 7894, holds $v1, e0's first fit drops to $a2) + `__asm__("" : "=r"(p1) : "0"(p1))` between p1's andi and sll
  (undoes the global-allocno tie the first launder created; the $t6/$t7/$t8 rotation). Ladder 2 (pinned) -> 37 (unpinned)
  -> 15 -> 6 -> MATCH; a byte-identical alternate launders addr1 after its addu
- draft .run/P32/t5x/fable/func_80020DA4.c; report .run/P32/t5x/reports/func_80020DA4.md; coordinator rtu_match MATCH
  100/100 in src/800.c; gate_main slate_20DA4: BANKED, 143dbb89 BYTE-IDENTICAL
- main open 4 -> 3 (2 pinned walls + func_80039308 NEAR)
2026-09-05 18:16:01 -06:00
Drew T 836181a6c2 feat(phase-32): T3 (38) — main: func_8001BC6C (69 ins) BANKED byte-identical 143dbb89 via gate_main — permuter_ils found the two levers, the coordinator dropped its wrong-width mutation (R63) and re-spelled them well-defined
- seed: the Opus NEAR-6 draft (.run/P32/t3/opus/func_8001BC6C.c; §500-C REGALLOC-PERM $v0<->$v1 across the six OT-chain insns,
  local-alloc qty_compare one span unit). permuter_ils 8x150s -j3 --klass REGALLOC: cycles 6/7/8 = 6, 5, 1 (output-1-1)
- R63 read of the "1": three mutations — (a) `idx` computed AFTER `color`, (b) an early dead `tag = (a1 << 8) | k;` before
  k's assignment, (c) `(D_800B9A02 & 0xFFu) << 14` — and (c) turns the target's `lhu` into an `lbu` (semantically WRONG:
  the masked score rewards it; second witness after S80). (a)+(b) alone = leaf MATCH 69/69; (a) alone 8, (b) alone 21
- well-defined re-spelling: `k = 0; tag = (a1 << 8) | k;` at the top (I1) MATCHES; k-initialised-first (15), tag=a1<<8 (19),
  tag=a1 (8), tag=(a1<<8)|K (20), tag=0 (8), tag-then-k (8) all regress — the lever is the early BIRTH of the tag/k pseudos
  (§47 live-length: qty_compare = floor_log2(n_refs)·n_refs·size/(death−birth)), documented in the source comment
- rtu_match MATCH 69/69 in src/800.c; gate_main slate_main3: "slate 1 -> 1 compatible … BANKED 1 of 1 … 143dbb89 BYTE-IDENTICAL",
  EXIT 0 (.run/P32/t3s3/gate/gate_main3.log); main open 7 -> 6 (5 pinned walls + func_80039308 NEAR 17)
- func_800CD674's ILS plateaued at the SAME $a3<->$t1 pair (output-2-1 = 2 rows, no drift) — ledgered with its cost (R41)
- variants kept under .run/P32/t3s3/p1bc6c/ (the 11 spellings measured)
2026-09-05 11:35:41 -06:00
Drew T e2aee8e274 feat(phase-32): T3 (12)+(13) — main: func_80015B6C (120 ins) + func_8002FDE8 (73 ins) BANKED byte-identical 143dbb89 via gate_main
- gate_main .run/P32/t3s3/gate/slate_main2.json --apply: "slate 2 -> 2 compatible, 0 dropped"; clean EXE rebuild
  (extract + build) -> "BANKED 2 main functions -- 143dbb89f34491258bbc27810d0a12ec8b43a8dd BYTE-IDENTICAL", EXIT 0
  (.run/P32/t3s3/gate/gate_main2.log)
- func_80015B6C (src/800.c, Opus .run/P32/t3/opus/func_80015B6C.c): both journal walls fell — the "$v0/$v1 swap" was an
  artefact of the s32 wh[3] frame-slot hack; the corner-copy wall is cse.c canon_reg (make_regs_eqv keeps the FIRST
  register canonical) -> a barrier on the SOURCE variable `__asm__("" : "=r"(x) : "0"(x))`; four empty volatile fences
  partition block 2 into five phases at zero cost; the 0xE1000200 trailer lui hoist = reuse the $6-pinned tag variable
- func_8002FDE8 (src/800_b_2.c, Opus .run/P32/t3/opus/func_8002FDE8.c): the "regalloc-priority wall" at 35 was the ARRAY
  spelling of D_800A46D2 — the block-scope SCALAR `extern s16 D_800A46D2;` (as same-TU func_8002FF0C/func_800301C8) gives
  35 -> 3; third `return 1` inside the == -1 arm; the §47 live-length slider COMPUTED from -dl -dg (one fence where the
  constant is live and `data` dead); `one = 1;` and `i4 = idx * 4;` as separate statements
- both rtu_match MATCH in the real TU (S82 re-verification); cookbook §500-B carries the closers
- main: 12 -> 7 open (5 pinned walls + 2 NEAR)
2026-09-05 10:34:35 -06:00
Drew T 0276aaec68 feat(phase-32): T3 (8) — main: func_80023BF0 (281 ins) BANKED byte-identical 143dbb89 via gate_main — the OT link is libgpu's P_TAG 24-bit BITFIELD store (§364), not a hand-written mask/or
- the 11-18 plateau had two mutually-exclusive halves under (A & 0xFF000000) | (B & 0xFFFFFF): preheader hoist order
  of the two masks vs &otab[idx], and the $t3/$t4 pairing of the mask register and the slot pointer. store_field ->
  store_fixed_bit_field expands the RHS bitfield extract BEFORE the destination read, which fixes loop.c's movable
  order [&otab[idx]; 0xFFFFFF; 0xFF000000] AND the ior operand roles at once (operand swap alone = 35). Third witness
  for §364's -O2 half (func_8001D3FC/func_80021284/func_80023570 in the same TU already use the idiom).
- kept from the S79 90->18 chain (re-measured): the §194-A fence in both arms, `code` split from its base with
  compound accumulation, register u32 base __asm__("$3"), and exactly 13 zero-byte fences after pkt = D_800A5E60
  (0->15, 8->13, 10/11/12->7, 13->MATCH). Dropped as now inert: the m24 $11 and e1 $4 pins.
- the S80 permuter waypoint (closeness 11) was semantically UNSOUND (m24 sunk into one arm) and was not used (R63).
- rtu_match MATCH 281/281 (coordinator-verified); gate_main --apply 1/1, main byte-identical
2026-09-05 01:06:17 -06:00
Drew T d04fe31882 feat(phase-31): S79 #9 (9) — main: func_8001EFE0 (468 ins, the largest G-UNKNOWN main body) banked from an Opus agent's draft: recovered the prior closeness-14 body from .run/match and closed all three [permuter]-filed clusters by reading the matched same-TU siblings func_8001DA34/func_8001EA14 — the addPrim tail's ot split so the sll lands between the two pinned luis, one zero-byte fence between the tpage sh and the q[7] RMW, a §419 density asm on (vh,vv2,vw) for the two-SVECTOR fill, and the shift split from its mask; rtu_match --tu src/800.c MATCH, gate_main --apply clean rebuild BYTE-IDENTICAL 143dbb89 2026-09-04 20:47:51 -06:00
Drew T 1961a7bfb1 feat(phase-31): S79 #9 (5) — main: func_8002AC98 (114 ins) banked: the generic arm's val = r + b routed through a fresh s32 temp ({ s32 xt = r + b; val = xt; }, with b widened to s32) so expand_binop's target==op1 swap does not fire — the same lever as func_80015608; gate_main BYTE-IDENTICAL 143dbb89 2026-09-04 19:05:29 -06:00
Drew T ec786e0a46 feat(phase-31): S79 #9 (2) — main: func_80015608 (86 ins) banked: a Sonnet agent closed the permuter's last instruction by routing the accumulator add through a fresh temp ({ s32 xt = blockSize + x0; x0 = xt; } — expand_binop's target==op1 swap does not fire on a new pseudo); gate_main BYTE-IDENTICAL 143dbb89 2026-09-04 19:00:03 -06:00
Drew T 06ee3c1234 feat(phase-31): S79 #8 (1) — main: func_80015760 (106 ins) banked from a permuter ILS score-0 winner (cycle 1) + plumbing: TU data spelling (u8 *D_800A5E60), the callee's TU prototype with a (u16) call-site cast for the target's andi, the permuter's typedef preamble stripped; gate_main BYTE-IDENTICAL 143dbb89 — the S76 journal had filed it as a 'genuine sched1 artifact' 2026-09-04 18:42:41 -06:00
Drew T 7129b6cac8 chore(phase-31): S79 #8 plumbing — main src/800.c: func_80015760's forward decl no-protoed + its 2 call sites cast (cast_self_callers --sync-decls); byte-neutral (143dbb89) 2026-09-04 18:39:40 -06:00
Drew T a85733a487 feat(phase-31): S78 #3 — 13 "game code" subsegs were PsyQ objects: wired LINKED (libgte 70/30, libgs 33/7, snd 62/11); main's game-code metric corrected to 91.8%
- exact tiles, 0 tokens: libgte23-26 (MSC01/02/05/09, SMP_00, FGO_01-06, PATCHGTE), libgte9 re-derived
  as SMP_05 NormalClip (SMP_06 NormalClipS = nested sub-pattern; psyq_integrate now drops nested
  placements), libgte27-30 (the libgs-gap MTX_05/07/11, REG03+REG11), libgs7 (2D_BG0+2D_BG1), snd10
  (VM_NO1), snd11 (VM_NOWON carved off sgap_8). LINKED 959->1040, REAL 912->886 (SDK inline-asm wrappers
  re-provenanced), VERBATIM 146->85, 13 TUs deleted; splat re-emits the stub records.
- main 143dbb89 WITH and WITHOUT the SDK objects. The no-SDK fallback had been red since S7x
  (CdReadyCallback called by its SDK name while the libcd stub carried func_800435B4) — curated
  CdReadyCallback = 0x800435B4, refs unified. R22 clean fleet 213/213; tools-health OK.
- METRIC CORRECTION (R35): progress.py's "MAIN game-code weighted" sig never excluded the LINKED
  objects (its comment said it did) — ~31k linked-SDK ins sat in the denominator as unmatched game
  code. Exclusion now derived LIVE from the Makefile stub lists + yaml ranges: 91.8% (44,562/48,537),
  not 59.8%; the 3,975-ins remainder equals the open-stub sum exactly.
- VM_F.o probed SPLITTABLE at .bss 0x50c (SYS.o's class -> task #4). cookbook §488; worklist S78 #3;
  decision-log + accelerators; SETUP rows.
2026-09-04 16:26:12 -06:00
Drew T a7394f44dc feat(phase-31): S78 #12 — the 800c3 "wall" band is LIBPAD 4.2.1 + LIBAPI 4.2: 46 names applied; integrate wired by subseg range; renames via ApplySymbols
- provenance: the psx loader's per-version PsyQ signature sets place PADENTRY/PADCMD/PADPORTD/
  PADSEQD (4.2), WAITRC2 (4.3), COUNTER/C114/FIRST/PAD/PATCH/CHCLRPAD (libapi 4.2) byte-exact in
  0x8005CE48-0x8005FC68 / 800c2 -> 12 of main's 29 stubs incl. all four §332 walls are Sony's
  DualShock library in reorder mode. 46 names -> symbols.us.txt (count 1081), band TUs, verbatim
  manifest, wave_exclude; firstfile/firstfile2 (4.2 naming); CdGetToc @0x800430B8 (was the Phase-21
  xdedup mislabel DecDCToutCallback). SETUP §5.1 corrected; psyq-worklist S78; cookbook §487;
  decision-log + accelerators S78; CHECKSUMS +Psy-Q_46.zip +PSYQ_SDevTC_v4.5.zip.
- psyq_integrate: --yaml maps stub<->objects by SUBSEG RANGE with an exact-tiling check and PRINTS
  the located-but-unwired residue (libgte: 13 objs / 1,264 ins) — main's LINKED build had been RED
  at HEAD since the S77 psyq_identify fix (22 libgte blocks merged to 3; gate worktrees take the
  stub fallback so it never showed); a library object's exported symbol whose recovered address the
  curated file names differently is --redefine-sym'd (R15; A66 firstfile->firstfile2).
- Ghidra: 47 MCP renames did NOT persist through the sentinel stop (R9 caught it) -> NEW
  tools/ghidra_scripts/ApplySymbols.java + tools/ghidra_apply_symbols.sh mirror the curated file
  headless with a real save: 73 renamed, R9-verified x4. SETUP inventory rows (R21).
- lint_symbol_refs: scans verbatim __asm__ bodies (`.ent\tfunc_X` is invisible to \b and to the
  string-masked scan); negative-controlled (red on the pre-fix TUs, green on the passing tree).
- R22: clean extract-all 212/212 + check-all green on the final config; main rebuilt byte-identical
  143dbb89 after the last src-only fix -> 213/213; tools-health OK.
2026-09-04 15:57:06 -06:00
Drew T 335e1d677d feat(decomp): bank main:func_8001EA14 (371 ins) from close=89
Five new levers, all in the draft header. The headline one (L5): STATEMENT
ORDER IS THE ALIAS ORDER — a mem/s local matrix store can never be hoisted over
by a mem/s varying p-> load, because true_dependence's exemption needs one side
non-struct AND non-varying. Writing the matrix init in NATURAL OFFSET ORDER
closed the whole 45-instruction init block, and the same law one scope down
removed the +1 length drift.

Also: an inline-asm "r" operand that is a bare symbol_ref has NO pseudo and is
allocated by reload ($t0); assigning it to a local first makes it a pseudo and
local-alloc gives $v0 — worth 10 instructions.

A scripted 858-candidate sweep PROVED mode/rot/shift placement inert, which is
what redirected the hunt from LUID to DAG/allocation.

gate_main: BANKED 1, 143dbb89f34491258bbc27810d0a12ec8b43a8dd BYTE-IDENTICAL.
2026-09-03 20:43:01 -06:00
Drew T 1f2ae12b5d feat(decomp): bank main:func_8001FC08 (400 ins) and func_8002FF0C (166 ins)
Both bodies were already solved in S76 and had never banked. Neither needed a
codegen change — they needed the gate to stop applying a rule cc1 does not
(§481 / the _depth0 fix): func_8001FC08 renames its struct to MTX_8001FC08 and
declares D_80074818/D_80075018 at block scope, and func_8002FF0C shadows
D_800A46D2 with a block-scope scalar because the array spelling forces la and
costs 12 mismatches.

gate_main: BANKED, 143dbb89f34491258bbc27810d0a12ec8b43a8dd BYTE-IDENTICAL.
2026-09-03 20:21:22 -06:00
Drew T 337a040047 feat(decomp): bank main:func_80024054 via permuter ILS (DELAY-SLOT/2, 4 of 91)
Score 0 on cycle 1. gate_main: BANKED 1, 143dbb89f34491258bbc27810d0a12ec8b43a8dd BYTE-IDENTICAL.
2026-09-03 19:39:54 -06:00
Drew T 94b528b54e feat(decomp): bank main:func_80021174 via permuter ILS (SCHEDULE-REORDER/2)
The residual was a two-instruction adjacent swap in the target's favour:

    idx 49  MINE lh   $a1, 0($sp)      TARGET sra $a2, $v1, 16
    idx 50  MINE sra  $a2, $v1, 16     TARGET lh  $a1, 0($sp)

Hand lever tried first and REFUTED by bytes: hoisting `a0 = a0 >> 16` above
the load is semantics-preserving (a0 is untouched in between) but scores
23 mismatched at 67/68 ins — it lets gcc fold an instruction away entirely.

permuter_ils --klass SCHEDULE reached score 0 on cycle 1. Its winning edit is
a clean C-level one: drop the `a1 = *(s16 *)sp;` temporary and inline the load
into both comparisons, which is what moves the sign-extend ahead of it.

gate_main: BANKED 1, 143dbb89f34491258bbc27810d0a12ec8b43a8dd BYTE-IDENTICAL.
2026-09-03 19:28:06 -06:00
Drew T ef0cb64c14 plumb(main): undo-journal the plumbing for the 3 drafts that did not bank
`cast_self_callers --undo-journal .run/S77_selfcast.json --keep
func_80013154,func_8005EAC8,func_8005E3AC,func_8005E79C` — reverted 6 edits
across 2 files, kept the 4 that banked.

The three reverted are func_80015608, func_80015760 and func_80039DEC, all
proven NEARs (closeness 3, closeness 9, and 8 differing bytes at 0x80039ded
respectively) — body residuals for the DIFF lane, not plumbing. Their §378
chain is one command to regenerate when a corrected body arrives.

main rebuilds 143dbb89f34491258bbc27810d0a12ec8b43a8dd after the revert.
2026-09-03 18:58:06 -06:00
Drew T a9980bdd8c feat(decomp): bank func_80013154 and func_8005EAC8 in main (§378 self-decl chain)
The first two banks off the `self_decl_tu` class: the TU declared the very
function the draft defines, with a different signature, so the draft could not
compile no matter how correct its body was.

  func_80013154  src/800.c    tu s32 (s32,s32,s32)  | def s32 (s16,s16,s16)
  func_8005EAC8  src/800c3.c  tu void (void)        | def void (void*)

func_80013154 was a §265 VERBATIM-ASM bank — it is now real decompiled C.

gate_main: 3-draft slate, bisected in 5 rebuilds, 2 banked,
143dbb89f34491258bbc27810d0a12ec8b43a8dd BYTE-IDENTICAL.

progress.py main: REAL 895 -> 897, INCLUDE_ASM stubs 46 -> 44.

Rejected by the byte gate, correctly, and handed to the DIFF lane:
  func_80039DEC  8 differing bytes at 0x80039ded  (a NEAR, not a plumbing miss)
  func_80015608  sync_tu_decls refused up front: NEAR at closeness 3
2026-09-03 18:53:15 -06:00
Drew T cb1b6fc9fb plumb(main): §378 self-caller casts + decl sync for 7 self_decl_tu drafts
`blocker_probe --binary main` over the 36 stranded S76 drafts classifies 7
whose blocker is `self_decl_tu` — the TU declares the very function the draft
defines, with a different signature:

    func_80013154 src/800.c    tu s32 (s32,s32,s32)   | def s32 (s16,s16,s16)
    func_80015608 src/800.c    tu void (s32,s32)      | def void (void*,u32*)
    func_80015760 src/800.c    tu void (s32,s32)      | def void (Obj*,s32*)
    func_80039DEC src/800_c.c  tu void (void*,s16,u8) | def void (void*,s16,s16)
    func_8005E3AC src/800c3.c  tu void ()             | def s32 (Ctx*,s32)
    func_8005E79C src/800c3.c  tu void ()             | def s32 (void*,void*)
    func_8005EAC8 src/800c3.c  tu void (void)         | def void (void*)

14 edits: each call site cast to a no-proto function pointer (§20 — gcc-2.7.2
folds the cast of a known function symbol back to a direct `jal`, so the
caller's bytes do not move), then the forward declaration synced.

Verified byte-neutral BEFORE any draft is substituted: main builds
143dbb89f34491258bbc27810d0a12ec8b43a8dd with these edits alone.

Committed ahead of the gate because gate_main `git checkout`s main's TUs
before substituting and would otherwise destroy these edits. Journal at
.run/S77_selfcast.json — `--undo-journal --keep <banked>` follows the gate.
2026-09-03 18:49:56 -06:00