Skip to content

Ariadne gym: the limits the drive planned each command with on the plant (plants()' plan) - #1286

Merged
transfix merged 5 commits into
masterfrom
feat/gym-plant-plan
Nov 18, 2026
Merged

transfix merged 5 commits into
masterfrom
feat/gym-plant-plan

Conversation

@transfix

@transfix transfix commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Update 2026-11-16. This branch now also carries:

A generic hook for a twin of the world gym's drive: the limits nav@1's plant arm planned each command with. Stacked on #1284 (base feat/gym-drive-intents).

What

  • plants() reports each agent's plan (entity_plant::plan, a new entity_plan, in SI). These are the limits the drive plans the plant's command with: the plant arm, plant_drive, as sim_world sets it up from plant_limits each tick.

    • The vehicle's envelope (a_max, vmax, the cornering a_lat) and its wheelbase.
    • The steering lock (max_steer, the fleet's tightest), the actuator's slew limit (steer_rate) and its angle now (steer_now).
    • The latency and the braking the vehicle achieves (a_brake).
    • Its body as footprint discs (body_rr, body_offsets from the rear axle, footprint).
    • parked: the next tick parks the agent (it brakes to a stop at a_brake).
    • modulated: the plant's measured state scales the drive (plant_modulation), which these do not carry.

    known is false on nav's bicycle, which has no plant arm. pycvc gives it as plants()[i]["plan"].

  • sim_world::plant_plan gains the columns the plan did not have yet: wheelbase, lock, slew, steer_now, latency, a_brake, parked, modulated. plant_plan_of already gave the envelope and the footprint.

  • ARIADNE.md's twin section describes it.

Why

#1284's drive gives a twin the drive's coefficients and carrot, so it can replay the control law. On a vehicle plant, though, the command the plant takes comes from the plant arm, after the control law:

  • v_stop with the latency and a_brake;
  • braking down to -a_brake;
  • the steering slew and lock;
  • the vehicle's own envelope and footprint;
  • the park brake at the goal.

Without these limits, a twin's command departs from the plant's on most agent-ticks within 60 m of a goal (61 % in the run below, parked ticks included). With them, GRL-SNAM's grl_snam.gym_twin (GymTwin(gym, plant_arm=True), CVC-Lab/GRL-SNAM#190) gives the plant's command on all but a few agent-ticks. On three Humvees that nav@1 drives on dynamic4w, the fraction of agent-ticks whose command departs (steering by more than 1e-4 rad or acceleration by more than 0.01 m/s²), with the plan against without it:

  • en route (over 60 m from the goal): 0 % against 0.9 %;
  • arriving: 0.5 % (one tick) against 10.5 %;
  • parked, on the acceleration: 0 % against 99.2 %.

Checks

Built locally (Release, Jolt, CUDA), with this commit cherry-picked onto #1275 (feat/sim-tick) plus #1284's change, the build #1284 was checked on:

  • ariadne_scene_world_test: 49/49, including the new AriadneWorldGym.ThePlanTheDriveCommandedThePlantWith. It checks:
    • the plan's values against the Humvee's body and nav_plant_options' defaults;
    • that nav's bicycle has none;
    • that steer_now is the model's actuator;
    • that once parked is announced, the next tick's command is the park brake's, clamp(-v/dt, -a_brake, a_max).
  • bindings/pycvc/test_pycvc_gym.py: 83 checks, including the new plan checks on every plant.

…ant (plants()' plan)

sim_world::plant_plan gains the rest of the plant arm's columns (plant_drive):
the wheelbase, the steering lock, the actuator's slew limit and its angle now,
the latency, the braking the vehicle achieves, whether the next tick parks the
agent, and whether the plant's measured state modulates the drive. entity_plant
gains entity_plan, those and the envelope and footprint plant_plan already had,
in SI; pycvc.WorldGym.plants() gives it as `plan`. With it a twin of the drive
gives the command the plant took, not only the control law's. Tests:
AriadneWorldGym.ThePlanTheDriveCommandedThePlantWith and test_pycvc_gym's plan
checks; ARIADNE.md's twin section.
transfix added a commit to CVC-Lab/GRL-SNAM that referenced this pull request Nov 16, 2026
)

* gym twin: nav@1's plant arm (GymTwin(plant_arm=True)) and its gate

On a vehicle plant libcvc's drive gives its command through the plant arm
(plant_drive), after the control law: the stopping governor with the latency
and the vehicle's braking, braking down to -a_brake, the steering actuator's
slew and lock, the vehicle's own envelope and footprint, and the park brake at
the goal. sdf_nav.bike_control takes it as plant= (a PlantArm) and steer_now=;
GymTwin(gym, plant_arm=True) reads it from plants()' plan (transfix/libcvc#1286)
and parks rows in rollout, drive_gym and tick_residuals as nav@1 parks an agent.
The default is the control law alone, unchanged.

Gate 5 (tests/test_gym_twin.py): nav@1 drives three Humvees on dynamic4w; the
twin's command from the drive the gym reports against the command the gym's
plant took. Departing agent-ticks, plant arm against the control law alone:
en route 0 % against 0.9 %, arriving 0.5 % (one tick) against 10.5 %, parked
(acceleration) 0 % against 99.2 %. Gate 3 runs with the plant arm too.
docs/gym-twin.md has the numbers.

* gym twin: the stop at the goal (bike_control's stop_at), as nav@1 makes it

transfix/libcvc#1297 makes nav@1 come to rest at its goals: the drive's
speed toward a stop point is held to the speed it stops there from (a_max,
or on the plant arm the latency and a_brake). sdf_nav.bike_control takes it
as stop_at=, and GymTwin(plant_arm=True) applies it at each row's goal where
fields()["navigator"]["stop_at_goal"] is set (older libcvc: no stop).

Gate 5 against #1297: plant arm 0 % departing en route, arriving and parked
(accel), against 0.9 / 77.8 / 98.4 % for the control law alone; the gate
now steps past the gym's end of the episode until the agents are at rest.
Gate 3's plant-arm case starts below ~5 m/s, where beta and gamma act: above
it the stop sets the braking and their gradients are zero.
…parked bicycle holds (#1297)

veh_params::stop_at: a point per agent the drive's speed toward it is held
to stop at, as v_stop holds it to the walls (a_max, or on the plant arm the
latency and a_brake; only the motion that closes on it). sim_world gets two
options, both off by default (byte-identical): stop_at_goal (the stop point
is each agent's goal) and park_hold (on the kinematic arm a parked agent
brakes to a stop at a_max and holds). WorldVehicles turns both on for its
navigators, and navigator() reports them (pycvc's fields()["navigator"]).

Without them nav@1 met its goal at the speed the goal's pull left, which
grows with the trip: a Humvee 150 m out arrived at ~19 m/s and parked ~28 m
past its goal; on the bicycle a parked agent drove on at 5.5 m/s. A gym's
agents were then never all at their goals at once, so its episode never
ended.
… sleep (#1282)

* state_exec async test: SL-7 times the sleeper from just before a warm sleep

Slices.SL07_ABetterPriorityPreempts failed all three tries in #1246's
recipe / macos-latest / Release job (run 43708365932): the runner made 62,
37 and 42 ticks past the sleeper's due time, against a limit of 32.

The test timed the due time from (arm), the step before a first
(sleep 0.02). The scheduler's due time is the sleep's own clock reading plus
20 ms, and in a fresh process (one test per ctest run) the code between the
two readings runs for the first time there: the runner's ticks over that gap
counted as lateness. On an idle Windows machine, fresh processes counted
9-24 that way; the macOS runner, 37-62.

Now (arm) is the sleep's argument, (sleep (arm)), so it reads the clock just
before the sleep does, and a (sleep 0.001) first warms the sleep's path. The
same machine counts 1-5 in fresh processes (40 runs), 0-12 warm (300), and
0-10 in fresh processes with 66 busy loops on its 22 CPUs (30). The limit
stays 32, and the count is printed.

* Ariadne action-caps test: steps checked with the time cap raised; each kill waits for its warning

AriadneAsyncFn.ActionCapsAreTreeSettingsAndChargeAsyncCalls failed three times running on
package-linux / libcvc-debug: the 200-round loop was killed with time_limit_exceeded. The
default time cap (0.1 s) is wall time, and a loaded Debug runner spent it on the loop.

- The step-cap checks raise ariadne.limits.action_max_time to 30 s, so only steps decide them.
- The default time cap gets its own check: ten million rounds with no step cap, which run into
  0.1 s on any machine (time_limit_exceeded).
- Each button is clicked alone, by its label (button_click clicked every button, so each click
  ran every program), and a kill waits up to 30 s for its own warning instead of a fixed 1 s.
- The second spin kill has its own key: a kill warns once per message.

Locally (Windows, MSVC Release): 5/5, and 160/160 with 32 copies running at once (slowest 403 ms).

(cherry picked from commit a5e83b1)
Base automatically changed from feat/gym-drive-intents to master November 17, 2026 12:16
@transfix
transfix enabled auto-merge November 18, 2026 03:43
# Conflicts:
#	src/cvc/ariadne/world_vehicles.cpp
@transfix
transfix merged commit 1222b13 into master Nov 18, 2026
29 checks passed
@transfix
transfix deleted the feat/gym-plant-plan branch November 18, 2026 09:12
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