Lay of the Land
All methods

Performance against the spec's targets

Spec section 7 gives five performance targets, "subject to benchmarking". This is where each stands, how it's measured, and what holds it in CI.

Target Latest result Held in CI
Map and project responsive on 160 to 640-acre fields An edit to a 5,005-pipe design reaches the screen in 71 ms alone, 127 to 486 ms with the suite around Edits and undo under 1 s, in network.spec.ts
Cached elevation layers begin rendering within 5 s 0.70 to 1.0 s locally; 4.0 to 6.2 s on CI software WebGL Under 5 s locally (8 s on CI software WebGL), in terrain-layers.spec.ts
160-acre DEM terrain within 60 s, excluding slow upstream sources Median 30 s, slowest 42 s, on production The processing alone under 20 s, in test_terrain_budget.py; it runs in 2 s
Edits return revised calculations within 2 s A 640-acre design in the real Web Worker in 59 to 68 ms alone Under 2 s for the middle of three runs, in results.spec.ts
Long jobs run in the background, with progress and retries, no lockup Every search, build, layout, simulation and export is a job, shown in the job tray The job tray's browser tests, and the queue's database tests

How each is measured

  • A large design. network.spec.ts loads a design of 5,005 pipes, about 3 MB, in the real app. network-performance.md has its timings from 2026-11-06, with and without other browsers competing for the machine. Its budget is a collapse check, not a target: headless Chrome draws maps in software, so a person's browser should do better.
  • Stored terrain. terrain-layers.spec.ts builds terrain from stored images, then times a reload from the moment the project opens to the hillshade being on the map with its image loaded. That includes the page, the map's style and the stored image, all from the local stack. Three runs on 2026-11-08, three browsers at once: 703, 708 and 1,000 ms. In the full suite, with seven browsers competing, 2,377 ms.
  • Terrain. python -m gis_worker.benchmark_terrain asks for terrain on a 160-acre field the way the button does, so it includes the wait for a worker, the search, the download and the build. terrain-benchmark.md has 16 runs from 2026-11-06, on production and locally. It needs the network, so CI holds only the processing to a budget: test_terrain_budget.py runs the build's steps after the DEM is read, on a 247-acre made-up field with low spots and exact flats, which were the slowest ground found. That's 2.1 s in the worker's image on a MacBook.
  • Calculations. results.spec.ts sends the real Web Worker a square mile with 105 laterals and ground every 2 m along them, three times. network-performance.md has the timings.

Interaction speed budgets (Plan v3 items 375 and 416)

Fourteen @nightly browser measurements in apps/web/e2e/speed-budgets.spec.ts are backed by one checked-in budget file (apps/web/e2e/speed-budgets.json):

  • The three original baseline measurements on the standard 512 x 512 (64.8-acre, 1 m) e2e terrain fixture at desktop 1440 x 900: opening a project (open_project), dragging Water level for 10 steps (drag_slider), and generating a layout to the first alternative (generate_layout).
  • Eight slider-drag measurements on a synthetic 160-acre, 1 m timing terrain (805 x 805 = 648,025 cells, generated deterministically by node apps/web/e2e/build-synthetic-160ac-geotiffs.mjs into apps/web/e2e/fixtures/synthetic-160ac-1m-*.tif; synthetic math matching benchmark-terrain-grid.mts, not real field data). They drag Sun height (with tiled in-browser Hillshade active) and Water level over 32 steps each, at both desktop (1440 x 900, mouse) and an emulated narrow touch viewport (390 x 844, CDP touch). Each drag records both the longest requestAnimationFrame gap during the drag (alongside p50/p95 frame gaps, PerformanceObserver longtask counts/durations where supported, and input-to-next-frame latency) and the time from the last input or pointer release until the settled result paints on screen.
  • Three measurements of plan v4's tools on the same synthetic 160-acre terrain at desktop size (the strict audit's "Fast under the hand"): the longest frame gap while a slope rule's top value is dragged across its track in 32 steps (drag_slope_rule_160ac_desktop), and, for a day of sun, the time from choosing its date to its first picture on the map (sun_day_first_picture_160ac_desktop) and to its settled sentence (sun_day_settled_160ac_desktop). The date is chosen while another date's full pass is running, so the time includes dropping that pass. They're under "A rule, a view and a day of sun" below.

Since 2026-12-01 each of the fourteen is taken two ways, its wall-clock time and the page's CPU time over the same action, and CI holds the CPU time, not the wall clock. The next section says why and how. The wall-clock budgets set on 2026-11-30 are retired; "How the wall-clock budgets were set" below keeps their history. No budget number was written ahead of a measured run.

What CI holds since 2026-12-01: the page's CPU time

What was found. The nightly browser run failed on its speed budgets, and the app was not the cause. Each budget was a wall-clock figure set on 2026-11-30 from six runs that day, and on GitHub's shared ubuntu-latest runner the same code, runner image and browser then measured, for one drag's longest frame gap (drag_slider, budget 150 ms): 33 ms in nightly 46617503936 and 383 to 1,117 ms a day later (targeted run 46786252631); within one job, 33 ms on a first attempt and 1,933 ms on its retry; and across that day's runs 150 to 2,450 ms. A day of sun's first picture took 559 ms alone and 2,224 ms in the nightly. The lane before this one (t3/v4-r3-nightly) found no long task on the page's main thread during the spikes, and waiting for a settled map with all its tiles in changed nothing: targeted run 46787502781 still measured 150, 1,250, 1,600 and 1,900 ms for that drag. So the runner moves a wall-clock figure ten to fifty times, and a budget set from one day's runs fails on the next for no fault of the app. A nightly that fails for no reason is one nobody reads.

This lane found where the frame gaps go. Every drag's longest gap followed the CPU time of the GPU process, where SwiftShader draws the map in software, and not the page's: in ten measurements of drag_slider the gap was 33 to 133 ms when the GPU process spent 0.66 to 0.9 s, and 0.8 to 1.5 s when it spent 4.4 to 9.4 s, while the page's own CPU time stayed between 530 and 940 ms. drag_water_level_160ac_desktop and drag_slope_rule_160ac_desktop split the same way. What makes the software renderer do ten times the work on some drags is not known; the app's own work during them is the same.

