code wiki / (root) / nx_commonsbench.nx

nx_commonsbench.nx

buildroot/runtime/nx_commonsbench.nx

13272 B218 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind bench
docsdependenciesstructsconstsfunctions

about

nx_commonsbench.nx -- THE RULER for neighbour-network standing: does a reciprocity rule actually reward the person who shares and starve the person who skims? Method (per feedback-match-known-good-then-improve): we do NOT invent a ruler. We take the estate's EXISTING reciprocity rule -- the pairwise tolerance-ratio audit shipped in nx_mycorrhiza (nx_my_audit_kind) and nx_hypha (nx_hy_reciprocity_verdict) -- and measure it against a labelled population of economic archetypes with declared ground truth. The bench is CALIBRATED TO FAIL THE INCUMBENT: a ruler that the current rule passes would measure nothing. THE STRUCTURAL CLAIM UNDER TEST: AN EXTRACTOR IS BALANCED WITH EVERY COUNTERPARTY AND NET-NEGATIVE ON THE NETWORK. A PAIRWISE AUDIT IS THEREFORE STRUCTURALLY BLIND TO THE CLASS. The skimmer always gives each counterparty *something* fee-justifying, so every pairwise audit returns BALANCED. The extraction is only visible in the network aggregate. Symmetrically, the most generous member (a nurse: gives 7x what she takes) is the one a ratio rule flags as anomalous. If that is true, the incumbent rule does not merely miss the predator -- it INVERTS the ordering. Ground truth is declared per archetype and is the thing later rules are scored against. Integer only, no floats, no content read. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_commonsbench.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ cw sys_write ↻ incumbent_standing incumbent_flags cname cpad sys_write ↻ cn sys_mmap ↻ sys_write ↻ sys_exit ↻

structs

none

consts

22const CB_N: i64 = 10 // actors in the labelled population
23const CB_Q10: i64 = 1024 // Q10 unit (1.0x) -- matches NX_MAGIC_1024 in nx_mycorrhiza
24const CB_TOL_Q10: i64 = 2048 // pairwise tolerance = 2.0x slack, the mycorrhiza-style admit window
25const CB_RING: i64 = 7 // index of first sybil-ring member (ring occupies 7,8,9)
26const CB_RING_N: i64 = 3
29const CB_ADMIT_HIGH: i64 = 3
30const CB_NEUTRAL: i64 = 1
31const CB_THROTTLE: i64 = 0
32const CB_EXCLUDE: i64 = 0 - 1

functions

34func cw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
35func cn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
36func cpad(s: *u8, w: i64) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); var j: i64=n; while j<w { sys_write(1," " as *u8,1); j=j+1 } return 0 }
called by 1: cname calls 1: sys_write
39func cname(i: i64) -> i64
called by 1: main calls 1: cpad
58func incumbent_standing(worst_pair_ratio_q10: i64) -> i64
called by 1: main
66func incumbent_flags(worst_pair_ratio_q10: i64) -> i64
called by 1: main
71func main() -> i64