Skip to content

OW5j: the boat a client drives, predicted on the relay's water - #1469

Merged
transfix merged 70 commits into
masterfrom
feat/one-world-ow5j
Nov 24, 2026
Merged

transfix merged 70 commits into
masterfrom
feat/one-world-ow5j

Conversation

@transfix

Copy link
Copy Markdown
Owner

OW5's tenth slice (ARIADNE_WORLDS.md §18.5): the boat a client drives (dynamicboat) is now predicted, like the other plants. Until now a boat was played out a round trip behind the driver's keys. Stacked on #1444 (which now carries OW5i, #1463).

What changed

  • The room's entities carry it. dynamic_drive takes plant dynamicboat (valid()), and WorldVehicles::dynamics fills it for a boat fleet's vehicle: its preset with its mass and top speed (boat_desc_of), and the navigator's hold and ticks.
  • dynamic_vehicle_model runs a boat on the relay's plant (dyn_boat_plant, its driver on), in a Jolt world of its own made as for a jolt vehicle (OW5i), with the holon's statics and their water.
    • Its state is that world, saved each step, plus the driver's memory, which the save doesn't hold: the speed and rudder trims, the last measured acceleration, and the held command. dyn_boat_plant gains remember(i) and resume(i, memory) for that.
    • The boat goes on the water at its first sample over water deep enough for it (attach). Until then, or with no water at all, it is played out.
  • The water comes with the statics. world_replica::water() holds the replica world's fluid fields (a water node's). Where the world has no water of its own over the grid's lake, it holds the still water the relay adds for its boats instead. That still water is boat_still_water, which WorldVehicles::ensure_water now calls too. holon::set_statics takes the water (an argument defaulting to none), and client_pump passes the replica's. New statics rebuild a boat's model, as they rebuild a jolt one.

Tests

  • AriadneOneWorld.AClientRunsTheBoatItDrivesAsTheWorldDoes: the relay's drivable launch on a still lake (a water node, no wind or waves) against the client's model, built on the client's own statics and water from the same document. It runs through throttle, a turn, astern and reverse, with the relay's sample every 4 ticks. Each sample finds the model within 0.8 mm and 0.08 mrad, height within 0.03 mm, pitch and roll within 5 mrad.
  • AriadneOneWorld.AClientsReplicaHasTheRelaysWater: the replica carries the water node's field, and boat_still_water gives nothing where the world has its own water. Over a world with none, it gives water up to the lake's level. A holon fed by client_pump predicts a boat on it.
  • HolonVehicleTest.TheBoatWeDriveIsPredictedAndReconciled: a model needs water, and a boat off the water waits. Two models on the same lake agree exactly, with nothing to correct, and a 1.5 m push is corrected at the next sample, after which they agree exactly.
  • HolonSyncTest.TheClientPumpPredictsTheBoatWeDriveOnTheWater: the plant round-trips through the room's entities. The boat is played out with no water, and predicted once the statics bring some.
  • DynBoatPlant.ARunRestoredWithItsDriversMemoryStepsOnTheSame: a restored world with resume steps on to the same state hash. Resuming with a fresh driver doesn't.
  • Locally, these suites pass: scene world 124, holon 54, holon sync 39, loader 254, server document 23, avatar sim 8, nav plant 28, boat 10, dyn boat plant 13, pose stream 13, room avatar 11, room intrinsics 21, room scene 21, world clock 52. arigl builds.

Not verified

  • A sea's waves. A boat model reads its water at its own world's field time, which isn't tied to the relay's. On a water node with waves, what a sample finds isn't measured.
  • I haven't run a live arisrv + arigl session, and arisrv isn't built in my local configuration (CI builds it).
  • A boat model touches only the statics and the water. Another boat, a wake (wake_push), or a body in the water is still the relay's correction.
  • The test samples every 4 ticks, as the holon does. I didn't measure how far a boat's model strays open loop.

…7 quanta

ARIADNE_WORLDS.md section 18.1 (owner, 2026-11-19: "7 quanta"). Every host
runs the holon's 1/120 s quantum, physics a step a quantum, and the
navigator's tick is 7 quanta (0.0583 s), the nearest whole tick to the
0.06 s the shipped policies were trained at.

- sim_tick.h: kSimQuantum 1/120 s, kSimTickQuanta 7, kSimTick from them;
  adopt_sim_clock puts a fresh clock on the catch-up even at the quantum.
