code wiki / _hdl_build / nx_wasmpage_census.nx

nx_wasmpage_census.nx

buildroot/runtime/_hdl_build/nx_wasmpage_census.nx

19780 B314 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind orphan library
docsdependenciesstructsconstsfunctions

about

nx_wasmpage_census.nx -- EVERY SHIPPED PAGE THAT CARRIES A WASM MODULE, VERIFIED. NO SAMPLING. WHY IT EXISTS. On 2026-08-14 /craft shipped black twice because its framebuffer had outgrown the module's own declared linear memory, and nothing in the pipeline could see it: size floors and magic bytes cannot tell a module that RUNS from one that TRAPS. The fit guard now lives in the shared emitter, so no NEW page can ship with that defect -- but every page emitted BEFORE the guard existed is still out there unmeasured, and I could not enumerate them: a grep across the docroot's 79,966 files times out. ★"TOO SLOW TO MEASURE" IS A TOOLING GAP, NEVER A LICENCE TO SAMPLE. This is the tool. WHAT IT DOES: walks the docroot, and for every .html that carries an embedded module (the emitter writes it as const B="<base64>") forks nx_wasm_vm_verify on that page and classifies the verdict. ★IT COMPOSES THE RULER RATHER THAN RE-IMPLEMENTING IT. The decode, the parse, the declared-memory read and the fit arithmetic all live in nx_wasm_vm_verify; duplicating any of that here would give the estate two answers to one question and no way to tell which had rotted. The partition is printed and RECONCILED against the file count -- a census whose parts do not sum is a leak, and every OVERSIZE page is NAMED, because a count without a worklist is not actionable. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_tool_run.nx nx_gate_verdict.nx nx_wasmpage_census.nx

imports: nx_syscalls.nxnx_tool_run.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

structs

none

consts

24const WC_VERIFY: *u8 = "nx_wasm_vm_verify.elf"
33const WC_ANCHOR: *u8 = "AGFzbQEAAAA"
34const WC_DIRBUF: i64 = 131072
35const WC_PATHBUF: i64 = 4096
36const WC_OUTCAP: i64 = 262144
40const WC_MIN_PAGE: i64 = 4096
44const WC_TIMEOUT_MS: i64 = 10000
47const WC_MAXDEPTH: i64 = 12
52const WC_JSMARK: *u8 = "WebAssembly.instantiate"
55const WC_ARGV_SLOTS: i64 = 5
97const WC_TAL_SLOTS: i64 = 16

functions

66func wc_puts(s: *u8) -> i64 { return gv_puts(s) }
67func wc_num(v: i64) -> i64 { return gv_num(v) }
68func wc_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
69func wc_is_html(nm: *u8) -> i64
79func wc_find(buf: *u8, len: i64, needle: *u8) -> i64
99func wc_tal() -> *i64 { if WC_TAL == 0 { WC_TAL = sys_mmap(WC_TAL_SLOTS * 8) as i64 } return WC_TAL as *i64 }
107func wc_lenbox() -> *i64 { if WC_LENBOX == 0 { WC_LENBOX = sys_mmap(16) as i64 } return WC_LENBOX as *i64 }
109func wc_argvbox() -> *i64 { if WC_ARGVBOX == 0 { WC_ARGVBOX = sys_mmap(WC_ARGV_SLOTS * 8) as i64 } return WC_ARGVBOX as *i64 }
111func wc_outbox() -> *u8 { if WC_OUTBOX == 0 { WC_OUTBOX = sys_mmap(WC_OUTCAP) as i64 } return WC_OUTBOX as *u8 }
113func wc_olenbox() -> *i64 { if WC_OLENBOX == 0 { WC_OLENBOX = sys_mmap(16) as i64 } return WC_OLENBOX as *i64 }
115func wc_check(path: *u8) -> i64
208func wc_walk(dir: *u8, depth: i64) -> i64
259func main(argc: i64, argv: *i64) -> i64