Repository navigation
nav: CoPH's agent and fleet, and the crossing world (C5 part 1; G12) - #1413
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
transfix
enabled auto-merge (squash)
November 22, 2026 08:29
This was referenced Nov 22, 2026
transfix
added a commit
that referenced
this pull request
Nov 23, 2026
…on slow Debug runners (#1462) CophFleet.TheEnergyAccountStaysAtRoundOffOverALongRun runs the crossing until both agents are at their goals (767 and 784 ticks). It takes about 4 s in Release and 69.65 s in package-linux / libcvc-debug on a normal runner (#1413's job 137148518817). A PR's Debug ctest gives a test without a TIMEOUT of its own 300 s, and on #1452's run 45049798289 (job 137292269354) it timed out on all three tries. On that runner this executable's other cases ran 4.2-4.7 times slower than on #1413's (the golden cases 24 s against 5, the channel-delay test 30 against 7.2), so the long run would have needed about 290-330 s. The executable gets TIMEOUT 900, as the segmentation action test has for a Debug time of about 100 s: 13 times the normal Debug time, about 2.8 times that slow runner's. The test is unchanged. Not shortened in Debug: both agents reaching their goals, with no hit and the energy residual at round-off, is what the test checks. Not made cheaper: at /Od the learner's updates are about 60 % of the run, the actions 19 % and the exports 15 %, all held bit for bit to GRL-SNAM's G12 golden, so a cheaper step is learner work rather than a test fix. Checked on Windows with the test built from its sources in a Debug configuration (/Od /Ob0 /RTC1) and this file's cvc_discover_tests wrapper and line: every discovered case has TIMEOUT 900, the eight pass under ctest --timeout 300, and the long run passes under --timeout 5 (the property wins over the command line). The long run took 17.5 s there, 35 s with the machine loaded.
transfix
added a commit
that referenced
this pull request
Nov 23, 2026
#1413 landed as a squash, and nav/coph-c5b took master in (f32c670). The one conflict, src/cvc/tests/CMakeLists.txt, keeps master's TIMEOUT for nav_coph_fleet_test (#1462) and nav/coph-c5b's for nav_coph_cars_test, and gives nav_coph_driver_test the same 900 s. #1461's first run failed package-linux / libcvc-debug on two timeouts at the PR Debug ctest's 300 s default, on a runner about 5x slower than usual (the fleet's goldens took 25 s against 5): CophFleet.TheEnergyAccountStaysAtRoundOffOverALongRun, which #1462 fixes, and CophDriver.ABlockSensedLateIsNeverHit. CophDriver.TwoCarsCrossTheField passed there in 298 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 1 of
docs/roadmap/NAV-COPH-ROADMAP.md(§4.5): one CoPH agent as a whole, a fleet of them, and the crossing world, reproducing GRL-SNAM's G12. Additive and default-off.Stacked on #1410 (C4), and its golden comes from CVC-Lab/GRL-SNAM#202 (G12, itself on #201). Until #1410 merges, this branch's first commit is C4's.
src/cvc/tests/data/coph_golden.jsonis #202's fixture (blob6a96239c). G1–G11 are unchanged. Merging this PR is Joe's call.What lands
inc/cvc/nav/coph_agent.h:coph_agent, the demos' whole learner (CrossingLearner) over C1–C4.observe:CooperativeLearner's agent-prefixed uids;navigation.observe_geometry's store (what intersects a kept stage or lies within the stopping distance, nearest first);MazeLearner's geometry reports.advance.action: the routed control (C3) in the live navigation context.update:CooperativeLearner's diagnostic controls, whose guard steps count against the budget, around C3/C4's update; thenTerrainLearner's own anchors, one per 0.2 m cell.export_toandassimilate, with the received-geometry events.inc/cvc/nav/coph_fleet.hcoph_fleetis the demos' runner (staggered_demo.execute) for agents that start together, over acoph_channel. Each boundary observes and advances, exports on the update cadence, delivers in(timestamp, identity)order, then updates and acts. It keeps the runner's records and each agent's energy account (coph_energy).coph_crossing_worldis the crossing demo's world: the exact-flow plant, door and corridor hits, and the 21-point sensor with a pluggable noise.run()drives a fleet through it.coph_ledger::commit;route_changedand the raw command (proposed) incoph_control_meta;coph_corridor_clearandcoph_slab_sweep;coph_field_vector;TerrainLearner's local cells in the exchange state.Results on Windows (MSVC 19.44, Release)
Not yet: part 2
sim_worldagents, Froude scaling, the allocation,override_command).plant_ledgeritems (D11).The roadmap's §4.5 now has a "Landed in part 1" note saying so.
Also not modelled: the runner's status replies and acknowledgements. They cost bytes but never bind at the demos' budgets, and the fleet counts payload bytes only.