seriesoftubes/tests/durations.json
jvanvik 065c922287 Server-run play, part 2: the engine
The engine that runs every network of a server session (server-sim design,
section 4): each network in its own vm realm, realms in a small pool of
worker threads, a promise API for the session host. Nothing uses it yet;
the plain build and the game are unchanged (no file under src/).

- scripts/lib/mp-sim-realm.js: one network in a DONT_CONTEXTIFY realm
  running the plain page's game (never the MP page's client folder), with
  recording DOM stand-ins, no-op timers that count, and the srv... calls:
  load from a checkpoint (route memory seeded, then routed), begin a new
  network, marks and restores, the day as a page runs it, the action
  pipeline with drafts, arming, the sanitize gate and rollback, what-ifs
  that put S, R, the dice and uidN back, pulls with top-level key diffs,
  slim R and flow records on demand, fx captured and bounded, saves, cards.
- scripts/lib/mp-sim-worker.js: realms per session in one worker, days one
  network at a time with other messages between them, loads and unloads
  waiting for a session's day, time limits; a throw goes back to the mark
  in place, a timeout gets a fresh realm (new epoch) carrying the old R, a
  day is retried once and the network broken after a second failure.
- scripts/lib/mp-sim-engine.js: createEngine() with the fake engine's API,
  placement by realm count, every pending call rejected when its worker
  exits, a worker of its own after two exits in an hour; snapWith() joins
  the host's clock, roster and since to a realm's snapshot.
- Contract: a pulled snapshot is the realm's half (the host adds clock,
  roster, since); haptic fx carry milliseconds; the fake engine follows,
  with close() and snapWith(). The button crawl moved to tests/lib.
- Tests: realm vs jsdom byte for byte over 60 scenic big-network days with
  actions; restore; retry after a throw or a timeout; realm order; a timer
  audit and the gate over a sweep of sent buttons (SIM_LONG=1: a year and
  every button); captures, rollbacks, asks, selection reports, ordering,
  bounds, pollution, worker exits; the act tables against the game.

The gate found two keys the game writes in a shape a reload repairs (buyTE's
S.te, mkLeave's S.monkey): game fixes for the integrator, kept visible as a
todo test and a list in the audit.

Rebased onto the 3.3.0 merge (61e31c5): the engine itself needed no change. A
realm still routes in the game's own code (no route worker, no saves), the
route cache that now keeps list orders from day to day leaves a checkpoint and a
retry the same, and the capacity market and moved customers play in a realm as
on a page, under the strict gate. The tests needed three things: an old save's
first days earn the new traffic badges, which the unwatched network's snapshot
keeps; the restore test compares JSON text with sorted keys instead of a
deep-equal of two networks (a diff of gigabytes when they differ); and the crawl
opens the windows that move a customer, with a new test playing the market's and
the path moves' acts, 40 days of sales and a checkpoint against the page.
2026-11-09 19:30:38 +01:00

81 lines
2.8 KiB
JSON

{
"tests/any-home-city.test.js": 12.0,
"tests/architect.test.js": 20.1,
"tests/automation.test.js": 13.8,
"tests/backbone-core.test.js": 27.5,
"tests/badges-variants.test.js": 20.2,
"tests/build.test.js": 1.3,
"tests/canonical-state.test.js": 64.0,
"tests/capacity-deals.test.js": 12.6,
"tests/chaos-monkey.test.js": 30.3,
"tests/city-size.test.js": 8.5,
"tests/compute-idempotent.test.js": 10.4,
"tests/ddos-floods.test.js": 22.8,
"tests/ddos-model.test.js": 31.7,
"tests/eyeballs.test.js": 13.0,
"tests/fiber-broker.test.js": 9.7,
"tests/find-city.test.js": 9.6,
"tests/game.test.js": 42.8,
"tests/gameplay-rules.test.js": 42.9,
"tests/gangnam.test.js": 12.3,
"tests/glowball-sakura-lager.test.js": 15.8,
"tests/i18n.test.js": 59.9,
"tests/islands-and-arctic.test.js": 13.7,
"tests/issues.test.js": 103.0,
"tests/language-picker.test.js": 12.5,
"tests/latency.test.js": 11.1,
"tests/levels.test.js": 16.3,
"tests/link-metrics.test.js": 22.0,
"tests/link-trial.test.js": 6.4,
"tests/load-time.test.js": 102.7,
"tests/metric-panel.test.js": 8.1,
"tests/modes.test.js": 41.1,
"tests/more-cables.test.js": 14.3,
"tests/moscow-premium.test.js": 12.0,
"tests/mp-sim-acts.test.js": 14.0,
"tests/mp-sim-contract.test.js": 7.0,
"tests/mp-sim-determinism.test.js": 40.0,
"tests/mp-sim-engine.test.js": 9.0,
"tests/networks-list.test.js": 6.4,
"tests/new-game-speed.test.js": 10.1,
"tests/optic-counts.test.js": 9.7,
"tests/own-asn.test.js": 7.9,
"tests/pages.test.js": 12.4,
"tests/peering-desk.test.js": 13.9,
"tests/peering.test.js": 27.6,
"tests/perf.test.js": 10.9,
"tests/persist.test.js": 16.1,
"tests/pni-all.test.js": 12.5,
"tests/pni-global.test.js": 17.9,
"tests/pni-list.test.js": 15.4,
"tests/pnis-and-sold-out.test.js": 11.6,
"tests/puzzle-monkey.test.js": 7.9,
"tests/puzzles.test.js": 73.3,
"tests/regions.test.js": 80.3,
"tests/release-story.test.js": 2.8,
"tests/report-link.test.js": 12.0,
"tests/router-art.test.js": 7.8,
"tests/routers-per-pop.test.js": 8.1,
"tests/routing-reference.test.js": 11.6,
"tests/rules-locked.test.js": 8.4,
"tests/rules.test.js": 29.4,
"tests/sales-trial.test.js": 33.3,
"tests/save-size.test.js": 16.1,
"tests/save-slots.test.js": 48.5,
"tests/scenarios-playtest.test.js": 113.2,
"tests/sea-routing.test.js": 42.6,
"tests/server-sim-prereqs.test.js": 16.0,
"tests/services.test.js": 15.7,
"tests/specialist.test.js": 14.3,
"tests/speed.test.js": 144.6,
"tests/standing-orders.test.js": 66.8,
"tests/subsea-upgrade-timing.test.js": 13.5,
"tests/supply.test.js": 11.0,
"tests/tier1-cone.test.js": 19.8,
"tests/useless-subsea-upgrades.test.js": 7.2,
"tests/utilities-caches.test.js": 9.5,
"tests/utilities.test.js": 15.6,
"tests/weekly-architect.test.js": 28.7,
"tests/weekly-puzzle.test.js": 145.0,
"tests/weekly-scenario.test.js": 54.4
}