- pycvc: SIM_TICK_QUANTA; cars.py's fallbacks; the gym, swarm and
  sim_thread defaults follow kSimTick.
- NavPlantConvergence.PoliciesHoldTheirReachAtTheSimulationTick
  (CVC_NAV_TICK_AB=1): the shipped and default policies on Jolt
  RoboRacers at 0.06 s, the simulation tick and 0.05 s over 24 s.
The plant host's own default stays 0.01 s, where navigators at the
trainers' 0.06 s run; the cars template and the scene swarm, which tick
cvc::kSimTick, give their plant_host a 1/120 s world. The nav lab's
retarget lands on the first tick at or past 3 s.
0.01 s for a tick of whole 0.01 s steps (every score so far), the
simulation quantum for one of whole quanta (cvc::kSimTick), else the step
nearest 0.01 s that divides it.
ARIADNE_WORLDS.md section 18.2. holon::attach_world(SceneWorld *) moves
the avatars into a server document's physics world, beside its bodies and
vehicles, and steps that world on the holon's clock: SceneWorld::follow
gains per-step hooks, the avatars driven just before each step and read
after it. A car shoves an avatar; the avatar takes some of its momentum.

- avatar_world over a shared world it does not own: its owner steps it
  and owns its gravity, air and statics; release() and move_to() (a
  world its owner replaced).
- AppRuntime::set_world_external: the runtime stops stepping a world a
  holon runs.
- arisrv attaches the server document's world to the room's holon.
- AriadneOneWorld tests: a Humvee driven into a standing avatar carries
  it down the road and ends behind the same run without it; attach
  refuses a client, a holon without physics and a world on another step;
  avatars stand on the scene's own bodies; detach puts them back.
ARIADNE_WORLDS.md section 18.4. WorldVehicles::set_movers: other things
in the world the navigators steer around while avoid is on, as foreign
agents to each fleet's separation. A holon running the world sets them to
its avatars before each step, and clears them when it leaves. A car on
nav@1 swings 3.1 m past a person standing in its lane and drives on;
without avoiding it carries them 34 m (AriadneOneWorld).
ARIADNE_WORLDS.md section 18.4. holon::entities() lists every mover in the
holon's world: each participant's person and the attached world's
entities, with kind, controller, driver, owner and policy.
holon::set_driver(pid, entity) puts a participant in a world vehicle: its
person leaves the world (feet and reserve kept), its intent's new drive
axes (avatar_intent::steer, accel; intent.steer/accel on the wire)
replace the vehicle's command each frame, and its state and display pose
are the vehicle's. Getting out puts the person at a clear point beside
the vehicle and gives the vehicle back to its controller.
WorldVehicles::set_driver / driver; the room's entities carry driver.
# Conflicts:
#	docs/roadmap/ARIADNE_WORLDS.md
#	src/cvc/tests/ariadne_scene_world_test.cpp
…40 steps

master's #1384 (fleets) wrote it at the 0.01 s step; with #1378's 1/120 s quanta 240 steps are
2.0 s, and the fleet, from rest at about 1.75 m/s^2, makes 4.35 m of the 5 m it asks for. 2.4 s
(288 steps) makes 6.1 m.
…bcvc into feat/one-world-avoid

# Conflicts:
#	src/cvc/ariadne/world_vehicles.cpp
#	src/cvc/tests/ariadne_scene_world_test.cpp
…bcvc into feat/one-world-entities

# Conflicts:
#	src/cvc/ariadne/world_vehicles.cpp
#	src/cvc/tests/ariadne_scene_world_test.cpp
…g in by asking

avatar_intent's drive axes are now shares of the vehicle's envelope: steer of its lock,
throttle [-1, 1] (negative is reverse), brake [0, 1]; the server scales them by the
driven vehicle's max_steer/max_accel/max_decel (holon::drive_command). The brake stops
the vehicle and never backs it up; reverse brakes a car still rolling forward, then
backs it up; a boat has no brake and reverses on its propeller astern. On the wire:
intent.throttle, intent.brake, intent.jump (intent.accel is gone).

The walker jumps (avatar_intent::jump) at its controller's jump_speed (4 m/s by
default) when something is under its feet, paying the jump from its reserve.

Getting in is asked for in the room: participants.<pid>.drive = "<seq>:<entity>",
answered by server_pump in drive_status and driving (relay-owned). holon::get_in holds
it to the world's rules: the archetype's drivable: and reach: (3 m from its chassis
box). room-drive / room-driving verbs; room entities carry drivable, reach, controls.

