nx_regprof_test.nx
buildroot/runtime/nx_regprof_test.nx
about
nx_regprof_test.nx -- DECOMPOSE the reg_put cost. A profiler, not a gate.
WHY: debt 1785519597 records "reg_put costs ~678ms per append vs reg_get ~70us". That number is REAL
(measured on this host) but it is an AGGREGATE, and an aggregate names no fix. Whoever owns seg_store
needs to know WHERE the 678ms goes, and the source offers two very different candidate explanations:
(a) THE PLANE LOCK, added 2026-07-31. reg_put now takes <prefix>plock via sts_lock. If another
writer family holds it, every put pays contention -- and the fix is scheduling, not storage.
(b) THE FULL-INDEX-PER-SEGMENT SHAPE. Per the source: "every reg segment carries the FULL index",
so ss_get walks every segment and each put copies the whole index forward. The fix there is
the store layout, and it gets worse with every row.
Those imply OPPOSITE work. u2605AN AGGREGATE THAT CANNOT DISTINGUISH TWO OPPOSITE FIXES IS NOT YET A
MEASUREMENT -- it is a symptom. This probe separates them by timing the phases independently against
a FRESH prefix (so segment count starts at zero) and reporting per-op microseconds for each.
It also measures GROWTH: the same put timed at row 1 and at row 20. If cost is flat, the lock or a
per-commit fsync dominates and (a) is the story. If cost climbs with row count, the full-index copy
dominates and (b) is the story. u2605THE SLOPE, NOT THE MAGNITUDE, IS THE DISCRIMINATOR.
Reports only. Kills nothing, changes nothing, writes only to its own nonce-scoped prefix.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_registry.nxnx_store_seed_lib.nxnx_gate_verdict.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
| none |
functions
| 30 | func rp_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: main |
| 31 | func rp_catn(dst: *u8, off: i64, v: i64) -> i64 called by 1: main |
| 43 | func main(argc: i64, argv: *i64) -> i64 |