Repository navigation
Support checked Whale numeric operations and standardize Rust formatting - #860
Merged
Merged
Conversation
Signed-off-by: LunaStev <luna@lunastev.org>
Signed-off-by: LunaStev <luna@lunastev.org>
This was referenced Oct 7, 2026
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.
Summary
The Whale adapter previously rejected shifts and float-to-integer conversions. This change lowers them with Wave's existing HIR rules: shift counts are checked before narrowing, and invalid floating conversions trap before the cast. Invalid constants retain frontend diagnostics, while short-circuited operands remain unevaluated.
020d2a4cf312123518ec75cc865eea1d257c5689and round-trip generated format-3 IR through its reader and verifier.The PR also retains the existing README logo/header presentation change in fd07427.
Motivation
Advance the opt-in Whale backend under #93 using the established Wave semantics. The upstream verifier and text reader now allow the adapter to validate serialized IR as well as its in-memory representation.
Target and compatibility impact
Whale remains opt-in through
--whale, limited to Linux amd64, O0, and IR output. LLVM remains the default. This does not add native Whale execution, wider runtime integer types, or new language semantics.Untyped wide shift literals retain their original value until the range check; supporting those literals does not enable runtime integers wider than 128 bits. Tests inspect the emitted guard behavior and IR round trips, not native execution parity. This does not complete #773.
Validation
Passed locally with Rust 1.89 and
LLVM_SYS_211_PREFIX=/usr/lib64/llvm21where needed:cargo +1.89 test --locked --jobs 2 -p whale— 6 tests, including integer-width matrices, float boundaries, NaN/infinities, ordered conversions, and IR round trips.cargo +1.89 test --locked --jobs 2 --test whale_backend— 11 tests.cargo +1.89 test --locked --jobs 2 --no-default-features --features llvm-target-wasm --test whale_backend— 11 tests, validating Whale independence from native LLVM targets.cargo +1.89 clippy --locked --jobs 2 --workspace --all-targets -- -D warnings.RUSTUP_TOOLCHAIN=1.89 python3 tools/format-rust.py --check.git diff --check.Cross-platform validation is left to PR CI.
Checklist
Signed-off-byline.std/.Issues
Closes #862, closes #863, closes #864, closes #865, closes #866, closes #867.
Related to #93 and #773.