Skip to content

fix(gen-zig): assert invariant predicates, return tail values, discard value calls (owner exception, #5980) - #6579

Merged
gHashTag merged 6 commits into
masterfrom
claude/gen-zig-value-ignored
Oct 5, 2026
Merged

gHashTag merged 6 commits into
masterfrom
claude/gen-zig-value-ignored

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Closes #6315

What

t27c gen-zig produced Zig that would not compile ("value of type 'bool' ignored" and related errors). It now:

  • asserts a brace invariant's predicate instead of leaving it as a bare expression;
  • returns a function's tail expression;
  • discards a value-returning call used as a statement (_ = f(...)).

specs/compiler/zig_value_ignored.t27 is the regression spec. It replaces the hand-written Rust test bootstrap/tests/value_ignored_zig.rs, which this PR deletes.

Owner exception

This PR edits hand-written Rust (bootstrap/src/compiler.rs), which the only-t27 rule forbids. The owner approved it on 2026-10-05, relayed by the coordinator ("fix it and do not stop, do what is best"): the parked gen-zig fixes land as exceptions, one class per PR, with the label owner-approved-foreign. The debt is #5980 (t27core self-host); these fixes move to t27core there.

The entries added to tools/policy/foreign-exceptions.txt (listed here as the coordinator asked; they stay, because the next gen-zig PRs #6451/#6532, #6533 and #6295 need them):

bootstrap/src/compiler.rs
bootstrap/tests/bare_semicolon_zig.rs

Once the last of those PRs lands, the owner should remove it.

File classification

File(s) Kind
bootstrap/src/compiler.rs hand-written Rust, owner exception (#5980)
bootstrap/stage0/FROZEN_HASH derived: sha256 of compiler.rs
bootstrap/tests/value_ignored_zig.rs hand-written Rust, deleted
bootstrap/tests/bare_semicolon_zig.rs hand-written Rust, owner exception: a one-line assertion. It pinned side(1);, which Zig rejects because side returns u32; it now pins _ = side(1);
specs/compiler/zig_value_ignored.t27 .t27 regression spec
.trinity/seals/*.json (about 190) generated on the Railway t27c lab (tri seals drift --fix, t27c seal --save --force, tri seals sync-twins)
tools/seal_baseline.txt ledger data: 5 tests-fail rows
tools/policy/foreign-exceptions.txt policy data: the exception entry
docs/now/2026-10-06-gen-zig-value-ignored.md NOW prose

Lab numbers (t27c reference: gen-zig + zig test over specs/, Railway t27c lab)

run sha pass blocked fail timeout
master 9c59c51 754 502 26 2
this PR 26c013c 768 485 28 2
earlier pair: master 682564f 723 509 25 3
earlier pair: this fix f342dbc 738 492 27 3
  • 15 blocked->pass: c_abi, tri_api_context, tri_api_loop, tri_api_permissions, rust_tail_returns, verilog_branch_context, bpsk, ternary_encoding, ternary_graph, tri27_bytecode, tools/catalog, mcp_protocol, hex, trinity_vm, trinity_compat. The new spec zig_value_ignored also passes.
  • 0 regressions (no pass -> non-pass). The only two "pass -> absent" rows are aggregate-experience and generate_episodes, which landed on master after this branch's base.
  • 2 blocked->fail. The specs now compile, and it is their own tests that fail: tri27_machine (a u32->i32 @intCast panic) and the trios-cli config (the spec's test contradicts its own default). Both are filed in gen-zig: same-width sign cast panics (tri27_machine); trios config test contradicts its default #6560.

CI notes

  • test-ratchet: bare_semicolon_zig is fixed in this PR (see the table). The other two newly failing tests, the_dead_code_census_names_what_it_skipped and corpus_classifier_matches_lean_completeness (ar_ternary_logic), fail the same way on another PR at the same master (claude/t27c-gen-typecheck-gate-rebased). They come from master, not from this change.
  • spec-guards: ring-096-rust vs specs/numeric/formats.t27 DRIFTED, the same failure as on master (spec-guards: ring-096 drift and 8 published-figure pins were hidden behind the seal step #6553).
  • duplicate-bodies, fpga-conformance: these fail on master too. build-and-test: cargo install wasm-objdump cannot find the crate, an infrastructure problem.

Seals

Seals were regenerated on the lab (2cab1b5; a drift pass at 26c013c on the newer master found nothing more). Three specs that now compile have failing or hanging tests: tri27_machine (1 of 10 fail), clock_domain_tb (hangs) and gf16_accel_tb. They were sealed with --force, which records the failures in the seal's tests object. Their 5 seals (twins included) are ledgered as tests-fail in tools/seal_baseline.txt with #6560. On the lab: check_seal_currency passes, and check_seal_coverage reports OK (1454 seals, 1325 hold, 129 known-broken).

spec-guards has been red on master since 2026-09-16 for reasons this PR does not touch (#6553).

🤖 Generated with Claude Code

@gHashTag gHashTag added the owner-approved-foreign Owner-approved exception to the only-t27 rule: hand-written foreign code allowed in this PR label Oct 5, 2026
gHashTag and others added 5 commits October 6, 2026 00:57
…ression, discard a value call (Closes #6315)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #6315

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… regression spec replaces the Rust test (#6315)

Refs #6315

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #6315

The owner approved the parked gen-zig fixes as exceptions; the debt is #5980.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rced tests-fail seals (#6315, #6560)

Refs #6315

Regenerated on the Railway t27c lab at 2cab1b5 (tri seals drift --fix, sync-twins).
tri27_machine, clock_domain_tb and gf16_accel_tb now compile but their own tests
fail or hang; sealed with --force (failures recorded in the seal) and ledgered as
tests-fail. check_seal_currency and check_seal_coverage pass on the lab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gHashTag
gHashTag force-pushed the claude/gen-zig-value-ignored branch from 7d4aaf0 to 26c013c Compare October 5, 2026 17:57
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-05 17:59:15 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 41
PRs with All Checks Green 9
READY 9
FAILING 41
PENDING 0
NO CHECKS YET 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=8e8efc938684 != 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).

Refs #6315

The bare-semicolon test pinned `side(1);`, which Zig rejects because side
returns u32. With #6315 gen-zig writes `_ = side(1);`; the test pins that.
Owner-approved exception entry added for the test file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-05 18:09:01 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 40
PRs with All Checks Green 10
READY 9
FAILING 40
PENDING 0
NO CHECKS YET 0

These columns do not partition: 9 + 40 + 0 + 0 = 49, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=8e8efc938684 != 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

owner-approved-foreign Owner-approved exception to the only-t27 rule: hand-written foreign code allowed in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gen-zig: brace invariants and tail expressions become 'value ignored' (16 specs do not compile)

1 participant