Repository navigation
Description
Re-filed from #4480. An attempt claimed that issue on 2026-09-20 and left an empty branch, and a dispatch row that has spent its retry ceiling keeps its issue for good - so no bee could take it again, however much the brief improved. The work below is carried over unchanged.
Test the 1 untested function in specs/fpga/testbench/vcd_trace_tb.t27
Context
t27c coverage specs/fpga/testbench/vcd_trace_tb.t27 says this file declares 4 functions and 1 of them has no test. A function with no test is a claim: it compiles, it generates, and nothing in this repository says what it is supposed to do.
.t27 is the hand-authored source language. t27c compiles it out to C, Rust, Verilog and Zig. You are writing source, not compiler output, and not prose about an implementation.
Before you write a function, ask whether it already exists. 576 of the 4021 function bodies in specs/ are byte-identical copies of another one - magadd written 30 times, sadd 29 - because nothing told the agent writing them that the function was already there.
If it already exists, do not copy it and do not try to import it. Cross-module reuse does not generate yet: use other::fn; compiles to a comment and an unqualified call, and the Zig fails with use of undeclared identifier. Say so in your report instead - name the file and line where the function lives and state that this spec needs it - and implement only what this spec's own criteria ask for. Duplicate Body Ratchet fails a pull request that adds a new copy, and 576 of 4021 bodies here are already copies, each of which has to be fixed everywhere it was written.
The compiler answers more questions than grep does. Every one of these reads the file and prints; none of them writes. Run them from the repository root, with <spec> replaced by the file named in ## Boundary:
.t27 is not Rust and not Zig, and a bee fluent in either writes one by
accident. Measured 2026-09-20: a bee filled eight bodies in
specs/file/watcher.t27 with return Ok(());, Err(FileError::WatcherNotFound)
and for i in 0..watchers.length. The parse ratchet refused the whole file --
Unexpected token in expression: RParen, line 123 -- and a spec that does not
parse generates nothing, so every test it already carried stopped running.
At the top level the parser accepts exactly these eight forms, with an optional
pub, and no others:
const var fn enum struct test invariant bench
There is no trait, no impl, no type X = ..., no generics, no macro. What
a bee reaches for from another language, and what happens:
- Rust's result sugar (
Ok(()),Err(E::V),?) is not a construct here. - Rust macros (
println!,format!,vec!) are not constructs here. - A range loop (
for i in 0..n) is Rust and Zig, not this language. - Zig builtins (
catch unreachable,@intCast,@constCast) are not constructs here. - Cross-module reuse (
use other::fn;) parses and then generates a comment and an unqualified call, so the Zig fails withuse of undeclared identifier(use a::b; generates no import, so no spec can reuse a function from another spec #4298). It does not work yet.
t27c parse <spec> answers in one line whether what you wrote is the language.
Run it before you report, every time.
t27c spec-status <spec>- the compiler's one-word verdict: IMPLEMENTED, PARTIAL, UNWRITTEN, NOPARSE, NOFN. Exit code is 0 whatever it says, so read the word.t27c symbols <spec>- every name the file declares, with its kind. Answers "does this already exist here?" before you add it.t27c outline <spec>- per function: its locals, what it calls, what it returns. The contract you are implementing against.t27c coverage <spec>- which functions have a test and which do not. The issue asks for tests; this is how you check you wrote them.t27c lint <spec>- style and shape warnings. It OVER-REPORTShas no test or invariant: measured 2026-09-20 over 60 specs it printed 677 of those wherecoveragefound 190 untested functions, disagreeing on 59 of the 60 - it warns aboutbit_to_trit_pairinspecs/base/ternary_encoding.t27, whichtest bit_to_trit_pair_zerocalls on line 249. Read it as a hint;coverageis the answer.t27c typecheck <spec>- types, before generation. PrintsTypecheck OK (0 errors, 0 warnings)or the errors.t27c test-report <spec>- builds this spec and runs its own tests, which is what the oracle does.BLOCKEDmeans the generated Zig does not compile, with the error beside it.python3 tools/dupe_scan.py --name <function>- where that function already lives, if it does. 576 of 4021 bodies here are byte-identical copies.
Check yourself with t27c test-report before you report. It builds this spec and runs its own tests, which is what the review does. BLOCKED means the generated Zig does not compile, and the error is printed beside it. If the block comes from something outside this file, say so in your report and name the error rather than working around it. The rest of the toolbelt is in docs/BEE_TOOLBELT.md.
Current state - re-run these yourself, from the repository root
$ t27c coverage specs/fpga/testbench/vcd_trace_tb.t27
Functions: 4
Untested: 1
User Scenarios & Testing
- Given
specs/fpga/testbench/vcd_trace_tb.t27, where 1 of its 4 functions has no test,
whentickis written and the commands under Acceptance criteria are run from the repository root,
then each of those commands prints the value stated beside it.
Requirements
- FR-001: every signature quoted below MUST stay exactly as it is - the signature is the contract, and a caller elsewhere is holding it.
- FR-002: the spec MUST still parse afterwards.
t27c parseis the check, and a spec that stops parsing generates nothing, so every test it already carried stops running too. - FR-003: no function MUST be deleted to satisfy a count. The function count is itself a criterion below.
- FR-004: each test MUST assert on a result.
assert trueand a body of only comments are counted as vacuous byt27c validate-vacuity, and the corpus ratchet fails a file that gains one.
What has no test
Quoted verbatim from the file - keep every signature exactly as it is:
fn tick()
The file already has 5 test declaration(s). Write one for each function above. Either spelling is accepted: test name { or test "name" {.
A test that asserts nothing is not coverage. assert true and a body of only comments are both counted as vacuous by t27c validate-vacuity, and the corpus ratchet fails a file that gains one.
Acceptance criteria
-
t27c coverage specs/fpga/testbench/vcd_trace_tb.t27 2>&1 | grep -cE '^Untested: +0$'prints1(today: 0 - it printsUntested: 1)
-
grep -cE '^[[:space:]]*(pub[[:space:]]+)?fn[[:space:]]' specs/fpga/testbench/vcd_trace_tb.t27prints4- the same functions are still there (deleting a function also makes it untested-free)
-
grep -cE '^[[:space:]]*test[[:space:]]+("|[A-Za-z_])' specs/fpga/testbench/vcd_trace_tb.t27prints at least6(today: 5)
-
t27c spec-status specs/fpga/testbench/vcd_trace_tb.t27printsIMPLEMENTED(today: IMPLEMENTED)
Boundary
specs/fpga/testbench/vcd_trace_tb.t27
The instruments
Every one of these reads and prints; none of them writes. Run them from the repository root, with <spec> replaced by the file in ## Boundary:
.t27 is not Rust and not Zig, and a bee fluent in either writes one by
accident. Measured 2026-09-20: a bee filled eight bodies in
specs/file/watcher.t27 with return Ok(());, Err(FileError::WatcherNotFound)
and for i in 0..watchers.length. The parse ratchet refused the whole file --
Unexpected token in expression: RParen, line 123 -- and a spec that does not
parse generates nothing, so every test it already carried stopped running.
At the top level the parser accepts exactly these eight forms, with an optional
pub, and no others:
const var fn enum struct test invariant bench
There is no trait, no impl, no type X = ..., no generics, no macro. What
a bee reaches for from another language, and what happens:
- Rust's result sugar (
Ok(()),Err(E::V),?) is not a construct here. - Rust macros (
println!,format!,vec!) are not constructs here. - A range loop (
for i in 0..n) is Rust and Zig, not this language. - Zig builtins (
catch unreachable,@intCast,@constCast) are not constructs here. - Cross-module reuse (
use other::fn;) parses and then generates a comment and an unqualified call, so the Zig fails withuse of undeclared identifier(use a::b; generates no import, so no spec can reuse a function from another spec #4298). It does not work yet.
t27c parse <spec> answers in one line whether what you wrote is the language.
Run it before you report, every time.
t27c spec-status <spec>- the compiler's one-word verdict: IMPLEMENTED, PARTIAL, UNWRITTEN, NOPARSE, NOFN. Exit code is 0 whatever it says, so read the word.t27c symbols <spec>- every name the file declares, with its kind. Answers "does this already exist here?" before you add it.t27c outline <spec>- per function: its locals, what it calls, what it returns. The contract you are implementing against.t27c coverage <spec>- which functions have a test and which do not. The issue asks for tests; this is how you check you wrote them.t27c lint <spec>- style and shape warnings. It OVER-REPORTShas no test or invariant: measured 2026-09-20 over 60 specs it printed 677 of those wherecoveragefound 190 untested functions, disagreeing on 59 of the 60 - it warns aboutbit_to_trit_pairinspecs/base/ternary_encoding.t27, whichtest bit_to_trit_pair_zerocalls on line 249. Read it as a hint;coverageis the answer.t27c typecheck <spec>- types, before generation. PrintsTypecheck OK (0 errors, 0 warnings)or the errors.t27c test-report <spec>- builds this spec and runs its own tests, which is what the oracle does.BLOCKEDmeans the generated Zig does not compile, with the error beside it.python3 tools/dupe_scan.py --name <function>- where that function already lives, if it does. 576 of 4021 bodies here are byte-identical copies.
The rest of the toolbelt is in docs/BEE_TOOLBELT.md.
Activity
docs: the coordination entry this branch needs to land
Test the 1 untested function in specs/fpga/testbench/vcd_trace_tb.t27 (…