feat(t27b): compile integer casts natively, checked like @intCast - #6065
Merged
Merged
Conversation
`x as T` between integer types, and from bool, lowers to native AArch64. A lossless cast widens; bool becomes 0 or 1; an unsigned narrowing truncates like @truncate; every other narrowing is checked and traps at a new site kind (brk #7). Wrap mode truncates every narrowing. Casts to or from a float and casts to bool stay rejected. Corpus: 36 -> 54 passing files (109 tests), 0 failing, 0 JIT/interpreter mismatches. The differential generator emits casts and bool widening, and casts_at_edge_values runs every integer cast at its edge values. Refs #5977 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 4, 2026
Merged
Merged
6 tasks
This was referenced Oct 4, 2026
Merged
The updated blockers branch carries master's memory lane (Slot, Data, Load, Offset, Bounds, Seq; Val::P / Val::M; Program data, internal_abi, unchecked). Both sides kept: ExprKind::Cast and TrapKind::Cast = 7 next to TrapKind::Bounds = 16 and the memory expressions in ir, eval and codegen; lower's ExprCast arm and cast() next to the struct arms and unknown_name, with cast() rejecting a pointer or struct operand as ExprCast. differential: the seq/chain thresholds rebalanced around the cast lane (seq < 94, chain < 96), traps indexed by TrapKind, the cast test's Program gets the new fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
This was referenced Oct 4, 2026
Brings the branch up to master a9650c0; no files under cli/t27b change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Merged origin/master (a9650c0) into the branch; tip d082cbc (on top of afa41bf). cli/t27b content equals the tree tested below.
|
Contributor
PR DashboardGenerated at: 2026-10-04 15:57:04 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.
Stacked on #6064. This branch contains #6064's commit. Once #6064 merges, the diff is only the cast commit.
What
x as Tbetween integer types, and frombool, now lowers to native AArch64. This was step 1 of the--blockersgreedy order: 18 files needed nothing else.boolbecomes 0 or 1.@truncate.@intCast. A value outside the target type traps at a new site kind,TrapKind::Cast(brk #7in an object file). The check is an extend-compare (cmp w, w, sxtbetc.), plus a sign test when an unsigned 32- or 64-bit source goes to a signed type.bool, stay rejected.t27b chooses the semantics by type. The Zig backend chooses
@truncatevs@intCastfrom the expression's shape. The README describes the difference.Corpus numbers (
t27b corpus specs)Newly passing:
Differential
casts_at_edge_values, runs every source type against every integer target. Each pair is checked in its truncating and checked forms, with constant operands, at every edge value, and the test asserts that cast traps actually fire.compiler.rs. feat(t27b): corpus --blockers lists every construct and the greedy unlock order #6064's tree was rebuilt and passes on the new base.Refs #5977
Refs #6063
🤖 Generated with Claude Code