code wiki / _hdl_build / nx_seg_cache_gate.nx

nx_seg_cache_gate.nx

buildroot/runtime/_hdl_build/nx_seg_cache_gate.nx

8665 B183 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic seg
docsdependenciesstructsconstsfunctions

about

nx_seg_cache_gate.nx -- referee for ss_open_cached (debt seq962 / status seq978). WHAT IS UNDER TEST: ss_open/ss_open2 read EVERY segment fully into anonymous RAM and there is NO ss_close anywhere in the tree, so a caller that opens PER REQUEST leaks the whole store per request (MEASURED live: nx_hub_gw 1336 kB/request, VmSize==VmPeak). ss_open_cached memoises the handle and invalidates on the manifest (st_size, st_mtime), removing the leak WITHOUT ever calling munmap. T2 IS THE NON-VACUITY TOOTH AND IT IS NOT OPTIONAL: it asserts that BARE ss_open returns DIFFERENT handles for the same store. If T2 ever fails, T1 is passing for free and this whole gate is theatre. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_gate.nx nx_seg_store.nx nx_vsz_watchdog_core.nx nx_seg_cache_gate.nx

imports: nx_gate.nxnx_seg_store.nxnx_vsz_watchdog_core.nx

imported by: nobody (leaf or entry point)

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

main ss_begin ss_begin_cap 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 ↻ ss_add ss_add2 ss_w32 ss_len ss_commit ss_segid_ok ss_commit_body ss_segid_ok ↻ sys_mmap ↻ ss_cat ss_catn sys_mmap ↻ sys_write ↻ ss_write_seg ss_sr_new sys_mmap ↻ ss_segid_ok ↻ ss_sr_map sys_mmap ↻ sys_write ↻ ss_cat ↻ ss_catn ↻

structs

none

consts

26const SCG_TEETH: i64 = 9
27const SCG_VM_ITERS: i64 = 200 // open/close cycles driven by the T9 leak tooth
28const SCG_VM_SLACK_KB: i64 = 1024 // tolerated VmSize drift across the WHOLE T9 run
29const SCG_KB: i64 = 1024 // bytes per kB, for the bytes-per-open magnitude report

functions

17func scg_row(name: *u8, ok: i64) -> i64
called by 1: main calls 1: gw
30func main() -> i64