Repository navigation
specs: bench bodies Zig never type-checks (8 specs reject once referenced) #6268
Description
Problem
Zig analyses a function lazily. A bench body that t27c gen emits is never referenced by a test, so zig test never type-checks it. The bench lane (#6258) referenced every bench with _ = &bench_x; and found that in 8 specs that pass the reference path, Zig rejects the bench body:
value of type 'u32' ignored(a call result dropped as a statement), infpga/boards/arty_a7_integration,fpga/boards/qmtech_a100t_integrationandfpga/testbench/{cts,partition,power,simulator,router}_tb. Example:estimate_latency(...)inbench_cts.unable to resolve comptime valueinisa/ternary_gates(a.{...}tuple indexed with a runtime value).
From the same run: 78 of the 116 former-BenchBlock files fail once their benches are referenced, and fpga/testbench/gf16_accel_tb hangs in test_add_zero.
Goal
Every bench body in specs/ type-checks, and a check keeps it that way.
Original checks (kept for history; the Queen does not run these)
- The 8 specs above compile with every bench referenced (
_ = &bench_x;or an equivalent t27c option). - Either
t27c genemits a reference to each bench, or a CI check compiles the bench bodies. Whichever is chosen is written down in the PR. - The 78-file figure is re-measured and either fixed or listed in a ledger.
Original file list
Spec fixes under specs/, plus t27c's zig backend if the chosen fix is to emit a reference. t27b does not change: it already lowers and compiles each bench body (#6258).
Refs #6063
Queen-runnable restatement (2026-10-05)
The first attempt (branch queen-6268) left no diff against master. Re-measured on master 13e212a by generating each spec, appending test { _ = &bench_x; } for every bench and running zig test --test-no-exec: all 8 specs are still rejected (7 with value of type 'u32' ignored, isa/ternary_gates with unable to resolve comptime value at the bench bodies that are written in Zig syntax - @setEvalBranchQuota, @intCast, for (0..1000)). A spec-only fix is measured to work: writing the dropped call as _ = estimate_latency(...); in cts_tb.t27 removes that error. This restatement covers the spec fixes; the generator option and the CI check from the original goal are hand-written Rust/YAML and are not part of this card.
Boundary
specs/fpga/boards/arty_a7_integration.t27specs/fpga/boards/qmtech_a100t_integration.t27specs/fpga/testbench/cts_tb.t27specs/fpga/testbench/partition_tb.t27specs/fpga/testbench/power_tb.t27specs/fpga/testbench/simulator_tb.t27specs/fpga/testbench/router_tb.t27specs/isa/ternary_gates.t27
User Scenarios & Testing
- Given master, where each listed spec's bench body is rejected by Zig once the bench is referenced, when every dropped call result in a bench is written as
_ = call(...);and theternary_gatesbenches are rewritten in t27 constructs (no@builtins, nofor (0..n), the operand array indexed by a value the language defines), thenzig testaccepts each spec with every bench referenced. - Given the fixed specs, when
t27c test-reportruns them, then their existing tests still pass.
Requirements
- FR-001: The change MUST make every bench body in the 8 listed specs type-check when referenced, by editing the bench bodies only.
- FR-002: The change MUST NOT change test blocks or function bodies, and MUST keep every bench (no deletion of a bench to silence it).
- FR-003: The change MUST NOT add or modify non-t27 hand-written code (specs/policy/own_language.t27);
bootstrap/and.github/are out of scope.
Success Criteria
grep -cE '^ +_ = ' specs/fpga/boards/arty_a7_integration.t27prints at least1grep -cE '^ +_ = ' specs/fpga/boards/qmtech_a100t_integration.t27prints at least1grep -cE '^ +_ = ' specs/fpga/testbench/cts_tb.t27prints at least1grep -cE '^ +_ = ' specs/fpga/testbench/partition_tb.t27prints at least1grep -cE '^ +_ = ' specs/fpga/testbench/power_tb.t27prints at least1grep -cE '^ +_ = ' specs/fpga/testbench/simulator_tb.t27prints at least1grep -cE '^ +_ = ' specs/fpga/testbench/router_tb.t27prints at least1grep -c '@' specs/isa/ternary_gates.t27prints0t27c test-report specs/fpga/testbench/cts_tb.t27 | grep -cE '^ FAIL +0$'prints1t27c parse specs/isa/ternary_gates.t27exits 0 and the spec has at least 2 tests.
Activity
github-actions commentedon Oct 9, 2026
Re-filed as #8195.
An attempt claimed this issue on 2026-10-05 and left an empty branch. A dispatch row that has spent its retry ceiling is released once and then keeps its issue for good, which is the right rule for a third identical failure and the wrong outcome for an issue nobody ever attempted twice. The new issue carries the same work, the same boundary, and today's brief.
Closing this one so the swarm can take the work again.