Commit Graph

114 Commits

Author SHA1 Message Date
Drew T 3a67dd609f feat(phase-26): func_8017BEBC (952 ins, ×113) CLOSED + banked ×1 — the §47 live-length slider
The largest unmatched core in the game, walled at close=2 for the permuter (25 min, no close) and
queued for a gdb-on-cc1 read. Closed WITHOUT gdb — the RTL dumps were the oracle:

- THE TIE, byte-measured (.lreg): &g.sz1 pseudo 228 refs 13 / live_length 783; &g.sz2 pseudo 230
  refs 13 / 782 -> pri = int(390000/L) = 498 == 498, an exact int-truncation tie in global.c:594
  allocno_compare. Tie-break = creation order -> allocation follows emission; the target needs them
  to DIFFER (allocation sz2-first, emission sz1-first). The shipped operand-permutation workaround
  could only pick one (close=2 vs close=10).
- THE FIX (§47): restore NATURAL operand order (emission correct) + ONE zero-byte
  `__asm__ volatile ("")` placed BETWEEN two existing GTE volatile asms (no new cse/sched barrier —
  one is already there) -> +1 static insn at global-alloc time -> L 784/783 -> pri 497 vs 498 ->
  the tie SPLITS toward the shorter-lived (later-created) pseudo, which is ALWAYS the direction
  "allocation != creation" requires. All 10 grants cascade; MATCH 952/952 first try; the slider
  emits only #APP/#NO_APP (zero bytes). PIN-FREE, ×113 template-safe.
- BANKED ×1 in ov_SC01_000 through the WHOLE-BINARY gate (jr fn — match_one is not the arbiter,
  §8a): lazy isolation -> new region ov_SC01_000_jr_8017BEBC + 9-piece jtbl interleave -> splice ->
  BYTE-IDENTICAL. One TU-visible decl reconcile en route (D_800B9A02: declare the TU's `short`,
  force the unsigned halfword at use `(*(u16*)&D_800B9A02)` — §8d sub-class (b)).
- R22 clean-fleet 136/136 BYTE-IDENTICAL; 0 NON_MATCHING (G4). The ×113 sibling sweep is IMM-class
  (scattered addresses) -> Task-8 mechanical work via the imm engine.
- cookbook §47 (the slider method + the placement rule + the direction law); decision-log (R31).
2026-07-13 22:02:46 -06:00
Drew T 7b970653ff docs(phase-26): cookbook §46 — func_80178D40 MATCH (890 ins ×134): four loop-structure levers
The heaviest core in the game (890 ins, reach 134 = 477 KB) closed from close=39 to MATCH 890/890,
PIN-FREE, by cheap-Opus reading loop.c/jump.c/cse.c. All 39 residuals were in ONE case body and every
one was STRUCTURAL — the permuter could not have reached any of them. Four new general levers:

- L1 PEEL: a loop's `break` must not land on the loop's own fall-through label — that leaves
  NOTE_INSN_LOOP_BEG + an unconditional jump, firing duplicate_loop_exit_test (jump.c:2131), which
  rotates the loop and peels iteration 1 (const-folding `i++` and dragging an extra address
  re-materialization block). Write `goto <label>;` — same destination, different construct.
- L2 SURVIVING COPY: a source-level `fp = q;` ALWAYS dies (cse canon_reg + qty_first_reg, then flow).
  To make it survive, split def and uses across extended basic blocks — cse resets its hash table at a
  label with >1 predecessor. Test the memory, assign inside the guard branch.
- L3 MERGED STORE: write the store INSIDE the branch that reaches the shared tail, so jump2 tail-merges
  it and reorg steals the `li` into the delay slot. An unconditional store before the `if` blocks it.
- L4 UN-COALESCED LOOP COPY = a non-replaceable giv, needing all three of: an index giv `&A[i]`; a use
  OUTSIDE the loop (record_giv, loop.c:4437 -> emit_insn_after at loop.c:3945); and the biv increment
  LAST, so the reduced giv's addiu lands in the loop-back delay slot (i++ at the top costs +1 insn).
