Repository navigation
t27o: integer ! is a bitwise ~, the oracle spec uses type_text, the harness drops no_std (Closes #10534) - #10611
Merged
Merged
Conversation
Owner
Author
|
Review (orchestrator, Opus):
|
This was referenced Oct 18, 2026
This was referenced Oct 18, 2026
Closed
Closed
Merged
Contributor
This was referenced Oct 18, 2026
…27o cannot class is refused (Closes #10534) unary wrote every `!` as a boolean NOT, so bootstrap/src/host/bitmask.rs:15 and :27, `value & !m` and `value & !(1u32 << bit)`, became `value & !m` and `value & ((@as(u32, 1) << bit) == false)` -- a different function. The operand's class now decides: expr_class reads it from the source (a declared bool or integer type, a fn's return type, a comparison, a suffixed literal, a bool-valued std method), an integer gets `~`, a bool keeps today's text, and anything else is refused with a reason naming `!` and the unknown type. type_class gains `bool` (C_BOOL) and name_class reads a `let` whose init is a comparison. `~(x)` keeps its parentheses on the Zig, C, Verilog and Rust backends of the shared t27c; a test runs it under t27b and t27c. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… type_text (Closes #10534) The oracle test of bootstrap/src/host/bitmask.rs `FieldDesc::new -> Self` compares the struct's `name: &'static str` with type_text::same, but only a return type spelled `str` set the spec's use line, so tri t27o --check said `type_text` was undeclared (t27b: call to type_text::same undeclared; t27c Zig: use of undeclared identifier). struct_text reads the struct the return type names (Self is the impl's type) and ret_has_str counts a text field as a text. `tri t27o bootstrap/src/host/bitmask.rs --check` now passes 20 of 20. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d forbid (Closes #10534) rings/ring-090-rust/src/lib.rs opens with `#![cfg_attr(not(test), no_std)]`; the harness copied it and plain rustc (no --test) built the harness without std: 415 errors, format!, println!, Vec and String not found. put_item_source now leaves out a crate-level no_std or no_main, bare or carried by a cfg_attr (only what the cfg_attr applies, not its predicate), and also deny and forbid: with std back the lib's `deny(missing_docs)` failed 30 more times on the docs of items the harness leaves out. `tri t27o rings/ring-090-rust/src/lib.rs --oracle` now compiles with rustc and `--check` passes 25 of 25. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… or a method a unit test shares a name with (Closes #10534) Measured on this repository, the first cut of the integer-! rule refused 4 fns it could class: capflags.rs `!self.0` (a newtype over u32) twice, and calls of a method that a `fn name() {}` test repeats. ret_class now ignores a fn with no return type (`!` cannot be applied to `()`), chain_class reads `x.0` through the tuple struct's field type, and head_struct finds the struct of `x` by its declared type or by `let x = Type::new(..)`. A method two types share with different return classes, and a field of a local built by a call this file does not show, stay refused (negative controls). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #10534) t27c test-report folded the asserts of the first cut (constants) at compile time and reported "vacuous passes 1 of 90". The pin now calls two small fns: 4 runtime asserts, vacuous passes 0 of 90, t27b 90 of 90. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gHashTag
force-pushed
the
t27o/check-defects-10534
branch
from
October 18, 2026 20:16
c5e4997 to
cbb551d
Compare
This was referenced Oct 18, 2026
Contributor
PR DashboardGenerated at: 2026-10-18 20:32:17 UTC
Summary
Seal Status
|
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 #10534
Stacked on #10593 (branch
t27o/refusal-classes-10526, on auto-merge): this branch is cut from it and edits the same spec, so it merges after it. Lane F of epic #10522. Boundary kept: onlyspecs/tools/t27o/rust_convert.t27, its gen file and its seal; no hand-written code anywhere.What changed
1. Integer
!is a bitwise~(unary).expr_classreads the operand's class from the source: a declared bool/integer type (type_classnow returnsC_BOOLforbool), a fn's return type (ret_class: all fns of that name must agree; a fn with no->does not count,!cannot be applied to()), a comparison /&&/||, a suffixed literal, a bool-valued std method (std_bool),matches!, a tuple fieldx.0and a field of a let-owned local (head_struct), andname_classlearns aletwhose init is a comparison. Integer ->~, bool -> today's text (!x,(x == false)for a parenthesized operand), anything else -> refused with`!` of an operand whose type t27o cannot tell `<operand>`. Never a guess.~(x)and!(x)on its Zig, C, Verilog and Rust backends (probed with 17 shapes), so~(x)is emitted as is.bitwise_not_keeps_the_parentheses_of_its_operandruns it undert27b testandt27c test-report(4 runtime asserts through two small fns; a first cut on constants was folded by t27c and reportedvacuous passes 1 of 90). Unsuffixed literals (x & !0) are refused:~0isunsupported construct ExprUnary(~)on t27b andBLOCKED ... cannot represent -1on t27c.an_integer_not_is_a_bitwise_not_and_a_bool_not_stays_a_boolean_one(bitmask.rsinsert/clear_bitgive~mand~(@as(u32, 1) << bit); au8and aboolnamed alike in one file each keep their own),negative_control_a_bang_on_an_operand_t27o_cannot_class_is_refused_and_says_so(x & !0, a call of another file's fn, aforbinding), the tuple/let-owned/method test and its negative control (a method two types share with two return classes, a field of a local built by an unseen call).!again -> the first test fails; unknown falls to bool -> the negative control fails; unit fns counted inret_class, tuple fields dropped,ret_classdisagreement ignored -> each its own test fails.2.
use tri::t27b::type_text;(ret_has_str/ newstruct_text). The appended oracle test ofFieldDesc::new -> Selfcompares the struct'sname: &'static strwithtype_text::same, but only a return type spelledstrset the use line. A return type that names a struct of this file (orSelf) with a text field now counts. Tests:a_struct_result_with_a_text_field_makes_the_spec_use_type_text; negative control..._without_a_text_field_adds_no_use(a number field, and a text field no fn returns). Removing thestruct_textclause fails the first; counting au8field as text fails the second andtuple_structs_have_fields_0_and_1.3. The harness drops
#![no_std]/#, bare or applied by acfg_attr(the predicate is not read:cfg_attr(not(no_std), ..)stays). It also drops crate-leveldeny/forbid: with std back, ring-090's#![deny(missing_docs)]failed 30 more times on docs of items the harness leaves out, so the issue's own acceptance command needed it. Tests:the_oracle_harness_drops_a_crate_level_no_std_no_main_deny_and_forbid; negative control..._an_attribute_that_only_names_a_dropped_word_stays_in_the_harness(no_stdas a predicate, in a string,warn,allow). Rule removed -> first test fails; predicate scanned too -> negative control fails;denynot listed -> first test fails.Verified
t27b test specs/tools/t27o/rust_convert.t27: 90 passed, 0 failed (was 81 on the base).t27c test-report: 90 of 90,vacuous passes 0 of 90.t27c seal ... --save, then--verify: all hashes MATCH.gen/rust/tools/t27o/rust_convert.rsist27c gen-rustof the spec;tribuilt from this tree.tri t27o bootstrap/src/host/bitmask.rs --check --name chk_bitmask: 20 of 20 (was BLOCKED ontype_text),vacuous passes 0 of 20; with a hand vector appended,clear_bit(0xFF, 0) == 0xFEandinsert(0xFF, 3, 0, 0) == 0xF0hold under t27b and t27c.grep -c '== false'on the converted file is 0;~is on 2 lines (~mmatches one of them).tri t27o rings/ring-090-rust/src/lib.rs --oracle | rustc --edition 2021compiles (was 415 errors); its--checkpasses 25 of 25.Measured on this repository
377
.rsfiles (tracked, not undergen/, 300000 bytes or less; 5 larger skipped), each run through the newtri, the stacked base'stri(this branch minus this PR) and the shared mastertri, 30 s cap each, no timeouts.!became~in 3 places in 2 files (bitmask.rs twice, capflags.rsrequired._0 & !self._0); all areu32. 643 fns convert, base 644: the one loss is ring-097new_proof_trace_creates_empty(assert!(!t.verified)on a local built by a free fn the head resolver does not follow). 17 more fns now report the!reason first but were already refused for another reason (the report lines are unchanged).!/~and are code, the only changes are the three~above and one newly converted boolassert(!(r.reading.len == 0))(census.rs, same meaning as the Rust). No converted fn changed meaning otherwise.Still refused, and why
A
!whose operand is an unsuffixed literal, a call of a fn this file does not show (read_is_complete(30, 30),lab::ssh_should_retry(..)), an index (f[1],ms[1].empty_fns), a field of a local built by a call (stats.has_pending,result.passed,v.ok), or a method two types share with different return classes: t27o cannot tell bool from integer there, and a wrong guess is a different function.Not touched:
cli/tri/src/main.rs,spice_convert.t27,ledger.t27.🤖 Generated with Claude Code