nx_bench_tsv_persist.nx
buildroot/runtime/nx_bench_tsv_persist.nx
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
imports: nx_syscalls.nxnx_tier.nx
imported by: nx_bench_dist_persist_test.nxnx_bench_tsv_persist_test.nx
structs
| none |
consts
| 23 | const NX_BCPS_OK: nx_int = 0 |
| 24 | const NX_BCPS_OPEN_FAIL: nx_int = 1 |
| 25 | const NX_BCPS_WRITE_FAIL: nx_int = 2 |
| 26 | const NX_BCPS_CLOSE_FAIL: nx_int = 3 |
| 27 | const NX_BCPS_NULL_PATH: nx_int = 4 |
| 28 | const NX_BCPS_NULL_BUF: nx_int = 5 |
| 29 | const NX_BCPS_INVALID: nx_int = 6 |
| 30 | const NX_BCPS_N: nx_int = 7 |
functions
| 32 | func nx_bcps_v_is_valid(v: nx_int) -> nx_int called by 1: main |
| 43 | func _bcps_null_terminate(path: *u8, path_len: nx_int) -> *u8 |
| 56 | func nx_bc_persist_open_append(path: *u8, path_len: nx_int) -> i64 |
| 66 | func nx_bc_persist_write(fd: i64, buf: *u8, n_bytes: nx_int) -> i64 |
| 75 | func nx_bc_persist_close(fd: i64) -> nx_int |
| 88 | func nx_bc_persist_row(path: *u8, path_len: nx_int, called by 2: mainmain calls 4: nx_bc_persist_open_appendnx_bc_persist_writesys_closenx_bc_persist_close |