code wiki / (root) / nx_itoa_lib_gate.nx

nx_itoa_lib_gate.nx

buildroot/runtime/nx_itoa_lib_gate.nx

4530 B105 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_itoa_lib_gate.nx -- gate for the shared integer->decimal emitter (nx_itoa_lib). Authored ON nx_gate_verdict per the D001 migrate-on-touch law: a new gate imports THE lib. WHAT IT PROVES: ccz_cat_num is byte-identical across every boundary the ~87 hand-rolled clones it replaces got right only by accident -- zero, single digit, the 9-to-10 and 99-to-100 carries, interior zeros (100, 1024, which a sloppy reverse drops), negatives, and the full 19-digit range. If this is not byte-identical the migration silently corrupts every number the ecosystem prints, so the teeth are on OUTPUT BYTES, never on "it returned". T13 is the one the clones could not do at all: appending at a NON-ZERO offset without disturbing what is already in the buffer. That property is what makes the zero-allocation form possible, and it is why the fd shim (nxi_fd) needed to exist separately instead of being baked into the emitter. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_itoa_lib.nx nx_itoa_lib_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

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

main gv_head gv_puts sys_write gv_ctr sys_mmap ig_case sys_mmap ↻ ccz_cat_num ig_eq gv_check gv_puts ↻ sys_munmap sys_mmap ↻ ccz_cat_num ↻ gv_check ↻ sys_munmap ↻ nxi_buf gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap ↻ gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gv_cat sys_write ↻ sys_close sys_munmap ↻ sys_exit

structs

none

consts

19const IG_BUF: i64 = 64
20const IG_X: i64 = 120
21const IG_FOUR: i64 = 52
22const IG_TWO: i64 = 50
23const IG_ZERO: i64 = 48
24const IG_SEVEN: i64 = 55
25const IG_SENT: i64 = 88

functions

28func ig_eq(buf: *u8, n: i64, expect: *u8) -> i64
called by 1: ig_case
39func ig_case(name: *u8, v: i64, expect: *u8, ctr: *i64) -> i64
48func main(argc: i64, argv: *i64) -> i64