Skip to content

fix(gen-verilog-sim): test-block reg declarations + 64-bit __mul_noop - #1899

Merged
gHashTag merged 2 commits into
masterfrom
fix/tb-local-decls
Aug 7, 2026
Merged

fix(gen-verilog-sim): test-block reg declarations + 64-bit __mul_noop#1899
gHashTag merged 2 commits into
masterfrom
fix/tb-local-decls

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Two testbench-path fixes, each surfaced by running tri-net's ring specs under the new icarus KAT flow:

  1. Closes gen-verilog-sim: test-block local bindings emitted as assignments without reg declarations #1894 -- named test-block bindings (h = f(...);) parse as StmtAssign, not StmtLocal, so gen_verilog_probe_prelude never declared them and iverilog could not bind the names (21 of 26 lowerable tri-net ring specs failed to compile). Every plain-identifier assign target is now declared once (recursively collected, width-inferred from the value expression, 64-bit fallback) before any procedural statement.

  2. Closes gen-verilog: u64 width truncation in lowered helper functions (surfaced by icarus assert lowering) #1886 -- the injected R-SI-1 __mul_noop helper was function [31:0] with [31:0] inputs: every u64 multiply silently truncated, so GF-T32/64 mantissa products computed wrong in simulation while gen-rust and the silicon KATs are correct. Widened to [63:0] in/out with a [127:0] accumulator over 64 iterations; 32-bit callers unchanged.

Validation: on tri-net's ring specs the icarus run goes 5/26 -> 23/26 locally (the last three blockers are tri-net spec-side: Verilog reserved words class/small used as identifiers, and one stale spec test the simulation legitimately catches -- fixed in tri-net separately). FROZEN_HASH resealed per ceremony; NOW.md updated.

🤖 Generated with Claude Code

@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 19:42:22 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)=2bd87d0d139e != 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).

…bench prelude

Named test-block bindings ('h = f(...);') parse as StmtAssign, not
StmtLocal, so gen_verilog_probe_prelude never declared them and iverilog
could not bind the names -- 21 of tri-net's 26 lowerable ring specs failed
to compile. Declare every plain-identifier assign target once, recursively
collected, width-inferred from its value expression (64-bit fallback),
before any procedural statement. Unlocks 11 of the 21 immediately (the
rest hit the u64 __mul_noop truncation, #1886).

FROZEN_HASH resealed per ceremony.

Closes #1894

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gHashTag
gHashTag force-pushed the fix/tb-local-decls branch from 54ddf92 to 0a4460f Compare August 7, 2026 19:49
@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 19:49:27 UTC

Summary

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

Seal Status

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

…runcate

The injected R-SI-1 multiplication helper was function [31:0] with [31:0]
inputs, so every u64 multiply in generated Verilog silently truncated --
GF-T32/64 mantissa products (up to 2^48+) computed wrong in simulation
while the same spec functions are correct in gen-rust and in the
hand-written silicon KATs. Now [63:0] in/out with a [127:0] accumulator
over 64 iterations; 32-bit callers are unchanged (zero-extended).
Unlocks tri_gft_arith and the u64 money-layer specs in tri-net's
icarus KAT run. FROZEN_HASH resealed.

Closes #1886

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gHashTag
gHashTag force-pushed the fix/tb-local-decls branch from 0a4460f to 2c9557a Compare August 7, 2026 19:54
@gHashTag
gHashTag enabled auto-merge (squash) August 7, 2026 19:54
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-07 19:54:33 UTC

Summary

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

Seal Status

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant