mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-04 16:28:11 -04:00
T10: residue coverage gate and 3.40 sizing: log and summary
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# T10 log — residue coverage gate and 3.40 sizing
|
||||
|
||||
Timeline:
|
||||
- start: read card slice expert, plan Context/Interfaces/Cookbook/Research, task T10, summaries T2/T3/T4. pgrep: no restruct/type_census/delever running. HEAD a1edf89167.
|
||||
- design: one shared per-site matcher in restruct (`residue_match`), imported by type_census, so `--check-residue` and `--check-casts --residue` cannot disagree. Match key within body (tu, fn) = (form, s_base_norm(base), off), multiset, never line (lines drift across sweeps). Covered iff latest[("S",tu,fn)] entry verdict `RESIDUAL(<cause>)` and non-empty cause.
|
||||
- decision: a `--residue` row for a body that already has a latest S row MERGES (copies prior row incl. KEPT/MEMBER entries and verdict, appends new RESIDUAL entries); a fresh row would supersede the prior latest via ledger_latest and unback its KEPT macros.
|
||||
- decision: I/M residue capability only (selftest); not run on the tree, so the gate keeps failing on I/M per done-when.
|
||||
- c1 brief sent (restruct matcher, `--forms`, per-site `--check-residue`, merged rows, selftest, P/X rerun). Returned done: fad97b178c (tool), f991bab729 (ledger). Per-site exposed before rerun: ov 14,296 sites / 4,234 bodies; md 281/99; main 3/2; shared 0/0. Rows t10_res_ov 4,234, t10_res_md 99, t10_res_main 2 (all merged). After: uncovered 0 everywhere.
|
||||
- expert spot-check: `restruct --rung S --check-residue --only main` → uncovered 0 sites / 0 bodies rc 0; git log shows both c1 commits.
|
||||
- c2 brief sent (type_census `--residue`, residue_census.{json,txt}, selftest controls, docs/ops note, HOW_WE_WORK row). Returned done: 1246b85c38. selftest 67/67; card 6,354/7,000 chars.
|
||||
- verify (expert): .run/logs/t10_verify_a.log → type_census selftest 67/67, struct_layout 9/9, restruct 101/101, check-residue ov_*/md_*/main/src/shared/* each `uncovered 0 sites / 0 bodies`, RC=0. .run/logs/t10_verify_b.log → gate rc 1, `test` RC=0.
|
||||
- read .run/P37/census/residue_census.txt (77 lines) for the summary tables.
|
||||
|
||||
Hypotheses rejected: none needed; per-site gaps (14,580 P/X sites) were bodies with MEMBERS/KEPT rows whose undrawn-base sites were never listed (T3/T4 residue skipped any body with a row).
|
||||
|
||||
Retrievers: none. Reports: none.
|
||||
Coder logs: logs/T10.c1.md, logs/T10.c2.md (c2 log has the gate line and residue_census tables verbatim).
|
||||
@@ -4,3 +4,4 @@ T1 | done | phase-start health, carry cleanup and baselines | - | tasks/T1.md |
|
||||
T2 | done | cast and lying gate instruments, reinterpret-macro set | - | tasks/T2.md | logs/T2.md | -
|
||||
T3 | done | rung S sweep, overlays (forms P and X) | - | tasks/T3.md | logs/T3.md | -
|
||||
T4 | blocked | rung S sweep, md_*, main and shared bodies (forms P and X) | - | tasks/T4.md | logs/T4.md | -
|
||||
T10 | done | residue coverage gate (--check-casts --residue) and 3.40 sizing | - | tasks/T10.md | logs/T10.md | -
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# T10 — residue coverage gate (--check-casts --residue) and 3.40 sizing
|
||||
|
||||
Status: done | expert: expert-opus55 | ctx-at-completion: n/a | commit: see COMMIT | coder runs: c1 opus55 done (fad97b178c, f991bab729), c2 opus55 done (1246b85c38)
|
||||
Done: per-site residue coverage in restruct and type_census (one shared matcher), ledger-only P/X gap closed, `type_census --check-casts --residue` gate and residue census written; on the T4 tree P/X uncovered 0, gate fails only on I/M uncovered and lying.
|
||||
Files:
|
||||
- tools/restruct.py — `residue_match(latest, sites, forms)` :3480 (pure; per site, multiset, key (form, s_base_norm(base), off) inside body ("S", tu, fn) via ledger_latest; covered iff entry `RESIDUAL(<cause>)` with non-empty cause); `--check-residue` per site; `--residue --forms P,I,X,M` (default P,X); I/M causes ABS-ADDR, GLOBAL plus residue_cause set; merged rows (copy prior latest row, append RESIDUAL entries, `residue_of` = prior label); residue under apply lock; selftest 101/101 (c1)
|
||||
- tools/type_census.py — `--residue` with `--check-casts`; writes `.run/P37/census/residue_census.{json,txt}`; selftest 67/67 (per-form covered/uncovered x3 controls, KEPT macro site under macros) (c2)
|
||||
- .run/P37/restruct/ledger.jsonl — +4,335 merged rows t10_res_ov/md/main (c1)
|
||||
- decomp-architect/corpus/tools/P10/{restruct,type_census}.py — kit-corpus copies
|
||||
- docs/ops/p39-t10-2026-10-02-check-casts-residue.md, docs/ops/INDEX.md, HOW_WE_WORK.md Tools row "type_census casts" (H7)
|
||||
Interfaces (shapes later tasks read):
|
||||
- `type_census --check-casts --residue` → `check-casts: raw P= I= X= M= (uncovered P= I= X= M=); macros …(unbacked n); lying=n (ledgered n)` + `by-cause: <CAUSE>=<n> …` (covered sites, desc); rc 1 on uncovered > 0, unbacked > 0, unledgered lying > 0. Without `--residue`: T2 output unchanged.
|
||||
- `restruct --rung S --residue [--forms P,I,X,M] --only <seg> --label <l>`; `--check-residue` prints `uncovered <n> sites / <m> bodies`, per site, forms P,X.
|
||||
Decisions:
|
||||
- binding: residue coverage is per site, matched on (form, normalised base, off) within the body's latest rung-S row, never on line; both gates use `restruct.residue_match`.
|
||||
- binding: a `--residue` row for a body with an existing latest S row merges (keeps KEPT/MEMBER entries and verdict) so macro backing survives.
|
||||
- I/M residue rows not written on the tree (capability + selftest only); I/M coverage is the next owner's work.
|
||||
Deviations:
|
||||
- c2: by-cause attribution reads each covered site's cause via `rs._residue_key`; the split itself is residue_match's.
|
||||
- residue_census files sit under gitignored .run/ (regenerable; not committed).
|
||||
Findings:
|
||||
- Per-site match exposed P/X gaps the per-body check hid: ov 14,296 sites / 4,234 bodies, md 281/99, main 3/2, shared 0 (bodies with MEMBERS/KEPT rows whose undrawn-base sites were never listed); closed by merged ledger-only rows (TNC 13,936, NO-TYPE-IN-MAP 360 in ov).
|
||||
- Gate on the T4 tree: `raw P=257464 I=51505 X=13790 M=15130 (uncovered P=0 I=35625 X=0 M=14762); macros CAST_ALIAS=1173 CAST_SIGN=8429 CAST_WIDTH=10410 CAST_MISALIGNED=624 CAST_NONSTRUCT=327 (unbacked 0); lying=229 (ledgered 0)`, rc 1.
|
||||
- I covered 15,880 and M covered 368 come from prior rung-S rows that already listed I/M sites with causes.
|
||||
- 3.40 sizing (residue_census.txt), covered by form: P 257,464 · I 15,880 · X 13,790 · M 368; uncovered: I 35,625 · M 14,762.
|
||||
- By segment covered/uncovered: ov 267,984/48,334 · md 6,315/328 · main 1,751/321 · shared 11,452/1,404.
|
||||
- By cause (covered sites): TYPE-NOT-CANONICAL 281,252 · NO-TYPE-IN-MAP 2,966 · NO-FIELD 1,773 · NO-EDIT 482 · INDEX 479 · AGGREGATE-FIELD 369 · FILE-SCOPE 172 · TYPE-NOT-VISIBLE 9.
|
||||
- TNC concentration: 281,252 sites over 13,081 distinct map types; 50% covered by 81 types, 80% by 579, 95% by 4,384.
|
||||
- Top 50 map types, Unkstruct_<id> sites/bodies:
|
||||
800D3888 21350/6239; 0caecd54 4340/124; dac960ce 4216/124; f8ed2b9f 4061/4061; a32b99a1 3936/123; 8e3dbe51 3930/131; 57a28935 3271/196; 1fa9e810 3144/131; 30b21035 3100/124; a2c8734a 2646/126;
|
||||
198fc7cc 2580/129; ed8f1335 2356/124; 80126948 2213/705; 8016B4F8 2141/535; 80139C7C 2111/265; 80130D48 2109/317; 2729e670 2091/123; dd542e54 2016/126; f49880fd 2000/125; a8d34bce 1948/1948;
|
||||
8016DF5C 1926/131; 568f7bda 1875/125; cd1bacd2 1764/126; 8011F7A8 1742/270; 84612d18 1722/123; 57db4d07 1664/128; 4692fc17 1612/124; eda88e53 1596/133; 4e09b6d9 1572/131; 8012D3B4 1565/180;
|
||||
645b745d 1548/258; 0980b9f0 1441/131; b5c0372a 1441/131; 47470ce3 1404/117; a68f6d03 1364/124; 801345F8 1336/134; 8fdd92d1 1300/130; 110cf29e 1250/125; 4db8cec8 1240/124; d292c30d 1240/124;
|
||||
f0bc3b7a 1240/124; a459e3e5 1220/122; f9a7989e 1179/131; 80135260 1170/130; 801290DC 1149/259; 0b30043d 1128/376; 301381d4 1116/124; 4e427c01 1116/124; 4857195e 1107/123; 50a3f6b4 1040/130.
|
||||
- Many top types recur with ~123-131 bodies: likely one overlay struct duplicated per overlay family (hash-named twins); 3.40 should check twin-merge before defining each.
|
||||
Gotchas:
|
||||
- generalizable: a coverage check keyed on "body has any ledger row" hides per-site gaps once later sweeps add rows for other reasons; match per site, and merge new residue entries into the latest row rather than superseding it (a superseding row unbacks earlier KEPT entries).
|
||||
Research: none new
|
||||
Next task needs: T5 (or I/M owner) runs `restruct --rung S --residue --forms I,M` per segment once I/M causes are agreed; lying 229 still unledgered; 3.40 canonical-types campaign sizes from the top-81/579 types above.
|
||||
Verified: `PY tools/type_census.py --selftest && PY tools/restruct.py --selftest && check-residue ov_*/md_*/main/src/shared/*` → 67/67, 101/101, each `uncovered 0 sites / 0 bodies`, RC 0 (.run/logs/t10_verify_a.log); `(PY tools/type_census.py --check-casts --residue; test $? -eq 1)` → RC 0, gate line above (.run/logs/t10_verify_b.log)
|
||||
Full log: phase-ends/current/logs/T10.md
|
||||
Reference in New Issue
Block a user