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 orphan library
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)

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 }
17func sw_w(s: *u8) -> i64 { sys_write(1, s, sw_len(s)); return 0 }
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 }
19func sw_u(dst: *u8, off: i64, v: i64) -> i64
27func sw_read(path: *u8, buf: *u8, cap: i64) -> i64
37func sw_writeall(fd: i64, buf: *u8, n: i64) -> i64
44func sw_fork(mode: *u8, prompt: *u8, ob: *u8, cap: i64) -> i64
77func main(argc: i64, argv: *i64) -> i64