Skip to content

fix(gen-c): [T;N] param types, test-block bindings, two-arg assert macro - #1920

Merged
gHashTag merged 1 commit into
masterfrom
fix/c-backend-validity
Aug 8, 2026
Merged

fix(gen-c): [T;N] param types, test-block bindings, two-arg assert macro#1920
gHashTag merged 1 commit into
masterfrom
fix/c-backend-validity

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Applying the Zig-campaign methodology to the C backend (gcc -fsyntax-only over tri-net's 68 legacy specs), three systematic fixes take validity from 64/68 invalid to 8/68:

  1. Rust-style [T; N] parameter types lower to T* -- previously the element type was read from AFTER the ] (Zig-style), emitting a bare * name.
  2. Test-block bindings are declared on first assignment (uint64_t b0 = ...; -- the C twin of the Verilog gen-verilog-sim: test-block local bindings emitted as assignments without reg declarations #1894 / Zig defects); tuple targets bind the struct return once via GNU __auto_type (gcc + clang) and peel .f0/.f1.
  3. t27's two-argument assert(cond, "msg") lowers to a self-contained t27_assert macro with the message literal RE-QUOTED -- bare unquoted words previously hit C's one-argument assert macro and even leaked non-ASCII message text into identifier position.

The eight remaining failures are distinct one-offs enumerated in #1919 (array-returning fns, _ redefinition, scalar-from-tuple binding, two call-site arity mismatches that look like genuine spec bugs, an oversized literal, one parse error). Unit suite 1537/1537 (== master); other backends untouched; FROZEN_HASH resealed; NOW.md + docs/NOW.md updated.

Refs #1919

🤖 Generated with Claude Code

Applying the Zig-campaign methodology to the C backend (gcc -fsyntax-only
over tri-net's 68 legacy specs): Rust-style [T; N] parameter types lower
to T* (previously a bare '* name'); test-block bindings are declared on
first assignment (the C twin of #1894), with tuple targets bound once via
GNU __auto_type and peeled .f0/.f1; and t27's two-argument
assert(cond, "msg") lowers to a self-contained t27_assert macro with the
message re-quoted -- bare unquoted words previously hit C's one-argument
assert macro and even leaked non-ASCII message text into identifiers.
Sweep: 64/68 -> 8/68 invalid; the eight remaining one-offs are enumerated
in the issue. Unit suite 1537/1537; FROZEN_HASH resealed.

Refs #1919

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) August 8, 2026 07:55
@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 07:55:42 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)=409ab0614427 != 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 02b98f4 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