Commit Graph

138 Commits

Author SHA1 Message Date
Drew T f555a441a3 docs(phase-21): distill — handwritten-GTE-sqr cop2-nop + raw-byte-verify idiom from func_8013E2C4 2026-06-23 12:21:51 -06:00
Drew T e8b1f8f253 docs(phase-21): distill — explicit-temp load-delay-fill idiom from func_801856F8 2026-06-23 11:50:51 -06:00
Drew T 28afb3c49c docs(phase-21): distill — per-access (volatile T*) field-reload idiom from func_801424E4 2026-06-23 11:12:15 -06:00
Drew T d07c6edb0a docs(phase-21): distill — volatile-global forces reload-between-stores idiom from func_801806D8 2026-06-23 10:36:56 -06:00
Drew T 934c007df8 docs(phase-21): distill — global-RMW pointer-var address-materialize idiom from func_80186938 2026-06-23 03:39:30 -06:00
Drew T a830648291 chore(phase-21): checkpoint — session reach-1 progress (fleet 61.21%, 215 banked, 7 idioms, 2 pool fixes)
CURRENT_PHASE SESSION UPDATE refreshed (waves 17-25) + regenerated digests. Crash-recovery (R30).
2026-06-23 03:13:49 -06:00
Drew T 8e892ad49e docs(phase-21): distill — packed-aligned(1)-union unaligned-source load idiom from func_80142A80 2026-06-23 03:11:26 -06:00
Drew T 1e5cc1b28f docs(phase-21): distill — exploit-cross-jump dual-arm-call idiom from func_80159BE4 2026-06-23 02:45:37 -06:00
Drew T 279662bbed docs(phase-21): distill — barrier-free memory-reload-via-statement-order idiom from func_80168430 2026-06-23 02:23:46 -06:00
Drew T e59e8b5ef6 chore(phase-21): checkpoint — session 2026-06-23 reach-1 progress (fleet 61.19%, 165 banked, 4 idioms, pool fix)
CURRENT_PHASE.md SESSION UPDATE + regenerated fleet/backlog/progress digests.
Captures waves 17-22 state for crash-recovery (R30). No source change.
2026-06-23 02:07:35 -06:00
Drew T c694c9d7a1 docs(phase-21): distill — combined store-and-capture call-result idiom from func_80142DC4 2026-06-23 02:05:40 -06:00
Drew T 43d089ec64 docs(phase-21): distill — byte-predecrement +0xFF-not-1 immediate idiom from func_8016EBA8 2026-06-23 01:42:09 -06:00
Drew T 478aeeee2a docs(phase-21): distill — $sp-switch inline-asm trampoline idiom (maspsx delay-nop/.set-reorder/%% rules) from func_8014CCB4 family 2026-06-23 01:28:13 -06:00
Drew T bbfe27d095 docs(phase-21): distill — u16-vs-s16 high-bit-const halfword-store ori idiom from func_8017E924 2026-06-23 01:09:19 -06:00
Drew T 9d07712205 feat(phase-21): reach-1 harvest pivot — fuel built + handoff (×134 walls exhausted at 61.16%)
- ×134 wave fuel walled (waves 13-16: +6 banked incl 476-ins func_80141CA4 ×134, fleet
  60.93% -> 61.16%); grinder stopped (Drew). Pivot to reach-1 (overlay-unique) fuel.
- reach-1 fuel BUILT: 298 uncached reach-1 prefetched (headless DecompileFunctions.java,
  298 ok / 0 fail) -> all 420 reach-1 region-main draftable fns cached (median 47 ins).
- tools/wave_targets.py: new reach1 pool, SMALLEST-FIRST sort (idiom-mining order).
- tools/orchestrator.py: reach1 in POOLS; orch_state set to reach1 (prep --mode pool serves it).
- docs/automation-runbook.md + CURRENT_PHASE.md: the reach-1 smallest-first harvest cycle
  (distill EVERY wave) for the fresh session Drew drives. x1 leverage (ov_SC01_077 only).
- docs/matching-cookbook.md: marked the 2 floating §21 bullets CANDIDATE/unverified (near-miss
  func_801775E0, not byte-banked); drafter-cookbook-edit guard at commit:0219.
