Commit Graph

851 Commits

Author SHA1 Message Date
Drew T 7f18dbad2f feat(phase-29): func_8014CD80 x138 — the fresh-138 def-side blocker is RECOVERABLE (R35 reversal)
Bounded probe (SESSION-13, token-free) that REVERSED the same-session "fresh
reach-138 well is spent" verdict. Target func_8014CD80: 138 live, 0 matched, NO
DEFINE macro, a universal body (only universal callees + param offsets, zero
overlay-local D_* refs), clean MATCH draft from batch-1.

- Blocker was a def-side header decl: engine_core.h DEFINE_func_8014CD0C()
  forward-declares it `void func_8014CD80(s32,void*,void*)` while the byte-true
  def is `int func_8014CD80(s32,u16*,u16*)`. gate_stage's arity pre-pass is
  param-COUNT-only (misses return/ptr-type); §54 reconcile_def_sig fixes the
  wrong direction.
- One byte-neutral header edit (void->int, void*->u16*; call site passes u16[3]
  arrays + ignores the return -> codegen unchanged) -> harvest_verify banked x1
  BYTE-IDENTICAL -> dedup_propagate --addr propagated 138/138 overlays
  byte-identical (live 138->0) -> R22 clean-fleet 140/140.
- Fleet 78.7->78.8% instr, 88.22->88.26% fn-count from this one family;
  tools-health green (dedup 1851/0).

Quantified market (decision-log 2026-07-23): of the 75 fresh (>=100-live)
families, 46 carry an engine_core.h caller forward-decl, 38 SIMPLIFIED = the
func_8014CD80 pattern -> each a candidate x138 (~+1.5-2.8pp instr). NEXT: build
tools/fix_header_decl.py + a fresh-family wave. func_80165CA0's 0/135 was a
non-universal BODY (different failure mode), not this blocker.
2026-07-23 12:06:26 -06:00
Drew T 5760b39a1a docs(phase-29): SESSION-13 — diagnose the fresh-138 def-side blocker (header-decl reconcile is the missing tool) 2026-07-23 11:46:35 -06:00
Drew T 57ef4ebcb5 feat(phase-29): ov_SC07_006 reach-138 batch-1 propagation + live-count re-scope (SESSION-13)
Propagation of the 6 batch-1 x1 banks (§55b: banks committed first in commit:0848,
then targeted propagate as a standalone step):

- dedup_propagate --addr: func_801325B8 -> +3 onboarded-tail siblings
  (ov_SC07_007/010/011). func_8014A048/func_801678F0 byte-diverge in the SC07
  cluster (kept x1); func_8014FE60/func_80167540 local-type-blocked §20 (x1).
- func_80165CA0: consolidated its h_exact subgroup (dedup group registered, +0
  new), then family_sweep --hseq 0/135 — a PER-MEMBER WALL (cf func_80133AB0
  0/136). The x135 "fresh family" prize does not exist here.
- Net batch-1 yield ~9 newly-matched functions; fleet 78.6->78.7% instr, distinct
  flat; ov_SC07_006 84.6->84.8%. R22 clean-fleet 140/140; tools-health 1850/0.

The finding (R14/R35, decision-log 2026-07-23): nins*reach leverage over-counts —
rank by LIVE-siblings. build_wave_args.py --rank live now ranks by the true lever
and reports the fresh(76)/onboarded-tail(44) split. The reach-138 family well is
largely SPENT via wave+gate; the fresh families are the hard tail (def-side
plumbing/DIFF/per-member walls), not free x138 fuel.
2026-07-23 11:43:28 -06:00
Drew T b76ad85157 feat(phase-29): ov_SC07_006 reach-138 crack-wave batch-1 — 6 x1 banks
Option (b) from the SESSION-12 checkpoint: fresh-exemplar crack-wave on the
P27-onboarded ov_SC07_006 (84.6% -> 84.8%). New reusable builder
tools/build_wave_args.py emits wave_binary.js args from a fuel manifest.

- Drafting wave (wave_binary.js, 24 xHigh drafters over the top-24 reach-138
  WAVE families by leverage): 16 self-assessed MATCH, 8 hit the session usage
  limit (redraft later).
- Byte-gate: plain harvest_verify banked 2 (func_801325B8, func_80165CA0);
  gate_stage reconcile ladder (arity pre-pass + cast/sig_unify) banked +4
  (func_8014FE60, func_8014A048, func_801678F0, func_80167540). 7 near, 6
  reconcile-fail, 2 CC1-FAIL, 2 DIFF (the incomplete session-limit drafts).
- R14/R35 leverage reality-check: nins*reach over-counts. 5 of 6 are already
  matched in ~135 overlays (only the onboarded SC07 tail ov_SC07_007/010/011
  is live, +2-3 each). func_80165CA0 is a TRUE fresh family (135 live) — the
  x135 sweep prize, propagated next.
- R22 clean-fleet 140/140 (engine_core.h arity edit fleet-safe); tools-health
  green (dedup 1849/0). Propagation is the next commit (§55b: banks first).
