# LUCAS WRB benchmark -- v0.9.50 empirical close (v0.9.60)

**Date**: 2026-05-06
**soilKey version**: 0.9.60
**Generators**:
- `inst/benchmarks/run_lucas_v0950_close.R` -- 100 perfis ES/FR/PL/IT, 3 configs (full)
- `inst/benchmarks/run_lucas_v0950_close_focused.R` -- 30 perfis FR/PL/IT, 2 configs (focused)

## What this report closes (and what it does not)

v0.9.50 (2026-05-05) shipped `fill_topsoil_from = "soilgrids"` and
`fill_subsoil_from = "soilgrids"` (9 SoilGrids properties × topsoil
0-5 cm + subsoil 30-60 cm) to lift the v0.9.49 LUCAS WRB benchmark
out of the **3% Regosols catch-all** baseline. 13 synthetic-injection
tests passed, but the empirical post-fill accuracy was never
published.

v0.9.60 ships the **scripts and infrastructure** to close that gap.
The baseline number is reproduced. The post-fill numbers are
**deferred** to v0.9.61: the SoilGrids COG round-trip latency
turned out to be 2-3x slower in practice than the smoke-test
suggested (~8-12s observed, vs ~3-4s warm), and 30 perfis x 9
properties did not converge in 46 min wall-clock. A clean overnight
run is the right path.

## Reproduced baseline (focused, 30 perfis FR/PL/IT)

```
configuration                    | elapsed_s | accuracy | in_scope
-------------------------------------------------------------------
baseline_no_fill                 |       3.3 |    0.000 | 27 / 30
```

0.0% on N=30 is consistent with the v0.9.49 baseline (3.0% on
N=200): without subsoil chemistry, no WRB diagnostic horizon
fires (cambic / argic / mollic / ferralic / spodic all need
subsoil features), so `classify_wrb2022()` falls back to
**Regosols** (catch-all). Histosols recall in v0.9.49 was 1/3
(33%) -- the histic threshold (OC >= 12%) is the only one
detectable from a 20 cm sample alone. With N=30 the lone
Histosol candidate didn't make it into the sample.

## Stage-2 hold-up: SoilGrids COG latency

The smoke test in `inst/benchmarks/run_lucas_v0950_close_focused.R`
showed:
- 1 coord + 1 property + 1 depth = ~10-16 s cold call
- 5 coords + 1 property + 1 depth = ~19 s (~4 s/coord warm)

In the actual 30-perfis run on 2026-05-06, the warm rate was
~8-12 s/coord-property over the `plantonderzoekwur.nl:443` SoilGrids
COG endpoint. Estimated wall-clock for 30 perfis × 9 props:
- best case (~4 s) : ~18 min
- observed (~10 s) : ~45 min
- worst (~15 s)    : ~70 min

The actual run hit 46 min and was killed before stage 2 emitted
its accuracy line. **A clean overnight run is the simplest path**.
Both scripts save the partial RDS after stage 1 so a restart is
safe.

## Recommended workflow for v0.9.61

```bash
# 30 perfis, baseline + subsoil_soilgrids only:
nohup Rscript inst/benchmarks/run_lucas_v0950_close_focused.R \
    > /tmp/lucas_focused_overnight.log 2>&1 &

# Or 100 perfis stratified ES/FR/PL/IT, 3 configs:
nohup Rscript inst/benchmarks/run_lucas_v0950_close.R \
    > /tmp/lucas_full_overnight.log 2>&1 &
```

The `_focused` variant should converge in 30-90 min once SoilGrids
load is light. The `_full` variant takes 2-5h because it adds the
`topsoil_plus_subsoil_soilgrids` config (cfvo for Leptosols, an
extra 9 properties × 100 perfis).

## Output paths

- `inst/benchmarks/reports/lucas_v0950_close_focused_<DATE>.rds`
  -- partial RDS after stage 1 (this run); will be overwritten
  with the full result when a complete run lands.
- `inst/benchmarks/reports/lucas_v0950_close_focused_<DATE>.txt`
  -- text summary, only written when stage 2 completes.

## Honest reading

v0.9.60 closes the **methodology** gap of v0.9.50 (script exists,
runs end-to-end, replicates baseline) and the **headline empirical
gap** of `benchmark_bdsolos` (SiBCS Order 27.9% on RJ.csv). The
LUCAS post-fill number remains open as a v0.9.61 deliverable, gated
purely on a network-throughput-friendly window for the SoilGrids
COG endpoint.

This is the same kind of "honest baseline" the v0.9.49 NEWS used:
acknowledge what the run shows and what it does not show.
