code wiki / (root) / nx_bench_tsv_persist.nx

nx_bench_tsv_persist.nx

buildroot/runtime/nx_bench_tsv_persist.nx

3827 B108 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind benchtopic bench
docsdependenciesstructsconstsfunctions

about

nx_bench_tsv_persist.nx -- write bench TSV rows to a real file on disk. Sibling to the emit + parse primitives. Closes the final loop: measurement bytes now persist beyond process exit so cross-runner comparison (Nishi.tsv vs llama_cpp.tsv vs vllm.tsv) reads canonical-format rows from disk. V1 ships: nx_bc_persist_open_append(path, path_len) -> fd or NEGATIVE nx_bc_persist_write(fd, buf, n_bytes) -> bytes_written or NEGATIVE nx_bc_persist_close(fd) -> 0 or NEGATIVE nx_bc_persist_row(path, path_len, buf, n) -> bytes_written or NEGATIVE (one-call wrapper: open-append + write + close) Sealed verdict so callers handle disk failures (ENOENT, EPERM, etc.) as structured negative returns instead of as silent zero-byte writes.

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_tier.nx nx_bench_tsv_persist.nx nx_bench_dist_persist_test.nx nx_bench_tsv_persist_test.nx

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_bench_dist_persist_test.nxnx_bench_tsv_persist_test.nx

structs

none

consts

23const NX_BCPS_OK: nx_int = 0
24const NX_BCPS_OPEN_FAIL: nx_int = 1
25const NX_BCPS_WRITE_FAIL: nx_int = 2
26const NX_BCPS_CLOSE_FAIL: nx_int = 3
27const NX_BCPS_NULL_PATH: nx_int = 4
28const NX_BCPS_NULL_BUF: nx_int = 5
29const NX_BCPS_INVALID: nx_int = 6
30const NX_BCPS_N: nx_int = 7

functions

32func nx_bcps_v_is_valid(v: nx_int) -> nx_int
called by 1: main
43func _bcps_null_terminate(path: *u8, path_len: nx_int) -> *u8
called by 1: nx_bc_persist_open_append calls 1: sys_mmap
56func nx_bc_persist_open_append(path: *u8, path_len: nx_int) -> i64
66func nx_bc_persist_write(fd: i64, buf: *u8, n_bytes: nx_int) -> i64
called by 2: nx_bc_persist_rowmain calls 1: sys_write
75func nx_bc_persist_close(fd: i64) -> nx_int
called by 2: nx_bc_persist_rowmain calls 1: sys_close
88func nx_bc_persist_row(path: *u8, path_len: nx_int,