Skip to content

fix(gen-verilog): re-materialize test-block call temps after a rebinding - #1991

Merged
gHashTag merged 2 commits into
masterfrom
fix/verilog-tb-cse-rematerialize
Aug 8, 2026
Merged

fix(gen-verilog): re-materialize test-block call temps after a rebinding#1991
gHashTag merged 2 commits into
masterfrom
fix/verilog-tb-cse-rematerialize

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Problem

A call-return temporary is CSE'd by call TEXT in the Verilog testbench, but a test block mutates its bindings between statements — the st = on_ack(st); repeated-step pattern. Caching the temp across a reassignment reused a stale value, so the modelled state never advanced: every step re-tested the pre-mutation snapshot. The divergence only surfaced on the Verilog path (Rust/Zig/C evaluate the calls directly).

Fix

After any statement that rebinds a variable (StmtAssign, or a named StmtLocal), invalidate the materialized set so the next use re-assigns the temp from the current values. Nested-call temps inside a single non-mutating statement are unaffected — they still materialize once, in dependency order (an earlier over-broad per-statement clear scrambled that; this is the narrow, mutation-scoped version).

Validation

  • 6 tri-net runtime-divergence specs flip to passing under Icarus: congestion_control, flow_control, network_simulator, production_scenarios, quarantine_manager, traffic_animator
  • Full 99-spec icarus gate re-run against origin/main specs: 0 regressions
  • FROZEN_HASH resealed

Refs #1948

🤖 Generated with Claude Code

A call-return temporary is CSE'd by call TEXT, but a test block mutates
its bindings between statements (`st = on_ack(st);` repeated). Caching
the temp across a reassignment reused a STALE value, so the modelled
state never advanced -- every step re-tested the pre-mutation snapshot,
and the divergence only showed on the Verilog path (Rust/Zig/C evaluate
the calls directly).

After any statement that rebinds a variable (StmtAssign, or a named
StmtLocal), invalidate the materialized set so the next use re-assigns
the temp from the current values. Nested-call temps inside a single
non-mutating statement are unaffected -- they still materialize once, in
dependency order.

tri-net corpus: 6 runtime-divergence specs flip to passing
(congestion_control, flow_control, network_simulator,
production_scenarios, quarantine_manager, traffic_animator); full
99-spec icarus gate shows 0 regressions.

FROZEN_HASH resealed.

Refs #1948

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-08 23:48:47 UTC

Summary

Status Count
Total Open PRs 15
PRs with Failing Checks 2
PRs with All Checks Green 13
READY 5
FAILING 2
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=512b60aa836b != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

Refs #1948

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-08 23:50:41 UTC

Summary

Status Count
Total Open PRs 15
PRs with Failing Checks 2
PRs with All Checks Green 13
READY 5
FAILING 2
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=512b60aa836b != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit 1d15347 into master Aug 8, 2026
28 of 30 checks passed
@gHashTag
gHashTag deleted the fix/verilog-tb-cse-rematerialize branch August 8, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant