Skip to content

scrub page: 30 fps, the Humvee's model, the pause, how far apart the runs drive, real tables, a legend - #206

Merged
transfix merged 7 commits into
mainfrom
fix/scrub-page-ux
Nov 24, 2026
Merged

transfix merged 7 commits into
mainfrom
fix/scrub-page-ux

Conversation

@transfix

@transfix transfix commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Joe tried the scrub page (transfix.github.io/grl-snam-demos/scrub/) on 2026-11-23 and found four problems: no Humvees, jerky movement, no pause, and a scrub that seemed to do nothing. He also asked for real table columns and for windows that fit their content. This fixes all six, and adds the legend for the cubes over the cars that Joe asked for afterwards. The site needs one more line, in transfix/grl-snam-demos#3 (installs vehicle-humvee); without it the page's cars stay boxes.

before: main's page, from above after: as it opens now
before after

Jerky: 10 → 30 fps

The page was measured in headless Chrome 152 on the GPU (ANGLE GL, GTX 1650, 1600×900). Both builds use the same 30 runs, deployed today with libcvc 4.0.0, and measure 15 s of playback each, back to back:

fps frame p50 p90 worst long tasks
main 10.2 83 ms 217 ms 233 ms 154 in 15 s
this branch 30.4 33 ms 50 ms 67 ms 24 in 15 s

Two causes, found with cProfile over 300 offscreen frames natively (25.6 ms of Python a frame):

  • Trails, every sixth frame. update_ghosts removed and re-added both trails (add_path 25 ms, removeGraphics 12.5 ms, each twice), about 75 ms natively and far more in wasm. A replay knows the whole path up front. The view now draws each run's whole path once per checkpoint, after the pick holds still for 0.25 s, so dragging the slider draws none. st["tracks"] = None tells update_ghosts to skip its running tracks; live and replay are unchanged.
  • Tables, every frame. Each frame called set_table six times, 1.3 ms each, because set_tree removes the subtree and rewrites every cell. Now the tables follow the play head at most every 0.2 s while it plays, and at once for a new checkpoint, run or arm. live.set_rows also writes only the cells that changed.

After both: about 1.5 ms of Python a frame. The rest is the Ariadne walk. The 41-row checkpoint table (about 410 text cells) cost 12–15 ms a frame in wasm on its own (31 vs 20 fps), and the row-major layout costs the same. So the table moved to its own Checkpoints window. The page opens with it closed; Table in Scrub opens it.

