code wiki / (root) / nx_physics_ladder.nx

nx_physics_ladder.nx

buildroot/runtime/nx_physics_ladder.nx

6826 B103 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_physics_ladder.nx -- GENEALOGIST physics-limit grading: how close is the sovereign hash get to the PHYSICS FLOOR? Operator telos: S-class exceed graded on ABSENT->EXISTS->EXCEEDS->NEAR-PHYSICS->PHYSICS- OPTIMUM, not just "beats sqlite". For a key->value lookup the irreducible physics limit is MEMORY-ACCESS LATENCY: you cannot find a value faster than touching the memory that holds it. This measures the real floors on THIS hardware with a dependent pointer-chase (the canonical memory-latency benchmark -- each load's address depends on the previous load, defeating prefetch/OOO so we measure latency, not bandwidth) at two working-set sizes: cache-resident (256KB) and DRAM-resident (64MB > LLC). Then it measures the sovereign hash get and places it on the maturity ladder vs those physics floors. Honest: a lookup must do >=1 random memory access; being at ~1 access = PHYSICS-OPTIMUM (irreducible). No hw writes (Rule 26). expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_hash_index.nx nx_itoa_lib.nx nx_physics_ladder.nx

imports: nx_hash_index.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

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

main pl_puts chase_latency_ns sys_now_us sys_mmap sys_clock_gettime_mono pl_puts ↻ pl_num nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write sys_munmap hi_new sys_mmap ↻ hi_put hi_hash hi_keq sys_now_us ↻ hi_get hi_hash ↻ hi_keq ↻

structs

none

consts

13const K_MAGIC_1664525: i64 = 1664525
14const K_MAGIC_1013904223: i64 = 1013904223
15const K_MAGIC_32768: i64 = 32768
16const K_MAGIC_8000000: i64 = 8000000
17const K_MAGIC_8388608: i64 = 8388608
18const K_MAGIC_20000: i64 = 20000
19const K_MAGIC_7919: i64 = 7919

functions

21func pl_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
26func pl_num(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
30func chase_latency_ns(n: i64, iters: i64) -> i64
called by 1: main calls 2: sys_now_uspl_puts
46func main() -> i64