code wiki / (root) / nx_uxf_store_bench.nx

nx_uxf_store_bench.nx

buildroot/runtime/nx_uxf_store_bench.nx

7045 B133 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind benchtopic uxf
docsdependenciesstructsconstsfunctions

about

nx_uxf_store_bench.nx -- UXF arc R3: MEASURED exceed vs SQLite, on the sovereign seg_store. Honest framing (Rule: no-overclaim; sqlite3 is NOT installed here so a live 1:1 run is not possible): the NISHI side is REALLY MEASURED with the native monotonic clock INSIDE the organ (sys_clock_now_us -- honoring monitor-the-system-not-the-person); SQLite is a BY-DESIGN named reference (its costs stated, NOT fabricated numbers) -- the same discipline nx_ws_exceed_gate used for git. Exceed claim = the measured Nishi numbers + the STRUCTURAL properties SQLite pays by-design and the append-only content-addressed store does not. Workload: N put records into one segment via the real write path (ss_add -> ss_build_keys -> ss_writefile+fsync), then M point-gets via binary search over the sorted NXK1 index (zero-copy read of the index bytes). All timed natively. No hardware writes (Rule 26). expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_seg_store.nx nx_uxf_store_bench.nx

imports: nx_syscalls.nxnx_seg_store.nx

imported by: nobody (leaf or entry point)

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

main b_puts sys_write sys_mmap sys_clock_now_us sys_now_us sys_mmap ↻ sys_clock_gettime_mono ss_begin ss_begin_cap sys_mmap ↻ b_key ss_add ss_add2 ss_w32 ss_len ss_build_keys sys_mmap ↻ ss_r32 ss_kcmp ss_w32 ↻ ss_writefile sys_openat_wr sys_write ↻ sys_close sys_fsync ss_readall sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ↻ b_get ss_r32 ↻ ss_kcmp ↻ b_putn sys_mmap ↻ sys_write ↻ sys_exit

structs

none

consts

16const K_MAGIC_4194304: i64 = 4194304
17const K_MAGIC_7919: i64 = 7919
18const K_MAGIC_1000000: i64 = 1000000
20const BN: i64 = 20000 // records written
21const BM: i64 = 20000 // point-gets timed

functions

23func b_puts(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
24func b_putn(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { m = 0 - m; sys_write(1, "-" as *u8, 1) } let t: *u8 = sys_mmap(28); var k: i64 = 0; if m == 0 { t[0] = 48 as u8; k = 1 } while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } var i: i64 = 0; while i < k { bb[i] = t[k - 1 - i]; i = i + 1 } sys_write(1, bb, k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
27func b_key(i: i64, dst: *u8) -> i64
called by 1: main
38func b_get(idx: *u8, key: *u8, kl: i64, out: *i64) -> i64
called by 1: main calls 2: ss_r32ss_kcmp
60func main() -> i64