- L5 KEEP TAILS APART: two structurally identical loops must differ in a REGISTER or cross_jump merges
  their tails — give each its own pointer pseudo. (§8's cross-jump lever, inverted.)

Confirms the tier doctrine: cheap-Opus applying the documented §31 map cracked the game's heaviest core;
Fable5 was not needed. R17 held — "wrong BYTES" -> read the real gcc-2.7.2 passes.
2026-07-13 21:16:36 -06:00
Drew T cc6220eba4 fix(phase-26): extract_unit mistook m2c declarations for definitions (15 phantom exemplars)
- BUG: the guard `not ln.rstrip().endswith(";")` misses m2c's declaration form
  `M2C_UNK func_80178D40(s32, s32);   /* extern */` — the raw line ends in `*/`, not `;`, so a
  DECLARATION was accepted as a DEFINITION and the forward brace-scan swallowed the NEXT
  function's body, handing remap_hseq a garbage unit.

- BLAST RADIUS (measured): 15 of 35 substantial-family exemplars were phantom "matches" — all
  still INCLUDE_ASM stubs (incl. func_80178D40 and the carried-queue func_801670E4); 3 more
  anchored on the Phase-17 canonical-sig layer's `extern … /* match-first, arity N */` decls and
  templated garbage, leaving those families SILENTLY UNBANKABLE. The whole-binary byte-gate
  rejected every one — no wrong match was ever banked (G3/P9 held) — but the engine burned a
  build per sibling and every extract_unit-based readiness analysis was wrong.

- FIX: strip trailing comments before the `;` test.

- REGRESSION-GATED over the whole corpus (6,286 family exemplars, .run/_eu_before.json):
  15 phantom exemplars now correctly refused; 3 garbage units corrected to the REAL definition
  (found in the right region file); 0 real definitions lost; 0 unit contents otherwise changed.
  src/ and config/ untouched, so the committed build is unaffected.

- cookbook §40: the trap + the general lesson — this is the phase's FOURTH silent-skip bug
  (find_site braces, overlay_files splits, reconcile_decls fn-ptr regex, now this). A tool that
  silently no-ops on input it cannot parse is indistinguishable from one that had nothing to do.
2026-07-13 20:53:23 -06:00
Drew T 1ab9905368 feat(phase-26): §8d scope_data_externs — the ×133 sweep blocker fixed; func_8015AE2C banked ×134
- ROOT CAUSE (R14 — the session-7 diagnosis was half right): the isolated region builds [ OK ]
  WITHOUT the body, so §8b isolation was never implicated. `family_remap.gather_externs` prepends
  carried decls at FILE scope; D_801812A4 is a fn-ptr dispatch table the sibling declares FOUR
  incompatible ways at BLOCK scope inside its own later functions, so the carried file-scope decl
  ESTABLISHES A GLOBAL THE TU NEVER HAD and every later block-scope extern must now agree with it.
  Byte-proven asymmetry: BLOCK(int)->BLOCK(struct*)->FILE(void*) builds; FILE(void*)->BLOCK(int)
  errors. It was the ONLY hard error in the build — all 27 carried function externs were fine raw.

- THE FIX (demote, don't reconcile): tools/scope_data_externs.py emits a carried D_ extern at BLOCK
  scope inside the function body when the TU has no file-scope decl of it above the insertion point.
  Byte-neutral (an extern emits no code; type + access opcodes unchanged) and never worse than raw,
  so it needs no oracle, no type comparator, no fn-ptr parser. Restores fidelity — the original
  declares these symbols at block scope in exactly this way. Wired into jtbl_family_bank as the
  `scoped` stage: raw -> scoped -> recovered -> reconciled (scoped is the base for the later stages).

- reconcile_decls is the WRONG instrument for this class, twice: its oracle answers "what does the
  FLEET call this symbol" when the question is "what can THIS TU see", and its DATA_DECL_LINE_RE
  cannot parse `extern void (*D_x[])(void *);` — silently skipping the very symbols that were
  failing (the phase's third silent-skip bug, after find_site braces + overlay_files splits).

- R17 TRIAGE RULE, first real test, held: `conflicting types` = the compiler REFUSED TO COMPILE =
  a C front-end diagnostic = our Python. Reading cse.c/global.c would have taught nothing.

- RESULT: func_8015AE2C (562 ins, reach 134) swept 133/133 siblings, 0 failures. R22 clean-fleet
  136/136 BYTE-IDENTICAL (534 changed src files); dedup-check 1813 validated / 0 failed; 0
  NON_MATCHING (G4). instr-weighted 63.0 -> 63.6%; distinct-code 39.1 -> 40.5% (+256 unique fns /
  +79,957 ins) — one core, ~0 agent tokens.

- knowledge captured during the producing session (R30/R31/R21): cookbook §8d, decision-log
  2026-07-13 session 8, SETUP tool-inventory row; CURRENT_PHASE session-8 checkpoint.
2026-07-13 20:45:15 -06:00
Drew T 12631df74a docs(phase-26): R17 triage rule — 'wrong bytes' -> read gcc; 'won't compile' -> read our Python
Drew asked whether the x133 sweep blocker warrants a gcc-2.7.2 source read. It does not,
and the distinction is worth pinning down because it routes every future residual:

- The sweep blocker is a C FRONT-END diagnostic (conflicting types: two incompatible
  file-scope decls of one identifier in one TU). gcc is correctly rejecting plain C89.
  The bug is in reconcile_decls (fleet-majority oracle vs the TU's visible decl).
  Reading cse.c/loop.c/global.c would tell you nothing.
- func_8017BEBC (close=2) is the opposite: it compiles fine and emits the wrong bytes, and
  the cause is localized to global.c's allocno-priority tie. THAT is the R17/§45-B target
  (gdb-on-cc1 read of allocno_live_length) — 2 instructions from a 107K-ins bank.

Rule: 'wrong BYTES' -> read the compiler (R17). 'won't COMPILE' -> read our Python.
cookbook §31-triage + the CURRENT_PHASE NEXT block annotated with the routing.
2026-07-13 19:50:51 -06:00
Drew T 754ac3428f fix(phase-26): permuter silently no-op'd on every GTE draft (+ --asm-subdir)
Second silent no-op of the §G class, found while permuting func_8017BEBC (close=2):

- hide_asm() is built for __asm__ STATEMENTS and `register __asm__("$sN")` pins inside a
  function body (it scans back to the previous ;{} and forward to the next top-level ;).
  A draft whose GTE ops are #defines CONTAINING __asm__ (the PsyQ inline_c.h convention,
  i.e. most renderer code) therefore had its macro DEFINITIONS chewed up, swallowing the
  function itself -> pycparser 'Function <fn> not found in base.c' -> decomp-permuter
  no-op'd in 0s. base.c contained ZERO occurrences of the target function.
  FIX: cpp_expand_macros() pre-expands with `cpp -P` so each GTE op becomes an inline
  __asm__ statement hide_asm can carry via the b64 pragma. Applied ONLY when a
  '#define ... __asm__' is present -> macro-free drafts byte-untouched.
- p16_permute was hardcoded to OV=ov_SC01_077's MAIN object, so no core in another overlay
  or split object could be permuted at all. Added --asm-subdir (threaded explicitly: a
  def-time default arg cannot see a mutated global).

LESSON (cookbook): permuter 'no match (0s)' is a TOOLING failure signature, never a real
search result. Verify workers actually ran.

Verified: base.c now holds the function; 16 workers searching on func_8017BEBC.
2026-07-13 16:50:38 -06:00
Drew T b0691f4bd9 fix(phase-26): jtbl_carve trims trailing .align pad words (§8a-pad)
A trailing `.word 0x00000000` under a jtbl dlabel is the ORIGINAL TU's intra-rdata
.align 3 padding, NOT a table entry (0x00000000 is not a jump target). The true entry
count is the fn's `sltiu <n>` bound: func_8015AE2C has sltiu 0x7 = 7 entries yet its
raw dlabel spans 8 words.

maspsx drops all .align, so a C-emitted jump table can never reproduce the pad. Carving
to the next dlabel would reserve 8 words while the compiled object supplies 7 ->
.rodata under-fills by 4 B -> every later symbol shifts +4 (the same image-corruption
class as §41d). jtbl_range now trims trailing zero words, leaving the pad in the raw
post-carve data piece.

Retroactively explains the §8a func_80159C84 '5 words vs the real 6' false-MATCH.
Existing carves are parsed from CONFIG, not re-derived, so committed banks are
unaffected (verified: the 3 carved jtbls are absent from the raw data asm). The build
never invokes jtbl_carve, so the fleet is inert to this change until the next bank.

Found by the Fable5 crack of func_8015AE2C (562 ins x134, MATCH, pin-free).
2026-07-13 15:23:59 -06:00
Drew T e79d030499 feat(phase-26): func_80182268 banked via the LAZY isolation path + the void->s32 gate-cap fix
End-to-end proof of the §8b lazy bank composition on a real cracked jr core:
lazy isolate -> jtbl_carve into the isolated subseg -> C body -> whole-binary gate
-> d19c9580 BYTE-IDENTICAL; R22 clean-fleet 136/136.

- func_80182268 (31-ins jr, ov_SC01_077_after) MATCHED first try: shared-tail
  fallthrough (jtbl cases 3+7 enter case 4's tail) + the u16-shift sign-extend idiom
  ((s8)(*(u16*)(p+0x70) >> 8) -> lhu/sll16/sra24). Carve collided with the committed
  func_801734BC carve -> lazy isolation fired exactly as designed.
- R14 FINDING (cookbook §41d): the Phase-17 canonical convention "void->s32 return is
  byte-neutral (§3a-1)" is FALSE for a void body with no `return` — it costs ONE extra
  instruction. canon_sig_reconcile applies it unconditionally, so it turned a perfect
  31-ins MATCH into 32 ins. That extra word made the isolated object's .text 4 B long,
  shifting EVERY data symbol +4 -> ~271k differing bytes, image +5 B. match_one said
  MATCH; only the whole-binary gate caught it (G3/P9).
- FIX (generalizes the §19 sig_unify lesson): every recovery pass is a FALLBACK, never
  unconditional. jtbl_family_bank now gates RAW first, reconciled only on failure.
- 136/136 byte-identical from a clean tree (R22); 0 NON_MATCHING (G4).
2026-07-13 14:34:04 -06:00
Drew T 38ac5659aa feat(phase-26): §8b scoping wall BROKEN — decl-environment reconstruction + lazy per-core isolation
The full 54-jr isolate-all on ov_SC01_077 now builds d19c9580 BYTE-IDENTICAL
(R22 clean-fleet 136/136) — the configuration session 5 could not build. The
heavy-jr harvest (191 cores / 5.53M templatable ins) is unblocked.

- R14 CORRECTION: session-5's "gcc-2.7.2 block-scope-extern TU-persistence" root
  cause was WRONG. There is no gcc quirk — DEFINE_func_* macros expand at FILE
  scope, so their leading externs are genuine file-scope decls that merely live in
  engine_core.h, invisible to any col-0 .c scan (1377 macros / 3929 lines / 1462 syms).
- REJECTED the approved "global symbol->type map + shadow set" design: the engine is
  loosely typed (func_80173544 is DEFINED `s32 f(void*)` yet declared `extern void
  f(void);` inside func_801734BC's body), so declaring every USED symbol hoists that
  block-scope shadow to file scope and CREATES the conflict a shadow-set then dodges.
  Instead reconstruct the original TU's file-scope decl environment and carry it
  strictly FORWARD — conflict-free by construction (every carried decl already
  coexisted with every definition in the one original TU; compatibility is
  order-symmetric; shadows stay in bodies and travel with their item).
- The byte-gate found two MORE lost decl sources, not predicted: (a) a definition is
  itself a declaration for everything below it in its TU (func_8012B2CC undeclared);
  (b) file-local typedefs used by a carried prototype (parse error, Vec3s). K&R defs
  must render `extern T f();` (unprototyped), never f(void).
- LAZY per-core isolation wired into jtbl_family_bank (Drew's call — upfront-x134 =
  ~7,200 region files): jtbl_carve NON-CONTIGUOUS fail-loud -> jr_isolate_all --only
  <core> -> re-extract -> re-carve. Proven on func_80178D40 (890x134, heaviest core):
  carve blocked -> isolated (byte-neutral d19c9580) -> carve in its own subseg.
- TWO LATENT BUGS fixed (both would have corrupted the heavy sweeps):
  * jtbl_carve.func_subseg derived the owning subseg from the ASM TREE, which `make
    extract` never prunes -> after an isolation it returned the STALE owner and
    silently re-created the very collision the isolation removed. Now config-derived.
  * jtbl_family_bank/jtbl_carve revert() DELETED the shared overlays.mk carve var
    unconditionally -> would destroy a COMMITTED carve (all 134 overlays have one) on
    any failed sibling. Now restored to its committed value; only region files created
    by this attempt are removed; dirty-tree preflight refuses to start a sweep.
- docs: cookbook §8b RESOLVED + new §8c "splitting a TU means rebuilding its
  DECLARATION ENVIRONMENT, not moving text"; decision-log 2026-07-13 (R30/R31).
- parser selftest 404/404; R22 clean-fleet 136/136; 0 NON_MATCHING (G4).
2026-07-13 13:25:39 -06:00
Drew T d1dd29d815 feat(phase-26): §8b multi-jtbl same-subseg — contiguous MERGE (built) + isolation scaffold
Session-4 same-subseg handling (the de-risk preamble's harder half; byte-proof of
the merged build + isolation deferred to Stage 2 with concrete cores):

- jtbl_carve.py: MERGE adjacent same-subseg carves into one spanning .rodata piece
  (a code object emits its jtbls contiguous, so two matched jr-fns in one subseg are
  byte-correct iff their jtbls abut). BOUND-FIX: a new jtbl's end is bounded by the
  next raw dlabel OR the next existing carve start (an already-carved adjacent jtbl
  is gone from the data asm -> raw dlabels over-extend it -> false "non-contiguous").
  Config-proven (func_80171B4C 801D8C48 merges with func_801734BC 801D8C68). NO-OP
  for family-1/cross-subseg (single carve per subseg) -> committed configs unaffected.
- jr_isolate.py (scaffold, NOT yet functional): the non-contiguous case — split a fn
  into its own code subseg (whale _o0b precedent) so its jtbl carves independently.
  BLOCKED on split_src_region, which can't partition the overlay .c (global canonical-
  sig extern layer + per-fn callee-externs + DEFINE_func macros + @class annotations,
  ~922 non-address items). Stage-2 build item (overlay-.c-aware source split).
- cookbook §8b (the --order sandwich + the two same-subseg cases + the blocker);
  CURRENT_PHASE session-4 checkpoint updated with the Stage-2 unblock decision.
2026-07-12 22:06:17 -06:00
Drew T 095a611e75 feat(phase-26): §8 jtbl-rodata tooling — overlay PoC proven (func_8012ACE0, R22 136/136)
- overlay jr-functions can now bank as C: gcc switch jump tables form a .rodata island at
  the overlay TAIL; carve a matched fn's jtbl into a dotted [.rodata, <code-subseg>] subseg
  + ld_interleave (data->rodata->data sandwich) places it byte-exact. cookbook §8a + SETUP.
- tools/ld_interleave.py: --section .<binary> param (derives the <binary>_TEXT/DATA/RODATA/
  DATA2/BSS symbol prefix); default .main = the EXE, byte-identical (backward-compat proven)
- Makefile + config/overlays.mk: <bin>_JTBL_INTERLEAVE hook + a $(strip)-guarded extract
  branch (gotcha caught: a trailing #comment on the := left whitespace -> non-empty -> the
  branch misfired on resident with the EXE defaults)
- PoC: func_8012ACE0 (25-ins jr-fn in ov_SC01_077) reconciled (canon_sig_reconcile) + banked
  BYTE-IDENTICAL d19c9580 -- the first overlay jr-function matched through the C pipeline
- R22 FULL-FLEET clean rebuild: 136 passed, 0 failed (main 143dbb89 unaffected by the
  ld_interleave change); 0 NON_MATCHING in any default build (G4)
- P9 findings: func_80159C84/func_8015444C (the 2 carried Fable5 jr bodies) are rtu_match
  FALSE-matches (incomplete jtbls: 52B vs 56B -> never bank); the maspsx "hang" scare was a
  truncated experimental-file artifact (real pipeline builds in ~1s)
- metrics: distinct-code 39.1% (50,572 unique fns), instr-weighted 62.9%
- NEXT: the ×134 automation (generate the per-overlay carve + template the reconciled body)
2026-07-12 16:37:37 -06:00
Drew T 7ccf48f2f4 feat(phase-26): Task-8 reconcile wiring (§41c h_seq) + 463 reconcile-class banks
- BUILT the per-sibling reconcile: family_remap.remap_hseq_body (h_seq-remap a RAW crack draft: symbol +
  immediate + cross-address self-rename) + family_sweep.reconcile_remap_hseq + --reconcile-raw. Per sibling,
  remap the RAW crack then canon_sig_reconcile against that sibling's own TU (the h_seq port of the h_norm
  M2 path) — because a reconciled body is TU-specific and can't template plainly (validation: 0/4).
- HARVEST: the 4 triage isolation-cracks (func_80155800/80167540/801506A4/8016A73C) templated 463/0 x~133
  via --reconcile-raw (0 failures). Metrics: instr 58.5->58.9%, distinct 30.9->31.1%.
- each overlay SHA-gated by harvest_verify vs config/check.<ov>.sha (byte-identical = the match def, G3).
  FULL R22 clean-fleet DEFERRED until the concurrent Fable5 crack agents release asm/ (their m2c needs it);
  R22 fleet-confirm to follow post-window.
- cookbook §40c (the h_seq per-sibling reconcile technique, R30).
2026-07-12 00:03:47 -06:00
Drew T 462734edb2 feat(phase-26): task 3 — T2a immediate engine (Tier 1) + T2b cross-address, 0-DIFF verified
- family_remap: imm_value (signed/unsigned field-aware) + imm_map_tier1 (diff-driven literal swap:
  asm-side ambiguity guard defers values that also appear at a non-differing position; C-literal
  swap preserves sign + hex-case) + remap_hseq (symbol remap + imm subst + cross-address self-rename
  in one pass; refuses STRUCT/unresolved members -> caller skips, byte-gate would reject anyway).
- Tier 2 (targeted probe) intentionally DEFERRED — build-if-needed per Task-5 measurement; only ~8
  low-weight IMM families, and the whole-binary byte-gate arbitrates (plan: simpler where gate arbitrates).
- VERIFIED (.run/v3_imm.py, match_one reloc-masked so immediates are checked exactly): 0 DIFF on every
  compilable derived draft — 3 IMM + 2 PURE cross-address MATCH; 4 remap-fails were correctly-deferred
  asm-ambiguous values (not wrong output); 45 compile-fail are match_one isolation limits -> whole-TU
  gate in Task 5. Cookbook §40b imm-engine forward-ref fixed.
2026-07-11 21:14:09 -06:00
Drew T 5b7e366648 feat(phase-26): task 1 — extended reloc tracker (addu-hi) + single-pass remap; V0/V1 green
- reloc_targets: propagate lui-hi through add/addu index arithmetic (gcc-2.7.2 indexed-global
  idiom lui;addu $idx;lw %lo($at)). The pre-26 tracker dropped it -> D[i] functions mis-normalized
  per overlay (inflated the 'h_norm reach-1 tail') AND lost their indexed D_ symbols in remap.
  norm_stream/h_norm deliberately UNTOUCHED (fleet metrics + proven sweep depend on it).
- remap/symbol_map: backward-compatible to_addr=None (cross-address T2b sibling + self-rename) +
  imm_map hook (T2a); sequential re.sub -> single-pass simultaneous substitution (fixes latent
  chained-rename/value-permutation corruption). All 5 family_sweep call sites unchanged.
- V0 (.run/v0_reloc.py): func_80141100 22/22 NEW==OLD (zero regression); func_801407F4 15/15 vs
  splat .s (pre-fix 10), recovers indexed D_80187B88/90/B0; cross-addr symbol_map clean.
- V1 (.run/v1_regression.py): 160 real h_norm sibling pairs, 96 SAME, 0 lost — differences are
  strict indexed-reloc improvements only.
- docs: cookbook §40b (the technique, R30) + decision-log 2026-07-11 (the strategic why, R31).
2026-07-11 20:57:28 -06:00
Drew T 8270e7692e feat(phase-25): task A giant #2 — flagship func_80133CD4 (399 ins) cracked ×134 via Fable5 §45; 3 flywheel giants Fable5-seeded
- FLAGSHIP func_80133CD4 (399 ins) CRACKED ×134 (Fable5 gdb-on-cc1 §34): whole-binary byte-gate
  BYTE-IDENTICAL (d19c9580); family_sweep 133/133 siblings, 0 failed; PIN-FREE (×134-clean).
  Retires the ~22-phase 'unsteerable whole-function register permutation'. Fleet instr-weighted
  57.7->58.2%, distinct-code 29.3->30.3% (+1.0% distinct from one giant).
- cookbook §45: merged-accumulator-variables permutation-breaker (K8 no-coalescing -> one reused
  C var) + 1-death local-alloc in-out-asm (flow.c:2511) + offset-0 /s + goto-shared-return.
- FLYWHEEL (3 cheap-Opus, §45 + the map): all 3 walled -> Fable5, each a pin-free ×134-safe seed
  + gdb-oracle spec (func_8014D820 LCS226, func_8016CBC0 c=153, func_801670E4 c=23). Downgraded
  §44-Lever-5 'i=0/p-hoist' (42->0, R14); merge-lever mirror split-law + input-anchor dial.
- R22 clean-fleet 136/136 byte-identical; 0 NON_MATCHING (G4).
2026-07-11 15:09:40 -06:00
Drew T 89162fd6b8 feat(phase-25): task A giant batch 1 — 2 more giants ×134 (func_80135480, func_80163EC8) + §44 levers; 4 Fable5 seeds
- cheap-Opus batch over the 6 frontier giants: 3 banked ×134 this session (func_80166994 §43
  committed earlier; + func_80135480 258-ins block-scoped-pointer-split; func_80163EC8 234-ins
  cross-jump-duplicated-tail, 1 benign $v0 pin). 266 siblings byte-identical, 0 failed
- R22 clean-fleet 136/136; instr-weighted 57.2->57.7%, distinct-code 28.2->29.3%, dedup 1813/0
- cookbook §44 — 5 reusable levers: §43-extension (K&R s16 also covers callee-stash sign-extend),
  pointer-var-decl (avoid &sym CSE-hoist), block-scoped-pointer-split, cross-jump-duplicated-tail
  (cracks a §31-D1/D2-"permuter-only" class), + the intrinsic-wall taxonomy (what cheap-Opus can't)
- R14: §43 does NOT universally transfer (only 1 of 6 giants was K&R-s16; each is its own class);
  giant #1's prior "MATCH" note was stale/false (verify vs bytes)
- 4 giants -> pin-free/structural Fable5+permuter SEEDS (func_80133CD4 flagship §37 allocno-tie,
  func_8014D820 RC-6 pin-free, func_801670E4 scheduling, func_8016CBC0 coalescing); escalation
  = permuter-first then Fable5 §34, queued in the CURRENT_PHASE resume block
- SESSION CHECKPOINT: phase 25 OPEN; fresh session resumes the giant-seed escalation round
2026-07-11 02:27:23 -06:00
Drew T c62fe7f7ea feat(phase-25): task A giant #1 — func_80166994 (369 ins) cracked ×134 via Fable5 + the K&R s16-param idiom (§43)
- Fable5 subagent cracked func_80166994 (trail/afterimage ring recorder, 369 ins) — FULLY
  STRUCTURAL, zero register pins -> swept ×134 CLEAN (exemplar + 133 siblings byte-identical).
  R22 clean-fleet 136/136; instr-weighted 56.8% -> 57.2%; distinct-code 27.3% -> 28.2%
- NEW IDIOM cookbook §43: a K&R s16-param DEFINITION dissolves the §17/§29 "narrow-param wall".
  On MIPS K&R promotes s16->int (ABI-identical to the canon-sig s32), body keeps the in-place
  sll aN,16 narrow/extend the (s16)cast form can't reproduce. void->s32 return-flip pair:
  split //@EDIT (self-fn, ov077-specific) + engine_core.h ec_edit ×5 (byte-neutral, callers discard)
- family_sweep --edit-remap: split-edits now OPTIONAL (apply where present, never skip; the
  whole-binary byte-gate is the sole arbiter, G3/P9) — a sibling lacking the ov077 canon-sig decl
  still banks via ec_edit + body. edit-absent tracked, not skipped
- R14: the prior wave's "@stuck: none — MATCH" note on func_80166994 was STALE/FALSE (re-ran DIFF
  366/369). Verify a MATCH claim vs the bytes, never a stale note
- structural cracks are the ×134-SAFE ones (contrast §42e pin-heavy families that cc1-SIGABRT in
  sibling TUs). Other 6 giants -> cheap-Opus applying §43+§31, Fable5 only on new-class evidence
2026-07-11 01:03:09 -06:00
Drew T 5fcb040dc3 feat(phase-25): task B — family_sweep --edit-remap; 2 array-decay families ×134 (+266 fns), 4 cc1-crash-walled
- family_sweep.py: new --edit-remap MANIFEST mode (§42e) — per family, symbol-remap the
  split-scope //@EDIT old||new per sibling + apply once-global engine_core.h ec_edits
  (byte-neutral), stage the family_remap body, gate via harvest_verify (the sole arbiter)
- BANKED 266/266 (0 failed): func_80136824 + func_80136334 (array-decay ptr-flip) ×133
  siblings each — full ×134. R22 clean-fleet 136/136, fleet 74.40% -> 74.48%, dedup 1813/0
- R14 FINDING (cookbook §42e addendum + decision-log): the other 4 byte-drift families
  (func_80133AB0 zero-reg pin, func_8016DF5C/8013D9B0 GTE-pin, func_80156044 trampoline)
  cc1-SIGABRT (Error 134) in the SIBLING TU — hand pins are ov077-TU-context-specific,
  NOT mechanically ×134-recoverable; backlogged as ×1/permuter fuel. rtu_match/match_one
  are blind here (neutralized/isolation compiles crash too); only make build is truth
- 0 NON_MATCHING in any default build (G4)
2026-07-11 00:03:39 -06:00
Drew T 0241772225 fix(phase-25): canon_sig_reconcile def-finder (\n -> (?:^|\n)) unblocks crack propagation; recover func_8014FE60 x134; fleet 74.36->74.40%, R22 136/136
- R14 CORRECTION of the prior "family_remap limitation" call: it was a MISDIAGNOSIS. family_remap
  succeeds on all droppers; the "remap-fail" family_sweep reports was a mislabeled canon_sig_reconcile
  throw ("no definition of func_X found in draft") — the def-finder regex required a leading \n, so a
  //@EDIT-stripped raw draft with the fn definition on line 1 was not found.
- FIX: def-finder regex \n -> (?:^|\n) (also match a def at draft start; strictly additive, low-risk).
- Recovered func_8014FE60 fully: 133/133 siblings banked (fix + engine_core.h DEFINE_func_8014FDF4
  extern void->s32 global flip, byte-neutral fleet-wide; caller discards return).
- Residual (the genuine, small --edit-remap): func_8016DF5C/80136334/8013D9B0/80156044 reconcile but
  byte-drift per sibling (out-of-body fixes: pointer //@EDIT, no-proto, return-flip not carried per sibling).
- cookbook §42e (the two-layer diagnosis + the forward ×134-leverage-realism rule); decision-log corrected.
- R22 clean-fleet 136/136 BYTE-IDENTICAL from a fully clean tree; NON_MATCHING 7 (0 in default build, G4).
2026-07-10 21:05:25 -06:00
Drew T 6c0887b097 feat(phase-25): crack fan-out over the frontier map — wave 4, 24/26 MATCH + 1330 swept; fleet 73.97->74.36% (+1350 fns), R22 136/136
- Frontier map (docs/phase25-frontier-map.md, committed commit:0506): rtu_match-measured all 42 draftable
  families -> 37 crack targets; endgame = 42 draftable + 235 matched-free + 2481 absent.
- Crack fan-out wf_b54b5d98-380 (26 tractable-band exemplars): 24/26 MATCH -> 20 banked byte-identical,
  incl. func_8014FBC0 (22 ins x1996 inline-asm trampoline), func_80132144 (27 x539), func_8016CF04
  (engine_core.h void->short flip). Swept x134: 1330 siblings / 931 failed (//@EDIT/trampoline/engine_core
  families -> --edit-remap backlog). Batch = 20 exemplars + 1330 = 1350 fns.
- 5 durable levers -> cookbook §42d: return-type flip BOTH ways (void<->s32/short); address-recompute-vs-cache
  (the unifying read-global rule); the full-inline-asm trampoline idiom + family_remap-inside-asm; memcpy->
  struct-assign at scale; phantom-frame induction.
- Deferred (backlog, map tiers): func_8016D1D8/80165240 (M-linkwall), func_80164E40 (sig-reconcile),
  func_801457A4 (-O0), func_8012E364/801549F8 (permuter).
- R22 clean-fleet 136/136 BYTE-IDENTICAL from a fully clean tree; NON_MATCHING 7 (0 in default build, G4).
2026-07-10 19:49:39 -06:00
Drew T 8fa29f2dda feat(phase-25): T7 F-band wave 3 part 2 — corrected rtu_match fan-out, 7/9 cracked + 266 swept; fleet 73.89->73.97%, R22 136/136
- NEW tools/rtu_match.py: real-TU-faithful, PARALLEL-SAFE per-fn match check. Compiles the WHOLE
  split TU (candidate spliced, INCLUDE_ASM neutralized via -DINCLUDE_ASM(a,b)= + -Isrc/<source>)
  in a per-fn temp dir -> no asm/, no shared overlay build. Closes match_one's isolation blind
  spot (in-TU decl/global-type/memcpy-builtin drift) so a MATCH HOLDS at the whole-binary gate.
- Corrected Ultracode fan-out (wf_80762f2c-822, 9 xHigh workers): 7/9 real-TU MATCH -> all 7
  banked byte-identical (individual + combined d19c9580), ZERO drift (vs wave-2's ~50% attrition).
  Banked: func_8012FCC4 func_80133AB0 func_80134A74 func_80136824 func_8014DD8C func_80168828
  func_8016C188. func_8012FCC4's "irreducible" delay-slot was a wrong-callee-arity bug.
- Swept x134: 266 siblings banked / 266 failed (the 2 //@EDIT families func_80133AB0/80136824
  can't per-sibling-reconcile via family_sweep -> backlog: a --edit-remap enhancement). Batch =
  7 exemplars + 266 = 273 fns.
- func_8014DD8C: engine_core.h DEFINE_func_8014D790 extern void->s32 flip (byte-neutral fleet-wide,
  caller discards return) -- R22-confirmed neutral across all 136.
- 7 durable levers -> cookbook §42c (callee-arity delay-slot, pointer-global *(T**)&, array-decay
  CSE, §17 zero-reg copy, void->s32, register-arg capture, free-floating load hoist). rtu_match -> SETUP §6.
- 2 DIFF -> permuter (func_801670E4 70->48, func_80185BA4 c=65), seeds .run/crack3/wave3/.
- R22 clean-fleet 136/136 BYTE-IDENTICAL from a fully clean tree; NON_MATCHING 7 (0 in default build, G4).
2026-07-10 17:23:20 -06:00
Drew T 69d1d37262 feat(phase-25): T7 F-band wave 3 — func_80164930 cracked + swept ×134 (read-global fix); fleet 73.85->73.89%, R22 136/136
- func_80164930 (81 ins) CRACKED + swept x134 = 134 fns (133/0 siblings, family_sweep --reconcile).
  The crack = the read-global fix: flip the file-scope decl s16->u16 (byte-neutral to the store-only
  caller func_801647A4) + reference the global directly, so the read lowers to direct-addressed `lhu`.
- TWO DURABLE FINDINGS (cookbook §42b):
  (1) THE STALE-OBJECT GATE TRAP: a piped `make build >/dev/null` that FAILS leaves a stale .o, and
      `asm-differ -o` then reports a phantom score-0. This invalidated wave-2's "iso-drift" labels --
      a rigorous re-check (rm .o + build exit-code + real whole-binary SHA) shows all 4 remaining
      iso-drift drafts NOCOMPILE (unreconciled callee externs vs the TU canonical-sig layer). Every
      gate MUST rm the split .o + check the exit code (compounds the §42a --out gotcha).
  (2) canon_sig_reconcile `*(T*)&D_sym` READ-global drift: &sym forces the address into a held register
      (kills direct %hi/%lo -> schedule drift); write-only globals unaffected. Fix = file-scope exact-type
      decl + direct ref (a block-scoped `extern u16` vs ambient s16 is a hard cc1 conflicting-types error).
- Frontier reassessed: the 9 remaining wave-3 targets each need real-TU reconcile-cracking (NOT gating the
  broken wave-2 drafts); each cracks -> ~134 fns (all x134 families). ~1,200 fleet potential.
- R22 clean-fleet 136/136 BYTE-IDENTICAL from a fully clean tree; NON_MATCHING 7 (0 in default build, G4).
2026-07-10 14:58:19 -06:00
Drew T b936dec411 docs(phase-25): T7 F-band wave 2 — 4 banked + 399 swept ×134 (fleet 73.73→73.85%, R22 136/136)
- Ultracode 14-worker wave 2 (§42 playbook): 9/14 iso-MATCH -> 4 banked, 5 real-TU drift, 5 near
- Banked: func_80133784 (203-ins 29-100 win), func_8017B614 (memcpy-fix held), func_8017EF50, func_80145CEC
- Swept ×134: 399 member-matches / 0 failed (auto-committed commit:0502)
- cookbook §42a: real-TU-verify rule (iso-MATCH != real-TU bank; 5/9 drifted), memcpy->struct-assign fix, 5 levers
- Session total: fleet 73.66% -> 73.85% (~673 fns across 2 waves); dedup 1813; NON_MATCHING 7 (0 in default build)
2026-07-10 12:52:20 -06:00
Drew T 67a8fe670d docs(phase-25): T7 F-band ≤28 regalloc crack wave — 4 banked + 266 swept ×134
- Ultracode 9-worker wave (register-pin/§31-density levers) cracked 7/9 to byte-0 in isolation
- Gated: 4 banked byte-identical (func_80134C20/801345F8/80141A60/80180F10); 3 real-TU drift; 2 near
- Swept ×134: func_80134C20 + func_801345F8 = 266 siblings (func_80141A60 frame-pad = exemplar-only)
- Fleet 73.66% -> 73.73%; R22 clean-fleet 136/136; dedup 1813; NON_MATCHING 7 (0 in default build)
- cookbook §42: density-lever catalog + 3 tooling gotchas (harvest_verify --out, reconcile fn-ptr, R22 extract-all)
- src banks already committed commit:0500 (family_sweep --commit)
2026-07-10 04:22:52 -06:00
Drew T ee957d11c6 docs(phase-25): T7-M4 verdict — NOT mechanical (0/8), re-tiered to F-band; checkpoint for fresh session
- M4's 8 fns byte-correct in ISOLATION but drift 8-69 in-TU (codegen scheduling/volatile-loss, not
  data-type casts; 4 have no data conflict) -> reconcile_decls banks 0/8. R14 correction: the T6
  'mechanical M4' projection was a 3rd object-probe over-count (after jumptable + linkwall). The 8
  re-tier to F-band (permuter/§31). cookbook §41b-addendum + decision-log R31 entry.
- T7 truly-mechanical tier EXHAUSTED: M1 37 + M3-clean 2 = 39 exemplars swept ×134 = ~4,694 fleet fns,
  fleet 72.29 -> 73.66%, R22 136/136 (committed commit:0495/commit:0496/commit:0497). CHECKPOINT for a fresh
  session; phase OPEN; NEXT = the F-band frontier (~39 fns) + jumptable/linkwall specialist workflows
2026-07-10 01:52:24 -06:00
Drew T c908c3913a feat(phase-25): T7-M2 — 4,389 def-side-wall members swept ×134 (fleet 72.29→73.58%)
- tools/family_sweep.py --reconcile <rawdir>: the Q5-proven per-sibling path — symbol-remap the RAW
  exemplar draft (family_remap.symbol_map) then RE-RUN canon_sig_reconcile v3.2 against EACH sibling's
  own TU (block-scope-vs-ambient decisions depend on the sibling's decompile state), then the plain
  whole-binary byte-gate. Plain remap of the ov077-reconciled body banks 0; per-sibling reconcile banks 94%
- swept the 35 M1 exemplars across 133 overlays: 4,389 / 4,655 member-remaps banked (266 per-sibling
  loose-typing-wall misses -> backlog); 266 overlay source files gained real C defs
- fleet 72.29% -> 73.58% (+1.29%), REAL 251,804; R22 clean-fleet 136/136 byte-identical (make clean +
  extract-all-136 + check-all); dedup-check 1813 validated / 0 failed; 0 NON_MATCHING (G4)
- cookbook §41c (the ×134 def-side-wall sweep). ~0 agent tokens (local cpp+build only)
2026-07-10 01:20:38 -06:00
Drew T 5b94a8247b feat(phase-25): T7-M1 — 37 exemplars banked ×1 via canon_sig_reconcile v3.2 (giants incl. func_8016A290/284)
- tools/t7_bank.py: the M1 driver (reconcile-at-bank-time against the CURRENT TU + harvest_verify
  whole-binary gate; chunk-bet + per-round re-reconcile for cross-fn ambient mutation; giants first)
- canon_sig_reconcile v3.2: uniquify ALL draft-defined type names AND struct/union TAGS to <name>_<addr>
  (byte-neutral) -> collision-proof when many exemplars bank into one TU (the 'redefinition of struct Fr'
  class); banked func_8016A290 (284-ins giant) + fixed the inter-draft collisions
- 37/40 non-jumptable M1 exemplars banked BYTE-IDENTICAL (ov_SC01_077 d19c9580, clean rebuild); each is
  currently ×1 (M2 sweeps them ×134 next)
- R14 CORRECTION (cookbook §41b): the T6 object-only probe OVER-counted BANKABLE by 7 -- it is blind to
  rodata + link. (a) 4 jump-table fns (3 _o0 giants + func_8012ACE0): .text byte-perfect but a switch
  jump table in rodata diverges -> REFUTES the T6 'Q3 -O0 REFUTED' claim; F-band jump-table workflow.
  (b) 3 last-referencer link-walls (func_8016D688/D1D8/165240): C-ifying the only asm referencer of a
  scratch data symbol drops splat's auto-symbol -> ld undefined reference; M-linkwall tier, deferred
- ov_SC01_077 REAL 32 stub-exemplars -> 37 more defined; whole binary byte-identical throughout (G3/P9)
2026-07-10 00:02:55 -06:00
Drew T f12bff04c0 feat(phase-25): T6 — Fable5 crack curriculum: def-side wall ~71% tool-shaped; 44/62 probe-BANKABLE via canon_sig_reconcile v3.1; x134 sweep law proven
- R14 re-verified ALL 95 draftable-exemplar stubs (match_one, best-of every drafts dir):
  62 genuine isolation-MATCH (incl. all 11 batch-2 'walls' + the 3 _o0 giants), 31 verified
  nears (closeness reproduces exactly), 2 no-draft tinies
- 6-iteration probe program (reconcile -> splice into the REAL TU -> full cpp|cc1|maspsx|as ->
  relocation-masked in-TU byte-compare): canon_sig_reconcile v1 itself was the wall for most.
  v3.1 fixes 5 measured defects (scalar-typedef strip; preprocessed-TU canonical incl. the
  self-decl class; block-scope-move-not-strip [draft extern types are LOAD-BEARING]; colliding-
  typedef RENAME [SVEC/Vec3/ApplyMatrixSV walls = rename, never layout]; decl-lines-never-cast
  + comment-masked def anchor) -> BANKABLE 10 -> 20 -> 37 -> 44 (4,254 ins, 13 giants >=145)
- swing answers: Q1 44 mechanical (not ~19); Q2 resident-callee moot (real class = arity-vs-
  visible-prototype -> M3 engine_core no-proto rewrite, 6 fns); Q3 -O0 reconcile REFUTED (all
  3 _o0 giants bank under v3.1 as-is); Q4 type collisions = rename; Q5 x134 sweep = remap +
  PER-SIBLING re-reconcile, 6/6 proven (S41 sweep-fragility dissolved)
- gate-validated end-to-end: func_8013DD68 (187-ins wall giant) banks BYTE-IDENTICAL through
  make build (d19c9580 == check file); tree restored (no T7 execution in T6)
- deliverables: docs/phase25-t6-curriculum.md (tiers M1-M4/F + per-fn worklists + commands +
  projections: mechanical tiers ~ +2.2% fleet for ~0 agent tokens), .run/t6_worklist.json +
  .run/t6_recon6/ (44 staged drafts), cookbook S41a, decision-log R31 entry, CURRENT_PHASE T7 handoff
- cost: ~0 agent tokens (local deterministic compute; no Workflow/Agent fan-out)
2026-07-09 23:39:14 -06:00
Drew T 20747321c4 feat(phase-25): T5b batch-2 — def-side wall cracked mechanically (canon_sig_reconcile); +5 giants, 3x134 (fleet 72.18->72.29%)
- 29 giants drafted (Opus-xHigh wave), 16 R14-isolation-MATCH but 0 auto-banked: ALL
  blocked by the DEF-SIDE canonical-sig wall (Ghidra-typed draft sigs conflict with the
  engine_core.h canonical, which lives inside DEFINE_ macros so sig_unify can't reach it).
- NEW tools/canon_sig_reconcile.py: strip ambient-dup typedefs/externs -> rewrite def to
  the canonical sig -> cast changed params AT USE (never intermediate locals: a local adds
  a pseudo -> regalloc shift -> byte-diff, measured 70ff4748 != d19c9580). Byte-neutral.
- BANKED 5 giants mechanically: func_8013B274 func_80130D48 func_80167DBC (family_sweep
  x134) + func_8016DC20 func_8018514C (exemplar-only). ~404 new fn-defs.
- R22 clean-fleet 136/136 BYTE-IDENTICAL (from make clean + extract-all + check-all),
  dedup 1813/0, 0 NON_MATCHING (G4).
- 11 walls backlogged (non-identical ambient types SVEC/ApplyMatrixSV, macro-local data
  symbols D_*, u8 redef, byte-diff) + 13 nears (permuter-ILS/Fable5 fuel). Frontier +29.
- Cookbook §41 (the reconcile recipe + the at-use-cast-not-locals regalloc proof) +
  decision-log R31 (the "giant tier was plumbing not matching" pivot). R30/R31.
2026-07-09 20:56:35 -06:00
Drew T aa0736a4f8 docs(phase-25): T7.2 log + cookbook §40a — decl-reconcile pass
- CURRENT_PHASE: T7.2 done (1,729 banked, fleet 71.32%, clean-fleet 136/136); resume points to T7.3 + Close; Phase-26 backlog (16 split-TU families, 683 diffs, 127 draftable)
- cookbook §40a: the decl-reconcile pass — (1) --no-preclassify (match_one isolation can't see engine_types.h, false-negatives lifted types; real-TU byte-gate is arbiter), (2) split files are separate TUs → blind lift-all unsafe (Buf cross-TU layout collision, PsyQ MATRIX/VECTOR shadowing), (3) byte-neutral verify per lift
2026-07-08 13:20:36 -06:00
Drew T 6280d24c16 docs(phase-25): cookbook §40 — structural-family mechanical symbol-remap (R30 capture)
The mechanical remap method (crack one exemplar -> remap per-overlay symbols to bank the ~133
siblings ~free). Captured now (R30) before the fresh-session handoff. h_norm families are templates
not free dedup; family_remap/family_sweep; plain harvest_verify gate; type-lift for local types;
uppercase func_ hex. Fleet 66.02->70.82% in one deterministic pass.
2026-07-08 11:25:27 -06:00
Drew T f62cd42c32 feat(phase-24): T7 §G — func_801372B0 banked ×134; ×1→×134 giant endgame COMPLETE; fleet 65.99→66.02%
- func_801372B0 (207 ins, reach-134) propagated ×134: unique-renamed its local SVEC/GLINE
  -> Svec_801372B0/Gline_801372B0 (a DIFFERENT same-named SVEC/u16 lives in _after.c, so a
  bare-name lift would double-define fleet-wide) + lifted to engine_types.h; ov_SC01_077
  byte-neutral (d19c9580); dedup_propagate --recover -> 134 byte-identical, E_func_801372B0.
- Clean fleet check-all 136/136 (R22), dedup-check 1812->1813/0, fleet 65.99->66.02%.
- Completeness scan (R14): NO matched giant remains ×1. Only small reach-134 ×1 fns left
  (3 now-propagatable stragglers + 17 local-type-blocked) = the T8 tail.
- The giant endgame is fully banked ×134 (whale + 6 §G cracks + func_801770E0 + func_801372B0);
  the 2 remaining reach-134 giants are permanent walls (func_80178004, func_801412A8 — G4).
- cookbook §39: native-DEFINE-path for -O2 giants (whale shared-header is -O0-only) · the
  overlay_files post-whale-split gap · find_site extern-comment class · unique-rename
  typedef-lift · R14 handoff-staleness.
2026-07-07 23:39:27 -06:00
Drew T 8cfbbf2d47 feat(phase-24): T7 whale func_80144B9C banked ×134 (-O0 reach-134 rollout) — clean fleet 136/136
The single biggest byte-weight lever (770 ins ×134 ~ +1.6% byte-weight), banked across all 134
overlays as -O0 compiled C (was ×1 in ov_SC01_077, commit:0463).

- ROLLOUT (tools/rollout_whale_o0.py): per single-file overlay, LINE-split <ov>.c at the whale
  (splat emits in vram order), carve the yaml code subseg into before/<ov>_o0b(-O0)/<ov>_after,
  thin <ov>_o0b.c #includes the shared src/shared/func_80144B9C.h (the whale C moved there — DRY,
  TU-local typedefs, not a fragile 200-line DEFINE_ macro). Makefile WHALE_O0B_OBJS wildcard -O0.
- DEDUP: group E_func_80144B9C (134 members, h_exact 74186b97, source=the header; group_members
  keys on binary+vram so a header-share validates like a macro-share).
- MILESTONE: clean fleet check-all 136/136 (R22); dedup-check 1811/0; FLEET REAL 225816->225949,
  byte-identical 65.91->65.95% function-count (the gain is byte-weighted). Validated on ov_SC01_000
  + spot-checks SC02/SC03/SC07 before the full fleet.
- cookbook §38 + SETUP inventory.
2026-07-07 22:23:10 -06:00
Drew T c106774776 feat(phase-24): T7 §G — 6/8 giants cracked, 4 ×134; fleet 65.75→65.91%
- MATCHED 6 reach-134 giants: func_801571C4 (permuter), func_8014EA4C/801372B0/
  801770E0/80176D94/80148094 (Fable5, sequential idiom-banking chain)
- 2 genuine walls stay INCLUDE_ASM (G4): func_80178004 (close=7), func_801412A8 (close=29)
- propagated x134: func_801571C4/8014EA4C/80176D94/80148094 (134 overlays byte-identical;
  dedup 1810 groups/0 failed; genuinely-clean make-clean+extract-all+check-all = 136/136)
- func_801372B0/801770E0 banked x1 (x134 follow-up: pin/asm + local-type self-containment gaps)
- tools: p16_permute.py comment-fix (unblocked the permuter fleet-wide) + permuter_ils.py (warm-restart ILS)
- knowledge: cookbook §37 + docs/gcc-2.7.2-map/t7g-giant-harvest.md
2026-07-07 20:20:43 -06:00
Drew T 8ba3b82307 feat(phase-24): T7 — 3 Fable5-cracked giants ×134 (func_801392FC/8013A530/8013AF20); fleet 65.64->65.75%
- func_801392FC (182, close=2->MATCH): CROSS-BB COMBINE LAW (a backedge-crossing count is a variable,
  not a foldable (s16)load; reorg steals the sll into the delay slot) + VOLATILE-FRAME-PARITY (volatile
  count-load avoids the cse-common -> combine keep-load -> stale-allocno reload slot). cookbook §36.
- func_8013A530 (204, close=10->MATCH): the RC-6 'reload knot' WAS the pins; the $0-ADD OPAQUE COPY
  (iVar7 = fc + zr, zr=$0) assembles to addu $v1,$a1,$zero but doesn't reserve the reg + 3 zero-byte
  levers. regalloc.md RC-12/RC-13, §36.
- func_8013AF20 (185, close=15->MATCH): the 'impossible' const-hoist order was libgpu addPrim's 24-bit
  BITFIELD store (store_fixed_bit_field emits 0x00ffffff first) + delete the inherited barrier; P_TAG
  lifted to engine_types.h (byte-neutral). loop.md, RC-7, §36.
- banked via the §35 recipe (fix_arity_callers --any-proto -> sig_unify -> harvest_verify ->
  dedup_propagate --recover). clean fleet check-all 136/136, dedup 1806/0, 0 NON_MATCHING.
- SESSION: 7 giants ×134 total (1 R14-free, 2 Opus-solo, 4 Opus->Fable5); fleet 65.48 -> 65.75%.
  gcc-2.7.2 reference tree extended (expmed.c/mips.md/... added). Giant queue (§G) stored for next session.
2026-07-04 04:14:43 -06:00
Drew T f38bded1d6 docs(phase-24): T7 harvest — §35 (ranking law + banking recipe + loop idioms); 3 residuals -> backlog
- cookbook §35: the region-a sibling-giant harvest. RANKING LAW (difficulty = global-array
  hoisting, NOT $s-reg count — param/buffer giants one-shot Opus even at all-8-$s); the ×134
  banking recipe (fix_arity_callers --any-proto -> sig_unify -> strip/anonymize local typedefs ->
  harvest_verify -> dedup_propagate; skip cast_call_sites on no-proto); new loop idioms
  (dest-off-base giv, index-form source, sltiu/slti-without-CSE, div2 range-extension).
- 3 deferred residuals logged to docs/backlog.md (Fable5 batch fuel): func_801392FC close=2,
  func_8013A530 close=10, func_8013AF20 close=15 — each single-class, ×134, seed in .run/t7/.
- CURRENT_PHASE: T7 harvest complete (4 giants ×134 banked, 3 deferred); next decision = Fable5 batch.
2026-07-04 00:40:45 -06:00
Drew T 994368fbcd feat(phase-24): T7b/T5 — 2nd giant func_80138ED0 MATCHED + banked ×134; fleet 65.52→65.56%; §34 idioms
- func_80138ED0 (159 ins, reach-134): Opus applying §32 -> close=21 (all semantics/control-flow/
  constants exact, +the giv-init fence lever) -> Fable5Max reading the vanilla gcc-2.7.2 source ->
  MATCH (every regalloc/sched class C-reachable, no permuter).
- banked via the standard pipeline (validates it on a real un-reconciled sibling): cast_call_sites
  reconciled func_8013914C (u8*,u16*)->(s32,s32)+cast; reconcile_decls a NO-OP (2 data bases
  giant-local -> no fleet conflict, confirms no false-positive); harvest_verify ×1 d19c9580 ->
  dedup_propagate --recover ×134 (pins/asm body propagates fine). clean fleet check-all 136/136,
  dedup 1800->1801/0, 0 NON_MATCHING.
- NEW §31 idioms (cookbook §34 + regalloc.md RC-11 + loop.md): gcc-2.7.2's 3-qty local-alloc SORT
  BUG (local-alloc.c:1441 — <=3 qtys allocate in creation not density order; decoy-qty fix) + the
  zero-byte asm allocation toolkit (input-only/multi-input/def+use dummies) + the giv-init fence +
  gdb-on-cc1. gcc-2.7.2 reference tree completed (18 .c); SETUP §5.6.
- T5 satisfied: reconcile_decls proven on 2 real giants (func_80129CF8 reconcile-path byte-proof +
  func_80138ED0 no-op/full-pipeline). CURRENT_PHASE T5 logged.
2026-07-03 21:09:38 -06:00
Drew T 787b756e6d docs(phase-24): T7b — distill reconcile_decls (cookbook §33, SETUP, design-doc RESOLVED); R14-correct §32 wall
- cookbook §33: the reconcile_decls mechanism (oracle + byte-neutral cast taxonomy + pipeline
  placement + the func_80129CF8 byte-proof); §32 'BANKING WALL' note R14-corrected (×134 was free,
  the wall was only the ×1 loose-draft reconcile).
- SETUP.md: reconcile_decls tool-inventory row.
- canonical-decl-reconcile-design.md: ✅ RESOLVED banner — the premise reframe (automation not
  unlock), the answered open questions, T4 no-op, the validation.
- CURRENT_PHASE: T7b/T2+T3 progress-log entry; NEXT = T5 sibling (func_80138ED0) via Fable5Max.
2026-07-03 17:59:19 -06:00
Drew T 8b48f482f9 feat(phase-24): T7 — Fable5 cracks giant func_80129CF8 + §32 idiom; banked ×1 (×134 needs the canonical-decl tool)
- Fable5Max cracked func_80129CF8 (191-ins region-a camera giant; match_one MATCH, 0-off): struct-base
  hoisting via SOURCE-LOCAL pointers (gcc-2.7.2 has no cross-bb CSE → a callee-saved base can only come
  from a local, NO pins), branch-polarity-off-the-opcode, S12 reused-temp fence, expand_block_move
  struct-assignment for the grouped copy, dead-local-aggregate for the frame. Distilled → cookbook §32.
- banked ×1 in ov_SC01_077_a.c (d19c9580; clean fleet 136/136) after reconciling its loose-typed decls
  (u8[]/s32[]/struct BigCopy/s8-vs-u8; func_80012F74 s16-vs-s32) to canonical + byte-neutral access casts;
  RView (GsRVIEW2-shaped 32B) lifted to engine_types.h.
- FINDING (byte-proven): ×134 propagation is BLOCKED by the fleet-wide loose-typing wall — the giant's
  shared callees/data are declared incompatibly across overlays, so the macro's externs conflict per
  overlay (dedup_propagate --recover only fixes the propagated fn's CALLER extern, not its callee/data).
  Unlike the flagship func_80132784 (compatible → ×134), loose-typed giants bank ×1, not ×134.
- Drew's call (A, invest): build the fleet-wide canonical-decl reconcile tool = the ×134 giant unlock.
  Spec + conflict taxonomy + byte-neutral cast patterns: docs/canonical-decl-reconcile-design.md.
- clean fleet check-all 136/136 BYTE-IDENTICAL (R22). No new governance rules.
2026-07-03 16:40:04 -06:00
Drew T 6c2fb9f04f fix+feat(phase-24): T5b — S11 CRACKED (func_8014E048 banked) + fleet GetTPage linkage fix
Both concerns byte-verified from a fully-clean tree (ov_SC01_077 d19c9580, ov_SC07_009 2a6499b6
+ 133 overlays). Fleet is 135/136 — the 1 remaining failure is `main`, a SEPARATE pre-existing
Phase-21 breakage (62 dangling INCLUDE_ASM refs, tracked in CURRENT_PHASE, fix in progress),
NOT introduced by this commit.

[FIX (partial) — pre-existing Phase-21 latent breakage, found during T5b's fleet verify]
- A genuinely-clean `make check-all` failed 135/136 (overlays: `undefined reference to func_80058B40`;
  main: dozens of `can't open asm/nonmatchings/800c3/func_*.s`). This commit fixes the OVERLAY side.
- Root cause: Phase-21 xdedup renamed func_80058B40 -> GetTPage in symbols.us.txt (one of the
  +62 PsyQ names) but did NOT update the two shared engine_core.h macros that CALL it
  (DEFINE_func_80139680, DEFINE_func_8012E28C — in all 134 overlays + ov_SC01_077_a). Since
  Phase 21 a clean rebuild couldn't link; incremental builds reused stale .o's and masked it
  (the R22 failure mode) — every "check-all 136/136" Phase 21->23 was incrementally-stale.
- Scope = exactly 1 symbol (static scan of all func_/D_ refs in the shared headers vs symbols).
- Fix: rename the 4 occurrences -> GetTPage (byte-neutral, same addr 0x80058b40 -> identical jal;
  G6 curated-name). ov_SC07_009 link-fail -> byte-identical 2a6499b6.
- Lesson: a symbols.us.txt rename must be propagated to shared-macro bodies AND verified by a
  genuinely clean (make clean + full re-extract) check-all, never incremental.

[FEAT — T5b: the S11 class crack, Fable5 spike]
- The S11 LUID(x)alloc "intrinsic" verdict was MAP-INCOMPLETENESS. func_8014E048 (143 ins,
  reach-134; "not source-steerable" since the map wave; 28-off even after T5's directed permuter)
  -> MATCH (143/143) -> whole-binary BANKED (ov_SC01_077 d19c9580). Derived by reading gcc-2.7.2
  source + RTL dumps (12 experiments .run/gccmap/exp/e1a..e1k.c).
- NEW LEVERS (byte-proven): S12 reused-s32-temp fence (u16 temps DON'T work — combine folds the
  unpromoted-HI zext temps away); S13 head-skip escape (body-local param copies conflict-steer the
  scratch contest; volatile-asm dead-read wedge fence; multi-input dead-read K2 rebalance);
  cse-opaque asm-copy; RC-4b pinned store-temp; RC-10 preference-cascade mechanics.
- Integration reconciles (both T6 classes): engine_core.h caller decl s16*->u16* (codegen-neutral)
  + canonical data decls w/ *(u16*) casts (D_801152A8 u8[] / D_801152AC s16). x134 lift blocked by
  dedup_propagate self-containment (pins/asm) -> T6 target (joins func_80132784).
- Distilled (R30/R16): sched.md §6 (S12/S13) + regalloc.md §F (RC-10 + RC-6/S11 downgrade) +
  cookbook §31 triage update; backlog re-logged (capped); memory updated.
2026-07-03 02:02:26 -06:00
Drew T 0eadf313ee feat(phase-24): T5 — §31-directed permuter mutation + grinder input-changed gating
- tools/permuter_weights.py (NEW): classify(klass,where) -> regalloc|schedule|cse|None
  + render_settings_toml emitting the [weight_overrides] table decomp-permuter merges over
  the gcc defaults (main.py:336 / helpers.py per-key replace). Biases pass-selection toward
  each class's §31 levers (perm_reorder_decls RC-1/3, perm_reorder_stmts RC-2/S1,
  perm_temp_for_expr S2, perm_commutative cse); value/type noise -> ~0.1. NO submodule edit.
- p16_permute.setup(..., klass=, where=) writes it (+--klass, backlog auto-lookup);
  grinder.py auto-threads klass/where_stuck. klass=None -> gcc defaults (undirected superset).
- grinder fix (R14): replace the blind tried.clear() idle churn with input-changed gating
  (draft_sig=(best_draft mtime, closeness) — re-open a fn only when the worker improved it).
- VALIDATED: regalloc profile drove func_8014E048 masked 36->29 (match_one -drz 35->28) where
  the undirected search stalled; re-logged (28, improved draft promoted). Flagship S11/RC-6
  count-exact seeds improve but do not gate (intrinsic, §31 "two probes dont grind") -> T5b fuel.
- distill: cookbook §3b + SETUP inventory (R16/R30). No build-input changed -> 136/136 untouched.
2026-07-03 00:14:29 -06:00
Drew T 3b6f2c5f94 docs(phase-23): §31 — the gcc-2.7.2 codegen map (4 Fable5 agents read the source)
- docs/gcc-2.7.2-map/{sched,regalloc,loop,cse_expr}.md: source-cited, byte-proven
  pass -> residual -> C-lever catalogs (935 lines). cookbook §31 = the index + triage.
- WALLS BROKEN (byte-proven steerable, were "CONFIRMED unsteerable"): §10/§20
  hoist-vs-remat (cross-call address-caching), store-vs-load (/s), dbr delay-slot
  (D1+S2 fresh-local: func_801770E0 53->49), birthing-boost both directions.
  Incidental bank: func_80149374 x134 (fleet 64.86%).
- GENUINE walls -> permuter: S3 chain-priority sink, S11 LUID(x)alloc coupling,
  RC-6 pressure-lock, cse 1000-insn table flush.
- CORRECTION (loop agent): tools/reference/gcc-papermario is gcc 2.8.1 NOT 2.7.2
  (behavioral biv-elim diff). Vanilla gcc-2.7.2 -> tools/reference/gcc-2.7.2/
  (gitignored); SETUP §5.6 + §31 flag it. All banked levers stand (match_one-validated
  vs the real cc1). Also corrected: spill-slot = declaration order; §25 4th rank rule.
- the payoff: the cheap tier (Opus agents + local model) can now apply compiler-internal
  levers by triage-table lookup, without reading 80k lines of source.
2026-07-02 20:12:19 -06:00
Drew T e74dd52b19 docs(phase-23): cookbook §30a — §30 generalizes via Opus agents + 2 new levers (IV-combine, inline-limit) + mechanical macro-widen integration 2026-07-02 17:34:53 -06:00
Drew T 6678c6868a feat(phase-23): Fable5Max cracks §20 "unsteerable" giant func_8014EE14 ×134
- Fable5Max agent (Agent model=fable) matched a 248-ins reach-134 GIANT on the
  §20/§10 store-vs-load wall (22 phases "CONFIRMED unsteerable") by reading the
  gcc-2.7.2 source (tools/reference/gcc-papermario) + RTL -da dumps. Leaf
  MATCH(248 ins) -> whole-binary banked:1 -> dedup_propagate ×134. Verified:
  check-all 136/136 byte-identical, dedup-check 1780 validated/0 failed.
- 3 byte-proven idioms -> cookbook §30 (corrects §29's "not a bigger model"):
  (1) store-vs-load is a deterministic MEM_IN_STRUCT_P /s aliasing flag, not a
      scheduler tie-break; steer via ((struct{s32 f;}*)p)->f (anon struct keeps
      /s AND propagates ×134) to grant, *p to deny
  (2) def-side return-type wall has a MACRO escape: widen a discarding caller
      macro's extern void->s32 (byte-neutral, check-all-verified) -- extends §29
  (3) birthing-boost prologue-order lever: __asm__("":"=r"(x):"0"(x)) re-tie in a
      later bb kills sched.c's REG_N_SETS==1 priority boost
- tools/glm_parallel.sh: K concurrent OpenRouter/GLM cloud drafters (parallel
  api_draft), key read from .env at runtime
- §10/§20 "store-vs-load unsteerable" backlog now re-test candidates:
  func_8014F2E0, func_80150528, func_8014EA4C
2026-07-02 16:56:56 -06:00
Drew T 6127367017 docs(phase-23): T10.7 conclusion — def-side wall intrinsic (GLM 1/7); GLM = drafter+teacher not wall-breaker
- cookbook §29: reasoning-model reconciliation idioms (match-pointer-type-to-TU-decl, call-site cast
  for value mismatch, cast-a-callee-definition, data-type match) + the narrow-param hard limit
- gen2-mips-matching-model.md + CURRENT_PHASE: Option-3 verdict (GLM reasons the wall expertly but
  banks 1/7; wall INTRINSIC, Fable5 §3c triple-confirmed); GLM role = $0.03-0.08/fn hard-band drafter
  + idiom teacher; real lever past the wall = public flip, not a bigger model
2026-07-01 21:05:18 -06:00
Drew T 205fc202e9 feat(phase-23): macro-extern-injection lever — 8 reach-134 fns freed ×134 (fleet 63.82→64.09%)
- tools/inject_capped_externs.py (new): source each propagation-capped reach≥2
  inline match's externs from ov_SC01_077's own file-scope decls, inject them
  block-scope so the lifted macro is self-contained (the Phase-20-backlog
  macro-extern-injection lever; byte-neutral, fail-safe via compiles_standalone)
- 8 reach-134 fns freed from ov_SC01_077.c, 077 byte-identical; dedup_propagate
  --auto-from registered 7 new shared groups ×134 (1678->1685), check-all 136/136
- the LLM reach≥2 measurement run already banked +7 (v3 banks reach≥2: 6/15 in 005
  vs v2's 0/15) — committed earlier (commit:0359, commit:0360)
- cookbook §28d + SETUP tooling inventory (R16/R21/R30)
- fleet 63.82% -> 64.09%, 0 NON_MATCHING, dedup-check 1685/0 failed
2026-06-30 11:15:11 -06:00
Drew T a126d2170d docs(phase-22): correct cookbook §28b-6 — the dedup_propagate registry-skip is independent of concurrent make (R14, per §28c) 2026-06-26 22:25:17 -06:00
Drew T c1230fa6ea feat(phase-22): T2 close=0 recovery batch — 14 fns ×134 (fleet 63.29%->63.66%)
- R14 corrects cookbook §26 ('close=0 recovery exhausted'): recover_giant + the
  whole-binary gate still banks a ~15-20%% tail. Banked 7 close=0 reach-134 fns
  (func_80156ECC/80147E44/8015ADB0/801661CC/80166054/8012CFA8/8012A62C); dedup_propagate
  --auto-from swept those + 7 pre-existing inline-matched bonus fns ×134 (14 total)
- the other ~33 close=0 are the genuine DEF-side loose-typing / masked-residual wall
- func_80132784 HARD-DEFER (hoist-vs-remat + register-lifetime-reuse not C-expressible)
- §28c distilled: close=0-not-exhausted recipe + the dedup_propagate registry-skip
  recovery (register via append_groups; bytes were already check-all-correct)
- make check-all 136/136 byte-identical (R22); dedup 1619->1633 validated/0 failed;
  0 NON_MATCHING (G4)
2026-06-26 04:14:06 -06:00
Drew T b5a1fe6dab feat(phase-22): T2 — giant func_80156B74 banked ×134 via engine_types.h type-lift (fleet 63.22%->63.25%)
- struct-walled close=0 giant (cookbook §28 case #3) is bankable: lift the S8/B8
  typedefs from ov_SC01_077.c's prelude to src/shared/engine_types.h (shared via
  engine_core.h; byte-neutral), recover_giant block-scopes externs, whole-binary
  harvest_verify MATCH, dedup_propagate ×134 (214 ins, +28676 ins byte-weighted)
- cookbook §28b: the type-lift recipe + the serialize-make-jobs gotcha (concurrent
  make corrupted an .o and dropped the registry write; re-ran dedup_propagate idempotent)
- make check-all 136/136 byte-identical (R22); dedup 1617->1618 validated/0 failed;
  0 NON_MATCHING (G4)
2026-06-26 03:45:35 -06:00
Drew T 0375cd529b docs(phase-22): T3 — distill §28 canonical-extern recovery + recover_giant.py + decomp.wiki patterns
- cookbook §28: the 4-way triage of a close=0 gate-rejected giant (pure-extern plumbing /
  masked-residual / struct-walled / regressed-draft) + the canonical-extern recovery (the NEW
  lever that banked func_8015126C, which Phase-21 left as a close=0 wall) + the coalescing pin
  (register __asm__ + lazy in-&& assign). §28a: PS1-applicable decomp.wiki GCC patterns
  (negative-offset loops, branch-duplication, load-coalescing, div-magic table, slti-0)
- tools/recover_giant.py: canonicalize a draft's engine_core.h-callee externs to def-sigs +
  move all externs block-scope (validated func_8015126C -> MATCH)
- R14: close=0-giant fan-out NOT uniformly near-free — only func_8015126C was pure-extern;
  the rest are struct-walled / masked-residual / regressed -> genuine per-giant hand-work
2026-06-26 03:06:54 -06:00