Skip to content

world: the generated world's water is at water_level_m, and a road's bank is dry - #1374

Merged
transfix merged 1 commit into
masterfrom
fix/world-water-level
Nov 20, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/world-water-level

Conversation

@transfix

Copy link
Copy Markdown
Owner

Six of GRL-SNAM's 205 fixed/retrain scrub checkpoints on the Humvee counted 71–186 ticks "inside a building" with no building contact (CVC-Lab/GRL-SNAM#192). There's no building there. The car drove into a basin at (−290, 175), 0.6–3.5 m above the −4 m water level. The navigator read that basin as deep water, and the physics has nothing there to collide with.

Cause

The generated world gives its terrain cells water where there is none, in two ways. The navigator reads these cells through nav::rasterize, and the physics reads them through add_world_geometry.

A. The water level.

  • The raster's water classes (derived_class) and each terrain cell's (cell_class) are measured against the terrain source's sea_level_m(). That is the 0 m datum every generator lays its relief against. water_level_m is where the water is drawn.
  • When water_level_m is below 0 m, the ground between water_level_m and −0.5 m becomes water_deep. That class is hard, so the navigator keeps off it, and the physics gives the car deep water's grip.
  • Fix: terrainFrom wraps the ground in water_level_terrain, so sea_level_m() returns water_level_m. The wrapper is added only when the two differ, so a world at 0 m is unchanged by this part.

B. The grade.

  • The terrain cells take their class at the materials stage, before the roads grade the ground. regradeRaster then re-classes only the raster, so a bank a road lifted out of the water stays water on the mesh.
  • Fix: the grade stage now re-classes, with cell_class, every cell with a corner that the grade or a waterline sliver moved. Before, only the slivers' cells were re-classed (world: lower the terrain mesh's waterline slivers under the water #1271). Each cell is re-classed once, in the grade's last step.

Measured

On GRL-SNAM's scrub world (seed 7, 1 km, a 25 m relief, water at −4 m, nav planes at 2 m):

master this branch
nav samples blocked 17.9% 2.8% (2.45% buildings, 0.35% real water)
blocked water on ground at or above −4 m 14.8% 0
the six Humvee runs' 809 "inside" ticks all on that water 0 inside
kinematic "inside buildings" ticks (three sets) 79–93% on that water buildings only
  • These run counts come from re-scoring the cached trajectories on the fixed planes. A re-deploy would drive differently.
  • No building collider is missing. The nav's building cells come from the same buildings mesh (role_all) that the physics collides with.

Tests

  • ACellsWaterIsTheMeshsDepth now includes graded cells and runs at water levels of 0 m and −4 m. It also checks the raster: no dry sample is water.
  • New: TheScrubWorldsNavigatorHasNoWaterOnDryGround rasterizes the scrub world the way pycvc_gl.cars does.
  • Both fail on master:
    • 63 wrong cells at 0 m (road banks) and 2,207 at −4 m;
    • 7,660 dry water cells in the scrub world, and the runs' way in is water_deep.
  • Passing locally (Release, Jolt on, no cvcGL or pycvc): world_generated_test 35/35, ariadne_scene_world_test 86, ariadne_loader_test 244, multi_app_integration_test 5, nav_sim_world_test 8, nav_world_planes_test 4 (1 skip, no bundle), physics_vehicle_test 34, physics_world_test 47, physics_plant_host_test 5, world_water_bodies_test 23.
  • Not run locally: the cvcGL and pycvc consumers (cvcgl_ariadne_physics, test_pycvc_gym, test_pycvc_gl_cars, ...). CI covers them.

Behaviour change

  • Worlds at the default 0 m: only graded cells that a road lifted out of the water change. They become dry, as the raster already had them.
  • Worlds with water_level_m other than 0: the navigator and the physics change wherever the ground lies between the water level and 0 m. GRL-SNAM's scrub page and anything else deployed on its −4 m world would need a re-deploy on a libcvc carrying this; its Pages deploy pins 4.0.0. Whether to backport is a separate call.