- NOT started: no waves launched (Drew's instruction). Byte-gate unchanged (G3/P9).
2026-06-22 21:22:35 -06:00
Drew T 501d112758 docs(phase-21): session handoff + queued 10h run (fleet 60.93%) — crash-recovery for fresh session
- CURRENT_PHASE ★ CURRENT STATE: overnight loop summary (59.05->60.93%, ~55 fns, 12 waves), the 3
  gate-safe tooling upgrades + 6 idioms, the tractable-pool-depleting finding, exact resume cycle
- ▶ QUEUED 10-HOUR RUN: fuel verified (80 tractable+28 giants+9 o0 cached, grinder 21 eligible),
  staged first batch, paste-ready fresh-session start (grinder + worker loop, auto-rotate to giants)
- T6 marked done (the loop ran); T7 (close) pending Drew's gate-2. NOT STARTED (STOP present).
2026-06-22 07:47:14 -06:00
Drew T 0b77956d54 docs(phase-21): drafter-distilled idioms (non-volatile reload-clobber, phantom-frame induce) + backlog/progress regen
func_801758FC's drafter added two byte-verified idioms to cookbook §21 (additive, H5-safe).
2026-06-22 03:31:30 -06:00
Drew T 29858df0b4 docs(phase-21): distill — register-short-truthiness sll-16 idiom from func_8013F244 2026-06-22 00:08:05 -06:00
Drew T 4927f38c46 feat(phase-21): option C — grinder blacklist + sig_unify DEF-side arity-extend recovery
- grinder.py: persistent blacklist for permuter-won/gate-rejected (plumbing-bound) fns;
  stops the tried.clear()-after-idle churn (was 0 banks in 8h on func_8014F3E8/func_8014FE60)
- sig_unify.py rewrite_def: adopt the canonical param list on arity mismatch (DEF-side
  loose-typing wall) — unused extras sit in $a0-$a3, free at -O2; banked func_8016EDEC/EE40
- cookbook §22 (DEF-side recovery + grinder blacklist); CURRENT_PHASE option-C log
- compounds: sig_unify is in the gate pipeline -> every future wave + the grinder auto-recover
2026-06-21 22:55:40 -06:00
Drew T 9dcabfbdc7 docs(phase-21): distill — giv-anchor store-order idiom from func_80178298 2026-06-21 22:39:22 -06:00
Drew T 0744e5ad89 docs(phase-21): distill — disjoint-bits add->ori barrier idiom from func_80169058 2026-06-21 22:05:23 -06:00
Drew T fc3b7d25e1 docs(phase-21): distill — memcpy-unaligned + 16-byte struct block-copy + out-param-buffer idioms from func_80153800/func_80163A94/func_801749C8 2026-06-21 15:22:16 -06:00
Drew T 5fc5d64445 feat(phase-21): R2/R3 — the learning flywheel (class-grouped waves + distill)
- residual class travels with the draft: drafter stamps // @class / // @stuck; gate_stage logs
  the worker's gcc-quirk class to the backlog (not the coarse manifest class).
- wave_targets.py --class <C> / --list-classes: class-grouped re-attempt waves over the backlog's
  classified near-misses (REGALLOC/SCHEDULE/REMAT/STRUCT/IV/LOOPGUARD/LOOSE/PLUMBING).
- orchestrator prep: auto-picks a class-focused wave when a class accrues >= threshold near-misses,
  else a fresh pool harvest; clears the draft dir per wave.
- tools/workflows/distill.js: post-wave agent extracts NEW byte-verified gcc idioms -> cookbook §21
  (R16, conservative); drafters now read the LIVE cookbook so distilled idioms feed forward.
- runbook: the full prep->worker->gate->distill cycle (the Phase-18 close-rate loop, automated).
2026-06-21 13:56:59 -06:00
Drew T aa010db9d4 feat(phase-21): R1 — gate pre-reboot wave2 drafts (+2 fns x134)
- gate_stage on the 15 worker drafts saved before the reboot: banked 2 byte-matches,
  propagated x134 (dedup 1508->1510); the gate process was killed pre-commit (empty log),
  banks recovered from the working tree (dedup_propagate fail-closed per-overlay = verified).
  Remaining 13 -> backlog near-misses.
2026-06-21 13:50:53 -06:00
Drew T 7bd3fa2ee9 docs(phase-21): backlog snapshot at reboot stopping point 2026-06-21 13:30:01 -06:00
Drew T 66d1af0e09 docs(phase-21): automation runbook + status tool (grinder running; worker = remote-driven)
- docs/automation-runbook.md: launch/monitor/stop for the grinder (live) + worker /loop;
  safety invariants (byte-gate sole arbiter, git crash-safe, auto_stop kill switch);
  remote-management note (Drew can remote in -> no bulletproof keep-alive needed).
- auto_status.sh: show grinder + worker heartbeats, backlog, phase-21 checkpoints, daemons.
2026-06-21 13:12:04 -06:00
Drew T 8de18e617d feat(phase-21): T4/T5/T6 — worker validated (func_80164530 x134), grinder, orchestrator
- T4 worker Workflow validated: 3-target wave, all self-MATCH; whole-binary gate banked
  func_80164530 x134 (5 register-pins + offset-fold + scheduling). fleet 58.90->58.98%.
  §20 holds (1/3 survived the whole-binary gate); the 2 near/failed -> backlog.
- T5 grinder: token-free permuter of backlog near-misses -> gate_stage; gate correctly
  rejected a permuter over-prediction (integrity intact). auto_supervisor DRIVER-param.
- T6 orchestrator.py: ROI pool rotation (prep/finish/status); gate_stage flock serializes
  grinder+orchestrator builds. Sandbox: detached daemons build fine, foreground needs override.
2026-06-21 13:06:34 -06:00
Drew T c2e93e50cd feat(phase-21): T3 — backlog ledger + shared gate stage (validated, +0.08%)
- tools/backlog.py: near-miss ledger (.run/backlog.jsonl + docs/backlog.md ranked by
  reach->closeness->size; drop-now-matched filter, P9). tools/gate_stage.py: the shared
  deterministic spine both worker+grinder call (canon_resident_calls -> cast_call_sites ->
  sig_unify -> harvest_verify --chunk 1 -> dedup_propagate --auto-from -> backlog -> summary).
- validated end-to-end on a real 30-draft m2c sample: banked func_801710DC + propagated x134
  (dedup 1506->1508), 29 near-misses logged+ranked. make check-all 136/136 byte-identical
  (R22); fleet 58.82%->58.90%; dedup-check 1508 validated/0 failed (G3/P9).
- capped-fns reframe (R14): they're matched-inline (propagation-blocked), not draftable ->
  deferred to the worker; not claiming the unbanked +0.3% (P9).
2026-06-21 12:32:21 -06:00
Drew T e803651f0c feat(phase-20): close — cap tool + T3a %lo crack + 3 byte-proven findings; fleet 58.00%->58.82% (v1.19.0)
- THE CAP TOOL tools/cast_call_sites.py (§17a-1 callee-cast): per draft, callee whose canonical
  TU sig != draft's intended sig -> decl->canonical + call-site cast ((ret(*)(args))func_X)(args)
  (codegen-neutral; gcc folds the cast of a known symbol -> direct jal). Recovered 6 of T6 batch-1's
  33 gate-fails byte-identical (5 x134 + 1 local). Pipeline canon_resident_calls -> cast_call_sites
  -> sig_unify -> harvest_verify --chunk 1.
- T3a CRACKED (not cited): the %lo-folding indexed-global -O0 residual falls to the array-of-STRUCT
  idiom (extern Struct base[], sizeof==stride, base[i].field; NOT *(T*)(&sym+i*stride) which
  materializes &sym). func_8013B7AC banked. Reusable idiom fleet-wide. cookbook §18/§20.
- THREE byte-proven findings (R14): (1) the wave cap is the DEF-side loose-typing wall, not
  callee-conflicts (the §20 "~33" projection was wrong); (2) the -O0 cluster is OVERLAY-LOCAL,
  not reach-134 -> the ×134 rollout is INVALID; (3) data-cast is MOOT (0 real data conflicts).
- T1 typedef type-lift (+0.35%, 9 fns x134); T2 exemplar_miner router; T4 codegen map (cookbook §20);
  T6 batch-1 (+0.28%, 8). dedup 1485->1513/0 failed. check-all 136/136 BYTE-IDENTICAL (R22);
  0 NON_MATCHING (G4). fleet 58.00% -> 58.82%.
- rule R30 (capture context-dependent knowledge before a fresh session). worklog -> logs/Phase20.md.
- bumps 1.18.0 -> 1.19.0
2026-06-21 10:26:34 -06:00
Drew T f1a7e518f5 feat(phase-20): T3a CRACKED — %lo-folding -O0 falls to the array-of-struct idiom
- the %lo-folding indexed-global -O0 residual (§18, long "irreducible") is CRACKED: declare
  the global as "extern Struct base[]" (sizeof == stride) and access "base[i].field" -> gcc
  keeps sym a symbol_ref and folds %lo(sym+off) into the store, byte-matching. The failing
  forms "*(T*)(&sym + i*stride)" materialize &sym as a value first, blocking the fold.
- func_8013B7AC byte-gated + banked (x1 — the -O0 cluster is overlay-local, R14 finding above);
  the idiom is reusable fleet-wide for ANY indexed-global access (-O0 or -O2).
- cookbook §18 ("%lo-folding indexed global — CRACKED") + §20 placeholder closed.
- the other 9 -O0 stubs: idiom applies but need per-fn -O0 drafting (3 quick ones tried, failed
  on -O0 codegen detail; 4 are large) -> backlog/autonomy fuel. clean rebuild d19c9580 (R22).
2026-06-21 09:58:01 -06:00
Drew T a978081b2d docs(phase-20): data-cast is moot (R14) — 0 data-type conflicts on the tail
- byte-proven: 0 drafts declare an extern struct/union data conflict; the lone apparent
  DATA-conflict (func_8016A8FC/D_800AE620) was a typedef-REDEFINITION (Blk20 inline vs
  engine_types.h, same type) masking the def-sig loose-typing wall. Stripping the inline
  typedef compiles but still byte-mismatches. data-cast = code for 0 cases -> not built.
- cookbook §20 DATA-conflict note corrected; fleet unchanged 58.82%.
2026-06-21 09:30:22 -06:00
Drew T 7f2f314896 docs(phase-20): -O0 ×134 rollout is INVALID — cluster is overlay-local, not reach-134 (R14)
- byte-proven: only 1/134 overlays shares ov_SC01_077's -O0 cluster bytes; the 6 matched
  -O0 fns reference per-overlay data addresses (func_8013B568 -> D_80187270 in ov_SC01_077
  but 0x80182B04 in ov_SC01_005), so they're overlay-LOCAL, not ×134-shareable. The
  Phase-18/19 'reach-134' label conflated function-present with byte-identical (R14).
- the §18 split infra (rollout tool + Makefile %_o0.o pattern + PROVIDE .ld) was built and
  byte-validated to compile/link a 2nd overlay; the whole-binary gate then exposed the
  per-overlay-data wall -> reverted (the finding is the deliverable, P9).
- -O0 rollout = ×1 per-overlay-unique re-matching (~0.2-0.3%), NOT +0.6% free -> SKIP.
  cookbook §18 corrected; fleet unchanged 58.82%, 136/136 byte-identical.
2026-06-21 09:26:44 -06:00
Drew T 6c5bd1c4a9 feat(phase-20): cast_call_sites.py — the §17a-1 callee-cast cap tool; 6 recovered, fleet 58.63%->58.82%
- tools/cast_call_sites.py: per draft, callee whose canonical TU sig != draft's
  intended sig -> decl->canonical (kills in-TU conflicting types, keeps symbol in
  scope) + call-site cast ((ret(*)(args))func_X)(args) (codegen-neutral: gcc folds
  the cast of a known symbol -> direct jal). Pure --in/--out; whole-binary gate is
  the arbiter (G3/P9). Pipeline: canon_resident_calls -> cast_call_sites ->
  sig_unify -> harvest_verify --chunk 1
- recovered 6 of T6 batch-1's 33 gate-fails byte-identical (func_80153C44/8015CF58/
  801711FC/80161BE0/801683D8/8015F948); 5 propagated x134 + 1 local; check-all 136/136
