Prefer keeps the say at its own POP only, and the direct ranks stop slowing the game day

Review of #205:

- Prefer no longer switches the carrier-direct rule off for the whole network.
  A POP with a Prefer-marked transit port keeps what Prefer says; every other
  POP keeps the rule. compute(), traceroute and the reference loop in the tests
  all use the same per-POP rule, and a new test covers it (New York and Chicago,
  Prefer on one POP's Tell-Ya port).
- dayTick() cost. The harness is neutral (the same page on both sides differs by
  1%), but the cost was real: the four extra rank passes inside compute()'s main
  loop made V8 deoptimise compute() 954 times in 30 game days against 46 on main.
  The direct ranks now run in a small function of their own, in the plain way the
  reference loop does (their lists are one carrier's ports), so the main loop is
  the one main has, and the setup moved out of compute(). 61 deopts instead of 954.
- Italian: "Porta qui" read as "port here" next to "Porta più vicina"; it is
  "Instrada qui" now, and "Ogni POP instrada il traffico..." matches.
- Help text: says that real BGP carries the traffic from every POP (the shorter
  AS path beats IGP distance), that Carry here does that here, and that Nearest
  port is the default. All six languages.
This commit is contained in:
Christopher Hawker 2026-11-01 20:07:23 +11:00
parent b8845413d3
commit eb78d7104e
14 changed files with 77 additions and 23 deletions

View file

@ -39,6 +39,8 @@ test('indexed routing matches the simple allocation loop across network changes'
"S.transit.filter(t=>t.net==='lvl').forEach((t,i)=>{if(i%2===0)t.carry=true})",
"S.transit.filter(t=>t.net==='tly').forEach(t=>{t.carry=true})",
"S.transit.filter(t=>t.net==='lvl').forEach((t,i)=>{t.pref=i%2?'low':'normal'})",
// Prefer keeps the say at its own POP: the POPs with a Prefer-marked port skip the carrier-direct rule, the others keep it.
"S.transit.forEach((t,i)=>{if(t.net!=='lvl')t.pref=i%3===0?'high':'normal'})",
"S.pni.forEach((p,i)=>p.pref=i%3===0?'high':i%3===1?'low':'normal')",
"S.te={on:true,script:''};S.core={lv:2,run:2,legacy:true}",
"S.te.script='prefer pni for goggle\\nspill at 80%\\navoid transit for netchill'",