…bank is dry

The terrain cells the navigator and the physics read (nav::rasterize, add_world_geometry) had
water where there was none, in two ways:

- The raster's water classes (derived_class) and each terrain cell's (cell_class) were taken
  against the terrain source's sea_level_m(), the 0 m every generator lays its relief against,
  not water_level_m, where the water is drawn. Below 0 m the ground between water_level_m and
  -0.5 m was deep water: hard, so the navigator kept off it, and the physics drove on deep
  water's grip. terrainFrom now wraps the ground (water_level_terrain) so sea_level_m() is
  water_level_m; a world at 0 m is unchanged.
- The terrain cells take their class at the materials stage, before the roads grade the ground,
  and regradeRaster re-classed only the raster: a bank a road lifted out of the water stayed deep
  water on the mesh. The grade stage now re-classes (cell_class) every cell with a corner the
  grade or a waterline sliver moved, not only the slivers' (#1271).

GRL-SNAM's scrub world (seed 7, 1 km, a 25 m relief, water at -4 m): the navigator blocked 17.9%
of it, 13.5% of it phantom water on dry ground; now 2.8% (2.45% buildings, 0.35% real water). Six
fixed/retrain Humvee checkpoints drove into one such basin at (-290, 175): 71-186 ticks "inside"
with a clearance down to -25 m and no contact, the physics having nothing there to hit.

