code wiki / _hdl_build / nx_analyst_store_scale_gate.nx

nx_analyst_store_scale_gate.nx

buildroot/runtime/_hdl_build/nx_analyst_store_scale_gate.nx

8948 B191 linesdepth 10pulls 21 transitivereach 0 importersview sourcekind gate/prooftopic analyst
docsdependenciesstructsconstsfunctions

about

nx_analyst_store_scale_gate.nx -- F1001: prove the analyst survives a dataset LARGER than one seg_store version window, and that when it cannot, it SAYS SO instead of quietly analysing a recency slice. THE DEFECT THIS PINS (found 2026-07-23 reading nx_seg_store for F1001): ss_scan keeps at most SS_VER_WINDOW=256 versions of one key and the window SLIDES -- oldest out, newest kept. So 300 rows stored under one key read back as the NEWEST 256, and nx_analyst_store returned them with no signal at all. Every number in the resulting report described a slice nobody asked for. T1/T2 reproduce that on real committed data; T3-T5 prove the sharded path reads all 300; T6-T8 pin the fail-closed edges. D001-compliant: verdict via the shared nx_gate_verdict lib. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_gate_verdict.nx nx_analyst_store.nx nx_analyst_store_scale_gate.nx

imports: nx_gate_verdict.nxnx_analyst_store.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap gv_head gv_puts sys_write sys_now_us sys_mmap ↻ sys_clock_gettime_mono sg_prefix sg_catn ss_begin ss_begin_cap sys_mmap ↻ sg_row sg_lcg sg_catn ↻ ss_add ss_add2 ss_w32 ss_len ss_commit ss_segid_ok sys_mmap ↻ ss_cat ss_catn sys_mmap ↻ sys_write ↻ ss_write_seg ss_segid_ok ↻ sys_mmap ↻ ss_cat ↻ ss_catn ↻ sys_write ↻ ss_segname ss_cat ↻ ss_catn ↻ ss_writefile sys_openat_wr sys_write ↻

structs

none

consts

13const SG_ROWS: i64 = 300 // > SS_VER_WINDOW on purpose
14const SG_SHARD: i64 = 150 // rows per shard in the sharded store
15const SG_MAXSH: i64 = 8
16const SG_OUTCAP: i64 = 32768

functions

18func sg_lcg(s: i64) -> i64 { return (s * 1103515245 + 12345) & 0x7fffffff }
called by 1: sg_row
19func sg_catn(buf: *u8, o: i64, v: i64) -> i64
called by 2: sg_prefixsg_row
31func sg_has(hay: *u8, n: i64, needle: *u8) -> i64
called by 1: main
44func sg_eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
46func sg_prefix(out: *u8, tag: *u8, n: i64) -> i64
called by 1: main calls 1: sg_catn
57func sg_row(row: *u8, id: i64, seed: i64) -> i64
called by 1: main calls 2: sg_lcgsg_catn
75func main() -> i64