code wiki / (root) / nx_regfix_gate.nx

nx_regfix_gate.nx

buildroot/runtime/nx_regfix_gate.nx

4188 B85 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_regfix_gate.nx -- ISOLATED proof of the reg_put next-segid fix (registration persistence past the seg-store's cap). Writes REG_TEST_N records to a FRESH /tmp store (never the shared toolreg): with the OLD ss_manifest cap, records beyond it collide onto one segment and are LOST; with reg_next_segid (uncapped max+1) ALL persist + read back. rule-11 clean: every threshold is a NAMED const (no bare literals). Runner must clean /tmp/regfix first. Exit 0 only on all-PASS. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_registry.nx nx_regfix_gate.nx

imports: nx_syscalls.nxnx_registry.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sys_mkdir g_id sys_mmap ↻ reg_put reg_put_x sts_lock sts_mm sys_mmap ↻ sts_werr sys_write sys_exit ss_cat sys_openat_append sts_werr ↻ sys_flock reg_key reg_cat ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss_scan_seglist ss_len sys_mmap ↻ ss_cat ↻ ss_readall ss_r32 reg_strlen reg_id_present sts_unlock sys_flock ↻ sys_close ss_next_segid sys_mmap ↻ ss_cat ↻ ss_readall ↻

structs

none

consts

10const REG_TEST_N: i64 = 300 // records to write -- chosen ABOVE the old cap so the tail exercises it
11const OLD_MANIFEST_CAP: i64 = 256 // the seg-store cap this fix eliminates (documented in nx_seg_store)
12const KEY_CH: i64 = 107 // ASCII 'k' (id prefix)
13const VAL_CH: i64 = 118 // ASCII 'v' (value prefix)
14const ASCII_0: i64 = 48
15const DIR_MODE: i64 = 0x1ed // 0755
16const GATE_CHECKS: i64 = 3 // number of PASS conditions below (all must be GREEN)

functions

18func g_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
19func g_putn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
29func g_id(buf: *u8, c: i64, i: i64) -> i64
called by 1: main calls 1: sys_mmap
40func main(argc: i64, argv: *i64) -> i64