From 804d7d196fa6868ed22994be87a8eb30b88d8cb0 Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Wed, 30 Sep 2026 16:44:36 -0600 Subject: [PATCH] T5.1.c7: log --- phase-ends/current/logs/T5.1.c7.md | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phase-ends/current/logs/T5.1.c7.md diff --git a/phase-ends/current/logs/T5.1.c7.md b/phase-ends/current/logs/T5.1.c7.md new file mode 100644 index 0000000000..8eec34ebf7 --- /dev/null +++ b/phase-ends/current/logs/T5.1.c7.md @@ -0,0 +1,37 @@ +# T5.1.c7 — fold every SHARED tier-2 class; list SEPARATE + UNBOUND with addressed causes + +## Result +- census (.run/logs/c7cen7.log, tree e477c4a992): dup_classes=0 outside_canon=0 dead=0 twins_stale=0 variants=0 pad_names=0 parse_error_decls=1106 controls=4/4; twins_listed=54 dead_kept=3. +- Start (c7cen0 @ 43b7fd08fa): dup_classes=63 twins_stale=1; struct_twins 81 rows · SEPARATE 20 · SHARED 55 · SDK 4 · UNBOUND 2. +- End: struct_twins 54 rows · SEPARATE 44 · SHARED 0 · UNBOUND 10 (SDK layout 4, now a note). + +## Folds (all via `lift_types.py --fold --fold-class --fold-canon --apply`, each batch R22 green then committed) +- Method: scratch `.run/P38/c7/plan.py` = union-find over each class's `shared` objects (struct_twins.collect) → one fold row per connected component (`#`), `fold.tsv`; canon (`canon.py`) = names embedding an address of a shared object of the component (G62), most-used first; else lift_types default (meaning+uses). A partly-shared class folds its components; the rest stays apart and is listed. +- ba807d1258: 97 components (2,321 files; 942 names folded in total across all batches). Bisected out of the first all-in batch: b53d46e36006:opaque (`sv.c[0]` 3 candidate rewrites, ov_SC02_027_jr_8017D898.c:8095), 7e5cdb66875c (cc1 `request for member field_4`, ov_SC02_005_jr_80185E80.c:238), 64533110def7:opaque big comp (`sp10.v` whole member, 0 rewrites, ov_SC03_*), 4cc70dd1aeae Blk4 comp (attr refusal). +- 634dfd25ed: 978ca7deff8f, 06c78d2eedc6 (Blk28→C24 frame), 4cc70dd1aeae:opaque#0, b85caab442ac:opaque#0. +- 63214c2e41: 4cc70dd1aeae:opaque#2,#4. +- next: 4cc70#3; `--fold-dead` 10 Rec027_* (bodies orphaned by the Blk027 fold); `typedef struct Obj8017EBC4 {` untagged (tag unused; tag+typedef counted as 2 names of 978ca7deff8f). +- Blk4 comp → canon Block4 (`packed,aligned(1)` on `u8 b[4]` = natural alignment; `--fold-canon` on the attr def lets aliases inherit it). +- 64533110def7:opaque 115-name comp → canon Blk8_80126940 (`s16 v[4]`) instead of SV4_8017B368 so `sp10.v` stays valid; 9 `cur/target.m0..m2` sites in ov_SC07_002_jr_8017C8D0.c hand-respelled to `.v[i]` (cc1 lines were off: `#line 900 "p.c"` in that TU). +- b53d46e36006:opaque 19-name comp → canon Blk8_801867AC (`u8 c[8]`); 4 `.b`→`.c` respells. +- MainStruct pair (0x801E43A4) → canon MainStruct; SubStruct def moved above MainStruct_SC02_005_8017CF90 (C0224). +- Refused (stays apart with R22 evidence): none. Canon deviations from the address rule: Blk8_80126940, Blk8_801867AC, Block4, MainStruct (forced by cc1 / attrs), and 4 C0224 notes (00bfd8673c28, 68c91496d82c, 9dec8574d64e, 7e5cdb66875c) where lift_types took the first def. + +## tools/struct_twins.py (e477c4a992) +- SDK is a note, not a class (SDK rows were gating and unlisted); cause appends `same layout as PsyQ X, no name of the row bound to it`. +- U use sites: in-function uses → `/0x`; file-scope uses → the name the enclosing declaration defines (struct member / alias), plus that owner's own bound objects (second scan, one level); macro bodies naming a type → each in-function macro use. UNBOUND classes now get a `### ` section citing them; a class with no addressed cite is not written and printed `NOT WRITTEN` (none now). +- `--write` order fixed (-n names, lhash): was non-idempotent (listed rows move from dup_gating.tsv to the listed set). Verified: two consecutive `--write` → `cmp` identical. +- `## Dead kept`: removed `actor4c_8015444C` (def folded away with Actor4C_8015444C_t9f81a8d5; census reported it stale). + +## Verified +- `.venv/bin/python tools/type_census.py --selftest` → 32/32 OK +- `restruct.py --audit-types` → 0 violations +- R22 after each src batch: c7r22a,b,c,d,e,f,g,h → extract-all 217/217, check-all 218/218. Last src commit (MainStruct) R22 c7r22h green; later commits touch only tools/struct_twins.py + docs (R22 not re-run after them). + +## Notes for the expert +- UNBOUND causes that rest on a name suffix only: b85caab442ac:opaque `Mat_80167540` used only by `type Mat_800CB658`, which has no bound object. +- 6ef8724a7464: F20T (member f20 of P10, P10 bound 0x80126B58) and Obj20_80178D40 (member unk20 of Actor_80178D40, bound 0x80126B58) — both at +0x20 of objects at 0x80126B58: possible same-type evidence the binder does not follow (member-of-same-object). Left listed. +- 9dec8574d64e `Actor4C, actor4c` and similar: census counts a def's tag and typedef name as two names of one class; listed (actor4c also in Dead kept). +- generalizable: lift_types' member respell pools candidates across every class in one run (`by_member`); batching many classes with the same member names gives "N candidate rewrites" — fold such classes in separate runs. +- generalizable: a whole-member use (`f(x.v)`) cannot be respelled; pick the canon whose spelling the whole-member users have. +- harness: `.git/index.lock` left stale once (no git process) mid-task; removed. `tools/commit_task.sh` refuses messages >100 chars; the xargs trick (`xargs -x -a list bash tools/commit_task.sh …`) commits >2k paths without cat'ing the list (guard).