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
{{ message }}
Repository navigation
t27b: a signed @mod of any width up to i64 widens to the i64 routine (arena_heap, file_io_contract, reel_particles_mux) #10423
specs/tri/t27b/libm_plan.t27 (the decision) and its generated gen/rust/tri/t27b/libm_plan.rs (t27c gen-rust).
specs/tri/t27b/conformance/rem_int.t27 (conformance cases; no new file).
cli/t27b/src/lower.rslibm_call glue only, net <= 0 lines.
docs/reports/t27b_expectations.json rows and .trinity/seals/ for the specs that move.
Out of scope: a float @mod, a signed @mod wider than i64 (no i128 routine), any other builtin.
User Scenarios
A spec author writes @mod(n, 2) on an i32 (specs/ml/arena_heap.t27 is_pow2), @mod(size, 4) (specs/ml/file_io_contract.t27) or @mod(ms, 1000) (specs/t27f/reel_particles_mux.t27 millis). Today t27b refuses each file with ExprCall(@mod): "a signed @mod is ported for i64 only" (REFUSE_WIDTH). After this, t27b compiles them and gives the reference's verdict.
Requirements
A signed @mod narrower than i64 (i32, i16, i8, odd widths) lowers by widening both operands (the second takes the first one's type) to i64, calling the existing t27b_libm_mod, and narrowing the result back. This is lossless because the result is 0 <= r < b and b fits the operand type, and a zero or negative divisor traps or panics as before.
The choice (widen and narrow rather than one routine per width) is recorded in libm_plan.t27 with tests.
A signed @mod wider than i64 stays refused with REFUSE_WIDTH. An integer @rem of every width stays t27b's %.
Success Criteria
t27b test --blockers no longer lists ExprCall(@mod) for specs/ml/arena_heap.t27, specs/ml/file_io_contract.t27 or specs/t27f/reel_particles_mux.t27.
t27b test --check agrees with t27c test-report on rem_int.t27 and libm_plan.t27.
The ledger rows in docs/reports/t27b_expectations.json are updated for any spec that moves to pass.
Seals are re-saved, and the hand-written lower.rs is net <= 0 lines.
Requirements
FR-001: A signed @mod narrower than i64 (i32, i16, i8, odd widths) MUST widen both operands (the second operand takes the first operand's type) to i64, call the existing t27b_libm_mod, and narrow the result back to the original width.
FR-002: The widening-and-narrowing design choice MUST be recorded in specs/tri/t27b/libm_plan.t27 with accompanying tests.
FR-003: A signed @mod wider than i64 MUST continue to be refused with REFUSE_WIDTH.
FR-004: An integer @rem of every width MUST continue to lower to t27b's % operator.
Closed by the issue-shape gate (specs/policy/issue_shape.t27, #7498): an issue must have the template's sections. Edit the body; an edit that passes reopens it.
missing: ## Requirements -- numbered obligations, FR-001: ... MUST ...
Activity
t27b: regenerate libm_plan.rs, reseal, arena_heap and file_io_contrac…
github-actions commentedon Oct 18, 2026
Closed by the issue-shape gate (specs/policy/issue_shape.t27, #7498): an issue must have the template's sections. Edit the body; an edit that passes reopens it.
FR-001: ... MUST ...t27b: lower std.debug.print by a plan in t27 (WIP, Refs #10423)
t27b: a narrow signed @mod widens to the i64 routine -- arena_heap an…
t27b: std.debug.print lowers by a plan in t27 -- zig_open_slice passe…