What CI holds, and why. As for network.spec.ts above, on this runner a wall-clock figure is a collapse check, not a target. So for each of the fourteen keys apps/web/e2e/speed-budgets.json holds:

  • maxCpuMs, the page's CPU time allowed, where that figure is steadier than the wall clock (below). The spec fails when the CPU time passes it, or when it could not be read.
  • collapseMs, a wall-clock bound whose only job is to fail a hang: a round figure at least ten times the worst wall-clock figure ever recorded for the key (in this document, in the nightly and targeted runs named above, and in this lane's runs), never under 10 s, from proposeCollapseBound() in scripts/speed-budgets.ts. The floor is there because a 33 ms frame gap has measured 2,450 ms on this runner. For a day of sun, the spec's own 120 s waits fail a hang before its bound would.

Every run still records both figures, with the CPU time's parts, in apps/web/e2e-output/speed-measurements.json, and prints each as a SPEED_FIGURES {json} line in the log. The spec no longer asserts that a day of sun's first picture comes within 2 s of the wall clock: that line is the spec's target for a person's machine, and is shown on the laptop and the phone below, not on this runner.

How CPU time is read. Through Chrome's DevTools protocol, at each end of every timed action:

  • SystemInfo.getProcessInfo on the browser's session gives each process's CPU time across all its threads. The page's CPU time is the sum over every renderer process: the page's main thread, its web workers (terrain-calc.worker.ts, the layout preview's worker, the sun's passes) and its compositor. A renderer that starts inside the window counts whole and one that ends is left out, so opening a project counts even if the navigation changes process. It doesn't cover the GPU process, where software WebGL draws the map. That is recorded as cpuGpuMs and not budgeted, since it is the figure that swings with the frame gaps. Linux reports this time in 10 ms steps.
  • Performance.getMetrics on the page's own session, enabled with timeDomain: "threadTicks", gives the main thread's CPU time alone (TaskDuration, ScriptDuration, LayoutDuration, RecalcStyleDuration, ThreadTime) and the renderer's ProcessTime. These are recorded beside it. If thread ticks were refused, the four durations would be wall time, so the spec drops them rather than pass them off as CPU time.

The window for a drag runs from just before its first move to just after its release, and a settle's from the release to the settled result. So for Water level, whose wall-clock settle runs from the last input, the CPU window starts a little later. A day of sun's two windows run from choosing June 21 to the first picture, and to the settled sentence.

The check that it is CPU time. The spec's first test, on a blank page served on the app's origin, times a 1 s sleep, a busy 1 s on the page's thread and a busy 1 s in a web worker. On CI, in all ten runs of it in this lane, the page's CPU time rose 0 to 10 ms for the sleep, 920 to 1,010 ms for the busy page and 1,000 to 1,010 ms for the busy worker. The main thread's thread-ticks figure rose 0.7 to 1.1 ms for the sleep, 921 to 1,001 ms for the busy page and 1.9 to 4.7 ms for the busy worker, which runs off that thread. The test fails if the sleep adds 150 ms or more to the page's figure (100 ms or more to the main thread's), if either busy second adds less than 600 ms or more than 1,500 ms, if no process list is read, or if thread ticks are refused. A browser upgrade that drops either fails there, before any budget is read.

The runs. Five targeted runs of e2e-targeted.yml on t3/v4-r3-speed, on 2026-12-02 (UTC) between 01:49 and 04:15, the evening of 2026-12-01 in Central time: 46790264100 (one repeat), 46791429976, 46797767673, 46803945894 and 46806492512 (two repeats each). That is ten measurements of each key. The phone Sun height drag has nine, because run 46806492512's first attempt failed the spec's existing check that the drag moved Sun height by at least 20, before recording anything, and passed on its retry. Spread is the highest over the lowest. The GPU column is recorded, not held.

Key Wall clock, ms, each measurement in order Page's CPU time, ms, the same measurements Wall spread CPU spread GPU process CPU, ms, lowest to highest What CI holds
open_project 3,308, 7,089, 4,306, 8,085, 4,144, 7,298, 4,677, 5,122, 4,912, 3,494 1,890, 2,900, 2,980, 3,100, 2,950, 3,100, 2,950, 2,430, 3,120, 2,360 ×2.4 ×1.7 2,080 to 4,520 Unbudgeted; wall ≤ 90,000
drag_slider 33, 1,467, 1,283, 1,283, 1,333, 33, 1,333, 133, 1,317, 833 540, 720, 750, 700, 780, 550, 750, 530, 940, 610 ×44.5 ×1.8 660 to 9,360 CPU ≤ 1,269; wall ≤ 30,000
generate_layout 3,248, 4,881, 4,196, 4,850, 4,166, 4,886, 3,610, 2,945, 4,053, 2,891 380, 570, 600, 640, 600, 640, 570, 390, 560, 440 ×1.7 ×1.7 3,250 to 5,810 Unbudgeted; wall ≤ 60,000
drag_sun_height_160ac_desktop 850, 2,017, 1,600, 2,000, 1,550, 1,683, 1,817, 1,450, 1,283, 1,317 10,220, 14,700, 14,160, 14,020, 14,080, 15,100, 14,690, 11,040, 13,610, 11,760 ×2.4 ×1.5 29,070 to 62,300 Unbudgeted; wall ≤ 40,000
settle_sun_height_160ac_desktop 631, 1,152, 1,731, 895, 1,312, 1,060, 1,194, 1,019, 870, 925 200, 190, 280, 190, 220, 180, 200, 180, 170, 150 ×2.7 ×1.9 1,100 to 2,610 Unbudgeted; wall ≤ 20,000
drag_water_level_160ac_desktop 600, 33, 50, 50, 1,633, 1,433, 50, 33, 533, 33 2,430, 1,250, 1,310, 1,320, 1,890, 1,580, 1,230, 1,150, 3,940, 970 ×49.5 ×4.1 1,370 to 21,390 CPU ≤ 5,319; wall ≤ 20,000
settle_water_level_160ac_desktop 398, 280, 252, 247, 229, 306, 214, 189, 610, 256 20, 300, 270, 240, 170, 270, 220, 220, 40, 240 ×3.2 ×15.0 110 to 630 Unbudgeted; wall ≤ 10,000
drag_slope_rule_160ac_desktop 533, 1,317, 67, 1,550, 417, 1,350, 867, 817, 767, 517 900, 1,010, 970, 1,040, 1,070, 1,200, 1,120, 990, 2,120, 860 ×23.1 ×2.5 1,380 to 17,640 CPU ≤ 2,862; wall ≤ 30,000
sun_day_first_picture_160ac_desktop 1,273, 2,163, 7,337, 2,515, 4,497, 3,663, 6,909, 1,177, 2,592, 3,013 1,040, 1,810, 7,290, 2,010, 3,360, 2,900, 4,760, 830, 1,820, 2,530 ×6.2 ×8.8 900 to 7,020 Unbudgeted; wall ≤ 80,000
sun_day_settled_160ac_desktop 8,482, 11,154, 14,615, 11,030, 12,443, 12,311, 14,649, 10,258, 9,232, 9,435 4,850, 8,170, 10,110, 8,580, 9,310, 8,320, 8,280, 6,750, 7,230, 6,760 ×1.7 ×2.1 8,960 to 18,000 Unbudgeted; wall ≤ 200,000
drag_sun_height_160ac_phone_emulated 417, 700, 550, 400, 617, 533, 450, 367, 433 820, 1,160, 1,270, 870, 960, 1,280, 1,030, 740, 930 ×1.9 ×1.7 790 to 2,030 Unbudgeted; wall ≤ 10,000
settle_sun_height_160ac_phone_emulated 149, 277, 681, 113, 444, 551, 460, 168, 453 200, 200, 210, 390, 350, 220, 220, 280, 300 ×6.0 ×1.9 430 to 1,110 CPU ≤ 527; wall ≤ 10,000
drag_water_level_160ac_phone_emulated 17, 17, 17, 17, 17, 33, 17, 17, 17 610, 520, 400, 630, 620, 560, 590, 410, 580 ×1.9 ×1.6 170 to 560 Unbudgeted; wall ≤ 10,000
settle_water_level_160ac_phone_emulated 136, 85, 157, 117, 141, 124, 84, 201, 155 100, 90, 110, 120, 150, 140, 80, 150, 120 ×2.4 ×1.9 10 to 120 Unbudgeted; wall ≤ 10,000

Which keys are budgeted. A key's CPU time is budgeted where its spread across these runs is at most half its wall clock's, the test this lane was set for whether CPU time "moves far less" than the wall clock. Four keys pass, and each budget is set by the rule the retired budgets used: the worst of the ten measurements (nine for the phone) times 1.35, and at least 100 ms more, from proposeBudgetFromRuns().

Key Runs it came from Worst CPU time CPU budget
drag_slider the ten above 940 ms 1,269 ms
drag_water_level_160ac_desktop the ten above 3,940 ms 5,319 ms
drag_slope_rule_160ac_desktop the ten above 2,120 ms 2,862 ms
settle_sun_height_160ac_phone_emulated the nine above 390 ms 527 ms

The other ten are unbudgeted, held only to their collapse bound, with their CPU time recorded:

  • Where the wall clock times the page's own work and not a frame gap, the two move alike, about ×1.5 to ×2.5 on this runner, because that wall time is mostly the page's CPU time: open_project, generate_layout, drag_sun_height_160ac_desktop (the page spends 10 to 15 s of CPU in a 32-step drag, most of it in the hillshade's workers), settle_sun_height_160ac_desktop, both phone drags and sun_day_settled_160ac_desktop. CPU time is no noisier for these, but it isn't far steadier either, so it isn't budgeted.
  • settle_water_level_160ac_desktop and settle_water_level_160ac_phone_emulated are a few hundred ms or less, a few 10 ms steps, and the desktop window starts at the release while the work starts at the last input, so its CPU time ran from 20 to 300 ms.
  • sun_day_first_picture_160ac_desktop moved ×8.8 in CPU time, more than its wall clock: up to 7.3 s of the page's CPU went by before June 21's first picture was on the map, against 0.8 s at best. The quick pass is 42 to 69 ms of the worker's time on the laptop, so the first picture is waiting behind other work, perhaps December's full pass not yet dropped or June's full pass begun first. That is a question about the app, left for its own item. This lane changed no app code. The next section finds the cause and mends it.

A key can be budgeted later, with no code change, by setting its maxCpuMs from more runs.

What CI does not show. Whether the map feels responsive under the hand is not shown by CI at all, neither by these CPU times nor by the collapse bounds. It is shown on a named laptop and on a phone, in the tables below. The laptop's browser figures for all fourteen keys are under "All fourteen in a browser on the named laptop", in a headless browser that draws the map in software, as CI's does; its worker figures for a rule, a view and a day of sun are under "A rule, a view and a day of sun". The phone's are a person's, and none has been taken.

A day of sun's first picture (2026-12-02)

The owner's call of 2026-12-01 is that a day of sun shows a first picture within 2 seconds and drops a superseded pass at once. The table above found up to 7.3 s of the page's CPU before June 21's first picture, against a quick pass of 42 to 69 ms on the laptop. The lane t3/v4-r4-sun-first found three causes, in this order of size, and mended each.

What was found, and how. Two diagnostic runs of the spec's test (targeted runs 46811259579 and 46814301510, on a branch not merged) logged every message to and from every web worker, every worker ended, the frames, and each thread's CPU time from /proc across the timed moment. They showed:

  1. The quick pass queued behind its own day's full pass. TerrainCalcClient keeps one waiting request per channel in a Map and takes the oldest first (terrain-calc-client.ts, run and dispatchNext). Replacing a waiting request keeps its place, so when a full pass was already waiting (asked for while the last quick pass ran), the new day's full pass took that place and the new quick pass went behind it. The new day's first picture then waited the whole full pass: 3 to 6 s on CI. It happens when the date, or the ground past the edge (which arrives a second or two after the layer is turned on, and changes what's asked), changes while a quick pass runs. The spec chooses June as soon as December's first look is on the card, so the timing of the ground past the edge decided which runs hit it. That is why the figure moved ×8.8. sun-first-picture.test.ts shows it, and failed before the mend: the client sent June's full pass first.
  2. Ending the worker didn't stop the old pass at once. A superseded full pass was stopped by ending its worker (interrupt). Chrome let the ended worker run on, 750 ms of CPU in the first diagnostic, while a new worker started cold, was sent the grids again, and took 710 ms for a quick pass that took 218 to 374 ms in a warm worker.
  3. On CI's two cores the full pass kept the first look's frame from being drawn. This repository is private, so ubuntu-latest gives it 2 cores. Once the quick pass was in, the full pass began at once and took a core, while the GPU process needed both to draw the map in software. In one measurement the June sentence was on the card 716 ms after the date was chosen, and the next frame came 5.4 s later. Over that window about 1.7 cores were busy: the full pass, and the GPU process's two drawing threads.

What changed.

  1. The quick pass goes ahead of any waiting run (run(..., { ahead: true }), from sun-layer.tsx).
  2. The worker works a day's pass one sun position per slice and reads its messages between slices (isSlicedTask, startTerrainTask, startSunHoursOverDay). interrupt sends a superseded sliced pass drop: it stops at its next slice, and the warm worker, which keeps its grids, takes the quick pass straight after. Anything else is still stopped by ending the worker. The hours are the same to the last digit: packages/surface/src/sun/day.test.ts compares every cell bit for bit on the engine's reference cases, and sun-first-picture.test.ts compares the worker's sliced picture with executeTerrainTask's.
  3. The full pass starts once the first look is on screen: when the frame after the one drawn with it begins (fullPassMayStart in sun-card.ts). It starts at once if the quick pass failed or the page is hidden. On a person's machine that is two frames, about 33 ms, before a full pass of seconds. The pictures and the words are the same.

Other tools had the same shape. A view from a point and a slope rule are mended in the next section; a slope band's edge and the rain slider are checked there too.

The figures. sun_day_first_picture_160ac_desktop on CI, from choosing June 21 while December's full pass runs to the frame after June's first picture. Targeted runs on t3/v4-r4-sun-first, 2026-12-02 (UTC).

Code Run Wall clock, ms, in order Page's CPU time, ms, the same
Before (the table above, ten) five runs 1,177 to 7,337 830 to 7,290
1 and 2 only 46813010412 2,283, 4,274, 3,886 2,120, 3,870, 3,570
1, 2 and 3, waiting one frame 46815551092 1,302, 1,197, 4,460, 3,702, 2,891, 4,338 520, 700, 3,630, 1,210, 1,010, 1,360
1, 2 and 3, waiting for the next frame (what's merged) 46817055875 1,177, 1,396, 313, 327 280, 700, 220, 290

Waiting one frame was too early: the frame with the first look had been recorded but not yet drawn in software when the full pass took its core. The settled sentence's CPU time in the last run was 4,880 to 5,380 ms, against 4,850 to 10,110 before: slices add no cost. In the same run the slope rule's drag (680 to 1,630 ms of CPU), both Sun height drags and their settles stayed within the ranges above.

No CPU budget is set yet. The four measurements of the merged code are small, 220 to 700 ms of CPU, but they come from one run, and their spread, ×3.2, is more than half the wall clock's ×4.5, so they fail this document's test for a budget. Five runs were spent finding and checking the causes. Two or three more targeted runs of the spec (grep "day of sun", repeat_each 3) would settle it. If they stay as small, the rule gives the worst measurement × 1.35, and at least 100 ms more: 945 ms on these four. Three more runs are under "The sun's first picture, measured again" below: still no budget.

A view's quick pass and a slope rule's first drag step (2026-12-02)

The lane t3/v4-r4-quick-first took the two tools the section above found with the same shape. Each cause was confirmed from the code and shown by a unit test that failed before the mend.

A view from a point. sight-tools.tsx (lines 1237 to 1248 before the mend) asked for a quick view and then a full view on two channels with run, as a day of sun did. So two things held, as they did for the sun:

  1. When the observer moved while the last point's quick view ran, that point's full view was waiting. The new full view took its place in the queue (terrain-calc-client.ts, run and dispatchNext), and the new quick view went behind it: the new point's first picture waited its whole full view.
  2. A full view already running was only marked superseded and worked to its end before anything queued behind it began.

A full view from the middle of the 160-acre timing terrain at the starting 1,320 ft takes 0.13 to 0.15 s of the laptop's time in Node, and from a corner over the whole field 0.29 to 0.31 s (the worker table under "A rule, a view and a day of sun" has 0.12 to 0.47 s for the full views, loaded); sight-and-sun.md allows up to about 3 s at its limit of 2 million cells. view-first-picture.test.ts shows both causes, and failed before the mend: the client sent the new full view first, and sent no drop.

What changed: the quick view goes ahead of any waiting run, and a full view running for something else is dropped at once (askForView in lib/terrain/view-ask.ts, called by sight-tools.tsx). The worker works a view a slice of rows at a time, at least 16,384 cells a slice (startViewFrom in packages/surface/src/sight/view.ts, startSightViewTask, isSlicedTask), so a dropped view stops at its next slice in the warm worker, which keeps its grids. Every cell is the same to the bit: view.test.ts compares each cell's state, bare-ground flag and count on the engine's reference cases, worked in slices of 50 cells and in one go, and view-first-picture.test.ts compares the worker's sliced view with executeTerrainTask's.

Measured with the app's code in Node on the laptop named below (load average 2.1 to 3.0), three times each, on the synthetic 160-acre timing terrain:

A full view In one go, ms In slices, ms Slices Longest slice, ms
From the middle, 1,320 ft 144 to 153 141 to 157 31 6.3 to 6.7
From the middle, 1,320 ft, over what stands on it 128 to 140 129 to 139 31 5.3 to 5.9
From a corner, 805 m, the whole field 287 to 335 288 to 311 119 6.7 to 7.4
From a corner, 805 m, over what stands on it 107 to 113 106 to 111 119 1.9 to 2.1

Slicing costs nothing that shows, and a superseded full view now gives way within one slice, 7.4 ms at most here, where before it ran to its end, up to 0.3 s here and about 3 s at the limit. In a browser the worker also takes its waiting messages between slices, which wasn't measured here. No browser test times a view, so none of this is a browser figure.

A slope rule's first drag step. slope-tools.tsx asks for a rule's picture on one channel, slope-rule, and the stride changes when a drag begins (line 716 before the mend): every cell at rest, with the largest single piece, and every second cell in a drag. So when a person took hold of a value while the resting pass was still running, the drag's first step was queued and the resting pass only marked superseded: the first step waited it out. A resting pass with its piece takes 8.7 to 18.1 ms here (median 12 to 13), against 6.0 to 7.4 ms for a drag step. rule-first-step.test.ts shows it, and failed before the mend: nothing more was sent until the worker replied.

Ending the worker would not mend it. A new worker starts cold, is sent the grids again and works slope afresh: a drag step in a fresh worker takes 17.5 to 18.6 ms, more than the wait. So the worker works a rule's picture in three steps, the figures, then the piece, then the picture (startSlopeRuleDraw in terrain-calc.ts), the same functions in the same order, and askForRule (lib/terrain/rule-ask.ts) drops a pass running for something else at its next step, in the warm worker that keeps the slope. rule-first-step.test.ts compares the stepped picture, figures and piece with executeTerrainTask's.

What is left: the figures step is most of a resting pass, 5.7 to 12.6 ms here (median 8), the piece 2.2 to 6.1 ms and the picture about 1 ms. A first drag step can still wait out one figures step, which is the same work the drag step itself does at every cell. Working the figures in slices of rows is engine work in slope-and-grade.ts this lane didn't do; at these figures it would save a few milliseconds.

A slope band's edge. The same shape: slope-bands, one channel whose stride changes when an edge is dragged (line 660). But a resting pass, slope kept, takes 5.0 to 5.1 ms here, against 3.1 to 5.0 ms for a drag step, so a first step waits at most about 2 ms more than it takes. The first pass of all, which works slope and the starting bands, takes 52 to 61 ms, and comes before there is an edge to drag. Not mended.

The rain slider. Not the same fault. In See where water goes (water-path.tsx, the water-path channel) and in the workbench's rain comparison (surface-water-panel.tsx, the rain-comparison channel), what's asked doesn't change when a drag begins: each step asks for the whole answer at its rain, the same work as the step before (33 ms a step on the laptop, "See where water goes" below), and only the picture drawn on the page is coarser while the slider moves. A step that comes while another works replaces any waiting, so a step waits at most one step's work, never a heavier pass. Not mended.

The figures in a browser. CI's targeted runs on this lane are under "The sun's first picture, measured again" below, with the rule's drag beside them.

The sun's first picture, measured again (2026-12-02)

The section on a day of sun's first picture left its CPU budget for two or three more runs. Three targeted runs of speed-budgets.spec.ts (grep "day of sun", repeat_each 3, which also runs the rule's drag, under the same heading) on t3/v4-r4-quick-first at 3183a371, the sun lane's mend with the two mends above: 46822453111, 46822554050 and 46824117408, on 2026-12-02 (UTC), each passed 7 of 7. They finished at 06:16, 06:24 and 06:32: the second and third were queued behind the one before, so these are three runs in one half hour, not at three times of day. The sun's code is the same as the sun lane's; the lane's own four measurements are in the table above it.

Key Run Wall clock, ms, in order Page's CPU time, ms, the same GPU process CPU, ms
sun_day_first_picture_160ac_desktop 46822453111 1,049, 2,258, 1,662 340, 770, 700 1,580 to 2,900
46822554050 1,940, 1,764, 3,151 550, 900, 900 1,930 to 4,610
46824117408 989, 2,922, 1,825 390, 890, 490 1,290 to 3,400
sun_day_settled_160ac_desktop 46822453111 10,233, 7,924, 7,637 5,320, 5,330, 5,210 8,550 to 12,730
46822554050 12,729, 12,249, 11,809 7,310, 7,270, 7,440 14,100 to 16,180
46824117408 11,815, 11,686, 9,727 7,000, 7,070, 6,750 10,360 to 14,510
drag_slope_rule_160ac_desktop 46822453111 1,700, 1,150, 767 860, 850, 950 7,270 to 9,640
46822554050 1,683, 1,033, 1,000 880, 900, 900 4,180 to 10,880
46824117408 1,317, 1,517, 1,083 890, 900, 920 9,730 to 13,100

Still no CPU budget for the first picture. Its CPU time stayed small, 340 to 900 ms in all nine, where before the sun lane's mend it reached 7,290 ms. But its spread, ×2.6, is more than half its wall clock's, ×3.2, so it fails this document's test for a budget, and it stays unbudgeted, held to its collapse bound. With the sun lane's four measurements of the same code (220 to 700 ms of CPU, 313 to 1,396 ms of wall clock) the thirteen would pass the test, ×4.1 against ×10.1, but those came from a different branch's run and this lane was asked for the final code's. A later lane can set it from more runs at other times of day by the same rule, with no code change. On these nine the rule would give 1,215 ms.

The rule's drag stayed inside its budget in all nine, 850 to 950 ms of CPU against 2,862 ms, and within the ten measurements the budget was set from (860 to 2,120 ms).

How the wall-clock budgets were set (retired 2026-12-01)

These budgets (maxMs) were retired on 2026-12-01, for the reasons in the section above. The "Budget on CI's machine" columns in the two tables below are these retired wall-clock budgets, kept as history. What follows is as it was written.

The budgets in apps/web/e2e/speed-budgets.json were set on 2026-11-30 by the session reviewing the work, from the six runs in the table below. The rule is the one proposed here by the implementer who wrote the spec, with one change: the least headroom is 100 ms and not 25, since six runs on a shared runner are too few to bound a single late frame, and four of the eleven measures are frame gaps under 100 ms. The margin and the floor are judgment, not findings. Each budget is Math.ceil(Math.max(worst * 1.35, worst + 100)), from proposeBudgetFromRuns() in scripts/speed-budgets.ts. A nightly run now fails when a measure passes its budget, and says by how much. The steps as first proposed:

  1. Run .github/workflows/e2e-nightly.yml on CI's ubuntu-latest runner (headless Chromium with SwiftShader software WebGL) across at least N = 5 nightly runs on the same runner class so shared-runner variance is visible. Each test in apps/web/e2e/speed-budgets.spec.ts runs serially so sibling browsers do not compete for CPU.
  2. Download the speed-measurements artifact (speed-measurements.json) from each run and note the median and worst observed run for each key.
  3. Proposal: derive each budget from the worst of the N nightly runs plus a 35% headroom margin, with a 25 ms minimum headroom floor so short frame-gap measurements are not tripped by single-frame scheduler jitter: maxMs = Math.ceil(Math.max(worstMs * 1.35, worstMs + 25)) (implemented in proposeBudgetFromRuns() in scripts/speed-budgets.ts). The reviewer may pick a different N, margin, or floor before committing budgets.
  4. Enabling a budget in apps/web/e2e/speed-budgets.json is a one-line change per key: replace "maxMs": null with "maxMs": <number> (no separate status field needs to be changed). Also fill machine and measuredOn in speed-budgets.json and copy the observed CI numbers into the browser-timings table below.
  5. Once maxMs is set for a key, speed-budgets.spec.ts fails whenever a run exceeds it and prints the exact overrun in milliseconds. Because CI renders WebGL in software, CI budgets guard against relative regressions on CI's runner class rather than proving interactive speed on a user's GPU or phone.

The first look: from a search to relief (plan v4 item 523)

The app's own time from finding a place to relief on the map, measured by apps/web/e2e/first-look.spec.ts against the local stand-in for the elevation service (apps/web/e2e/quick-look-tiles.mjs). It runs from the moment Enter is pressed in the search box on typed coordinates to the first frame the map draws with a quick-look relief tile on it, read with performance.now() in the page. A new project, with nothing at the place in the browser's cache. On CI's runner (ubuntu-latest, headless Chromium, SwiftShader software WebGL), run 46575478668 on 2026-12-01 UTC, the test's first try and its retry:

Window First try Retry
Laptop, 1,280 by 800 2,363 ms 2,253 ms
Phone-sized, 390 by 844, touch, mobile 1,572 ms 1,404 ms

What it includes: the search box reading the coordinates (no lookup), the map's 800 ms flight to the place, the quick look's scheduler asking for its coarse first picture and the view's tiles once the view stops, the stand-in's answers, decoding and shading in the terrain worker, and the frame that draws the first tile. What it doesn't: the USGS's own time to answer (the stand-in answers on the same machine at once), the network between a person and the USGS, loading the page, and a real GPU. The "phone" is a phone-sized window with touch on CI's machine, not a phone: it is quicker than the laptop size because its view needs fewer tiles and fewer pixels drawn in software. Timing a real phone is the owner's to do.

With the real service beside it (quick-look-service.md, item 512's measurement, from one home connection): where someone has looked in the last 12 hours, the CDN answers a tile in about 150 ms, so relief would be on screen in about the app's own time above. Where nobody has, the first tile took a median of 5.2 s, 10.4 s at the 90th percentile and 18 s at worst, and that wait comes on top of the app's time. The nightly check's own first request, on 2026-11-30, waited 17 s for a cold tile.

The open door: from opening the page to relief (plan v4 item 555)

The time from opening the map anyone can open, /look, to relief on screen, measured by apps/web/e2e/open-door.spec.ts with no account and against the local stand-in for the elevation service (apps/web/e2e/quick-look-tiles.mjs), with the browser's search for a place answered by the spec. It runs on the page's own clock, performance.now(), from the moment navigation to the page began to the first frame the map draws with a quick-look relief tile on it. The spec types the place and presses Enter as soon as the map's style is there, so a person's typing isn't in it. It also notes the map's first frame and when Enter was pressed, all from the start of navigation. A browser with nothing cached. The spec fails if it takes 15 s or more, a budget set at several times what CI measured so that it catches a collapse, not a slow minute on a busy runner.

On CI's runner (ubuntu-latest, headless Chromium, SwiftShader software WebGL), runs 46626304415 and 46627559223 on 2026-12-01 UTC, each the test's first try. The map's first frame was noted only in the second run.

Window Open to relief, first run Open to relief, second run Enter pressed, first and second Search to relief, first and second Map's first frame, second run
Laptop, 1,280 by 800 4,115 ms 4,272 ms 2,255 and 2,441 ms 1,860 and 1,831 ms 1,921 ms
Phone-sized, 390 by 844, touch, mobile 2,918 ms 3,257 ms 1,592 and 1,709 ms 1,326 and 1,548 ms 1,411 ms

What it includes: loading the page and its scripts from the app's production build on the same machine, the map's style and first tiles from Mapbox, the search's answer, the map's flight to the place, the quick look's first tiles from the stand-in, decoding and shading in the terrain worker, and the frame that draws the first tile. What it doesn't: the USGS's own time to answer (see the first look, above), a real network between a person and this app, Mapbox or the USGS, and a real GPU. The phone-sized window is CI's machine at a phone's size, not a phone.

On a real laptop and a real phone. These are a person's to measure, and neither has been measured.

Device Network Open to relief Measured by, and when
A laptop, in Chrome, with its make and year written here Home broadband, named here Not yet measured
A phone, in its own browser, with its model written here Mobile data, 4G or 5G named Not yet measured

The method, for each: open a private window so nothing is cached; open the browser's developer tools on the Performance panel (on a phone, from a laptop by USB: Chrome's remote debugging for Android, Safari's Web Inspector for an iPhone); start recording, go to the production /look, type Mankato, MN in the search and press Enter at once, and stop when relief shows. Read the time from the start of navigation to the first frame with relief, and the time from Enter to that frame. Do it three times, and write the middle one with the device, the browser, the network and the date. The first look at a place nobody has looked at in 12 hours waits on the USGS (median 5.2 s for a cold tile, in quick-look-service.md), so say whether the place was warm or cold.

Finer grids take longer

Processing time grows with the number of cells, and the build keeps a ready-made DEM's own grid. Over the same 247 acres, measured on 2026-11-08 in the worker's image on a MacBook:

Grid Cells Processing Of which, hydrology
1 m, USGS 1.0 M 1.9 s 0.8 s
0.5 m, MnTopo 4.0 M 8.1 s 3.6 s
1 ft, NOAA 10.8 M 18.2 s 10.5 s

Production's builds have run about 2.5 to 3 times slower than these. So a field on one of NOAA's 1 ft DEMs could take 45 to 55 s to process there, with its search and a larger download on top, and is likely to miss the 60 s target. That hasn't been measured on production. Ranking already counts such a grid as 1 m of detail, since nothing shows the data supports finer, so building it at 0.5 m or 1 m would be one way to bring it in. That's a choice between detail and time for someone to make, and nothing has been changed.

Memory

Measured on 2026-11-10 in the worker's image, on a made-up 640-acre field: a square 1,809 m across with its 100 m margin, gently falling, with 100 low spots and 24 exact flats, and the 5 km of ground around it at 10 m. Peak resident memory of the build's steps after the DEM is read, from getrusage and from sampling every 10 ms, which counts WhiteboxTools' own process alongside the worker's while it runs:

Grid Cells Worker before Worker after WhiteboxTools before WhiteboxTools after Together after
1 m 3.3 M 503 MB 327 MB 312 MB 195 MB 372 MB
0.5 m 13.1 M 1,611 MB 812 MB 791 MB 757 MB 1,025 MB

Together, before, was 1,628 MB at 0.5 m. Both start from about 120 MB with the libraries loaded. The worker's own share came down by keeping the hydrology grids as float32, which loses nothing since WhiteboxTools writes them as float32 or they're differences of float32 heights; drawing the map overlays one at a time in float32, which moves a drawn slope by at most 0.003%; drawing flats' nudges and fill depths a block of rows at a time; measuring low spots over wet cells only; and running every WhiteboxTools step before reading any grid back. What's left at 0.5 m is mostly WhiteboxTools' breach step, about 58 bytes a cell in a process of its own. Together it's 69 to 77 bytes a cell, so the budget allows 80 (worker-deploy.md, "Memory"). Before, 640 acres at 0.25 m would have needed about 6 GB.

Gridding a point cloud, on the same field at QL 1's 8 points per square meter, half of them ground: 27.4 million points in four files.

Grid Before After
1 m 2,669 MB 230 MB
0.5 m 2,974 MB 563 MB

Before, every point was loaded and then copied out again to be counted. Now they stream through PDAL half a million at a time and are counted as they pass, so only the grid is held. The surfaces are the same, cell for cell, which test_point_cloud_dem.py holds the streamed build to on its fixtures.

Whole-grid browser terrain calculations (plan v3 item 375)

Hillshade shading, custom elevation coloring, water-level flooding (unconstrained and connected), raindrop tracing, watershed delineation and outline extraction, measured volume, rain ponding comparison (both without-tile and with-tile runs plus inlet ceilings), landscape position zones, topographic wetness (TWI), and cut-and-fill evaluation (with uncertainty, 0.1 ft contours, and RGBA map rendering) run off the main thread in apps/web/src/lib/terrain/terrain-calc.worker.ts using the same pure functions from packages/* and apps/web/src/lib/terrain/*. Grids cross to the worker once per terrain and stay cached across slider drags; rapid drags coalesce to the latest input and drop stale replies.

Pure calculation CPU time on a synthetic 160-acre, 1 m grid

Measured on 2026-11-29 on an Apple M5 (arm64) running Node v26.5.0 (node apps/web/scripts/benchmark-terrain-grid.mts), 1 warm-up run followed by 5 timed runs per function on a synthetic 805 × 805 (648,025 cells, 1 m, ~160.1 ac) field with 16 depressions, 252,928 flooded cells at the test water level, a full-field 648,025-cell watershed, and an 80-acre polygon.

What these numbers are and aren't: These are the pure functions' synchronous CPU times on a laptop's CPU in Node. They are not a measure of the map's responsiveness in a browser (which also includes message passing, canvas upload, WebGL compositing, and React rendering), and the browser's figures on the laptop are under "Browser timings" below, for the fourteen speed keys only. The phone browser measurements are still to be made.

Calculation Median (ms) Min (ms) Max (ms) Runs in worker?
shadeHillshade (full, stride 1) 7.1 6.9 7.2 Yes
shadeHillshade (drag, stride 2) 1.8 1.8 1.9 Yes
colorElevation (full, stride 1) 4.5 4.5 4.6 Yes
fitRangeToWindow (full grid, 0–100%) 1.1 0.7 3.0 No (one-shot button)
floodUnconstrained + renderFloodOverlay 6.5 6.4 6.6 Yes
floodConnected + renderFloodOverlay 9.7 9.4 10.1 Yes
traceRaindrop (full diagonal, NW to SE) 0.3 0.2 0.6 Yes
delineateWatershed + maskToOutlineRings (full field) 22.9 18.2 90.8 Yes
validMaskFromDem 0.9 0.9 0.9 Yes (cached inside worker)
measureVolume (80-acre polygon, lowest_edge) 21.2 15.2 25.9 Yes
compareRainPondingOnGrid (1×, all_rain) 54.0 36.9 59.4 Yes
compareRainPondingOnGrid (2× without + with tile, curve_number) 80.4 75.7 96.7 Yes
renderDepthOverlay (rain ponding RGBA) 2.1 1.7 2.2 No (main thread)
renderSplitDepthOverlay (swipe RGBA) 1.9 1.9 2.0 No (main thread)
classifyLandscapePosition + smoothZoneGrid + summarizeZoneAcres 79.1 52.4 134.6 Yes
computeTwi (flow accumulation + wetness index) 31.9 27.7 35.2 Yes
computeElevationChange (two flights) 2.6 2.1 10.0 No (one-shot mode switch)
measureChangeVolume (80-acre polygon) 3.9 3.8 4.0 No (one-shot polygon)
computeHeightsAboveGround (DSM − DEM) 1.3 1.3 1.3 No (one-shot mode switch)
evaluateCutFill (80-acre grading plane) 14.7 12.0 23.6 Yes
computeCutFillUncertainty (80-acre grading plane) 40.6 38.1 56.5 Yes
generateSurfaceContours (0.1 ft on 80-acre grading plane) 5.9 2.4 9.0 Yes
renderCutFillOverlay (RGBA map) 8.6 8.6 9.0 Yes

Browser timings (Plan v3 items 375 and 416)

The laptop's column was measured on 2026-11-30, three runs. CI's column is six runs of the same spec on GitHub's runner that day, one on #319's branch and five on #320's, which draws the map in software with no graphics card. It shows one thing plainly: on that machine, frames come one to three seconds apart while the sun is dragged over 160 acres at a desktop size, where a laptop holds 50 to 83 ms. CI's numbers are for catching a change that makes things much slower, and say nothing of how fast the app is in a user's hands. The phone's column is left empty until a person holding one measures it. Two more laptop runs, of all fourteen keys, on 2026-12-02, are in the section after this table.

Emulation caveat: An emulated 390 x 844 touch viewport running on a laptop's or CI runner's processor is not a phone. It tests the phone layout, sheet chrome, and touch-drag path on host CPU with SwiftShader software WebGL; real phone numbers still require a person holding a real phone.

Measurement (key in speed-measurements.json) Grid & viewport This laptop, three runs on 2026-11-30 CI's machine, six runs on 2026-11-30 Budget on CI's machine A phone in the hand (needs a person)
Open project to interactive map (open_project) 512 x 512, 1 m (64.8 ac, standard e2e), 1440 x 900 873 to 1,396 ms 1,973 to 7,067 ms 9,541 ms
Drag Water level, longest frame gap, 10 steps (drag_slider) 512 x 512, 1 m (64.8 ac, standard e2e), 1440 x 900 67, 67 and 317 ms 17 to 50 ms 150 ms
Generate layout to first candidate (generate_layout) 512 x 512, 1 m (64.8 ac, standard e2e), 1440 x 900 1,367 to 1,887 ms 3,079 to 5,353 ms 7,227 ms
Drag Sun height (Hillshade), longest frame gap, 32 steps (drag_sun_height_160ac_desktop) 805 x 805, 1 m (160 ac, synthetic timing), 1440 x 900 50 to 83 ms 1,100 to 3,083 ms 4,163 ms
Drag Sun height (Hillshade), last input to settled (settle_sun_height_160ac_desktop) 805 x 805, 1 m (160 ac, synthetic timing), 1440 x 900 105 to 149 ms 162 to 645 ms 871 ms
Drag Water level, longest frame gap, 32 steps (drag_water_level_160ac_desktop) 805 x 805, 1 m (160 ac, synthetic timing), 1440 x 900 83 ms each time 483 to 1,583 ms 2,138 ms
Drag Water level, last input to settled (settle_water_level_160ac_desktop) 805 x 805, 1 m (160 ac, synthetic timing), 1440 x 900 178 to 182 ms 123 to 644 ms 870 ms
Drag Sun height (Hillshade), longest frame gap, 32 steps (drag_sun_height_160ac_phone_emulated) 805 x 805, 1 m (160 ac, synthetic timing), 390 x 844 touch (emulated) 17 ms each time 50 to 100 ms 200 ms
Drag Sun height (Hillshade), last input to settled (settle_sun_height_160ac_phone_emulated) 805 x 805, 1 m (160 ac, synthetic timing), 390 x 844 touch (emulated) 36 to 40 ms 40 to 120 ms 220 ms
Drag Water level, longest frame gap, 32 steps (drag_water_level_160ac_phone_emulated) 805 x 805, 1 m (160 ac, synthetic timing), 390 x 844 touch (emulated) 33 ms each time 17 to 33 ms 133 ms
Drag Water level, last input to settled (settle_water_level_160ac_phone_emulated) 805 x 805, 1 m (160 ac, synthetic timing), 390 x 844 touch (emulated) 40 to 67 ms 67 to 220 ms 320 ms

How to produce each column

  • This laptop: three runs on 2026-11-30 on an Apple M5 with 16 GiB, macOS 26.7.3, in the headless Chromium that Playwright 1.64.1 drives, which draws the map in software. Each cell gives the lowest and highest of the three. No task over 50 ms was recorded on the main thread during any drag on the 160-acre field. The one 317 ms frame gap came on the small fixture in the third run. To take them again, from the repo root, run:
    scripts/e2e.sh e2e/speed-budgets.spec.ts --workers=1
    
    All 11 measurements (plus per-drag p50/p95 frame gaps, longtask counts/durations, input-to-next-frame latencies, tile count/overview level, viewport, grid size, and device note) are written to apps/web/e2e-output/speed-measurements.json. Record your CPU model, OS, date, and observed values in the column above. To also check interactive GPU performance in a headed browser outside SwiftShader, run the local app and profile the same 160-acre drags in DevTools Performance.
  • CI's machine (from nightly runs): Trigger .github/workflows/e2e-nightly.yml from the Actions tab (or wait for the scheduled nightly run, which executes scripts/e2e.sh --grep @nightly on ubuntu-latest), then download the speed-measurements artifact (speed-measurements.json). Record the median and worst of at least N runs before setting budgets in apps/web/e2e/speed-budgets.json.
  • A phone in the hand (needs a person): Open a project with a 160-acre, 1 m terrain on a real iOS or Android phone (Safari or Chrome), enable Hillshade with Low sun and drag Sun height continuously across the track, then enable Water level over ground and drag Water level continuously across the track. Record the phone model, OS/browser version, observed frame time or stutter (via Safari Web Inspector or Chrome remote DevTools), and settle latency in the rightmost column.

All fourteen in a browser on the named laptop (2026-12-02)

The table above has the laptop's figures for the first eleven keys from 2026-11-30, and no laptop browser figure for the three plan v4 added. On 2026-12-02 the orchestrating session ran the whole spec twice on the laptop, from the repo root, with scripts/e2e.sh e2e/speed-budgets.spec.ts --workers=1. Both runs passed 11 of 11 tests.

  • The machine: the laptop named under "A rule, a view and a day of sun" below: model identifier Mac17,4, Apple M5, 16 GB, macOS 26.7.3, in the headless Chromium that Playwright drives. Like CI's, that browser draws the map in software (SwiftShader), not with the laptop's graphics, so these figures are a laptop's processor with software drawing, not a person's browser.
  • The code: commit f9e69211, which is before the lane t3/v4-r4-sun-first mended a day of sun's first picture (the section "A day of sun's first picture" above). The two day of sun figures are the code before that mend.
  • The load: another task was working on the laptop at the same time. Its load average was 3.8 when the first run began and 8.4 when the second did, so the figures are, if anything, high.
  • When: the first run from 04:57 to 04:58 UTC on 2026-12-02, the second from 04:59 to 05:00 UTC (the evening of 2026-12-01 in Central time).

Each figure is the spec's own, from its speed-measurements.json (kept with the orchestration log, not in the repo). The wall clock is what the key's metric says: a longest frame gap for a drag, an elapsed time otherwise. The page's CPU time and the GPU process's are read as "How CPU time is read" says above.

What Key Wall clock, ms, first run Wall clock, ms, second run Page's CPU time, ms, first run Page's CPU time, ms, second run GPU process CPU, ms, first and second
Open a project to an interactive map, elapsed (512 by 512) open_project 1,428 1,607 1,762 1,055 4,966 and 4,750
Drag Water level, longest frame gap, 10 steps (512 by 512) drag_slider 150 100 263 254 9,940 and 8,999
Generate a layout to the first alternative, elapsed (512 by 512) generate_layout 1,381 1,875 141 263 6,040 and 10,315
Drag Sun height, longest frame gap, 32 steps (160 ac, desktop) drag_sun_height_160ac_desktop 183 217 4,695 5,074 55,001 and 47,695
Sun height, release to settled (160 ac, desktop) settle_sun_height_160ac_desktop 252 376 55 74 2,213 and 1,562
Drag Water level, longest frame gap, 32 steps (160 ac, desktop) drag_water_level_160ac_desktop 217 217 1,187 1,300 32,572 and 31,407
Water level, last input to settled (160 ac, desktop) settle_water_level_160ac_desktop 226 235 9 11 1,032 and 976
Drag a slope rule's top value, longest frame gap, 32 steps (160 ac, desktop) drag_slope_rule_160ac_desktop 33 50 595 603 9,364 and 9,229
A day of sun, choosing June 21 to its first picture, before the sun lane's mend (160 ac, desktop) sun_day_first_picture_160ac_desktop 214 120 818 178 1,072 and 916
A day of sun, choosing June 21 to its settled sentence, before the sun lane's mend (160 ac, desktop) sun_day_settled_160ac_desktop 2,350 2,188 5,510 2,605 9,702 and 10,437
Drag Sun height, longest frame gap, 32 steps (160 ac, 390 by 844 touch, emulated) drag_sun_height_160ac_phone_emulated 167 217 941 942 4,820 and 6,069
Sun height, release to settled (160 ac, 390 by 844 touch, emulated) settle_sun_height_160ac_phone_emulated 327 200 34 32 3,094 and 1,796
Drag Water level, longest frame gap, 32 steps (160 ac, 390 by 844 touch, emulated) drag_water_level_160ac_phone_emulated 17 17 601 528 3,695 and 3,462
Water level, last input to settled (160 ac, 390 by 844 touch, emulated) settle_water_level_160ac_phone_emulated 68 50 26 52 420 and 207

What they show, on this laptop:

  • A rule's drag kept up with the hand: the longest frame gap in 32 steps was 33 and 50 ms, two or three frames at 60 a second, where CI's software drawing measured 67 to 1,550 ms (the table under "What CI holds since 2026-12-01").
  • A day of sun's first picture was on the map 214 and 120 ms after June 21 was chosen, inside the spec's 2 s, even before the mend; its settled sentence came 2,350 and 2,188 ms after.
  • The other eleven are mostly higher than the 2026-11-30 laptop column above, and some much higher. Sun height's longest frame gap was 183 and 217 ms at a desktop size, against 50 to 83 ms then, and 167 and 217 ms on the emulated phone, against 17 ms; its settles were 252 to 376 ms, against 36 to 149 ms. Water level's longest frame gap at a desktop size was 217 ms both times, against 83 ms. Opening a project (1,428 and 1,607 ms, against 873 to 1,396), a layout (1,381 and 1,875 ms, against 1,367 to 1,887) and Water level on the emulated phone are close to the earlier figures. The load, with another task working, is a likely reason, but these two runs can't show it: the load on 2026-11-30 wasn't written down, and no run here was taken on an idle machine.

What still has no browser figure on a laptop: a view from a point (no key times one; it is timed only in the worker, under "A rule, a view and a day of sun"), a slope band's edge dragged, and the rain slider of See where water goes. None of these is a key in speed-budgets.spec.ts. The next section has the figures from a browser drawing with the laptop's graphics. No figure is from a phone in the hand, which needs a person.

All fourteen with the laptop's own graphics (2026-12-02)

Every figure above this section, on CI and on the laptop, is from a browser that draws the map in software: apps/web/playwright.config.ts starts it with --use-angle=swiftshader, and a visible window started that way still draws in software. These are the first figures from a browser drawing with a machine's own graphics, which is what a person has.

  • How: from the repo root, with a temporary file that was not committed, apps/web/playwright.gpu.config.ts, which takes the repo's config, drops the launch arguments that name SwiftShader and sets headless: false: scripts/e2e.sh e2e/speed-budgets.spec.ts --workers=1 --config=playwright.gpu.config.ts. The browser then picks the laptop's graphics by itself. Asking for Metal by name (--use-angle=metal) was tried first and is not needed.
  • The machine: the same laptop, Mac17,4, Apple M5, 16 GB, macOS 26.7.3, in a visible Chromium window that Playwright 1.64 drives.
  • The code: the fifth round's tree with the mend below joined, local commit 19cddc6d. Four runs, each 11 of 11 tests passed, with a load average of 1.8 to 4.9 as each began.
  • That it was the graphics card: the graphics process's CPU time. In a visible window drawing in software it was 2,200 to 74,000 ms a measurement on this laptop (for example 70,900 ms for the sun height drag); here it is 1 to 813 ms.
Measurement (key) Wall clock, ms Page's CPU time, ms Graphics process's CPU time, ms
open_project 947 to 958 1,275 to 1,396 123 to 148
drag_slider 18 to 19 274 to 306 49 to 56
generate_layout 869 to 1,908 137 to 323 71 to 131
drag_sun_height_160ac_desktop 19 3,623 to 3,697 806 to 813
settle_sun_height_160ac_desktop 22 to 37 38 to 54 7 to 10
drag_water_level_160ac_desktop 19 1,028 to 1,060 155 to 168
settle_water_level_160ac_desktop 48 to 67 7 to 10 1
drag_slope_rule_160ac_desktop 19 601 to 679 78 to 82
sun_day_first_picture_160ac_desktop 78 to 110 145 to 189 13 to 18
sun_day_settled_160ac_desktop 1,876 to 1,924 2,377 to 2,431 141 to 154
drag_sun_height_160ac_phone_emulated 19 1,335 to 1,470 256 to 281
settle_sun_height_160ac_phone_emulated 19 to 32 23 to 119 7 to 13
drag_water_level_160ac_phone_emulated 19 509 to 609 73 to 74
settle_water_level_160ac_phone_emulated 50 23 to 40 3
  • Every drag kept to one frame. The longest gap between frames in each drag was 18 or 19 ms in all four runs, one frame at 60 a second: water level at both sizes, sun height at both sizes, a slope rule's value. In software on the same laptop the same drags measured 33 to 300 ms.
  • A day of sun's first picture was on the map 78 to 110 ms after the day was chosen, and its settled sentence 1.9 s after.
  • A project opened to a working map in 0.95 s.
  • What this still is not: a person's hand on a trackpad, a phone, or a machine slower than this one. The emulated phone rows are this laptop at a phone's window size.

What these runs found. Before the mend, three of four runs with the laptop's graphics failed before anything was timed: the test stores a built terrain and waits for the page to take it, and the page was still on the terrain preview 15 seconds later. In software the same test passes every time. The cause is in how an open project hears that a build has finished. The page listens on a realtime channel, and the channel can say it has joined a moment before the server's feed of changes is listening; what happens in that moment is never sent, and the page learned of it only at its next 15 second poll. A fast browser joins early enough to fall into the gap. The page now reads the jobs again when the feed itself says it is listening (apps/web/src/lib/jobs/job-feed.ts, with a test of that order of events), and with that, four runs of four passed. A real build takes half a minute and seldom ends inside the gap, but every rejoin of the channel opens it again: a tab back from the background, a laptop waking. So software drawing on CI had hidden a fault that only a fast machine shows, and a timing on a real machine is worth taking for more than its figures.

See where water goes (plan v4 items 542 and 545)

Measured on 2026-11-30 on an Apple M5 (arm64), Node v26.5.0, with the machine busy with other work (load average 4 to 6), twice, by node apps/web/scripts/benchmark-water-path.mts. It reads the synthetic 160-acre, 1 m timing terrain's four stored grids (apps/web/e2e/fixtures/synthetic-160ac-1m-*.tif, 805 × 805, 16 low spots) with the app's own readers, then times the water path's one calculation, the water-path task of terrain-calc.ts that the Water step's runner sends the terrain worker: the rain comparison once without tile, where the water leaves and the culvert offers. These are elapsed times in Node, each the difference of two performance.now() readings, so they include any wait for a core while the machine was busy, and are not CPU time (corrected 2026-12-02, review finding D8); nor are they the browser's frames: the worker's messages, the map drawing the picture and React's rendering come on top, and a browser drag of the slider hasn't been measured yet.

What Two runs
Reading the four stored grids with the app's readers, from files served by byte range 130.8 and 130.9 ms
A first raindrop (traceRaindrop) 1.4 and 1.6 ms
The first water answer at 1 in, where the water leaves worked fresh 82.4 and 83.3 ms
Where the water leaves alone (whereWaterLeaves), worked once a flow grid and kept median 15.5 and 15.7 ms
Each step of a drag of the rain slider, 32 steps from 0.25 to 8 in, each a full answer median 32.7 and 33.2 ms, slowest 58.2 and 62.3 ms
The water held, drawn coarse while the slider moves (every 2nd cell) and full at rest 0.5 ms coarse, 1.4 to 1.5 ms full

Dragging the rain slider on a 160-acre field at 1 m. Each step's whole answer takes about a thirtieth of a second of the worker's time, off the page's thread, and a step that arrives while one is working replaces any still waiting (latest wins), so the slider and the map stay with the hand and the figures catch up within one step. The picture drawn on the page's own thread while it moves takes half a millisecond.

From a saved area to a first raindrop. What it is made of, as far as it can be measured here:

  • The build, on the worker. Saving the area starts the search and the build with no click (plan v4 item 518). A 160-acre build through the button took a median of 30 s and at slowest 42 s on production ("160-acre DEM terrain", above), including the search, the download and the processing. That is most of the time.
  • Reading the ground in the browser. Once the build lands, the step reads the heights and the flow, ponding and outside-entry grids: 131 ms here from local files, so a person's download of the four files comes on top, and depends on their connection.
  • The first answer and the first drop. 83 ms for the water's answer, and under 2 ms to trace a drop once it is tapped.

So a first raindrop comes about as soon as the build lands, a median of half a minute after the area is saved. The browser tests stand in for the worker with recorded fixtures (apps/web/e2e/purpose-walks.ts, water-path.spec.ts), so they say nothing of the build's time, and the time from a landed build to the water's answer on the map in a real browser hasn't been timed.

A rule, a view and a day of sun (plan v4 item 507)

How long the three newest tools take on a 160-acre field at 1 m: a rule of slope (plan v4 item 448), what can be seen from a point (item 494) and a day of sun (item 498). The laptop's figures are measured, in the worker below, and in a browser for the rule and the day of sun ("All fourteen in a browser on the named laptop", above); the phone's are not yet, and the way to take them is below.

How the laptop's were taken. node apps/web/scripts/benchmark-rule-view-sun.mts, from the repo root, with no browser. It reads the synthetic 160-acre timing terrain's DEM (apps/web/e2e/fixtures/synthetic-160ac-1m-dem.tif, 805 × 805 = 648,025 cells at 1 m, 160.1 acres, made-up heights with 16 low spots) with the app's own reader, and sends executeTerrainTask, the terrain worker's own code, the tasks the screens send, picture included: slope-rule-draw as slope-tools.tsx builds it (the 3 by 3 window, the whole terrain, a picture every 2 cells while a value is dragged and every cell at rest), viewTask as sight-tools.tsx builds it (an eye 5.5 ft up, the starting distance of 1,320 ft, a quick pass on cells 4 times wider and then the full one), and sun-draw with sunHoursTask and sunShadeTask as sun-layer.tsx builds them (a day's quick pass on 4 m cells every 20 minutes, its full pass on 1 m cells every 10 minutes). The sun is worked for Fargo, ND (46.88° N, 96.79° W, in the fixture's UTM zone 14, America/Chicago); the heights are made up, so only the sun's path is real. Over what stands on the ground, a copy of the field with every 53rd cell 8 m taller stands in for trees, as sight-and-sun.md timed it. Each figure is the median of 5 runs (3 for a view's and a day's full pass), after one run not counted, except the drags, which are each of 32 steps. These are elapsed times of the worker's calculation in Node, each the difference of two performance.now() readings: they include any time the process waited for a core while other work ran on the laptop, so they are not CPU time, and are not the same measure as CI's renderer CPU figures (corrected 2026-12-02, review finding D8; the figures are unchanged). The worker's messages, the map drawing the picture and React's rendering come on top.

The machine. An Apple laptop, model identifier Mac17,4, Apple M5, 10 cores, 16 GB, macOS 26.7.3 (25G342), Node v26.5.0 (from sysctl hw.model machdep.cpu.brand_string hw.memsize hw.ncpu, sw_vers and node -v). Measured twice on 2026-12-01, with other work running on it: load average 3.7 to 5.5.

What Laptop, first run Laptop, second run A phone (needs a person)
A rule: the first rule, slope worked fresh (1 to 3%, facing east through south to west) 29.4 ms 23.3 ms Not yet measured
A rule: each step of a drag of its top value, 32 steps from 0.5 to 8.25%, slope kept 12.2 ms (slowest 29.1) 6.7 ms (slowest 19.4) Not yet measured
A rule: once the value rests, the full picture 20.9 ms 10.1 ms Not yet measured
A view from the middle, 1,320 ft: quick pass 16.2 ms 11.5 ms Not yet measured
A view from the middle, 1,320 ft: full pass 269.2 ms 202.9 ms Not yet measured
A view from the middle, 1,320 ft, over what stands on it: full pass 270.7 ms 131.8 ms Not yet measured
A view from a corner, 805 m, the whole field: quick pass 15.9 ms 12.6 ms Not yet measured
A view from a corner, 805 m: full pass 472.7 ms 473.8 ms Not yet measured
A view from a corner, 805 m, over what stands on it: full pass 118.7 ms 239.2 ms Not yet measured
A day of sun, 21 June: quick pass 62.4 ms 68.8 ms Not yet measured
A day of sun, 21 June: full pass 2.82 s 2.56 s Not yet measured
A day of sun, 21 June, over what stands on it: full pass 8.19 s 6.86 s Not yet measured
A day of sun, 21 December: quick pass 56.0 ms 41.8 ms Not yet measured
A day of sun, 21 December: full pass 1.65 s 1.57 s Not yet measured
A day of sun, 21 December, over what stands on it: full pass 6.53 s 6.07 s Not yet measured
Shade at a time: each step of a drag of the time slider, 21 June, 32 steps, quick pass 3.4 ms 3.3 ms Not yet measured
Shade at a time: once the slider rests at 18:00, full pass 27.3 ms 29.9 ms Not yet measured

The script prints every row with its fastest and slowest run as well.

In a browser, on CI's machine. Three of these are also timed in the browser by apps/web/e2e/speed-budgets.spec.ts, on the same synthetic terrain in the app, at 1,440 by 900, with the map, the worker's messages and React's rendering included. The machine is CI's: GitHub Actions ubuntu-latest, headless Chromium with software WebGL (SwiftShader), one worker, the machine the other browser budgets were set on. Measured on 2026-12-01 in three targeted runs (e2e-targeted.yml, runs 46689531800, 46689607047 and 46691184090) of two repeats each, then a fourth (46694493264) with the budgets enforced. In the fourth, the first attempt of a day of sun took its first picture 1,094 ms, past the 678 ms the six runs had set, and passed on its retry, so that budget was set again by the same rule from every run, and the last two figures in each row are the fourth run's (a day's settled sentence wasn't reached on the failed attempt). A day of sun is set to Central time and read Through a day; December 21 is chosen and, once its first look is on the map, June 21, while December's full pass runs. The budget is set by the rule the file uses (the worst run plus 35 percent, and at least 100 ms more), under "How the budgets were set" above. That session ran no browser on the laptop. The orchestrating session timed all three there in a browser on 2026-12-02, before the sun lane's mend: under "All fourteen in a browser on the named laptop".

What (key in speed-measurements.json) CI, each run (in order) Budget on CI's machine
A rule: longest frame gap while its top value is dragged, 32 steps (drag_slope_rule_160ac_desktop) 2,517, 1,900, 1,300, 1,550, 2,633, 1,867, 1,250, 917 ms 3,555 ms
A day of sun: choosing June 21 to its first picture on the map (sun_day_first_picture_160ac_desktop) 342, 502, 364, 355, 332, 356, 1,094, 407 ms 1,477 ms
A day of sun: choosing June 21 to its settled sentence (sun_day_settled_160ac_desktop) 5,870, 6,277, 4,369, 4,236, 5,704, 5,644, 5,658 ms 8,474 ms

The first picture was on the map in a third of a second to 1.1 s on CI's machine in those runs, inside the spec's 2 s. The browser test checked that outright until 2026-12-01, and no longer does, since CI's runner can't show a wall-clock line (2,224 ms in nightly 46617503936). It is shown on the laptop and the phone ("What CI holds since 2026-12-01", above). The full pass settles in 4.2 to 6.3 s there, against 2.6 to 2.8 s of the worker's time on the laptop, since CI's processor is slower and the map draws in software; on CI the card says it's a first look for that long. The frame gaps while a rule is dragged, 1.3 to 2.6 s, are of the same order as CI's for Sun height and Water level on this terrain (1.1 to 3.1 s and 0.5 to 1.6 s, in the table above), where a laptop holds 50 to 83 ms: CI's figures catch a change that makes things much slower and say nothing of a person's machine. On the laptop, in a headless browser that also draws in software, a rule's longest frame gap was 33 and 50 ms and a day of sun's first picture came in 214 and 120 ms ("All fourteen in a browser on the named laptop"). A view from a point is timed in no browser, and a phone's figures for these three are still to be taken, as "On a phone" below sets out.

Against the budgets. No figure in plan v4 is a budget for these tools in milliseconds. PR 53's "Done when" asks that dragging a rule's value leaves the map responsive, PR 58's that a view and a day of sun are timed, and the spec's section 7 asks that edits return revised calculations within 2 s ("Edits return revised calculations within 2 s", above). sight-and-sun.md set the view's limit of 2 million cells for a full pass of about 3 s at worst on a loaded laptop, with the quick pass in a fifth of a second.

  • A rule keeps up with a drag: each step is 7 to 12 ms of the worker's time, under the 16.7 ms of one frame at 60 a second, and slope is worked once per terrain and kept.
  • A view is well inside its own limit: the quick pass is 12 to 17 ms and the full pass at most 0.47 s on the whole field, against the 3 s it allows.
  • A day of sun meets the 2 s line with its first picture, and keeps its detail. Decided for the owner on 2026-12-01: the 10-minute step and the project's own cells stay, because an hour of sun a person can trust is worth more than a second nobody waits through. The first picture, the quick pass, is 42 to 69 ms of the worker's time and is on the map at once; a browser timing showed it under 2 s from choosing the date on CI's machine on 2026-12-01 ("In a browser, on CI's machine", above), though CI no longer holds that line. The full pass over bare ground is allowed 3 s on the laptop named above, the limit sight-and-sun.md already sets for a view, and takes 2.6 to 2.8 s at midsummer. Over what stands on the ground it runs longer, 6.1 to 8.2 s, and says so on screen. From the first picture until the full pass settles, the card says under its sentence that its hours are a first look and the finer picture is being worked out (firstLookDayWords in lib/terrain/sun-words.ts, chosen by lib/terrain/sun-card.ts); the hours it shows meanwhile are the first look's, and only the settled sentence is announced, once. Nothing waits on it: both passes run off the page's thread, so the map pans, and the date can be changed, which ends the pass under way at once (TerrainCalcClient.interrupt) so the new date's first picture doesn't queue behind it. A day is not dragged; shade at a time, which the slider drags, is 3 ms a step.

Where a day of sun's time goes. A full pass is one shade picture for every 10 minutes the sun is up: on 21 June at Fargo the sun is up 949 minutes, so about 95 pictures over 648,025 cells, and on 21 December 508 minutes, about 51. Each picture follows a line from every cell toward the sun until it rises above the highest point of the ground, skipping blocks of cells it is already above. One picture costs 24 ms with the sun 66.6° up and 73 ms with it 1.3° up over bare ground, because a line toward a low sun runs much farther before it clears the highest ground; 95 of them come to the 2.6 s measured. Over what stands on it, the same pictures cost 33 ms and 108 ms: the stand-in trees raise the highest point by 8 m, so every line has to climb 8 m more before it clears, and, scattered every 53rd cell, they leave few blocks of cells low enough to skip. That stand-in is harsher than most real canopy, which clusters and leaves open fields to skip, so a real field's time over what stands on it isn't known from it. The engine was not changed in this item; the step between sun positions (SUN_DEFAULTS.stepMinutes) and the cells a day's full pass may take (maxFullDayCells) are where time could be traded for detail, and that is a choice for its own item.

On a phone (needs a person). To fill the right-hand column: on a real iPhone (Safari) or Android phone (Chrome), signed in, open a project whose terrain is about 160 acres at 1 m, such as a quarter section near Fargo, ND, built with a 1 m flight, and connect the phone to a computer's Safari Web Inspector (Timelines) or Chrome's remote DevTools (Performance). Record, for each, from the tap to the moment its live region's sentence changes (each of the three announces once its full result settles, apps/web/src/lib/ui/live-results.ts), and for the quick pass to the first picture on the map:

  • A rule: the slope tools' Ground that meets a rule, with a slope range typed; then drag its top value across its track and note the longest frame gap while dragging, and the time from the release to the sentence's new acres.
  • A view: View from here, at the starting 1,320 ft and 5.5 ft eye, tapped near the middle of the field and then at a corner: the time to the quick picture and to the sentence with the acres seen.
  • A day of sun: Sun and shade with a date and no time, on 21 June and on 21 December: the time to the quick picture and to the sentence with the hours. Then set a time and drag the time slider, noting the longest frame gap.

Write the phone's make and model, its OS and browser versions, the date, the project's acres and cell size, and each time in this table, in place of "Not yet measured".

What this doesn't establish

  • A person's machine. Automated browser timings run in headless Chromium with SwiftShader software WebGL. The whole-grid timings above are elapsed times of Node runs on an Apple M5 (not CPU time; see review finding D8), not browser responsiveness.
  • Production for anything but terrain. Only the terrain benchmark has run there.
  • Real tablets and phones. An emulated 390 x 844 touch viewport on a laptop or CI CPU does not measure mobile SoC performance, mobile Safari/Chrome WebGL, or thermal throttling; item 137 and the phone column for item 375 still need a person with a real device.