code wiki / (root) / nx_checked_arith_wrap.nx

nx_checked_arith_wrap.nx

buildroot/runtime/nx_checked_arith_wrap.nx

1375 B43 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_checked_arith_wrap.nx -- LN1 wrap-by-intent witness (sibling of nx_checked_arith.nx). __wrap_add / __wrap_sub / __wrap_mul reproduce the WRAPPED values under BOTH modes: under the default they are exactly `+ - *`; under --chkarith they are exempt from the overflow check, so a hash or ring counter written with them keeps running once the mode flips. Exit 0 iff all three wrapped results are the expected ones. Separate file on purpose: a pre-LN1 compiler has no such intrinsics, and the gate must be able to say WHICH tooth the old compiler fails. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_checked_arith_wrap.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main cw_max cw_pow62 cw_min cw_one cw_pow32 cw_zero

structs

none

consts

none

functions

10func cw_pow62() -> i64
called by 1: cw_max
15func cw_max() -> i64
called by 1: main calls 1: cw_pow62
19func cw_min() -> i64
called by 1: main
24func cw_pow32() -> i64
called by 1: main
29func cw_one() -> i64 { return 1 }
called by 1: main
30func cw_zero() -> i64 { return 0 }
called by 1: main
32func main() -> i64