Repository navigation
codegen: a birth stores a proven Number into a raw f64 lane with no number test (P3 B4b) - #14668
Merged
Merged
Conversation
added 4 commits
November 13, 2026 20:51
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
What
A Number has one encoding, the plain double (representation RFC §10 P3). The births did not use that yet: a
constructor prologue, a compact birth and a birth image (
new C(..)of a store-only constructor, every closedobject literal) tested each value bound for an
F64lane "plain finite number" and sent a miss to the sharedbirth and the ordinary constructor (
PrologueStore::requires_number_check: the lane alone decided). The birthand fill lanes filed this as "goes when a proven Number is storable raw (P3 B4b)".
Now a raw-
f64lane store whose argument the facts or its structure prove a Number takes the lane as it is:PrologueStore::proven_numberaskstype_analysis::expr_produces_canonical_raw_f64, the predicate a field store(
property_set.rs) already stores raw on: a facts-Number local or field read, arithmetic, aMath.*result, aclosed Number call, a literal. Non-finite Numbers and
-0are born raw too, as they are stored raw by a fieldstore. An argument that is no proven Number keeps its test.
Chess: the
Undoliteral inmaketestedcaptureSquare,ep,halfmoveandfullmoveon every move.Fact, witness, switch
PERRY_VERIFY_FACTS=1): each such value is tested "is a plain double" before the allocation(
ctor_prologue_stores::witness_proven_number,Fact::CanonicalNumber, site "canonical number birth lane"); amiss exits 86.
number-birth-negative: with thecanonnumruntime (Math.roundreturns an INT32-tagged word) thebirth's witness reports it; the correct arm prints what node prints.
PERRY_FACTS_NUMBER_BIRTHS=0keeps every test (= main). Registered incompile_env(sorted position) with thetest
number_births_switch_is_a_cache_input.PERRY_SITE_STATS=1names every image as before. No per-site IR diff was taken; the on / off arms share one build and one facts dump.Chess (qb10, ONE build d9b0433 = this branch with main dd083f3 merged in; off arm
PERRY_FACTS_NUMBER_BIRTHS=0,instructions:u, each arm x2)Second runs: search 11 848.140 / 11 764.425, perft 258.929 / 256.316, evaluate 1 191.813 / 1 191.814, legal
354.791 / 352.166. The off arm's binary is byte-identical to main dd083f3's (sha afd9f085de252fae) and its
counts equal main's measured in the same hour (11 848.132 / 258.929 / 1 191.813 / 354.792). Binary size unchanged
(9 320 576 B); facts dump identical in both arms. Chess check mode: all four modes rc 0, 0 misses. evaluate does not
move.
Gates run
All on d9b0433 (qb10):
tests/parity/language/number/test_p3_b4b_number_births.ts: = node in default, DCE off, check mode,check mode with DCE off, and with
PERRY_FACTS_NUMBER_BIRTHS=0.the runtime: a JS Number has one encoding; delete the INT32 Number consumers (P3 B4b) #14658 branch on the same base (apart from each branch's own fixture, both matching).
canonnumruntime: 205 executable controls passed;number-birth-negative0 (correct) / 86 (false).cargo test -p perry number_births_switch_is_a_cache_input: passed. Maccargo check -p perry-codegen -p perry --lib --tests: clean.scripts/check_file_size.sh: OK.Not run
Full suites, parity IR census, corpus check mode, tssrc, Supabase, skin size, GC schedule stress (the birth window
is unchanged: the same stores, the witness sits before the allocation).