controls.h: control schemes walk, car and boat with their own bindings (Space jumps a
walker, brakes a car; E held 0.4 s gets in and out), and a resolver with steering
ramps and hold-to-fire.
… camera; docs

arigl's room controls come from the scheme of what we control: walking (avatar.keys, plus
Space to jump, V for mouse look, E held to get in), or the car's or boat's scheme while
the relay says we drive (controls.<scheme>.<action>; all of them in the Controls window).
The nearest drivable vehicle in reach (drive_target, the one ahead first) gets a prompt
over it, "E  Drive <name>", whose ring fills as E is held; a refusal is shown for a
moment. Driving, client_pump plays our own pose out from the relay's samples instead of
predicting it, room_view hides every driver's marker (set_riders), and the camera swings
behind the moving vehicle.

traffic.ari's trucks are drivable. ARIADNE_WORLDS 18.6 describes the schemes, the shares,
the jump and the ask; OW6 is started.
A control binding's pad inputs are read now: buttons by position (A, B, X,
Y, LB, RB, ...), the triggers LT and RT, and stick halves (LeftY-, LeftX+).
Each has a deadzone; an action is its keys' value or its gamepad's, the
larger, and only a key's steering ramps.

Defaults: walk on the left stick (as fast as pushed), look around on the
right, jump A, get in and out on X held; driving, the left stick steers,
RT is the throttle and LT the brake, LB a car's reverse (a boat's is LT).

cvcGL's SdlGamepad reads the first gamepad SDL finds. arigl feeds it to
the resolver, faces where the camera looks while the gamepad is in use,
turns the camera with the right stick, and names the pad's button in the
get-in prompt. room_view gains intent_from_axes for the analog walk.
A KeyBinding can name its gamepad inputs and where they live (pad,
pad_path). The Controls window shows them in a column of their own with
a Change button: the next gamepad input pressed becomes the new binding.
Keys are ignored while it waits, and Escape keeps the old one.

Runtime::post_pad_press takes the newly pressed gamepad inputs.
SdlGamepad::pressed() lists them each frame (a button gone down, a
trigger or stick half past half way).

arigl's input pump now owns the gamepad: it posts the presses to the
runtime and hands the gamepad to the room's controls, except while the
window waits for a button. Each avatar and vehicle action lists its
gamepad default, seeded at <viewer>.pad.<scheme>.<action>.
world: avatars: archetypes: entries may name one of the world's vehicle
archetypes (vehicle: rover). This is §5k phase 3 for vehicles.

- Choice: a participant picks an archetype under the existing avatar
  choice subtree (participants.<pid>.avatar.archetype, beside color and
  accessory); until it picks, it has the first.
- Server: server_pump rules on the choice (holon::set_archetype) and
  answers in the relay-owned archetype_status. For a vehicle it spawns
  it where the person stands and seats the participant for good: no
  getting out or into another, and the vehicle goes when the participant
  leaves or picks a person again.
- Rules: world_rules::avatar() is now the first person archetype;
  find_avatar is new.
- Room: the archetypes section carries vehicle, and room entities carry
  avatar (whose body it is). drive_target skips such vehicles, and arigl
  shows its owner no get-out prompt.
- Verbs: room-archetypes, room-set-archetype, room-archetype. The
  baseline conference document gains a Body combo beside Colour and
  Wear.
