code wiki / _hdl_build / nx_benchmark_ref.nx

nx_benchmark_ref.nx

buildroot/runtime/_hdl_build/nx_benchmark_ref.nx

6548 B101 linesdepth 7pulls 8 transitivereach 0 importersview sourcekind benchtopic benchmark
docsdependenciesstructsconstsfunctions

about

nx_benchmark_ref.nx -- DURABLE benchmark-reference REGISTRY (operator: "its fine to have our benchmarks but they must exist SEPARATE or you appear to hallucinate and use them"). When a sovereign organ is built clean-room from an external reference (a spec, an OSS algorithm), the reference itself must be MATERIALIZED as a separate, durable, content-addressed artifact -- NOT left in the overwrite-prone srch_latest.raw and NOT merely named in prose (which reads as hallucination). Each reference lands in knowledge/benchmarks/refs/<id>.ref (the real fetched bytes) + <id>.meta (provenance: source_url, content_cid via the sovereign substrate hash, byte count, what it documents, tier=REFERENCE-ONLY). SEPARATION is structural: refs are DATA under knowledge/benchmarks/refs/, sovereign code is .nx under runtime/ and imports ONLY .nx -- no organ imports or reads a ref, so it is provably "learned-from, never used". verify re-hashes the stored bytes and checks they match the recorded cid (real + untampered, not invented). Usage: nx_benchmark_ref register <id> <source_url> <srcfile> <documents> | verify <id> license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_uxf_cid.nx nx_benchmark_ref.nx

imports: nx_syscalls.nxnx_itoa_lib.nxnx_uxf_cid.nx

imported by: nobody (leaf or entry point)

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

main streq register_ref sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close br_p br_w sys_write br_slen ensure_dir uxf_cid_profiled sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word sha256_final blk_set_byte ↻ sha256_compress ↻ uxf_nib_hex refpath cat sys_openat_wr sys_write ↻ sys_close ↻ br_w ↻ br_n nxi_out

structs

none

consts

14const K_MAGIC_1024: i64 = 1024

functions

16func br_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: br_wcontains
17func br_w(fd: i64, s: *u8) -> i64 { sys_write(fd, s, br_slen(s)); return 0 }
called by 2: br_pregister_ref calls 2: sys_writebr_slen
18func br_p(s: *u8) -> i64 { br_w(1, s); return 0 }
called by 2: register_refmain calls 1: br_w
23func br_n(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: register_ref calls 1: nxi_out
24func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 }
called by 1: register_ref
25func cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off+i]=s[i];i=i+1} return off+i }
called by 1: refpath
26func contains(hay: *u8, hl: i64, needle: *u8) -> i64
called by 1: verify_ref calls 1: br_slen
32func refpath(id: *u8, ext: *u8, out: *u8) -> i64
called by 2: register_refverify_ref calls 1: cat
37func register_ref(id: *u8, url: *u8, srcfile: *u8, documents: *u8) -> i64
70func verify_ref(id: *u8) -> i64
85func streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8){ if a[i]!=b[i]{return 0} i=i+1 } if b[i]!=(0 as u8){return 0} return 1 }
called by 1: main
87func main(argc: i64, argv: *i64) -> i64