From e031245825ad8335a00ccd6c3873b1b2aec1d9a7 Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Sat, 12 Sep 2026 14:57:23 -0600 Subject: [PATCH] =?UTF-8?q?tools(phase-37):=20restruct=20defs=5Fvisible=20?= =?UTF-8?q?indexes=20the=20shared=20headers=20a=20sibling=20TU=20includes?= =?UTF-8?q?=20=E2=80=94=20t4=5FD21's=2010,495=20'external'=20DECL-NONE=20r?= =?UTF-8?q?ows=20were=20the=20binary's=20own=20shared-header=20functions?= =?UTF-8?q?=20(func=5F80147514-shaped);=20the=20killed=20t4=5FD22=20erased?= =?UTF-8?q?=20(6=20files=20reverted,=20197=20orphan=20rows=20dropped);=20c?= =?UTF-8?q?ycle=20relaunched=20with=20REDRAW=3DDECL-NONE=20|=20?= =?UTF-8?q?=F0=9F=9B=91=20T4=20in=20progress=20(S108)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .run/P37/restruct/calibrate_t4_D22.log | 5 +++++ .run/P37/restruct/cycle_t4e.log | 7 +++++++ .run/P37/restruct/snapshot_t4_D22.log | 1 + phase-ends/CURRENT_PHASE.md | 18 ++++++++++++++++++ tools/restruct.py | 9 ++++++++- 5 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .run/P37/restruct/calibrate_t4_D22.log create mode 100644 .run/P37/restruct/snapshot_t4_D22.log diff --git a/.run/P37/restruct/calibrate_t4_D22.log b/.run/P37/restruct/calibrate_t4_D22.log new file mode 100644 index 0000000000..c9732ba6f5 --- /dev/null +++ b/.run/P37/restruct/calibrate_t4_D22.log @@ -0,0 +1,5 @@ +delever_oracle --calibrate main md_SC07_004 ov_SC03_015 ov_SC04_011: 146/146 objects byte-identical untouched; twin checks 32 (0 mismatch); positive control DIFFERS on build/src/800.o; 2.7 s — OK + main 85/85 identical, mean 0.103 s per object + md_SC07_004 1/1 identical, mean 0.548 s per object + ov_SC03_015 32/32 identical, mean 0.155 s per object + ov_SC04_011 28/28 identical, mean 0.145 s per object diff --git a/.run/P37/restruct/cycle_t4e.log b/.run/P37/restruct/cycle_t4e.log index be6d3f6845..f3846b96e0 100644 --- a/.run/P37/restruct/cycle_t4e.log +++ b/.run/P37/restruct/cycle_t4e.log @@ -1,2 +1,9 @@ cycle: batch t4_D21 wrote no file — restruct: batch t4_D21 rung D — 300 files (TUs; 3877 drawable) · 0 declaration units: 0 canonical / 0 promoted / 0 K&R marked / 0 aliases typed / 0 __builtin_abs → abs / 0 kept · compiles 0 in 259 s wall · final 300/300 identical · written 0 files log: t4_D21 +cycle: batch t4_D21 committed a6ea4252f — restruct: batch t4_D21 rung D — 300 files (TUs; 3877 drawable) · 0 declaration units: 0 canonical / 0 promoted / 0 K&R marked / 0 aliases typed / 0 __builtin_abs → abs / 0 kept · compiles 0 in 259 s wall · final 300/300 identical · written 0 files | check-all: 218 passed, 0 failed of 218 +cycle: batch t4_D22 — restruct exited non-zero +KeyboardInterrupt +Command terminated by signal 2 +t4_D22 wall=133.02 s +exit=130 +cycle exit=1 diff --git a/.run/P37/restruct/snapshot_t4_D22.log b/.run/P37/restruct/snapshot_t4_D22.log new file mode 100644 index 0000000000..617bb0eaf9 --- /dev/null +++ b/.run/P37/restruct/snapshot_t4_D22.log @@ -0,0 +1 @@ +delever_oracle --snapshot-baseline: 7428 object(s) under .run/P36/delever/baseline at a6ea4252f; link inputs for 218/218 binaries under .run/P36/delever/baseline/_link (links.json) diff --git a/phase-ends/CURRENT_PHASE.md b/phase-ends/CURRENT_PHASE.md index ba754db2c5..087d3f5528 100644 --- a/phase-ends/CURRENT_PHASE.md +++ b/phase-ends/CURRENT_PHASE.md @@ -460,6 +460,24 @@ bucketed by what each bucket needs before any plan is proposed. **Candidates for - **2026-09-12 — T4 batch `t4_D21`** (`.run/P37/restruct/run_t4_D21.log`, `batch_t4_D21.json`): `restruct: batch t4_D21 rung D — 300 files (TUs; 3877 drawable) · 0 declaration units: 0 canonical / 0 promoted / 0 K&R marked / 0 aliases typed / 0 __builtin_abs → abs / 0 kept · compiles 0 in 259 s wall · final 300/300 identical · written 0 files` → R22 (`.run/P37/baseline/r22_t4_D21.log`) **`check-all: 218 passed, 0 failed of 218`** (`wall=87.91 s`) → census `(census skipped)`. +- **S108 — T4 batch `t4_D21` = the DECL-NONE test: FAILED the test, and the failure was the INSTRUMENT (R40).** `restruct: batch t4_D21 rung D — + 300 files (TUs; 3877 drawable) · 0 declaration units … compiles 0 in 259 s wall · final 300/300 identical · written 0 files` → R22 `check-all: + 218 passed, 0 failed of 218` → committed `a6ea4252f` by the cycle (0 files; 11,885 `DECL-NONE` rows: 10,495 "no visible definition (external + to this TU's binary…)", 1,387 "already canonical", 3 K&R). Read against the tree (R14): `func_80147514` — DECL-NONE in all 300 TUs — is + defined in `src/shared/ov/func_80147514.h`, included by the binary's own `ov_SC05_000_after.c`. **`defs_visible` indexed the sibling TUs' + bodies but not the shared headers the siblings include — and since P35 every shared body IS such a header, so a binary's own shared + functions read as external.** The class was invisible to D1–D20 too (before the DECL-NONE settling those callees were silently not units, + never touched — the lying declarations of shared-header-defined functions across the fleet are still owed). Fixed at the cause: a sibling + TU's headers join the index (`defs_visible`); known-true: the three sample callees now resolve to their `src/shared/ov/*.h` definitions + with units, `skipped {}`. **My own race on the way (recorded, not repeated):** I sent `kill -INT` to the D22 judge and ran `--restore` + 8 s later while the judge was still unwinding (it honours the SIGINT only after its in-flight units — ~2 min); the restore consumed + `inflight.json` and dropped 1,321 rows, the judge then wrote 6 more files and 197 rows with no tool-side restore left. Recovery: the 6 + files (declaration rewrites only, IDENTICAL-judged, but a killed batch's unbanked candidate text) reverted to HEAD by an operator + `git checkout` — stated here (R102 governs tools; R42's banked work is not at issue) — and the 197 orphan rows dropped (`ledger.jsonl` 48,114 + → 47,917; `--check-ledger` 0 violations; `git diff src` empty). **Gotcha for the checkpoint: after `kill -INT`, WAIT for the judge's exit + (`ps`) before `--restore`.** Because `DECL-NONE` is a DONE verdict, D21's 300 TUs are settled on the blindness: the cycle relaunched with + `REDRAW="DECL-NONE"` (batches 22–40) so every such pair is drawn again — the genuinely external ones re-settle at zero compiles. + ## 🛑 SESSION CHECKPOINT — S107 (2026-09-12, FINAL — written for a FRESH session at 84 % context; the session's last commit follows this): gate 1 APPROVED, **T0 ☑ T1 ☑ T2 ☑ T3 ☑ — T4 IN PROGRESS (☐)** — 🛑 **T4 NEXT: resume the declaration layer where the cycle stopped (below, §1 "T4 — where it stands and the exact next commands"); xHigh** | R22 `check-all: 218 passed, 0 failed of 218` at `f2b58011e` (every one of the 21 T4 commits carries its own) | HEAD after this commit is the checkpoint's commit; tree clean; nothing pushed after `79b2f6f15` (Drew pushes, R6) | last batch `t4_D21` on 5cbf06f84: 300 files (TUs; 3877 drawable) · 0 declaration units: 0 canonical / 0 promoted / 0 K&R marked / 0 aliases typed / 0 __builtin_abs → abs / 0 kept · compiles 0 in **Replay this block into the chat at the next session start (R64); it is the ONLY in-phase context the next session inherits. Everything below diff --git a/tools/restruct.py b/tools/restruct.py index 572d5eb29f..d8f69438ac 100644 --- a/tools/restruct.py +++ b/tools/restruct.py @@ -1321,7 +1321,14 @@ def defs_visible(tu): pass files = [tu] + sorted(h for h in headers_of(tu) if h in results) for d_ in sorted(dirs): - files += [rel for rel in _files_in_dir(d_) if rel != tu] + for rel in _files_in_dir(d_): + if rel == tu: + continue + # the sibling TU AND the shared headers it includes: since P35 every shared body is a header included by ONE member TU of + # the binary, so a definition visible to a sibling is a definition this binary links (t4_D21: 10,495 "external" rows were + # func_80147514-shaped — defined in src/shared/ov/, included by the binary's *_after.c, invisible here) + files.append(rel) + files += sorted(h for h in headers_of(rel) if h in results) out = collections.defaultdict(list) seen = set() for rel in files: