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: integer constants wider than 64 bits (type u128, u256, u512, u1024), folded at compile time #7423
t27b refuses every spec that names an integer type wider than 64 bits. The corpus has five: specs/numeric/gft128.t27 (type u128), gft256.t27 (type u256), gft512.t27 (type u512), gft1024.t27 (type u1024), and specs/port/bootstrap/src/phi_f64_literals.t27 (type i128).
In the four gft specs, the wide values are module constants with literal values. t27c's Zig backend prints const X: u128 = <literal>; unchanged, so Zig's compiler folds every operation on X at compile time, at any width. Only a comparison (a bool) or an as (@intCast to a 64-bit type) ever reaches run time.
This slice adds that to t27b:
Exact big-integer folding of wide module constants, following Zig's comptime rules: + - * must stay inside the type, << drops the bits shifted out, >> rounds toward minus infinity, / % need a non-zero divisor and non-negative operands, and two typed operands must share one type.
A comparison of wide values becomes a constant bool.
An as back to a standard width must fit, because @intCast at compile time is checked.
A fn that no test reaches may name a wide type in its signature: Zig never resolves it. This works the same way as unresolved_sig does today for a struct whose layout fails.
These stay refused, by name, as type u128 and the like:
a run-time wide value (a parameter of a reached fn, a local, a result, a wide constant mixed with a run-time operand);
anything Zig's compiler would reject.
phi_f64_literals.t27 stays blocked. It uses i128 as a run-time value (a parameter and a local), which needs register pairs through t27b's one-register IR. It also needs tuples, str == and string indexing, which other lanes own. That is a separate slice, not this one.
Conformance spec first: specs/tri/t27b/conformance/wide_int_const.t27. t27c test-report gives 4/4 pass with 0 vacuous on the Railway lab.
Parked. PR #7440 implements this slice and its corpus run is clean: 6 files move from blocked to pass, mismatch 0. It adds 854 hand-written Rust lines, so the foreign-line budget from #7371 (40 per file, 80 per PR, no label lifts it) denies it. The folding logic has to be written in .t27 and generated by t27c (t27b port #6198) before this can land. Details: #7440 (comment)
Reopened 2026-10-07: the bulk close of issues without a ## Boundary section was reverted by the owner. Nothing to do here; this comment replaces the earlier close notice.
Activity
gHashTag commentedon Oct 7, 2026
Parked. PR #7440 implements this slice and its corpus run is clean: 6 files move from blocked to pass, mismatch 0. It adds 854 hand-written Rust lines, so the foreign-line budget from #7371 (40 per file, 80 per PR, no label lifts it) denies it. The folding logic has to be written in .t27 and generated by t27c (t27b port #6198) before this can land. Details: #7440 (comment)
gHashTag commentedon Oct 7, 2026
Reopened 2026-10-07: the bulk close of issues without a
## Boundarysection was reverted by the owner. Nothing to do here; this comment replaces the earlier close notice.t27b: the wide-constant test also refuses a constant that names itself (
t27b: the wide plan spells its operators with a body of its own (Closes
t27b: ledger rows for the wide-constant fold (Closes #7423)
t27b: integer constants wider than 64 bits fold at compile time, from…