- R14 CORRECTION of cookbook §20's '~33' projection (byte-proven): the batch is NOT
  mostly callee-conflicts — ~6 callee (cast-recovered), ~18 DEF-side loose-typing wall
  (def's matchable sig conflicts with the unchangeable caller-canonical; caller-side
  fix BLOCKED because INCLUDE_ASM declares no symbol -> a shared macro's internal
  extern is load-bearing in the 133 stub overlays), + a small DATA tail. The def-side
  needs re-drafting under the caller-canonical sig (future wave), not a text transform
- cookbook §20 RESOLUTION + SETUP tool inventory (R16/R21/R30); CURRENT_PHASE log (R28)
- fleet 58.63% -> 58.82%, dedup 1501 -> 1508, 0 NON_MATCHING (G4)
2026-06-21 02:04:39 -06:00
Drew T 2070cdb000 docs(phase-20): T4 — distill the codegen map (cookbook §20) + R14 loop-guard correction
- cookbook §20: the wave-at-scale GATE CAP (match_one over-predicts; the in-TU loose-typing
  call-graph wall; all recovery levers fail; the only fix is automating §17a-1 call-site casts =
  Phase-21 cap lever) + the stale-.o diagnostic lesson
- CONFIRMED-irreducible classes w/ byte-evidence: §10 store-vs-load (8014F2E0/80150528), §10
  hoist-vs-remat (80149374/801493D0); NEW classes: IV-combine combine_givs (80177AD4),
  hoisted-invariant prologue order (80177F84), the -O1 build-infra class (80161A90)
