code wiki / _hdl_build / nx_outbench.nx

nx_outbench.nx

buildroot/runtime/_hdl_build/nx_outbench.nx

13886 B284 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind bench
docsdependenciesstructsconstsfunctions

about

nx_outbench.nx -- OUTPUT-CORRECTNESS BENCH: does a generated site's OUTPUT hold together? ★WHY THIS EXISTS (the gap this lane measured and filed, 2026-07-25): nothing scored whether generated output is CORRECT. A generation census scores CAPABILITY ("can it generate"); a craft judge scores design MARKERS on ONE finished page. Neither asks the questions that caught every real defect in this lane -- each of which was LIVE and passed every craft/a11y/contrast checker: * a coffee shop's product page selling the GENERATOR'S OWN software subscriptions (leak) * a site shipping TWO visual identities across its pages (skin) * a tool reporting success having written NOTHING (set) * links pointing at pages that were never emitted (link) So a generator can score well on both existing rulers while shipping broken sites. GENERATOR-AGNOSTIC BY CONSTRUCTION: it reads a DIRECTORY of emitted files and needs no knowledge of who produced them, so it runs against the field's output exactly as it runs against ours. Offline -- no network, no live edge, no vantage problem (deliberately complementary to the live link sentinel). usage: nx_outbench bench <dir> [leakterm ...] | nx_outbench selftest Scores four classes in permille and an overall (worst-class-weighted) figure. expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_emit_guard.nx nx_outbench.nx

imports: nx_syscalls.nxnx_emit_guard.nx

imported by: nobody (leaf or entry point)

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

main ob_say sys_write sys_exit ob_eq eg_buf sys_mmap eg_say sys_write ↻ sys_exit ↻ sys_openat_rd sys_getdents64 dirent_name ob_slot dirent_reclen sys_close ob_ends ob_len ob_join sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read sys_close ↻ ob_links ob_find ob_len ↻ ob_ends ↻ ob_has_name ob_eq ↻ ob_slot ↻ ob_signature ob_find ↻ ob_find ↻ ob_has_name ↻ ob_num sys_write ↻ sys_mmap ↻

structs

none

consts

21const OB_MAGIC_1024: i64 = 1024
23const OB_MAXFILES: i64 = 256
24const OB_NAMEW: i64 = 128
25const OB_DIRBUF: i64 = 65536
26const OB_FILEBUF: i64 = 1048576
27const OB_PERMILLE: i64 = 1000

functions

29func ob_say(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
30func ob_num(v: i64) -> i64 { if v == 0 { sys_write(1, "0" as *u8, 1); return 0 } var m: i64 = v; if m < 0 { sys_write(1, "-" as *u8, 1); m = 0 - m } let t: *u8 = sys_mmap(28); var k: i64 = 0; while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } while k > 0 { k = k - 1; sys_write(1, (((t as i64) + k) as *u8), 1) } return 0 }
called by 1: main calls 2: sys_writesys_mmap
31func ob_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: ob_findob_ends
32func ob_slot(base: *u8, i: i64) -> *u8 { return (((base as i64) + i * OB_NAMEW) as *u8) }
called by 2: ob_has_namemain
33func ob_eq(a: *u8, b: *u8) -> i64
called by 2: ob_has_namemain
40func ob_find(buf: *u8, len: i64, lit: *u8, from: i64) -> i64
called by 3: ob_linksob_signaturemain calls 1: ob_len
53func ob_ends(name: *u8, suf: *u8) -> i64
called by 2: ob_linksmain calls 1: ob_len
61func ob_join(dst: *u8, dir: *u8, name: *u8) -> i64
called by 1: main
72func ob_has_name(names: *u8, n: i64, want: *u8) -> i64
called by 2: ob_linksmain calls 2: ob_eqob_slot
107func ob_signature(buf: *u8, len: i64, out: *u8) -> i64
called by 1: main calls 1: ob_find
128func main(argc: i64, argv: *i64) -> i64