code wiki / (root) / nx_probe_ub_shift.nx

nx_probe_ub_shift.nx source

↩ module page · 11 lines · 695 B

1// nx_probe_ub_shift.nx -- MUST-REFUSE WITNESS (UB axis rung 1, 2026-08-13): 2// a CONSTANT shift count outside the result width. MEASURED pre-fix: `1 << 70` compiled clean, 3// ran, and returned 64 -- the processor keeps only the low 6 bits of the count (70 -> 6), so the 4// program silently computed a different shift than the one written. Decidable at compile time. 5// EXPECT: COMPILE-FAIL naming the range + capability=shift-count-range. 6// (A RUNTIME count is deliberately NOT checked here -- that is the honest C-class lane and its 7// own rung; the control in the gauntlet proves a variable count still compiles.) 8func main(argc: i64, argv: *u8) -> i64 { 9 let x: i64 = 1 << 70 10 return x 11}