- operational gotchas: Workflow args-as-array, harvest_verify --chunk 1
- R14 correction to §17a: loop-guard (8012C2D0) is STRENGTH-REDUCTION/IV-final-value addressing,
  NOT operand-order
- SETUP §tooling: exemplar_miner.py (T2) + build_engine_types.py typedef-lift (T1) (R21)
- T3c cited (written up), T4 done; CURRENT_PHASE handoff refreshed
2026-06-21 01:24:01 -06:00
Drew T 9991e4d6be feat(phase-20): T6 batch-1 — harvest wave 41/48 match_one, 8 banked (7 x134), fleet 58.35->58.63%
- Ultracode wave on 48 cached reach-134 <=90-ins targets: 41/48 match_one MATCH (85%)
- whole-binary byte-gate: 8/41 banked (canon 3 + sig_unify 5); 7 propagated x134 + 1 local;
  dedup 1494->1501, check-all 136/136, +0.28%
- FINDING (R14/P9): match_one->gate gap ~80% this batch = EXTERN-CODEGEN-COUPLING (a callee's
  declared sig changes the call codegen; match_one uses the draft externs, the gate uses the
  overlay decls). The 33 lost are byte-correct vs the wrong externs -> need a callee-extern-
  canonicalize pass (NOT sig_unify, which rewrites the def-sig and regresses byte-correct drafts)
