Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThe changes optimize MLS surface computation in FilterMLS by introducing workspace buffer reuse, thread-local storage via ThreadWorkspace, and power caching mechanisms. Function signatures are extended to accept external workspace parameters, replacing per-iteration allocations with reusable buffers and improving memory efficiency during parallel processing. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
f2171a1 to
2ccd5a7
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
mp2p_icp_filters/src/FilterMLS.cpp (1)
234-239:⚠️ Potential issue | 🟠 MajorBug: LLT decomposition is computed twice, and the check may not reflect the solve's status.
AtWA.llt().solve(AtWb)creates a temporary LLT decomposition, thenAtWA.llt().info()creates a second, separate decomposition. The status check doesn't verify the decomposition used for solving.🐛 Proposed fix: reuse the LLT object
- // Solve (A^T*W*A)*c = A^T*W*b using Cholesky decomposition - c_vec = AtWA.llt().solve(AtWb); - if (AtWA.llt().info() != Eigen::Success) + // Solve (A^T*W*A)*c = A^T*W*b using Cholesky decomposition + Eigen::LLT<Eigen::MatrixXd> llt(AtWA); + if (llt.info() != Eigen::Success) { return; } + c_vec = llt.solve(AtWb);
🤖 Fix all issues with AI agents
In `@mp2p_icp_filters/src/FilterMLS.cpp`:
- Around line 50-64: The Padé approximation in fast_weight_gaussian produces
negative weights for large sqr_dist because x = -sqr_dist/sqr_radius can go
below -2; update fast_weight_gaussian to prevent negative returns by clamping
the approximation to a non‑negative value—e.g., after computing x (or xh) check
if x < -2.0 and return 0.0 (or otherwise cap the computed weight with max(0.0,
approx)); keep the existing early exit for very small weights but replace the
unsafe approximation with a clamp to zero for x < -2 to ensure weights used in
the weighted mean/covariance remain nonnegative.
- Around line 366-368: The ThreadWorkspace currently hardcodes buffer sizes
(basis_vector, u_pow_cache, v_pow_cache) for polynomial_order == 3 which leads
to OOB if params.polynomial_order > 3; update initialize_filter (or the
ThreadWorkspace ctor) to validate params.polynomial_order and resize these
buffers dynamically based on polynomial_order: set basis_vector.size() =
(p+1)*(p+2)/2 and u_pow_cache.size(), v_pow_cache.size() = p+1 (where p =
params.polynomial_order), or fail fast with a clear error if an unsupported
order is provided; ensure computeMLSSurface and projectPointSimple rely on these
dynamically sized buffers.
🧹 Nitpick comments (1)
mp2p_icp_filters/src/FilterMLS.cpp (1)
101-103: Remove commented-out code.These commented members are no longer needed with the workspace-based approach. Leaving them clutters the code.
♻️ Suggested removal
- // mutable std::vector<double> u_pow; // Reusable workspace - // mutable std::vector<double> v_pow; // Reusable workspace -
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #38 +/- ##
===========================================
+ Coverage 76.99% 77.07% +0.07%
===========================================
Files 179 179
Lines 9529 9557 +28
Branches 917 919 +2
===========================================
+ Hits 7337 7366 +29
+ Misses 2192 2191 -1
🚀 New features to boost your workflow:
|
Summary by CodeRabbit