- traffic.ari offers a rover body.
Walking under mouse look, arigl puts the camera at the walker's eyes
(0.92 of its body's height, 5 cm behind them) and hides its own avatar,
so W walks where you look. The orbit distance comes back when mouse look
ends.

The Controls window gains "Mouse look in first person"
(MouseControls::first_person, arigl's camera settings.first_person,
seeded on). Turning it off gives back the over-the-shoulder view.
Driving keeps the chase camera.
A client's holon now holds each vehicle it shows as a kinematic box of its chassis's size where
its playout shows it (holon::hold_entity, on avatar_world's new obstacles), carried on along its
velocity through the frame's steps. The walk it predicts stops at a parked car and is pushed by a
moving one, as on the relay, instead of walking through and snapping back.

client_pump takes the entity_playout and holds every entity except the one the participant drives
or is; arigl pumps the entities first. ARIADNE_WORLDS.md section 18.5: OW5a as built, OW5b and
OW5c still to come.
…/one-world-drive

# Conflicts:
#	docs/roadmap/ARIADNE_WORLDS.md
#	inc/cvc/ariadne/avatar_sim.h
#	inc/cvc/ariadne/holon.h
#	src/cvc/ariadne/holon.cpp
#	src/cvc/ariadne/holon_sync.cpp
#	src/cvc/tests/ariadne_scene_world_test.cpp
…op of the stack

# Conflicts:
#	inc/cvc/ariadne/world_vehicles.h
…s own

The vehicle a participant drives on the jolt plant (nav_plant: a Jolt vehicle in the relay's
world) is predicted like the dynamic plants'. The room's entities carry it as dynamic_drive with
plant "jolt" (WorldVehicles::dynamics). dynamic_vehicle_model runs it in a Jolt world made as the
relay's scene world is, with the holon's statics and the vehicle alone, and keeps the whole of
that world (world::save) as the vehicle's state, so a sample restores what was predicted for its
tick and replays. New statics rebuild the model's world. avatar_world gains a constructor from a
world_config.

The gearbox, clutch and engine are not in the pose stream; with the relay's sample every 4 ticks
each sample finds the model within 3-5 mm of the relay's Humvee, flat and over a 3 m dome.
ARIADNE_WORLDS.md section 18.5. A dynamicboat boat a participant drives is now predicted, like the
other plants.

- dynamic_drive takes plant dynamicboat, and WorldVehicles::dynamics fills it for a boat fleet's
  vehicle (its preset with its mass and top speed, and the navigator's hold).
- dynamic_vehicle_model runs it on dyn_boat_plant in a Jolt world of its own, with the holon's
  statics and their water. Its state is that world and the driver's memory, which the save does
  not hold: dyn_boat_plant::remember and resume. The boat goes on the water at its first sample
  over water deep enough for it.
- The water comes with the statics: world_replica::water (the replica world's fluid fields, else
  the still water the relay adds for its boats, boat_still_water, which WorldVehicles now calls
  too), passed by client_pump to holon::set_statics.

Tests: the relay's launch on a still lake against the client's model, within 0.8 mm and 0.08 mrad
at each sample every 4 ticks (AriadneOneWorld); the replica's water; exact agreement and a
corrected push in the holon; the client pump played out without water and predicted with it; a
plant restored with its driver's memory steps on to the same state hash.
ARIADNE_WORLDS.md sections 12 and 18.5, AD1's first slice. world_pack (world_pack.h) is a
directory with an index, world-pack.index: one "<sha256> <size> <path>" line per file.
write_world_pack_index writes one. world_replica looks in the packs it is pointed at
(CVC_WORLD_PACKS, add_pack) when the room's document URI does not give the relay's bytes here. It
finds the document by the room's SHA-256, in the first pack that lists it and whose files all
match the index, and builds the world from there. A pack with a file that differs from its index
is refused, and the status says which.
The relay's scene world now reads its water's waves at the clock's
time: SceneWorld::follow sets the world's field time to the clock's at
its first call, as world::follow does. The step ending on tick T reads
the sea at T x fixed_dt however late the world was attached, and the
bodies float on the waves the drawn sea shows. A client's boat model
sets its world's field time to the sample's tick x fixed_dt, so it
rides the relay's waves.

AriadneOneWorld.AClientsBoatRidesTheRelaysWaves: on a lake with a
14 m/s wind sea that heaves the launch 0.71 m, each sample finds the
model within 2.2 mm of it and 6.4 mm of its height; a model reading
the waves half a second off is 171 mm off. The gust-front and wake
frame-pacing tests now pin the clock-anchored field time.
The relay's pose for an entity whose chassis is a body in its world (a
jolt vehicle, a boat's hull, a dynamic plant's box) now carries that
body's attitude and vertical speed, for the room's entities and for a
driver's pose alike; before, a turn about z alone. A jolt or boat
model takes its chassis's pitch, roll and vertical speed from each
sample; a heading-only sample (an older relay's) keeps the predicted
ones. The drive axes read the pose's heading whatever its tilt.

On OW5l's waves the boat model is within 7.9 mrad of the hull's
attitude from its first sample (145 mrad before); the jolt Humvee
within 3.7 mrad (17.5 before).
Base automatically changed from feat/one-world-statics to master November 23, 2026 05:47
A dynamic4w model takes its suspension's pitch and roll from each sample
that carries them (the relay's box, OW5m) and its heave from the box's
height (dyn_4w_plant::box_pose inverted). The rates of heave, roll and
pitch stay the model's: the pose stream carries no roll or pitch rate,
and its vertical speed is the box's after the relay's step under
gravity. A heading-only sample keeps the predicted suspension.

A client joining a four-wheel vehicle mid-turn is now within 24-26 mrad
of its attitude (94-98 before) and 0.3-1.2 mm of its height (1.7-10).
drive_as_the_world_does gains sampled_too and join for the new
AriadneOneWorld.AClientJoinsAFourWheelVehicleMidTurn.
@transfix
transfix enabled auto-merge (squash) November 23, 2026 06:48
The relay streams the room's vehicles from
conference::entity_pose_subjects, which still built a heading-only pose;
OW5m had changed only holon's ride_of (a driver's pose and
holon::entities). Both now use entity_ride (world_vehicles.h), with
WorldVehicles::world() for the chassis. Every client draws the room's
vehicles from that stream, so they were drawn level.

client_run gains entity_gap: the jolt and boat runs check the
vehicle's own entry in that stream is within 1e-6 rad of the chassis.
Without this fix it was 169 mrad off for the jolt car on the hill and
207 mrad for the boat on the waves.
The pose stream carries each entry's angular velocity (mrad/s) and a
vehicle's steering angle (microradians), delta-encoded like the rest
(PoseEntry.wx, wy, wz, steer). PoseSnapshot.carries says the relay
sends them (kCarriesMotion); a relay before this leaves it 0, so its
zeros read as not known, not as not turning, and a client keeps its
model's values.

The relay fills them from the chassis body (entity_ride's angular
velocity) and the plant's steering (entity_info::steer; holon::steer
for a driver). A client's sample carries them (pose_sample::steer)
through holon::apply_authoritative to dynamic_vehicle_model::at: the
dynamic plants take the steering angle and yaw rate, dynamic4w the
roll and pitch rates too, a jolt or boat model its chassis's spin.

A client joining a four-wheel Humvee mid-turn, through the pose
stream, is now within 0.7 mrad of its attitude and 0.3 mrad of its
heading (24-25 and 10.4 with the attitude alone). The jolt Humvee is
within 1.1 mrad (3.7); the boat on the waves within 3.6 mm of height
(4.7). The waves test's phase check now skews by a second (15 mm of
drift) rather than half (8 mm).
OW5k: a client finds the relay's world document in a world pack
A jolt or boat model's world holds a box for each of the room's
vehicles the client shows (dynamic_vehicle_model::hold_obstacles, from
holon::held_obstacles). Before each step each goes where its vehicle is
to be at the step's end, along its velocity, as the walker's world holds
them. A kinematic-plant vehicle is a kinematic box. A vehicle the relay
can push (a jolt vehicle, a dynamic plant's box) is a body of its mass
(room_entity::dynamics, through hold_entity's new mass), put where it is
shown before each step, so the car shoves it as the relay's does.

The boxes are made with the model's world (obstacle_room: one per
vehicle held and two spares of each size and mass), since world::restore
needs the same bodies. When more come into view than it has room for,
the holon makes the model again with room (vehicle_rebuilds). Held
entities now count their steps while the participant drives, too.

The relay's car into a parked vehicle, sampled every 4 ticks through the
pose stream: the model is within 3.9 mm holding its box, 50 mm without
(kinematic plant); 3.9 mm and 21 mm for a jolt Humvee shoved 4 m.
OW5m: a vehicle's attitude in its pose
OW5l: a sea's waves under a predicted boat
OW5o: the room's vehicles in the car a client drives
OW5n: a vehicle's spin and steering in its pose
@transfix
transfix merged commit 50e4b50 into master Nov 24, 2026
30 of 31 checks passed
@transfix
transfix deleted the feat/one-world-ow5j branch November 24, 2026 06:10
transfix added a commit that referenced this pull request Nov 24, 2026
transfix added a commit that referenced this pull request Nov 24, 2026
master has #1469 as one squashed commit; this branch carried its commits. Merged #1469's last head (8190bfa) first, then master three-way against it, so only master's changes since come in.
transfix added a commit that referenced this pull request Nov 24, 2026
…ment, #1469

# Conflicts:
#	src/cvc/ariadne/loader.cpp
#	src/cvc/tests/ariadne_loader_test.cpp
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