Keep route-server networks on the route server (#265)

With an Open policy and the route server on, the peering desk still picked
networks the route server already reached and stored them as bilateral
sessions. It now skips a request from a network ixSessions() already has,
after drawing its random numbers, so the desk's draws stay as they were.

The changed peer list still moves seeded games a little: the Mid-Atlantic
scenario's floor goes from day 40 to 30 (main wins on days 34-58 across
seeds), and the past week 2026-W44 is regenerated as rev 3.
This commit is contained in:
Frederic Jung 2026-11-03 06:47:06 +00:00
parent da1a4e2f3c
commit 3e57b41e13
5 changed files with 29 additions and 2 deletions

View file

@ -6,6 +6,7 @@ All notable changes to this project are documented here. The project follows
## [Unreleased]
- Networks you reach through an exchange's route server now stay "via RS" (#265). With an Open peering policy, the peering desk used to turn some of them into separate sessions of their own.
- The Build POP button now shows the whole price of a new POP, including the routers of your standard POP (#261). Before, it showed only the site, although the standard routers were paid for on top; a note under the button now lists them, and the intern's one-tap template prices them in as well. POPs that come with a new wave, dark fiber, your own subsea cable or a consortium seat now get the standard routers too, and those offers show the price with them.
## [2.5.0] — 2026-11-02

View file

@ -1 +1 @@
{"v":1,"key":"2026-W44","rev":2,"theme":"flood","city":"sto","cash":2050000,"days":250,"lvl":4,"rules":{"ddos":true},"mods":[],"goal":{"t":"floods","p":{"n":32,"big":5}},"name":{"l":"wkscn.name_packet_monsoon","p":{}},"desc":{"l":"wkscn.desc_city_hosts_the_internets_favourite","p":{"city":"sto"}},"seed":1559294845,"par":214,"ref":{"home":"sto","bb":true,"ix":true,"steps":[{"k":"hop","v":["sto","tll",1,null]},{"k":"hop","v":["tll","hel",1,null]}],"avoid":[],"tr2":false,"scrub":2}}
{"v":1,"key":"2026-W44","rev":3,"theme":"flood","city":"sto","cash":2050000,"days":250,"lvl":4,"rules":{"ddos":true},"mods":[],"goal":{"t":"floods","p":{"n":28,"big":5}},"name":{"l":"wkscn.name_packet_monsoon","p":{}},"desc":{"l":"wkscn.desc_city_hosts_the_internets_favourite","p":{"city":"sto"}},"seed":1559294845,"par":198,"ref":{"home":"sto","bb":true,"ix":true,"steps":[{"k":"hop","v":["sto","tll",1,null]},{"k":"hop","v":["tll","hel",1,null]}],"avoid":[],"tr2":false,"scrub":2}}

View file

@ -17,6 +17,8 @@ function peeringDeskDay(d){const w=Math.floor(d/7);let D=S.pdesk;
if(!ixs.length||Math.random()>=Math.min(0.9,0.15*ixs.length)*PDESK_ASK[p])return;
const c=pick(ixs),real=ixMembers(c).filter(id=>{const n=NET[id];return !S.peers[id+'@'+c]&&!merged(id)&&n.type!=='t1'&&n.type!=='cdn'&&n.pol!=='paid'&&n.share<=0.006;});
const net=real.length&&Math.random()<0.4?pick(real):null,fresh=Math.random()>=0.6;
// A network you already reach (route server, your own exchange) needs no session of its own (#265).
if(net&&ixSessions(c).has(net))return;
if(!pdeskWant(p,net,fresh)){D.d++;return;}
if(net)S.peers[net+'@'+c]=true;D.a++;if(!D.ix.includes(c)&&D.ix.length<PDESK_IX)D.ix.push(c);}
// "Peering desk: 7 new sessions at DE-KICKS and LINX, 3 declined (Selective)."

View file

@ -0,0 +1,23 @@
const test = require('node:test');
const assert = require('node:assert/strict');
const { load } = require('./harness');
// #265: with the route server on and an Open policy, the peering desk must not turn
// networks you already reach through the route server into bilateral sessions.
test('#265 peering desk leaves route-server networks on the route server', () => {
const { ev, errors } = load();
ev("ACT.start({});S.cash=1e9;S.lvl=6;S.nextFail=S.nextEvent=1e9;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'});ACT.buildPop({city:'ams'});S.pops.ams.rgen=3;ACT.buyIx({city:'ams',tier:1});ACT.rs({city:'ams'});compute()");
assert.equal(ev('ppol()'), 'open');
const viaRs = JSON.parse(ev("JSON.stringify(ixMembers('ams').filter(id=>NET[id].pol==='open'&&ixSessions('ams').has(id)&&!S.peers[id+'@ams']))"));
assert.ok(viaRs.length > 0, 'some networks are reached through the route server');
// Every day: someone asks, at this IX, a real network, each candidate in turn, fresh PeeringDB.
for (let i = 0; i < 60; i++) {
ev(`(()=>{const q=[0.01,0.01,0.01,${i / 60},0.9];Math.random=()=>q.length?q.shift():0.5;})()`);
ev(`peeringDeskDay(S.day+${i})`);
}
const made = JSON.parse(ev(`JSON.stringify(${JSON.stringify(viaRs)}.filter(id=>S.peers[id+'@ams']))`));
assert.deepEqual(made, [], 'route-server networks stay "via RS"');
const bilateral = JSON.parse(ev("JSON.stringify(Object.keys(S.peers).filter(k=>k.endsWith('@ams')))"));
assert.ok(bilateral.length > 0, 'networks the route server does not reach still get their own sessions');
assert.deepEqual(errors, []);
});

View file

@ -41,8 +41,9 @@ const PLAY = {
// The 1.6T chains: grow the traffic first, then light every hop at once (a day-0 build also gets there, just).
pac: { ref: [...home('hnl'), ...home('lax'), ...home('syd'), ['link', 'lax', 'tok', 1, 'jup'], HIRE, ['served', 145], ['link', 'lax', 'hnl', 4, 'seaus'], ['link', 'hnl', 'suv', 4, 'scx'], ['link', 'suv', 'syd', 4, 'scx']],
win: [50, 120], cheese: [...home('hnl'), ...home('lax'), ...home('syd'), ['link', 'lax', 'tok', 1, 'jup'], ['link', 'lax', 'syd', 3, 'hwk'], ['loans']], by: null },
// The win day swings with the seed (34 to 58 over five seeds in 2.5.0), so the floor sits below that spread.
atl: { ref: [['bb', 'pdl'], ['tr', 'pdl', 1], ...home('mia'), ...home('mad'), ...home('lis'), HIRE, ['link', 'mia', 'bda', 4, 'sol'], ['link', 'bda', 'pdl', 4, 'sol'], ['link', 'pdl', 'mad', 4, 'sol'], ['served', 90], ['link', 'lis', 'tci', 4, 'ace'], ['link', 'tci', 'lag', 4, 'twoaf'], ['bb', 'lag']],
win: [40, 120], cheese: [['bb', 'pdl'], ['tr', 'pdl', 1], ...home('mia'), ...home('mad'), ...home('lis'), ['link', 'mia', 'mad', 3, 'col3'], ['link', 'lis', 'lag', 3, 'equi'], ['loans']], by: null },
win: [30, 120], cheese: [['bb', 'pdl'], ['tr', 'pdl', 1], ...home('mia'), ...home('mad'), ...home('lis'), ['link', 'mia', 'mad', 3, 'col3'], ['link', 'lis', 'lag', 3, 'equi'], ['loans']], by: null },
};
test('C1 played: every scenario has a reference strategy and a shortcut that fails', () => {