Skip to content

One world: the entity table and drivers, server side (OW3) - #1387

Merged
transfix merged 16 commits into
masterfrom
feat/one-world-entities
Nov 21, 2026
Merged

transfix merged 16 commits into
masterfrom
feat/one-world-entities

Conversation

@transfix

Copy link
Copy Markdown
Owner

OW3 of ARIADNE_WORLDS.md section 18 (generic entities), server side. Stacked on #1381 (OW4) and #1379 (OW2).

  • holon::entities(): one table of every mover in the holon's world. Each participant's person and the attached world's entities (vehicles, boats) are listed with kind, controller (walker@1 or the plant), driver (participant:<pid>, or the entity's own nav@1 / external / none), owner, policy, whether it is in the world, and its state.
  • holon::set_driver(pid, entity): a participant gets into a world vehicle.
    • Its person leaves the physics world; its feet and reserve are kept.
    • Each frame, its intent's new drive axes replace the vehicle's controller command. The axes are avatar_intent::steer and accel, sent on the wire as intent.steer / intent.accel; "nan" or absent means none.
    • While driving, the participant's state() and display_pose() are the vehicle's.
    • Getting out (0) puts the person at a clear point beside the vehicle and gives the vehicle back to its controller.
    • Refused: a client, an unknown participant or entity, a vehicle someone else drives.
    • Removing a participant or detaching the world makes its driver get out first.
  • WorldVehicles::set_driver / driver (entity_spec::driver). A change is a new revision, so the room's entities section sends a new driver leaf to every client.

Test (AriadneOneWorld.AParticipantGetsIntoAVehicleAndDrivesIt):

  • A participant gets into a Humvee, and its person's body leaves the world.
  • At 2 m/s² for 3 s it drives the Humvee 5.7 m to 4.7 m/s, and the participant's pose is the vehicle's.
  • The entity table and room_entities_of name the driver.
  • Getting out puts the person 2.5 m beside the vehicle, standing; the Humvee (controller external) brakes to rest.
  • The refusals above are checked too.

Not yet (section 18.7):

  • A client's verb to ask to drive, and clients drawing and predicting it (OW6, OW5).
  • Avatars that are vehicles (OW6).
  • A person driven by a navigator.

Local (MSVC, Jolt): AriadneOneWorld 4/4; holon, room, arisrv, conference and world-vehicle suites 233/233.

…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.
transfix added a commit that referenced this pull request Nov 20, 2026
…1403)

FL1b of [FLEETS_AND_NIGHT_ROADMAP.md](docs/roadmap/FLEETS_AND_NIGHT_ROADMAP.md), following FL0 + FL1a (#1384, merged as 28c371c).

Each fleet now has its own navigator, with its own sense, belief and policy (settled as D8). Nothing in the one-world stack (#1378, #1379, #1381, #1387) touches this part.

```yaml
start:
  - { fleet: city, archetype: humvee, plant: kinematic, count: 800, spawn: opposed, seed: 7,
      rally: { count: 16 }, sense: fog, belief: grouped, policy: trained }
```

## A navigator per fleet

- **One navigator per plant per fleet**, keyed `<plant>/<fleet>`. The plant's unnamed vehicles keep the navigator they had. The fleets meet each other as foreign agents, as different plants already did.
- **`sense:`** is `known` or `fog`. By default it is the world's `vehicles.sense`, and it follows that key when the key changes.
- **`belief:`** says how the vehicles share what they sense:
  - `shared` (the default): one map;
  - `grouped`: max(2, n / 64) maps, teammates together;
  - `private`: one map per vehicle.
- **Keys:** `vehicles.fleets.<name>.sense` and `.belief` rebuild the navigator, with the vehicles at rest where they are. `.planes` counts the maps.

## The policy

`policy:` takes one of:

- `trained` (the default): `$CVC_NAV_WEIGHTS`, else an installed copy (`coef_mlp::default_weights_path`), else a download of `cvcpkg://cvc/grl-snam-weights` (`share/grl-snam-weights/coef_sdf.cvcnav`) through the data store, cached by hash;
- `builtin`: the built-in net;
- a `.cvcnav` path;
- `{ uri, path, sha256 }`: a file, an https URL or a cvcpkg:// package, the `.cvcnav` inside it, and its hash;
- `{ data: <entry> }`: one of the document's `data:` entries.

Switching and reporting:

- `vehicles.fleets.<name>.policy` switches it live: `sim_world::set_policy`, or `reset_policy` for the built-in net.
- `.drives` says what drives:
  - `trained (<where>, sha256:...)` or `weights (...)`;
  - `builtin`;
  - `builtin: loading <uri>` while a download is under way;
  - `builtin: no trained weights (<why>)` when the weights can't be had. The fleet then drives on the built-in net, and the host's log gets the same line once. With the network off, the reason reads "the network is off, so ... cannot be fetched: run the host with the network on (--net-allow ORIGIN)".
- New `policy_library::get_bytes` loads weights already in memory (a download, a data entry) once per hash, as `get` does for files.

## Also

- **`controller: pose` is refused for a fleet**, and so is an archetype whose first controller is `pose`. A fleet lays out and drives its vehicles, while a pose entity is placed only by its poses.
- **The FL1a documents now say `policy: builtin`**, so their layout and drive tests don't depend on the weights a box has installed.
- **Docs:** the Fleets section of ARIADNE.md, and in the roadmap the FL1b row and D3 updated for ARIADNE_WORLDS section 18. A drawn host's async world becomes the local server-role holon (OW7), and `poses(fleet)` feeds OW5's playout.

**Left for FL1:**
- plant lists and per-team plants;
- the metric (D9);
- `poses(fleet)`;
- the gym's fleet.

## Tests

`ariadne_scene_world_test` passes locally (MSVC, Jolt).

- **New:** `AriadneWorldVehicles.AFleetHasANavigatorAndAPolicyOfItsOwn` covers:
  - a 130-vehicle grouped fleet (2 maps) beside 6 private fog scouts (6 maps) on a sha256-pinned `.cvcnav`;
  - the belief key, then the policy key switched live: builtin, trained via `$CVC_NAV_WEIGHTS`, a missing file, and an unreachable cvcpkg package. The last two fall back visibly.
- **Extended:** `AFleetIsANamedStartEntry` gains the new keys and their errors.
…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
…ties

# Conflicts:
#	docs/roadmap/ARIADNE_WORLDS.md
#	inc/cvc/ariadne/holon.h
#	src/cvc/ariadne/holon.cpp
#	src/cvc/tests/ariadne_scene_world_test.cpp
@transfix
transfix merged commit 3d45850 into master Nov 21, 2026
29 checks passed
@transfix
transfix deleted the feat/one-world-entities branch November 21, 2026 12:52
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