2026-07-23 10:51:36 -06:00
Drew T 14166b8c47 docs(phase-29): SESSION-12 CHECKPOINT — non-jtbl wave 64 instances + gate_stage arity-undo fix + jtbl §62; fleet 78.6% instr / 67.6% distinct 2026-07-22 22:58:13 -06:00
Drew T e945933364 feat(phase-29): ov_SC06_018 non-jtbl wave batch-2 partial (5 x1 + 21 swept = 26 instances)
- batch-2 hit a usage limit mid-drafting (5 of 25 completed, all 5 MATCH); the 5 whole-
  binary banked via gate_stage --src-file, swept 5 families -> 21 members / 12 overlays.
- validates the gate_stage arity-undo fix (banks persist). R22 clean-fleet 140/140.
- non-jtbl wave running total (batch-1 + batch-2 partial): 13 x1 + 51 swept = 64 instances.
  fleet distinct 67.6% (+26 fns this batch), instr 78.6% steady, fn-count 88.22%.
- REMAINING (resume aids in CURRENT_PHASE): batch-2's 20 undrafted (.run/wave_b2_args.json)
  + batch-3's 30 (.run/wave_b3_args.json). Low-reach modal tail = low ROI (~0.1pp/batch).
2026-07-22 22:57:32 -06:00
Drew T 0aae4b2ce5 docs(phase-29): checkpoint non-jtbl wave batch-1 + gate_stage arity-undo fix (resume aids for batch 2/3) 2026-07-22 21:48:59 -06:00
Drew T 57af7ea889 feat(phase-29): ov_SC06_018 non-jtbl wave batch-1 (8 x1 + 30 swept = 38 instances) + fix gate_stage arity-undo revert bug
- batch-1 wave: 25 non-jtbl ov_SC06_018 targets (reach 3-14 modal), 13/25 match_one
  MATCH; whole-binary banked 8 (4 plain + 4 via gate_stage --src-file), swept 4 families
  -> 30 members across 13 overlays. 5 matches deferred (missing-sym/s58/deeper plumbing);
  12 nears are permuter fuel (several close=2/3/4).
- KEY: non-jtbl fns in a jr-split file need gate_stage --src-file <the jr TU> (the default-
  TU reconcile misses them -- same class as the jtbl --src-file fix).
- BUG FIX (R33): gate_stage's arity-undo snapshotted src/<bin>/*.c BEFORE _gate1 splices
  the banks there, so an unbanked draft in the batch triggered a snapshot-restore that
  SILENTLY REVERTED the banks (measured: a 9-draft run banked 4, the 5 unbanked reverted
  all 4 to INCLUDE_ASM). Fix: restore ONLY src/shared/ (the fleet hazard the snapshot
  exists for); the binary's own TU arity edits are local + byte-neutral. GATE_NO_ARITY=1
  was the interim workaround. s61's law from below (undo scope must not EXCEED write scope).
- incremental check-all 140/140 (concurrent with batch-2 drafting; full R22 after batch 2).
  fleet distinct 67.5->67.6% (+38 unique fns), instr 78.6% steady.
