code wiki / (root) / nx_sts_lock_gate.nx

nx_sts_lock_gate.nx

buildroot/runtime/nx_sts_lock_gate.nx

5178 B123 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic sts
docsdependenciesstructsconstsfunctions

about

nx_sts_lock_gate.nx -- proves sts_append_row's lock actually prevents the seq1559 lost-row race. THE COMPARISON IS CONTROLLED: both arms run the IDENTICAL read-modify-write with the IDENTICAL artificial window (a sleep between load and commit). The ONLY difference is whether <prefix>plock is held across it. If the locked arm keeps every row and the unlocked arm loses some, the lock is doing the work -- nothing else varies, so nothing else can be credited. NON-VACUITY IS THE POINT: a concurrency test that never triggers the race proves nothing at all. The unlocked arm MUST lose rows. If it does not, this gate reports VACUOUS rather than GREEN -- a guard that cannot be shown to fire has not been tested. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 4 imports · 0 importers

nx_store_seed_lib.nx nx_seg_store.nx nx_syscalls.nx nx_gate_verdict.nx nx_sts_lock_gate.nx

imports: nx_store_seed_lib.nxnx_seg_store.nxnx_syscalls.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main g_w sys_write sys_mkdir g_arm sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sts_seed sts_pfxhash ss_begin_cap sys_mmap ↻ sts_mm sys_mmap ↻ sts_werr sys_write ↻ sys_exit ↻ sts_rowkey ss_catn sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len ss_catn ↻ ss_commit_cas ss_segid_ok ss_commit_body

structs

none

consts

17const G_N: i64 = 6
18const G_CAP: i64 = 262144
19const G_WIDEN_MS: i64 = 150
20const G_NL: i64 = 10
21const G_PATHCAP: i64 = 256

functions

23func g_w(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_nummain calls 1: sys_write
24func g_num(v: i64) -> i64
called by 1: main calls 3: g_wsys_mmapsys_write
36func g_rows(prefix: *u8) -> i64
called by 1: g_arm calls 3: sys_mmapsts_loadsys_munmap
48func g_worker(prefix: *u8, id: i64, locked: i64) -> i64
67func g_arm(prefix: *u8, locked: i64) -> i64
85func main(argc: i64, argv: *i64) -> i64