From b6c2fe677bb4208c165bec7b6701162ecb504c27 Mon Sep 17 00:00:00 2001 From: Frederic Jung Date: Sun, 1 Nov 2026 15:34:42 +0100 Subject: [PATCH] Speed test: switch off the routing shortcuts in their new spelling (flows are columns now) --- tests/speed.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/speed.test.js b/tests/speed.test.js index 2b03e05..b3ac6f4 100644 --- a/tests/speed.test.js +++ b/tests/speed.test.js @@ -272,17 +272,17 @@ test('the map is not drawn while the dashboard covers the whole screen', () => { function plainCompute(ev) { const src = ev('compute.toString()'); let plain = src - .replace('if(!lst.hi&&ALONE[f.ci])', 'if(false)') + .replace('if(!lst.hi&&ALONE[fci])', 'if(false)') .replace('if(!G.length){\n // One scan', 'if(false){\n // One scan') - .replace('for(const n of e.nets||NET_IDS)', 'for(const n of NET_IDS)') + .replace('const ns=e.nets||NET_IDS;', 'const ns=NET_IDS;') .replace('if(P.dead)return 0;', '').replaceAll('if(r<=1e-6){P.dead=1;return 0;}', '') .replace('if(!P.dead)room-=push(', 'room-=push(').replace(/const gone=e=>\{[^\n]*\};/, 'const gone=e=>false;'); // ...and the group split and sorting written the plain way, with array copies, as before they were made allocation-free const sg = plain.indexOf('const ROOM=[],sendGroup='), sd = plain.indexOf('const sortD='); assert.ok(sg > 0 && sd > sg, 'found the group sender and the sort'); plain = plain.slice(0, sg) + `const ROOM=[],sendGroup=(g0,i0=0,i1=g0.length)=>{const g=g0.slice(i0,i1);for(const e of g)e.vis=vis; - if(g.length>1){const room=g.map(e=>Math.max(0,e.cap-e.used)),tot=room.reduce((a,b)=>a+b,0),want=f.rem;if(tot>1e-6)g.forEach((e,k)=>send(e,want*room[k]/tot));} - for(const e of g){if(f.rem<=1e-6)break;send(e,f.rem);}};\n ` + plain.slice(sd).replace(/^const sortD=a=>\{[^\n]*\};/, 'const sortD=a=>a.sort(byDist);'); + if(g.length>1){const room=g.map(e=>Math.max(0,e.cap-e.used)),tot=room.reduce((a,b)=>a+b,0),want=FREM[F];if(tot>1e-6)g.forEach((e,k)=>send(e,want*room[k]/tot));} + for(const e of g){if(FREM[F]<=1e-6)break;send(e,FREM[F]);}};\n ` + plain.slice(sd).replace(/^const sortD=a=>\{[^\n]*\};/, 'const sortD=a=>a.sort(byDist);'); for (const [a, b] of [[src, plain]]) assert.notEqual(a, b); assert.equal((plain.match(/if\(false\)/g) || []).length, 2, 'both shortcuts were found and switched off'); assert.ok(!plain.includes('e.nets||NET_IDS'), 'the exit index was switched off');