nx_sts_cas_gate.nx
buildroot/runtime/nx_sts_cas_gate.nx
about
nx_sts_cas_gate.nx -- does an UNLOCKED sts_seed writer LIE ABOUT SUCCEEDING?
nx_sts_lock_gate already proves the lost-row race exists (1 of 6 rows survive unlocked). It counts
SURVIVING ROWS, and that is the one thing it cannot use to tell the two outcomes apart:
SILENT CLOBBER : sts_seed returns a row count, the caller believes it wrote, and the row is gone.
LOUD REFUSAL : sts_seed returns negative, the caller KNOWS it did not write, and can retry.
Both leave fewer rows in the plane. Only one of them is a data-loss defect; the other is ordinary
backpressure. So this gate measures the thing that actually matters:
SILENT LOSS = (writers that were TOLD they succeeded) - (rows actually present)
Pre-guard that is 5 of 6: six writers each get a success return, one row exists. Every one of those
five callers has already moved on, logged success, and returned a row id nobody will ever read.
A CAS/generation guard cannot make more rows survive -- the writes genuinely conflict -- but it can
drive SILENT LOSS to ZERO, which converts an invisible corruption into a retryable error.
NON-VACUITY: if every writer succeeds AND every row survives, nothing raced and the gate says
VACUOUS rather than GREEN. A concurrency gate that never triggers the race proves nothing.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 4 imports · 0 importers
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
structs
| none |
consts
| 27 | const G_N: i64 = 6 |
| 28 | const G_CAP: i64 = 262144 |
| 29 | const G_WIDEN_MS: i64 = 150 |
| 30 | const G_NL: i64 = 10 |
| 31 | const G_EXIT_SHIFT: i64 = 8 |
| 32 | const G_EXIT_MASK: i64 = 255 |
functions
| 34 | func g_p(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 35 | func g_num(v: i64) -> i64 |
| 46 | func g_rows(prefix: *u8) -> i64 |
| 59 | func g_worker(prefix: *u8, id: i64) -> i64 |
| 76 | func g_arm(prefix: *u8, claims: *i64) -> i64 |
| 111 | func g_worker_fast(prefix: *u8, id: i64) -> i64 |
| 121 | func g_arm_fast(prefix: *u8, claims: *i64) -> i64 |
| 148 | func main(argc: i64, argv: *i64) -> i64 |