// ============================================================================ // AB-SPLIT-4480 — THE A/B SIDE SPLIT OF THE ROUGH-PAIR CENSUS ERROR. // // Job #4480, question Q-roughpair-error (PARTIAL), lane measure. // Pre-registration: PREREG-4480.md, written before this file existed. // // The item both owning notes name and neither ran: // attack-roughpair-error.md §8 NOT REACHED "E was not split by side (A/B)" // measure-roughpair-null-0829.md item 7 "still not done" // and the mechanism measure-roughpair-null-0829.md leaves open: // "The residual 30% is unattributed. Prime-prime dependence is the natural // candidate and was not fitted." // // The pair coupling IS that dependence, and it needs no fit: with the two // marginals NA, NB measured, the independence product is Xind = NA*NB/C, and // // E = X - Xmain = (X - Xind) + (Xind - Xmain) = D_pair + D_marg // // identically. The split attributes the measured error; it is not a model // comparison, and there is no residual. // // ARITHMETIC CONVENTIONS ARE THE SERVED PRODUCER'S, UNCHANGED, and SEC 0-2 // below re-derive its published numbers as a gate before any new number is // printed (G1-G5 of the preregistration). The engine here is written from the // same conventions, independently of the served file's source. // // ARTIFACT RULE: no wall clock, no rate and no random draw reaches stdout. // Timing goes to stderr, so stdout is byte-identical across runs with no // normaliser. (The served producer prints its elapsed seconds to stdout and is // therefore byte-volatile; the corpus's research/qc/tailfmt.js normalize scrubs // it, and the served file's recorded out-sha256 reproduces under that rule -- // checked in this session, gate G6, not a defect.) // ============================================================================ 'use strict'; const T0 = Date.now(); // for the stderr line only; never stdout function assertEq(tag, got, want) { if (got !== want) { failures++; console.log(` ASSERT FAIL [${tag}] got ${got} want ${want}`); } } function assertNear(tag, got, want, tol) { if (!(Math.abs(got - want) <= tol)) { failures++; console.log(` ASSERT FAIL [${tag}] got ${got} want ${want} +-${tol}`); } } function assertTrue(tag, cond) { if (!cond) { failures++; console.log(` ASSERT FAIL [${tag}]`); } } let failures = 0; const f0 = (x) => x.toFixed(0), f2 = (x) => x.toFixed(2), f3 = (x) => x.toFixed(3), f4 = (x) => x.toFixed(4), f5 = (x) => x.toFixed(5); const pad = (s, n) => String(s).padStart(n); // --------------------------------------------------------------------------- // primes, actives, anchors // --------------------------------------------------------------------------- const PLIM = 31700; const flag = new Uint8Array(PLIM + 1); flag[0] = flag[1] = 1; for (let p = 2; p * p <= PLIM; p++) if (!flag[p]) for (let m = p * p; m <= PLIM; m += p) flag[m] = 1; const PRIMES = []; for (let n = 2; n <= PLIM; n++) if (!flag[n]) PRIMES.push(n); const ACT = PRIMES.filter(p => p >= 7); const QMAX = 10007; const ANCHORS = ACT.filter(p => p <= QMAX); const GAMMA = 0.5772156649015329, EG = Math.exp(GAMMA), EMG = Math.exp(-GAMMA); const isOpen30 = (c) => c === 11 || c === 17 || c === 29; const NP = ACT.length; const P1 = new Float64Array(NP + 1), P2 = new Float64Array(NP + 1); P1[0] = 1; P2[0] = 1; for (let i = 1; i <= NP; i++) { const p = ACT[i - 1]; P1[i] = P1[i - 1] * (1 - 1 / p); P2[i] = P2[i - 1] * (1 - 2 / p); } // --------------------------------------------------------------------------- // Buchstab omega, from the delay equation (u w(u))' = w(u-1) // --------------------------------------------------------------------------- const WSTEP = 1e-4, WMAX = 20; const NW = Math.round((WMAX - 1) / WSTEP) + 1; const WOM = new Float64Array(NW); { for (let j = 0; j < NW; j++) { const u = 1 + j * WSTEP; if (u <= 2) WOM[j] = 1 / u; else if (u <= 3) WOM[j] = (1 + Math.log(u - 1)) / u; else break; } const j3 = Math.round(2 / WSTEP); let g = 3 * WOM[j3]; for (let j = j3 + 1; j < NW; j++) { const a = WOM[j - 1 - Math.round(1 / WSTEP)], b = WOM[j - Math.round(1 / WSTEP)]; g += WSTEP * (a + b) / 2; WOM[j] = g / (1 + j * WSTEP); } } function omega(u) { if (u < 1) return 0; if (u >= WMAX) return EMG; const t = (u - 1) / WSTEP, j = Math.floor(t), fr = t - j; return WOM[j] * (1 - fr) + WOM[Math.min(j + 1, NW - 1)] * fr; } const beta = (u) => omega(u) * EG; console.log('SEC 0 — GATES: omega, and the engine against the cited constants (G1, G2, G3)'); assertNear('G1 omega(2)', omega(2), 0.5, 1e-9); assertNear('G1 3omega(3)', 3 * omega(3), 1 + Math.LN2, 1e-7); assertNear('G1 omega(12)', omega(12), EMG, 1e-6); let uStar = 0; { let a = 3, b = 5; for (let it = 0; it < 200; it++) { const m = (a + b) / 2; if (m * omega(m) < 2) a = m; else b = m; } uStar = (a + b) / 2; } assertNear('G1 u*', uStar, 3.565845, 2e-4); console.log(` omega: w(2) = ${f5(omega(2))}, 3w(3) = ${f5(3 * omega(3))}, w(12) = ${f5(omega(12))}`); console.log(` root of u*w(u) = 2: u* = ${uStar.toFixed(6)}, 1/u* = ${(1 / uStar).toFixed(6)} [prior-art scratchpad 3.565845 / 0.280438]`); console.log(` rho(2) = e^{2gamma}/4 = ${f5(EG * EG / 4)} = beta(2)^2 = ${f5(beta(2) * beta(2))}`); // --------------------------------------------------------------------------- // the engine: per-anchor window sieve, X(K) and the two marginals // --------------------------------------------------------------------------- let maxW = 0; { let prev = 7; for (const p of ACT) { if (p > 10009) break; maxW = Math.max(maxW, p * p - prev * prev); prev = p; } } const lpfw = new Int32Array(maxW + 4); const rows = []; for (let Qi = 0; Qi < ANCHORS.length; Qi++) { const Q = ANCHORS[Qi], Qp = Qi + 1 < ANCHORS.length ? ANCHORS[Qi + 1] : PRIMES[PRIMES.findIndex(p => p > Q)]; const lo = Q * Q, hi = Qp * Qp, width = hi - lo, nR = Qi + 1; lpfw.fill(0, 0, width + 3); for (let ri = 0; ri < nR; ri++) { const r = ACT[ri]; for (let v = Math.ceil(lo / r) * r; v <= hi + 4; v += r) if (lpfw[v - lo] === 0) lpfw[v - lo] = ri + 1; } let C = 0, T = 0; const histo = new Int32Array(nR + 2); // min(iA,iB) for pairs with both > 0 const hA = new Int32Array(nR + 2), hB = new Int32Array(nR + 2); let nA0 = 0, nB0 = 0; for (let a = lo; a + 2 < hi; a++) { if (!isOpen30(a % 30)) continue; C++; const iA = lpfw[a - lo], iB = lpfw[a + 2 - lo]; if (iA === 0) nA0++; else hA[iA]++; if (iB === 0) nB0++; else hB[iB]++; if (iA === 0 && iB === 0) T++; else if (iA > 0 && iB > 0) histo[Math.min(iA, iB)]++; } // THE MARGINALS MUST MATCH THE CENSUS'S OWN EVENT. X[K] = #{a : iA > K and iB > K}, which // requires iA > 0, so NA[K] = #{a : iA > K} and the iA = 0 case (a coprime to ACT) is NOT in // either. Adding nA0 here was a real bug, caught by the independent Python checker before any // number was quoted, and it inflated the coupling factor from ~1 to 4.4. const X = new Int32Array(nR + 1), NA = new Int32Array(nR + 1), NB = new Int32Array(nR + 1); for (let K = nR - 1; K >= 0; K--) { X[K] = X[K + 1] + histo[K + 1]; NA[K] = NA[K + 1] + hA[K + 1]; NB[K] = NB[K + 1] + hB[K + 1]; } // THE SHIFT CONTROL (F2's discriminator). Over one TRIMMED opener range, count rough // numbers at a, a+2 and a-2. If the side asymmetry is a window-edge effect of the shift, // NA-NB and NA-NBm must have OPPOSITE signs and comparable size; if it is a real // asymmetry of the pair, they must agree in sign. Trimmed so every one of the three // indices exists in the window array. // THE TWO-FACTOR CONTROL. NA counts rough numbers in window [lo,hi) with residues // {11,17,29} mod 30. NB counts rough numbers in [lo+2,hi+2) with residues {13,19,1} // mod 30 -- because b = a+2. Those differ from NA in TWO ways at once, so one more // count separates them: NA' = rough numbers in [lo+2,hi+2) with residues {11,17,29}, // i.e. NA's own residues in NB's own window. Then // NA - NB = (NA - NA') + (NA' - NB) // window shift residue shift // A -2 probe was tried first and DISCARDED: a-2 lands on residues 9,15,27 mod 30, which // are not reduced mod 30, so it compares different arithmetic populations and cannot // control for anything. It is recorded as withdrawn in the report, not silently dropped. const hAp = new Int32Array(nR + 2), hBp = new Int32Array(nR + 2); let nAp0 = 0, nBp0 = 0; for (let v = lo + 2; v < hi + 2; v++) { const c30 = v % 30; const isAres = (c30 === 11 || c30 === 17 || c30 === 29); const isBres = (c30 === 13 || c30 === 19 || c30 === 1); if (!isAres && !isBres) continue; const i = lpfw[v - lo]; if (isAres) { if (i === 0) nAp0++; else hAp[i]++; } else { if (i === 0) nBp0++; else hBp[i]++; } } const NAp = new Int32Array(nR + 1), NBp = new Int32Array(nR + 1); for (let K = nR - 1; K >= 0; K--) { NAp[K] = NAp[K + 1] + hAp[K + 1]; NBp[K] = NBp[K + 1] + hBp[K + 1]; } // same event as NA / NB, so the i = 0 case is excluded here too (nAp0 / nBp0 are counted and // deliberately unused; the control compares like with like) let Kstar = -1; for (let K = 0; K <= nR; K++) if (T - X[K] >= 1) { Kstar = K; break; } rows.push({ Q, Qp, lo, hi, width, C, T, nR, X, NA, NB, NAp, NBp, Kstar, X0: X[0], lnh: 2 * Math.log(Q), lnW: Math.log(width) }); } const byQ = new Map(rows.map(r => [r.Q, r])); // --- G2: the cited constants, as an engine licence ------------------------ { const V2K = [[1511, 15], [1999, 16], [2503, 19], [2999, 25], [3163, 18], [3511, 22], [4001, 27], [4507, 21], [4999, 22], [5623, 27], [6007, 23], [6521, 27], [7001, 29], [7507, 34], [8009, 31], [8513, 32], [9001, 33], [9497, 32], [10007, 30], [7, 0], [43, 0], [61, 1], [67, 1], [71, 4], [809, 16], [1499, 13]]; for (const [Q, Ks] of V2K) assertEq(`G2 cited K* at Q=${Q}`, byQ.get(Q).Kstar, Ks); const worst = rows.reduce((w, r) => (r.Kstar > w.Kstar ? r : w)); assertTrue('G2 largest K* = 46 at Q = 9281', worst.Q === 9281 && worst.Kstar === 46); const ok0 = rows.filter(r => r.X0 <= r.T - 1).map(r => r.Q); assertEq('G2 K=0 certificate list', ok0.join(','), '7,11,13,19,23,31,37,43'); for (const r of rows) assertTrue(`G2 X(full) = 0 at Q=${r.Q}`, r.X[r.nR] === 0); console.log(` engine: ${rows.length} anchors Q = 7..${QMAX}; 25 cited K* values, max K* = 46 at 9281, the K=0 list and X(full) = 0 all reproduced`); } const BANDS = [['B3', 101, 313], ['B4', 317, 997], ['B5', 1009, 1499], ['B6', 1500, 3163], ['B7', 3164, 5623], ['B8', 5624, 10007]]; { const want = { B3: ['3.88', '0.093'], B4: ['8.42', '0.075'], B5: ['12.20', '0.061'], B6: ['16.88', '0.050'], B7: ['23.34', '0.040'], B8: ['31.22', '0.032'] }; let line = ' Z1 target reproduced: '; for (const [nm, a, b] of BANDS) { const rs = rows.filter(r => r.Q >= a && r.Q <= b); const mK = rs.reduce((s, r) => s + r.Kstar, 0) / rs.length; const mF = rs.reduce((s, r) => s + r.Kstar / r.nR, 0) / rs.length; assertEq(`G3 Z1 ${nm} K* mean`, f2(mK), want[nm][0]); assertEq(`G3 Z1 ${nm} K*/pool mean`, f3(mF), want[nm][1]); line += `${nm} ${f2(mK)}/${f3(mF)} `; } console.log(line.trimEnd()); } // --------------------------------------------------------------------------- // main terms // --------------------------------------------------------------------------- function mains(r, K) { const nR = r.nR; const V2K = P2[K], U = P1[nR] / P1[K], V2Q = P2[nR]; const uK = K === 0 ? Infinity : r.lnh / Math.log(ACT[K - 1]); const bK = K === 0 ? 1 : beta(uK), bQ = beta(2); const corr = r.C * (V2K * bK * bK - 2 * V2K * U * bK * bQ + V2Q * bQ * bQ); return { corr, uK }; } const Tmain = (r) => r.C * P2[r.nR] * beta(2) * beta(2); function KatU(r, u) { const y = Math.exp(r.lnh / u); let lo = 0, hi = r.nR; while (lo < hi) { const m = (lo + hi + 1) >> 1; if (ACT[m - 1] <= y) lo = m; else hi = m - 1; } return lo; } // the dimension-1 sibling of mains(): one member sifted with rho = 1 function marginalMain(r, K) { const uK = K === 0 ? Infinity : r.lnh / Math.log(ACT[K - 1]); return r.C * P1[K] * (K === 0 ? 1 : beta(uK)); } // --------------------------------------------------------------------------- console.log('\nSEC 1 — GATE G4: the served producer’s calibration row (T is the one known truth)'); { const want = { B3: ['1.0109', '0.8017'], B4: ['1.0072', '0.7987'], B5: ['1.0262', '0.8138'], B6: ['1.0090', '0.8002'], B7: ['1.0024', '0.7949'], B8: ['1.0019', '0.7945'] }; console.log(' band n sumT sumTmain(corr) T/Tmain T/Tnaive'); for (const [nm, a, b] of BANDS) { const rs = rows.filter(r => r.Q >= a && r.Q <= b); let sT = 0, sM = 0, sN = 0; // the naive full-depth main term is C * V2(Q); the corrected one carries rho(2), so // T/Tnaive sits at rho(2) = 0.79305 (measured 0.7945 at B8), which is the point of the column. for (const r of rs) { sT += r.T; sM += Tmain(r); sN += r.C * P2[r.nR]; } assertEq(`G4 ${nm} T/Tmain`, f4(sT / sM), want[nm][0]); assertEq(`G4 ${nm} T/Tnaive`, f4(sT / sN), want[nm][1]); console.log(` ${nm} ${pad(rs.length, 4)} ${pad(sT, 7)} ${pad(sM.toFixed(0), 13)} ${f4(sT / sM)} ${f4(sT / sN)}`); } } // --------------------------------------------------------------------------- console.log('\nSEC 2 — GATE G5: the served producer’s own §2 table at u* and u = 3'); const U_DEPTHS = [3.0, uStar]; const DEPTH_STATS = {}; for (const u of U_DEPTHS) { const cells = {}, perAnchor = []; for (const r of rows) { const K = KatU(r, u); if (K < 3) continue; const Xm = mains(r, K).corr, E = r.X[K] - Xm; perAnchor.push({ Q: r.Q, K, X: r.X[K], Xm, E, T: r.T }); const nm = (BANDS.find(([n, a, b]) => r.Q >= a && r.Q <= b) || [null])[0]; if (!nm) continue; const c = cells[nm] || (cells[nm] = { n: 0, sX: 0, sT: 0, sM: 0, sE: 0, sAE: 0, sE2M: 0, mx: 0, sXoT: 0, sMoT: 0 }); c.n++; c.sX += r.X[K]; c.sT += r.T; c.sM += Xm; c.sE += E; c.sAE += Math.abs(E); c.sE2M += E * E / Xm; // and are MEANS OF RATIOS in the served producer, not ratios of sums c.sXoT += r.X[K] / r.T; c.sMoT += Xm / r.T; if (Math.abs(E) / r.T > c.mx) c.mx = Math.abs(E) / r.T; } DEPTH_STATS[u] = { cells, perAnchor }; const label = u === uStar ? `u* = ${f4(uStar)}` : f2(u); console.log(` --- u = ${label} ---`); console.log(' band n sumE/sumXmain <|E|>/ max|E|/T chi2/df'); for (const [nm] of BANDS) { const c = cells[nm]; if (!c) continue; console.log(` ${nm} ${pad(c.n, 4)} ${f4(c.sXoT / c.n)} ${f4(c.sMoT / c.n)} ${pad((c.sE / c.sM >= 0 ? '+' : '') + f4(c.sE / c.sM), 8)} ${f4(c.sAE / c.sT)} ${f4(c.mx)} ${f3(c.sE2M / c.n)}`); } } { const want = { B3: ['0.7467', '0.7903', '-0.0311', '0.0934', '0.5628', '0.627'], B4: ['0.8734', '0.8819', '-0.0089', '0.0759', '0.4792', '0.785'], B5: ['0.9054', '0.9044', '+0.0056', '0.0462', '0.2818', '0.546'], B6: ['0.9115', '0.9115', '-0.0044', '0.0401', '0.3271', '0.665'], B7: ['0.9209', '0.9268', '-0.0051', '0.0298', '0.1949', '0.578'], B8: ['0.9486', '0.9491', '-0.0012', '0.0255', '0.2054', '0.718'] }; const cs = DEPTH_STATS[uStar].cells; for (const nm of Object.keys(want)) { const c = cs[nm]; const got = [f4(c.sXoT / c.n), f4(c.sMoT / c.n), (c.sE / c.sM >= 0 ? '+' : '') + f4(c.sE / c.sM), f4(c.sAE / c.sT), f4(c.mx), f3(c.sE2M / c.n)]; for (let i = 0; i < 6; i++) assertEq(`G5 ${nm} col${i + 1}`, got[i], want[nm][i]); } let mx = 0, mxQ = 0, nOver = 0, n = 0; for (const p of DEPTH_STATS[uStar].perAnchor) { n++; if (Math.abs(p.E) / p.T > mx) { mx = Math.abs(p.E) / p.T; mxQ = p.Q; } if (Math.abs(p.E) >= p.T) nOver++; } assertEq('G5 sup at u* is 0.5628', f4(mx), '0.5628'); assertEq('G5 sup anchor is Q = 269', mxQ, 269); assertEq('G5 anchors with |E| >= T at u*', nOver, 0); assertEq('G5 anchor count at u*', n, 1206); console.log(` gate G5 PASS: sup over all ${n} anchors at u*: max |E|/T = ${f4(mx)} at Q = ${mxQ}; anchors with |E| >= T: ${nOver}`); } // =========================================================================== console.log('\nSEC 3 — NEW: THE A/B SIDE SPLIT. E = D_pair + D_marg, exactly.'); console.log(' A = a, B = a+2. NA, NB the one-sided rough counts; Xind = NA*NB/C;'); console.log(' Amain = C * P1[K] * beta(u_K) the dimension-1 main term.'); console.log(' D_pair = X - Xind (the coupling), D_marg = Xind - Xmain (the marginals).'); // =========================================================================== const SPLIT = {}; for (const u of U_DEPTHS) { const cells = {}, perAnchor = []; for (const r of rows) { const K = KatU(r, u); if (K < 3) continue; const Xm = mains(r, K).corr, X = r.X[K], NA = r.NA[K], NB = r.NB[K]; const Am = marginalMain(r, K), Bm = Am; // the two sides are exchangeable const Xind = NA * NB / r.C; const dPair = X - Xind, dMarg = Xind - Xm; perAnchor.push({ Q: r.Q, K, X, NA, NB, Xm, Xind, Am, Bm, dPair, dMarg, E: X - Xm, T: r.T, C: r.C, Ap: r.NAp[K], Bp: r.NBp[K] }); const nm = (BANDS.find(([n, a, b]) => r.Q >= a && r.Q <= b) || [null])[0]; if (!nm) continue; const c = cells[nm] || (cells[nm] = { n: 0, sX: 0, sNA: 0, sNB: 0, sXind: 0, sM: 0, sE: 0, sPair: 0, sMarg: 0, sAbsNAmd: 0, sX2: 0, sPair2: 0, sMarg2: 0, sM2: 0, sWin: 0, sRes: 0, sAt: 0 }); c.n++; c.sX += X; c.sNA += NA; c.sNB += NB; c.sXind += Xind; c.sM += Xm; c.sE += X - Xm; c.sPair += dPair; c.sMarg += dMarg; c.sAbsNAmd += Math.abs(NA - NB); c.sX2 += dPair * dPair / Math.max(Xind, 1e-9); // coupling dispersion, Poisson-referenced c.sPair2 += dPair * dPair / Math.max(Xind, 1e-9); c.sMarg2 += dMarg * dMarg / Math.max(Xm, 1e-9); c.sM2 += dMarg * dMarg / Math.max(Xm, 1e-9); c.sWin += (NA - r.NAp[K]); // NA - NA': same residues, window shifted +2 c.sRes += (r.NAp[K] - r.NBp[K]); // NA' - NB: same window, residues shifted +2 c.sAt += NA; } SPLIT[u] = { cells, perAnchor }; } for (const u of U_DEPTHS) { console.log(` --- u = ${u === uStar ? 'u* = ' + f4(uStar) : f2(u)} ---`); console.log(' band n <<|NA-NB|>/> sumDpair/sumE sumDmarg/sumE chi2_pair chi2_marg (NA-NB)/ = window + residue'); for (const [nm] of BANDS) { const c = SPLIT[u].cells[nm]; if (!c) continue; const mNA = c.sNA / c.n; console.log(` ${nm} ${pad(c.n, 4)} ${pad(c.sNA.toFixed(0), 8)} ${pad(c.sNB.toFixed(0), 8)} ${pad(f4(c.sXind / c.sNA), 9)} ${pad(f4(c.sAbsNAmd / c.sNA), 13)} ${pad((c.sPair / c.sE >= 0 ? '+' : '') + f4(c.sPair / c.sE), 10)} ${pad((c.sMarg / c.sE >= 0 ? '+' : '') + f4(c.sMarg / c.sE), 10)} ${pad(f3(c.sPair2 / c.n), 7)} ${pad(f3(c.sMarg2 / c.n), 7)} ${pad((c.sWin / c.sAt >= 0 ? '+' : '') + f5(c.sWin / c.sAt), 9)} + ${pad((c.sRes / c.sAt >= 0 ? '+' : '') + f5(c.sRes / c.sAt), 9)}`); } } // --------------------------------------------------------------------------- console.log('\nSEC 4 — THE PRE-REGISTERED READINGS AND THEIR FALSIFIERS'); // --------------------------------------------------------------------------- { // F1, AS ACTUALLY RUN, IS A MIS-SCALED INSTRUMENT AND ITS VERDICT IS NOT A FINDING. // E is the small residual of two terms that are three orders of magnitude larger, so // |sumD_pair|/|sumE| is >> 1 for arithmetic reasons and not because the coupling "carries" // the systematic. Both facts are printed, and the fix is named, rather than reading the // ratio as a verdict. for (const u of U_DEPTHS) { const c = SPLIT[u].cells.B8; console.log(` ${u === uStar ? 'u*' : 'u = 3'} B8: sumD_pair/sumXmain = ${f2(c.sPair / c.sM)}, sumD_marg/sumXmain = ${f2(c.sMarg / c.sM)}, sumE/sumXmain = ${f4(c.sE / c.sM)}`); console.log(` the pre-registered ratio |sumD_pair|/|sumE| = ${f2(Math.abs(c.sPair) / Math.abs(c.sE))}; sumD_pair is ${f4(c.sPair / c.sM)} of the main term, sumD_marg ${f4(c.sMarg / c.sM)}, and their sum E is ${f4(c.sE / c.sM)} of it, so each term is ~${f0(Math.abs(c.sPair) / Math.abs(c.sE))}x the residual it was meant to attribute.`); } console.log(' F1 NOT USABLE AS WRITTEN: the criterion assumed D_pair and D_marg would be comparable'); console.log(' to E. They are about 50x E at B8 (and their difference is E exactly), so the ratio'); console.log(' cannot come out below 0.25 however the arithmetic falls. It is a mis-scaled'); console.log(' instrument: H1 is neither confirmed nor refuted by it. Fix named in the report --'); console.log(' attribute the residual against the main-term structure, not against raw counts.'); let worst = 0, worstWhere = null; for (const u of U_DEPTHS) for (const [nm] of BANDS) { const c = SPLIT[u].cells[nm]; if (!c) continue; const r = c.sAbsNAmd / c.sNA; if (r > worst) { worst = r; worstWhere = `${nm} at ${u === uStar ? 'u*' : 'u=3'}`; } } const f2Fires = worst >= 0.01; console.log(` F2 ${f2Fires ? 'FIRES AS WRITTEN' : 'does not fire'}: worst band ABSOLUTE side-asymmetry <|NA-NB|>/ = ${f4(worst)} (${worstWhere}) against a registered limit of 0.01.`); console.log(' Reported as fired, not re-interpreted. What it is made of, measured:'); console.log(' NA - NB = (NA - NA\') + (NA\' - NB), where NA\' is NA\'s own residues in NB\'s own'); console.log(' window. W = the window-shift share, R = the residue-shift share, both /.'); for (const u of U_DEPTHS) { let line = ` ${u === uStar ? 'u* ' : 'u=3'}: `; for (const [nm] of BANDS) { const c = SPLIT[u].cells[nm]; if (!c) continue; line += `${nm} W${c.sWin / c.sAt >= 0 ? '+' : ''}${f5(c.sWin / c.sAt)} R${c.sRes / c.sAt >= 0 ? '+' : ''}${f5(c.sRes / c.sAt)} `; } console.log(line.trimEnd()); } // F3: R against the main-term expectation, both aggregate for (const u of U_DEPTHS) { let sX = 0, sXind = 0, sM = 0, n = 0, sR2 = 0; for (const p of SPLIT[u].perAnchor) { sX += p.X; sXind += p.Xind; sM += p.Xm; n++; } const R = sX / sXind, Rpred = sM / sXind; // anchor-level scatter of the ratio, for the 3-s.e. clause const rs = SPLIT[u].perAnchor.map(p => p.X / p.Xind); const mR = rs.reduce((a, b) => a + b, 0) / rs.length; sR2 = rs.reduce((a, b) => a + (b - mR) * (b - mR), 0) / (rs.length - 1); const se = Math.sqrt(sR2) / Math.sqrt(rs.length); console.log(` ${u === uStar ? 'u*' : 'u = 3'} F3: R = sumX/sumXind = ${f4(R)}; main-term prediction sumXmain/sumXind = ${f4(Rpred)}; |R - Rpred| = ${f5(Math.abs(R - Rpred))} vs 3 s.e. = ${f5(3 * se)}`); console.log(` => ${Math.abs(R - Rpred) <= 3 * se ? 'inside 3 s.e. of the main-term prediction (F3 silent)' : 'outside 3 s.e. of the main-term prediction (F3 fires: report as a finding)'}`); // SELF-CORRECTION, stated in the producer rather than left for a reader to find: // R - Rpred = (sumX - sumXmain)/sumXind = (sumE/sumXmain) * Rpred, so this is ALGEBRAICALLY // the already-measured systematic rescaled. It is a consistency identity, NOT independent // evidence, and no claim rests on it. const sysB8 = SPLIT[u].cells.B8.sE / SPLIT[u].cells.B8.sM; console.log(` identity check: (sumE/sumXmain at B8)*Rpred = ${f5(sysB8 * Rpred)} equals R - Rpred = ${f5(R - Rpred)} -- so this line carries the SAME information as SEC 2's systematic column and is NOT independent evidence.`); } } console.log('\nSEC 5 — SCOPE. Q <= 10007, two decades, range summary; no asymptotic claim, no bound'); console.log(' on X, no TPC claim, nothing on the certificate. The capture identity is not used and'); console.log(' not needed. Nothing here is PROVEN about the arithmetic.'); console.log(failures === 0 ? '\nALL ASSERTIONS PASS' : `\nFAILURES: ${failures}`); if (failures > 0) process.exitCode = 1; const t1 = Date.now(); console.error(`[stderr] elapsed ${((t1 - T0) / 1000).toFixed(1)}s`);