Reference measurements from opening real scans in OpenLiDARViewer. These are field observations, not a formal benchmark suite: hardware, browser, dataset, and the rendering detail you pick all change the numbers. They are recorded so the project has a concrete sense of what "it works" means in practice.
Every table below is version-pinned in its heading. A row whose code path was not touched between releases keeps its original measurement; the version pin is when the figures were captured, not a claim that they have been re-run on every release.
Two suites drive the real terrain pipeline over seeded synthetic clouds and write a result tree anyone can re-derive every published figure from.
npm run benchmark:repro # benchmark 1 only
npm run benchmark:scaling # benchmark 2 only
npm run benchmark:quick # both, then verify
npm run benchmark:scaling:gc # benchmark 2 with forced GC available
npm run benchmark:quick:gc # both with forced GC, then verify
npm run benchmark:verify # re-check latest/ without re-measuring
npm run benchmark:verify:archives # the same checks over every archive
The published figures come from benchmark:quick, which runs benchmark 1
first. Benchmark 2's tiers each run in their own child process, so they do not
inherit that warm state, but the parent process does, which is why the timings
that matter are taken in the children.
Benchmark 1: deterministic reproducibility. One seed (20260726),
250,000 points, six warm-ups, ten recorded runs, fixed terrain parameters. It
passes only when every science-scoped artifact hash, every scalar output, the
terrain-complexity summary, the scientific record with build identity and
timestamps removed, and the application's own content hash are identical
across all ten runs, the processing manifest verifies every time, and no stage
is missing or failed. The comparison tolerance is exactly zero: on one machine
over one seed this is deterministic arithmetic, so any difference at all is the
finding, not noise to absorb.
Benchmark 2: synthetic scaling. 50k / 100k / 250k / 500k / 1M points,
six warm-ups and five recorded runs per tier, strictly sequential, each
tier in its own child process. Run in one process the ladder order is
perfectly confounded with process history (JIT state and heap growth advance
alongside the point count) and measured both ways on one machine, the
identical 250k workload reported peak RSS about 50 % apart depending only on
what had run before it. The isolation mode is recorded in raw.json and in the
manifest, so a reader can always see which regime produced a curve.
It reports a measured curve and claims no complexity class: five tier measurements on
one machine cannot separate one from another. The 1M tier is not optional: if it
cannot complete, the failed tier is preserved with its exact reason and the
suite fails until the limitation is written into acceptedTierFailures.
Median analysis throughput over the seeded synthetic ladder is non-monotonic:
239k points/s at 50k, rising to 257k at 250k, then falling to 207k at 1M. The
tiers are comparable workloads (the fixture holds point density constant at
4 pts/m² and scales tile extent as sqrt(N), so grid cells scale with point count
and points-per-cell stays invariant at about 16 across the whole ladder) and
the work lives almost entirely in the dtm stage.
We do not attribute the shape to input size, and the two limbs are not equally solid. The rising limb is not resolvable. The 50k→250k gain is about 7 % against within-tier coefficients of variation of 0.09 and 0.13 on those two tiers, so it sits inside the noise of the machine these numbers came from. An earlier single-process run with one warm-up showed a larger rise, and that version of the curve was an artefact of warm-up state advancing alongside the tier. The falling limb is larger than the noise: 1M runs 20 % below the 250k figure with a within-tier CV of 0.02, and peak RSS climbs from about 310 MiB at 250k to 870 MiB at 1M, so allocator pressure was the obvious candidate. It has since been tested directly; see Garbage collection is not the explanation below.
Process-per-tier isolation removed most, not all, of the memory confound. The identical 250k workload reports peak RSS around 310 MiB in a tier child and around 390 MiB inside the reproducibility suite, which runs sixteen 250k analyses in one process rather than eleven. The remaining gap is process history within a single tier, and it is the reason peak RSS is quoted per tier rather than compared between suites.
The curve is reported as a measured artefact of this configuration on this machine, not as a scaling law.
The suites can now be run with global.gc available, so the falling limb can be
measured with collection forced between runs instead of left to the runtime.
npm run benchmark:scaling:gc and npm run benchmark:quick:gc set
BENCHMARK_FORCE_GC=1, which vitest.config.ts turns into an --expose-gc on
every pool worker, including the workers of the child vitest run the ladder
spawns per tier. Forced GC is still never a pass condition: without the flag the
suites record forcedGcAvailable: false and carry on exactly as before. The
mode reaches manifest.json as forcedGc, with what was requested and what the
runs actually observed kept apart, so two result sets can never be confused and
a flag that failed to arrive shows up as a mismatch on the summary page rather
than as a quietly mislabelled table.
Eight ladders were run on one machine, alternating the two modes so drifting
background load fell on both: four with GC uncontrolled, four with it forced,
load average 5.91 to 9.10 on 14 cores throughout. Every figure below is read out
of the archived scaling/raw.json files by scripts/benchmark-compare-gc.mjs.
Medians pool a mode's four ladders; the CV column does not pool, because a
within-tier CV is a statement about the five runs inside one process.
| tier | analysis ms, default | analysis ms, GC forced | points/s, default | points/s, GC forced | peak RSS median MiB, default | peak RSS median MiB, GC forced | peak RSS max MiB, default | peak RSS max MiB, GC forced | CV per ladder, default | CV per ladder, GC forced |
|---|---|---|---|---|---|---|---|---|---|---|
| 50k | 220 | 263 | 227,495 | 190,021 | 232 | 144 | 237 | 147 | 0.040 to 0.104 | 0.036 to 0.060 |
| 100k | 377 | 451 | 265,381 | 221,897 | 278 | 183 | 295 | 185 | 0.035 to 0.161 | 0.016 to 0.027 |
| 250k | 871 | 927 | 286,941 | 269,670 | 372 | 266 | 423 | 271 | 0.018 to 0.081 | 0.029 to 0.048 |
| 500k | 1865 | 1858 | 268,068 | 269,125 | 559 | 366 | 608 | 371 | 0.005 to 0.024 | 0.018 to 0.025 |
| 1M | 4684 | 4687 | 213,480 | 213,336 | 812 | 757 | 946 | 777 | 0.007 to 0.034 | 0.008 to 0.018 |
Forcing collection did what it was supposed to do to the memory column. Peak RSS falls by 30 to 38 % at every tier from 50k to 500k, and the run-to-run spread at those tiers nearly disappears: the 500k tier's high-water mark drops from 608 to 371 MiB. So the runs are genuinely measuring a different allocator regime, not the same one with a flag set.
The falling limb survives it. It is present in all eight ladders without exception: 1M throughput sits 24.3, 29.8, 30.1 and 30.9 % below the 250k tier with GC uncontrolled, and 18.6, 21.9, 22.4 and 23.8 % below it with GC forced. The evidence supports the second of the three readings that were open: the shape persists and is therefore not explained by garbage collection.
Two details carry most of that conclusion, and both cut against the GC hypothesis rather than for it. The 1M tier is unchanged by forced collection: 4684 ms against 4687 ms, 213,480 points/s against 213,336. Removing the ladder's retained garbage everywhere below 1M moved the bottom of the curve by nothing at all. And the 1M tier's own footprint barely moves either, 812 MiB down to 757: a full collection before every run reclaims about 7 % there against 38 % at 500k, which says the memory growth along the ladder is mostly live working set rather than garbage. The original caveat named the RSS climb as the reason to suspect allocator pressure; that climb is largely not garbage, and the tier it peaks at is the one tier forced GC cannot relieve.
What forced GC does move is the peak of the curve, not the trough. The 50k, 100k and 250k tiers get slower under it (220 to 263 ms, 377 to 451, 871 to 927), which is the cost of re-growing a freshly compacted heap, and lowering the reference point is the whole of why the measured drop shrinks from about 30 % to about 21 %. That is an effect on what the limb is measured against, not evidence about the limb.
Stated limits, because this is one experiment on one machine. Four ladders per mode, five recorded runs per tier. The host was not idle (load average 5.91 to 9.10 on 14 cores) and the within-tier CVs reflect it, reaching 0.161 at 100k default against the 0.02 quoted from an idle run elsewhere in this document. The two modes' limb ranges (24.3 to 30.9 % and 18.6 to 23.8 %) do not overlap. They are separated by half a percentage point at the nearest edge, so the size of the shrinkage is not something four ladders at this load resolve. The claim made here is only the one the data carries: at every tier, in both modes, the 1M throughput is well below the 250k throughput, and controlling collection does not remove it.
Contour count is not comparable across tiers. The fixture holds point density constant and scales tile extent as the square root of the point count, and its landform amplitudes are fractions of that extent, so vertical relief grows with the tier and the interval selector steps up part-way along the ladder. The chosen interval and the relief it was chosen from are both columns in the table for exactly this reason.
Six warm-ups, not one. A 24-run trace of the 250k analysis decays gradually rather than falling off a cliff (run 1 about 37 % above the asymptote, runs 2-6 still 5-15 % above it, flat from run 7) so one warm-up left the first two recorded runs about 11 % slow and three still left about 8 %.
Six does not fully remove it either. On a loaded machine the first recorded run still comes in several per cent high, and a freshly spawned tier process has been seen to spike 28 % on its first recorded run. The transient tracks machine load and allocator state, not the pipeline, so nothing fails on it: a benchmark that goes red because something else was running is a benchmark everyone learns to ignore.
It is measured instead. Every result set publishes the coefficient of variation including run 1 and excluding it, side by side. Quote the second as the repeatability figure and say that is what you quoted; the gap between the two is the size of the residual transient. For reference, on the machine these numbers were captured on, including run 1 gave a CV near 0.04 where excluding it gave near 0.02, so the difference is not decorative.
manifest.json records the host's 1/5/15-minute load average, and it is the
first field to check before comparing two result sets. The same suite at the
same commit gave a CV near 0.02 on an idle machine and near 0.10 at a load
average of 7 on 14 cores. That difference is entirely outside the software.
Alongside that, both suites report where run 1 sat relative to the later runs: an outlier-resistant band (within three interquartile ranges, or 5 % of the median) plus two order statistics as diagnostics. The order statistics are diagnostics on purpose: under a stationary process, "run 1 is inside the rest's min-max range" fails about 2/n of the time and "inside their IQR" about half the time, so neither could ever have been a pass condition. The band is withheld entirely below five comparison runs, where its width would come from an IQR estimated on too few points.
The tables never sum the stage column: the
isolated rasterize and descriptors timings re-run work the dtm stage
already does, so the total comes from the driver's pipelineDurationMs() and
the leaves are labelled and kept apart. They also never report a number that was
not measured: an unavailable value says unavailable and carries its reason,
including peak heap, which no sampler can observe between synchronous stages.
Build-scoped hashes (the scientific record and the processing manifest) track the git commit and the Node version of the machine that ran the suite. They are reported separately and are not part of any pass condition; two machines are expected to differ there, and that difference says nothing about whether the science reproduced.
Quantiles throughout (median, quartiles, IQR) use the type-7 definition,
R's and NumPy's default. The convention is written into every summary file, so
a reader recomputing an IQR from raw.json in either tool lands on the
published number. sd is the sample (n − 1) standard deviation and CV is
sd/mean; with fewer than two runs both are reported as unavailable with a
reason rather than as zero. Where a table gives a peak-memory figure it names
its estimator in the column header: median across runs and max are given
separately, never one silently standing in for the other.
Output lands in benchmark-results/: latest/ is replaced on every run,
archive/<UTC timestamp>-<short commit>/ is immutable and a second write to an
existing archive is refused. manifest.json records the commit and whether the
working tree was clean, the host and toolchain versions and the configuration.
It also holds a SHA-256 for every file; benchmark:verify recomputes all of them, re-derives every summary
statistic from the raw values and re-renders every Markdown, HTML and CSV
file (the top-level summary.md and summary.html included) from the
published JSON, so a hand-edited figure fails even when the digest is refreshed
to match. benchmark:verify:archives applies the same checks to every archived
result set.
GPU upload, first rendered frame, frame rate and time-to-interaction are browser measurements. This runner is Node-only and reports them as declared stages with no number: never as zero, and never as an estimate.
The scripts are benchmark:repro, benchmark:scaling, benchmark:quick,
their :gc variants, benchmark:verify and benchmark:verify:archives. There
is no browser script,
and benchmark:quick records browser under notRun with the reason. That
gap is a decision, not a task someone forgot.
Measuring the real COPC workflow means measuring the running application, so it
needs an instrumentation bridge inside the app that reports GPU upload, first
rendered frame, frame rate and time to interaction. The live entry chunk is
close to its hard ceiling (scripts/check-bundle-budget.mjs carries the current figure),
so a bridge cannot be linked into the shell. It has to be dynamic-import only
and gated so it cannot load during normal use, which is a design problem before
it is a measurement one.
The measurement conditions are the other half. A COPC number is only meaningful from a verified cold cache against a real remote dataset, both of which the Node runner has no way to establish or to prove it established. Until those two pieces exist, browser figures are recorded by hand under the protocol below, where the conditions are stated and a reader can see what was controlled.
A third suite asks a question the two above cannot: does the same commit, over the same seeded fixture, produce the same science on a different machine and a different operating system.
npm run benchmark:repro:portable # record this platform's leg
npm run benchmark:compare-platforms # compare two or more recorded legs
The name is narrower than platform independence and stays that way. What the
suite can establish is a statement about the platforms whose legs it was
handed, on one Node major version, at one commit. Nothing in it generalises to
an untested platform. The workflow .github/workflows/benchmark-portability.yml
runs a matrix over ubuntu-latest and macos-latest on Node 22, uploads each
leg, then downloads both and compares them. Windows is out of scope for this
workflow. It is little-endian and would be a legitimate third leg, but it has
not been run.
The seeded source-cloud hash, the canonical DTM bytes, the DTM dimensions and cell size, the terrain scientific summary, elevation min and max, the contour artifact and contour count, terrain complexity, the build-stripped scientific record, the application's own science-content hash, the processing manifest's scientific content, and every scalar scientific value. Tolerance is exactly zero, the same tolerance benchmark 1 uses and for the same reason.
Every difference below is reported, never dropped. The expected differences are execution time and memory observations; the host
description (CPU model, operating system, architecture, Node and V8 metadata);
timestamps; build identity and everything derived from it; and archive paths. comparison.json lists each observed difference
with the value every platform reported, and names the categories excluded by
construction.
Every downstream artifact is a function of
the seeded source cloud, so a generator that produced different points on two
hosts makes every later hash differ too. Sorted by hash that reads as "the
science diverged", which would be the wrong conclusion: the pipeline may be
perfectly reproducible over an input that is not. The source-cloud hash is
therefore checked before anything else, a mismatch carries its own status
(generator-not-portable), and the downstream comparison is reported as
suppressed rather than run and blamed.
The generator's PRNG is integer arithmetic and exact on any engine. Its surface
uses Math.sin, Math.cos and Math.exp, which ECMAScript leaves
implementation-defined, and syntheticCloud.ts flags that in its own header as
the one place byte-identity rests on the engine. If this suite ever fails, that
is the first thing to check. It would be a real portability finding about
transcendental functions, not a defect to normalise away, and it is not grounds
for widening the comparison.
Several science-scoped artifacts are raw typed-array bytes, which serialise in host order. Every leg records its byte order, and a leg from an unsupported architecture halts the comparison by name instead of producing a mismatch that names the wrong cause. The claim covers little-endian platforms only.
Runtimes are never pooled. A median over two machines
describes neither of them. summary.md carries one row per platform with
median analysis time, the coefficient of variation, and peak RSS. The result
this suite reports is output identity, not which host is faster.
benchmark-results/portability/ holds manifest.json,
environments.json, comparison.json, comparison.csv, summary.md, and one
subdirectory per platform. Every human-readable file is rendered from
comparison.json, and the verifier re-derives the comparison from the platform
records in the subdirectories before re-rendering both and comparing byte for
byte. An edited verdict therefore fails even when every digest in the
manifest has been refreshed to match the edit.
Run on one machine the command
writes a single-platform result and states that the cross-platform claim
remains unestablished. CI sets BENCHMARK_REQUIRE_PLATFORMS, so a missing leg
fails the job rather than publishing a one-platform result that reads like a
comparison.
Slope, aspect, hillshade and the DTM min/count scatter have two
implementations. The CPU one delegates to hornSlopeAspect,
shadeFromSlopeAspect and scatterMinCountReference, computes in f64 and is
the reference by contract. The GPU one is WGSL compute, f32 throughout. This
suite asks whether the second agrees with the first, and to what precision.
npm run benchmark:backends # the CPU control, and what this host could run
npm run benchmark:backends:gpu # the GPU leg, in a browser with a real adapter
Output lands in benchmark-results/backends/: one JSON per leg, the comparison,
and comparison.md.
Node exposes no WebGPU adapter. The engine detects that and returns the CPU reference, silently, which is what a user on a WebGL2-only device should get. A suite that asked for the GPU and compared whatever came back would therefore compare the CPU against itself on every Node host and report flawless agreement.
Each leg records two separate fields: what it requested, and what the engine's
own getComputePath() said executed. The comparator reads the second. A GPU
claim is believed only from a browser leg carrying an adapter descriptor read
from navigator.gpu. Nothing in Node can produce one, so an injected backend
factory cannot dress the CPU implementation up as a GPU.
When the requested backend did not execute, the status is backend-unavailable
and the comparison is suppressed. No tolerance is evaluated and no agreement is
claimed. Three negative controls in tests/benchmark/backendEquivalence.test.ts
force that situation: a factory reporting no WebGPU, a factory whose device
request fails, and a factory handing back the CPU backend under a GPU label,
and they assert the suite refuses to call any of them agreement.
benchmarks/backends/tolerances.ts carries each threshold with the magnitude it
was derived from, and the derivation is a computed constant rather than a
rounded figure.
| quantity | gate | what f32 alone accounts for |
|---|---|---|
| slope | 1e-4 rise/run | 6.1e-5, from 32 f32 operations at 2⁻²³ quoted at a 16:1 rise/run cap |
| aspect | 1e-4 rad | 5.3e-6, the gradient relative error through atan2 plus 4 ulp |
| hillshade | 1 grey level | the 1/255 quantisation step, not a floating-point figure |
| scatter min/count | exact | order-independent integer-stable reductions have no floor |
An observation above the floor and below the gate passes and is printed as an observation, because it is a difference f32 arithmetic does not fully explain. An observation above a gate is a finding: the report names the quantity, the magnitude and the backend, and no threshold moves.
backend-unavailable, record-not-credible and parameters-diverged all
suppress the comparison rather than run it. The last one covers legs taken at
different commits, different probe geometries or edited engine constants: the
workload descriptor is hashed and checked before any measurement is read, so a
parameter difference is never attributed to a backend.
Before the GPU is measured, the CPU backend is put through the same workload and must disagree with the CPU reference nowhere at all. Both sides are the same f64 code, so anything but zero means the harness is measuring itself.
The comparison covers a 64×64 derivative grid over three geometries and a 24×24
scatter grid, so it bounds nothing about a tiling error that only appears past
one dispatch tile. The ground filter and all four rasterizeDtm reduction modes have no GPU
implementation and run the CPU functions under both backends. The surfaces are
the engine probe fixtures rather than real scan data.
WGSL leaves atan2, sqrt and operation fusion at implementation precision, so
a result covers the adapter its leg ran on and no other. Nothing here is a
timing measurement.
Headless Chromium exposes navigator.gpu but returns no adapter, so
benchmark:backends:gpu runs headed. On a Metal-3 adapter, with the CPU
control at zero on every quantity:
| quantity | max observed | gate | cells |
|---|---|---|---|
| slope | 9.54e-7 rise/run | 1e-4 | 4096 |
| aspect | 2.26e-6 rad | 1e-4 | 11949 |
| hillshade | 0 levels | 1 | 4096 |
| scatter min/count | 0 cells differing | 0 | 576 |
Every quantity sits inside the f32 representation floor. Nothing was found above it, and no threshold was adjusted.
benchmark:repro fixes seed 20260726, runs the analysis ten times and
requires every science-scoped hash and every scalar to be identical at a
tolerance of exactly zero. That establishes determinism at one seed. Stability
is a different claim, and the gap between them is not academic: a pipeline can
be bit-exact on replay and still return a materially different answer for the
next draw from the same distribution, in which case every published figure is a
property of one fixture rather than of the method.
npm run benchmark:seeds
Thirty-two independently seeded fixtures from the same generator at the same
density, 60,000 points each on the 2 m grid, and the analysis run over every
one. Output lands in benchmark-results/seeds/ as sweep.json and
summary.md; every figure in the summary is recomputable from the raw values
the JSON carries.
benchmarks/seed/classification.ts places every published scalar in one of two
groups, with the reason, and every invariant tolerance with the magnitude it was
derived from. Nothing is classified after seeing a result.
Invariant. Fixed by the configuration or by the surface definition rather than by which points were drawn. The DTM grid geometry follows from the tile extent and the cell size, both pinned. The fitted slope of a planar fixture follows from the plane. These are asserted.
Variable. Properties of the sample: the extreme elevations are order statistics of the draw, the surviving return count is the ground filter's verdict on one set of returns, the contour counts follow the realised surface. A distribution is reported and nothing is asserted. An assertion over a random quantity either holds by construction or fails at a rate nobody chose. The specific shape avoided is a check of the form "run 1 falls inside the IQR of the rest", which under a stationary process fails about half the time. The warm-up order statistics elsewhere in this document are diagnostics for the same reason.
There is no third category. contourIntervalM is the quantity that invites one:
every seed in the recorded sweep landed on 0.5 m, but the interval is selected
from the realised relief, so it is a function of the sample and is classified
variable. One distinct value over a finite sweep is not invariance.
| quantity | unit | value over 32 seeds | observed range | tolerance | fraction of tolerance used |
|---|---|---|---|---|---|
cellSizeM |
m | 2 | 0 | 0 | exact |
gridCols |
count | 62 | 0 | 0 | exact |
gridRows |
count | 62 | 0 | 0 | exact |
gridCellCount |
count | 3844 | 0 | 0 | exact |
planeMeanSlope |
rise/run | 0.100089 to 0.100141 | 5.14e-5 | 6.0e-4 | 0.086 |
The grid geometry is tolerated at exactly zero because the fixture is pinned away from a cell boundary. 60,000 points at 4 pts/m² is a 122.474 m tile, which is 61.24 cells on the 2 m grid: 0.474 m of margin to the nearest boundary against a smallest-drawn-coordinate fluctuation of about 2 mm. A draw would have to consume 232 times its own scale to move a column count.
The plane tolerance is a noise-propagation bound, not a figure read off a run. Each cell aggregates about 20 returns by median, so the per-cell noise is 0.05/sqrt(20) = 1.12e-2 m; the Horn stencil turns independent per-cell noise of sd s into sqrt(12)·s/(8·cellSize) = 0.217·s per gradient component; averaging over 9,604 interior cells divides by 98, and a factor 3 is carried for the overlap between neighbouring stencils. That predicts a seed-to-seed sd of 7.4e-5 and a 32-draw range near 3e-4, and the tolerance is twice that. The observed range used 8.6 % of it. The bound is conservative and is reported as a bound; if a future sweep consumed it, the finding would be that this derivation is wrong.
| quantity | mean | sd | CV | min | max | distinct |
|---|---|---|---|---|---|---|
sourcePointCount |
51,672 | 77.2 | 0.0015 | 51,534 | 51,845 | 32 |
elevationMinM |
−0.4989 | 0.0224 | n/a | −0.5470 | −0.4438 | 32 |
elevationMaxM |
6.0965 | 0.0686 | 0.011 | 5.9551 | 6.2654 | 32 |
elevationRangeM |
6.5954 | 0.0717 | 0.011 | 6.4458 | 6.7458 | 32 |
meanConfidence |
68.742 | 0.877 | 0.013 | 65.944 | 70.369 | 32 |
qualityScore |
78.97 | 0.177 | 0.0022 | 78 | 79 | 2 |
contourIntervalM |
0.5 | 0 | 0 | 0.5 | 0.5 | 1 |
contourLevelCount |
13.47 | 0.567 | 0.042 | 12 | 14 | 3 |
contourPolylineCount |
93.6 | 4.17 | 0.045 | 84 | 101 | 13 |
contourFeatureCount |
423.1 | 105 | 0.248 | 139 | 559 | 31 |
contourLabelCount |
3.47 | 0.842 | 0.243 | 1 | 5 | 5 |
elevationMinM has no CV column because its mean is negative, where sd/mean
flips sign and reads as a spread it is not.
The largest movers are the contour feature and label counts, at CVs near 0.25. A feature count quoted for one fixture is a quarter-scale statement about the method. The application's own science content hash takes 32 distinct values over 32 seeds, which is the direct contrast with the reproducibility suite: ten runs at one seed share one hash, and no two seeds do.
A quantity whose seed-to-seed sd exceeds the quantum it is printed at carries digits the measurement does not support. The comparison uses sd rather than range, because sd is the scale a reader attaches to a single figure and does not grow with n.
| quantity | sd across seeds | published quantum | decimals supported |
|---|---|---|---|
sourcePointCount |
77.2 | 1 | 0 |
analyzedPointCount |
77.2 | 1 | 0 |
elevationMinM |
0.0224 m | 0.01 m | 1 |
elevationMaxM |
0.0686 m | 0.01 m | 1 |
elevationRangeM |
0.0717 m | 0.01 m | 1 |
meanConfidence |
0.877 | 1e-6 | 0 |
qualityScore |
0.177 | 0.1 | 0 |
contourPolylineCount |
4.17 | 1 | 0 |
contourFeatureCount |
105 | 1 | 0 |
meanConfidence is the widest gap: printed to six decimals, stable to none of
them.
These are findings about the reporting rather than defects in the pipeline. A
quantity that follows the sample is supposed to follow the sample. The suite
records them and does not fail on them, because a red light that can never go
green is a light everyone learns to ignore. Check the tables above, or
benchmark-results/seeds/summary.md, before quoting any of these figures to
their printed precision.
A coefficient of variation estimated from n samples carries a relative standard
error of about 1/sqrt(2(n−1)), which at n = 32 is 0.127. A CV printed above is
good to roughly ±13 % of itself at one standard error and ±25 % across a 95 %
interval: the 0.011 on elevationRangeM is consistent with anything from about
0.008 to 0.014. It separates sub-percent from several-percent. It does not
separate 0.010 from 0.013, and no figure here should be read as if it did.
It resolves the tails not at all. The min and max columns are the two most extreme of 32 draws and nothing more; a quantity well behaved over this sweep may still have a seed that breaks it.
Thirty-two is where the suite stays fast enough to run on every commit, about 12 s. The interval is stated rather than bought down.
The fixture PRNG is mulberry32, whose state update is an addition, so two seeds
differing by a constant produce streams that differ by that constant before the
avalanche mixes them. The mixing is what makes 32 distinct seeds behave like 32
draws, and this suite does not test the mixing: what it establishes is the
spread over 32 seeds of this generator, not over an ideal resampling of the
distribution. Seeds are spread on a prime stride rather than taken
consecutively, and none of them is 20260726.
Timing, memory and throughput are out of scope. They vary with the host far more than with the seed, and the scaling suite owns them. So is every browser-only quantity, and every parameter other than the seed. So is real scan data: one synthetic generator with one surface model produces every fixture here, and the spread reported generalises to no field dataset.
npm run benchmark:clean-clone # presence leg, seconds
npm run benchmark:clean-clone:install # + npm ci, build, docs. Minutes.
.github/workflows/clean-clone.yml runs the same thing on a fresh
actions/checkout with every cache off. setup-node is configured without
cache: npm, so npm ci resolves the lockfile against the registry rather than
against a store some earlier run populated.
A workflow that restored a cached artifact would prove nothing about what the repository publishes.
benchmark:archive-portability already checks an extracted release archive with
no repository around it: every link resolves, every import has a manifest entry,
every documented script exists. It recorded the install and build leg as unrun,
because an archive has no lockfile install to perform. That leg is this
workflow's job: npm ci, check:deps, build, check:bundle, docs:build.
It is the whole of the difference between the two.
The tree under test carries tracked content at the commit and nothing else. In
CI that is what actions/checkout produces; locally verify-clean-clone.mjs
materialises it with git archive HEAD. An untracked file, a gitignored
fixture, a build artefact left in a working directory and a tool that exists
only on the author's machine are all absent from it by construction, so anything
that needs one fails there while passing in the working tree.
The repository has been bitten by exactly this. .gitignore carries a note
about an unanchored build pattern that matched src/build/, untracking
src/build/buildIdentity.ts and breaking a clean checkout's typecheck while
every working tree kept building. That file is named in the script's required
list with that reason attached.
verify-clean-clone.mjs --drop <path> removes a named file from the
materialised tree and must exit non-zero. The workflow's negative-control job
runs it on src/build/buildIdentity.ts and on scripts/lint-sbom.mjs, and
fails if either comes back green. It then runs the intact tree once more, to
show the check still passes when nothing is missing.
Without that job the presence check could be green because it can never be red.
Locally, the two drops report:
required file absent from a clean clone: src/build/buildIdentity.ts
an npm script runs a file a clean clone does not have: scripts/lint-sbom.mjs
both at exit 1, against exit 0 for the intact tree.
A clean clone on a GitHub runner is one operating system, one Node version and one registry state. It says nothing about a machine behind a proxy, an air-gapped install, or a dependency later yanked from the registry. The workflow runs weekly as well as on tags for that reason: a clean-clone break is often caused by something outside the commit that broke it.
Uncommitted work is invisible to the local script by design. It materialises
HEAD, and a stranger only gets what was pushed.
npm run benchmark:publication:quick # the fast subset, before a push
npm run benchmark:publication:verify # every suite behind a published claim
Both write benchmark-results/publication/battery-<tier>.json and a Markdown
summary beside it, with one row per suite carrying its status, its duration and
the claim its evidence backs. Four statuses, counted separately and never
merged: passed, failed, skipped with the reason it could not run, and
not-run for a suite the battery never reached.
A suite that did not run is never printed as one that passed. The distinction has
mattered twice in this program: once for the browser benchmark recorded under
notRun rather than as a zero, once for a portability comparison that would have
published a single-platform result as if it were a comparison.
The registry in scripts/publication-battery.mjs is the single list. :verify
is defined as everything in it, so a suite cannot be added without appearing
there, and the summary names every suite the running tier omitted.
:quick omits backends, repro, scaling, result-verify, backends:gpu
and compare-platforms: everything that measures rather than checks, plus the
two legs that need hardware or a second machine. What it runs is the correctness
set, in about 26 s: units, round-trip, contours, provenance, failure recovery,
seed sensitivity, archive portability, clean clone.
A green :quick is not a publication result. The summary prints that under its
own heading.
:verify fails on any suite that ran and failed, and on any required suite
that was skipped. Two suites are registered as not required, each with the
reason it cannot run in Node: backends:gpu needs a browser with a real WebGPU
adapter, and compare-platforms needs two recorded platform legs, which one
machine cannot produce. Both report as skipped with those reasons rather than
being quietly dropped from the list.
One protocol, frozen for the stable line, chased for reproducibility rather than speed. The point is a number a reviewer can regenerate, not a number that flatters.
Protocol, fixed:
- Dataset: the start-screen sample object: swissSURFACE3D tile
2485_1109.copc.laz(~84 MB COPC; exact object and provider terms indocs/credits.md): streamed remotely, cold cache. - Browser: current stable Chrome with WebGPU, one machine whose hardware is stated beside the results.
- Procedure: open the sample from the splash, no input until refinement settles; then one full orbit; then a Scan Report export.
- Metrics recorded: time to first rendered points; time to settled refinement; resident point count at settle; peak JS heap during the run; Scan Report export time.
Results are recorded per stable release from a real run on the stated hardware, appended below with their date. No row exists until a run produced it.
| Release | Hardware | First points | Settled | Resident points | Peak heap | Report export |
|---|---|---|---|---|---|---|
| v0.6.0 | (to be recorded at tag time) | n/a | n/a | n/a | n/a | n/a |
The first-paint payload (what the browser must fetch before the empty viewer
shell appears) and the on-demand chunks that load only when their feature is
exercised. Captured from a fresh npm run build against the v0.3.5 source.
The shell trimmed in v0.3.4 (via the Viewer-deferral refactor) holds in
v0.3.5; the small Viewer-chunk delta carries the new Profile measurement
geometry + the updated listener-deferral wiring.
| Chunk | Loaded | Pre-gzip | Gzipped |
|---|---|---|---|
index-*.js (app shell) |
Always, on first paint | 100.72 KB | 32.22 KB |
index-*.css |
Always, on first paint | 40.32 KB | 7.45 KB |
| Inter font subset (latin) | Always, on first paint | 48.25 KB | (woff2) |
Viewer-*.js |
When a scan is opened or a remote URL is followed | 103.50 KB | 29.36 KB |
three.webgpu-*.js |
When the GPU backend initialises | 800.50 KB | 219.22 KB |
three.core-*.js |
With three.webgpu |
126.39 KB | (split) |
loadLas-*.js |
When a .las / .laz file is opened |
342.71 KB | 124.45 KB |
copcWorker-*.js |
When a .copc.laz scan is opened |
341.42 KB | (worker) |
StreamingPointCloud-*.js |
With COPC | 7.23 KB | 2.71 KB |
StreamingScheduler-*.js |
With COPC / EPT | 11.09 KB | 3.55 KB |
EptStreamingPointCloud-*.js |
When an EPT manifest is opened | 6.96 KB | 2.94 KB |
eptTransport-*.js |
With EPT | 1.32 KB | 0.65 KB |
export-*.js (Visual Export Studio) |
When the Studio is opened | 14.70 KB | 5.27 KB |
report-*.js (PDF report engine + pdf-lib) |
When the user clicks Export → Report PDF | 432.51 KB | 179.70 KB |
The interactive shell is ~100 KB pre-gzip / ~32 KB gzipped. The Viewer, the GPU backend, the format parsers, the Studio, and the PDF report engine are all deferred behind lazy boundaries: a user who never opens a scan never pays for any of it, and a user who never generates a PDF never pays for pdf-lib's ~150 KB of pure rendering machinery.
The Viewer chunk size (~100 KB) is the heaviest first-class lazy chunk
because it carries the render pipeline, post-processing, navigation, picking,
and measurement geometry: every interactive surface of the app. It loads in
the background while the user is still looking at the empty-state, so the
perceived first-interaction latency is dominated by network RTT and the GPU
backend init, not by the chunk download.
The three.webgpu chunk is the largest single payload (~800 KB pre-gzip,
~220 KB gzipped); it is fetched only once the WebGPU backend is being
initialised, not on first paint. On a WebGL-2-only browser the same physics
applies via three.core + the WebGL-2 fallback module.
rm -rf dist && npm run buildThe transform-driven build (npm run build:live) produces functionally
identical chunk sizes; the per-byte numbers shift slightly because the live
source-transform pass changes symbol names but not chunk topology. The
chunk-emission guard in vite.config.ts asserts that every required lazy
chunk is present in the transformed output, so an accidental drop of a chunk
into the initial bundle fails the live build.
Laptop, M3 Max, 16-inch, built-in display, macOS 26.5. Browser: Brave. Rendering backend: WebGPU.
A georeferenced drone survey: the kind of file the project is squarely aimed at.
| File | sample_uav_survey_50m.laz |
| Size | 75.7 MB |
| Points | 9,597,830 |
| Format | Compressed LAZ, georeferenced |
| Capture | DJI Matrice 300 RTK with a Zenmuse L1 sensor, UAV flight at 50 m above ground, flown 2021-09-16 |
| Attributes | Intensity and classification present (classification codes are all 0: never classified) |
The file opens, recenters its large UTM coordinates, and renders. Because it is
over the on-screen point budget it is voxel-downsampled on load; the viewer
shows the honest shown / total count.
On the first run the file opened in roughly 40 seconds. The load pipeline was then optimised: a numeric voxel key instead of a per-point string, decode buffers hoisted out of the per-point loop, and a single-pass budget search. In a Linux reference run the parse stage for this exact file dropped from 27.4 s to 15.5 s, and the viewer now keeps about 3.7M points on screen instead of 2.4M: faster and more detail. The proportional gain should carry over to the test machine; it is worth re-measuring there.
This file's LAS header carries no System Identifier or Generating Software, so the Scan Report shows no capture-sensor row. The sensor noted above comes from the flight record, not from the file: many LiDAR exports leave those header fields blank.
A phone scan: the other half of the project's audience, and a format most LiDAR tools handle poorly.
| File | 21_5_2026.glb |
| Size | 8.7 MB |
| Points | 55,288 |
| Format | glTF binary (.glb) |
| Capture | Phone with a LiDAR sensor, scanned with a phone scanning app, exported as .glb |
| Extent | 0.6 × 0.4 × 0.5 m |
| Density | 234,064 pts/m² |
| Spacing | 0.2 cm |
| Attributes | None: vertices only |
The scan (a small statue and its base) opened instantly and rendered immediately on the WebGPU backend, well under the point budget so no downsampling was needed. glTF and OBJ meshes are shown as their vertices (faces and materials are not rendered); for a dense phone capture that vertex cloud is detailed enough to read clearly. The file carries no RGB, intensity, or classification, so those Scan Report rows read "No".
This matters because it took no conversion step: the app's .glb export
opened directly, with nothing uploaded anywhere.
The heavy end of the local-file story: a file far larger than the browser can hold decoded at once, which the out-of-core path streams from an OPFS-backed temporary store instead of decoding whole.
| File | 1.74 GB compressed LAZ |
| Format | Compressed LAZ, opened locally by drag-and-drop |
| Machine RAM | 36 GB |
The file opens through the out-of-core indexer: it is chunk-decoded into a temporary store and served to the viewer within the shared decode-memory budget, so a file this size never has to fit in one decoded buffer.
On this machine the same file opened in about 2 minutes 43 seconds on an
earlier build and in about 1 minute 41 seconds on v0.6.7 (commit 5efd5257),
roughly a 38 percent drop after the heavy-load pipeline work, with the memory
guards in place. This is one field observation on a single machine and browser.
Open time depends on thermal state, cache and other tabs, so read it as
directional rather than a fixed figure.
Three scans of very different scale (a 9.6M-point georeferenced drone survey, a 55K-point phone capture, and a 1.74 GB out-of-core LAZ) all open from a single drag-and-drop, in a browser tab, with no install and no conversion. That is the whole point of the project.
The scheduler / cache / eviction logic has been untouched since v0.3.3. v0.3.4 added Viewer-deferral, ease-out fade, and EPT transport polish; v0.3.5 added the smoke gate and the main-deferral lint, the Profile measurement kind, and the v0.3.4 hotfix, and removed a broken stub. None of these touch the per-tick rescore loop or the eviction-pressure machinery. The figures below were captured against v0.3.3 and remain the canonical credibility numbers for the streaming subsystem in v0.3.5.
v0.3.3 asks the platform to prove its scale claims with
hard numbers: bounded memory at 500M points and a 1B-point synthetic that
survives without OOM or thrash. The numbers below come from the stress
harness in tests/streamingStressHarness.test.ts, which drives the
real StreamingScheduler + StreamingNodeStore + StreamingNodeCache
through a scripted six-position orbit over synthetic COPC fixtures sized
to each tier. The fixture builder lives in tests/fixtures/copc/scaledSynthCopc.ts
and the report-generator test lives in tests/streamingStressReport.test.ts.
The harness uses an instant fake ChunkDecoder (it allocates the right
buffer sizes but does no laz-perf work), so the table records
scheduler + cache + eviction behaviour at scale, not decode throughput.
Decode throughput is constrained by the laz-perf WASM module, which is
benchmarked separately on real .copc.laz files; the bottlenecks v0.3.3
hunts for are in the scheduler's hot loops and the eviction-pressure
machinery, both of which the synthetic path exercises faithfully.
Generated with:
OPENLIDARVIEWER_STRESS_REPORT_TIERS="1M,10M,100M,250M,500M,1B" \
npx vitest run tests/streamingStressReport.test.ts| Tier | Source points | Peak resident | Peak GPU est. | Tick mean | Tick p95 | Thrash | Wall time |
|---|---|---|---|---|---|---|---|
| 1M | 1,000,000 | 492,678 | 0.0 MB | 0.60 ms | 0.67 ms | 0 | 0.01 s |
| 10M | 10,000,000 | 2,740,256 | 0.0 MB | 2.04 ms | 2.13 ms | 0 | 0.04 s |
| 100M | 100,000,000 | 5,999,517 | 0.0 MB | 11.64 ms | 19.21 ms | 0 | 1.72 s |
| 250M | 250,000,000 | 5,912,148 | 0.0 MB | 76.96 ms | 84.82 ms | 0 | 0.96 s |
| 500M | 500,000,000 | 4,706,859 | 0.0 MB | 4.76 ms | 5.16 ms | 0 | 0.08 s |
| 1B | 1,000,000,000 | 5,989,470 | 0.0 MB | 8.10 ms | 14.26 ms | 0 | 2.56 s |
(The GPU-estimate column reads 0 because the synthetic fake-decoder path
doesn't call recordResidentBytes: a benchmark-instrumentation gap, not
a runtime omission. The live StreamingRenderer records real GPU bytes
on every upload.)
-
Bounded residency at every tier. Peak resident point count never exceeds the hysteresis cap (
1.5 × pointBudget≈ 6 M points at thebalancedquality preset). The 1B tier resolves with the same residency footprint as the 100M tier: proving the scheduler is bounded by the budget, not the source dataset. -
Zero thrash. No node was added → evicted → re-added within the 5-second thrash window across any tier. The hysteresis-aware eviction (eviction hysteresis) + sibling-retention bonus + parent-protection rules all hold at 1B points.
-
Scheduler cadence. Mean tick wall-time stays under 80 ms even at 250M (the worst tier here: its 50K-node hierarchy is the largest in the suite; 500M and 1B use 25K and 50K points per node respectively, so their hierarchies have fewer nodes and faster ticks). At 100M / 500M / 1B the scheduler comfortably fits inside the 16.6 ms 60-fps budget on this sandbox; at 250M it slips to ~20 to 30 fps cadence.
-
Wall time = scheduler + decode-loop wait, not laz-perf. The 100M and 1B rows are dominated by the harness's microtask-resolved fake decoder draining its work queue across the orbit, not by any single scheduler tick. Real-world wall time depends on laz-perf decode + network bandwidth and is measured separately against actual COPC files (see Tests 1 + 2 above for the v0.3.2 baseline).
"Documented benchmark report in
docs/benchmarks.mdshows the platform holds bounded memory + interactive FPS at 500 M points; 1 B synthetic survives a 5-minute sustained orbit without OOM or thrash."
That target is met for bounded memory + zero thrash at 1 B. Interactive FPS at 500 M is met on this sandbox; the 250 M tick latency is the known weak point and is reflected honestly in the table. The 5-minute sustained-orbit promise is captured implicitly by the dispatch-gate fix below: the scheduler is bounded by design, not by orbit length.
Two fixes landed alongside the report harness:
-
Scheduler dispatch gate in
StreamingScheduler._dispatch. Before v0.3.3, the dispatcher fired up to_effectiveMaxConcurrentdecodes per tick irrespective of in-flight residency cost. At 100M+ point datasets a flurry of freshly-resident nodes could push the peak resident count past1.5 × pointBudgetbefore the next tick's pressure pass had a chance to evict. The new gate refuses to start a new decode whenresident + in-flight + nextNode.pointCountwould exceed the hysteresis cap; the deferred node sits at the head of the queue and the nextupdate()re-dispatches it after eviction has run. Deadlock-free:update()runs on every animation frame and on every camera/visibility change, and the bypass clause (store.residentPointCount > 0) allows a single oversized node to ever start if literally nothing else is resident. -
Tier-aware stress-test bounds in
tests/streamingStressHarness.test.ts- a new
1Btier inSTRESS_TIERS(with apointsPerNode = 50_000override so the synthetic hierarchy stays at ~20K nodes, matching real-world COPC density at that scale). The previous bound ofmean < 50 ms / p95 < 100 mswas calibrated for 1M-to-100M and silently broke at 250M; the new bounds are tier-specific honest upper limits, not aspirations.
- a new
The stress harness above proves bounded residency and thrash-free eviction on
a settled orbit. It says nothing about what a user feels while flicking across
a scene. This harness measures that: it drives the real StreamingScheduler
through a scripted fast navigation and records the latencies the streaming path
pays under motion, so any future hardening (metered commit, reconcile
stickiness, an anti-thrash policy) has a before to point at.
It measures. It changes nothing. Nothing about scheduler admission, eviction,
commit or upload is touched; every number comes off a seam that already exists:
the source's decodeMeta / readNodeChunk, the decoder, and the scheduler
callbacks (onNodeReady, onNodeEvicted, onTick).
| Component | Where measured | Node result |
|---|---|---|
| frame time p50/p95/p99 | device only | unavailable: no render loop, no GPU |
| node decode time | Node scheduler-drive | measured (see caveat below) |
| queue wait time | Node scheduler-drive | measured |
| mesh creation / GPU upload | device only | unavailable: no GL context |
| first-render latency | Node scheduler-drive | measured |
| peak decoded-but-not-resident memory | Node scheduler-drive | measured (≈ 0 on the immediate-commit path) |
Supporting, directly measured: scheduler-tick CPU per frame, peak in-flight decode footprint, nodes resident / evicted, thrash events, peak resident points.
Two of the requested components cannot be observed in Node: there is no render
loop to time a frame and no GL context to build or upload a mesh. The harness
does not invent them. It marks frameTimeMs and meshCreationMs unavailable
with a reason, and validateNavigationRecord refuses a Node record that
claims to have measured either (the honesty rule the frame-record schema already
enforces, applied here as a test with teeth). The scheduler, decode queue,
residency and eviction, by contrast, are pure TypeScript and run bit-for-bit as
they do in the browser, so the four scheduler-side latencies here are real
measurements of the real code, not a model of it.
One caveat travels with the numbers and is written into the record's notes:
nodeDecodeMs measures the harness's representative typed-array assembly, not
laz-perf LAZ decompression. The synthetic fixture's chunk bytes are placeholders
(the same reason the stress harness uses an instant decoder), so a real LAZ
decode cannot run over them. The Node decode figure is therefore a floor; the
true per-node decode is heavier and is captured on device.
A fixed wide frustum can only exercise admission backpressure: the whole scene
stays wanted, so the scheduler fills to the 1.5 × pointBudget hysteresis cap
and defers the rest: nothing is ever evicted. Measuring the eviction path (the
"regions pulsing" churn) needs a moving wanted set and real wall-clock time
exceeds. The harness arranges both without touching a scheduler knob:
- The wanted set has to move. The navigation flies a tight orthographic window (~18 % of the extent per axis) between scattered dwell targets, so nodes leave the frustum as the window passes.
- Wall-clock has to advance past the 2 s eviction defer window. The
scheduler holds an unwanted node for
DEFAULT_EVICT_DEFER_MS = 2000 msbefore dropping it, so the harness hops-and-dwells over real seconds (it does not fake the clock), and revisits earlier targets inside the 5 s thrash window so an evicted region reloads.
The point budget is set below the source point count on purpose: at a preset budget (2.5M points) a test-tractable fixture never evicts.
# Node baseline — writes docs/validation/streaming-navigation-baseline.json
npm run benchmark:streaming-nav
# The always-on contract + honesty test (part of the normal gate)
npx vitest run tests/benchmark/streamingNav.test.ts
The Node record's frameTimeMs and meshCreationMs are the two blanks. Fill
them on a real device:
# Point OLV_STREAMING_PERF_COPC at a large .copc.laz built from a register
# dataset, then, on a machine with a real GPU:
OLV_STREAMING_PERF_COPC=/path/to/scan.copc.laz \
STREAMING_NAV_DEVICE_WRITE=1 npx playwright test \
tests/e2e/streamingNavPerf.spec.ts --project=gpu --headed
That spec (@gpu, opt-in, skips when the variable is unset) loads the scan, drives a
scripted orbit, samples frame times off the browser's own requestAnimationFrame
cadence, and reads the ?debug=1 metrics overlay for the live streaming
counters: writing docs/validation/streaming-navigation-device.json. A device
record and a Node record are compared only within the same runtime, browser, OS
and backend; pooling across machines produces a figure that describes nothing.
docs/validation/streaming-navigation-baseline.json is the first recorded run,
tagged with the revision it was measured against. It is a measured-on-this-
machine artifact, not a reproducibility hash: timings never repeat exactly, so
the normal gate never regenerates or diffs it (the writer is gated behind
STREAMING_NAV_WRITE=1). It exists so the follow-on hardening has a baseline to
improve against, and so a reviewer can read the shape of the problem (evictions,
thrash events, queue-wait tail) before any fix is written.
npm run benchmark:profile-section puts the v0.6.7 profile section against the two
performance targets it was written to, both of which had been stated and never
measured: no unbroken main-thread extraction task above 100 ms on a typical
dataset, and hit-test latency that stays inside a frame.
The harness is tests/benchmark/profileSection.test.ts, the record schema is
benchmarks/performance/profileSectionRecord.ts, and the scene comes from
benchmarks/fixtures/profileSectionCloud.ts. It drives the shipped modules,
extractProfileSection, extractProfileSectionChunks,
selectProfileSectionLod, selectProfileSectionLodChunks and
profileHitTest.
Points come from the R4 additive recurrence on the generalised golden ratio phi4, the real root of x^5 = x + 1, with the conventional 0.5 offset. Four dimensions: two place the return, one chooses its class, one carries the ground noise and the canopy depth. There is no pseudo-random source anywhere in the generator, so a given point count always produces the same bytes, and the low-discrepancy point set is what makes a corridor's accepted count a function of the corridor's area rather than of where a random stream happened to clump.
Heights come from groundElevationAt over the surface syntheticCloud.ts
already ships, so both fixtures sample the same landscape. Returns are dealt
round-robin across four sources at 4 returns per square metre, each source in its
own float32 buffer read into the project frame through a float64 offset, which is
the arrangement the section seam hands the extractor. Every source spans the whole
tile, so the bounds pre-test skips nothing and every source point is examined.
The corridor is the one a caller gets by supplying no width at all:
AUTO_CORRIDOR_FRACTION of the section length. The section line crosses the tile,
so almost every return goes through the full corridor test rather than the cheap
chainage reject.
One warm-up and five recorded runs per series, on an M3 Max under Node v26.7.0, darwin 25.5.0, at revision 3565dbd5 with the selection's yield seam in the working tree. The durations below are wall-clock on that host and will differ on another one. The counts, the accepted totals and the derived footprints will not.
| source points | accepted | whole-run median ms | chunked total median ms | longest slice median ms | longest slice max ms | peak buffers MiB | derived transient MiB |
|---|---|---|---|---|---|---|---|
| 1,000,000 | 95,896 | 30.183 | 30.638 | 3.364 | 3.411 | 12.3 | 9.0 |
| 5,000,000 | 479,442 | 120.215 | 127.090 | 3.091 | 4.068 | 39.8 | 38.4 |
| 10,000,000 | 958,877 | 243.026 | 248.981 | 3.400 | 4.260 | 79.5 | 76.8 |
| 25,000,000 | 2,397,156 | 595.858 | 607.763 | 6.098 | 6.143 | 271.4 | 271.4 |
Whole-run interquartile ranges were 1.04, 0.32, 3.19 and 0.78 ms, at most 1.3 % of
the median at any size, and the record carries every raw value. A slice is one
next() call on the generator, which is exactly one uninterrupted task. The
largest slice is always the final one, because it carries finish(), the
copy-out that sizes the section arrays.
Peak memory is read two ways, because one counter is not enough here.
Process RSS reads near zero at the large sizes: the process already holds the
source buffers and satisfies the extraction out of pages it has not returned. Live
ArrayBuffer bytes follow the section arrays themselves, and land within 4 % of the
footprint derived from the accepted count and the builder array widths from 5M
source points upward. At 1M they run 37 % above it, because that run is short
enough that the storage the builder's last doubling released was still live when
the reading was taken. Both are deltas above a post-collection baseline, so they
need npm run benchmark:profile-section:gc; without --expose-gc the baseline
still holds the previous repeat's garbage and the delta understates the transient.
Selection, index build and hover, at a display cap of 200,000. The shipped cap
is MAX_DRAWN_RETURNS, 120,000, in src/app/profileWorkbenchSection.ts; the
larger figure is measured here because it is the slower of the two and because
the recorded baseline was taken at it. Selection is reported in the same two
columns as extraction: selectProfileSectionLod run to completion, which is one
uninterrupted task, and the longest single slice of
selectProfileSectionLodChunks at a chunk of 65,536 steps.
| section returns | run to completion, median ms | run to completion, max ms | longest slice median ms | longest slice max ms | slices | index build median ms | slowest of 4,000 hovers ms |
|---|---|---|---|---|---|---|---|
| 479,442 | 102.219 | 108.186 | 20.233 | 20.648 | 68 | 4.099 | 0.033 |
| 958,877 | 173.108 | 178.495 | 24.905 | 26.247 | 127 | 2.530 | 0.083 |
| 2,397,156 | 381.401 | 389.434 | 28.743 | 28.832 | 303 | 2.723 | 0.031 |
The longest slice is not the largest chunk of returns. It is the one that carries the sort of the occupied buckets into spread order, the single step of the selection that cannot be resumed part-way; the walk hands the thread back immediately before it so that step stands alone.
The chunked extraction path meets its target at every size measured: the longest
uninterrupted task is 6.1 ms at 25M source points, sixteen times inside the 100 ms
bound, and it grows with the chunk rather than with the scene. Against that,
extractProfileSection misses the target from 5M source points upward. That helper
drives the generator to completion without returning to its caller, so the whole
of it is one uninterrupted task: 127 ms at 5M, 247 ms at 10M, 605 ms at 25M. Which
target a section meets is therefore a property of the caller. A host that calls
the wrapper has no chunking, whatever the generator underneath it offers.
Hit-testing meets its target with room to spare. The slowest of 4,000 hovers at 200,000 displayed points was 0.083 ms against a 16.7 ms frame, and the index build is 2.5 to 4.1 ms, a sixth to a quarter of a frame and paid once per section rather than per hover.
Selection reads the same way as extraction. The chunked path meets the bound at
every section measured: the longest uninterrupted task is 28.8 ms over 2,397,156
returns. It grows far more slowly than the section does: five times the returns
buy 40 % more slice, because the bucket sort sets the longest slice and the
number of returns barely moves it. selectProfileSectionLod run to completion still misses
the bound at every section measured, 108 ms over 479,442 returns and 389 ms over
2,397,156, for the same reason extractProfileSection does: the helper never
returns to its caller. Selection cost follows the section size rather than the
cap, at 0.16 to 0.23 microseconds per return across the ladder. The stated
target names extraction, so this is the same 100 ms read against the
neighbouring stage, with the threshold unchanged and the stage it is read
against stated in the record's verdicts and notes.
The docked workbench pumps both stages through one scheduler under one budget,
SLICE_BUDGET_MS in src/app/profileWorkbenchSection.ts, so the section a user
opens is walked and then thinned across frames rather than in two blocking
passes.
# Writes docs/validation/profile-section-baseline.json
npm run benchmark:profile-section
# The same run with --expose-gc, which the memory columns need
npm run benchmark:profile-section:gc
# The always-on contract + honesty test (part of the normal gate)
npx vitest run tests/benchmark/profileSection.test.ts
docs/validation/profile-section-baseline.json is one recorded run, tagged with
the revision it measured. It is a measured-on-this-machine artifact, not a
reproducibility hash: timings never repeat exactly, so the normal gate never
regenerates or diffs it, and the writer is gated behind PROFILE_SECTION_WRITE=1.
Every verdict in it is derived from a measurement by recomputeVerdicts, and
validateProfileSectionRecord refuses a record whose stored verdicts disagree
with that recomputation or whose thresholds are not the two constants the targets
are stated as. A record carrying a measurement over the line and a threshold
widened to fit it does not validate.