- the 7 DIFFs = gcc-class diagnoses: T3c store-vs-load (8014F2E0/80150528) CONFIRMED unsteerable
  (sched.c); SS10 hoist-vs-remat (80149374/801493D0); IV-combine (80177AD4); hoisted-invariant
  order (80177F84); 80161A90 = -O1 (build-infra)
2026-06-21 00:57:04 -06:00
Drew T ba6cb87d30 feat(phase-20): T2 — exemplar_miner routes 835 residuals (WAVE 472 / PINS 45 reach-134 / STUB 90)
- tools/exemplar_miner.py: consume wall_taxonomy.json + per-overlay reach (dedup_propagate's
  computation) -> route each residual to a lever (WAVE/STRUCT/PINS/STUB); emit
  docs/exemplar_curriculum.md + .run/exemplar_routing.json (wave-gen input)
- routing: WAVE 472 (218 reach-134, T6 fuel) / STRUCT 159 / PINS 114 (45 reach-134) / STUB 90
  (74 ARITY_WALL loose-typing + 16 NONFAITHFUL, honest P9)
- KEY T3 input: 17 reach-134 fns at m2c-mismatch=1 = cleanest regalloc/schedule isolates
  (likely SS17-pins wins + the genuine class residuals); 3 named exemplars confirmed reach-134
- note: census is the Jun-19 snapshot (pre-Phase-19 waves); T5/T6 regen = authoritative WAVE list
2026-06-20 23:55:51 -06:00
Drew T 4f5f73c480 feat(phase-20): T1 — typedef lift closes the type-blocked propagation cap (9 fns ×134)
- build_engine_types.py: add find_typedefs() (brace-aware) + typedef_name() (anon-struct,
  fn-ptr, alias) + same-name/overlap collision guards; lift 14 typedefs to engine_types.h
  in source order after the named structs (A801593E4 -> S801593E4 dep preserved)
- engine_types.h: 48 named types + 14 typedefs; ov_SC01_077 byte-neutral (still d19c9580)
- dedup_propagate --auto-from: 9 reach-134 fns propagated x134 (8013E4B4 80148C9C 8014A238
  8014C118 80153978 801593E4 80168664 8016B964 8017AD0C); engine_core.h +9 DEFINE macros
- FINDING (R14/P9): cap was 16; only 9 were TYPE-blocked (all freed). The other 7 fail on
  undeclared callees/data (80142B2C 801535F4 80155E30 80157580 801576A8 80168F40 80170B48)
  -> the SS19 declaration-plumbing class, a recovery-tooling lever, NOT the type-lift
- check-all 136/136 byte-identical; fleet 58.00%% -> 58.35%%; dedup 1485 -> 1494 / 0 failed; 0 NON_MATCHING (G4)
2026-06-20 23:49:58 -06:00
Drew T de35505a63 feat(phase-19): scale the toolkit — 2 waves (88%/92%), fleet 56.64%->58.00%, propagation is the cap (v1.18.0)
- T1 (prior session, commit:0158/commit:0159): per-file -O0 split infra + 6 -O0 matches; deferred the
  10 %lo-folding-quirk fns + the ×134 rollout (R14 corrected "free ×134")
- T2 (commit:0161): recovery tooling. R14: the 3 Phase-18 "implicit-int" near-misses are NOT
  implicit-int -> resident-callee link-miss (NEW canon_resident_calls.py) + shared-caller arity
  (no-proto caller-extern fix). 3 matches; cookbook §17a-3 corrected
- T3 (commit:0162/commit:0163/commit:0164): 2 Ultracode waves over reach-134 tractable residuals. batch-1
  44/50 match_one (30 banked, 25 propagated ×134); batch-2 35/38 (25 banked, 10 propagated).
  NEW fix_arity_callers.py (no-proto, ALL 18 batch-2 failures were the arity class); canon-first
  2-stage gate (sig_unify REGRESSES canonical drafts); gen_harvest_targets garbled-sig fix
  (0/749, 88%->92%); build_engine_types --strip lift (+4 propagated)
