// Separate verification implementation: sieve the base; branch on an uncovered // slot and its possible killing prime. No producer or producer code is imported. const fs=require('node:fs'),assert=require('node:assert/strict'); const cpu=process.cpuUsage(); const cert=JSON.parse(fs.readFileSync(process.argv[2]||'doubling-certificate.json','utf8')); assert.deepEqual(cert.cases.map(c=>c.top),[37,43]); const ps=[];for(let n=2;n<=43;n++)if(!ps.some(p=>n%p===0))ps.push(n); assert.equal(cert.base,19);const old=ps.filter(p=>p<=cert.base),W=old.reduce((a,b)=>a*b,1); assert.equal(W,cert.W);const bad=new Uint8Array(W); for(const p of old){for(let n=0;na[((i%D)+D)%D]+Math.floor(i/D)*W; function span(m){let best=0;for(let i=0;ip>cert.base&&p<=c.top),m=c.K+1; assert(m<=28&&m>1);assert.equal(c.lower.positions.length,c.K); const start=c.lower.start;assert(start>=0&&starty%BigInt(p)!==0n&&(y+2n)%BigInt(p)!==0n)); assert(Q.some(p=>y%BigInt(p)===0n||(y+2n)%BigInt(p)===0n),'lower witness must be killed'); } for(const x of [previous,next]){const y=BigInt(x)+shift;assert(Q.every(p=>y%BigInt(p)!==0n&&(y+2n)%BigInt(p)!==0n),'adjacent old slot must survive');} let nodes=0,root_pruned=0,root_searched=0; const full=2**m-1,fullPrimes=2**Q.length-1; const count=x=>{let n=0;while(x){x&=x-1;n++;}return n;}; for(let i=0;iat(i+j)); // Construct every residue choice directly. Keep duplicates and subsets. const masks=Q.map(q=>Array.from({length:q},(_,r)=>{ let mask=0;for(let j=0;j