code wiki / (root) / nx_writejob_sweep.nx

nx_writejob_sweep.nx

buildroot/runtime/nx_writejob_sweep.nx

7400 B173 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_writejob_sweep.nx -- drain the writer's durable job queue (operator 2026-08-05: the hub stores requests and runs them later; nothing pushed from a spoke may take the hub down). Walks knowledge/staging/writejobs.queue (append-only ledger of job ids), and for each id that has a .req ticket but no finished .txt: re-runs ./nx_write.elf with the stored mode+prompt. ADMISSION COMPOSES FOR FREE: nx_write itself yields (NX-WRITE-DEFERRED) while a game holds the GPU, so a sweep during play leaves everything queued and costs one probe. Batch per sweep is conf-driven (writejob_sweep_batch). A consumed ticket is renamed .req.done (never deleted). license_tier: ORIGINAL module: nishi-core.write.sweep

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_lane_conf.nx nx_writejob_sweep.nx

imports: nx_syscalls.nxnx_lane_conf.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sw_read sys_openat_rd sys_read sys_close sw_w sys_write sw_len lc_write_lane lc_geti sys_mmap ↻ lc_read sys_openat_rd ↻ sys_read ↻ sys_close ↻ lc_slen sw_cat sys_openat_rd ↻ sys_close ↻ sw_fork sys_mmap ↻ sys_pipe2 sys_fork sys_close ↻ sys_dup3 sys_execve sys_exit sys_read ↻ sys_wait4 sys_openat_wr sw_writeall sys_write ↻ sys_renameat sw_u sys_mmap ↻ sys_write ↻

structs

none

consts

12const SW_BUF: i64 = 262144
13const SW_CAP: i64 = 200000
14const SW_LINE: i64 = 4096

functions

16func sw_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: sw_w
17func sw_w(s: *u8) -> i64 { sys_write(1, s, sw_len(s)); return 0 }
called by 1: main calls 2: sys_writesw_len
18func sw_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){d[o+i]=s[i];i=i+1} return o+i }
called by 1: main
19func sw_u(dst: *u8, off: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
27func sw_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
37func sw_writeall(fd: i64, buf: *u8, n: i64) -> i64
called by 1: main calls 1: sys_write
44func sw_fork(mode: *u8, prompt: *u8, ob: *u8, cap: i64) -> i64
77func main(argc: i64, argv: *i64) -> i64