code wiki / (root) / nx_dr_refute.nx

nx_dr_refute.nx source

↩ module page · 50 lines · 2474 B

1// nx_dr_refute.nx -- SOVEREIGN adversarial REFUTATION aggregator (DR-2). 2// The measured gap (liar-killed h2h): our "verify" was source-AGREEMENT (confirms 3// popular-but-wrong claims) -> adversarial refutation 0-vs-9 vs Claude deep-research. 4// This organ is the Co-Scientist Reflection/Critic kill-stage: N independent verifiers 5// vote refute/abstain/support on a claim, and it is KILLED only with enough EFFECTIVE 6// INDEPENDENT refutations. It bakes in the Structured-Test-Time-Scaling theory 7// (xinmingtu.cn 2026): correlated retries buy almost nothing -- m_eff = m/(1+(m-1)*rho) 8// -- so verifiers must be DECORRELATED (different lenses/evidence/prompts) to count. 9// Integer, deterministic. Imports ONLY nx_syscalls = drift-immune. No hw writes (Rule 26). 10// 11// module: nishi-core.research.dr_refute 12// depends: nx_syscalls.nx 13// genealogy_id: coscientist_reflection + structured_ttscaling_2026_decorrelation 14import "nx_syscalls.nx" 15 16// tally votes: <0 refute, >0 support, ==0 abstain. out[0]=R out[1]=S out[2]=A. 17func rf_tally(votes: *i64, n: i64, out: *i64) -> i64 { 18 var r: i64 = 0; var s: i64 = 0; var a: i64 = 0; var i: i64 = 0 19 while i < n { 20 if votes[i] < 0 { r = r + 1 } 21 else { if votes[i] > 0 { s = s + 1 } else { a = a + 1 } } 22 i = i + 1 23 } 24 out[0] = r; out[1] = s; out[2] = a 25 return 0 26} 27 28// effective independent vote count in PERMILLE under verifier correlation rho (permille): 29// m_eff = m / (1 + (m-1)*rho_frac). permille form m*1000000/(1000+(m-1)*rho). 30// rho=0 -> m (fully independent); rho=1000 -> 1 (fully correlated = one voice). 31func rf_effective_n(m: i64, rho: i64) -> i64 { 32 if m < 1 { return 0 } 33 let denom: i64 = 1000 + (m - 1) * rho 34 return (m * 1000 * 1000) / denom 35} 36 37// effective refutations in permille = refutes discounted by the independence fraction. 38func rf_effective_refutes(refutes: i64, m: i64, rho: i64) -> i64 { 39 if m < 1 { return 0 } 40 return (refutes * rf_effective_n(m, rho)) / m 41} 42 43// KILL a claim iff refutes are the strict majority AND the EFFECTIVE independent 44// refutations clear the confidence bar (permille). Decorrelation (rho) shrinks the 45// effective count, so correlated refuters cannot confidently kill (S1). 46func rf_kill(refutes: i64, supports: i64, m: i64, rho: i64, bar_permille: i64) -> i64 { 47 if refutes <= supports { return 0 } 48 if m < 1 { return 0 } 49 if rf_effective_refutes(refutes, m, rho) >= bar_permille { return 1 } else { return 0 } 50}