[Tests] Fix undefined behavior in shammath/solve::least_squares test - #2098
[Tests] Fix undefined behavior in shammath/solve::least_squares test#2098tdavidcl wants to merge 1 commit into
Conversation
The comparison loop used an uninitialized loop counter (`size_t i;` instead of `size_t i = 0;`), so its starting value was whatever garbage was left on the stack. Depending on compiler/optimization level, this could skip comparisons entirely (silently passing a bad fit) or read out of bounds, explaining the flaky/non-deterministic CI failures. Also fixed a related out-of-bounds read: `ex_res` only had 3 entries but was indexed up to 3 (missing the expected R^2 value). Assisted-by: Claude
|
Thanks @tdavidcl for opening this PR! You can do multiple things directly here: Once the workflow completes a message will appear displaying informations related to the run. Also the PR gets automatically reviewed by gemini, you can: |
|
Warning Review limit reached
Next review available in: 51 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
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 |
Workflow reportworkflow report corresponding to commit 6b53feb Light CI is enabled (the default for pull requests). This will only run the basic tests and not the full tests. Pre-commit check reportPre-commit check: ✅ Test pipeline can run. Clang-tidy diff reportNo relevant changes found. You should now go back to your normal life and enjoy a hopefully sunny day while waiting for the review. Doxygen diff with
|
The comparison loop used an uninitialized loop counter (
size_t i;instead ofsize_t i = 0;), so its starting value was whatever garbage was left on the stack. Depending on compiler/optimization level, this could skip comparisons entirely (silently passing a bad fit) or read out of bounds, explaining the flaky/non-deterministic CI failures. Also fixed a related out-of-bounds read:ex_resonly had 3 entries but was indexed up to 3 (missing the expected R^2 value).Assisted-by: Claude