The city panel put the name of your own subsea cable and an incident's
repair label into its HTML as they came from the save. Both are escaped
now, and sanitize() keeps a cable's name to a string of 60 characters.
A see-through line on the card was one round-ended quad per segment, so
where two met it was blended twice: the selected tube's halo showed a
darker blob at every point, and the cables a notch at every corner. Each
segment now knows its neighbours' directions and keeps only its side of
the corner's bisector, as the 2D canvas strokes a path once.
The link being dragged out was painted on the overlay, above the cities
and their labels; it now goes to the card, under them, as in 2D, and its
price label is a picture like the others.
Auto after Always 2D, when the browser will not give the context back,
gives the card up instead of waiting for it all session. Firefox reads
the card's name from RENDERER, without the extension it warns about.
Any site open in the same browser could POST results (printed to the
terminal, escape sequences included, and written to --out), and DNS
rebinding could read the save. The server now checks the Host header and
the origin of a POST, caps the body at 2 MB, drops control characters,
and no longer sends stack traces. The panel no longer shows <sub> tags.
Offer and customer ids come from Date.now(), so the shark's oversell, the CEO's veto, his promises
and every contract roll differed each time the same game was played, and the shark test could fail
on CI (67% oversold against 54%, short of its 15-point margin). They now hash the deal or the
customer (type, cities, name, size), and a test checks two ids give the same roll.
From customer level 2, one person runs sales at a time, next to the NOC intern:
- The engineer turned salesdroid ($9k/mo) books you into every network operators' meeting 30 days
ahead at the usual ticket price, brings 40% more offers (half as many again while a meeting's glow
lasts) but never the huge deals, and their customers leave less often at renewal (half as often
for the nerdy ones: HFT, ISPs, universities, L2). Haggles badly.
- The shark ($15k/mo) brings bigger sizes at 25% more, takes a month of each deal as commission,
oversells half of them with a requirement the network does not meet yet, never brings technical
customers, makes selective peering desks want 25% more traffic, wins most haggles, and their
customers leave 50% more often.
- The CEO (free) signs the biggest internet customer the network can take on the golf course every
50-80 days at 30% off, often with a promise nobody checked, signs about a third of the offers you
decline anyway, and has opinions. He cannot be fired: a board meeting brings a VP of Sales a month
later.
Customers remember who signed them (by), which the renewals read. Every roll is a hash of the day
or the deal, so games without a salesperson keep their random stream.
The differential fuzz also leaves out buttons for actions main does not have yet.
A leased pair was $400 + $1/km a month, so a single 400G wave on the
same route cost two to three times the whole fiber. It is now $600 +
$1.50/km (amplifiers as before): a lease pays off at a couple of 400G
waves, as dark fiber does. Leases already signed keep their price (l.mo).
Alien-wave rent follows, since it is priced against the fiber.
The differential route fuzz now also compares link prices, so a
deliberate price change compares this checkout with itself, as a change
to the world already does.
The dashboard shows what you have built, not what you haven't. The new tab lists every city you could still open, with its eyeballs, exchange and price, and sorts, filters by region and pages like the other long lists. Open selects the city on the map, so a build still goes through the city panel and its warnings. The tab also works in the NOC window.
Every customer now signs for a term (enterprise and hosting 1-3 years, wholesale and circuits 2-5,
fiber pairs 10-20). When it ends most renew at today's bandwidth price, happy ones often grow to
the next size, a few with competitors around ask for a discount 30 days ahead (match, meet halfway
or let go in Deals; no answer matches), and some leave: unhappy ones because of the service, others
acquired, bust, insourced, moved (they stay if you have a POP there), multihomed, project ended,
a cheaper bid, or now and then one of the odder reasons (never more than one every 60 days).
The bandwidth market is flat for six months, then about 10% cheaper a year, slowed by dearer
hardware, moving in a slow three-year cycle and pushed up during a shortage. New offers and
renewals are priced in it; one renewal moves a price at most 25% down or 10% up.
Nothing happens in a first term. Rolls are hashes of the customer and its term, never Math.random,
so seeded games keep their stream. Old saves get renewals spread over the next year. Happy
customers of a year or more send a referral about every six weeks. The dashboard's Customers tab
shows customers won and lost each month and why, renewals due and the market; customer rows show
the contract end.
The differential fuzz now leaves out state fields only this checkout has, so a new feature's state
does not fail the comparison with main while everything both games share must still match.
An alien wave rented for about as much as leasing the whole fiber, so a
route sold out to its market earned 11 to 35 times its lease and the
gear paid back in one to three months. A wave now rents for 30% of the
fiber's monthly cost (lease plus amplifiers), and each one sold between
the same two cities goes cheaper, down to 40% of the first: a full
route earns 2 to 6 times its lease. Signed contracts keep their price.
Gameplay rule F6.
Extra crews could bring any land build to the next day. They now cut it
to half its planned time at most, and the button says when it would be
done. Gameplay rule F7.
A typed order (the agent API) could end a wave, dark fiber or cable in a
city the map does not show, and opened a POP there.
Gothenburg between Oslo and Copenhagen on Netnod's exchange, Malmö across the Øresund on SONIX, and Haparanda where GlobalConnect's fibre crosses the land border to Finland. A Nordic fibre carrier sells transit along that route; Tele2, Telenor and Arelion reach the new cities.
What a scrubbing center sends back to its target is the target's own
traffic, but compute() carried it under the junk bucket, so a small
flood at a big customer showed up as hundreds of gigabits of DDoS junk
on the backbone. It now has its own bucket, shown as scrubbed clean
traffic in the link panel.
The card blends the texels around the point it reads, so a picture drawn
off whole pixels, or stretched while a zoom moves, read half a texel past
its edge: its neighbour in the atlas, or a picture left from before the
last reset. The map showed thin coloured lines along the edges of cities
and labels. Each picture now goes in with a clear one-texel border, and
painting on the pad is clipped to the picture so the border stays clear.
The WebGL work had eight bullets, so with upstream's three the app's What's new (five bullets) showed only two of
ours, and four described fixes to the WebGL map itself, which no release has had: a zoom that lost the context, the
cities repainted at every step of a zoom, the coastlines' points, the garbage per frame. What a player gets from them
goes into the first bullet (smooth zooms, the coastlines, Always 2D freeing the card, a lost card coming back), which
leaves four, each with the pull request's number.
A frame that sent pictures read getError() to know whether the card took them. In every browser WebGL runs in another
process, and each read waits for it to finish everything sent so far, uploads included: a wait on the main thread on
exactly the frames that already cost the most (a pan or a zoom sends pictures on most frames, up to 321 in one).
The card keeps an error until it is read, so one read a second still finds a refusal: the pictures are now checked at
most every GL_MEM_EVERY (1 000) ms, and a picture refused in between shows at worst as a dark box until then, after
which the map goes to 2D as before. The first pictures sent into a new atlas are still checked at once, where a card
that allocates it lazily refuses. The cost could not be timed here (no Vulkan driver on this machine for Chromium to
reach the graphics card); the change bounds it whatever it is.
Tests: webgl-out-of-memory reads at most twice in two seconds of panning, and a refusal after the first check gives
the map to 2D within a second.
The loop runs at the screen's rate even when a still map is not drawn again, so the readout's "fps" said 60 or 240 on
a map that was not being drawn at all, which a bug report would take for the map's speed. It now also says how often
the map was drawn ("map drawn N/s"). The sot-fps setting it carried over only ever existed on this branch, never in a
release, so it is no longer read or removed; ?fps and ?nofps still open and close the readout.
Settings › Map drawing said "This browser cannot" by calling glInit(), so opening Settings on the title screen or in a
puzzle, where the map is drawn in 2D, made the WebGL context and its 64 MB atlas. It now says what is known without
asking the card (glCan()): a card given up or a browser without WebGL2 cannot; a card not tried yet counts as able.
A card that turns out to be the processor's is still named once the game draws its first frame, in Diagnostic info
and in Settings. Test in webgl-context-restore.
The first loss of the WebGL context gave the card up for the session. A context can come back (a driver reset; on a
phone, sometimes just leaving the app), so a phone that went to another app came back to the slower 2D map until the
page was reloaded. Always 2D, chosen in Settings, kept the context and its 64 MB atlas for a map drawn in 2D.
A loss now leaves the 2D map drawing while the context is away (glLost(): the event is cancelled so the browser may
give it back), and everything on the card is built again on the same context when it comes back (glRestored(),
glForget(): glInit() runs as for the first frame). A card lost more than GL_LOSSES (2) times is given up for the
session, so a card that keeps failing does not keep the map switching. Always 2D lets the context go through
WEBGL_lose_context and Auto asks for it back, the same path, never counted as a loss; a context the browser gives back
after the player chose Always 2D is let go again. Without the extension, and for the GPU benchmark's switches
(mapGl(on,false)), the context is kept as before. The listeners and the overlay's wrappers are set once.
Diagnostic info says when the map waits for a lost context. Tests: webgl-context-restore (7), and the loss test of
webgl-out-of-memory now waits for the context instead of giving it up.
The 2D map keeps a canvas per picture, and the list was capped only by its length (1 400). A long zoom on a big
network paints every city again at each step of its scale, so a pinch from 0.6 to 3.2 and back held 181 MB of
pictures (the TTL save: 179 MB) where one frame uses 2 to 23 MB.
At the end of a frame over 48 MB, the pictures it did not use go, those unused the longest first, down to 36 MB, and
each canvas let go is emptied (0×0) so its pixels are freed without waiting for the collector. The frame's own
pictures are never let go, so a screen that needs more keeps what it needs. Finding a picture now marks it as used.
Measured in jsdom on the same pinch (1280×800 at 2×): 43 MB at most (TTL: 40 MB); 4 781 pictures painted against
4 083 (TTL: 5 549 against 6 030); at most 321 painted in one frame, the same as before (the zoom's own steps).
The card's atlas is unchanged: it has its own fixed size.
Given up while its context still lived (memory refused, a setup failing half-way), the card kept the atlas (64 MB at
4096 px), the tubes' points and the rest while the 2D map began painting its own pictures. glKill() now deletes the
biggest and lets the context go (WEBGL_lose_context, where the browser has it), unless the browser already lost it;
glInit() keeps the context from the start so a failed setup is let go too, and the loss event of a context let go on
purpose does not give the card up a second time. Always 2D still keeps the card for later.
The atlas, the land, the tubes and the cables read getError() after they are sent, but a picture sent into the atlas
(texSubImage2D) was marked as sent at once: a card short of memory that only set OUT_OF_MEMORY left it kept and
drawn from an atlas that never got it. A frame that sent new pictures now asks once, at its end and before drawing
them; a refusal gives the map to 2D in the same frame and forgets the card's pictures. A frame that only reuses the
atlas still asks nothing.
The card filled the land by an odd/even count over all the coastlines at once, so two coasts that overlap cancelled
out into sea: Timor, drawn by two coastlines, lost most of its inside and its shadow when zoomed in. The 2D map fills
each coast on its own. The fan now turns every coast the same way and the stencil counts windings (+1 and -1 by the
triangles' facing, filled where not zero), which is the 2D canvas's nonzero rule: an overlap counts 2 and stays land.
Same number of draws.
The 2D map paints its land into an offscreen picture. In Firefox that picture was a software canvas
(willReadFrequently), because Firefox on Android garbled big paths on its graphics card (#43). Firefox on a computer
had it too, and a software canvas is sent to the card again on every frame, at a cost that grows with the picture:
the whole world at mid zoom, four screens of it zoomed in.
Only Firefox on Android keeps it now (softCanvas()). Measured in Firefox 159 on Windows (RTX 4090, full screen
2560x1440), 2D map, frames per second at zoom 0.6 / 1.1 / 1.6 / 3.2:
- big-network fixture, main: 56 / 37 / 34 / 26; with this change: 64 / 49 / 51 / 78;
- the 183-POP save, main: 32 / 25 / 25 / 22; with this change: 36 / 26 / 33 / 55.
(Measured with the change injected into main's page; the land picture is the same code on this branch.)
tests/world-layer-firefox.test.js: which browsers get the software canvas, and that the land is an ordinary one
elsewhere.
Settings › Viewport info is now Diagnostic info, and the frame meter of the WebGL work joins it: one readout in a
corner instead of two, for bug reports. It shows:
- what the screen tells the game, as before (sizes, visual viewport, safe areas, standalone, the tab bar);
- what draws the map: WebGL2 and the graphics card's name, or 2D and why (Always 2D, a puzzle, no WebGL2, a
processor pretending to be a card, a lost context, a card out of memory: glKill() keeps the reason);
- how fast: frames per second, the 95th percentile and slowest frame, draw()'s mean time, the speed and zoom, and on
the card its segments and packets.
?vp and ?fps open it, ?novp and ?nofps close it, five taps on the date toggle it, and a device that had the frame
meter on keeps it. Its text stays technical and in English: it is pasted into reports. On a 360 px phone it wraps
inside the screen and never takes a tap. The setting's name and description are translated.
tests/diagnostic-info.test.js: the setting, the readout's parts, each reason for 2D, the frame figures, the address
flags and the old setting, the taps, and the phone layout.
A card short of memory may refuse a texture or a buffer without throwing: the call only leaves OUT_OF_MEMORY for
getError(), which nothing read. Refused, the 64 MB atlas drew every city, label and marker as a black box while the
map stayed on the card (seen in Chromium by refusing it).
The big uploads now read it (glMem()): the atlas, the land for each zoom level, the tubes once a day, the cables.
The atlas tries 2048 px (16 MB) before giving up; any other refusal is the card's error, so draw() gives WebGL up
for the session and draws the same frame again in 2D. getError() is never read on an ordinary frame: each read waits
for the card.
tests/webgl-out-of-memory.test.js: a 4096 px atlas refused gives a 2048 px one; both refused, or the land or the
tubes refused, leave the map in 2D in that frame with no glitch for the player; panning reads no error.
Cities, markers and labels are now pictures painted once on a canvas of their own. Drawn straight on the map,
main's dashed rings (the selected city, the cities feeding a selected tube, a flood), the cones' tips, a sleeping
POP's "zzz" and a working cable ship's spark took the state the tubes and labels left on the map's canvas: round
line ends and corners, text centred on its middle. A new canvas starts with square ends and text on its baseline, so
the rings came out with square dashes and the "zzz" sat higher. Every picture now starts with that pen (sprPen()),
on the card's shared canvas too.
tests/map-2d.test.js holds the 2D map to main, for players who keep it:
- for the same state, a frame drawn from the kept pictures is, call for call, the frame painted with no cache at
all: over every state a POP can be in, a city without a POP, random views of the big network with days passing,
and seeded random games after every move and day (the route-fuzz driver, two pages in lockstep);
- every tube's width, colour, dash and packets follow main's formulas;
- the 2D map never asks for WebGL, never draws a picture without a canvas, keeps one canvas per picture, draws as
a 2D map after the card is switched off or lost, and paints again at a new pixel density;
- money pop-ups fade as before; every picture starts with the right pen.
Planted bugs (incomplete keys, a stale key memo, the tubes' looks kept without the routing, one shared 2D canvas,
no pen) each fail it. A pixel comparison with main in Chromium (desktop and phone, the fixture, a late-game save and
states from random games) found the pen and nothing else beyond sub-pixel edges.
A frame joined a key for every city, label, quiet dot and stamp it drew, built a closure
to paint each even when the picture was already there, concatenated a prefix onto every
key, made an array per city per copy of the map for its place on screen, and rebuilt
the waves' and the clouds' arrays. Keys are now kept per city (packed into one number for
the yes/no parts), per label text and look, per stamp and scale, and joined again only
when the picture changes; pictures already painted are found before any closure is
made; the card's and the 2D map's pictures are two maps, so keys need no prefix; the
cities' places and the POP lights are computed in place; the waves and the clouds are
written into arrays kept from frame to frame.
Sampled heap profile, TTL save, RTX 4060 Ti: allocations under drawFrame 68 -> 37 MB/s
at x1 and 62 -> 43 MB/s during a pan/zoom sweep; under glBegin 5.4 -> 0.5 MB/s.
On the card the land was most of a frame's work (the stencil fills twice, the sand, the
edge), and it scales with vertices, not pixels. The land is now built per zoom level
(powers of 2) with each coastline simplified (Douglas-Peucker) so that no point moves
more than 0.25 px at the level's zoom; zooming in takes the finer level at once, zooming
out keeps it until the zoom is 10 % under it. COAST, onLand() and the 2D map are
unchanged.
The scale of a city's picture is in steps of 1/24, so a pinch repainted every city every
~4 % of zoom: hundreds of pictures a frame, and the atlas full and reset over and over.
On the card, while the zoom moves, pictures that grow with it (cities, ships, badges) keep
the step of the scale held when it began, stretched by up to 1.25x either way by the
card's filtering, and take a new one beyond that; 250 ms after the zoom stops they are
painted at their own step again, and a still map is drawn once more for it. The 2D map
paints every step as before.
Every sprite kept its own <canvas> once it was in the atlas: a long pan and zoom made
~20,000 of them, then a frame of one to two seconds, then CONTEXT_LOST and a silent
fallback to 2D (4 sweeps out of 5). The card's pictures are now painted on one reused
canvas and sent to the atlas at once (texSubImage2D with a sub-rectangle); a full atlas
restarts and takes the picture at once. The 2D map, and a picture too big for the atlas,
keep a canvas each. The card's and the 2D map's pictures are kept apart, and giving the
card up drops its pictures.
With the perf benchmark now waiting for the surface the map was drawn on,
headless Chromium showed what WebGL costs without a graphics card: its
SwiftShader renderer spends about 8 µs per instance, so the coastlines alone
(29k segments, twice) took about 480 ms and a big map 1.4 s a frame, where the
2D canvas takes 46 ms. Players get the same with a blocked driver, a virtual
machine or Mesa's llvmpipe. glInit() now reads the renderer first and keeps
the 2D map on SwiftShader, llvmpipe, softpipe, lavapipe, WARP or any
"software" renderer; GLX.soft lets the GPU benchmark measure them anyway.
- A trial now ends before the next starts: the clock stops, the frame
callback is cancelled (and a queued one turned away), a day still in the
route worker is waited for (or dropped), the clock's leftovers are cleared,
and every trial starts from the same random numbers.
- The renderers take turns going first, scenario by scenario; ?reps=N runs
each N times and reports medians.
- draw() is labelled as CPU submission time; the card's own time comes from
EXT_disjoint_timer_query_webgl2 where available (read frames later, never
waited for, disjoint results dropped); a run drawn by the other map is
flagged.
- npm run perf --browser reads its sync pixel back from the surface the map
was drawn on (the WebGL canvas waits for the card) and says which map each
version drew with.
- A sprite or disc drawn as the queue grows was written into the old array and
lost: the record is now taken before the array is read.
- A city's picture without an attack shared its cache key with step 0 of a
DDoS ring (always, with animations off): no attack is now phase -1, and
cityStatic() reads only what the key holds.
- Back at the title (or on a damaged save), drawFrame() returned before hiding
the card's layers, so the last network stayed behind the title: the layers
are now shown or hidden on entry.
- An error from the card (frame start, tube upload, atlas, sprite flush) now
gives WebGL up and draws the same frame in 2D, once; the 2D context, the
sprite queue and GLS.frame are reset whatever fails. Other errors still
reach tickErr() and leave WebGL on.
- Selecting a tube no longer rebuilds and uploads every tube, packet and
point (about 230 KB on the big-network fixture): its halo is its own small
buffer.
- Sea, land, waves, clouds, cables, tubes and packets are drawn by the
graphics card; the land is geometry built once, so panning and zooming
repaint nothing.
- Cities, labels and markers are painted once into a sprite atlas and drawn
in one call (with drawImage in 2D, which speeds up the 2D map too).
- Settings > Map drawing: Auto or Always 2D, per device. Browsers without
WebGL2, a lost context and puzzles keep the 2D map.
- npm run bench:gpu compares 2D and WebGL in a real browser on a real GPU;
?fps shows a frame meter.
The stars become three goals; the current one says what is wrong and what to do. A red ring marks a city still short, a pulsing ✂ the link whose cut hurts. Cities far from the puzzle are left off the map, and idle stepping stones are nameless dots until tapped, used or zoomed in on.
It never landed on the Biscay coast: its Spanish landing was Conil, on the Gulf of Cádiz,
between Lisbon and the Mediterranean. Its Miami pair keeps ending at Madrid, as on main,
so saves with a Columbus link keep it.
Every joke now follows the code of conduct: networks, cables and routers are fair game, people, countries
and beliefs are not. Renamed eight networks, three own-cable names and one AI site, and rewrote about forty
descriptions (state censorship and surveillance jabs, national stereotypes, a parody religion, innuendo, a
real person) in every language.
Event customers named after a network operators' meeting only come to a city where it meets: NANOG in the
US, APRICOT in Asia Pacific and Oceania (not mainland China, Hong Kong, the Middle East or Central Asia),
DENOG in Germany, UKNOF in the UK, RIPE in Europe, the Middle East and Africa, DKNOG in Copenhagen.
Pyongyang's broadband tops out around 0.7 Gbps, and no customer of any kind spawns in North Korea.