Repository navigation
t27o: no invalid output -- the 55 specs t27c could not compile are valid or refused (Closes #10905) - #10976
Merged
Conversation
This was referenced Oct 19, 2026
9 of 12 tasks
…ue is Name{} -- two spellings t27c rejects (Closes #10905)
Class 5 of #10905. path() and pattern() wrote Owner::GF16 as Owner_GF16
whenever the member looked like a const (upper case, digits, _), so the
variants F32, GF16, X402, H2, FFN of seven enums named a declaration nobody
makes. enum_has asks the file: a member that is a variant of the enum Owner
(Self is the impl's type) is Owner.VARIANT; an associated const stays
Owner_CONST. A unit struct value was written as the bare type name, which
t27c rejects where a value stands ("expected type 'Gw', found 'type'");
unit_struct finds `struct Name;` (the index or the walk, Self is the impl's
type) and primary writes Name{}.
Tests: unit_hit / unit_struct / enum_has directly (index on and off, Self
with and without an impl, an empty enum, a braced and a tuple struct as
negative controls), and one body test whose output compiled under t27c
test-report and ran under t27b test; an associated const stays Gw_LIMIT.
t27b 292 / 292, seal re-saved and verified, cargo check -p tri clean.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ig's _ = e (Closes #10905) Class 3 of #10905. `let _ = Type::new();` in a Rust test became `_ = e;` in the t27 test block, which t27c writes as `const _ = e;` in Zig, a declaration Zig rejects ("'_' used as an identifier without @\"_\" syntax"); eight BR_OUTPUT specs of the trios rings were blocked on it. t27c's own spelling `const _ = e;` is the discard in both places (W608), so a test block now writes that. A fn body keeps `_ = e;`: its output is byte for byte what it was. The state vector gains INTEST (slot 53, 1 while the body of a #[test] fn is read); STATE, IXHIT .. IXTOP and NAMES move up by one slot, every user of them names the constants. Test: a Rust fn and a #[test] fn side by side, let_stmt with the flag up and down, a used binding as the negative control. t27b 293 / 293, seal re-saved and verified, the output of the new test compiled under t27c test-report and ran under t27b test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…st u32 a 64-bit tag (Closes #10905) Class 2 of #10905. enum_item wrote every unit enum as enum(u32), so `Neg = -1` was Zig's "type 'u32' cannot represent integer value '-1'" and nine specs (the Trit enums of trinity, trinity-fpga, trios-ternary, trios-tri, and rings 092, 093, 097) were blocked on it. enum_tag reads the discriminants -- the plain integer literals (decimal, 0x, 0o, 0b, _, a suffix) and the variants after them, one more than the one before; an expression leaves the ones after it unknown -- and picks the tag: i32 when one is negative, i64 when a value is also outside i32, u64 when one is past u32 and none is negative, u32 otherwise. t27c and t27b both take enum(i32), enum(i64) and enum(u64) (probed). An enum with no explicit negative or wide value is written exactly as before. Tests: enum_tag over sixteen bodies (an attribute, hex, an expression, an unclosed or missing brace, the i32 and u32 edges, an implicit successor crossing u32::MAX), and one body whose three enums read i32, u64, u32. t27b 295 / 295, seal re-saved and verified. What the nine specs hit next (an enum cast to an integer, arithmetic on enum values) is the last commit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…im is the converted receiver (Closes #10905) Class 4 of #10905, the two parse errors the list showed. `c >>= 1` and `e <<= 1` reached the output as written; t27 has no compound shift ("Unexpected token in expression: Equals", t27c and t27b alike). Five specs (host/dma, host/weight_loader, rings 095, 098, 099) held it in a pow or a CRC loop. expr_stmt now writes `c = c >> 1`, the place copied from what was written (put_again) and the amount wrapped unless it is an atom (`c = c << (k + 1)`). The place is written twice, so one that calls something is refused with the new reason R_SHIFTCALL, never called twice. `path[..i]` in a parse-error: the std table's trim forms write the receiver three times, and the second and third copies came from the Rust text, not from the output -- `path[..i].trim()` kept `..i` in two of them (use_resolve.t27, brace_module). expand now copies the receiver as it was written in the output (the same copy `^` makes), so the receiver reads `path[0 .. i]` in all three. The two tests that pinned `a <<= 2` as the output (stmt, expr_stmt) now pin `a = a << 2`. Tests: a body with both shifts, a place that calls (refused, stub kept), expr_stmt directly (self.x, a sum amount, += and ^= unchanged as controls), put_again incl. a buffer too small, and the trim of `path[..i]` beside a plain `s.trim()`. t27b 298 / 298, seal re-saved and verified; the generated shifts and trims compiled under t27c test-report and ran under t27b test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…Closes #10905) Class 1 of #10905, 15 specs that named something t27c cannot find. The causes, each with the spec it came from: - `Type::f(..)` wrote `Type_f(..)` whether or not an impl declared f: `Language::default()` of a #[derive(Default)] (multibots user.rs) named a `Language_default` no one writes. assoc_declared asks the file; a call nothing answers is refused as undeclared. - A last match arm is the else, so `Some(want) => want == ..` bound nothing and `want` was undeclared (prcheck.rs). payload_binder binds `Some(x)` / `Ok(x)` to the scrutinee's value (`const want : T = e.?;`, T from the Option's declared type, so t27c knows it is a text), lets a payload nobody reads go, and refuses any other payload pattern. - `pub extern "C" fn gf16_to_f32` was refused without its name, so the tests of ffi/src/lib.rs that call it kept the call; an `unsafe fn` registered the name `fn`, which refused every fn after it with "uses refused `fn`". qualified_fn finds the name behind unsafe / extern / async / const; the fns of an `extern "C" { .. }` block are recorded too. - A call into a #[path] gen module t27c cannot splice beside type_text: operator_text has a `use` of its own (compiler.rs, #10843), sha256 and its siblings declare a `same` beside type_text's (main.rs, #10556). The refusal now reads the module's path, not the alias it was mounted under, from a list (SPLICE_CLASH). A gen module's const in a match pattern (`t27a::ASM_NO_MNEMONIC =>`) was written `t27a_ASM_NO_MNEMONIC`; pattern uses the same mod_member as an expression. - t27c writes the Zig prelude (the std import, the assert helper) only for a spec with a test block, so an assert in a fn of a testless spec left `__t27_assert_fail` undeclared (trinity_loss tests/loss.rs). A pass that found no test now refuses such an assert (R_NOPRELUDE), through two flags kept in the name table. Tests: every new fn directly (assoc_declared with and without the index, payload_binder over nine arms, qualified_fn / foreign_block / record_foreign, mod_member, splice_clash, need_prelude, bind_type) and a body test per cause whose output compiled under t27c test-report; the older tests that used operator_text as a stand-in module now use a module that splices, and the known-defect pin of #10843 is flipped into its fix. t27b 312 / 312, coverage 374 of 374, seals re-saved and verified. At this commit 25 of the 51 specs compile (user, main, compiler, prcheck, ffi lib, loss among them); SR_ALG_00 and CR_CHAT_06 need the next commit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…enum, struct, array and text values, borrows, types -- and the arrays and bool methods it reads wrongly are typed (Closes #10905) Class 6 of #10905, the rest of the 55: 26 specs, each blocked by a Rust construct whose t27 spelling t27c rejects. Refused (new reason R_OPERAND, operand_kind says what an operand is): - `a < b`, `a == b` on structs (version.rs SemVer), `==` on arrays (SR_ALG_03, preregistration_seed_lock_final, trios-phd main: assert_eq!(CONST, [..])), `>` on texts (issues.rs open_at), arithmetic on enum values (`Trit::Pos * Trit::Neg`), `-Trit::Pos`, `x as i8` of an enum (rings 092 .. 098, trit.rs x4): t27c has no operator or cast for them. Two enums ordered or compared (`Health.Critical < Health.Healthy`) compile and run in t27c and stay. - `*tag` of a `&[u8; 4]` parameter (firmware.rs) and `&self.session` of an array field (CR_CHAT_04): the parameter is written a slice, the field is an array, and a slice of the fn's own copy of self dangles. - `[]const ?f64` (`&[Option<f64>]`, fpga.rs), which t27c prints as a broken parameter list; a struct or enum named like a type t27c renames in its Zig backend (`struct GF16(u16)` is u16 there: golden-float lib.rs). - two texts or byte slices compared with `==` and an assert in a fn, in a spec with no test block: R_NOPRELUDE, as the previous commit does for the assert (SR_ALG_00, CR_CHAT_06, `std` undeclared). Written: - `let cmds = [Cmd::Nop, ..]; for c in cmds`, `let mut scores = [0.0f64; N]; scores[0] = 1.0`, an array borrowed (`&input`) or indexed by a run-time value is a typed array (protocol.rs, red.rs, ring_099, ring_092, fpga.rs); an element type no one gives, for an array that is written, is refused. vec_first_type reads a const's declared type for `[PVT_TEMP_MIN_C, 20i64]`. - `const NAMES: &[&str] = &[..]` is the array `[N][]const u8` (t27c has no value for a slice const: bitnet_bundle.rs), unless the file hands the name whole to a call. - `let mut r = 1.0;` is `var r : f64` when the file never says f32, refused when it does (pow_u64 of rings 095, 098, 099). - `x.validate().is_ok()` of a method that returns Result<(), E> is a bool (mup.rs); `.unwrap()` / `.expect()` of one is refused (ema.rs). enum_open finds an enum through the declaration index (find_enum walked the file once per operator: compiler.rs took 56 s of CPU, now 7 s as before). Tests: every new fn directly (type_kind, operand_kind over 30 operands, operands_ok, for_var_kind, let_array, slice_const, ..) and a body test per construct whose output compiled under t27c test-report; the reasons table test now carries R_OPERAND, R_TYPENAME and R_FLOATLIT. t27b 332 / 332, coverage 395 of 395, seals re-saved and verified. With this commit all 51 Rust specs of the 55 compile under t27c (42 also pass t27b; 9 meet t27b's own gaps: a struct or array const, @max, a repeat count that is a sum, an f64 cast, a u32/u64 mix, a stub reached by name). The 180 of 492 corpus outputs that change all stay valid: no t27c or t27b pass became a failure. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
gHashTag
force-pushed
the
t27o/valid-output-10905
branch
from
October 19, 2026 10:18
57e0a0e to
8c6cb0b
Compare
gHashTag
marked this pull request as ready for review
October 19, 2026 10:18
gHashTag
enabled auto-merge (squash)
October 19, 2026 10:18
Owner
Author
|
Review (orchestrator) and rebase:
|
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10905. Lane TO1 of #10879 / #10522.
Stacked on #10883 (
t27o/convert-coverage-10825): the branch starts at its head, so until #10883 merges this PR's diff also shows its commits. The six commits of this lane are the last six (listed below).What was wrong
Step 1 of #10879 converted every tracked
.rsof five repositories and judged the outputs under t27b and the reference t27c. 55 specs did not compile undert27c test-reporteither: the converter wrote text that is not valid t27. A converter must refuse what it cannot express, never emit an invalid spec.Result
t27c test-reportt27b testThe 9 t27b gaps are t27b's, not output defects: a struct or array const that is not a compile-time value (3),
@maxof a u32 and a scalar, a repeat count that is a sum, a cast of an f64, a u32/u64 mix of an untypedvar n = 0, a stub reached by name (crc32), an array literal with no result type (fpga.rs). All nine pass t27c.By class (one commit each; the last two cover several causes)
Owner_VARIANT, unit struct value written as a typeOwner.VARIANT,Name{}; an associated const staysOwner_CONST_as an identifierconst _ = e;(t27c writes a bare_ = e;there asconst _ = e;), a fn keeps_ = e;byte for byte; state vector gains INTESTenum(u32)c >>= 1isc = c >> 1(a place that calls is refused); the 2nd/3rd receiver of a trim form is the converted receiver (path[..i]kept..i)Type::f()no impl declares (Language::default()), an assert in a testless spec (R_NOPRELUDE), calls into modules t27c cannot splice beside type_text (list SPLICE_CLASH, read by path: fixes #10843); fixed: a last-armSome(x)binds x (typed),extern "C" fn/unsafe fnare refused under their own name (anunsafe fnused to register the namefnand refuse everything after it), a gen module's const in a match pattern==and<on structs,==on arrays,>on texts,*rof a&[T;N],&self.arr_field;[]const ?T; a struct namedGF16(t27c maps it to u16); fixed: typed array locals that are looped, written, borrowed or indexed, a&[E]const set from a list is[N]E,var r = 1.0;isf64unless the file says f32,x.validate().is_ok()of aResult<(), E>method is a boolDoes valid output stay valid
The 492 Rust files of the corpus that convert (
tbm/rust_corpus_list.json) were converted with the base converter and with this branch's and the outputs compared: 312 identical, 180 differ. Each differing pair was judged under t27c and t27b: 76 pass both before and after (text changes only:Owner.VARIANT,Name{},const _, typed arrays), 45 + 42 + 9 + 1 improve (a t27b gap or a BLOCKED becomes a pass), 7 remain as they were, and no t27c pass and no t27b pass became a failure.Cost, stated plainly: converted fns over those 492 files go 1,890 -> 1,791 and converted tests 668 -> 614. 36 files convert fewer; 8 of them were valid under t27c before. They lost a fn or a test that used an enum cast, an enum or array comparison, an array field borrow, or the
GF16struct; most of those fns were never reached by a test, so t27c (which analyzes lazily) had let them through while t27b (eager) already refused the spec. Two had passed t27b too:bindings/javascript/src/lib.rs(16 -> 12 fns, theGF16struct and its users) andtrios-hdc/src/phi_quantization.rs(2 -> 1).The 4 Zig specs of the 55 (not touched)
zig_convert.t27is held by the Zig step-2 lane. The four are two sources twice: trinitysrc/phi-engine/tvc/tvc_phi_integration(expected float type, found 'usize') andsrc/sacred/special(value with comptime-only type 'comptime_float' depends on runtime control flow), each also undertrios/crates/trios-sacred/src/.Verification
t27b test specs/tools/t27o/rust_convert.t27: 332 / 332 (was 290);t27c coverage: 395 of 395 fns named by a test;t27c test-report: 332 pass, 0 fail, vacuous passes 0 of 332.--verifyMATCH.gen/rust/tools/t27o/rust_convert.rsregenerated witht27c gen-rust(5 s, reproducible).python3 -I tools/dupe_scan.py: ok (no new duplicate body).check_devhome_paths.pyfails onspecs/tri/worktrees/reap.t27, which is on master and not in this diff.t27c test-reportand run undert27b test, with a negative control in the spec's own tests (a related construct that must stay as it was or be refused).Traps met
sttakeimpl AsRef<[usize]>, so a caller that usesstagain does not compile; pass the slots (ilo, ihi,flo) instead. Astrarray element is&strto gen-rust; copy it to a localstrfirst.==in a testless spec is undeclared. Handled with two flags in the name table, not a state slot, because the passes clear the state.find_enumwalks the file; calling it per operator made compiler.rs take 56 s of CPU.enum_opengoes through the declaration index.name:before a use, which a struct literal'stag: *tagis: parameters are read from the parameter list instead.let_stmtfor an unused_xis a discard; in a test block it isconst _.🤖 Generated with Claude Code