Repository navigation
Conversation
…ry at a rate The Ariadne runtime's frame (AriRuntime::frame) cost more in a browser than drawing the scene: with two dozen posed vehicles it walked state paths and formatted every entity's and the physics world's telemetry as text every frame, and the camera's clipping-range fit ran a VTK pipeline update for every actor each frame anything moved. - cvc::state: revision() (a node's value and data changes) and shapeRevision() (its tree's nodes and links), and cvc::state_key, a lookup held until the tree changes shape. value(string) takes the node's lock once. - The world's telemetry: the per-frame stats as before; the stats' lines and each entity's pose, speed, books and command at physics.telemetry_hz (seeded 10, in world time; 0 = every frame), and once more where a world stops; a new entity's keys, and all of them after a change of the entities, at once. Only what changed is written. - Held lookups for visible: bindings, clip offsets, bound opacity, repeat counts, data nodes, ribbons, pose keys and packed poses, the poses table, WorldVehicles::poll, adaptive quality and the key capture. - cvcGL: GraphicsNode no longer rebuilds an unused vtkTransform on each pose, and a GeometryNode's mapper is Static (its input is the node's own polydata, with no pipeline above it).
transfix
marked this pull request as draft
November 23, 2026 03:29
Owner
Author
|
Draft: this overlaps #1477 (the same runtime-frame fix from another session, opened first, its own |
Owner
Author
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.
The Ariadne runtime's frame (
AriRuntime::frame) cost more in a browser than drawing the scene did: with about 24 posed vehicles on a city, it walked state paths and formatted every entity's and the physics world's telemetry as text, every frame, and the camera's clipping-range fit ran a VTK pipeline update for every actor each frame anything moved. This makes the frame hold its lookups, write what changed, and write the telemetry at a rate.What changed
cvc::state: change counts, and a held lookup
state::revision(): a count that moves with each change of a node's value or data, asvalueChanged/dataChangedfire. A reader can tell the node was not written since it last looked, without copying the value or connecting a slot.state::shapeRevision(): one count per tree that moves when a node is added or removed, or a link is made, moved, cleared or has its mode or writability changed.cvc::state_key(inc/cvc/state/state_key.h): a path looked up once and held, walked again only after the tree changed shape. Itsread/write/find/getarefindThroughLinks/childThroughLinks/findDescendant/operator(), with their semantics. It pins the node and the way to it.state::value(string)takes the node's lock once instead of four times. The link check, the read-only check, the compare and the store are now one hold; the behaviour is the same.The world's telemetry at a rate (
physics.telemetry_hz, seeded 10)physics.stats.{tick, time, step_ms, bodies, active_bodies, contact_events, saturated}, andhashwhen asked.step_ms_history,nodes,vehicles) and each entity's pose, speed, books and command are written on the frame whose steps cross into a new 1/rate of world time. A period isround(1 / (rate × fixed_dt))steps counted from tick 0, so the ticks are the same at any frame rate, drawn or headless.0writes them every frame that steps.rev). Its identity,ids,countandrevare never late.%.6g; the stats'%.17g, formerly anostringstream). Something else writing one of these keys is seen through the node's revision, and the next write puts the value back.WorldVehicles::publish()andSceneWorld::publish_stats()still write everything;WorldVehicles::publish(bool telemetry)is the rate's form.Held lookups in the frame
visible:bindings (sync_scene_visibility): skip a frame in which neither key was written.repeat:counts and data nodes' status.WorldVehicles::poll()'s keys, adaptive quality's two keys, and the key-capture key.cvcGL
GraphicsNode::updateTransformno longer sets avtkTransformthat nothing read. Every pose rebuilt its concatenation, allocating and freeing VTK objects.Static: its input is the node's own polydata, changed in place, with no pipeline above it. The camera's clipping-range fit asks every actor for its bounds each frame anything moved, and the pipeline updates were most of what that cost.Docs: docs/ARIADNE.md (the telemetry rate, the entities' keys), scene_world.h, world_vehicles.h.
Measured
On a bench document: 24
poseentities driven by timed poses on the small Austin data city (scene-austin-south-small), each with an entity label, two windowed ribbons, a draped link and a marker (repeat:, each with a boundvisible:), and the physics panel.rt.frame()was timed with a scratch timer in arigl that is not part of this PR.rt.frame, wall time (1/60 s frames, 1280x720)rt.frame, instructions (callgrind, steady frames)AppRuntime::drain| of which the camera's clipping-range fit | 5.4 M | 0.69 M |
Browser numbers (wasm-mt, JSPI and wasm exceptions, headless Firefox 158 and Chromium 145) are not clean yet: this machine's GPU and CPU were shared with stray browser runs. Medians pointed the same way (Firefox p50 about 12 → 8 ms, Chromium 9.4 → 5 ms, at 10–15 fps).
Tests
state_key_test(the counts, the held lookup through links, removal and re-creation, a write through a held node).AriadneWorldVehicles.TheTelemetryIsWrittenAtItsRate(the per-frame stats every frame; the lines and an entity's keys once per period; 0 is every frame; a stopped world writes once more; a foreign write is put back).AriadneBind.SyncFollowsEveryChangeWhileItSkipsTheFramesWithout.cvc::planar(cvcgl_contour_lab,cvcgl_volume_grid_contours, andcvcgl_ari_golden's tiler and skeleton pages), and its GPU's pixels differ fromcvcgl_ari_golden's goldens by the same counts with and without the mapper change. CI is the check for those.