You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exclude diagonal matrix elements while counting valid entries.
Exclude infinity values from the count.
Remove unsigned subtraction to prevent underflow.
Testing
git diff --check passed.
Full build and automated tests have not been run locally because CMake is not installed.
Summary by CodeRabbit
Bug Fixes
Corrected matrix row counts to exclude diagonal entries and values set to the maximum representable number. Counts are now accurate when diagonal entries contain other values.
No actionable comments were generated in the recent review.
Walkthrough
detail::count_rows now counts only off-diagonal matrix entries whose values are not the maximum double value. It no longer subtracts the matrix row count from the total.
count_rows increments the count only for non-maximum values outside the diagonal. This replaces counting all non-maximum values and subtracting the matrix row count.
pgRouting/pgrouting#3192 — The issue reports underflow and underallocation in detail::count_rows. This change addresses its described counting behavior by excluding diagonal entries and maximum values.
Suggested labels: Bug Fix
Suggested reviewers: cvvergara
Merge Risk: Minimal · up to 9f5ca
This change fixes an unsigned underflow when counting valid entries by excluding diagonal and infinite values directly. No concrete risk was found, so it looks safe to merge after normal CI checks.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "Fix count_rows underflow" names the function and the bug class that the change addresses. The raw summary says count_rows now counts only off-diagonal entries that are not double's maximum …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "Fix count_rows underflow" names the function and the bug class that the change addresses. The raw summary says count_rows now counts only off-diagonal entries that are not double's maximum value, and no longer subtracts the row count. That removes the unsigned subtraction that the objectives describe as the cause of the underflow. The title matches the main change, so the check passes.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
A rabbit counts the entries in a row, Skipping the diagonal as it goes. Maximum values do not join the sum, The corrected count is neatly done. Hop, hop, onward through the matrix!
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 5ac49eb8-cd08-47a2-a449-416babd066bf
Commits
Reviewing files that changed from the base of the PR and between 0385ea7 and 9f5ca5f.
Files selected for processing: 1
src/cpp_common/to_postgres.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
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
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.
Summary
Testing
git diff --checkpassed.Summary by CodeRabbit