Repository navigation
String == is the emitter's job, not the corpus's: -21 errors, +2 valid, and a reclassification #5162
Description
Re-filed from #2572. An attempt claimed that issue on 2026-09-24 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.
#2545 filed cannot compare strings with == as corpus-side — meaning the spec was wrong and no emitter change could help. Reading the sites shows that classification was the error.
cloud/railway_deploy.t27 env_vars[0].key == "PHI"
fpga/assembler.t27 if (cfg.name == "")
fpga/axi4.t27 if (cfg.name == "")
Every one of the 21 compares against a string literal. The intent is unambiguous — "is this string equal to that one" — so t27's == means value equality on strings, and rendering it is the emitter's job. std.mem.eql(u8, a, b) is the Zig spelling.
Measured
valid: 170 -> 172 (+2, 0 regressions)
total ast-check errors: 615 -> 594 (-21)
spec parse gate: 154 events / 0 blind, ratchet holds
All 21 gone. Control: numeric comparisons are untouched — instr.imm == 0 and alignment == 0 still render as ==.
Narrower than the real rule, deliberately
Detection is by a string-literal operand, not by type inference, which this compiler does not do. A comparison between two string variables is not caught and stays broken.
That is narrow in the safe direction: a literal operand proves the intent, while inferring "this identifier holds a string" would be the same class of guess as [hidden_size] in #2405. If those cases exist they will surface as their own errors rather than being silently mis-rendered.
The re-census that prompted this
Blockers moved three times since #2545, so the corpus-side counts were re-measured rather than carried forward:
| class | #2545 | now |
|---|---|---|
| pointless discard | 86 | 0 — removed in #2564, #2571 |
| local never mutated | 44 | 44 |
== on strings |
12 | 21 |
| unused local | 10 | 10 |
| parameter shadows | 9 | 9 |
| unreachable | 4 | 4 |
== on strings grew from 12 to 21 as blockers cleared, exactly as #2569 predicted a census would. Had I worked from the old figure I would have fixed 12 and believed it complete.
Corpus-side total: 166 -> 90 -> 69 after this reclassification.
Boundary
specs/cloud/railway_deploy.t27specs/fpga/assembler.t27specs/fpga/axi4.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
gHashTag commentedon Oct 1, 2026
Live repro from a spec under review (#5375), not from the corpus sweep:
What this costs:
test-reportcannot produce a single per-test result for any spec whose tests compare strings, so a spec that is otherwise sound reports as BLOCKED rather than PASS/FAIL. The host side (rendersrc/spec/ball-board.test.ts) checks the same laws against the generated table today; the.t27test blocks themselves go unexecuted until==on strings renders asstd.mem.eql(u8, a, b).🤖 Generated with Claude Code
Reseal the four seals the string == fix made stale