nx_sts_rowwrite_gate.nx
buildroot/runtime/nx_sts_rowwrite_gate.nx
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
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
structs
| none |
consts
| 14 | const RW_DIR: *u8 = "/tmp/nx_sts_rowwrite" |
| 15 | const RW_PREFIX: *u8 = "/tmp/nx_sts_rowwrite/p-" |
| 16 | const RW_MODE_DIR: i64 = 493 // 0755 |
| 17 | const RW_CAP: i64 = 65536 |
| 18 | const RW_ROWS0: i64 = 3 |
| 19 | const RW_BAD_SEQ: i64 = 9 // beyond q:n on purpose |
functions
| 21 | func rw_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 23 | func 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 |
| 25 | func rw_row_is(b: *u8, n: i64, k: i64, want: *u8) -> i64 |
| 37 | func main() -> i64 |