Skip to content

fix(gen-zig): array types, tuple test-bindings, void returns, dead-local post-pass - #1915

Merged
gHashTag merged 1 commit into
masterfrom
fix/zig-remaining-classes
Aug 8, 2026
Merged

fix(gen-zig): array types, tuple test-bindings, void returns, dead-local post-pass#1915
gHashTag merged 1 commit into
masterfrom
fix/zig-remaining-classes

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Four more Zig-backend validity fixes, measured against tri-net's 68 legacy specs with zig ast-check (0.15.2):

  1. [T;N] array types lower to Zig's [N]T in params, locals and returns (recursive for nesting).
  2. Tuple test-block bindings lower to const a, const b = f(...); (a verbatim .{a, b} = ... is an invalid assignment target).
  3. Functions without a declared return type emit void -- a bare ) { never parsed.
  4. Dead locals get _ = 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/_cse1 helper 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

@gHashTag
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
gHashTag force-pushed the fix/zig-remaining-classes branch from 395f720 to fd651d1 Compare August 8, 2026 04:25
@github-actions

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

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-08 04:26:10 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)=43c5e020b3f9 != 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).

@gHashTag
gHashTag merged commit 0f064a8 into master Aug 8, 2026
23 checks passed
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.

1 participant