code wiki / _hdl_build / nx_deadline_gate.nx

nx_deadline_gate.nx

buildroot/runtime/_hdl_build/nx_deadline_gate.nx

14152 B238 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_deadline_gate.nx -- the referee for request-deadline propagation (nx_deadline_lib). The property that matters is not "does it parse a number". It is that the clamp can only ever SHORTEN a wait the caller already chose, because that is what makes this a COMPOSITION of the estate's existing per-lane timeout rulers instead of a second, rival one. So the load-bearing tooth is exhaustive over a grid: for every (deadline, now, want) tried, dl_wait_ms <= want AND >= 0. A primitive that could return more than `want` would silently extend somebody's timeout the first time it was adopted. It also asserts the PRODUCER and CONSUMER agree on the header name by reading the producer's SOURCE -- nx_sites_daemon_v2 carries its own NX_SD2_DEADLINE_HDR copy today, and a comment asking people to keep two literals in step is not a control. This tooth turns that into a RED. license_tier: ORIGINAL Read-only. No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_deadline_lib.nx nx_deadline_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_deadline_lib.nx

imported by: nobody (leaf or entry point)

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

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_check_eq gv_check gv_puts ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap dl_parse_ms dl_state dl_remaining_ms dl_wait_ms dl_state ↻ gv_check ↻ sys_mmap ↻ dg_read_any sys_read_file sys_openat_rd sys_lseek sys_mmap ↻

structs

none

consts

17const DG_SRC_A: *u8 = "buildroot/runtime/_hdl_build/nx_sites_daemon_v2.nx"
18const DG_SRC_B: *u8 = "runtime/_hdl_build/nx_sites_daemon_v2.nx"
19const DG_SRC_C: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/runtime/_hdl_build/nx_sites_daemon_v2.nx"
20const DG_PROD_CONST: *u8 = "const NX_SD2_DEADLINE_HDR: *u8 = \""
23const DG_FX_BUF: i64 = 2048
28const DG_FX_DEADLINE_MS: i64 = 1234567
33const DG_FX_HDR_OFF: i64 = 31
34const DG_FX_TRUNC_LEN: i64 = 6

functions

36func dg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: dg_findmain
38func dg_find(hay: *u8, hn: i64, needle: *u8) -> i64
called by 1: main calls 1: dg_len
58func dg_put(dst: *u8, off: i64, s: *u8) -> i64
called by 1: main
63func dg_read_any(box: *i64) -> *u8
called by 1: main calls 1: sys_read_file
70func main(argc: i64, argv: *i64) -> i64