2026-07-22 21:48:17 -06:00
Drew T 3ebdd91fc6 feat(phase-29): jtbl post-carve reconcile (harvest_verify._jtbl_reconcile) + REFUTE the reach-138 jtbl families as plumbing wins
- ROOT CAUSE: the jtbl carve's s8b carried-decl layer conflicts with each draft's
  externs; the reconcile chain (cast_call_sites+reconcile_tu, --src-file-aware) exists
  but gate_stage runs it PRE-carve against the wrong TU (a jtbl fn's real TU is the
  split file, which doesn't exist until harvest_verify carves).
- FIX (cookbook s62): harvest_verify._jtbl_reconcile runs the chain POST-carve against
  the CARVED TU, draft-only rewrite, guarded by _jsnap is not None. Validated:
  func_80135260 (callee) + func_80191C50 (data) both conflicting-types -> genuine DIFF.
- FINDING (R14/R31 -> decision-log): dissolving the plumbing REVEALED all 4 jtbl drafts
  have a deeper issue -- func_80135260/80191C50 real %hi-share regalloc residual (agents'
  reloc-masked match_one MATCH over-claimed it); func_8012AAAC def-side-arity + FLEET-
  SHARED + still DIFFs after arity fix (def-side wall); func_80135EB0 isolate FAILED.
  The '+0.58pp from 3 reach-138 jtbl families' is REFUTED -- near-misses/walls, not
  plumbing. The fix banks any plumbing-ONLY jtbl fn + makes the jtbl gate honest.
- s61 traps re-confirmed (s62): gate jtbl ONE-AT-A-TIME (mid-batch isolate-FAIL corrupts
  the batch); fix_arity on an engine_core.h fn leaks fleet-wide (restore src/shared/ too).
- R22 clean-fleet 140/140; tool change only (no committed-byte change).
2026-07-22 20:01:10 -06:00
Drew T 7e3a234985 docs(phase-29): SESSION-11 CHECKPOINT — fresh-exemplar sweep is family-specific (100/85/0% across 3), fleet 78.4->78.6% instr 2026-07-22 18:24:48 -06:00
Drew T 215c5e2636 feat(phase-29): ov_SC06_018 func_8017D648 x71 (3rd thesis data point: modal family sweeps 85%)
- func_8017D648 (102, reach 82, MODAL/cross-address family): cracked fresh in ov_SC06_018
  (+ a byte-neutral s17a-1 callee-cast reconcile of func_8012F14C to the TU's 1-arg
  convention), banked x1, then swept 70/82 siblings (85%) via family_sweep --hseq
  --source ov_SC06_018 --allow-pins (+3 gate-fail, +8 remap-refused unresolved-immediates).
- 3rd data point for the family-specific finding: across 3 thesis families the fresh-
  exemplar sweep rate is 100% (func_801365B8) / 0% (func_80133AB0) / 85% (func_8017D648).
  Refined model (-> decision-log): the sweep works for the MAJORITY of families at high
  per-family rates, with a genuine per-member-wall minority; cracking is the generator.
- R22 clean-fleet 140/140 byte-identical; tools-health green; 0 NON_MATCHING.
  fleet 78.5->78.6% instr / 88.18->88.20% fn (session net 78.4->78.6 instr / 67.1->67.5 distinct).
2026-07-22 18:23:58 -06:00
Drew T f142a6858f feat(phase-29): ov_SC06_018 crack-wave — func_801365B8 x138 (fresh-exemplar sweep CONFIRMED), thesis is family-specific
- binary-aware crack wave (new tools/workflows/wave_binary.js): 8-target calibration
  over ov_SC06_018 substantial stubs, 7/8 match_one MATCH
- func_801365B8 (155, reach 133): cracked FRESH in ov_SC06_018, swept 132/132 siblings
  via family_sweep --hseq --source ov_SC06_018 --allow-pins -- SESSION-10 refused this
  family 0/133 from an ov077 exemplar. THESIS CONFIRMED (fresh exemplar unlocks it).
- func_80133AB0 (137, reach 137): cracked fresh + banked x1 (+ a byte-neutral s17a-1
  cast reconcile of banked caller func_801343C4), but the family sweep FAILED 0/136 even
  from the fresh exemplar (reverted clean) -- THESIS REFUTED for this family.
- FINDING (R14/R31 -> decision-log): the fresh-exemplar sweep is FAMILY-SPECIFIC, not a
  blanket mechanical x137. A fresh crack is necessary but not sufficient; the byte-gate
  arbitrates each family (~50% on this 2-family sample -> discount the ~1.5pp estimate).
- tooling (R33): family_sweep --source override now searches matched_members (a fresh
  member leaves 'members' after a sig-regen); cdecl._depth0_spans consumes backslash
  line-continuations so a raw-draft #define macro no longer trips audit-cdecl.
- R22 clean-fleet 140/140 byte-identical; tools-health green (dedup 1849/0, C1 234615);
  0 NON_MATCHING. fleet 78.4->78.5% instr / 67.1->67.5% distinct / 88.14->88.18% fn-count.
2026-07-22 18:12:09 -06:00
Drew T d53a33eb06 docs(phase-29): SESSION-10 CHECKPOINT — five tooling walls, the gate SHA bug, main in the denominators 2026-07-22 16:25:50 -06:00
Drew T 124ada384b docs(phase-29): zero-crack vein tapped (exemplar provenance is the discriminator); metrics contract met 2026-07-22 16:23:30 -06:00
Drew T 80d570195c feat(phase-29): add main to the weighted denominators (roadmap §1 metrics contract)
The contract requires all three headline metrics to include the main EXE. Since
Phase-27 T10 main was reported as a SEPARATE provisional line, so the headline
silently measured 139 of 140 binaries — and flattered itself by omitting the
LEAST-decompiled one.

RESTATED CAVEAT (the old "stale, PROVISIONAL" wording was misleading): main's sig
is Ghidra's (2026-06-14), but function BOUNDARIES derive from the original bytes
and do not change, and matched-vs-stub comes from the LIVE corpus.stubs — so the
numbers do NOT drift. The real limitation is R34: sig_image cannot independently
validate a PS-X EXE's boundaries, so main has no SECOND, DISAGREEING oracle for the
PHANTOM/TRUNCATED class. The sig also excludes the LINKED PsyQ objects, which is
exactly right for a GAME-CODE contract.

EFFECT — the headline DROPS, which is the point:
  instr-weighted  78.7% -> 78.4%   (10,299,493 / 13,141,652)
  distinct-code   67.9% -> 67.1%   (3,782,990 / 5,634,875)
A continuity line reports the ex-main figure so pre-2026-07-22 readings stay
comparable, and the binary-count label is corrected to "main + resident + 138
overlays" (it read "resident+139 overlays").

Metrics-only change; no build impact (ov_SC06_018 re-verified BYTE-IDENTICAL).
2026-07-22 15:43:48 -06:00
Drew T b1d8c0cf39 docs(phase-29): zero-crack sweep track, revert fix, floor-verdict artifact corrected 2026-07-22 15:25:20 -06:00
Drew T c6515a6cdc fix(phase-29): the FLOOR VERDICT was an artifact of snapshot frequency, not yield decay
burndown.py averaged the last 3 INTER-COMMIT deltas. The phase's ROI criterion is
"per-SESSION yield floors out", and historically one snapshot was taken per session
— but I seeded THREE inside this session (9, 9b, 9c). Averaging them drove the mean
to +0.23 and printed "AT THE FLOOR — consider closing P29" for a session that
actually yielded +0.7pp instr (78.0 -> 78.7), comparable to recent sessions.

I nearly closed the phase on it. Same error class as everything else this session:
an instrument answering a DIFFERENT QUESTION than the one asked, where the wrong
answer is indistinguishable from the right one.

- --session-close marks a snapshot as a session boundary; the floor verdict is now
  computed ONLY from those (older records predate the flag, so a label containing
  "close" counts too). Mid-session snapshots still record for tracking.
- honest output now: "0 SESSION-to-SESSION delta(s) logged — need >=3 for a floor
  verdict (1 session-close snapshot on record)".

=> P29 must NOT close on ROI grounds yet: the floor is UNDETERMINED and needs 3
session closes to become computable. The eyeballed "+2.5 -> +1.1 -> +0.6 -> +0.2"
trend is not the instrument's verdict either.
2026-07-22 15:24:59 -06:00
Drew T 11a22b5c77 feat(phase-29): func_80167714 propagated ×134 (h_exact; 4 SC07 byte-diverge, kept ×1) 2026-07-22 15:18:58 -06:00
Drew T 372bff1153 fix(phase-29): jtbl_family_bank's revert left the tree GIT-CLEAN BUT UNBUILDABLE
Restoring config/ from git does NOT rewind asm/, so a reverted overlay was left
with stale extraction — and `git status` is structurally blind to it (the R22
corollary, here inside a tool's own undo path). Within a sweep each sibling is a
DIFFERENT overlay, so the next sibling's own extract never repairs the previous
one: the damage persists to whatever runs next.

Byte-witnessed on the 0x8013C414 probe: after 3 gate-fails `git status` was EMPTY
and ov_SC01_004 failed to link (`undefined reference to jtbl_8018DAC8`).

- revert() now RE-EXTRACTS (extract=True default); the clean-slate call at the top
  of bank_one passes extract=False since it extracts immediately afterwards anyway
- revert() only `git checkout`s a TRACKED path: an isolation creates region .c
  files that were never added, and checkout on those emitted `error: pathspec ...
  did not match any file(s) known to git` while doing nothing. The keep_regions
  cleanup removes them instead.

NEGATIVE CONTROL: the same probe now gate-fails 3/3 as before, and all three
overlays build BYTE-IDENTICAL afterwards with a clean git status.
2026-07-22 14:52:02 -06:00
Drew T a609f43338 docs(phase-29): Task-7 burn-down live (floor NOT yet determinable), zero-crack track, jtbl_family_bank revert defect 2026-07-22 14:45:59 -06:00
Drew T 49b66cd56b feat(phase-29): func_801299C8 family COMPLETE 137/137 (~21.6k ins) 2026-07-22 14:41:57 -06:00
Drew T 8887cf87bc feat(phase-29): func_801299C8 sweep chunk 2 — 45/45 banked 2026-07-22 14:36:09 -06:00
Drew T 048edcc6c2 feat(phase-29): func_801299C8 sweep chunk 1 — 45/45 banked 2026-07-22 14:30:07 -06:00
Drew T 540f096502 feat(phase-29): func_801299C8 family probe — 3/3 banked 2026-07-22 14:22:58 -06:00
Drew T 9c9ee6ea94 chore(phase-29): burn-down snapshot + regenerated digests 2026-07-22 14:20:28 -06:00
Drew T 6ff05498c8 docs(phase-29): decision-log — the shared gate compared against another binary's hash (R31) 2026-07-22 14:12:59 -06:00
Drew T 64bfe59bc0 fix(phase-29): gate_stage gated EVERY non-077 binary against ov_SC01_077's SHA — one-line default, one month
THE BUG (tools/gate_stage.py main(), introduced commit:0181, 2026-06-21, Phase 21 T3):

    good_sha=a.good_sha or DEF_SHA,      # DEF_SHA = ov_SC01_077's locked hash

DEF_SHA is TRUTHY, so it beat run_gate's per-binary lookup
(`good_sha or _check_sha(binary) or DEF_SHA`) and made that lookup DEAD CODE on
every CLI invocation. gate_stage therefore BUILT one binary and compared it to a
DIFFERENT binary's hash: it can never match, every draft reports as "near", and
NOTHING COULD EVER BANK outside ov_SC01_077 from the CLI. A "near" is
indistinguishable from a genuine codegen residual, so the failure looked like a
compiler wall for a month.

WHY IT HID: the programmatic callers take a different path and were all correct —
grinder/idiom_hunt pass good_sha=None (per-binary lookup), lora_grind/bulk_harvest
pass an explicit per-binary sha, orchestrator is 077-only where DEF_SHA is right.
That is exactly why the grinder banked func_80181F78 in ov_SC03_014 (Task 13B)
while my CLI ladder banked 0/10 on the same tree. Two paths disagreed for a month
and nothing compared them (R34's lesson, from the inside).

BLAST RADIUS, MEASURED (not assumed): 0 of 6,708 backlog records come from the
affected path — by source: worker 2724 / bulk-harvest 2275 / lora-grind 766 /
grinder 522, all correct. THE BACKLOG NEEDS NO RE-RUN. The void verdicts are the
manual CLI gates on non-077 binaries, i.e. exactly the Task-5 wave's "the gate
banked ZERO" on 12 preserved cracks — never a codegen finding at all.

FIXED: pass a.good_sha through; run_gate reads config/check.<bin>.sha (R33).
VALIDATED end-to-end: the raw draft that produced {banked:0, near:1} now gives
{banked:1}.

RE-RUN RESULT — 7 of the 12 preserved t5wave cracks are now banked:
  func_8018F694 (478) · func_8019059C (673) · func_80135A4C (181) ·
  func_80135888 (113) · func_80135D20 (100) · func_801749C8 (105) ·
  func_801299C8 (158, was filed "PLUMBING: prototype declaration")
STILL BLOCKED (5, believed genuine): func_8012AAAC, func_80135260, func_801365B8,
func_80165CA0, func_80191C50.

⚠️ SUPERSEDES the earlier retraction: the "0/10 ladder" was not vague interference
— it was the gate comparing against the wrong binary's hash. Task 14 stages 2-3
were priced against a number that could only ever have been zero.

- R22 clean-fleet 140/140 BYTE-IDENTICAL; all 6 verified stub-free
2026-07-22 14:12:32 -06:00
Drew T 8016c172f9 docs(phase-29): SESSION-9 CHECKPOINT — sweep 274 siblings, the PURE≠templatable finding, the tooling answer 2026-07-22 13:47:14 -06:00
Drew T 05f9b20f1d feat(phase-29): func_80135D20 family COMPLETE 137/137 (~13.7k ins) 2026-07-22 13:31:24 -06:00
Drew T 595b6476f9 feat(phase-29): func_80135D20 sweep chunk 2 — 46/46 banked 2026-07-22 13:16:35 -06:00
Drew T c56de627e0 feat(phase-29): func_80135D20 sweep chunk 1 — 46/46 banked 2026-07-22 12:57:09 -06:00
Drew T adf379fb88 feat(phase-29): func_80135888 family COMPLETE 137/137 (~15.5k ins) 2026-07-22 12:34:57 -06:00
Drew T fbed540ef2 feat(phase-29): func_80135888 sweep chunk 2 — 46/46 banked 2026-07-22 12:14:04 -06:00
Drew T c1c910ffdc feat(phase-29): func_80135888 sweep chunk 1 — 46/46 banked 2026-07-22 11:53:35 -06:00
Drew T e4f8bdca3c chore(phase-29): refresh backlog ledger 2026-07-22 11:24:57 -06:00
Drew T 84fd6c785a docs(phase-29): the isolation-must-follow-the-splice finding, 5/11 cracks banked, and the retraction 2026-07-22 11:24:36 -06:00
Drew T 52e772628b feat(phase-29): isolate-with-body FIX + 3 more preserved cracks banked (incl. a 673-ins giant)
THE FIX (harvest_verify._jtbl_prep_one): isolate WITH THE BODY STILL SPLICED.
jr_isolate_all accumulates each object's file-scope decls as the new region's
`ambient` set, so partitioning around an INCLUDE_ASM stub hands the region a
DIFFERENT decl context than the draft's body needs — and the gate then produced a
byte-DIFF rather than a compile error, which is why a batch of these read as
"9 compile / 0 bank" and looked like a codegen wall. §61b's law extends one step:
THE CARVE MUST FOLLOW THE SPLICE — AND SO MUST THE ISOLATION.

The un-splice existed only because the tool is stub-centric (a spliced fn is no
longer in corpus.stubs). New _unsplice_body() handles that properly: it finds the
file that NOW holds the body (isolation may have MOVED it into a fresh region file)
and writes back the stub line for THAT subseg, so the gate re-splices identical text.

BANKED via the corrected path (each whole-binary byte-gated, one per invocation):
  func_80135D20  (100 ins, reach 138)
  func_801749C8  (105 ins, reach 136)
  func_8019059C  (673 ins, reach 3 — a giant)
Together with func_80135888 and func_8018F694 earlier: 5 of the 11 preserved
t5wave cracks are now banked.

THE REMAINING 6, honestly classed: 2 genuine DIFF (func_80135260, func_80191C50),
2 CC1-FAIL (func_801365B8, func_80165CA0), 2 §57 self-decl plumbing
(func_801299C8 `prototype declaration`, func_8012AAAC own-name conflict).

⚠️ RETRACTION: the earlier "the ladder converts 0/10, which prices Task 14 stages
2-3" is WRONG and is withdrawn. Three of those ten bank through harvest_verify
alone with the SAME transformed drafts that gate_stage rejected — so that 0/10 was
measuring gate_stage's own interference, not the residuals. Prime suspect is the
arity pre-pass (fix_arity_callers --apply --any-proto edits engine_core.h before
the gate; the §19 regression mode). GATE_NO_ARITY=1 is the ready A/B. Task 14
stages 2-3 remain UNPRICED until that runs.

- R22 clean-fleet 140/140 BYTE-IDENTICAL; tree clean before and after
2026-07-22 11:18:43 -06:00
Drew T 1ded372164 feat(phase-29): func_80135888 (113 ins, reach-138) BANKED — the isolation must keep the BODY spliced
THE DIAGNOSIS (the recommended next task) did not find an image-level difference:
performed manually, there is no difference. The recipe

    splice draft -> jtbl_carve (NON-CONTIGUOUS) -> jr_isolate_all --only <fn>
    WITH THE BODY STILL SPLICED -> make extract -> jtbl_carve -> make extract -> build

yields BYTE-IDENTICAL (R22 clean-fleet 140/140). The draft was never wrong.

THE DIFFERENCE from the ladder path is one line: harvest_verify._jtbl_prep_one
UN-SPLICES before isolating, so jr_isolate_all partitions a TU in which the
function is still INCLUDE_ASM. jr_isolate_all accumulates each object's file-scope
decls as the new region's `ambient` set, so partitioning around a stub gives the
region a DIFFERENT decl context than the one the draft's body needs — and the gate
then builds a byte-DIFF rather than a compile error, which is why it read as
"9/10 compile, 0 bank" and looked like a codegen wall.

So §61b's law — THE CARVE MUST FOLLOW THE SPLICE — extends one step further:
THE ISOLATION MUST FOLLOW THE SPLICE TOO. The un-splice exists because after
isolating with the body in, the function is a real C def and corpus.stubs no longer
lists it (the tool is stub-centric). That is a fixable plumbing problem, not a
reason to isolate around a stub.

- func_80135888: 113 ins x reach 138 = 15,594 instruction-instances (~0.12pp) once
  swept; banked x1 here, sweep is its own batch (§55b)
- R22 clean-fleet 140/140 BYTE-IDENTICAL; tree verified clean before and after
- the other 9 residuals are now expected to be the same class — to be re-run through
  the corrected sequence, one per invocation (§61c fault 2 stands)
2026-07-22 10:58:08 -06:00
Drew T 7529ee3d86 docs(phase-29): SESSION-8 CHECKPOINT — §61c refuted, the tree-eating undo fixed, family ×138 + a giant banked 2026-07-22 01:57:04 -06:00
Drew T 02b16fa7a7 refactor(phase-29): DELETE gate_stage's jtbl pre-pass (R33) + the honest ladder measurement
gate_stage._jtbl_prepare carried the SAME config-only undo as harvest_verify's did,
and ate the tree again on the first ladder run: 5 orphan region files, truncated
TUs, `undefined reference to func_80192F64`. That INVALIDATED the run's 0/10, so it
was re-measured rather than reported (R35 — a probe from a broken tool is not
evidence). Tree restored from HEAD and re-verified byte-identical first.

DELETED, not patched (R33 — the best outcome is a deleted stage). It was wrong on
two independent axes:
  1. §61b already byte-proved THE CARVE MUST FOLLOW THE SPLICE. A batch pre-pass
     carving unspliced functions reports "prepared" and yields a spec that fails
     once the body lands — which is why it banked nothing.
  2. Its undo snapshotted only config/, while jr_isolate_all rewrites region 0 back
     over the ORIGINAL src/<ov>/<nm>.c truncated.
harvest_verify's per-draft prep is the correct mechanism, snapshots the full source
set, and undoes per function. Two implementations of one capability, the outer one
ineffective AND destructive.

THE HONEST RE-MEASUREMENT (clean tree; tree verified clean after):
- 0/10 bank, but 9/10 now COMPILE and land as whole-binary byte-DIFF; 1/10 plumbing.
- match_one close=0 on several (the function's own bytes exact) and rtu_match says
  MATCH-in-real-TU for func_80135888 — while func_801299C8's transformed draft does
  not compile in its real TU at all. The residual is MIXED, not uniform; at least one
  is an IMAGE-level effect rather than the draft or its TU decl context (prime
  suspect: jtbl/rodata carve placement). NOT generalized from one data point.
- This PRICES Task 14 stages 2-3 by measurement: the existing ladder converts 0 of
  10, so they are not "wire in normalize_self_decls + the type-lift and collect ten
  banks" — the projection error §57a already caught once this phase.

- R22 clean-fleet 140/140 BYTE-IDENTICAL with the giant func_8018F694 banked and the
  func_80135A4C family swept 138/138
- cookbook §61d (the tree-eating undo in two tools; the constant-label defect; the
  re-probe + ladder measurements; the general rule: an undo whose scope is narrower
  than its write scope destroys work no byte-gate can see)
- decision-log + CURRENT_PHASE updated (R30/R31)
2026-07-22 01:55:47 -06:00
Drew T fcd83f705e fix(phase-29): the undo was EATING the tree — snapshot src too; kill the §58 label; giant func_8018F694 banked
THE DEFECT (byte-witnessed, and it is the §61c mechanism). `jr_isolate_all`
repartitions a code object by writing region 0 back over the ORIGINAL
src/<ov>/<nm>.c — TRUNCATED to just that region — and emitting the rest as new
_jr_<lo>.c files. `_jtbl_restore` undid only config/ + the new region files, so
every gate-REJECTED draft left the original TU permanently truncated and its
stubs gone. Nothing regenerates them (splat does not rewrite a committed overlay
.c). Measured across an 11-draft re-probe: live stubs 419 -> 414 -> 406 -> 395,
ending in `undefined reference to func_80191C50`.

It is INVISIBLE to the gate that causes it: the incremental build keeps linking
stale objects (§42b) so `make build` stays green while a CLEAN rebuild fails.
That is exactly the "139/140, twice" signature that became the §61c blocker —
the tree was being eaten by the undo meant to protect it. The §61c attribution
(batch _jtbl_prep residue) is now a demonstrated defect, not an inference.

FIXES (both negative-control-validated on a draft that fails):
- _jtbl_snapshot captures every src/<binary>/*.c; _jtbl_restore restores them and
  removes exactly the files the attempt created (derived from the snapshot's file
  set, not re-guessed from the _jr_* name shape, R33). Undo by SNAPSHOT-RESTORE,
  never an inverse transform — §61's law one level deeper. Same failing draft that
  previously broke the tree now leaves it byte-identical, git status clean.
- classify_fail ignores `warning:` lines. The benign `conflicting types for
  built-in function 'memcpy'` warning was winning the match on 8 of 8 failures
  across four different real causes — a label identical for every input, which the
  cookbook had to work around by hand ("the gate label is useless here, splice
  individually and read real cc1 stderr"). Now reports the real error, and falls
  through to CC1-FAIL:<last error line> rather than guessing.

THE RE-PROBE THIS ENABLED (11 preserved t5wave cracks, one invocation each):
- BANKED: func_8018F694 (478 ins) — one of the wave's three giants, previously
  recorded as part of "the gate banked ZERO".
- The other 10 now carry TEN DISTINCT diagnoses: 4 data-decl conflicts (D_80193B64
  x2, D_8011D030, D_80126B5C), 3 callee-decl (func_80135480 x2, func_8012F14C),
  3 self-decl/own-sig (§57). ZERO jtbl-drift, ZERO local-type redefinition, ZERO
  codegen DIFF.
- So §61a's "§8e-2 jtbl table-count drift blocks 10 of 12" does NOT survive the
  carve-follows-splice prep: the carve now succeeds and what is left is ordinary
  decl plumbing the existing ladder already handles (cast_call_sites / reconcile_tu
  / normalize_self_decls / fix_arity_callers) = Task 14 stages 2-3, no new tooling.

- ov_SC06_018 BYTE-IDENTICAL cbbc4f44 with the giant banked; nothing committed broken
  at any point (tree was restored from HEAD and re-verified before these fixes)
- cookbook: the `git add -u` complementary hole (an isolation's NEW region file is
  untracked, so a carve/isolation bank needs `git add -A src/ config/`)
2026-07-22 01:30:30 -06:00
Drew T 01882c58d7 feat(phase-29): func_80135A4C family sweep chunk 3 — 46/46 siblings banked (family COMPLETE 138/138) 2026-07-22 01:21:19 -06:00
Drew T 18e989ca07 feat(phase-29): func_80135A4C family sweep chunk 2 — 45/45 siblings banked 2026-07-22 01:08:55 -06:00
Drew T 115a6c536f feat(phase-29): func_80135A4C family sweep chunk 1 — 45/45 siblings banked 2026-07-22 00:56:45 -06:00
Drew T b70fb3a728 feat(phase-29): func_80135A4C family sweep probe — ov_SC01_000 banked (mechanism validated) 2026-07-22 00:42:36 -06:00
Drew T 12a14410f9 fix(phase-29): §61c REFUTED — the jtbl bank IS clean-reproducible; func_80135A4C banked ×1
The session-7 checkpoint gated the entire jtbl track behind one finding: the
carve+isolation path yields a bank that is incrementally valid and clean-invalid
(139/140, [FAIL] ov_SC06_018, "twice, identically"). The prescribed diagnosis
(diff the incremental vs clean object set) never ran, because the failure does
not reproduce.

MEASURED, with the bank applied through the single-function automated path
(harvest_verify --chunk 1 -> [jtbl] carved -> + chunk(1) -> BYTE-IDENTICAL):
  per-binary clean (rm asm+build; extract; build)  -> BYTE-IDENTICAL cbbc4f44
  make clean && extract-all && check-all  (run 1)  -> 140 passed, 0 failed of 140
  make clean && extract-all && check-all  (run 2)  -> 140 passed, 0 failed of 140

ATTRIBUTION (best-supported; the failing tree is gone): the 139/140 runs were
taken on the tree left by the BATCH _jtbl_prep (6 table-bearing -> 1 carved,
4 isolate-FAILED, 1 stale-asm carve fail) — five failed preps' residue of
stranded carves + half-applied isolations. The per-function snapshot-restore
that removes exactly that residue landed AFTER those runs, in commit:0803, the
same commit that named the blocker.

THE LESSON (R35 on ourselves, -> decision-log): "twice, identically" was not a
replication — two reads of the SAME contaminated state is one observation. A
replication must RE-CREATE the state, not re-run the check. Standing guard:
re-apply a fault from a known-clean tree before writing it down as a property
of the mechanism. Sixth "structural wall" to resolve to our own tree/tooling.

- BANKED: func_80135A4C (181 ins) x1 in ov_SC06_018 — isolated into its own
  code subseg + .rodata carve (single-table, no JTBL_PADS; tail3..tail18 renumber)
- §61c faults 1-2 STAND: a stranded carve poisons the overlay; per-function undo
  is unsound in a batch -> ONE jtbl draft per harvest_verify invocation.
  jr_inventory's 1:1 ownership assertion was right and is unchanged.
- UNFROZEN: this family = 138 members / PURE / 24,978 ins ~ +0.19pp (jtbl_family_bank,
  §53 carve law); the 9 preserved t5wave cracks (Task 14 stages 2-3, §57 plumbing)
- R22 clean-fleet 140/140 x2; tools-health OK (dedup 1848/0, C1 234481/234481,
  cdecl 53189/53189, audit-binaries 140); 0 NON_MATCHING (G4)
- fleet 78.0% instr / 66.5% distinct / 87.95% fn-count
- also: preserve the 4 untracked wave-4 .o0 drafts (R20); killed an orphaned cc1
  from the Jul-21 session burning a full core for 13h23m
2026-07-22 00:40:26 -06:00
Drew T e1e77c7482 docs(phase-29): SESSION-7 CHECKPOINT — full fresh-session block (§61c is the single next task) 2026-07-22 00:12:04 -06:00
Drew T 0cf6356ffd docs(phase-29): jr_inventory was right; the clean-rebuild blocker stops jtbl banking 2026-07-21 23:51:38 -06:00
Drew T 41d65af73f fix(phase-29): per-function jtbl prep + stranded-carve undo; the clean-rebuild blocker named
THE BLOCKING FINDING (§61c): the jtbl carve+isolation path yields a state that is
INCREMENTALLY valid and CLEAN-INVALID. func_80135A4C banks every time through the automated
path (BYTE-IDENTICAL at harvest_verify's gate) and fails `make clean && extract-all &&
check-all` twice, identically (139/140, [FAIL] ov_SC06_018). The bank is therefore NOT
reproducible from committed config + source, and the gate that authorises it cannot see the
defect because the gate IS the incremental build (§42b, most expensive form).
=> NO jtbl core can be banked until that divergence is diagnosed. Next step is to diff the
incremental vs clean build/ov_SC06_018/** object set + generated .ld/asm for the carved
subseg — NOT to bank more. All 12 wave cracks stay preserved at .run/giants/t5wave_*.

TWO REAL DESIGN FAULTS FOUND AND FIXED IN harvest_verify:
1. A stranded carve poisons the overlay. _jtbl_prep carved a draft the gate then REJECTED;
   the carve remained with NO owner (the fn is still INCLUDE_ASM), and jr_inventory's 1:1
   ownership assertion then refused every later isolation in that overlay
   ([('UNOWNED','0x801d288c')] = func_801299C8's table). THE ASSERTION WAS RIGHT AND CAUGHT IT
   — R32/R33 working as designed; the defect was mine for leaving the carve behind. Fixed:
   per-function carve + exact snapshot-restore (config text + only this attempt's region files)
   on gate rejection.
2. Per-function undo is UNSOUND IN A BATCH: isolation REPARTITIONS shared source, so restoring
   one draft's snapshot deletes region files now hosting OTHER pending drafts, and their stubs
   vanish (KeyError in render). jtbl drafts must run one per harvest_verify invocation, or the
   undo must be region-aware.

MEASURED so it is not re-derived: of 11 preserved cracks exactly ONE (func_80135A4C) reaches
byte-identical through the carve path; the other 4 table-bearing ones fail one-at-a-time too,
on PLUMBING (§57 self-decl et al), not the carve.

Tree reverted; clean-fleet 140/140; nothing banked. cookbook §61c.
2026-07-21 23:51:16 -06:00
Drew T 86e262e844 docs(phase-29): jtbl-in-harvest_verify result + the jr_inventory ownership blocker 2026-07-21 22:13:50 -06:00