Files
BFM-decomp/phase-ends/current/logs/T3.c5.md
T

3.3 KiB

T3.c5 — rung S loop fix, NO-FIELD census, header additions (blocked)

Step 1: plan/apply agreement (done)

  • Cause (diag .run/t3c5/diag.py): in each of the 6 looping files the only unfinished drawn bodies had a latest KEPT row labelled t3c4_rejudge with no CANONICAL/LOCAL base (s_judged false) → s_finished false → file drawn; but an earlier judged row (t3_S1/S15/S20) at the same nhash sat in ledger_index done → work_file_S skipped every body → rows 0.
  • Fix tools/restruct.py s_finished(tu, fns, latest, done=frozenset()): a body is finished when ("S", tu, fn, current nhash) in done OR the old latest-row rule; plan_S passes its done (apply already passes the redraw-lifted done). Agreement by construction: a drawn file always has a body apply does not skip.
  • s_site_rows: every site row carries its base's type (per_base type by bclass:base; was edit sites only). s_macro_rows: macro site rows take the type from the row's bases[].
  • Check .run/t3c5/diag2.py: plan_S drawable 75 → 69 (file-finished 1631); drawn files with nothing to process 0; ov files drawn 0 (the 69 are T4's md_/main/shared).

Step 2: NO-FIELD census (.run/t3c5/nofield.py → .run/t3c5/nofield.json)

  • ov latest rung-S rows: 2455 RESIDUAL(NO-FIELD) sites, 92 groups (type, off, width, sign); type from the row's bases[].
  • ALL 92 groups are on two types: Unkstruct_80126B58 and Unkstruct_800B5CB8, both inside include/struct_types.h head_types:begin/end (generated).
  • IN-LEAF 1955 sites / 70 groups: the site lies inside an existing leaf (e.g. unk14 s32 of 800B5CB8 429 sites, unk10 of 80126B58 310) — not addable under the rule (would need a union / split; deferred by the 3.38 decision).
  • GAP-PAD 500 sites / 22 groups, all Unkstruct_80126B58, all inside pad arrays: offsets 0x78 4s(11) 0x7C 2u(5) 0x82 2u(8) 0x84 2s(19)/2u(3) 0x86 2u(6) 0x90 4s(1) 0x94 4s(11) 0x98 2s(3)/2u(2) 0xC8 1u(4) 0xC9 1u(4) 0xDA 1u(390) 0xE8 4s(12)/4u(1) 0xEC 2s(1) 0xEE 2s(1) 0xFF 1u(4) 0x108 2s(4)/2u(6) 0x10A 2s(2)/2u(2).

Wall: the brief's path for in-region types is destructive

  • head_types.py --header .run/t3c5/head.h (scratch) against the current .run/P37/census/struct_map.json (02:27 today; counts only remaining raw sites: 18324 sites vs 107580 the region was built from) rewrites 157 diff lines of the region and CHANGES existing fields (800B5CB8: u16 unk0 → u8 unk0+u8 unk1, s32 unk14 → s16 unk14+s16 unk16, u16 unkC → s16 unkC, …). 141260 MEMBER sites (check-ledger) are spelled against the current fields → regeneration would break src/byte identity. Not run on the real header.
  • Hand-editing the region is forbidden (generated). No header edit made; no apply/R22 run.
  • Options for the expert: (a) head_types.py additive mode: keep the current region's fields, add only map/ledger candidates in pads (needs the pinned map or a ledger-fed candidate list); (b) move the two head types out of the generated region (declare hand-maintained) then edit pads in one batch; (c) accept the 500 sites as residual.

Commands

  • restruct.py --selftest → 93/93 OK (struct_layout 9/9)
  • restruct.py --audit-types → 0 violations (1018 definitions)
  • restruct.py --check-ledger → 141260 MEMBER sites, 0 violations
  • make kit-corpus → corpus materialised; make tools-health → OK (exit 0)