Skip to content

FL1b: a navigator per fleet, with its own sense, belief and policy - #1403

Merged
transfix merged 1 commit into
masterfrom
feat/fleet-navigators
Nov 20, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/fleet-navigators

Conversation

@transfix

Copy link
Copy Markdown
Owner

FL1b of 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.

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.

Each fleet (a start: entry with fleet:) has a navigator of its own per plant, "<plant>/<fleet>".
- sense: known or fog (the world's by default); belief: shared, grouped (max(2, n / 64) planes,
  teammates together) or private (one per vehicle). vehicles.fleets.<name>.sense and .belief make
  it again with the vehicles at rest where they are; .planes counts its maps.
- policy: trained (the default: $CVC_NAV_WEIGHTS, an installed copy, else
  cvcpkg://cvc/grl-snam-weights through the data store), builtin, a .cvcnav, { uri, path, sha256 }
  or { data: <entry> }. .policy switches it live; .drives says what drives; without the weights
  the fleet drives on the built-in net and says why, in .drives and once in the host's log.
- policy_library::get_bytes: weights already in memory, loaded once per hash.
- A fleet refuses controller: pose.
- FL1a's test documents drive on policy: builtin, whatever weights a box has installed.

Docs: ARIADNE.md's fleets, the roadmap's FL1b row, and D3 with ARIADNE_WORLDS section 18 (the
worker is the local server-role holon's).

Test: AriadneWorldVehicles.AFleetHasANavigatorAndAPolicyOfItsOwn; AFleetIsANamedStartEntry
extended.
@transfix
transfix merged commit c1babd3 into master Nov 20, 2026
29 checks passed
@transfix
transfix deleted the feat/fleet-navigators branch November 20, 2026 20:07
transfix added a commit that referenced this pull request Nov 22, 2026
…#1449)

* Fleets: placing and removing vehicles is linear; fleet lookups build no strings

Loading a fleet took about twice as long as at FL1a: 88 ms for 800 kinematic
vehicles, 500 for 2000. Two causes:

- Placing a kinematic vehicle recomputed its fleet's per-vehicle kinematics
  (kinematics()), which walks every entity with two fleet lookups each. So n
  vehicles took n^2 lookups (since #1235). Removing one did the same, so
  teardown, a restart or reseed, and a navigator rebuilt were quadratic too.
- FL1b (#1403) gave a named fleet its own navigator, keyed "<plant>/<fleet>",
  and fleet_of() built that key on every call, which doubled each lookup.

The fix:

- A fleet's kinematics are marked stale when a vehicle comes or goes, and made
  once before its navigator next steps. Only the step reads them.
- The fleets are searched by the key's parts (nav_ref, through a transparent
  comparator), so fleet_of() builds no string.

FleetBench's [fleet doc] rows also time a reseed, with the tick after it.
Medians of three runs, alternating with the code before the fix:

- load, 800 vehicles: 105 to 117 ms before, 20 now;
- load, 2000 vehicles: 640 to 755 ms before, 40 now;
- reseed with summary keys: 228 to 28 ms at 800, 1.6 s to 118 ms at 2000.

Ticks didn't change beyond the noise. The roadmap's §3.1 has the numbers.

* Fleets: a step without contacts looks no vehicle up; a summary fleet's stats are one line

At 2000 kinematic vehicles with summary keys a tick took 23 % longer than at FL1a (43.9 ms
against 35.6), more than the seventh physics step (OW1's 120 Hz) accounts for. Timing each
phase, with FL1a's code and this branch's run alternately, it was 35.5 against 40.5 ms: 14 %,
the rest a busier day. Of the 5.0 ms:

- A step is more than its physics: it also counts the step's contacts and moves the kinematic
  boxes, at 2000 vehicles about half the physics again. At FL1a's costs a step, the seventh is
  2.3 ms.
- count_contacts() looked up every vehicle (a map of their chassis) before it read the step's
  contacts, and its lookups cost more since FL1b: 0.52 ms a step at FL1a, 0.69 now. A
  kinematic fleet's boxes meet nothing, so there were none to count.
- The navigator's tick took 0.9 ms more (the same lookups in its loops), and FL1d's pose
  snapshot 0.25.

The fixes:

- A step with no contacts that count looks nothing up.
- physics.stats.vehicles gives a summary fleet's quiet vehicles one line, as entities.summary
  does, not a line each built from info() every tick (3.3 ms at 2000 vehicles).

Alternating with the code before: 31.8 ms a tick at 2000 vehicles (40.5 before) and 9.5 at 800
(12.4), under FL1a's 35.5 and 10.9 with the seventh step. The roadmap's 3.1 has the numbers.
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