Repository navigation
Description
Re-filed from #8175. An attempt claimed that issue on 2026-10-09 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.
Refs #6063
Boundary
- In scope: t27b lowering of a local declared with an explicit array type whose elements are all bare numeric literals, for example
specs/numeric/formats.t27:628,const values = [3]f32{ -1.0, 0.0, 1.0 };. t27b blocks it asExprArrayLiteral("array literal with no result type"). The plan lives inspecs/tri/t27b/tuple_local_plan.t27(t27b: an untyped list local that the code indexes is a Zig tuple: constant indices, and run-time ones only at compile time #8050 / t27b: an untyped list local that the code indexes lowers as a tuple, from a t27 plan (Closes #8050) #8055) and is extended there, gen-rust'd. - Out of scope:
std.math.infin the same file (t27b: std.math.inf, std.math.log with base e, std.math.log1p and an f64 @round, from libm_plan.t27 (Closes #7923) #7925); any array literal whose elements are not literals.
User Scenarios
- An author writes a typed list of float constants inside an invariant and loops over it. The reference prints it as
.{ -1.0, 0.0, 1.0 }, a tuple of comptime_float. t27b should either run it with the same result or refuse it with a named reason, and never guess.
Requirements
- The reference drops the declared element type, so t27b may lower the local as
[N]Tonly when every element literal is exactly representable inT. Then reading an element asTand reading it as comptime_float give the same value. Any element that is not exactly representable stays refused with its own reason. - t27b: an untyped list local that the code indexes lowers as a tuple, from a t27 plan (Closes #8050) #8055's plan currently answers NOT_MINE for bare comptime_int / comptime_float elements. This issue changes that answer only for the exactly-representable case.
- A conformance spec under
specs/tri/t27b/conformance/covers the representable case (-1.0, 0.0, 1.0, 0.5) and a refused non-representable case (0.1in f16 or f32). It passest27c test-report, and t27b passes it with runtime asserts.
Success Criteria
t27c test-reporton the new conformance spec is all pass with 0 vacuous; t27btest --checkgives the same count with runtime asserts > 0.- Assert-flip mutants of the new spec are all killed.
- The lab receipt compare against master is IMPROVED_ONLY, EQUIVALENT or NEUTRAL, with 0 mismatch.
- formats.t27's
ExprArrayLiteralrow is gone from the ledger (the file may still block on t27b: std.math.inf, std.math.log with base e, std.math.log1p and an f64 @round, from libm_plan.t27 (Closes #7923) #7925).
Requirements
FR-001: t27b MUST lower a typed list local declared with an explicit array type whose elements are all bare numeric literals as [N]T only when every element literal is exactly representable in T; reading an element as T and as comptime_float MUST give the same value.
FR-002: Any element that is not exactly representable in the declared type T MUST be refused with its own named reason.
FR-003: The plan in specs/tri/t27b/tuple_local_plan.t27 MUST answer the exactly-representable case for bare comptime_int / comptime_float elements instead of NOT_MINE.
FR-004: A conformance spec under specs/tri/t27b/conformance/ MUST cover the representable case (-1.0, 0.0, 1.0, 0.5) and a refused non-representable case (0.1 in f16 or f32); it MUST pass t27c test-report, and t27b MUST pass it with runtime asserts.
Success Criteria
t27c test-reporton the new conformance spec exits 0 with all tests passing and 0 vacuous;t27b test --checkon the same spec exits 0 with the same test count and runtime asserts > 0.- Assert-flip mutants of the new conformance spec are all killed (exit 0 on mutation run).
- Lab receipt compare against master yields IMPROVED_ONLY, EQUIVALENT, or NEUTRAL with 0 mismatch.
- The
ExprArrayLiteralrow forspecs/numeric/formats.t27is absent from the ledger.
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