intg: declare live-read task results outside translate_off - #58
Conversation
|
Marked draft: this pick is NOT standalone — its live-analysis (synth_live_ids/growLive) was introduced by the parked -translate-sim-only trio, so this branch doesn't compile by itself (caught when the integration release candidate hit the same missing block). Needs the re-cut the carve plan already prescribes (II-14: carry its own live analysis, regold re-cut without the trio's EN-fold fallout). Also reverted out of release/integration-2026-08 pending that re-cut. |
The declarations-used-by-system-tasks group has always been inside translate_off, but a task result (a file handle from $fopen, an imported function's return value) can be read by synthesized logic such as a register input. Hiding the only declaration of a synthesis-visible reference leaves that reference undeclared, and one such error aborts the whole analysis. Partition the group by synthesis liveness: decls with synthesizable readers are emitted in the open, the rest stay under translate_off.
|
Re-cut on clean
Verified: derived_bits 66/0, evaluator/opt 84/0, curry 12/0, quirks 66/0 — all with untouched goldens — and task_result_live 3/0. Full-suite gate on this head running; will post before un-drafting. |
48794eb to
1f3fbee
Compare
|
Full-suite gate on the re-cut head ( |
Task #58 (monorepo handoff bug 3, design per external review): a design that CALLS a BDPI import whose partner .c/.so was never linked segfaulted through a NULL callee global (ip=0) — the loader fills trs_bdpi_<name> pointers only for symbols the companion .bdpi.so provides, and compiled call sites called through whatever was left. Fix: every compiled BDPI call site null-checks its callee global and branches to a noreturn trap through trs_cb_bdpi_missing, passing the import's name as a baked C string — ABI-clean (no call through a mistyped shim), names the exact import, and dead imports stay harmless because an uncalled site never reaches the check. The trap pointer is defined in the module prologue beside the other callback globals (an on-demand declaration without an initializer exports an undefined symbol and knocks the whole artifact onto the fallback path — caught by BdpiMin in the first battery pass) and filled by aot_load with a runtime fn that prints the import name and aborts. Baked/JIT callees are resolved constants and already bail gracefully. The trap fires wherever the first call executes — including DURING trs link, whose window bake / reset protocol runs early cycles; that is exactly the field shape (PbuAlu0Fp*Test died at link), which now aborts loudly with the name instead of segfaulting. Witnesses: new battery fixtures BdpiMissing (executed-missing import: loud named trap, phase-agnostic, never rc 139; interp leg raises its own loud error) and BdpiDead (declared-but-dead import runs green on both engines); battery grows to 25 checks; BdpiMin/StrCatBdpi (real BDPI) unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CerPH99xuDTaGhaBQ3wwqS
Pre-existing stock-bsc bug (II-14): task result declarations move to the synthesis view when read by live logic; 24-file regold re-cut without the parked lint trio's EN-fold fallout.
Integration-release carve (see ~/bluespec/upstream/INTEGRATION-RELEASE.md). Also landed on release/integration-2026-08.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NRVtTNugutAyrTED4qHnrt