Repository navigation
t27b: the comptime_float arithmetic of lower_float.rs moves to specs/tri/t27b/comptime_float.t27 (Closes #8244) - #8247
Merged
Merged
Conversation
…tri/t27b/comptime_float.t27 (Closes #8244) Big, round_bits and Q (Zig's comptime_float as an IEEE binary128 value: decimal literals, + - * /, order, and rounding to f64 and f32) are now t27, generated by t27c gen-rust into gen/rust/tri/t27b/comptime_float.rs and mounted with #[path]. lower_float.rs keeps Q as a one-field wrapper: -384 hand-written lines under cli/t27b/. A throwaway differential test on the t27c lab found 0 differences between the hand-written Q and the generated one. See #6198. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
October 9, 2026 16:02
Contributor
gHashTag
added a commit
that referenced
this pull request
Oct 9, 2026
…het is green again (Closes #8269) (#8277) 0fca4bd (#8247) declared `pub const Text = struct` in specs/tri/t27b/comptime_float.t27 while specs/test_framework/core.t27 already declares `struct Text`, and `tri types ratchet` has failed on master since ("ledger 85 name(s), observed 86, + Text NEW conflict"). The type is renamed LiteralText (8 lines), gen/rust/tri/t27b/comptime_float.rs is regenerated with t27c gen-rust, and the seal re-saved with master's t27c (4 of 4 tests pass). Checked on the t27c lab at 0f66f5d: tri types ratchet "ledger 85 name(s), observed 85, RATCHET: CLEAN"; cargo check -p t27b finishes. No hand-written line changes. 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.
Closes #8244. A port slice of #6198 (t27b written in t27); see #6063. It pays back hand-written lines under
cli/t27b/, as the owner's rule asks (see #8227).What
The comptime_float arithmetic in
cli/t27b/src/lower_float.rsmoves intospecs/tri/t27b/comptime_float.t27. That isBig,round_bits,Qand their two unit tests: Zig's comptime_float as an IEEE binary128 value, with its decimal literals,+ - * /, order, and rounding to f64 and f32.t27c gen-rustgeneratesgen/rust/tri/t27b/comptime_float.rs, whichlower_float.rsmounts with#[path], aseval.rsmountseval_arith.rs.lower_float.rskeepsQas a one-field wrapper around the generatedQ128, with the same methods. No caller changes.cli/t27b/: +24, -408, net -384.lower_float.rsgoes from 578 lines to 194.Where a fixed size changes nothing
The Rust
Bigwas aVec<u64>with no bound. The t27Bigis 640 32-bit limbs (20480 bits), with a count of the limbs in use. Each place where that matters is handled so the result stays the same correctly rounded value:str::parse::<f64>. The port decides it exactly against 2^1024 - 2^970, the least value an f64 parse takes to infinity.TOO_LONG). That takes about 750 digits next to the 10^-5000 cut-off, or 2048 characters anywhere. No spec has one.Evidence that nothing changed
Qagainst the generated one, comparing every result, internal value and refusal message: 0 differences. It covered:+ - * /, whose results fed back into the pool (49988 values, far outside the f64 range included), withcmp,to_f64,to_f32andexact_f64of both operands;from_int, plus its edges;1.,1.e5, exponents past i64,2e308, both sides of 2^1024 - 2^970,1e-4999,1e-5000,5e-324and its halfway point).+ - * /,cmpandto_f32; literals rounding once; and the edges.t27c test-report: 4/4, 0 vacuous.--check(aarch64, qemu): 4/4, 1688 runtime asserts.cargo test --release -p t27bon the t27c lab: 137 passed on x86_64 and 157 on aarch64, 0 failed. The build has no warning from the generated module; the mount allowsdead_code,unused_parensandunexpected_cfgs.t27c seal --save, then--verify: all hashes MATCH.dupe_scan.py: ok, and--likefinds nothing in the new spec written elsewhere.check_assertionless_spec_tests.py: ok.check_seal_coverage.py: OK.gen/c/policy/own_language.c:check_budget()ongit diff --numstat --no-renames: exit 0;check_all()with master'sforeign-exceptions.txt: exit 0.Signed lane receipts (#7686)
Requested from the t27b lab for this head and for master ca9866b. The compare is added here when both are in. Expected: every existing lane neutral, and the new spec's lane only-head.
Ledger
One row is added:
specs/tri/t27b/comptime_float.t27passes. No other row moves.Lines (
git diff --numstat --no-renames origin/master...HEAD)cli/t27b/src/lower_float.rsspecs/tri/t27b/comptime_float.t27gen/rust/tri/t27b/comptime_float.rst27c gen-rust, not hand-edited.trinity/seals/t27b_T27bComptimeFloat.jsondocs/reports/t27b_expectations.jsonAGENTS.mdwc -l, in AGENTS.md:cli/t27b/src/*.rsgoes from 15264 to 14880 on master ca9866b;cli/t27b/tests/*.rsstays at 8274.🤖 Generated with Claude Code