code wiki / _hdl_build / nx_outbench.nx
nx_outbench.nx
buildroot/runtime/_hdl_build/nx_outbench.nx
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
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
structs
| none |
consts
| 21 | const OB_MAGIC_1024: i64 = 1024 |
| 23 | const OB_MAXFILES: i64 = 256 |
| 24 | const OB_NAMEW: i64 = 128 |
| 25 | const OB_DIRBUF: i64 = 65536 |
| 26 | const OB_FILEBUF: i64 = 1048576 |
| 27 | const OB_PERMILLE: i64 = 1000 |
functions
| 29 | func 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 } |
| 30 | func 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 } |
| 31 | func ob_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 32 | func ob_slot(base: *u8, i: i64) -> *u8 { return (((base as i64) + i * OB_NAMEW) as *u8) } |
| 33 | func ob_eq(a: *u8, b: *u8) -> i64 |
| 40 | func ob_find(buf: *u8, len: i64, lit: *u8, from: i64) -> i64 |
| 53 | func ob_ends(name: *u8, suf: *u8) -> i64 |
| 61 | func ob_join(dst: *u8, dir: *u8, name: *u8) -> i64 called by 1: main |
| 72 | func ob_has_name(names: *u8, n: i64, want: *u8) -> i64 |
| 79 | func ob_links(buf: *u8, len: i64, names: *u8, nfiles: i64, tmp: *u8, tot: *i64) -> i64 |
| 107 | func ob_signature(buf: *u8, len: i64, out: *u8) -> i64 |
| 128 | func main(argc: i64, argv: *i64) -> i64 |