Test: ACellsWaterIsTheMeshsDepth now takes the graded cells too and runs at 0 m and -4 m (and the
raster: no dry sample is water); TheScrubWorldsNavigatorHasNoWaterOnDryGround rasterizes the
scrub world as pycvc_gl.cars does. Both fail on master (63 wrong cells at 0 m, 2207 at -4 m;
7660 dry water cells in the scrub world, its way in water_deep).
@transfix
transfix enabled auto-merge (squash) November 19, 2026 22:59
transfix added a commit to CVC-Lab/GRL-SNAM that referenced this pull request Nov 20, 2026
…combo, and a UI guide (#192)

In the checkpoint scrubber, the cars drove through the buildings. That was not a drawing bug. The scrubber deployed every checkpoint on nav's `kinematic` bicycle, which has no collision response, and the recorded runs really went through the buildings. This PR moves the scrubber onto the Jolt Humvee, which collides with the world, adds a way to pick the plant, and adds a short guide to the UI.

## What changes

- **The Humvee is the default plant.** `scrub.ari`'s `init:` seeds `nav_plant.vehicle` to `humvee`; `--plant` and `--set` still override it. A car that drives into a building now stops against it.
- **A Plant combo.** The Scrub window gets a Plant combo when the runs were deployed on more than one plant. It shows the same run at the same training step on the other plant, as the Set combo does across data sets. The view groups runs by data set and plant, and the Run combo lists a set's runs on the current plant.
  - **Natively:** `--plant` may be given more than once (`--plant humvee --plant kinematic`). Every checkpoint is deployed on each plant, cached per plant. One `--report` still holds one plant's run, and asking for two is refused.
  - **On the Pages page:** `pages/assemble.py --scrub-plants` (default `humvee kinematic`) deploys each set on each plant. When a page has more than one plant, its bundles move to `data/<plant>/<set>/<run>.scrub.zip`. The page opens on the Humvee, and the Plant combo switches to the kinematic runs for comparison. pages.yml lists the reports per plant, and its run cache key moves to v4.
- **`docs/scrubber-guide.md`**, a short guide. It covers each window (Scrub, Training, Episode, Stats, Ledger, Simulation), the six signs of a policy converging on useful behaviour, the warning signs, and what today's runs show. The scrub section of `grl_snam/ariadne/README.md` links to it.

## What the Humvee shows

The full re-deploy, as the site build does it: three sets × five seeds × 41 checkpoints × both plants, 1200 ticks each on the generated world, libcvc 4.0.0 (the closure pages.yml pins). No checkpoint reaches the goal on either plant.

| set | plant | ticks penetrating | least clearance | path | left to the goal |
|---|---|---|---|---|---|
| retrain | kinematic | 375–636, every checkpoint | −28.9 m | 480–631 m | 272–353 m |
| retrain | humvee | 0 | 1.33 m | 414–415 m | 579–580 m |
| fixed/retrain | kinematic | 372–634, every checkpoint | −28.9 m | 479–636 m | 231–350 m |
| fixed/retrain | humvee | 0 at 199 of 205, 71–186 at 6 | −25.7 to 49.0 m | 303–472 m | 503–667 m |
| world-units/retrain | kinematic | 355–459, every checkpoint | −29.8 m | 471–485 m | 329–339 m |
| world-units/retrain | humvee | 0 | 0.70–0.82 m | 212–218 m | 588 m |

- **What "ticks penetrating" counts.** It is the ticks a car's centre is on a cell the navigator marks blocked: a building, or deep water. On this world most of them are not buildings. libcvc 4.0.0's generated world marks dry ground between its −4 m water level and −0.5 m as deep water. transfix/libcvc#1374 fixes that.
- **On kinematic, the progress was never real.** Every checkpoint spends 355 to 636 of its 1200 ticks on blocked cells. 79–93% of those ticks are on the mislabelled water, and the rest are in buildings.
- **On the Humvee, two sets come to one outcome.** In `retrain` and `world-units/retrain`, whatever the seed or the step, the car meets a building and stays against it. That is the honest picture for the page and for the guide: these policies do not route around a building.
- **The six `fixed/retrain` Humvee checkpoints that penetrate are not in a building.** They count 71 to 186 ticks penetrating with no building contact. They drive into a dry basin near (−290, 175), 0.6–3.5 m above the water level. The navigator reads it as deep water, and the physics has nothing there to collide with (transfix/libcvc#1374). The page's runs are deployed on libcvc 4.0.0, so these counts stay until a libcvc with that fix is released and the runs are deployed again.

## Defaults and cost

- **Deploying on the Humvee costs about 10% more time than kinematic:** 106 s against 96 s for one run of 41 checkpoints. The site build's deploy of all 30 runs took 4058 s here.
- **Shipping both plants doubles the page's run logs, so this PR now carries #194** (squash 06880b5 on this branch).
  - In the old format, a run's bundle is 5.8–6.1 MB on the Humvee and 5.1–5.3 MB on kinematic. The 30 bundles total 167 MB.
  - That is over arigl-web's 128 MiB cap on a page's document set (`max_bytes` in libcvc 4.0.0's `doc_fetch.h`). On fd3ef7a the pages job dropped 7 bundles and scrub failed to start.
  - #194 packs the lean run logs losslessly (`run_log/v2`). The bundles come to 96.2 MB, and a first visit to about 129 MB.
  - `--scrub-plants humvee` builds a page with the Humvee alone.
- **Earlier kinematic runs stay readable:** a report records its plant, and `scrub --view` shows it.

## Tests

- `tests/test_ariadne_scrub.py`:
  - The module fixture pins `--plant kinematic`, so it still compares checkpoint 0 with `live --arms --plant kinematic`.
  - New: the default plant is the Humvee.
  - New: `--plant` given twice deploys both plants, the Plant combo keeps the same run and step, and `--report` with two plants is refused.
  - The assemble deploy test pins `--scrub-plants kinematic`.
- `tests/test_ariadne_browser.py`, new: a two-plant page names its bundles `data/<plant>/<set>/<run>.scrub.zip` and opens on the Humvee.
- Locally on the pages.yml closure (libcvc 4.0.0, CPU): both files pass, 39 tests plus 1 GL-only skip.
- black 26.5.1 and ruff 0.16 (CI's versions) are clean.
@transfix
transfix merged commit e5e1c48 into master Nov 20, 2026
29 checks passed
@transfix
transfix deleted the fix/world-water-level branch November 20, 2026 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant