fix(routing): preserve row-major layout when resizing capacity routes#1621
fix(routing): preserve row-major layout when resizing capacity routes#1621mlubin wants to merge 1 commit into
Conversation
|
/ok to test 7ffa08c |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe change makes capacity-route storage resizing preserve row-major data across stride changes and adds a CUDA unit test covering repeated growth of routes with weight and volume capacities. ChangesCapacity route resize
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cpp/tests/routing/unit_tests/capacity_route_resize.cu`:
- Around line 17-86: Update multi_dim_grow_preserves_second_dimension to use
distinct, binding weight and volume demand/capacity values so both constraints
can detect corruption, and adjust the expected load calculations accordingly.
Before validating capacities, assert that every order is assigned exactly once
in the returned host_route. Replace the current tautological cap checks with
assertions against each dimension’s actual configured capacity.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: f0b3ed3d-1bee-4f16-b5cb-992fa0bb7918
📒 Files selected for processing (3)
cpp/src/routing/route/capacity_route.cuhcpp/tests/routing/CMakeLists.txtcpp/tests/routing/unit_tests/capacity_route_resize.cu
capacity_route_t stores its per-node arrays row-major with one row per capacity dimension and stride == max_nodes_per_route. resize() grew the flat buffers with device_uvector::resize, which only preserves the linear prefix, so after a mid-solve route growth every capacity dimension beyond the first ended up read at the wrong stride. On problems with >=2 capacity dimensions this corrupted demand data whenever a route outgrew its allocation, yielding wrong infeasibility costs: a flaky "Cost should improve!" / "Cost mismatch" SIGABRT in assert-enabled builds, and silent constraint-accounting errors in release builds. Re-place each dimension's row at its new offset with a strided copy, and add a regression test that drives a multi-dimension route past its base allocation during a solve (see issue NVIDIA#1618). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
7ffa08c to
51893be
Compare
|
/ok to test 51893be |
CI Test Summary✅ All 31 test job(s) passed. |
Fixes
capacity_route_t::resizeto be correct when there's more than one capacity dimension.Adds a test that previously fails more reliably than the existing flaky failures and fixes #1618.