Skip to content

One world: the navigators steer around the avatars (OW4) - #1381

Merged
transfix merged 13 commits into
masterfrom
feat/one-world-avoid
Nov 21, 2026
Merged

transfix merged 13 commits into
masterfrom
feat/one-world-avoid

Conversation

@transfix

Copy link
Copy Markdown
Owner

OW4 of ARIADNE_WORLDS.md section 18, stacked on #1379 (OW2), which puts the avatars in the document's world.

  • WorldVehicles::set_movers(xy): other things that move in the world, in its metres. The navigators steer around them while avoid is on, as foreign agents to each fleet's separation (sim_world::set_foreign_agents), as they steer around another plant's vehicles. Kept until set again; with none set, runs are unchanged.
  • A holon running the world (attach_world) sets the movers to its avatars' positions before each step, and clears them when it detaches.

Test (AriadneOneWorld.ANavigatedCarSteersAroundAnAvatar): a kinematic Humvee on nav@1 drives west from x = 25 m to a goal at -30 m past a person standing in its lane.

  • Avoiding: it swings past with 3.12 m between their centres, reaches x = -31.7 m, and the avatar doesn't move.
  • Not avoiding: it drives into the person and carries them 34.4 m.

Local (MSVC, Jolt): AriadneWorldVehicles, AriadneOneWorld, holon, gym and room suites: 219/219.

…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).
# 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
Base automatically changed from feat/one-world-holon to master November 21, 2026 04:53
# Conflicts:
#	src/cvc/ariadne/holon.cpp
#	src/cvc/tests/ariadne_scene_world_test.cpp
@transfix
transfix merged commit 8dbe980 into master Nov 21, 2026
29 checks passed
@transfix
transfix deleted the feat/one-world-avoid branch November 21, 2026 08:38
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