Repository navigation
scrub: the Humvee by default (no driving through buildings), a Plant combo, and a UI guide - #192
Merged
Merged
Conversation
…combo, and a guide The scrubber deployed every checkpoint on nav's kinematic bicycle, which has no collision response, so the cars drove through the buildings: on world-units/retrain seed 0 every checkpoint spent 435-454 ticks inside one, as deep as 29.8 m. The Jolt Humvee collides with the world; on the same run no checkpoint penetrates, and each stops against a building about 150 m in. - scrub.ari seeds nav_plant.vehicle to humvee; --plant / --set override it. - --plant may be given more than once: every checkpoint deployed on each plant (cached per plant), and the Scrub window's Plant combo shows the same run and step on another. One --report holds one plant's run. - The view groups runs by data set and plant (Deployed.plant, from the scenario); the Run combo lists a set's runs on the current plant. - pages/assemble.py --scrub-plants (default humvee kinematic) deploys every set on each plant; a page with several plants names its bundles data/<plant>/<set>/<run>.scrub.zip and opens on the first plant. pages.yml lists the reports per plant; its run cache key moves to v4. - docs/scrubber-guide.md: each window, what a policy converging on useful behaviour looks like there, the warning signs, and what today's runs show.
This was referenced Nov 19, 2026
…dings (libcvc#1374)
…6 MB, the page 188 -> 129 MB (#194) The scrub page's run logs, packed losslessly: the 30 run bundles go from 167.5 MB to 96.2 MB, and a first visit to the scrub page from about 188 MB to about 129 MB (gzip). **Stacked on #192.** The base is `fix/scrub-walls`, since #192 changes the same files (`pages/assemble.py`, `pages.yml`, `scrub.py`, the docs). `ci.yml` runs only on PRs into main, so tests, black and ruff ran locally (below). This PR goes to main once #192 merges. ## The format A lean run log is now stored as `grl_snam.run_log/v2`. The arrays and meta are the same as v1, but the arrays are packed into one `packed` uint8 member, and `meta["packed"]` gives the encoding (`delta-shuffle`) and each array's name, dtype and shape: 1. The arrays of one dtype form one vector, each array flattened time first. 2. Each value's bit pattern is stored as its difference from the value before. These are unsigned integers that wrap, so the difference is exact. 3. The bytes are shuffled: every value's first byte, then every second byte, and so on. 4. npz deflates the result, as before. Unpacking needs only numpy and zlib (`diff`/`cumsum` on unsigned ints, a transpose, `np.load`), which is what the page has in ariglx-web. - `RunLog.save(lean=True)` writes v2. A full save is still a plain v1 npz, so `--log` and the cars template's readers are unchanged. - `RunLog.load` reads v1 and v2, so today's lean logs still read. An older GRL-SNAM refuses a v2 log by its schema instead of misreading the packed bytes. - Cache: `scrub`'s `deploy_all` reads a v1 lean log it finds in its cache and packs it in place. It is the same run, so it is not deployed again. `pages.yml`'s scrub run cache key goes from `scrub-runs-v4` to `v5`; the key also changes with `grl_snam/**`, so CI deploys again either way. ## Measured On the cached deploy of #192 (libcvc 4.0.0, three data sets × five seeds × two plants, 1230 lean logs of 71 series × 1200 ticks): | | per log | all logs | bundles (raw / gzip -9) | scrub page, first visit (gzip) | |---|---|---|---|---| | v1, today | 126.4 KB | 159.2 MB | 167.5 / 153.8 MB | 187.5 MB (Humvee alone 116.5 MB) | | **v2** | **69.8 KB** | **87.9 MB** | **96.2 / 95.0 MB** | **128.8 MB (Humvee alone 85.3 MB)** | - A run's bundle is now 3.3–3.7 MB on the Humvee and 2.9–3.0 MB on kinematic. A five-seed set is 15–18 MB a plant. - The page totals use the real ariglx-web 4.0.0 host (34 MB gzip, mostly `ariglx.wasm`). Other layouts measured on the 41 Humvee `world-units/retrain` seed 0 logs (KB a log; today 138.6): | layout | KB a log | |---|---| | byte shuffle, one npz member per array | 109.8 | | byte shuffle, one blob (dtype-grouped) | 91.1 | | xz, no shuffle | 86 | | **delta + shuffle, one blob (this PR)** | **79.8** | | deflate level 9 instead of npz's 6 | about 0.5% more off | Most of the gap between per-array shuffling and one blob is the 71 members' zip headers, plus deflate restarting for each member. **Not done (option only): keep every 2nd tick.** On top of v2 it gives 45.9 KB a log against 80.5 KB (same logs), but it halves the time resolution. float16 was ruled out: the energy series overflow, and positions near 300 m get 0.25 m steps. ## Verified - **Bit for bit, real data.** All 1230 deployed logs packed by `assemble.py --scrub --scrub-cache` (all 1230 `cached, packed`, none deployed again) read back equal to their v1 originals: same arrays, dtypes, shapes and bytes, and the same meta apart from the schema. All 1230 logs inside the 30 bundles are v2. - **Tests.** New tests in `tests/learning/test_learning_runlog.py`: - packing is exact for NaNs with payloads, ±inf, -0.0, subnormals, wrapping differences, several arms, bool/uint16/int64, and 0-d and empty arrays; - a lean log reads back bit for bit; - a v1 lean log (as written before this PR) still reads, and packs to the same arrays; - a full save of a loaded v2 log is v1 again; - load refuses an unknown encoding, a short or long blob, and an unknown schema. `tests/test_ariadne_scrub.py` checks that `deploy_all` packs a v1 cached log in place and leaves a v2 one alone. - **Local run.** `tests/learning/`, `test_ariadne_scrub.py`, `test_ariadne_live_arms.py`, `test_lab_acceptance.py`, `test_ariadne_cars.py` and `test_ariadne_ports.py` on the libcvc 4.0.0 closure: 156 passed, 9 skipped. 2 failed on `No module named 'click'`: the deploy closure has no click, and those tests (`test_grl_snam_subcommands_pass_through`, `test_the_cli_command`) don't touch the run log. - **Lint.** black 26.5.1 and ruff 0.16.0, both from cvcpkg: clean. - **Browser.** `pages/smoke.mjs` on the assembled site (ariglx-web 4.0.0, headless Chrome) passed all 9 cases. The scrub page started in 26.8 s and showed `retrain/seed0: checkpoint 22 of 41, step 2100; 30 runs in 3 data sets ... on 2 plants`, with the world drawn. ## Docs - `pages/README.md`, `pages/assemble.py`, `grl_snam/ariadne/README.md`, `scrub.py` and the landing card: the new sizes ("about 95 MB" added to a first visit, was 170 MB). - `runlog.py`'s docstring describes v2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the checkpoint scrubber, the cars drove through the buildings. That was not a drawing bug. The scrubber deployed every checkpoint on nav's
kinematicbicycle, 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
scrub.ari'sinit:seedsnav_plant.vehicletohumvee;--plantand--setstill override it. A car that drives into a building now stops against it.--plantmay be given more than once (--plant humvee --plant kinematic). Every checkpoint is deployed on each plant, cached per plant. One--reportstill holds one plant's run, and asking for two is refused.pages/assemble.py --scrub-plants(defaulthumvee kinematic) deploys each set on each plant. When a page has more than one plant, its bundles move todata/<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 ofgrl_snam/ariadne/README.mdlinks 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.
retrainandworld-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.fixed/retrainHumvee 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 (world: the generated world's water is at water_level_m, and a road's bank is dry 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
max_bytesin libcvc 4.0.0'sdoc_fetch.h). On fd3ef7a the pages job dropped 7 bundles and scrub failed to start.run_log/v2). The bundles come to 96.2 MB, and a first visit to about 129 MB.--scrub-plants humveebuilds a page with the Humvee alone.scrub --viewshows it.Tests
tests/test_ariadne_scrub.py:--plant kinematic, so it still compares checkpoint 0 withlive --arms --plant kinematic.--plantgiven twice deploys both plants, the Plant combo keeps the same run and step, and--reportwith two plants is refused.--scrub-plants kinematic.tests/test_ariadne_browser.py, new: a two-plant page names its bundlesdata/<plant>/<set>/<run>.scrub.zipand opens on the Humvee.