- FINDING: propagation (not matching) caps the fleet-% yield — typedef/local-type bodies can't
  auto-propagate (-> Phase-20 type-lift lever). decomp.dev-comparable byte-weighted est ~30%
- check-all 136/136 BYTE-IDENTICAL (R22); dedup 1450->1485/0 failed; 0 NON_MATCHING (G4);
  fleet 56.64% -> 58.00% (+1.36%). worklog -> phase-ends/logs/Phase19.md (R19)
- bumps 1.17.0 -> 1.18.0
2026-06-20 20:33:00 -06:00
Drew T c43b6d0830 feat(phase-19): T3 struct-lift + propagation top-up — fleet 57.93%->58.00%
- build_engine_types.py --strip: lifted 48 named types -> src/shared/engine_types.h
  (byte-neutral, ov_SC01_077 d19c9580); unblocked +4 struct-using matches -> propagated ×134
  (incl. func_80147514, a T2 match freed by the lift)
- check-all 136/136 BYTE-IDENTICAL (R22); fleet 57.93% -> 58.00%; phase total 56.64% -> 58.00%
- KEY FINDING: propagation (not matching) now caps the fleet-% yield — ~16 banked matches stay
  ov_SC01_077-local because their bodies use typedef'd/anonymous/sibling local types that the
  named-struct-only build_engine_types can't lift (dedup_propagate compiles_standalone rejects).
  Phase-20 lever: extend the type-lift to typedefs -> recovers those ×134 for ~0 agent tokens
2026-06-20 19:57:34 -06:00
Drew T 3e99d2836d feat(phase-19): T3 batch-2 wave — 25 matched, 8 propagated ×134, fleet 57.62%->57.93%
- Ultracode wave (38 targets, clean hints after the gen_harvest_targets fix): 35/38 match_one
  MATCH (92%, up from 88%); 2 of 3 garble-retries now match; 3 DIFF = genuine (delay-slot
  schedule, call-crossing hoist-vs-remat, narrow-param STOP)
- gen_harvest_targets.py: fixed INLINE_DEF_RE (was matching indented `if(func_X(...)){`
  call-exprs as defs -> garbled callee hints agents pasted as externs); 0 garbled of 749
- whole-binary gate: 25 banked. ALL 18 stage failures were the shared-caller ARITY class ->
  NEW tools/fix_arity_callers.py automates the no-proto caller-extern recovery (+8); 10 remain
  = genuine loose-typing conflicts (caller sig != def sig), Phase-16 documented wall
- pipeline finding folded in: gate canon-only FIRST, sig_unify FALLBACK (.run/t3_gate2.sh)
- propagated 8 ×134 (17 stayed ov_SC01_077-local: inline named structs need engine_types lifting)
- check-all 136/136 BYTE-IDENTICAL (R22); dedup 1475->1483 validated/0 failed; 0 NON_MATCHING (G4)
- fleet byte-identical 57.62% -> 57.93% (+0.31%)
2026-06-20 19:51:50 -06:00
Drew T 2f9b0d9906 feat(phase-19): T3 batch-1 wave — 30 matched, 25 propagated ×134, fleet 56.64%->57.62%
- Ultracode wave (50 agents, §17 toolkit): 44/50 match_one MATCH (88%); 6 DIFF = genuine
  gcc-quirk tail (fold-const constant-last, GCSE/reload, loop-IV combine, reg time-sharing,
  narrow-param), correctly stubbed (no false matches)
- whole-binary gate (the sole arbiter, G3/P9): 30 banked. Two pipeline findings (R14):
  - sig_unify REGRESSES already-canonical agent drafts -> gate canon-only FIRST, sig_unify
    FALLBACK (.run/t3_gate2.sh) recovered +5 vs unconditional sig_unify
  - 2 arity conflicts recovered via the T2 no-proto caller-extern fix (func_8014AB7C/AC10)
- propagated 25 ×134 (dedup_propagate --auto-from; incl. the T2-deferred func_8017209C);
  ~5 stayed ov_SC01_077-local (inline named structs, need engine_types lifting)
- check-all 136/136 BYTE-IDENTICAL (R22); dedup 1450->1475 validated/0 failed;
  fleet byte-identical 56.64% -> 57.62% (+0.98%); 0 NON_MATCHING (G4)
- 14 still-failing (3 agent-garble from a gen_harvest_targets garbled-sig bug, 1 struct,
  10 genuine codegen near-miss) -> batch-2 retry candidates