No Humvees

  • The page orbited the whole city, where a 4.7 m car is a pixel or two. It now opens on the follow camera (scrub.ari's own default).
  • The page drew boxes anyway. pycvc_gl finds Humvee.glb only in an install prefix or in Austin's bundle, and cvcpkg.org sends no CORS for github.io. assemble.py now ships vehicle-humvee's glTF (0.6 MB, CC BY 4.0) at share/cvc-scenes/shared/Humvee.glb, adds its credit (from the glTF's own asset.extras: "Low Poly Humvee FREE" by MadTrollStudio) to the page's THIRD_PARTY_NOTICES.md, and main.py points CVC_PREFIX at the page. --vehicle-model names the file; the default is that path in --python's prefix. pages.yml installs the package.
  • Checkpoint k's car is opaque and orange, step 0's see-through and blue. Their tags above them show both cars where they overlap.
  • The page logs which it drew (scrub: the cars are the Humvee's model), and the smoke checks that line whenever the page ships the model.

No pause

The Episode window now has Paused, Step, Restart and Speed. Scrub → Paused and the Simulation window are still there.

The scrub does nothing

The slider works. Dragging it in the page steps the checkpoint through 29 → 2 continuously, with no fight from the snapped write-back. But on the set the page opened on, every checkpoint drives like step 0:

  • apart_m is new: the farthest checkpoint k's car gets from step 0's at the same tick. It is in the report and the Metric combo, and in the table as apart (m). Reports without it are measured from the run logs when a checkpoint is shown.
  • The Scrub window says it for k and for the whole run. When it is under a car's width, it also says the two drive as one, e.g. on retrain: "every one drives within a car's width (2.2 m) of step 0, so on this scenario, training has not changed how it drives".
  • Most apart jumps to the checkpoint farthest from step 0. --at far opens there, and --data-set/--plant pick the run --view opens on.
  • The page opens on the set whose checkpoints part most. assemble.open_set takes the median apart_m per set and prints each one: on the Humvee that is retrain 0.1 m, world-units 1.0 m, fixed/retrain 9.3 m. fixed/retrain's pick is step 0 on every seed, so the page opens at its farthest checkpoint (--at far): seed 0 at step 2800, 80.9 m from step 0. That one is a dry-basin drive the README already describes (186 ticks "penetrating" libcvc 4.0.0's mislabelled water).

Per set, measured on today's deploy (median; each seed's farthest):

Humvee kinematic
retrain 0.1 m; 0.26–0.45 m 15.3 m; 39–120 m
fixed/retrain 9.3 m; 54–98 m 39.1 m; 114–119 m
world-units/retrain 1.0 m; 1.2–1.4 m 8.1 m; 8.6–11.1 m

A legend for the cubes

Joe asked what the blue and orange cubes over the car mean. They are the per-arm tags live.draw_ghosts draws, stacked so both show when the cars overlap. The Stats window now ends with a legend headed "in the scene":

  • one line per arm, in its colour slot's colour (c0..c7, _arms.SLOTS), with the arm's real name: "blue cube: step 0 (untrained) / see-through car, blue path" and "orange cube: step 2800 (the checkpoint picked) / solid car, orange path";
  • then "cubes stacked over one car: those runs are at the same spot" and "yellow post: the goal".

live.ghost_legend builds it from the arms' names and slots, and update_ghosts writes it whenever it changes. The legend sits in stats_panels.ari, so live --arms and replay show it too, with their own arm names.

Real tables, and windows that fit

  • Ariadne 4.0.0 has no table widget. A grid with col_widths is an ImGui table, but repeat: emits a whole group per instance, so every row was its own one-row table and the header another, lined up only by fixed pixel widths.
  • Each table in scrub.ari and stats_panels.ari (Checkpoints, Stats, the Ledger's five) is now one grid whose cells are its columns: a header, a rule, then that column's repeated values. auto widths fit each column to its widest cell, and the grid has borders.
  • No window in scrub.ari, and neither shared Stats/Ledger unit, has a fixed size:. Each fits what it shows, as far as the view's edge, with min: widths where a chart needs room. Stats and Episode are placed past the view's right and bottom edges, so the view moves them in to its corners. live.ari and replay.ari still set their own sizes.

Checked

  • tests/test_ariadne_scrub.py and test_ariadne_live_arms.py: 54 passed, 1 skipped (no grl-snam-weights here), with GL (the offscreen scrub test), on the libcvc 4.0.0 closure. New tests: apart and its texts, ghost_legend, first_run, set_rows, open_set, model_credit, Most apart in the view, --view --data-set --plant --at far, and assemble shipping the model.
  • black 26.5.1 and ruff are clean.
  • The local page: ariglx-web v4.0.0, all 30 runs deployed today from main and read back by this branch, served locally. pages/smoke.mjs passes 5/5 under SwiftShader, including the new cars check. In the page by CDP: Table opens Checkpoints, Paused pauses, Next and Most apart step, the Scrub drag scrubs, and the Set combo switches.
  • "this world is not quite the one deployed on" showed up only in my first local build, which used run logs cached on 2026-11-19. Since Ariadne: the ports drive in their document's world node, which libcvc's SceneWorld runs #196/Ariadne: SceneWorld's own colliders and a drawn host's grid (with libcvc#1391), and a page takes its world in a frame #198 the report stores scenario.world as {settings, stats} instead of one flat dict, and the check compares the two as text. The generator settings are identical. Reports deployed with the page's own code match exactly, and the site deploys its runs with the same code, so the site never shows this.

Not in this PR

…y drive, real tables

Joe's four problems on the Pages scrub page, and his two asks:

- Jerky: each frame rewrote six tables (set_table rewrites a whole subtree) and every
  sixth frame removed and re-added both trails. Now the tables follow the play head at most
  every 0.2 s while it plays, writing only the cells that changed (live.set_rows), and each
  run's whole path is drawn once per checkpoint. Python per frame natively: 25.6 -> ~1.5 ms.
  The 41-row table moves to its own window (Checkpoints; Table opens it): walking its ~410
  cells costs 12-15 ms a frame in wasm.
- No Humvees: the page orbited the whole city, and drew boxes (pycvc_gl finds Humvee.glb only
  in a prefix or Austin's bundle). The page ships vehicle-humvee's glTF where pycvc_gl looks
  (main.py makes the page that prefix), credited in THIRD_PARTY_NOTICES.md, and opens on the
  follow camera. Checkpoint k's car is opaque, step 0's see-through.
- No pause: Paused, Step, Restart and Speed are in the Episode window.
- The scrub does nothing: on the default set every checkpoint drives within 0.45 m of step 0.
  apart_m (the farthest k's car gets from step 0's) is a metric, a table column and two lines
  in the Scrub window, which say when the two drive as one. Most apart picks the checkpoint
  farthest from step 0; --at far opens on it; --data-set / --plant pick the run --view opens
  on. The page opens on the set whose checkpoints part most (fixed/retrain, whose pick is step
  0 on every seed), at its farthest checkpoint.
- Tables: one grid per table whose cells are its columns (header, rule, values), auto widths,
  borders, so the columns are the table's (Ariadne 4.0.0 has no table widget, and repeat:
  made every row its own table).
- Windows have no fixed size: each fits what it shows, as far as the view's edge.
…lay get it too)

Joe asked what the blue and orange cubes over the car mean. live.ghost_legend writes a line per
arm in use, in its colour slot's colour (stats_panels.ari's text rows, one per slot c0..c7):
'<colour> cube: <arm name> (<note>)', then 'see-through/solid car, <colour> path'; and what
cubes stacked over one car (the runs at the same spot) and the yellow post (the goal) mean.
update_ghosts writes it when it changes; the scrubber notes step 0 as untrained and k as the
checkpoint picked.
@transfix transfix changed the title scrub page: 30 fps, the Humvee's model, the pause, how far apart the runs drive, real tables scrub page: 30 fps, the Humvee's model, the pause, how far apart the runs drive, real tables, a legend Nov 24, 2026
transfix added a commit to transfix/grl-snam-demos that referenced this pull request Nov 24, 2026
The scrub page's cars are boxes on the site: pycvc_gl finds the Humvee's glTF only in an install prefix or Austin's bundle. CVC-Lab/GRL-SNAM#206 ships it with the page from --python's prefix (share/cvc-scenes/shared/Humvee.glb, CC BY 4.0, credited in the page's THIRD_PARTY_NOTICES.md); this installs vehicle-humvee into the deploy closure. Harmless before #206 lands.
@transfix
transfix merged commit ac77808 into main Nov 24, 2026
5 checks passed
transfix added a commit that referenced this pull request Nov 24, 2026
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