#!/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=TH[i])i++;return i;}; const allp=primesUpTo(Math.floor(Math.sqrt(L))+1); let y=2; for(const p of allp) if(p*p<=L) y=p; let delta=1; for(const p of primesUpTo(y)){const a=(p===2||p===3)?1:(p===5?2:p-2); delta*=a/p;} const ps=primesUpTo(y).filter(p=>p>=7), np=ps.length; let D=1; for(const p of ps) D*=p*(p-4)/((p-2)*(p-2)); const lam0=ps.map(p=>2/(p-4)), lam1=ps.map(p=>1/(p-4)); const cnt=[new Int32Array(K),new Int32Array(K),new Int32Array(K)]; const starts=(p)=>{const i6=inv6(p);return [p,(2*i6)%p||p,((p-2)*i6)%p||p];}; for(let i=0;i{const a=off[j][k],b=off[j][k+1];const out=[[1,1]]; for(let q=a;qs[0]>1); for(const j of [1,2]){const SE=subs(j,k).filter(s=>s[0]>1); for(const [a0,w0] of S0) for(const [ae,we] of SE){const n=a0*ae;if(n>2*L)continue;CU[binOf(Math.min(a0,ae))].add(base*w0*we);}} } (function desc(i,n0,e,w){ if(n0>1&&e>1){MU[binOf(Math.min(n0,e))].add(2*L*D*w/(n0*e));} for(let j=i;j2*L)break;desc(j+1,n0*p,e,w*lam0[j]);desc(j+1,n0,e*p,w*lam1[j]);} })(0,1,1,1); let tot=0; const rem=[]; for(let b=0;b{let s=0;for(let b=0;b'd<'+t+': '+f4(cum[i]/tot)).join(' ')+ ' all: '+f4(cum[NB-1]/tot)); ALL.push({x,L,y,delta,tot,rem,bins:BN,TH,cum}); } console.log('\n => the small part d carries the cell; its mass sits well below every fixed power L^delta'); console.log(' for delta of the size the printed short-factor bounds need, and below (2L)^(1/3).');