2026-06-20 19:27:53 -06:00
Drew T 85afa0dc81 feat(phase-19): T2 recovery tooling — canon_resident_calls + no-proto caller fix (3 matches)
- R14 finding: the 3 Phase-18 "implicit-int / propagate-first" near-misses are NOT
  implicit-int (reproduced each through the byte-gate). Real classes:
  (a) resident-callee LINK-miss: draft calls func_<ADDR> but the addr has a curated
      name (0x8004CFEC = ratan2) -> "undefined reference to func_8004CFEC". NEW
      tools/canon_resident_calls.py rewrites func_<ADDR> -> curated name (pure draft
      text, body bytes unchanged) -> run FIRST in the recovery pipeline.
  (b) shared-caller ARITY conflict: an engine_core.h caller macro declares the callee
      file-scope `extern void func_X(void)` then calls func_X(); the real def takes an
      arg -> "conflicting types". FIX = caller extern -> no-proto `extern void func_X();`
      (byte-neutral for the caller; compatible with promotion-safe params int/long/ptr).
- 3 matches banked in ov_SC01_077: func_8017209C (ratan2 rewrite), func_80147514 (s32),
  func_80168F40 (void*); 2 no-proto lines in src/shared/engine_core.h
- recovery pipeline: draft -> canon_resident_calls -> sig_unify -> harvest_verify --chunk 1
- make check-all 136/136 BYTE-IDENTICAL (full extract, R22); dedup 1450 validated/0 failed;
  0 NON_MATCHING in any default build (G4); fleet 56.64% (the 3 are ov_SC01_077-local,
  x134 propagation rides T3/Phase-20)
- cookbook §17a-3 corrected (R14/R16); SETUP tool inventory (R21); CURRENT_PHASE T2 done
2026-06-20 17:12:00 -06:00
Drew T c8e9258426 docs(phase-19): cookbook §18 — per-file -O0 split mechanism + the %lo-folding residual (T1 flywheel) 2026-06-20 16:35:29 -06:00
Drew T 151da542ab docs(phase-18): cookbook §17a (toolkit at wave scale + pipeline-integration recovery) + CURRENT_PHASE Step-1 done
- §17a: measured wave close-rates (calibration 56%, Step-1 90% match_one); the match_one->gate gap
  is declaration plumbing (call-site casts not redeclaration + re-validate; stale sibling M2C_UNK decl
  reconcile; implicit-int caller class); two NEW residual classes (per-file -O0 + gcc loop-guard order)
- CURRENT_PHASE: Step 1 done, session arc 55.58->56.64%, Phase-19 deferrals listed
2026-06-20 14:41:46 -06:00
Drew T 6d9cd213a2 feat(phase-18): Step-1 recovery — +2 matches (func_8012F68C parse-fix x134, func_8012A418 sibling-decl reconcile)
- func_8012F68C: agent left a malformed 'extern if(...)' line -> fixed to a proper extern; gated x134.
- func_8012A418: reconciled a stale 'M2C_UNK func_8012A418()' sibling forward-decl to the real
  'void func_8012A418(void)' sig; byte-gated, banked REAL in ov_SC01_077 (local-type body, not shared-macro).
- Step-1 total: 22 reach-134 matches (18 propagated x134 + 4 local REAL); deferred to Phase 19:
  3 TU-integration cases (func_80147514/8017209C/80168F40, standalone-MATCH) + 3 codegen DIFFs
  (func_80131CA8/80150528/8014E5B4) + the per-file -O0 class (func_8013C360 +17 siblings) + 2 genuine
  residuals (func_8014F2E0 §10 sched, func_8012C2D0 loop-guard order).
- make check-all 136/136 byte-identical (R22); 0 NON_MATCHING (G4).
2026-06-20 14:39:51 -06:00
Drew T fa0d4a3f62 feat(phase-18): Step-1 wave banks 20 reach-134 matches (55.94->56.60%)
- bounded Step-1 wave (.run/harvest_wave_p18s1.js): 31 tractable reach-134 targets, agents
  taught §17 toolkit + embedded canonical callee sigs + call-site-cast/re-validate fix.
- match_one MATCH 28/31 (90%, vs calibration 12/16); whole-binary gate 20 verified:
  7 pins, 5 barrier, 1 array-decay, 2 call-site-cast, 12 reconstruct, 1 other. 17 propagated
  x134 (3 have h_exact membership <134 -> banked REAL in ov_SC01_077 only).
