diff --git a/phase-ends/current/logs/T5.1.c3b.md b/phase-ends/current/logs/T5.1.c3b.md new file mode 100644 index 0000000000..29a0444c4e --- /dev/null +++ b/phase-ends/current/logs/T5.1.c3b.md @@ -0,0 +1,42 @@ +# T5.1.c3b — fold tier-1 dup classes, SDK MATRIX, fold-dead (done; 16 tier-1 classes excluded with cause) + +## Tool changes (tools/lift_types.py) +- fold_apply: one alias per NAME; tag-only def whose tag is a typedef name of the class (or canon) emits no alias, only `struct T`→`T` respell; a tag is respelled iff it is not the surviving canon tag (fixes c3's V3 redefinition). Respell entries keyed per def when names collide. +- fold_plan: SDK canon only under `--fold-sdk` (before: tier-1 classes with SDK member evidence silently took SDK names → POLY_G4/POLY_FT4 `pad1..3` broke the pad invariant; batch f9d3c125c had it, redone in 5752b7762). +- fold_plan refuses: (a) defs differing in attributes (packed/aligned(1)/aligned(2) vs none: one lhash, two codegens — DR_MODE class failed 142 binaries); (b) a member name the canon spells at another node (TrailEntry.f2@4 vs Entry8018F07C.f2@2: compiles, reads wrong field; cc1-driven respell blind to it — B1 trial failed 142 binaries). +- `--fold-class :sdk` now selects an SDK group (was a no-op). + +## Commits (each R22 green: 217/217, 218/218) +- 4e75840da tool fix + archive c3 progress → logs/T5.1.c3.progress1.md +- d702f389c 79 clean tier-1 classes (no respell) +- f9d3c125c 10 classes (had SDK canon bug; census pad_names=5) → 5752b7762 redo from pre-batch tree, pad_names 0 +- 83d8b742b 12 classes; a5c63c425 3 classes +- 5fcb110a2 SDK: 140 MATRIX-shaped defs (SDK member names m,t) → MATRIX; unused tag EntD820 dropped (1-def tier-1 row: tag+typedef of one def) +- 18829a78f fold-dead: 24 defs deleted; LineF2_8018F694 restored (used only in macro bodies, cc1 `undeclared`); `## Dead kept`: Unkstruct_80126B58, LineF2_8018F694, actor4c, actor4c_8015444C + +## Final state (census on committed tree) +- dup_classes=76 (tier 1: 16, tier 2: 60) outside_canon=0 dead=0 twins_stale=0 variants=0 pad_names=0 parse_error_decls=1106 controls=4/4; dead_kept=4 +- restruct --audit-types: 0 violations; type_census --selftest 31/31 OK +- R22 last run (.run/logs/r22Dd.log) on the tree committed as 18829a78f (docs only differ). + +## Tier-1 classes excluded (cause) +- 8d605044e3bf:f5e18b (V4), a2e73cdb49a3 (vecr), 0aaa0c2b3635 (DR_MODE): defs differ in attributes (aligned(2)/packed,aligned(1) vs none) — tool refusal +- f3431cdc6e53 (MATRIX_*/MB_*): member name at another node (MB `s16 m[10]` vs `m[3][3]`) — tool refusal +- eaec0835ca48 (TrailEntry/Entry8018F07C): f2/f4 at different offsets — tool refusal +- ab244e47ddd7:2982ab (Prim_80183FE0.c), f5c2ab89f5a9 (.b), 193af660478c (St80180ACC.a/.b), 0fb1d3def821:403b4a (FaceF4.v1/v2), 7b3adf8bd9e4 (F150Rec.flg): name at another node — tool refusal +- 31ae27c7fcb4 (H16/Bidx_*): 151 accesses inside macros (ADDPRIM2 …, RD16 lines) — no rewritable access +- 3e4f4166f2b3 (S126B58): pointer member pointee differs (unk20 → S126B58_inner* vs canon mtx) — cc1 `request for member unk12 in something not a structure` +- 7ffb740ef67d (B/Mtx40): m.q0/m.q1 have no canon node of same shape (0 candidates) +- 5b95bca7ba8c (Src_*): member `mat` types Mat_800CB658 vs Mat_CB6A0 (5b8ad54bc29f: L.a/L.b 0-candidate rewrites) — cc1 incompatible types +- f9ac75d6d838 (Slot): member types B8/B4 vs B8_80165140/B4_80165140 (tier-2 twins, not folded) — cc1 incompatible types +- 8353c1de6a85 (MtxBuf_*): member `mt` types in refused MATRIX class f3431cdc6e53 — cc1 incompatible types + +## SDK groups not applied +- POLY_FT4/POLY_G3/POLY_G4: SDK member names pad1..pad3 break the pad-at-offset invariant (pad_names gate) +- RECT (Rect), CVECTOR (Col4_8017F8BC), Vec32: single-name groups = SDK rename, not a fold (no dup removed); VECTOR has another layout + +## Gotchas +- generalizable: layout-hash equality is not type equality for folding: attributes (packed/aligned), member types (tier-2 twins, pointees) and same-name-other-offset members all break it; the last is silent to cc1. +- generalizable: tier 1 = same MEANINGFUL names; placeholder names (unk*/f*/w*) differ and need respell — brief's "no respell in tier 1" premise is wrong for placeholders. +- workflow: `--fold-class` batches with disjoint respelled member sets avoid ambiguous rewrites (f0 was in 6 classes); scratch driver .run/P38/fold/drive.py, batcher batch.py, cc1 sweep cc1all.py. +- harness: another coder committed d71d4c179 (struct_twins) mid-task; `## Twins` untouched by me.