You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stage 2 of the run-time i128 in t27b (see #7915; the owner chose option A, the register pair, on 2026-10-10). Stage 1 was #8736 / #8750.
Goal
specs/tri/t27b/source_text.t27 passes t27b test --check with run-time asserts, and its ledger row is set to pass.
What it needs (measured in the #7915 comment and the stage-1 report)
i128 accepted on an annotated local and on a reassigned var.
The run-time module constants NO_INT, I128_MAX (2^127-1) and U64_MAX (2^64-1) as pair constants, instead of wide_plan.t27 refusing a wide constant beside a run-time value.
@intCast from u8 to i128 (a lossless widening).
Checked +, - and *, each trapping with "integer overflow" at the operator's line:
+ as adds/adcs and - as subs/sbcs, the overflow from the high word's flags;
* as mul/umulh plus the cross terms, with an exact overflow check.
@divTrunc through a 128-bit division routine written in t27 and compiled by t27b (never hand Rust). It traps with "division by zero" on a zero divisor, and minInt / -1 traps with "integer overflow".
The interpreter (eval.rs, through eval_arith.t27's arith) doing exact 128-bit arithmetic without overflowing its own i128, so the JIT and the interpreter still agree.
Where the decisions live
specs/tri/t27b/i128_plan.t27 (the instruction sequences, their overflow conditions, a model that runs them, the division routine), eval_arith.t27, wide_plan.t27 and cmp_op.t27, generated with t27c gen-rust. The hand-written glue stays net <= 0 (check_budget, see #8236), paid for by porting codegen.rs functions into plans.
Acceptance
source_text passes t27b test --check; a conformance spec under specs/tri/t27b/conformance/ passes under the reference and t27b; _expect_trap cases cover overflow on +, - and *, a zero divisor and minInt / -1, interpreter and JIT agreeing on each site.
Corpus before/after: only intended files move; jit_interp_mismatch stays 0.
check_budget and check_all exit 0.
Stage 3 (eval_arith: parameters in pairs, struct fields, @rem, the bitwise operators, shifts) is not part of this issue.
Activity