From 928d6f01114d930035405fe0fb110ce33d3b2d2f Mon Sep 17 00:00:00 2001 From: Frederic Jung Date: Sat, 31 Oct 2026 07:10:27 +0100 Subject: [PATCH] Routing reference skips exits behind a full path too; #210 test checks the answer; CHANGELOG for players The reference loop now states the rule #225 adds to compute(): without Auto-TE an exit whose shortest path is already full fits nothing, like a full exit. With the same rule both match bit for bit; before, only float rounding differed (at most 3.6e-14 relative), because the ECMP split no longer counts a dead exit's room. --- CHANGELOG.md | 2 +- tests/helpers/reference-allocation.js | 4 +++- tests/issues.test.js | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5de6d5..02b2278 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to this project are documented here. The project follows ## [Unreleased] -- Saturated shortest paths are skipped during the candidate exit scan and usable exit filtering, preventing routing freezes on congested networks (#210). +- Big networks freeze for less on every game day and every click: working out where traffic goes skips exits whose route is already full, so a game day takes about 40% less time (#210). Traffic goes exactly where it went before. - Premium submarine terminals and Optical engineering can no longer be bought on a cable where they would change nothing (#198). The button now says so, and an upgrade that only helps together with the other one stays available. - A wave size that is sold out on a route can no longer be reached by upgrading a smaller wave on it (#201). The upgrade button says how long it is sold out, just like when buying. - Choosing Both for a PNI with one member now really splits it: the second member arrives in the other building when the augment lands, instead of joining the first (#219). diff --git a/tests/helpers/reference-allocation.js b/tests/helpers/reference-allocation.js index a69d199..f9e4e70 100644 --- a/tests/helpers/reference-allocation.js +++ b/tests/helpers/reference-allocation.js @@ -1,12 +1,14 @@ // Deliberately scan all exits for every flow, without byRank, local-city // shortcuts or first-group selection. Stable sorting preserves E order on ties. +// Without Auto-TE, an exit whose shortest path from this POP is already full fits nothing, so it counts as +// unusable, like a full exit (#210). module.exports = ` for(const pass of PASSES||[null])for(const rank of RANKS){ for(f of flows){ if(f.rem<=1e-6||(rank===0&&!f.cache)||(pass&&!pass(f)))continue; Dv=SDi[f.ci];Pv=SPi[f.ci];PP=walked[f.ci]||(walked[f.ci]=[]);vis++; const candidates=E.filter(e=>e.used(a.pref==='high'?0:1)-(b.pref==='high'?0:1)||Dv[CIDX[a.city]]-Dv[CIDX[b.city]]); for(let i=0;i1e-6;){ let j=i+1;while(j= 10 - 1e-6"), 'intercity wave is saturated'); + assert.ok(ev("R.load['x1'] <= 10 + 1e-6"), 'and carries no more than it can'); + // Skipping exits behind the full wave changes nothing: routing again gives the same answer. + const first = ev('JSON.stringify([R.served,R.citySrv,R.load])'); ev("compute();"); + assert.equal(ev('JSON.stringify([R.served,R.citySrv,R.load])'), first); assert.deepEqual(errors, []); });