Deterministic Volume Calculation: Why the Same Survey Must Give the Same Number

A volume that changes when you press Calculate twice is not a measurement — it is a dispute waiting to happen. Monthly reconciliation, payment for earthworks and audits all assume that the same surface, boundary and reference give the same number, every time, on every machine. This article explains what a deterministic volume calculation has to guarantee, and how STREAM's cut and fill engine does it.

What the calculation actually does

STREAM computes cut and fill on the elevation grid. A cell is counted when its centre lies inside the boundary you drew. For each counted cell the difference Δz = ground − reference is taken, after any terrain edits and height offset have been applied to the surface; positive Δz adds Δz × cell area to cut, negative Δz adds to fill. Cells with no data are skipped — they are never treated as zero.

The sloped (3D) area is reported alongside: each cell contributes its plan area × √(1 + gx² + gy²), with the gradient taken from its neighbours on the same corrected surface.

The rules that make it repeatable

Determinism is not automatic; it comes from a few deliberate choices. Each one removes a way the same input could produce a different number.

What keeps a volume calculation deterministic
RuleWhat it prevents
Cells are visited in a fixed order (row strips, row by row) into one accumulatorFloating-point sums that change with thread scheduling
Sampling grids are counted with integers, not by adding a step repeatedlyA last row or column that appears on one run and drops on the next
A cell counts by whether its centre is inside the boundaryAmbiguous partial cells decided differently each time
NoData is skipped, never read as zeroHoles turning into false fill or cut
A 'lowest point' reference is read from the same corrected surfaceA reference taken from one surface and the volume from another
No random sampling, no clock, no file-order dependenceResults that depend on when or where the run happens

Speed without changing the answer

An 18 GB surface should not be scanned end to end to measure a 40 m stockpile. STREAM therefore reads only a window around the boundary — its bounding box plus one cell, so the neighbour-based slope still has its neighbours. Cells outside the boundary contribute nothing either way, so the window changes the time, not the result.

The same principle applies to every optimisation of a quantity: a faster path has to return the identical number, and the comparison is made on a known surface before it ships.

What still changes the number — and should

Determinism means the same inputs give the same output; it does not hide the inputs. The reference, the boundary, terrain edits and the version of the surface all change the volume, and they should be written into the report next to it. Because a cell counts by its centre, the boundary is resolved to the cell size: a finer grid follows a curved boundary more closely.

You can check any volume tool the same way: build a planar test surface whose answer you know — the 40 m × 30 m pad rising 2 m, which gives 600 m³ of net cut against 101.5 m — and run it twice. The result should match the analytic value and itself, to the last digit.

Frequently asked questions

What is a deterministic volume calculation?

One in which the same surface, boundary, reference and settings always produce exactly the same volume, regardless of when or on which machine it runs.

Why can two runs of a volume tool give slightly different numbers?

Usually because of parallel floating-point sums whose order changes with thread scheduling, sampling grids built by repeatedly adding a step, or random sampling. Each makes the result depend on something other than the input.

How can I test whether a volume tool is repeatable?

Use a planar surface with a known answer, such as a 40 m × 30 m pad rising 2 m along its length (600 m³ net cut against a 101.5 m level), and run it twice. Both runs should match each other and the analytic value.

Compute repeatable cut and fill volumes in STREAM

Native Windows · fully offline · free beta

Cut and Fill Software