From a4ef9064f53585db17c025077343914b2cc41edd Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Fri, 2 Oct 2026 02:42:17 -0600 Subject: [PATCH] T3: handoff: sweep S1-S54 done, c5 field additions in flight --- phase-ends/current/TASK_PROGRESS.md | 37 +++++++++++++++++++++++++++++ phase-ends/current/logs/T3.c5.md | 24 +++++++++++++++++++ phase-ends/current/logs/T3.md | 4 ++++ 3 files changed, 65 insertions(+) create mode 100644 phase-ends/current/TASK_PROGRESS.md create mode 100644 phase-ends/current/logs/T3.c5.md diff --git a/phase-ends/current/TASK_PROGRESS.md b/phase-ends/current/TASK_PROGRESS.md new file mode 100644 index 0000000000..31499edcee --- /dev/null +++ b/phase-ends/current/TASK_PROGRESS.md @@ -0,0 +1,37 @@ +# TASK_PROGRESS — T3 (attempt 1) + +## Done so far +- T3.c1 (3ff15ee462, 3507628e40, fe2e814776): restruct rung S per-site classes, KEPT()/RESIDUAL(), CAST_* respell of kept P sites, `--only` glob; exemplar ov_SC05_010_jr_80180F84.c. +- T3.c2 (d476f3c92e): `--bbt` / RESTRUCT_BBT pin (.run/P39/census/body_base_type.json, untracked, never rewritten) + s_finished. +- T3.c3 (568de6c713, 357451cbb9, e88040d15a): apply uses the pin; s_judged. +- T3.c4 (0938e511ed..ffc0d3ecc1): unbacked 96 → 0 (alias-def params, S_PRIOR carry, nested base drift). +- Sweep: t3_S1..S54 committed by restruct_cycle.sh, every batch R22 218/218 (logs .run/P39/restruct/cycle_t3_{a,b,c,d,e}.log). Ends at HEAD b0951592bd (S55..S60 committed no src change). +- Full timeline: phase-ends/current/logs/T3.md. + +## In flight +- T3.c5 (coder-opus55, background, log phase-ends/current/logs/T3.c5.md): fix the 6-file plan/apply loop (S55..S61), site_row type on every site, batched NO-FIELD field additions in canonical headers (one R22), re-draw affected bodies. It may still be running: check `git log --oneline -8` for T3.c5 commits and `pgrep -af 'restruct|make check-all'` before touching tools/restruct.py, src or headers. + +## Hypotheses rejected +- Drift via unpinned bbt in apply: wrong; c3 found s_body_edits checked the live struct_map first (NO-TYPE-IN-MAP). + +## Current hypothesis +- After c5, remaining done-when gaps: (a) coverage — ov bodies with P/X sites but no S row (files never drawable: all bases TYPE-NOT-CANONICAL) need RESIDUAL rows + a check that counts uncovered ov P/X sites = 0; (b) summary numbers. + +## Next five steps +1. Read T3.c5 return (VERIFIED lines); confirm check-casts unbacked 0. +2. Coder T3.c6: residual rows for uncovered ov bodies (cause per site: TYPE-NOT-CANONICAL / NO-TYPE-IN-MAP / NON-STRUCT / untyped) + `restruct --check-residue --only "ov_*"` → 0 uncovered; R22 not needed (ledger only). +3. Re-run .run/T3/resid.py for per-cause counts; check-casts for P/X before (P 408,974, X 13,800) vs after. +4. Run verify: `PY tools/type_census.py --check-casts --quiet` (rc 1 expected, read ov P/X), `PY tools/type_census.py --check-structs --quiet && make clean && make extract-all JOBS=16 && make check-all JOBS=16` (bg + wait). +5. Write logs/T3.md tail + tasks/T3.md; `PY tools/task_log.py finish T3`; `bash tools/commit_task.sh T3 "..."`. + +## Gotchas +- restruct_cycle.sh ignores SIGINT during R22; stop it with TERM on the script pid and its `bash -c` parent, then kill the make/xargs children; `restruct --restore` afterwards. +- `pgrep -f 'restruct.py --apply'` in a kill loop matches your own shell (exit 144). +- Per-batch overhead (calibrate + R22 + census) is ~20 min; batch 200 files once apply time is small. +- plan_S weights come from the drifted live map (order alphabetical); harmless. +- harness: the hook denies `--help | head` style pipes on tool help and `cat` of SKILL files; use Read. + +## State to carry verbatim +- Cycle launch: `setsid nohup bash -c 'RESTRUCT_BBT=.run/P39/census/body_base_type.json LABEL_PREFIX=t3_ TASK=T3 bash tools/restruct_cycle.sh 200 S "ov_*"; echo "cycle exit=$?"' > .run/P39/restruct/cycle_t3_.log 2>&1 &` +- Baseline denominators: P 408,974 · I 60,666 · X 13,800 · M 19,542; ov raw 478,494. +- check-casts after c4: macros CAST_ALIAS 555 SIGN 5238 WIDTH 3966 MISALIGNED 258 NONSTRUCT 208, unbacked 0. diff --git a/phase-ends/current/logs/T3.c5.md b/phase-ends/current/logs/T3.c5.md new file mode 100644 index 0000000000..b24b6f9a16 --- /dev/null +++ b/phase-ends/current/logs/T3.c5.md @@ -0,0 +1,24 @@ +# T3.c5 — rung S loop fix, NO-FIELD census, header additions (blocked) + +## Step 1: plan/apply agreement (done) +- Cause (diag `.run/t3c5/diag.py`): in each of the 6 looping files the only unfinished drawn bodies had a latest `KEPT` row labelled `t3c4_rejudge` with no CANONICAL/LOCAL base (`s_judged` false) → `s_finished` false → file drawn; but an earlier judged row (t3_S1/S15/S20) at the same nhash sat in `ledger_index` done → `work_file_S` skipped every body → `rows 0`. +- Fix `tools/restruct.py` `s_finished(tu, fns, latest, done=frozenset())`: a body is finished when `("S", tu, fn, current nhash) in done` OR the old latest-row rule; `plan_S` passes its `done` (apply already passes the redraw-lifted `done`). Agreement by construction: a drawn file always has a body apply does not skip. +- `s_site_rows`: every site row carries its base's type (`per_base` type by `bclass:base`; was edit sites only). `s_macro_rows`: macro site rows take the type from the row's `bases[]`. +- Check `.run/t3c5/diag2.py`: plan_S drawable 75 → 69 (file-finished 1631); drawn files with nothing to process 0; ov files drawn 0 (the 69 are T4's md_/main/shared). + +## Step 2: NO-FIELD census (`.run/t3c5/nofield.py` → `.run/t3c5/nofield.json`) +- ov latest rung-S rows: 2455 RESIDUAL(NO-FIELD) sites, 92 groups (type, off, width, sign); type from the row's bases[]. +- ALL 92 groups are on two types: `Unkstruct_80126B58` and `Unkstruct_800B5CB8`, both inside `include/struct_types.h` head_types:begin/end (generated). +- IN-LEAF 1955 sites / 70 groups: the site lies inside an existing leaf (e.g. `unk14` s32 of 800B5CB8 429 sites, `unk10` of 80126B58 310) — not addable under the rule (would need a union / split; deferred by the 3.38 decision). +- GAP-PAD 500 sites / 22 groups, all `Unkstruct_80126B58`, all inside pad arrays: offsets 0x78 4s(11) 0x7C 2u(5) 0x82 2u(8) 0x84 2s(19)/2u(3) 0x86 2u(6) 0x90 4s(1) 0x94 4s(11) 0x98 2s(3)/2u(2) 0xC8 1u(4) 0xC9 1u(4) 0xDA 1u(390) 0xE8 4s(12)/4u(1) 0xEC 2s(1) 0xEE 2s(1) 0xFF 1u(4) 0x108 2s(4)/2u(6) 0x10A 2s(2)/2u(2). + +## Wall: the brief's path for in-region types is destructive +- `head_types.py --header .run/t3c5/head.h` (scratch) against the current `.run/P37/census/struct_map.json` (02:27 today; counts only remaining raw sites: 18324 sites vs 107580 the region was built from) rewrites 157 diff lines of the region and CHANGES existing fields (800B5CB8: `u16 unk0` → `u8 unk0`+`u8 unk1`, `s32 unk14` → `s16 unk14`+`s16 unk16`, `u16 unkC` → `s16 unkC`, …). 141260 MEMBER sites (check-ledger) are spelled against the current fields → regeneration would break src/byte identity. Not run on the real header. +- Hand-editing the region is forbidden (generated). No header edit made; no apply/R22 run. +- Options for the expert: (a) head_types.py additive mode: keep the current region's fields, add only map/ledger candidates in pads (needs the pinned map or a ledger-fed candidate list); (b) move the two head types out of the generated region (declare hand-maintained) then edit pads in one batch; (c) accept the 500 sites as residual. + +## Commands +- `restruct.py --selftest` → 93/93 OK (struct_layout 9/9) +- `restruct.py --audit-types` → 0 violations (1018 definitions) +- `restruct.py --check-ledger` → 141260 MEMBER sites, 0 violations +- `make kit-corpus` → corpus materialised; `make tools-health` → see below diff --git a/phase-ends/current/logs/T3.md b/phase-ends/current/logs/T3.md index 5912b2d6f2..2245d98268 100644 --- a/phase-ends/current/logs/T3.md +++ b/phase-ends/current/logs/T3.md @@ -17,3 +17,7 @@ - cycle 6..60 with pin (cycle_t3_c.log): t3_S6..S14, S16..S18 drew ~350 bodies each but 0 sites (written 7-9 files each); only t3_S15 real (5136 members, 37 kept, 1774 skipped). All R22 green. Stopped (TERM after INT ignored by bash during R22); `restruct --restore` dropped t3_S19 (8 files, 310 rows); HEAD 2f4594dce3. - Hypothesis: apply path reads unpinned map; s_finished marks zero-site files done. T3.c3 briefed. - T3.c3 done (568de6c713, 357451cbb9, e88040d15a): real cause = s_body_edits checked the drifting live struct_map before the canonical branch → every pinned base NO-TYPE-IN-MAP (t3_S6: 340 rows NO-SITE 332 / KEPT 8); written files in zero-site batches = MISALIGNED/NON-STRUCT respells. Fix: apply uses pin; `s_judged` (≥1 CANONICAL/LOCAL base) gates s_finished and ledger_index. Probe ov_MAIN_012_jr_801549F8.c IDENTICAL members 1. Plan 1872 drawable. check-casts unbacked 96 (t3_S1..S10) → T3.c4 briefed. +- T3.c4 done (0938e511ed, f1cae27da2, a83e31047f, ffc0d3ecc1): unbacked 96 = 60 alias-def params read as locals (restruct params_of fallback added) + 23 superseded by a later row (S_PRIOR carry of macro rows) + 13 nested-base respelling drift; 31 bodies re-walked (label t3c4_rejudge, 0 written). check-casts macros ALIAS 555 SIGN 5238 WIDTH 3966 MISALIGNED 258 NONSTRUCT 208, unbacked 0. R22 218/218. Open: a REFUSED/COMBINATION-FAILED row on a macro-holding body would unback it. +- cycle_t3_d: t3_S19..S49 green (R22 218/218 each), stopped after S49 commit 4f9445c6fa (648 drawable) to raise BATCH 50→200 (per-batch overhead ~20 min vs apply 1-2 min); interrupted snapshot is redone by the next cycle's calibrate step. +- cycle_t3_e (BATCH 200): t3_S50..S54 real (members 12305/5999/1456/1020/27), all R22 218/218; S55..S61 looped on 6 files (plan drawable, apply UNCHANGED rows 0: ov_SC02_000_jr_80187B40, ov_SC02_011_jr_80183178, ov_SC03_029_jr_8017FF7C, ov_SC04_002_jr_8017BEBC, ov_SC04_011_jr_8017D494, ov_SC03_006_jr_8017AE2C; plan/apply done-set disagreement, incl. c4 bases=[] rows). Killed by pid; src clean, HEAD b0951592bd. +- ledger scan (.run/T3/resid.py, pre-S50): 26,062 ov bodies with S rows; sites MEMBER 109,508 · RESIDUAL TYPE-NOT-CANONICAL 33,369 · KEPT WIDTH 17,925 / SIGN 9,740 / SCHED-ALIAS 1,127 / MISALIGNED 445 / NON-STRUCT 428 · RESIDUAL NO-FIELD 2,336 (site type None) / NO-TYPE-IN-MAP 632 / AGGREGATE-FIELD 410 / INDEX 341.