#!/usr/bin/env node // Standalone log-binned split of the dominant mix2a cell (job #4472). // // Derived from the served producer research/history/staging/attack-0830-varE-identification.js // (code-sha256 85e05f41440e21f327b457191660e2a2d8ecfc15a2fecb7fc45f6cac2e7893b3), // PART G. Same objects, same weights, same identity COUNT - MAIN = REM; only // the binning of the small part d = min(n0, e) is finer, at fixed absolute // thresholds, because the three range-restricted inputs the record prices the // cell against are located at d = L^delta (DFI97), d = (2L)^(1/3) (Harper // arXiv:2412.19644v1 Thm 1) and d = L^(2/5) (the cell's own balance bound). // // node attack0830_dlog.js > dlog_raw.txt 'use strict'; function assert(c,m){ if(!c) throw new Error('ASSERT FAIL: '+m); } function primesUpTo(n){const s=new Uint8Array(n+1),o=[];for(let i=2;i<=n;i++){if(!s[i]){o.push(i);for(let j=i*i;j<=n;j+=i)s[j]=1}}return o} function invN(a,p){a=((a%p)+p)%p;let r0=p,r1=a,s0=0,s1=1;while(r1){const q=Math.floor(r0/r1);[r0,r1]=[r1,r0-q*r1];[s0,s1]=[s1,s0-q*s1];}assert(r0===1,'invN');return ((s0%p)+p)%p;} function inv6(p){return invN(6,p)} class Kah{constructor(){this.s=0;this.c=0}add(v){const y=v-this.c,t=this.s+y;this.c=(t-this.s)-y;this.s=t}get(){return this.s}} const f6=v=>v.toFixed(6), f4=v=>v.toFixed(4), f3=v=>v.toFixed(3); const pad=(s,n)=>String(s).padStart(n); // thresholds in absolute value of d = min(n0, e); the smallest eligible d is 7. // The three range thresholds of the record (DFI97's L^delta, Harper's (2L)^(1/3), // the cell's own balance bound L^(2/5)) are inserted exactly, per level, so the // cumulative shares are exact at them. const BASE=[10,30,100,300,1000,3000,10000,30000]; const mkTh=(L)=>{const s=new Set(BASE.map(v=>v.toFixed(6))); for(const v of [Math.pow(L,1/3),Math.pow(2*L,1/3),Math.pow(L,2/5)]) s.add(v.toFixed(6)); return Array.from(s).map(Number).sort((a,b)=>a-b);}; const LV=[{x:17,L:510510},{x:19,L:9699690},{x:23,L:223092870}]; console.log('=== mix2a cell (n0 | h, e | h +- 2, n = n0 e <= 2L) binned on d = min(n0, e) ==='); console.log(' L = x#, y = largest prime <= sqrt(L); bin edges = {10,30,100,300,1000,3000,10000,30000}'); console.log(' plus the exact L^(1/3), (2L)^(1/3), L^(2/5) of that level.'); console.log(' x | bin | COUNT | MAIN | REM | del*REM | share'); const ALL=[]; for(const lv of LV){ const {x,L}=lv, K=L/6; const TH=mkTh(L), NB=TH.length+1; const BN=TH.map(t=>'d<'+f3(t)).concat(['d>='+f3(TH[TH.length-1])]); const binOf=v=>{let i=0;while(i