Skip to content

fix(compiler): repair all 7 gen-verilog regressions from batch merge #1783 (unblocks the repo) (#1789) - #1790

Merged
gHashTag merged 1 commit into
masterfrom
fix/codegen-w458-w459
Aug 6, 2026
Merged

gHashTag merged 1 commit into
masterfrom
fix/codegen-w458-w459

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 6, 2026 •

Copy link
Copy Markdown
Owner

Closes #1789

Master is red and nothing can merge — the check gate fails (7 internal tests) and gen-verilog emits invalid Verilog that yosys rejects repo-wide. Root cause: the #1783 batch merge (wave-loops w420–w459) reverted/mangled several gen-verilog pieces; #1788 only partially repaired. This fixes all 7 — cargo test now 1535 passed / 0 failed, yosys synthesizes again.

Fixes

  1. yosys unblock (repo-wide): tests section opened with // synthesis translate_off but closed with `endif (unbalanced) → "Found `endif outside macro conditional". Now emits `ifndef SIMULATION to match. Fixes tests_w458::no_translate_off_comments.
  2. pragma ram_style/rom_style: node.extra_pragma was unused on module-array vars; now emitted as (* ram_style="…" *). Fixes tests_w457_ram_style::{block,distributed}.
  3. array-param → module-array binding: current_fn_name_original was never assigned (only cleared) so the binding map lookup used an empty key; restored the assignment in gen_verilog_fn, and try_emit_primitive_array_access now indexes a bound param as the UNPACKED module array rom[i]. Fixes tests_w458::array_param_read_emitted + tests_w459::array_param_bound_from_test_block.
  4. test-block call emission: bare side-effecting calls (set(1,v)) and assert_eq now emit as REAL statements/comparisons — the section is `ifndef SIMULATION-guarded so synthesis is unaffected. Fixes tests_w459::test_block_emits_real_function_call.
  5. keyword escaping: a local var colliding with a Verilog keyword (task) is now escaped in its declaration + assignment in emit_local. Fixes …keyword_local_and_module_escaped.

FROZEN_HASH resealed (M5). Spec seals are stale vs the corrected output (they encoded the broken output) — a repo-wide reseal sweep is a mechanical follow-up; spec seals are non-blocking (no required gate verifies them; seal-staleness-warn only warns).

Unblocks PR #1786 (11 cycles of spec-first hardware work) and every other stuck PR.

🤖 Generated with Claude Code

…1783

Master was red (7 internal tests + yosys broken repo-wide -> check gate
red -> nothing could merge) from the #1783 batch merge that #1788 only
partially repaired. All 7 fixed; cargo test now 1535 passed / 0 failed;
yosys synthesizes again.

1. yosys unblock: test-assertions section opened with
   `// synthesis translate_off` but closed with `endif (unbalanced);
   now emits `ifndef SIMULATION to match.
2. pragma ram_style/rom_style now emitted as (* ram_style="..." *) on
   module array var decls (node.extra_pragma was unused).
3. array-param -> module-array binding: current_fn_name_original was
   never assigned (only cleared) so the binding lookup used an empty
   key; restored it, and array access now indexes the bound param as the
   unpacked module array rom[i].
4. test-block bare side-effecting calls and assert_eq are emitted as
   real statements/comparisons (section is `ifndef SIMULATION-guarded,
   so synthesis is unaffected).
5. keyword-colliding local var (task) escaped in decl+assign in
   emit_local, matching reference sites.

FROZEN_HASH resealed. Spec seals are stale vs the corrected output
(mechanical reseal follow-up; spec seals are non-blocking). Unblocks the
repo.

Closes #1789

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

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

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-06 13:37:26 UTC

Summary

Status Count
Total Open PRs 3
PRs with Failing Checks 2
PRs with All Checks Green 1
READY 1
FAILING 2
PENDING 0

Seal Status

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

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.

master codegen red: 7 tests + yosys broken (batch-merge #1783 regressions) — 3 fixed, 4 localized

1 participant