DiveCommand Bühlmann Validation
ZH-L16C with gradient factors tested against an independent reference model, exact physics and a second open-source engine✓ Every NDL and every decompression schedule DiveCommand produced matched the reference exactly — 4,828,035 checks across recreational, technical and trimix planning, sea level to 11,000 ft, salt and fresh water. Replayed with exact physics, none of 52,029 schedules broke its gradient factors.
What DiveCommand Computes, and How We Checked It
DiveCommand runs the Bühlmann ZH-L16C algorithm with Erik Baker’s gradient factors directly. Nothing comes from a lookup table: every limit is worked out from the 16 tissue compartments for the gas, depth, altitude and water type.
| Item | DiveCommand uses | Check |
|---|---|---|
| Nitrogen and helium constants | ZH-L16C, compartment 1b (5 min N₂ / 1.88 min He), all 96 values | ✓ Published table; compartments 2–16 identical to DecoTengu’s |
| Mixed gas | a and b weighted by each compartment’s N₂ and He tension (Baker) | ✓ Exact |
| Alveolar water vapour | 0.0627 bar | ✓ Bühlmann standard |
| Surface pressure at altitude | Barometric formula, sea level and 12 altitude settings to 11,000 ft | ✓ Exact; menu labels match |
| Water | Salt 1025 kg/m³, fresh 1000 kg/m³ | ✓ Exact |
| Oxygen exposure | NOAA CNS limits, 90-minute half-time between dives | ✓ Exact |
Every Depth, Every Mix, Every Setting
Each case runs through DiveCommand’s own engine in a real browser and through an independent reference model, written separately from the app’s code. The answers must match to the minute and to the foot.
Every whole-foot depth from 10 to 230 ft, on air and every nitrox mix from 22% to 40%. Each depth runs at 8 GF-High settings and 13 altitudes from sea level to 11,000 ft, in salt and fresh water.
✓ 919,360 / 919,360In the NDL grid, a deeper dive never gets a longer NDL. A richer mix, a higher GF-High or fresh water never gets a shorter one, and a higher site never gets a longer one. 2,601,209 neighbouring pairs were checked, with no exceptions.
✓ 2,601,209 / 2,601,209Every foot from 20 to 230 ft × 13 bottom times up to 3 hours × 5 mixes × 7 gradient-factor pairs (20/80 to 100/100) × 4 altitudes × salt and fresh water. Every stop depth, stop time, first stop and run time matched.
✓ 768,040 / 768,0407 bottom mixes (air, EAN32, and trimix down to 10/70) × 4 travel-gas choices × 4 deco-gas choices (EAN50, EAN80, oxygen) × 100–330 ft. Includes every gas switch at its ppO₂ 1.6 depth. Another 37,376 trimix NDLs to 330 ft also matched.
✓ 134,144 / 134,14460,000 adjusted NDLs and 30,000 schedules for a second dive. Each starts from the tissue state left by a first dive and a surface interval of 10 minutes to 8 hours. A further 500 three-dive days were driven through the real cards (counted under Real Screens), and every adjusted NDL tile matched.
✓ 90,000 / 90,000Multi-level plans, including reverse profiles, with ascents at 30 ft/min and descents at 60 ft/min between levels. The level that runs out of no-stop time, its limit, and the final tissue state all matched to 12 decimal places.
✓ 20,000 / 20,000Not Just Agreeing With Ourselves
A reference model can share a planner’s assumptions. So DiveCommand’s answers were also checked against exact physics and against a separate open-source engine.
Each schedule was followed again with the exact Schreiner equation for a continuous ascent, including every gas switch. On arrival at each stop and at the surface, tissue tension was checked against the gradient factor in force there. No schedule broke its gradient factors. 19 extreme schedules that DiveCommand itself flags “do not follow” were left out.
✓ 0 overshootsNDLs recomputed with exact continuous ascents. 27,899 were identical. In 53, DiveCommand was 1 minute shorter, the conservative side. None were longer.
✓ 0 longerDecoTengu is an independent open-source Bühlmann engine with its own stop search. It was set to the same constants and conventions. Total stop time agreed to the minute in 51% of schedules, within 1 minute in 92% and within 2 minutes in 98%. Where they differ, DecoTengu’s convention starts one 10-ft stop deeper and adds a minute or two. DiveCommand’s schedules pass the exact-physics replay either way.
Agreement, not pass/failWhat the Diver Sees, and What If
The NDL tile and within / over status at every depth button, every decompression stop shown in Technical Mode at four GF presets, and 500 three-dive days through the real cards. Also the NDL printed on 3,040 depth buttons and the MOD lock on each, across altitudes, water types and gases.
✓ 7,933 / 7,933Every mix from 10% to 100% O₂ at ppO₂ 1.2–1.6: MOD always rounded down and never set needlessly shallow. Also checks EAD and END, NOAA CNS limits and CNS build-up on the ascent, the warning on hypoxic mixes and the shallowest depth they can be breathed at, and the altitude menu labels.
✓ 174,844 / 174,844The minimum surface-interval table, helium off-gassing between trimix dives, CNS decay, run time with the safety stop, and the DAN no-fly rule (12 / 18 / 24 h). Also the recreational overstay rule: 6 hours before the next dive when 5 minutes or less over the NDL, 24 hours when more.
✓ 32,523 / 32,52316 realistic bugs were planted one at a time and had to be caught. Examples: one constant mistyped, the water vapour left out, the GF slope moved one stop, ascent at 33 ft/min, density 1030 kg/m³, the NDL tested at GF-Low, helium not off-gassed between dives, the NDL tile off by one minute. All 16 were caught.
16 caught · 0 missed- ● DiveCommand assumes the diver has already adjusted to the altitude, and tells you to wait about 6 hours after arriving.
- ● At 6,225 ft on air (GF 50/85), diving straight from the car after driving up from sea level cuts the 60 ft NDL from 36 to 32 minutes. After 1 hour it is 35, and from 3 hours on it is the full 36.
- ● At 10,000 ft: 27 minutes on arrival, 32 after an hour. The 6-hour advice has a wide margin.
- ● Planned EAN32 at 60 ft: NDL 77 minutes. With 31% it is 73; with 30% it is 69.
- ● Planned EAN36 at 60 ft: 100 minutes. With 34% it is 87.
- ● This is why DiveCommand asks you to analyse your cylinder and plan on the analysed O₂ %.
How the Tests Were Run
An independent reference. A separate implementation of ZH-L16C with gradient factors was written for this battery, from the published constants and DiveCommand’s stated conventions. It shares no code with the app, and it runs on its own outside the app to prove that. Those conventions are: the bottom time includes the descent and is loaded at depth; ascent at 30 ft/min; stops on 10-ft steps in whole minutes; last stop at 10 ft; the first stop found during the ascent at GF-Low; and gas switches at ppO₂ 1.6.
Exact physics. DiveCommand moves tissues through each ascent leg at the leg’s middle depth, a standard approximation. Every result was also re-checked with the exact Schreiner equation. That check found no NDL longer than the physics allows and no schedule that breaks its gradient factors.
A second engine. DecoTengu, an open-source Bühlmann engine, was run on the same profiles with the same settings. It is a cross-check of conventions, reported as agreement rather than pass/fail.
The real app, in a real browser. DiveCommand ran in headless Chromium through Playwright. Engine tests call the same functions the planner uses, and the screen tests read the tiles, buttons and stops the diver sees.
Testing the tests. 16 planted bugs, one at a time, each of which had to be caught. All 16 were caught.
Not covered here: how DiveCommand compares with a particular dive computer’s firmware. Computers differ in ascent rate, last-stop depth and how they treat the descent, so the same gradient factors can give slightly different numbers. DiveCommand is a planner and does not replace a dive computer used underwater.