mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-04 16:28:11 -04:00
6.6 KiB
6.6 KiB
T1 — phase-start health, carry cleanup and baselines
Status: done | expert: expert-opus55 | ctx-at-completion: n/a | commit: see COMMIT | coder runs: c1 opus55 done (6ea94447d7), c2 opus55 done (0cb2b6b522)
Done: timeline fresh, README live (Levers 3,729), 18 stale conflicting-types rows superseded through restruct (census conflicting_types 18 → 0), tools-health OK, R22 218/218, oracle recalibrated, selftest --real 82/82; P39 census baselines below.
Files:
- tools/restruct.py —
--rung D --redraw KEY [--headers]supersedes lifted rows with no lying decl left (DECL-NONE);argcheck_rows()factored out of plan_D; selftest +1 (T1.c1) - tools/timeline.py —
--checkignores only the latest row's Commits cell (T1.c2) - config/tool_dictionary.tsv — PROJECT-ONLY row for tools/expert_ttl.py (PA harness tool)
- decomp-architect/corpus/**, decomp-architect/tools/MANIFEST.md, docs/tool-index.md —
make kit-corpus - docs/story-timeline.md/.svg, README.md, docs/progress.json, docs/progress.fleet.md, docs/struct-map.md — regenerated
- .run/P37/restruct/ledger.jsonl (+18 rows, labels t1_stale/t1_stale_h), .run/P36/delever/calibration.json, .run/P3x/census/* — tool outputs
- docs/ops/p39-t1-2026-10-01-restruct-stale-supersede-timeline-check.md, docs/ops/INDEX.md — H7 note Decisions:
- Stale rows are superseded by an appended DECL-NONE row (ledger stays append-only, R70 latest-row reading), not deleted.
- binding:
timeline.py --checkcompares every cell except the latest row's Commits count (self-referential: the timeline's own commit moves it). Deviations: - R22 ran on
3feb64acd2(timeline commit), src/include/config identical to start commit7c28c1b8af(git diff --quietchecked). restruct --check-ledgerwas already clean before the fix (it checks MEMBER sites); the effect is shown by--check-structsconflicting_types=0.- tools-health was red at phase start (tool_census 9 gaps: new harness tool expert_ttl.py undictionaried, stale corpus copies, missing PhaseEnd_Phase3.38 record copy); fixed with a dictionary row +
make kit-corpus. - Verify run as two calls (timeline+tools-health+check-ledger; check-structs) > 285 s together; src unchanged between.
Findings (baselines, census at
6ea94447d7, src stamp 287e6f521d908e6d, out.run/P39/census,.run/P39/levers; R99 key per site in sites.jsonl: tu, fn, line, pos): - Raw deref 502,983 in 69,492 bodies = P 408,974 + I 60,666 + X 13,800 + M 19,543. Apart: A address-of 18,892; C typed cast-member 36,853. (P was 409,007 at P37 T1; C 36,681 in plan Context is stale, live 36,853.)
- Per binary kind: ov 478,494 · shared 12,856 (shared/ov 12,832) · md 9,473 · main 2,070 · resident 89 · include/common.h 1. Top binaries: ov_SC06_032 6,897 · ov_SC06_018 6,867 · ov_SC06_033 6,637 · ov_SC06_024 6,109 · ov_SC06_022 5,698 · ov_SC02_011 5,476 · ov_SC02_005 5,275 · ov_SC03_028 5,240 · ov_SC04_011 5,170 · ov_SC02_027 4,857 (top 30 in logs/T1.md; 220 buckets incl. shared/*).
- Per base class, struct-map explained / total: param 276,840/276,840 · local 149,900/149,900 · gaddr 40,123/40,123 · nested 22,983/24,076 · global 8,861/8,861 · ident 156/156 · other 0/1,677 · addr-of 0/1,350. Explained 498,863 (99.2 %); unexplained 4,120 = nested 1,093 + other 1,677 + addr-of 1,350.
- Top 20 bases: a0(param) 92,255 · param_1(param) 81,578 · arg0(param) 67,704 · p(local) 18,039 · p(param) 11,784 · s0(local) 10,368 · cach(local) 8,246 · s1(local) 7,137 · buf(local) 7,060 · flag(local) 5,453 ·
*(s32 *)(a0 + 0x20)(nested) 5,215 · iVar2(local) 5,160 · dst(local) 4,874 · iVar1(local) 4,836 · iVar3(local) 4,693 · e(local) 3,918 · obj(local) 3,681 · cur(local) 3,375 · param_1(local) 2,832 · a1(param) 2,667. - Struct map 19,122 types; top types Unkstruct_800B5CB8 107,580 sites, Unkstruct_80126B58 65,397; 857 types with conflicts, 11 suspect.
- Levers (lever_census): pins 1,868 + asm 1,861 = 3,729 in 1,837 bodies (661 distinct), all
// !FAKE:marked, 0 orphans. asm 1,861 = gte-lever 450 (94 via variant macro, 356 direct) + launder 613 + keepalive 323 + barrier 239 + instruction 223 + asm-body 13. GTE statements (not levers) 6,717 = gte 6,447 (197 direct, 6,250 via macro) + gte-unsigned 270. Per-TU asm macro defs outside gte header 314 (gte 150, launder 154, instruction 9, barrier 1; GTE variants 64). Verbatim-body 2,682 sites / 22 routines (permanent). Volatile 1,589, register 50. - Lying 229 over 24 callees (K&R-empty 216, narrow 13): aF801376E8 52 · aF80146A6C 33 · aF8014C4AC 33 · aF80161208 15 · aF801848DC 15 · aF80185EEC 14 · aF8018CB18 12 · aF8018A860 8 · aF8018AFD0 8 · func_80143C74 7 · func_8012BD14 7 (narrow 6 + K&R-empty 1) · aF8017E3F0 4 · aF801843E0 4 · func_8012CBF4 3 (narrow) · aF8018A224 2 · func_8012CC40 2 · func_80173544 2 (narrow) · func_801AAF34 2 · func_80014CF8 1 · func_80181E0C 1 · func_80181E98_impl 1 · func_8018283C 1 · func_801851DC 1 (narrow) · func_8018A224 1 (narrow). Also K&R sites 5,293/200 callees, cross-binary 418/96 (apart).
- check-structs non-gating now: conflicting_types=0 tu_conflict=0 types_floor_lying=229 block_frames=629 twins_listed=53 dead_kept=3. Gotchas:
- harness:
restruct --selftest --realis red after ANY commit (calibration keyed to HEAD), including this summary's own commit; T2 recalibrates (snapshot-baseline + calibrate) before its first apply. - harness:
type_census --out-dir <new dir>crashes in write_parked (type_census.py:1553) when the dir does not exist;mkdir -pfirst. - harness: commit_task.sh refuses gitignored-but-tracked paths (.run/**) even when staged;
git add -fthem and omit them from the path list. - generalizable: a "commits per date" column in a generated report is self-referential; a freshness check must mask it on the newest row.
- workflow: any edit under tools/ (or a new harness tool) needs
make kit-corpus(and a config/tool_dictionary.tsv row for a new file) beforemake tools-healthpasses. Research: R3.39-001 (cast forms, lever_census flags, lying source, gte_consolidate CLI) Next task needs: baselines above are the denominators; recalibrate before any restruct/delever apply; sites in .run/P39/census/sites.jsonl (244 MB, keyed tu/fn/line/pos + base/bclass/type); argcheck rows cached at .run/P37/restruct/argcheck_cache.json. Verified:PY tools/timeline.py --check && make tools-health && PY tools/restruct.py --check-ledger→ fresh (81 rows), tools-health OK, 0 violations, rc 0 (.run/logs/t1_verify_d.log);PY tools/type_census.py --check-structs --quiet→ OK, conflicting_types=0 (.run/logs/t1_checkstructs.log); R22 218/218 (.run/logs/t1_r22.log); calibrate 146/146 + selftest --real 82/82 at b5e18e5f83 (.run/logs/t1_snap2.log) Full log: phase-ends/current/logs/T1.md