fix(gen-zig): discard unused parameters and declare test/bench block bindings - #1911
Merged
Conversation
…bindings Two Zig-backend output-validity fixes, measured against tri-net's 68 legacy specs with zig ast-check: (1) parameters the body never reads get a '_ = param;' discard (Zig errors on unused fn parameters); (2) the first assignment to a plain identifier in a test/bench block lowers to 'const name = expr;' -- bindings parse as StmtAssign, not StmtLocal, so the emitted assignment referenced an undeclared name (the Zig twin of the Verilog testbench defect #1894). Invalid gens drop 66/68 -> 38/68; the remaining three mechanical classes (tuple destructuring LHS, un-translated [T;N] array types, unused local consts) are tracked in #1910. Unit suite 1537/1537; gen-rust output byte-identical. FROZEN_HASH resealed. Closes #1910 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two Zig-backend output-validity fixes, measured against tri-net's 68 legacy specs with
zig ast-check(0.15.2): parameters the body never reads get a_ = param;discard, and the first assignment to a plain identifier in a test/bench block lowers toconst name = expr;(bindings parse as StmtAssign -- the Zig twin of the Verilog testbench defect #1894). Invalid gens drop 66/68 -> 38/68; the remaining three mechanical classes (tuple destructuring LHS, un-translated[T;N]array types, unused local consts) are tracked in #1910 for full zig-leg restoration in tri-net.Unit suite 1537/1537 (== master); gen-rust output byte-identical (Zig-only change). FROZEN_HASH resealed; NOW.md + docs/NOW.md updated.
Closes #1910
🤖 Generated with Claude Code