code wiki / (root) / nx_swarm_tend_gate.nx

nx_swarm_tend_gate.nx

buildroot/runtime/nx_swarm_tend_gate.nx

6286 B92 linesdepth 6pulls 9 transitivereach 0 importersview sourcekind gate/prooftopic swarm
docsdependenciesstructsconstsfunctions

about

nx_swarm_tend_gate.nx -- gate for the active queue tender (SOTA queue ops, no fire-and-forget). T1 PURE verdict table: no waiters->OK, fresh waiter->DRAINING, starved waiter->JAMMED. T2 ACTIVE REAP: plant a HOLD for a DEAD pid + a HOLD for a LIVE pid (init=1) in the store, with NO waiter present; tend_reap frees ONLY the dead one (writes DONE) -> the leaked-slot bug the passive path can't fix (no waiter to trigger it). reaped==1; live holder untouched. T3 JAM DETECTION live: plant a waiter with an ancient enqueue timestamp -> tend_health sees a large oldest_wait_ms -> verdict JAMMED (the traffic-jam alarm fires before a silent timeout). T4 clean: fresh empty queue -> OK, 0 reaped. T5 MULTI-ENTRY index: dead holder + live holder coexist in q:ids; reap frees ONLY the dead one, the live one stays counted. (The case a false "seg_store bug" diagnosis claimed impossible -- the real bugs were nx_cc empty-literal + const-syscall getpid, both fixed/worked around.) license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_swarm_tend.nx nx_gate_verdict.nx nx_swarm_tend_gate.nx

imports: nx_swarm_tend.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 std_putln std_puts std_slen sys_write tend_verdict sq_getpid sys_read sov_put 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 ↻

structs

none

consts

none

functions

16func tg_put(pid: i64, ty: *u8, prio: i64, est: i64, us: i64) -> i64
called by 1: main calls 3: sq_mkrowsq_put_statesq_add_id
24func main(argc: i64, argv: *i64) -> i64