mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-04 16:28:11 -04:00
5.4 KiB
5.4 KiB
T3 — rung S sweep, overlays (forms P and X)
Status: done | expert: expert-opus55 (3 attempts, 2 handoffs) | ctx-at-completion: n/a | commit: see COMMIT line of the return | coder runs: c1 done (3ff15ee462, 3507628e40, fe2e814776), c2 done (d476f3c92e), c3 done (568de6c713, 357451cbb9, e88040d15a), c4 done (0938e511ed..ffc0d3ecc1), c5 blocked→decision (a8dbad4a21), c6 done (45cb633d08, d3cb6dff35), c7 done (f810278227), c8 done (ffecb36e29) Done: every ov_* body with a P/X site has a latest rung-S ledger row (sweep t3_S1..S61, each batch R22 218/218 and committed by restruct_cycle.sh; 34,131 undrawable bodies ledgered RESIDUAL by cause); kept casts are T2 macros, all backed (unbacked 0); 17 missing fields added to Unkstruct_80126B58 in one header fan-out. Files:
- src/ov_/**/.c — cast → member respell (rung S1/S2) and CAST_* macros for kept sites
- include/struct_types.h — 17 pad-split fields in Unkstruct_80126B58 (generated region, head_types --add-pads)
- tools/restruct.py — rung S per-site classes, KEPT/RESIDUAL rows, CAST_* respell, --only glob, --bbt pin, plan/apply done agreement, --residue, --check-residue, kept-macro carry over respelled bases (s_base_norm)
- tools/head_types.py —
--add-padsadditive mode (existing fields byte-for-byte) - docs/struct-twins.md — Unkstruct_80126B58 removed from Dead kept (now live)
- .run/P37/restruct/ledger.jsonl — S rows (tracked under ignored .run/)
- docs/ops/p39-t3-2026-10-02-restruct-rung-s-residue-head-types-add-pads.md, docs/ops/INDEX.md — new flags (H7) Decisions:
- binding: a struct-map type with no canonical definition (TYPE-NOT-CANONICAL) is residual for rung S; its bodies get ledger-only RESIDUAL rows (
restruct --rung S --residue), and--check-residue(uncovered 0) is the coverage check. - Pad fields added with head_types
--add-pads(additive), not a full head_types regen: full regen rewrites 157 lines and moves 141,260 MEMBER spellings. - IN-LEAF NO-FIELD (offset inside an existing leaf field, 1,912 sites / 69 groups) stays residual: needs a union/split, deferred by the 3.38 decision. Deviations:
- c6's hand-back was lost with attempt 2; its uncommitted header/tool edits were verified by regeneration (cmp identical) and committed by the expert under T3.c6.
- docs/struct-twins.md edited by hand (the
## Dead keptlist is hand-kept;struct_twins.py --writeonly rewrites## Twins). Findings: - Before/after ov_* (P39 T1 census vs final census): P 387,001 → 238,399 (−148,602); X 13,441 → 13,431 (−10); kept macros K 0 → 20,390; typed cast-member C 35,414 → 169,472. Repo-wide check-casts: P 408,974 → 260,372, X 13,800 → 13,790, I 60,666 → 51,514, M 19,542 → 15,130.
- Kept by cause (ledger site entries, ov): WIDTH 19,166 · SIGN 10,048 · SCHED-ALIAS 1,127 · NON-STRUCT 492 · MISALIGNED 445. Macros in src (repo): CAST_WIDTH 10,170 · CAST_SIGN 8,154 · CAST_ALIAS 1,127 · CAST_MISALIGNED 623 · CAST_NONSTRUCT 316.
- Residual P/X by cause (ov sites): TYPE-NOT-CANONICAL 234,400 · NO-TYPE-IN-MAP 2,444 · NO-FIELD 1,910 (IN-LEAF) · NO-EDIT 482 · INDEX 471 · AGGREGATE-FIELD 373 · FILE-SCOPE 167. MEMBER (converted) 127,888.
- Bodies (latest S rows, 61,603 ov): MEMBERS 25,955 · TYPE-NOT-CANONICAL 32,521 and RESIDUAL 1,610 (refused: no canonical type for any base) · KEPT 532 · S2 521 · NO-SITE 443 · KEPT-ALL 11 (every site kept, by class) · S+A 10.
- The X form barely moved: indexed
((T *)e)[i]sites mostly sit on non-canonical bases or are INDEX residual. - NO-EDIT 482: census type canonical and visible but body never drawn; likely body_base_type.json's base type differs from the site's type (unverified). Gotchas:
- generalizable: hash-named bbt types (Unkstruct_<8hex>) block a rung-S redraw; a scratch pin built from the ledger rows'
bases[].typegets through (T3.c6). - generalizable: a later sweep batch that respells a nested base under an earlier kept macro silently unbacks it; match carried KEPT entries on a normalised base (
*(T *)(X+k)≡((S *)X)->unkK). - generalizable: a "dead kept" canonical type becomes live when a sweep spells members on it;
--check-structsthen fails twins_stale until it leaves## Dead kept. - workflow:
.run/P37/restruct/ledger.jsonlis tracked under ignored.run/;git add -fit before commit_task.sh (commit_task refuses the path). - harness: the expert was forced to hand back while its coder was still running; the coder's hand-back is then lost. Poll git/log and verify uncommitted work by regeneration.
- harness:
struct_twins.py --writeaftermake cleanbinds fewer objects; run it on a built tree only. Research: none new Next task needs: TYPE-NOT-CANONICAL is now the dominant ov residual (234,400 sites, 32,521 bodies over 18,668 struct-map types vs 1,650 defined); reducing ov P further needs canonical definitions for the top map types first. IN-LEAF NO-FIELD needs union/split.restruct --rung S --check-residuemust stay at 0 after any further S batch (re-run--residuefor new bodies). Verified: PY tools/type_census.py --check-casts --quiet → rc 1 (raw P=260372 I=51514 X=13790 M=15130 from all segments; macros all backed, unbacked 0; lying 229) · PY tools/type_census.py --check-structs --quiet && make clean && make extract-all JOBS=16 && make check-all JOBS=16 → check-structs OK, extract-all 217/217 + main, check-all 218 passed 0 failed of 218 (.run/logs/t3_verify_gate2.log) · restruct --rung S --check-residue --only "ov_*" → uncovered 0 Full log: phase-ends/current/logs/T3.md