diff --git a/phase-ends/current/logs/T5.1.c6.md b/phase-ends/current/logs/T5.1.c6.md new file mode 100644 index 0000000000..3d3eabf602 --- /dev/null +++ b/phase-ends/current/logs/T5.1.c6.md @@ -0,0 +1,29 @@ +# T5.1.c6 — census lhash learns packed/aligned(N); SDK names for the c5 leftover groups + +## Tool change (tools/type_census.py, 343b718b21) +- `def_layout_hash(res, d, lay)` (new, above run_census): `layout_hash(lay)` unless the def's own `packed`/`aligned(N)` moves its alignment off the natural one (natural = layout_of_fields without packed); then sha1([size, leaves, "align", al])[:12]. Attr at natural alignment keeps the plain hash (twins ledger keys stable). +- run_census uses it for `d["lhash"]`. +1 selftest (PkW packed apart from NatW; AlW aligned(4) == NatW): `--selftest` 32/32 OK. +- Census diff vs baseline (.run/P38/c6/base.log vs .run/logs/c6cen1.log): layouts 517→523; tier 1 1→0; dup_classes 62→63; twins_listed 19→18; twins_stale 0→1. Rows gone: a2e73cdb49a3 (E4,packed_word), 0aaa0c2b3635 (BlockData,DRM). New: 8da756678e6d 8B packed (Bc8_80180E0C,Packed8,S80126B38,S80172C50,UnalignedPair,up — split out of 6c480babe175:opaque, 39→33), 1f2e73d77112 12B (Rec801806C8_s,Rec80182744_s — out of 245ecac205e6:opaque), c80fac242f04 32B (Mat801A8E34,Mat_80183C9C). +- twins_stale=1 = docs/struct-twins.md `### c80fac242f04` lists Mtx_A8CE0, which is `aligned(8)` (include/struct_types.h:904, natural 2) and now hashes apart. Needs the ledger regenerated/edited (`## Twins` off-limits to me) — expert. + +## SDK names (6b652730fb) +- RECT ← Rect (src/shared/engine_types.h; members x,y,w,h = SDK) +- CVECTOR ← Col4_8017F8BC (← CVEC chain) (include/struct_types.h; r,g,b,cd = SDK) +- POLY_FT4 ← FT4_801857A4 (← Ft4_80183DA4, Ft4_80184138) (engine_types.h) +- POLY_G3 ← PG3 (struct_types.h) +- POLY_G4 ← PG4_8017FD50 (← G4_80017778, PG4_8018C960*) (struct_types.h); members p1/p2/p3 → pad_F/pad_17/pad_1F +- pad_names answer: SDK pad1..pad3 match PAD_RX `^pad([0-9A-F]+)$` and would violate the offset invariant; pads keep/take `pad_` offset spelling (as FT4/PG3 already had), every other member is the SDK name. Comment on each def says so. +- Method: `lift_types.py --fold … --fold-sdk --fold-class <5 :sdk groups> --apply` ran clean (cc1 0 errors) but emitted SDK header text (`short`, pad1.., offset comments dropped) → reverted, done as hand renames of the def name + one alias line (bodies kept). No accesses needed respelling (no `.pad*`/`.p1` uses of these types; the only `.p1` is ov_SC02_000 `buf`, other type). +- VECTOR 16B (d4b0395bb0af, Vec32): left — tool refuses (12-byte VECTOR exists), per brief. +- src/800.c:6709 `typedef … RECT;` is under `#ifdef NON_MATCHING` and 800.c does not include engine_types.h: no clash. +- Re-dry-run `--fold-sdk`: only the VECTOR note remains. + +## Verified +- `.venv/bin/python tools/type_census.py --selftest` → 32/32 OK +- R22 (.run/logs/c6r22b.log): extract-all 217/217, check-all 218/218, RC=0 (on the SDK tree, then committed) +- census (.run/logs/c6cen2.log): dup_classes=63 tier1=0 outside_canon=0 dead=0 twins_stale=1 variants=0 pad_names=0 parse_error_decls=1106 controls=4/4 +- `restruct.py --audit-types` → 0 violations + +## Gotchas +- generalizable: `--fold-sdk` canon text from `_sdk_text` re-emits the SDK body (u_char→u8 but `short` kept, offset comments lost, SDK pad names break the pad invariant); for a class whose def already matches the SDK layout+names, rename the def by hand and alias the old name. +- harness: `make extract-all` output suppressed hides the 217 count; run R22 without `>/dev/null` on extract.