fix(gen-zig): var-inference, bare-underscore destructure, branch-safe var silencer - #1917
Merged
Conversation
…e, branch-safe var silencer Three more Zig-backend validity fixes: locals reassigned anywhere in the body are declared 'var' via collect_mutable_names (the Rust backend's discipline -- Zig errors on a mutated const AND on a never-mutated var, so the choice must be inferred); a discarded destructure element emits bare '_' (never 'const _'); and every inferred var gets the canonical '_ = &name;' silencer, because the same name may be declared in several branches and mutated in only one. With tri-net's parallel five-spec legalization, zig ast-check validity goes 9/68 -> 3/68 invalid; the remaining three are the deferred long-tails in the issue. Unit suite 1537/1537; gen-rust byte-identical; FROZEN_HASH resealed. Refs #1910 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
August 8, 2026 07:12
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
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.
Three more Zig-backend validity fixes, measured against tri-net's 68 legacy specs: (1) locals reassigned anywhere in the body are declared
varvia collect_mutable_names -- the Rust backend's discipline; Zig errors BOTH on a mutatedconstand on a never-mutatedvar, so the choice must be inferred; (2) a discarded destructure element emits bare_, neverconst _; (3) every inferredvargets the canonical_ = &name;silencer, because a name may be declared in several branches and mutated in only one.With tri-net's parallel five-spec legalization (tri-net#321),
zig ast-checkvalidity reaches 65/68 (from 2/68 at the start of this campaign). The remaining three are the deferred long-tails in #1910: the array-literal/repeat parse path (auto_config, traffic_animator) and CSE temp declarations emitted after first use (topology_visualizer). Unit suite 1537/1537 (== master); gen-rust byte-identical; FROZEN_HASH resealed; NOW.md + docs/NOW.md updated.Refs #1910
🤖 Generated with Claude Code