code wiki / (root) / nx_segstore_uncap_gate.nx

nx_segstore_uncap_gate.nx

buildroot/runtime/nx_segstore_uncap_gate.nx

6548 B128 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_segstore_uncap_gate.nx -- ISOLATED proof that the seg_store legacy-cap class is EATEN at the organ: (1) ss_next_segid = canonical UNCAPPED writer segid (max+1) -- no clobber past the legacy cap; (2) ss_manifest_dyn sees the WHOLE store while legacy ss_manifest stays byte-identical (capped) -- the discriminating pair proving old callers keep exact behavior (API contract stability); (3) the ss_scan_seglist version WINDOW slides (oldest out, latest kept): a high-churn key (every registry's __idx__ gains one version per put) now reads back its LATEST version past the window -- pre-fix ss_get returned the stale FIRST-window version (this is the "writes claim-OK but don't surface" symptom class); (4) ss_compact with a FRESH segid folds the >cap store to ONE segment with nothing lost. Fresh /tmp store (never a shared registry). Runner must clean /tmp/ssuncap first. Exit 0 only on all-PASS. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_seg_store.nx nx_segstore_uncap_gate.nx

imports: nx_syscalls.nxnx_seg_store.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 ↻ ss_begin ss_begin_cap sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len ss_commit ss_segid_ok sys_mmap ↻ ss_cat ss_catn sys_mmap ↻ sys_write ss_write_seg ss_segid_ok ↻ sys_mmap ↻ ss_cat ↻ ss_catn ↻ sys_write ↻ ss_segname ss_cat ↻ ss_catn ↻ ss_writefile sys_openat_wr sys_write ↻ sys_close sys_fsync sys_renameat ss_build_keys sys_mmap ↻ ss_r32 ss_kcmp ss_w32 ↻ ss_build_terms

structs

none

consts

15const GATE_N: i64 = 300 // commits to drive -- chosen ABOVE the legacy cap so the tail exercises it
16const GATE_LEGACY_CAP: i64 = 256 // the legacy ss_manifest cap (must STILL cap -- byte-identical old API)
17const GATE_SEG_SLOTS: i64 = 260 // legacy caller buffer sizing convention (slots)
18const GATE_CHECKS: i64 = 9 // number of PASS conditions below
19const KEY_CH: i64 = 107 // 'k' record-key prefix
20const VAL_CH: i64 = 118 // 'v' record-value prefix
21const HOTV_CH: i64 = 104 // 'h' hot-key value prefix
22const ASCII_0: i64 = 48
23const DIR_MODE: i64 = 0x1ed // 0755

functions

25func 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 2: g_checkmain calls 1: sys_write
26func g_putn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
36func g_id(buf: *u8, c: i64, i: i64) -> i64
called by 1: main calls 1: sys_mmap
47func g_get_eq(prefix: *u8, key: *u8, want: *u8, wlen: i64) -> i64
called by 1: main calls 2: sys_mmapss_get
57func g_check(name: *u8, ok: i64, pass: *i64) -> i64
called by 1: main calls 1: g_puts
63func main(argc: i64, argv: *i64) -> i64