// Targeted fixture for the three-fold branch newly used at fold41. No workers. // Extract the submitted engine and iterator unchanged except R=8, allowing // small blocks. Production uses R=256; observed qualifying runs have length3. const fs=require('fs'),vm=require('vm'),assert=require('assert'),crypto=require('crypto'); const source=fs.readFileSync(__dirname+'/evidence/job67-transport-parallel.js','utf8'); assert.equal(crypto.createHash('sha256').update(source).digest('hex'),'dedb112923e0baab0cd0825b4153651be2b230f8ebb607bd86ce5591dc11db7b'); const prefix=source.slice(0,source.indexOf('// WORKER\n')); const merge=source.slice(source.indexOf('function mergeInto('),source.indexOf('function runJob(')); const fixture=prefix.replace('const R = 256;','const R = 8;')+merge+'\nglobalThis.api={buildBase,prepJob,doBlock,mergeInto};'; const context={require,console};vm.runInNewContext(fixture,context); const {buildBase,prepJob,doBlock,mergeInto}=context.api; const base=buildBase(7); const job=prepJob({base:7,baseD:base.S.length,baseW:base.W,F:[11,13,17],q:19}); const RES=job.F.map(f=>Uint8Array.from(base.S,s=>s%f)),RQ=Uint8Array.from(base.S,s=>s%job.q); const merged={};for(let b=0;b(i+1=2){ const c=g[(i+L-1)%g.length]%q; if(c!==0&&c!==2&&c!==q-2)break; if(c!==0){if(c===last)legal=false;last=c;} } sum+=g[(i+L)%g.length];hLoose[sum/6]++;if(legal)hAlt[sum/6]++; } } for(let i=0;i R8; no worker spawned.'); console.log(`Three-fold stream [11,13,17] from T7, q19: ${job.NB} blocks, Dold=${merged.dold}, Dnew=${next.S.length}.`); console.log('All old/new gap histogram buckets match direct stored tiles.'); console.log('All loose/refined window-sum buckets match independent cyclic-word enumeration.'); console.log(`Max qualifying run=${merged.maxQrun}, L=${merged.L}, Mloose=${merged.Mloose}, Malt=${merged.Malt}; overflow0, unclosed0.`); console.log('All assertions PASS. This is a small serial port check, not a repeat of fold41.');