code wiki / _hdl_build / nx_im4_compact_gate.nx

nx_im4_compact_gate.nx

buildroot/runtime/_hdl_build/nx_im4_compact_gate.nx

4558 B89 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_im4_compact_gate.nx -- PROVES the EXISTING IM4 compaction (nx_seg_store ss_compact_cap) at scale: it folds a store with MORE than the 256-segment ss_manifest cap into ONE merged segment, with ZERO data loss + history preserved (never-delete) + crash-safe-by-construction (fail-before-swap). Verify-don't-rebuild: IM4 already exists; this MEASURES it (no-wave) so the s-class-exceed "scale" axis is graded honestly (compaction-backed PARITY, not the BEHIND I overstated). Seeds 300 single-record segments (distinct segids), compacts, checks segment-count 300->1, two values intact, and the archive holding all 300 retired names. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_seg_store.nx nx_g_puts_lib.nx nx_syscalls.nx nx_im4_compact_gate.nx

imports: nx_seg_store.nxnx_g_puts_lib.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main g_puts sys_write ss_begin ss_begin_cap sys_mmap sys_mmap ↻ g_key g_dig sys_mmap ↻ 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 ↻ sys_close sys_fsync sys_renameat ss_build_keys sys_mmap ↻ ss_r32 ss_kcmp

structs

none

consts

11const G_PFX: *u8 = "/tmp/im4gate-" as *u8
12const G_N: i64 = 300

functions

14func g_putn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
24func g_dig(v: i64, out: *u8) -> i64
called by 1: g_key calls 1: sys_mmap
32func g_key(c: i64, i: i64, out: *u8) -> i64
called by 1: main calls 1: g_dig
38func g_eq(a: *u8, an: i64, b: *u8, bn: i64) -> i64
called by 1: main
43func main() -> i64