- fleet 55.94 -> 56.60%; make check-all 136/136 byte-identical (R22); 0 NON_MATCHING (G4).
- 3 DIFFs well-characterized: func_8013C360 = per-FILE -O0 class (18 scattered -O0 fns;
  agent's C byte-exact at -O0, needs an -O0 split file like src/boot.c -> Phase 19);
  func_8014F2E0 = §10 store-vs-load scheduler tie-break; func_8012C2D0 = NEW gcc loop-guard
  operand-order class (irreducible). 8 gate-fails are recoverable sibling-decl/parse cases.
2026-06-20 14:30:36 -06:00
Drew T d593ee20fe feat(phase-18): Step-3b calibration — §17-toolkit wave banks 9 reach-134 matches (55.58->55.94%)
- upgraded harvest wave (.run/harvest_wave_3b.js) teaches the §17 TOOLKIT: triage the
  match_one diff -> reconstruct / array-decay / register-pins+barrier (instead of stubbing
  the regalloc tail). Calibration: 16 fresh tractable reach-134 targets.
- whole-binary close-rate 9/16 = 56% (vs Phase-17 baseline 33%): 2 via register pins
  (func_8012CB64, func_801468C8), 2 via array-decay (func_80149544, func_80149584),
  5 via clean reconstruction. Each reach-134 -> propagated x134 (config/dedup.us.yaml +9).
- FINDING (R16 flywheel): the match_one->gate gap (12->6 then ->9) is the §3a call-site
  CASTS the agents skipped + sig_unify narrowing the extern to canonical -> conflict.
  Recovered 3 by call-site arity-cast / void-return cast (codegen-neutral). Step-1 prompt
  must teach call-site casts + re-validate after sig_unify.
- make check-all 136/136 byte-identical (R22); dedup-check 1432 validated, 0 failed;
  0 NON_MATCHING in any default build (G4).
2026-06-20 13:40:11 -06:00
Drew T 667504a4ba docs(phase-18): correct §17/§8e — register-order class is STEERABLE via pins (not unsteerable)
- §17 rewritten: the call-crossing register-ORDER class is MATCHABLE with register
  __asm__ pins + a scheduling barrier (byte-proven func_8012B8E4), not unsteerable.
  The wall was a missing lever (the pins), not an impossibility. Recipe documented as
  a TOOLKIT: triage with match_one -> reconstruct / array-decay / PINS / barrier.
- §16 cross-refs + hand-matching §8e corrected to match. The ONLY genuine stub-and-skip
  left is the narrow-param loose-typing conflict (func_80146A6C).
- self-correction (P9/R14): I concluded 'unsteerable' before trying the pins; Drew's
  hand-match-everything directive exposed the gap. Recorded honestly.
2026-06-20 12:33:08 -06:00
Drew T f1bbcd241f feat(phase-18): VERDICT REVERSED — func_8012B8E4 hand-matched via register pinning
The 'unsteerable' regalloc-order class is NOT unsteerable. Drew's directive (hand-match
everything) exposed the lever I'd skipped: explicit register pinning.

- func_8012B8E4 (the flagship circular reach-134 'unsteerable' fn): 21 -> MATCH via
  * register pins: register s32 d __asm__("$16"); register s32 s1ang __asm__("$17")
    -> FORCES the $s0/$s1 global allocation gcc otherwise density-orders the other way
  * branch-polarity invert (§3-T4): 24->21
  * explicit clamp temps (t=u6+0x1000; iVar4=u5-t): fixes the reassociation, 7->3
  * scheduling barrier __asm__ __volatile__("" : : "r"(u5)): anchors the last sll, 3->MATCH
- byte-gated (harvest_verify, G3/P9) + propagated x134 (per-overlay gate); 134 byte-identical
- recipe = §10-family hand technique (pins + barriers); labor-intensive (per-fn register map
  from the asm) but it WORKS -> the circular tail IS hand-matchable, not asm-only
- supersedes the T1-T5 'unsteerable' verdict; cookbook §17 + PhaseEnd to be revised accordingly
2026-06-20 12:17:54 -06:00
Drew T ceecaeb235 docs(phase-18): T5 — cookbook §17 (steerable-vs-not) + reconcile §10-vs-§16
- cookbook §17 (NEW): the compiler-quirk wall, gcc-2.7.2-source + Xenogears confirmed:
  * UNSTEERABLE: call-crossing $s0/$s1 allocation ORDER (global.c allocno_compare density;
    exhaustive C/flag/cc1 sweep + Xenogears ships-as-asm corroboration) -> stub it (G4)
  * STEERABLE idioms: array-decay-forces-remat (NEW), for-loop-vs-do-while delay-slot
    scheduling (NEW), statement-order (§2-T2 ext); + reconfirmed branch-polarity/mask-local
  * pipeline gotcha: match_one masks relocs -> sig_unify/canonical-retype is MANDATORY
    before harvest_verify (the conflicting-types gate failure)
  * loose-typing narrow-param wall is REAL (func_80146A6C lhu/s16 vs canonical s32/lw)
- §16 reconciled: the 'not source-steerable' line cross-refs §17; §10-vs-§16 tension
  resolved by naming the residual class precisely (both right about different residuals)
- hand-matching-process.md §8e: Phase-18 outcome re-scopes the Phase-19 wave
  (triage-and-stub the unsteerable; spend on non-walled STRUCTURAL_MISS)
2026-06-20 11:54:07 -06:00