fix(gen-zig): array types, tuple test-bindings, void returns, dead-local post-pass - #1915
Merged
Conversation
gHashTag
enabled auto-merge (squash)
August 8, 2026 04:24
…cal post-pass
Four more Zig-backend validity fixes measured against tri-net's 68 legacy
specs: [T;N] -> [N]T in params/locals/returns; tuple test-block bindings
lower to 'const a, const b = ...'; fns without a declared return type emit
'void' (a bare ') {' never parsed); and dead locals are discarded by an
exact post-pass over the EMITTED Zig (per-top-level-block identifier
counting) -- the optimizer const-inlines uses while leaving declarations,
so AST-side prediction cannot match zig's used/unused verdict, and zig
also errors on pointless discards of used locals. Validity: 38/68 -> 9/68
invalid; the remaining nine are distinct long-tail one-offs listed in
the issue. Unit suite 1537/1537; FROZEN_HASH resealed.
Refs #1910
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gHashTag
force-pushed
the
fix/zig-remaining-classes
branch
from
August 8, 2026 04:25
395f720 to
fd651d1
Compare
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.
Four more Zig-backend validity fixes, measured against tri-net's 68 legacy specs with
zig ast-check(0.15.2):[T;N]array types lower to Zig's[N]Tin params, locals and returns (recursive for nesting).const a, const b = f(...);(a verbatim.{a, b} = ...is an invalid assignment target).void-- a bare) {never parsed._ = x;via an exact POST-PASS over the emitted Zig (per top-level block identifier counting). AST-side prediction cannot work: the optimizer const-inlines uses while leaving declarations behind, and zig errors BOTH on unused locals and on pointless discards of used ones -- only the emitted text decides.Validity: 38/68 -> 9/68 invalid (66/68 two waves ago). The nine remaining are distinct long-tail one-offs (undeclared
wrapping_sub/_cse1helper emissions, function-param shadowing a module decl,_used as an identifier, 2D array types, struct-literal field syntax) -- enumerated in #1910, which stays open to track them. Unit suite 1537/1537 (== master); gen-rust byte-identical; FROZEN_HASH resealed; NOW.md + docs/NOW.md updated.Refs #1910
🤖 Generated with Claude Code