Skip to content

feat(planner): repeatable plans: more IK seeds, reseed, graph fallback - #74

Merged
SwapnilPande merged 8 commits into
devfrom
feature/deterministic-planning
Nov 19, 2026
Merged

SwapnilPande merged 8 commits into
devfrom
feature/deterministic-planning

Conversation

@SwapnilPande

@SwapnilPande SwapnilPande commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Why

plan_to_pose often plans large, unintuitive motions around the wheelchair, and the same request gives a different motion from one call to the next. That makes it hard to trust waypoint ordering around obstacles the world doesn't model.

Results

80 start → goal-pose pairs on the chair fixture (mebot layers, 30° mount), 10 reps each, start jittered by 3 mrad per joint every rep.

Desktop (RTX 3090):

condition success pairs with >1 outcome final spread p50 goal distance p50 sweep p50 / p95 stray from straight line p95 plan time p50
baseline 799/800 70/80 4.45 rad 3.50 rad 0.110 / 0.209 m³ 1.03 m 0.08 s
reseed_each_plan 799/800 17/80 0.00 3.48 0.110 / 0.207 0.91 0.09
num_ik_seeds: 512 + reseed_each_plan 799/800 17/80 0.00 2.87 0.100 / 0.194 0.89 0.10
that + graph_fallback 799/800 17/80 0.00 2.87 0.100 / 0.195 0.89 0.09
512 + reseed, trajopt toward the nearest goal only 779/800 9/80 0.00 2.83 0.101 / 0.194 0.99 0.09

