Repository navigation
nav: CoPH's learner: field fit, damping fit, maze-routed replay and update (C3; G5-G8) - #1386
Merged
Merged
Conversation
…pdate (C3; G5-G8) C3 of docs/roadmap/NAV-COPH-ROADMAP.md (§4.3): the update of the demos' own learner (crossing_demo.CrossingLearner) in the profile, in inc/cvc/nav/coph_learner.h. - coph_field_fit: each kept stage's ridge fit (Cholesky on its 16 x 16 system). - coph_fit_damping: Newton steps on the plant loss, on hyper-duals (coph_dual.h). - coph_maze_route and coph_control: the profile's routed controller is MazeLearner's maze router on the surveyed corridor network, then the CBF projection and the corridor guard. - coph_prepare and coph_replay: the supported_boundary plan and budget, and retained_replay; on coph_dual2 one pass gives the cost and d cost / d policy. - coph_update: the fits, the policy step and its halvings, validation, then commit or rollback. coph_model.cpp gains scalar traits for the duals and instantiates the plant, potential and command on them. The golden (data/coph_golden.json) is CVC-Lab/GRL-SNAM#195's, with G5-G8 added; G1-G4 and G11 are unchanged. On Windows nav_coph_learner_test matches every decision, with values within 0.0069 of the tier's allowance (rtol 1e-9, atol 1e-12). nav_coph_test and nav_coph_model_test still pass. The roadmap's §4.3 records what landed, and corrects its routed-controller text: the profile never reaches the route field's anchors.
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.
C3 of
docs/roadmap/NAV-COPH-ROADMAP.md(§4.3): the update of the demos' own learner (crossing_demo.CrossingLearner, in GRL-SNAM'sgrl_snam.coph) in C++, in the demos' profile. It is additive and default-off: nothing calls it yet; C5's fleet driver will.Depends on CVC-Lab/GRL-SNAM#195 (the G5–G8 generator).
src/cvc/tests/data/coph_golden.jsonis that PR's fixture, the same blob (f2754a27). Its G1–G4 and G11 are unchanged. If #195 changes, this copy follows.What lands
inc/cvc/nav/coph_dual.h: forward-mode duals.coph_dual2gives the replay's cost and its gradient in the two policy gains in one pass.coph_dual<coph_dual<double, 1>, 1>gives the damping loss's first and second derivatives.coph_model.cppgains scalar traits for them and instantiates the plant, potential and command on them.inc/cvc/nav/coph_learner.h, over plain-data state (coph_learner_state). That state holds C1's stages, the geometry store, what the router reads, and the committed damping, policy and version.coph_field_fit(G5): each kept stage's ridge fit. The system is block diagonal, so each stage's 16 × 16 normal equations are solved by Cholesky.coph_fit_damping(G6): 8 Newton steps on the plant loss, with derivatives from hyper-duals.coph_reconcile_dampingthen clips the result to the trust region.coph_maze_routeandcoph_control: the profile's routed controller (below).coph_prepareandcoph_replay(G7): thesupported_boundaryplan with its pilots, the update cap and the routed reserve; thenretained_replayover the kept stages.coph_update(G8):src/cvc/tests/nav_coph_learner_test.cpp: rebuilds each of the three snapshots from the file's inputs alone and checks G5–G8. It also has unit tests of the duals and of the router (the middle door closing the middle row).Results on Windows (MSVC 19.44, Release)
nav_coph_test(12) andnav_coph_model_test(10) still pass. clang-format 18 is clean on the touched files.Where the spec met the code
The routed controller is the maze router, not the route field. §4.3 said the C++ takes "the route field's anchors". The demos' learner is a
MazeLearner, so a replay step actually runs:maze_learning.maze_route: Dijkstra on the surveyed corridor network (coph_crossing_network), with edges closed by the reported geometry and priced over the terrain anchors, then a waypoint on the 0.1 m grid;navigation.project(fast when the raw force satisfies every constraint);maze_geometry.corridor_clear.The roadmap's §4.3 now says so.
Cholesky, not Eigen's LLT. No other nav code uses Eigen, and the blocks are 16 × 16.
What the golden does not reach:
Left for C5:
TerrainLearner.update's local cells);CooperativeLearner.updateruns around an update, which only count guard steps outside the budget.Merge is left to Joe.