Repository navigation
t27o: five refusal classes from the roadmap dogfood convert (Closes #10526) - #10593
Merged
Merged
Conversation
#10526) Classes 4 and 5 of #10526. A raw string r"..", r#".."# is written as the ordinary t27 string with the same bytes (backslash, quote, newline and tab take the escapes t27 reads; CR LF is the LF Rust reads; other control bytes and non-ASCII stay refused). A backslash right before a newline inside a string literal is Rust's line continuation: the backslash, the newline and the next line's leading whitespace are joined out of the text. Raw strings are texts in ==, match arms, class inference and the out-buffer form. Tests and negative controls added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…loses #10526) Class 1 of #10526. assert_eq!(e, Ok(v)) is `e.? == v` with e read once into a temp when it calls something and asserted not null first; assert_eq!(e, Err(..)) is `e == null` with a comment that the payload is dropped (Result is ?T); assert_ne! negates each. A Result<(), E> call is a bool, so Ok(()) is `== true` and an Err `== false`. An Ok(()) of a non-call, and a struct payload, stay refused. The converted test was checked against rustc: same verdicts in t27b, and wrong expectations fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Closes #10526) Class 3 of #10526. `f(a, &[])`, `x.f(&[])` and `Type::f(&[])` look the callee up in the file's own fn declarations (every declaration of the name must agree): the parameter the argument lands on is `&[T]`, so the argument is `[0]T{}`, which a `[]const T` parameter takes (checked against t27b and the zig reference with t27c test-report). `let a: [T; 0] = [];` is the typed local `= []`. Where the element type cannot be known locally the refusal stays but names itself: "empty slice with no known element type" (R_EMPTY) instead of "block as a value `]`". Tests and negative controls added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…w rules (Closes #10526) gen/rust/tools/t27o/rust_convert.rs is `t27c gen-rust` of the spec (it also picks up the coverage-report change that the committed copy was missing); the seal is re-saved and `t27c seal --verify` prints all hashes MATCH. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y end its line (Closes #10526) The cited example of class 5 (bootstrap/tests/assert_paren_binary.rs:55) is a format! string; the out-buffer form copies its literal pieces on its own, so they join the `\` newline continuation as put_string does, and the last argument of a multi-line format!( .. ) no longer carries the white space before its `)` into the name lookup. Test added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t! piece rule (Closes #10526) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Review (orchestrator, Opus), before auto-merge:
|
gHashTag
enabled auto-merge (squash)
October 18, 2026 18:25
9 of 12 tasks
This was referenced Oct 18, 2026
Merged
Merged
This was referenced Oct 18, 2026
This was referenced Oct 18, 2026
This was referenced Oct 18, 2026
Closed
Contributor
This was referenced Oct 18, 2026
Closed
Merged
gHashTag
added a commit
that referenced
this pull request
Oct 18, 2026
…eeper Rust, Python, TypeScript, shell (Closes #10599) (#10601) Section 7 of the t27o dogfood document: per language the files, distinct fns and the share inside a stated first subset, with the top first blockers and the roadmap stage each maps to. Zig (coarse) 36,495 fns, 10.4-38.1 % in a first subset, tests as the oracle; TypeScript 2.5 % (26 % async); Python 3.7 %; shell is orchestration. The Rust section gets #10593's measured gain (1,573 -> 1,667 fns, 504 -> 593 tests). Co-authored-by: Claude <claude@anthropic.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Lane C of #10522. Five first-refusal classes of the roadmap dogfood now convert (or, where the type cannot be known, refuse under a name that says why). Only
specs/tools/t27o/rust_convert.t27carries rules;gen/rust/tools/t27o/rust_convert.rsist27c gen-rustof it and the seal is re-saved.What changed, per class
Ok(..)/Err(..)in a test'sassert_eq!/assert_ne!(result_assert). A Result is?T, soassert_eq!(e, Ok(v))isassert(e.? == v), with a call read once intot27o_r<offset>andassert(t != null)first;assert_eq!(e, Err(..))isassert(e == null)under the comment// t27o: Err payload dropped (Result is ?T);assert_ne!negates both (t == null or t.? != v). AResult<(), E>call is a bool in t27o, soOk(())is== trueand an Err== false.assert!(e.is_ok())/is_err()already converted. Stay refused:Ok(())of something that is not a call of this file'sResult<(), E>fn (a bool cannot be told from a?void), and a struct payload (== of structs).for x in &[a, b, c]is the loop over the literal[a, b, c](same typed local, same t27 for-each).&mut [..], unsuffixed integer elements and.iter()on the literal stay refused.&[]as an argument: the callee is looked up among the file's ownfndeclarations (a free fn,Type::f(..)orx.f(..); every declaration of the name must agree), the parameter the argument lands on is&[T], and the argument is[0]T{}. Alsolet a: [T; 0] = [];(15 of the 306 sites) as= []. Where the type cannot be known locally the refusal stays and now says so:empty slice with no known element type(newR_EMPTY) instead ofblock as a value]``.r"..",r#".."#,r##".."##become the ordinary t27 string with the same bytes (backslash, quote, newline, tab take the escapes t27 reads; CR LF is the LF Rust reads; other control bytes and non-ASCII stay refused). Raw strings are texts in==,matcharms, class inference and the out-buffer form.r#ident(raw identifier) stays refused.\+ newline inside a string literal (Rust's line continuation: the backslash, the newline and the next line's whitespace go) is joined, forput_stringand for the literal pieces of an out-bufferformat!. The cited example (bootstrap/tests/assert_paren_binary.rs:55) is aformat!; its last argument followed by a newline before)also needed a trim to convert. Only\right before a newline joins:\<space>,\\+newline and\rstay refused.Before / after
Protocol of
docs/nona-03-manifest/T27O-COMPETITORS-AND-DOGFOOD.md: every tracked.rsfile (not undergen/ortarget/) of the five repos at the commits it names (t27 7496ed2, trios 483dd9ee, trinity 0770abb9, trinity-fpga 20bf4c418, 999-multibots-telegraf 6e5512881), 30 s cap per file, the same 5 t27 files over the cap excluded from both columns. File counts equal the doc (382 / 786 / 23 / 30 / 167). "Before" is the converter of master 0c98c96, "after" this branch; both aret27c gen-rustoutput compiled into a small driver that callsconvert(whattri t27o FILEprints), not a rebuilttri.OkErr&](nowempty slice with no known element type)r#/r"\?(line continuation)#[test]fns convertedThe issue's counts (473 / 612 / 380 / 306 / 152 + 2
r"/ 88) are reproduced within 3. The doc's trios row says 8,230 fns seen; this run counts 8,220 on the same 786 files. What remains: 2Ok(())whose callee is declared in another file; 4for (a, b) in &self.fieldloops; 59&[]whose callee is another module's or a std method or has a generic element (&[Behavior<'_>]), e.g.bootstrap/src/behavior_sva_v2.rs:765still refuses becausebuild_behavior_sva_bind_blockitself does not convert (owned String result, lifetime-generic element).Tests
t27b test specs/tools/t27o/rust_convert.t27: 81 passed, 0 failed (66 before, 15 new).t27c test-report specs/tools/t27o/rust_convert.t27: 81/81,vacuous passes 0 of 81.t27c seal specs/tools/t27o/rust_convert.t27 --verify: all hashes MATCH (rust_std.t27 untouched, its seal verifies too).rustc --edition 2021 --crate-type lib gen/rust/tools/t27o/rust_convert.rscompiles.rustc --test, its converted t27 passes int27b, and with two wrong expectations the converted test fails; a file using&[]arguments,let a: [T; 0] = []and methods passes int27band in the zig reference (t27c test-report).Negative controls
Each class has a test that a near-miss form is still refused with the exact message, and each rule was removed in turn from a copy of the spec; these tests then fail in
t27b:result_asserthook)ok_and_err_comparisons_in_a_test_read_a_result_as_an_optional,negative_control_ok_unit_of_a_local_and_a_struct_payload_stay_refused&before the literal)a_for_over_a_borrowed_array_literal_is_a_for_over_the_literal,negative_control_a_mutable_or_unsuffixed_or_iterated_array_literal_loop_stays_refusedempty_arg)an_empty_slice_argument_takes_its_parameters_element_type,negative_control_an_empty_slice_with_no_known_element_type_is_refused_and_says_so= [])an_empty_slice_argument_takes_its_parameters_element_typeraw_strings_become_ordinary_strings,a_raw_string_is_a_text_in_a_comparison_and_a_match,negative_control_a_raw_identifier_and_an_unterminated_raw_string_stay_refused,a_control_byte_in_a_raw_string_is_refused,a_raw_strings_crlf_is_the_lf_rust_readsis_cont)a_backslash_before_a_newline_joins_the_string,a_continuation_with_crlf_skips_the_carriage_return_tooCR bytes in tests are built with
put(.., B_CR)because the specs are ASCII-only.Notes for the reviewer
gen/rust/tools/t27o/rust_convert.rson master was one spec change behind (65 tests in its header, the old coverage-report order); regenerating it brings that in as well.Errcomparisons are weaker than Rust's (any error passes). Every converted one carries the// t27o: Err payload droppedcomment, as the issue asked.cli/tri/src/main.rs,spice_convert.t27,ledger.t27,rust_std.t27.Part of #10522.
🤖 Generated with Claude Code