code wiki / (root) / nx_sts_rowwrite_gate.nx

nx_sts_rowwrite_gate.nx

buildroot/runtime/nx_sts_rowwrite_gate.nx

6169 B96 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic sts
docsdependenciesstructsconstsfunctions

about

nx_sts_rowwrite_gate.nx -- THE TEETH OF ROW-LEVEL PLANE WRITES (loadgov LV17 sts_put_append, 2026-09-02). In-process over nx_store_seed_lib on a /tmp fixture plane (created at SETUP with sys_mkdir; the fixture-ratchet law: never a production prefix). What is proven: sts_find_seq locates a row by its first column and refuses an absent id; sts_append_fast adds one row and the reader sees it last; sts_replace_fast overwrites exactly one row at its seq, keeps count and order, and newest-wins across two replacements; an out-of-range seq is refused with the plane untouched. NOT proven here: the O(1) cost. It holds BY CONSTRUCTION (each write is one ss_add + one commit) and the honest measure of it is the D-state roster under load, which is nx_dstate's job, not a unit gate's. Inherits nx_gate_verdict: the exit code IS the verdict; every neg-control is NAMED for the gatelaw census. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_store_seed_lib.nx nx_sts_rowwrite_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_store_seed_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 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 ↻ sys_mkdir sys_mmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real rw_slen 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

structs

none

consts

14const RW_DIR: *u8 = "/tmp/nx_sts_rowwrite"
15const RW_PREFIX: *u8 = "/tmp/nx_sts_rowwrite/p-"
16const RW_MODE_DIR: i64 = 493 // 0755
17const RW_CAP: i64 = 65536
18const RW_ROWS0: i64 = 3
19const RW_BAD_SEQ: i64 = 9 // beyond q:n on purpose

functions

21func rw_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: rw_row_ismain
23func rw_rows(b: *u8, n: i64) -> i64 { var r: i64 = 0; var i: i64 = 0; while i < n { if b[i] == (10 as u8) { r = r + 1 } i = i + 1 } return r }
called by 1: main
25func rw_row_is(b: *u8, n: i64, k: i64, want: *u8) -> i64
called by 1: main calls 1: rw_slen
37func main() -> i64