Skip to content

Ariadne: a parted vehicle look whose wheels roll and steer (replaces #1472) - #1471

Merged
transfix merged 4 commits into
masterfrom
feat/ariadne-wheeled-look
Nov 23, 2026
Merged

transfix merged 4 commits into
masterfrom
feat/ariadne-wheeled-look

Conversation

@transfix

@transfix transfix commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

This replaces #1472 (Joe, 2026-11-23: "keep #1471, close #1472"). #1472 had been squash-merged to master as 316b440, so this branch is three commits:

Squash-merged, it moves master from #1472's look: { file:, wheel:, wheelbase:, track: } to the look below.

A world vehicle drawn as a one-piece model (look: { model: humvee }) can't turn its wheels: Humvee.glb is one mesh with its wheels in it, and the view merges it. This adds a parted look, a chassis mesh, one wheel mesh and a rig. Each wheel is then drawn as its own node, rolled at the vehicle's speed and steered with it.

The look

world:
  vehicles:
    archetypes:
      rover:
        vehicle: humvee
        controllers: [pose]
        look: { chassis: rover/chassis.glb, wheel: rover/wheel.glb, rig: rover/rig.json }
      packaged:
        look: { data: parts, chassis: chassis.glb, wheel: wheel.glb, rig: rig.json }
  • The parts:
    • One frame for all three: metres, x forward, y left, z up (up: y for glTF's frame).
    • The wheel mesh is the left wheel, its axle along y. It's taken about its middle.
    • Files sit beside the document, else where the vehicle models are installed (find_vehicle_model), or with data: in a package.
  • The rig (cvc::ariadne::vehicle_rig): inline, or a YAML/JSON file.
    • radius:, or wheel: { radius: }; none given, it comes from the wheel mesh.
    • hubs:, a list of [x, y, z], or { xyz:, order: }.
    • steer:, by index or name; none given, the front axle steers.
    • mirror: (turn, reflect or none) and up:.
    • Other keys are ignored, so a rig file can keep its provenance beside it.
  • The fit: per axis, so the rig's axles, track and wheel size become the vehicle's. Its ground goes on the ground under the chassis.
  • Each frame (parted_wheel_poses): each wheel goes at its hub.
    • Its height is that of the plant's nearest wheel on the same side.
    • It's rolled by that wheel's spin.
    • When the rig steers it, it's turned by the steer of the nearest steered wheel: a Jolt or dynamic4w wheel's own angle, a pose entity's its pose's steer.

Every plant's wheels roll

  • Before: entity_wheel.spin was set only for pose entities.
  • Now:
    • A Jolt wheel uses its own rotation.
    • The dynamic, dynamic4w and kinematic plants roll at the chassis's speed, integrated each physics step.
    • entity_wheel also says each wheel's radius and whether its axle steered.
  • Visible change: the box look's wheels now roll on the plants too.

Also

  • parse_value (loader.h) reads a YAML or JSON text into a Value, for the rig's file.
  • The catalog publishes look.chassis, look.wheel and look.rig (the file, or an inline rig as vehicle_rig_text). So a vehicle_preview draws a parted look, at rest.
  • docs/ARIADNE.md gains "A model in parts".

Later

  • Suspension for a pose entity: each wheel's own travel. It needs per-wheel state in entity_pose; until then its wheels stand on the ground under them.
  • Conference rooms: the wire (room_entities) carries no parts, so a parted look is drawn as its box there.

Tests

  • ariadne_scene_world_test:
    • ALookInPartsTakesAChassisAWheelAndARig: parsing, rig files, path resolution, the catalog keys and the text round-trip.
    • EveryPlantDrivesInTheScenesWorld: each plant's wheel turns by its speed over its radius across a second, to within 20%, and each wheel has its radius and steered flag.
  • cvcgl_ariadne_wheeled_look (new):
    • Headless: a pose entity driven at 6 m/s and 0.3 rad. It checks the fit, each wheel node's matrix against Rz(steer) Ry(spin), each physics step turning a wheel v dt / r, and both mirrors.
    • parted_wheel_poses alone: Ackermann, suspension, and a rig that steers a wheel the plant doesn't.
    • From a data package: the parts load from a package.
    • Offscreen pixels: from the side, a paddle wheel stands up after a quarter turn of spin. From above, the front wheel turns with the steer and the rear one doesn't.

Local runs (Linux, Release, Jolt on, head 4b222f6 on master 7da04cc)

  • ariadne_scene_world_test: 123 pass, 1 skipped (FleetBench, skipped by design).
  • cvcgl_ariadne_physics: OK.
  • cvcgl_ariadne_wheeled_look: 104/104 checks.
    • From the side: the front left wheel is 64×17 px lying and 17×64 px a quarter turn on.
    • From above: it is 18×54 px straight and 46×49 px steered 0.8 rad; the rear wheel stays 18×54 px.
  • A bug the headless check caught: setRotation drops a node's scale, so a right wheel must be turned before it is scaled (89fd2a0).

@transfix transfix closed this Nov 23, 2026
@transfix transfix reopened this Nov 23, 2026
…nt's wheels roll

A look in parts (look: { chassis:, wheel:, rig: }): the chassis mesh, one wheel mesh and a rig
(cvc::ariadne::vehicle_rig: hubs, radius, steer:, mirror:, up:; inline or a YAML/JSON file),
fitted to the vehicle per axis. Each wheel is a node of its own, posed each frame from the
vehicle's wheels (parted_wheel_poses): at its hub, rolled by its spin, steered when the rig
steers it. The parts may come from a data: package.

entity_wheel's spin is now set on every plant (a Jolt wheel's own rotation; the others rolled
at the chassis's speed each physics step), with its radius and whether its axle steers.
parse_value reads a YAML/JSON text as a Value. Documented in docs/ARIADNE.md.
…1472's tests)

attach_vehicle_model names a parted look's nodes after its group, so the preview's wheels are
<node>_wheel<k>. The wheeled-look test checks the preview's wheels at rest at their fitted hubs and
that an unreadable wheel fails with a warning naming it. ARIADNE_WORLDS.md notes the parted look.
@transfix
transfix force-pushed the feat/ariadne-wheeled-look branch from 05a1021 to 4b222f6 Compare November 23, 2026 08:34
@transfix transfix changed the title Ariadne: a parted vehicle look whose wheels roll and steer Ariadne: a parted vehicle look whose wheels roll and steer (replaces #1472) Nov 23, 2026
@transfix
transfix enabled auto-merge (squash) November 23, 2026 08:57
@transfix
transfix merged commit 2aab686 into master Nov 23, 2026
32 of 33 checks passed
@transfix
transfix deleted the feat/ariadne-wheeled-look branch November 23, 2026 18:55
transfix added a commit that referenced this pull request Nov 23, 2026
#1471's parted look (look: { chassis:, wheel:, rig: }) is a fitted look whose
one-piece model is null, so the entity view drew every parted vehicle as a
node of its own.

- vehicle_look_mesh_of: a parted look's mesh is its chassis and its wheels
  at rest, each point where attach_parted_model's nodes draw it (the chassis
  fitted per axis; each wheel at its fitted hub, a right one turned or
  reflected as its rig says), the wheels in a tyre's dark. One texture, the
  chassis's. add_part bakes a part by a 3x3 matrix, normals by its inverse
  transpose; the one-piece model goes through it too.
- Role 3, the model's (white under its texture, else the entity's colour),
  so an untextured rung keeps role 2's dark.
- make_rungs decimates each colour role on its own. A coarse rung kept no
  roles, so the wheels would have taken the body's colour.
- sync_vehicle_markers keeps #1471's vehicle_wheels with the markers: a
  rebuild clears them, a demoted vehicle's go with its node.

Test cvcgl_ariadne_entities, parted: the mesh against attach_parted_model's
nodes (mirror turn and reflect, an axle offset); 40 at scale in the model's
four rungs, wheels dark at each rung drawn; one rung (lod: false), each
copy's chassis in its colour and its wheels dark.
transfix added a commit that referenced this pull request Nov 24, 2026
…rld on a worker), and FL2's first part (a world's vehicles drawn at scale) (#1475)

* Fleets: a placed vehicle keeps its fleet and its index in that fleet's navigator

A tick at 2000 kinematic vehicles with summary keys looked a vehicle's fleet up 28,000 times
(14 a vehicle), each a search of the fleets by the key's parts, about twice FL1a's plain find
(#1449 left it), and searched its navigator's ids for its index about as often.

- fleet_of(): a placed entity's fleet is set and cleared with its navigator id (place,
  remove_from_fleet, a failed placing, the world gone). A fleet outlives its vehicles in it, and
  an entity's key doesn't change while it is placed. An entity not placed is searched for as
  before.
- index(): kept on the entity until an agent comes or goes in that fleet (a fleet's agents_rev,
  bumped at each add_agent and remove_agent; an index past a removed one drops by one).
- Debug builds assert both against the search. The scene world, holon, holon sync and server
  document suites pass with the asserts on in a Release build.

Timed in one process on a busy machine (a whole tick's A/B was lost in its noise): a search took
124 to 141 ns and the kept fleet 3 to 6 ns; an index 102 to 122 ns and kept 5 to 8 ns. The
roadmap's 3.1 has it.

* Fleets' D3 as OW7's first part: a drawn host's world steps on a worker, in a local holon

A drawn host stepped its scene world (physics and the fleets' navigators) on the frame's
thread: at 3.6x 60 Jolt vehicles took two thirds of a core, 800 kinematic ones all of it. D3
(FLEETS_AND_NIGHT_ROADMAP.md) moves it off; Joe chose to build it as OW7's first part, the
world in a local server-role holon (ARIADNE_WORLDS.md 18.2). A holon has no thread of its own,
so the worker is new:

- cvc::ariadne::world_worker attaches a SceneWorld to a server-role holon of its own (physics
  on, holon_config_at the world's rate) and runs a thread that keeps the holon's lockstep clock
  tick for tick behind the host's, one quantum at a time, so the world takes the steps the
  host's own follow() would. The host holds lock() for its frame; the worker takes it per step
  and lets a waiting host go first. A step that throws stops it (error()); lag()/behind() say
  how far it is behind; wait_caught_up() is for tests and captures.
- SceneWorld::set_deferred: follow() then only steps. It runs no sync() and writes no key (a
  state subscriber runs on the thread that writes) and calls the worker's capture after each
  step; the host calls publish_due() (sync and the telemetry) under the lock. A restart anchors
  the world on the holon's clock again at once, since the host's clock may be back past where
  it was before the worker looks (the test caught that).
- SceneClockDriver::hold(): a world more than max_lag (0.25 s) behind holds the clock, so it
  runs slower than its speed, as on the frame's thread, rather than further behind.
- cvcGL: AriRuntime::set_world_thread starts a worker for the main scene's world at the next
  frame and holds its lock through frame() (input, pump, tick_scene); tick_scene publishes what
  the worker ran and draws from the poses it captured. The adapter owns the worker and stops it
  before a reload or clear replaces the world. arigl run --world-thread turns it on; snapshots,
  --terminal, wasm, the headless hosts, the gym and arisrv are unchanged.

No holon.h change (coordinated with the One World session, #1444, on dev.tx.wtf).

Tests: AriadneWorldWorker.StepsTheWorldAsTheHostsFollowWould (24 kinematic + 4 Jolt vehicles
through a restart: the same poses bit for bit as the host's follow, the keys written on the
host's thread; 30 repeats), cvcGL test_world_worker_drawn (bodies and their drawn pose as the
frame's own follow leaves them). The scene world (114), holon, holon sync, server document and
cvcGL physics suites pass. On arigl with 200 kinematic vehicles at 3.6x, alternating runs:
58.3 ms a frame against 66.4 on the frame's thread, the world at 3.6x both ways; the rest of
the frame is drawing 200 vehicles (FL2).

* D3: how far a world may lag its clock is a setting, the same on every host

A scene's clock: { max_lag: <s> } sets how far its world may fall behind its
clock: seconds of world time at 1x, growing with the speed as the clock's
catch-up does (by ceil(speed) past 1x), more than 0 and at most 10 s
(cvc::sim_catchup_valid). It was a fixed 30 quanta in world_worker, which is
0.25 s only at 120 Hz.

- On a worker (arigl --world-thread), it is how far the world may trail its
  clock before the host holds the clock: world_worker::options::max_lag is now
  seconds (cvc::kSimCatchup by default), max_lag_quanta() scales it with the
  leader's speed, and a value that is no catch-up is refused, so the world
  stays on the frame's thread.
- On the frame's thread (every single-threaded host, native or browser: arigl
  without the flag, the browser, snapshots, the headless AppRuntime), it is
  the catch-up one frame may run: SceneClockDriver sets the clock's stall
  guard from it when it binds (world_clock::set_max_steps_per_advance, new,
  which keeps the tick, and cap_scales_with_rate). Unset, the clock keeps the
  guard its host gave it, so no existing document changes.
- world_worker::available() is false in single-thread wasm. The worker tests
  skip there, and the browser's arigl says once that it steps the world on
  the frame's thread when given --world-thread.
- sim_tick.h: kSimCatchupMax, sim_catchup_valid, sim_catchup_quanta(_at), and
  sim_clock_config takes the catch-up.

Tests: WorldClockTest.TheStallGuardChangesInPlace,
SimTickTest.ACatchUpIsWholeQuantaAndGrowsWithTheSpeed,
AriadneScene.ClockBlockTakesAMaxLag,
AriadneSceneWorld.TheScenesMaxLagIsTheCatchUpAFrameMayRun and
AriadneWorldWorker.TheWorldMayTrailItsClockByMaxLag. Docs: ARIADNE.md
(--world-thread), WORLD_CLOCK_API.md, ARIADNE_WORLDS.md section 18.2.

* FL2, first part: a world's vehicles drawn at scale, in both holons (#1489)

Each world entity was a scene node of its own: a box look is six boxes and
a group, so 200 vehicles were 1400 actors. On arigl, 200 kinematic vehicles
at 3.6x took 61 ms a frame (19 of runtime, 42 to 46 of drawing), and 800
took seconds.

cvc::gl::ariadne::entity_view (entity_view.h) is the view of a set of
entities, whatever feeds it:
- set_entities (who each is: archetype, fleet, team, colours, look, size);
- promote, from the camera and the ids followed;
- then pose and draw each frame.

Its bodies layer draws the entities it takes as one mesh per archetype and
LOD rung:
- a fitted model gets four rungs (#1358's swarm rungs; decimate_mesh moves
  to mesh_lod.h and the swarm uses it there), a box look one;
- each copy is posed in 3-D, normals too, and culled on the frustum's
  sides. Near and far are left out: the renderer fits them to what it
  draws, and an unposed rung is a point, so a far plane fitted to it cut
  away the entities about to be drawn.

Promotion and layers:
- promote (8) are drawn as their own nodes by vehicle_view: the followed
  (a camera's track.target, vehicles.watch, the vehicle a client drives),
  then the nearest. An incumbent keeps its node until another is a fifth
  nearer.
- a layer of at most threshold (32) promotes them all, so small worlds
  look as before;
- type: entity_layer (of: all | { fleet } | { archetype } | { team }, lod:,
  promote:, threshold:) declares a layer. With none, an implicit layer
  covers every entity.

Two feeds, the local and the server-side holon:
- a scene's own world: update_entity_view in tick_scene. Poses come from the
  physics binding's group of the chassis bodies (bind_group), between steps,
  whether the frame steps the world or #1475's world_worker holon does;
- a relay's entities on a client: room_view::update_entities, from the
  entities section and the client's entity_playout poses.

sync_vehicle_markers draws only the promoted, and adds or removes nodes as
promotion changes. A boat, a mesh file look without fit, or an entity no
layer takes keeps its own node.

Test cvcgl_ariadne_entities (37 checks, 5 repeats): the implicit layer,
follow, keep, the threshold, of:, the world on a worker, and the room.
Locally, cvcgl_ariadne_labels, _scenes, _realize, _swarm, _physics and
cvcgl_room_view also pass.

arigl, 200 kinematic at 3.6x with --world-thread, alternating runs:
- 8 ms a frame (2.4 runtime, 5.4 to 6.6 drawing), against 61 with
  threshold: 100000 (each its own node);
- 800 take 8 ms of drawing. Their world, at 16 to 18 ms a frame, is now the
  cost.

Not yet: the other layers (flags, goals, trails, path, belief, dots,
targets, follow, headlights), of: { fleet } on a client (the room's
identities carry no fleet), and swarm_layer moving here (FL3).

* FL2: a parted look at scale, its wheels dark at every rung

#1471's parted look (look: { chassis:, wheel:, rig: }) is a fitted look whose
one-piece model is null, so the entity view drew every parted vehicle as a
node of its own.

- vehicle_look_mesh_of: a parted look's mesh is its chassis and its wheels
  at rest, each point where attach_parted_model's nodes draw it (the chassis
  fitted per axis; each wheel at its fitted hub, a right one turned or
  reflected as its rig says), the wheels in a tyre's dark. One texture, the
  chassis's. add_part bakes a part by a 3x3 matrix, normals by its inverse
  transpose; the one-piece model goes through it too.
- Role 3, the model's (white under its texture, else the entity's colour),
  so an untextured rung keeps role 2's dark.
- make_rungs decimates each colour role on its own. A coarse rung kept no
  roles, so the wheels would have taken the body's colour.
- sync_vehicle_markers keeps #1471's vehicle_wheels with the markers: a
  rebuild clears them, a demoted vehicle's go with its node.

Test cvcgl_ariadne_entities, parted: the mesh against attach_parted_model's
nodes (mirror turn and reflect, an axle offset); 40 at scale in the model's
four rungs, wheels dark at each rung drawn; one rung (lod: false), each
copy's chassis in its colour and its wheels dark.

* vehicle_view: entity_view.h's include without a trailing comment

CI's clang-format checks only the changed lines, so it would not align this comment with the
unchanged scene_labels.h line under it, while a whole-file format does.
transfix added a commit that referenced this pull request Nov 26, 2026
…in, boat fleets) (#1572)

BOAT-PARTS-ROADMAP.md plans drawing Ariadne boats in parts, after the parted vehicle look (#1471, vehicle-humvee cvc.5):
- an outboard or rudder that turns with the helm;
- a propeller that spins with the throttle;
- boat fleets in the entity layer.

The model is a new Meshy boat in separate pieces (B1). Scope P1-P4 is decided (B3). The package-vs-preset choice (B2) is open.

OCEAN-AND-WEATHER-ROADMAP.md's D5 "Not yet" points to it. Docs only.
transfix added a commit that referenced this pull request Nov 27, 2026
…ee loader (#1569)

* Ariadne: the Humvee in parts by default, its wheels turning

vehicle-humvee 1.0.0+cvc.5 ships its Humvee in parts beside Humvee.glb:
share/cvc-scenes/shared/humvee/chassis.glb, wheel.glb and rig.json
(cy-pca/graphics-assets#21). A world vehicle's look now draws those
where it used to draw the one-piece model, so its wheels roll and its
front pair steers (the parted look, #1471).

- resolve_vehicle_looks: a humvee with no look:, or `model: humvee`
  with no scale:, yaw:, z: or fit: false, is a parted file look when
  all three parts are installed in one directory. If they are not, it
  is Humvee.glb, then the box, as before. A look that names a file
  (`file:`, or `data:` with `file:`) does not change.
- The parted look keeps Humvee.glb in its path. A relay sends an
  entity's look as its kind and file only (room_entities), so a room's
  clients still draw the one piece and not the box.
- world_lab.ari: its Humvee is
  { data: humvee, chassis: humvee/chassis.glb, wheel: humvee/wheel.glb,
  rig: humvee/rig.json }.
- docs/ARIADNE.md ("Looks", "A model in parts") and ARIADNE_WORLDS.md
  describe the new default.
- Tests: AriadneWorldVehicles.TheHumveeIsInPartsWhereTheyAreInstalled
  (core), and test_default_humvee in cvcgl_ariadne_wheeled_look. With
  the parts installed in a fixture prefix (.glb files), a `vehicle:
  humvee` archetype with no look draws vehicle_1_chassis and four
  wheels, and so does its vehicle_preview. Without them it draws the
  one-piece model, and with neither, the box.

* Ariadne: the swarm, nav_scrub and VehicleModel load the Humvee one way

The swarm layer, nav_scrub and pycvc_gl's VehicleModel each had their
own Humvee search and fit. They now use the shared code, so they get
the Humvee in parts too.

- vehicle_look_named(name) (world_vehicles.h) resolves a look by name
  the way resolve_vehicle_looks resolves a world vehicle's. `humvee` is
  the default look: the parts, else Humvee.glb, else the box. A file
  that exists is that file, fitted. Any other name is `model: NAME`.
- swarm_nodes: read_vehicle, vehicle_template (a copy of
  fit_vehicle_geometry) and its own path search are gone. This
  includes the ../shared guesses beside a city bundle. An agents
  layer's look is vehicle_look_named(look), and its template comes
  from vehicle_look_mesh_of, as an entity layer's does. With the parts
  installed, its wheels are baked in at rest in a tyre's dark. The
  glyphs keep a point's own colour (role 2) when they build and
  recolour.
- mesh_lod: decimate_mesh_by_role. This is entity_view's per-role
  decimation, moved here so both layers share it. The swarm's LOD rungs
  now use it, so the coarse rungs keep the tyres dark.
- nav_scrub: its runs take vehicle_look_named("humvee") instead of
  picking Humvee.glb (the bundle's copy, else find_vehicle_model). A
  parted look is attached with attach_parted_model. Its wheels are
  posed each frame by parted_wheel_poses: rolled by the distance driven
  to the play head (the logged speed, summed, interpolated between
  ticks) over the wheel radius, and the front pair turned by the logged
  tel.steer.
- pycvc_gl: fit_vehicle_geometry is bound, and VehicleModel fits with
  it in place of its numpy copy of the same fit.
- `model: humvee, fit: false` gets the parts too. A model look is
  always made fitted, so `fit: false` never applied to it. Only
  scale:, yaw: and z: keep the one piece.
- Tests: AriadneWorldVehicles.TheHumveeIsInPartsWhereTheyAreInstalled
  checks vehicle_look_named. cvcgl_ariadne_swarm's new humvee section
  installs a fixture of .glb parts and checks that `look: humvee` draws
  tyre-dark wheel points on the finest rung and the coarsest.
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