nx_commonsbench.nx
buildroot/runtime/nx_commonsbench.nx
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
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
structs
| none |
consts
| 22 | const CB_N: i64 = 10 // actors in the labelled population |
| 23 | const CB_Q10: i64 = 1024 // Q10 unit (1.0x) -- matches NX_MAGIC_1024 in nx_mycorrhiza |
| 24 | const CB_TOL_Q10: i64 = 2048 // pairwise tolerance = 2.0x slack, the mycorrhiza-style admit window |
| 25 | const CB_RING: i64 = 7 // index of first sybil-ring member (ring occupies 7,8,9) |
| 26 | const CB_RING_N: i64 = 3 |
| 29 | const CB_ADMIT_HIGH: i64 = 3 |
| 30 | const CB_NEUTRAL: i64 = 1 |
| 31 | const CB_THROTTLE: i64 = 0 |
| 32 | const CB_EXCLUDE: i64 = 0 - 1 |
functions
| 34 | func cw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 35 | func 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 } |
| 36 | func 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 } |
| 39 | func cname(i: i64) -> i64 |
| 58 | func incumbent_standing(worst_pair_ratio_q10: i64) -> i64 called by 1: main |
| 66 | func incumbent_flags(worst_pair_ratio_q10: i64) -> i64 called by 1: main |
| 71 | func main() -> i64 |