Skip to content

fix(gen-verilog-sim): lower plain assert(cond, "msg") to an if-based check - #1885

Merged
gHashTag merged 1 commit into
masterfrom
fix/icarus-assert-lowering
Aug 7, 2026
Merged

fix(gen-verilog-sim): lower plain assert(cond, "msg") to an if-based check#1885
gHashTag merged 1 commit into
masterfrom
fix/icarus-assert-lowering

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 7, 2026

Copy link
Copy Markdown
Owner

assert is not a Verilog-2005 keyword and the two-argument assert(cond, "msg") form is not SystemVerilog either, so the generated testbench emitted it verbatim and iverilog rejected the entire file -- icarus-simulate was unusable for any spec whose tests use assert() (the standard t27 form) rather than assert_eq(). Both emission paths (the probed-assertions path and the W459 real-check path) now lower assert to the same if-based check assert_eq gets, with the message (%-escaped) in the failure display.

Validation: bootstrap unit suite 1537 passed / 0 failed -- identical to unmodified master; the pre-existing bitnet_layer integration failure reproduces identically on unmodified master (unrelated). On tri-net's four GF-T specs, icarus-simulate goes from "iverilog rejected generated Verilog" to full runs: tri_gft_add / tri_gft_sub / tri_gft_ladder PASS end to end, and tri_gft_arith now SURFACES a real pre-existing failure (GF-T32 u64 helper tests -- u64 width truncation in gen-verilog, the same family as ff0b8de's gen-rust fix; filing separately).

FROZEN_HASH updated per the FROZEN.md ceremony.

🤖 Generated with Claude Code

Closes #1888

@github-actions

github-actions Bot commented Aug 7, 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 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-07 17:06:41 UTC

Summary

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=f74459fc23c3 != 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).

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-07 17:07:46 UTC

Summary

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=f74459fc23c3 != 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).

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

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

…check

'assert' is not a Verilog-2005 keyword and the two-argument form is not
SystemVerilog either, so the testbench emitted it verbatim and iverilog
rejected the entire generated file -- icarus-simulate was unusable for any
spec whose tests use assert() (the standard t27 form) rather than
assert_eq(). Both emission paths (probed assertions and the W459 real-check
path) now lower assert to the same if-based check assert_eq gets, with the
%-escaped message in the failure display.

Validation: bootstrap unit suite 1537/1537, identical to unmodified master;
tri-net GF-T specs go from iverilog-reject to full runs (add/sub/ladder
PASS; tri_gft_arith surfaces the pre-existing u64 width bug, #1886).
FROZEN_HASH resealed and NOW.md updated per ceremony.

Closes #1888

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gHashTag
gHashTag force-pushed the fix/icarus-assert-lowering branch from 26e93aa to b76b9b7 Compare August 7, 2026 17:19
@github-actions

github-actions Bot commented Aug 7, 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 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-07 17:19:50 UTC

Summary

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=f74459fc23c3 != 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 c587c68 into master Aug 7, 2026
29 of 31 checks passed
gHashTag added a commit to gHashTag/tri-net that referenced this pull request Aug 7, 2026
New gft-verilog-kat workflow: t27c icarus-simulate generates a
self-checking testbench from tri_gft_add / tri_gft_sub / tri_gft_ladder and
runs it under iverilog -- the same specs that drive the Rust verifier and
the synthesizable silicon now have their assertions executed on the Verilog
path in CI. Requires t27c >= gHashTag/t27#1885 (assert lowering).
tri_gft_arith stays out until the upstream u64 width bug (t27#1886) is
fixed.

Co-authored-by: SSD DDD <ssdm4@MacBook-Pro.local>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

icarus-simulate: plain assert(cond, "msg") emitted verbatim -- iverilog rejects the whole testbench

1 participant