Commit graph

792 commits

Author SHA1 Message Date
Frederic Jung
15dc5741d4
Mostly a performance release: half the routing CPU, no freezes, instant clicks; real calendar, right-sized caches (2.5.0) 2026-11-02 07:39:18 +01:00
Frederic Jung
295908f859
Cache boxes sized by the city's own traffic split: Russia, China and Korea use their network lists, no box without local traffic (closes #260) 2026-11-02 07:36:17 +01:00
Frederic Jung
add3d67e48
Merge perf/6-routing-design: routing keeps its structural tables and runs as small functions, about half the CPU, identical results (347 fuzzed games)
# Conflicts:
#	CHANGELOG.md
2026-11-01 21:57:08 +01:00
Frederic Jung
640b65ce9a
Differential random games: main's page and this checkout's play the same seeded game move for move
scripts/route-fuzz.js plays many random games (every mode: presets, sandbox, scenarios,
the weekly, puzzles, architect runs, or a save) on two pages in one process and compares
all of R, R.fl, R.ef, the PNI lists and S after every move and every day, and routing with
the kept tables against routing without them. tests/route-fuzz.test.js plays four.
2026-11-01 21:44:30 +01:00
Frederic Jung
8b0c624b21
Merge remote-tracking branch 'origin/main' into perf/6-routing-design 2026-11-01 19:42:12 +01:00
Frederic Jung
204af83bff
Merge origin/main 2026-11-01 19:27:10 +01:00
Frederic Jung
0dad03727f
Merge #254: a plug-in optic too short for a subsea cable is no longer sent to upgrades that cannot stretch it (closes #253)
# Conflicts:
#	CHANGELOG.md
2026-11-01 19:27:10 +01:00
Frederic Jung
d93d598d01
Tests count calendar months, not 30 days (#257) 2026-11-01 19:27:01 +01:00
Frederic Jung
37def9dd6b
The game as a local MCP server: play, inspect and debug it from an AI client
scripts/mcp.js speaks MCP over stdio and loads the game from src/ in jsdom,
seeded, like the tests. Tools: new_game, load_save, export_save, status,
advance (with per-day timings), network, city, find, traceroute,
peering_check, hot_spots, actions, act, screen, panel, click, open_link.
Actions go through ACT as buttons do; files, slots, settings and the clock
stay out of reach, and nothing evaluates code in the page. Nothing is
hosted and the page is unchanged. See docs/MCP.md.
2026-11-01 18:04:22 +00:00
Frederic Jung
2122db8cc4
Architecture notes on the kept routing tables and compute()'s small functions; CHANGELOG 2026-11-01 19:04:18 +01:00
Frederic Jung
85e62f6392
Routing adds up per-kind traffic in typed arrays and keeps its group array's storage: half the allocation per compute
R.egT and R.netEg were summed by key in push(), which boxes every new value; they are now Float64Array sums written
back after routing, in the same order and key order. The first group G was emptied with length=0 for every flow,
which gives back its storage so the next push allocates it again; it is now G[0..GN). 27.5 MB -> 13.5 MB per compute.
2026-11-01 19:04:17 +01:00
Frederic Jung
a428ed817f
Routing keeps its structural tables between calls and runs its hot loops as small functions, identical results
compute() was one 33 KB function that V8 never kept optimised: it ran in baseline code, boxing every number,
and was recompiled in the background (about a second of compile each time on a loaded machine) only to deopt.
Its stages now run as closures of their own (compute's own bytecode: 7.7 KB) and the money is computeMoney().
The shortest paths and the exit lists (okBy, reach, BRJ/LIST, DSEL) are kept between calls under keys built
from everything they depend on (29-route-cache.js). Exits and paths have one object shape each.
The equivalence tests compare cached against uncached routing; tests/route-cache.test.js checks the keys.
2026-11-01 19:04:17 +01:00
Frederic Jung
3501a642a2
A real calendar: months of 28 to 31 days and leap years; monthly prices, loans, the intern budget and conferences follow it (#257) 2026-11-01 19:02:06 +01:00
Frederic Jung
25a43e22df
A 1.6T transponder takes two ports on 800G routers, one per 800G client (#256) 2026-11-01 19:02:06 +01:00
Frederic Jung
935c08839f
Clicks that change nothing routing reads keep their routing (loans do reroute); CHANGELOG corrected 2026-11-01 18:36:52 +01:00
Frederic Jung
de9b56befe
Puzzle speed test: time the fastest of 7 evaluations, so a busy CI runner cannot fail it 2026-11-01 18:09:52 +01:00
Frederic Jung
167e2a715b
Merge perf/3-worker: each day's routing runs in a Web Worker built from the page's own script, identical results 2026-11-01 16:52:07 +01:00
Frederic Jung
fde4279633
M3: the day's rule checks now live in its two halves, dayPre() and dayPost() 2026-11-01 16:39:35 +01:00
Frederic Jung
18db953818
Merge remote-tracking branch 'origin/main' into perf/3-worker
# Conflicts:
#	src/game/80-simulation/30-compute.js
2026-11-01 16:14:07 +01:00
Frederic Jung
bc5539c632
Merge perf/2-typed-arrays: routing loop on typed arrays, identical results 2026-11-01 15:43:25 +01:00
Frederic Jung
b6c2fe677b
Speed test: switch off the routing shortcuts in their new spelling (flows are columns now) 2026-11-01 15:34:42 +01:00
Frederic Jung
9bdc2b70e1
Prototype: route each game day in a Web Worker built from the page's own script
The day is split around its routing (dayPre, compute, dayPost). In play, S goes to a
worker started from a Blob URL of the page's inline game script (nothing fetched), the
day waits for R and finishes when it arrives. Actions, failures, events and the intern
still route synchronously; an action mid-day wins over the worker's stale answer.
R crosses as plain data: R.ef as its raw arrays (transferred), flows as columns.
Tests and any worker failure keep the synchronous path.
2026-11-01 15:04:45 +01:00
Frederic Jung
88c37d1b48
Routing loop: gather flows in reused scratch columns, and walk paths and exit lists with index loops
Fewer short-lived objects per compute: no array growth while gathering flows
(copied into each result's own columns), no iterator results in push or in
the exits-by-network setup, and R.efg reads the edge sums in place. Results
are identical to main.
2026-11-01 14:52:36 +01:00
Frederic Jung
0eba165bed
Cable ships, two new Tier 1s, shared cache ports, standard POPs and a faster big network (2.4.0) 2026-11-01 13:32:07 +00:00
Frederic Jung
89fc8b8d03
Routing loop: keep flows in typed-array columns instead of objects, and add up link and transit totals without boxing numbers
Flows are packed into Float64Array/Int32Array columns; R.fl builds the old
objects only when read. Edge egress sums keep a slot per egress in a plain
array, and R.tNet is added up in a typed array and written out at the end,
in the same key order. Results are identical to main.
2026-11-01 14:27:45 +01:00
Frederic Jung
0355eb4e38
Routing loop: set up a flow's city tables only once it has exits at the rank; drop the per-rank flow rebuild that cost more than it saved 2026-11-01 14:09:17 +01:00
Frederic Jung
dd10a6c19c
Faster routing and map: finished flows leave the rank loop, flows keep their exit table, lazy exit labels, off-screen links culled by box 2026-11-01 13:51:25 +01:00
Frederic Jung
fda5607238
Doitsche Telekomm and Tangerine Telecom are Tier 1s (#194)
Both are typed t1 and count for the Tier 1 goal in new games only (t1v 4);
older saves keep the Tier 1s they were playing for. Doitsche sells transit
at 12/Gbps, the dearest in Europe outside the China crossing, and keeps its
paid peering and 1G PNIs. Tangerine keeps its selective policy, sells at 6,
and gains a Frankfurt PoP like every other Tier 1.

W2 now counts Tier 1 incumbents with home markets; the N3 exceptions for
both are gone, since Tier 1s are not checked there.
2026-11-01 12:23:33 +00:00
thesysadmindev
54f40221d5
Merge branch 'main' into sea-optic-hint 2026-11-01 23:11:36 +11:00
Frederic Jung
19b546f5ab
Damaged saves are retried by the next version and have a Try again button; imports up to 64 MB 2026-11-01 13:08:43 +01:00
Frederic Jung
597cc40aef
Faster Networks tab and map labels: count connections without building them, cache exchange lists, grid label check 2026-11-01 13:08:43 +01:00
Frederic Jung
5e27f9e787
Cable ships a tad smaller on the map 2026-11-01 12:07:24 +00:00
Christopher Hawker
0bf27a66c7 A plug-in optic too short for a subsea cable is no longer sent to upgrades that cannot stretch it (closes #253)
On an own subsea cable, the hint under an optic that cannot reach the route
said "Consider submarine terminals or optical engineering" for every optic.
Those upgrades only lengthen the Sienna WaveMagic 1.6T and 3.2T transponder
modes (optModes()); the 400ZR+ and 800ZR+ plug-ins gain nothing, also with
both upgrades in service. Perth to Cape Town (8,891 km) showed it: 800ZR+
reaches 5,400 km and the advice was to buy $17M of upgrades that change
nothing.

chWhy() now asks whether the optic would reach with both upgrades in service
(withSubUps()). If so, the advice stays. If not, the hint says the upgrades do
not stretch this optic and names the optics that do reach the route. A
consortium seat and a leased line keep their own message.
2026-11-01 23:03:47 +11:00
Frederic Jung
66aaaec5f1
A waiting subsea cut offers a charter only when it beats waiting for the club's first ship home 2026-11-01 11:52:42 +00:00
Frederic Jung
620253b57b
Cable ships a size bigger on the map; a ship at work sits just off the cut marker 2026-11-01 11:48:42 +00:00
Frederic Jung
a77eef8ce7
Own cables are laid by the lay fleet, never by a repair ship: one list of lay ship names, the one in the toast lays the cable 2026-11-01 11:46:37 +00:00
Frederic Jung
96e2c2f537
Cable ships: club repair ships sail out to subsea cuts, private charters jump the queue, lay ships build your cables
A subsea cut sends the nearest free ship of its region's maintenance club from its port, along the cable routes at about 500 km a day; the cut lasts while it sails, waits for permits in slow countries and splices (3-5 days shallow, 6-12 deep). Ships stay busy until home (S.fleet). With the club's ships all out the cut waits; a private charter of the quickest free ship costs $1M + $200/km sailed. Own subsea builds show survey/factory, then a lay ship at 150 km/day; a second lay ship can be booked before laying ($3M + $150k/day saved), and crews no longer speed up cables at sea. Ships are drawn on the map and can be tapped.
2026-11-01 11:24:53 +00:00
Frederic Jung
1fa5566d66
Connections overview prices 400G cache boxes right; tests pin 100G boxes where they mean them 2026-11-01 12:06:20 +01:00
Frederic Jung
7202441716
400G cache boxes behind 400G or faster router ports 2026-11-01 11:37:34 +01:00
Frederic Jung
6b8791c605
Bulk PNI test fills the ports now that caches share them (#252) 2026-11-01 11:32:29 +01:00
Frederic Jung
533532ba32
A standard POP: new POPs get the standard router model and count at once (closes #240) 2026-11-01 11:32:29 +01:00
Frederic Jung
5d7b626519
Clarovision peers only over paid PNIs (closes #213) 2026-11-01 11:32:28 +01:00
Frederic Jung
999aaca0e8
Cache boxes share router ports: as many 100G boxes per port as its speed holds (closes #252) 2026-11-01 11:32:28 +01:00
Frederic Jung
38fdf9b4d8
Subsea hurry costs a cable ship: charters for builds, the repair-ship queue for cuts
Speeding up an own subsea cable charters another cable ship ($3M plus $500/km per 30 days saved), and a rush repair on a subsea cut costs $1M plus $200/km. Land crews and trench repairs keep their prices.
2026-11-01 10:25:32 +00:00
Frederic Jung
bd6ba6bfd7
Merge #205: A carrier's own transit port takes its traffic, with a Carry here switch for other POPs
Thanks to thesysadmindev.
2026-11-01 09:32:28 +00:00
Frederic Jung
31e1951376
CHANGELOG: the link-focus bullet from #250 goes under Unreleased, not 2.3.0 2026-11-01 09:19:24 +00:00
Christopher Hawker
eb78d7104e 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.
2026-11-01 20:07:23 +11:00
thesysadmindev
b8845413d3
Merge branch 'main' into own-carrier-egress 2026-11-01 19:10:37 +11:00
Frederic Jung
061acfe9f1
Merge #250: Inspecting a link moves the map to it
Thanks to ddryden.
2026-11-01 07:57:49 +01:00
Frederic Jung
b9183f1178
City panel fix, caches that scale, Manila, Cebu and Davao (2.3.0) 2026-10-31 16:31:50 +01:00