Repository navigation
nav: CoPH's cars' learner, the profile's router (C5 part 2a; G13) - #1460
Merged
Merged
Conversation
C4 of docs/roadmap/NAV-COPH-ROADMAP.md (section 4.4), additive and default-off: nothing calls it
yet; C5's fleet driver will.
- coph_packet.h: the demos' packet (cooperative.Packet, then MazePacket's geometry), and bytes():
the length of its compact, key-sorted JSON, with Python's repr for floats (coph_repr, from
std::to_chars's shortest digits) (D9). coph_exchange_state holds the received packets, the
route evidence and its cells, and the reported geometry.
- coph_exchange.h:
- coph_export: CooperativeLearner's bootstrap and candidate anchors, TerrainLearner's
risk-ordered anchors and second bootstrap, MazeLearner's geometry. The resample indices are
injected, or drawn from a seeded std::mt19937 through detail::pick_below (D8).
- coph_assimilate: MazeLearner's geometry checks; CooperativeLearner's schema, provenance, age,
order, payload and received cap; TerrainLearner's route evidence.
- coph_expire and the two refreshes.
- coph_fit_messages: the legacy receiver's whitened Gauss-Newton step, which coph_update now
commits when packets are held.
- coph_channel.h: the transport interface and coph_ideal_channel (seeded delay and jitter, drops,
duplicates, an optional range).
- detail/coph_math.h: the features, Cholesky and slab distance that coph_learner.cpp and
coph_exchange.cpp share (moved out of coph_learner.cpp unchanged).
nav_coph_exchange_test reproduces GRL-SNAM's G9 and G10 (CVC-Lab/GRL-SNAM#201;
data/coph_golden.json is its fixture). Every decision and byte count matches exactly, and the
values come within 0.074 of the tier's allowance on Windows. It also checks the channel's
statistics, production draws and JSON escapes.
C5 part 1 of docs/roadmap/NAV-COPH-ROADMAP.md (section 4.5), additive and default-off.
- coph_agent.h: the demos' whole learner (CrossingLearner) over C1-C4.
- observe: CooperativeLearner's uids, navigation.observe_geometry's store, C1's ledger, the
expiries, MazeLearner's geometry reports.
- advance.
- action: the routed control in the live navigation context.
- update: CooperativeLearner's diagnostic controls around C3's update, then TerrainLearner's
own anchors.
- export and assimilate, with the received-geometry events.
- coph_fleet.h:
- coph_fleet: the demos' runner (staggered_demo.execute) for agents that start together, over
a coph_channel. Its boundaries observe and advance, export on the update cadence, deliver,
update and act. It keeps records and each agent's energy account.
- coph_crossing_world: the crossing demo's world, with its plant, its door and corridor hits
and its sensing.
- C1-C3 gain the hooks it needs:
- coph_ledger::commit;
- the route change and the raw command in coph_control_meta;
- coph_corridor_clear and coph_slab_sweep;
- coph_field_vector;
- TerrainLearner's local cells in the exchange state.
nav_coph_fleet_test reproduces GRL-SNAM's G12 (CVC-Lab/GRL-SNAM#202; data/coph_golden.json is its
fixture). Every decision matches, and positions and forces are within 2.8e-16 against an atol of
1e-6. The C++-only tests cover:
- refusals outside the profile;
- packets arriving after a channel's delay;
- a run of the whole crossing, which both agents finish (agent 0 in 92.0 s, the demo's
reciprocal finish time) with each energy account's residual at 7e-15.
The vehicle driver and the plant_ledger items (D11) are part 2.
# Conflicts: # inc/cvc/nav/coph_exchange.h # inc/cvc/nav/coph_learner.h # inc/cvc/nav/coph_packet.h # inc/cvc/nav/detail/coph_math.h # src/cvc/CMakeLists.txt # src/cvc/nav/coph_exchange.cpp # src/cvc/tests/CMakeLists.txt # src/cvc/tests/data/coph_golden.json
C5 part 2a of docs/roadmap/NAV-COPH-ROADMAP.md (section 4.5), additive and default-off. A car carries
the cars controller's learner (GRL-SNAM's CarLearner, demo 2b), not the crossing's: a bare
CooperativeLearner whose stages advance by MazeLearner's rule, routing with the profile's own planner
since a car's world has no surveyed network, and sending packets without maze or terrain layers.
- coph_learner.h:
- coph_profile_route and coph_edge_clear port navigation.route without a maze graph: A* through
the sensor footprints on a 0.1 m grid, with edges priced by the stages' risk, replanning on
stagnation, the update cadence, a blocked waypoint or a newly sensed disk.
- coph_control dispatches on the learner's network: an empty one takes the profile's router
and drops the guard's corridor checks.
- Each kept stage keeps its entry context, from which the replay and the pilot start.
- coph_agent with an empty network runs CooperativeLearner on Learner: no geometry reports, no
terrain anchors, and CooperativeLearner's packet (coph_packet::maze false: no geometry keys in
its JSON).
- coph_can_export: whether an export makes a packet, so the fleet asks a draw source only then.
- coph_crossing_world with no network and risk patches is CooperativeWorld's open field.
nav_coph_cars_test reproduces GRL-SNAM's G13 (CVC-Lab/GRL-SNAM#203; data/coph_golden.json is its
fixture). Every decision matches, including each planned route and every delivery, and positions
are within 5.6e-16 against an atol of 1e-6. G1 to G12 are unchanged.
The vehicle driver on sim_world and the plant_ledger items (D11) are part 2b.
This was referenced Nov 22, 2026
#1413 landed as a squash (08a7386). Where master's copy of a file is still #1413's head (487d501), this branch's copy is taken. src/cvc/tests/CMakeLists.txt takes master's TIMEOUT for nav_coph_fleet_test (#1462) and gives nav_coph_cars_test the same 900 s: G13's cases take about 21 s each in a Debug job, and 116 s on the slow runner of #1461's first run.
transfix
enabled auto-merge (squash)
November 23, 2026 06:49
#1461 was stacked on this branch and landed as a squash (e1890d0), so master now holds all of this PR's changes plus #1461's. The two conflicts, src/cvc/tests/CMakeLists.txt (the driver test's registration and TIMEOUT) and docs/roadmap/NAV-COPH-ROADMAP.md (the part 2b note), were #1461's additions on master's side only, and take master's. The branch's tree is now master's.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
C5 part 2a of
docs/roadmap/NAV-COPH-ROADMAP.md(§4.5): the learner a car carries, reproducing GRL-SNAM's new G13. Additive and default-off.Stacked on #1413 (C5 part 1), and its golden comes from CVC-Lab/GRL-SNAM#203 (G13). Until #1413 merges, this PR's diff includes part 1.
src/cvc/tests/data/coph_golden.jsonis #203's fixture (blob41fd3f90); G1–G12 are unchanged. Merging it is Joe's call.Why part 2 starts here
A car carries the cars controller's learner (GRL-SNAM's
CarLearner, demo 2b), not G12'sCrossingLearner:CooperativeLearnerwhose stages advance by MazeLearner's rule (C1's ledger already follows it);The vehicle driver (part 2b) runs this learner, so it is pinned first.
What lands
coph_profile_routeandcoph_edge_clearportnavigation.routewithout a maze graph:The planner takes disks only, as the Python does; a slab throws.
coph_controldispatches on the learner's network. With an empty one it takes the profile's router, drops the guard's corridor checks, and takesproject's full candidate search.The replay and the pilot start each stage from that stage's entry context, which
coph_agentrecords when the stage is entered.coph_agentwith an empty network runs CooperativeLearner on Learner: no geometry reports and no terrain anchors. It sends CooperativeLearner's packet:coph_packet::mazeis false, so its JSON (and byte count) has no geometry keys.coph_can_exportsays whether an export makes a packet. The fleet asks a draw source only then: a car's learner sends nothing until a candidate anchor is supported.coph_crossing_worldwith no network and risk patches isCooperativeWorld's open field.Results on Windows (MSVC 19.44, Release)
Next: part 2b
The vehicle driver on
sim_world(Froude scaling, the allocation every tick with the force held between CoPH steps,override_command, the local goal, obstacles and risk from the world) and theplant_ledgeritems (D11), with the byte-unchanged runs without a fleet. The CoPH ledger items will need their own table, printed only with CoPH attached, because adding rows to the plant table would change every run's output.