Jetson (abra, AGX Orin, this PR's image rammp-curobo:pr74):

condition success pairs with >1 outcome final spread p50 sweep p50 / p95 plan time p50 / p95
baseline 799/800 70/80 4.44 rad 0.111 / 0.207 m³ 0.23 / 0.36 s
512 + reseed 799/800 19/80 0.00 0.100 / 0.194 0.35 / 0.38 s
512 + reseed + graph_fallback 799/800 18/80 0.00 0.099 / 0.195 0.35 / 0.41 s

("Outcome" = final joints more than 0.3 rad apart on any joint; spread = median distance between one request's final joints. The one failure in every row except the nearest-goal-only one is the start jitter landing in collision.)

  • The cause: IK already ranks its solutions nearest the start first. Raising cuRobo's null-space weight, or weighting it per joint, changed nothing, so neither is in this PR. The variance comes from which solutions IK's 32 random seeds happen to find, then which goal trajopt keeps.
  • The fix: with 512 IK seeds the nearest solutions are found every call, and the reseed makes the rest of the draw repeatable. An identical request gives one plan; under 3 mrad of start jitter, 18–19 of 80 pairs (near a boundary) can still land in two outcomes, against 70 of 80 before. The goal is about 18% nearer in joint space and the sweep about 8% smaller, with no lost plans.
  • The cost on the Orin: about 0.12 s per plan at the median, and 0.02–0.05 s at p95.
  • What didn't work: restricting trajopt to the single nearest goal failed 2 pairs on every rep (FINETUNE_TRAJOPT_FAIL at that goal). The graph planner didn't rescue them, so that option is dropped.

What's in it

  • Planner keys, all off by default:
    • num_ik_seeds: positive integer or null, passed to MotionGenConfig at construction. Warm-up records CUDA graphs for the seed counts, and changing one per plan crashed the GPU.
    • reseed_each_plan: calls MotionGen.reset(reset_seed=True) before every plan, which also clears the graph planner's roadmap.
    • graph_fallback: warms up the graph planner and sets enable_graph_attempt=1, so it engages after a failed attempt, for blocked routes. Cost on the Orin: about 2.4 s more at start-up, and when it engages on a request a plain retry would have saved, that plan takes 1.0–1.5 s instead of about 0.6 s (1 of 80 bench pairs; p99 0.59 → 1.03 s). It rescued nothing on this bench, which has almost no blocked routes. Engaging after the first failure is a deliberate choice; plan_log replay of real failures is the test of its value.
  • Jetson CUDA linear algebra fixed:
    • Cause: the jp6/cu126 torch 2.10 wheel needs cuSOLVER 11.7.1.2, and JetPack r36.4 ships 11.6.4.69, so every CUDA linalg op (svd, inv, eigh, ...) died at first use, the graph planner's warm-up included.
    • Image: installs NVIDIA's Tegra cuSOLVER 11.7.1.2 deb, and the build fails if the symbol is still missing.
    • Planner: no longer routes linalg to MAGMA, which the wheel lacks.
    • Tests: new GPU tests check CUDA svd against the CPU, and that a graph planner warms up and plans.
  • Node parameter plan_log: writes every plan request, the collision world it was planned in and the result to JSONL, under the planning lock. Nothing in it can fail a plan.
  • bench/: the benchmark, a replay mode for plan_log files, and an x86 Dockerfile. Replay skips held/via requests and reports them. Not shipped in the image.

Checklist

  • Jetson, this PR's image on abra: every check passed.
    • make build (cuSOLVER gate included), image-contents, image-default.
    • make verify: 387 passed, GPU required, including the new svd and graph-planner tests.
    • Node tests in the image: 62 passed.
    • make sim-test: 157 passed.
    • make sim: 45 cases, 0 failed, G0–G7 PASS.
    • Orin timing: the table above.
  • Desktop GPU suite: passed on an RTX 3090. test_platform_layer_pair failed once in the full suite; it is already known to be flaky on clean dev, and passed 3/3 reruns.
  • CI: green on amd64 and arm64.
  • Review, round 1: an independent review found that plan_log aborted every plan when enabled (world_boxes is a property). Fixed in fb17287, with replay and validation fixes.
  • Review, round 2 (fb17287 and the cuSOLVER commit): no critical or important issues. Minor fixes in the last commit: the deb is checked against NVIDIA's SHA256, the GPU test also runs batched eigh (the op behind the missing symbol), and the stale "keep the graph off on Jetson" docs are corrected. Rebuilt on abra: checksum OK, make verify 387 passed, image-default passes.
  • Where the defaults flip: per robot, in curobo: repeatable plans on every robot (512 IK seeds, reseed, graph fallback), plan_log param rammp-deployments#178. PLANNER_DEFAULTS stays cuRobo's.
  • Follow-up after merge: replay real requests: the bench pairs are random collision-free states, not task motions, and they have few blocked routes for graph_fallback. Needs a planner image with this PR running on a live session with plan_log set.

🤖 Generated with Claude Code

SwapnilPande and others added 5 commits November 18, 2026 22:11
Four planner keys, all off by default (cuRobo's own behaviour):

- num_ik_seeds: IK ranks its solutions nearest the start first, but with
  cuRobo's 32 seeds it often misses the nearest one, so one request lands
  on different goal configurations from call to call. 512 find it reliably.
- num_trajopt_seeds: how many IK goals trajopt optimises toward; 1 = only
  the nearest. Both counts go to MotionGenConfig at construction: warm-up
  records CUDA graphs for them, and changing them per plan crashes.
- reseed_each_plan: MotionGen.reset(reset_seed=True) before every plan, so
  one request draws the same seeds and noise (and the graph planner starts
  from an empty roadmap) each time.
- graph_fallback: warm up the graph planner and let cuRobo switch it on for
  the rest of a plan once an attempt fails trajopt (enable_graph_attempt=1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
plan_log:=<file> appends one JSON line per plan_to_pose / plan_to_joints
request: the start, the goal, the box world cuRobo was given, the status
and the trajectory; the first line carries the config path and the model.
"" (the default) logs nothing. bench/sweep_bench.py replays the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bench/sweep_bench.py plans start -> goal-pose pairs on the chair fixture
under one planner condition, jittering the start every rep, and reports
success, how many distinct final configurations one request lands in, the
swept volume of the collision spheres, and plan time; it also replays a
node's plan_log. bench/Dockerfile.x86 builds cuRobo v0.7.8 for an Ampere
desktop GPU. Not shipped in the image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Optimising toward only the nearest IK goal failed 2 of 80 bench pairs on
every rep (FINETUNE_TRAJOPT_FAIL at that goal) and the graph planner did not
rescue them. With 512 IK seeds and a reseed, trajopt's 4 goals are the same 4
nearest solutions every call: 799/800 plans, final spread 0, and the same
sweep reduction, so the key bought nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SwapnilPande SwapnilPande changed the title feat(planner): repeatable plans: seed counts, reseed, graph fallback feat(planner): repeatable plans: more IK seeds, reseed, graph fallback Nov 19, 2026
@SwapnilPande
SwapnilPande marked this pull request as ready for review November 19, 2026 03:26
SwapnilPande and others added 3 commits November 18, 2026 22:39
- plan_log called CuRoboPlanner.world_boxes, a property, as a function:
  with plan_log set, every plan_to_pose / plan_to_joints goal raised in its
  execute callback and was aborted. The test's stand-in was a function too.
  Now the record is built under the planning lock (so a world pushed
  meanwhile is not the one logged) and nothing building or writing it can
  fail the plan; the test runs the node's real _plan path against a
  property-shaped world_boxes.
- The log marks a hold or via only when active, and replay skips those
  requests (planned without them here) and reports what it skipped. Replay
  handles an empty-world session and refuses a log whose sessions used
  different models.
- num_ik_seeds must be a positive integer (or null), refused at
  construction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s on the Jetson

The jp6/cu126 torch 2.10 wheel was built against cuSOLVER 11.7.1.2 (CUDA
12.6.3); l4t-jetpack r36.4 ships 11.6.4.69, which lacks
cusolverDnXsyevBatched_bufferSize. The sonames match, so ldd and the import
are clean and every CUDA linalg op dies at first use. Plain planning never
calls one; the graph planner does (torch.svd in its warm-up), so
graph_fallback could not run on a robot.

The image installs NVIDIA's Tegra cuSOLVER 11.7.1.2 deb after the cuRobo
build (runtime only, so that layer stays cached) and fails the build if the
symbol is still missing. The planner no longer routes linalg to MAGMA: the
wheel has none, so the call was a no-op that broke svd once cuSOLVER loaded.
New GPU tests: a CUDA svd against the CPU, and a graph planner that warms up
and plans. Diagnosed and proven on abra (Orin, JP r36.4), 2026-11-18.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… docs

- The cuSOLVER deb is checked against the SHA256 in NVIDIA's Packages index
  (pinned like the cuRobo tag's commit).
- test_cuda_linear_algebra_works also runs batched eigh, which calls
  cusolverDnXsyevBatched, the symbol that was missing, itself.
- gen3.yaml and the README no longer say to keep the graph planner off on
  the Jetson: it needs the image's cuSOLVER, which a bare JetPack host lacks.
- CHANGELOG notes that on x86 the graph planner's linalg now uses torch's
  default backend instead of MAGMA.
- replay exits with a message on a log that has no header line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SwapnilPande
SwapnilPande merged commit 2564b0e into dev Nov 19, 2026
5 checks passed
@SwapnilPande
SwapnilPande deleted the feature/deterministic-planning branch November 19, 2026 06:09
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