Skip to content

[LinearSystem] ConstantSparsityPatternSystem: change key type to support bigger meshes#6067

Open
fredroy wants to merge 1 commit intosofa-framework:masterfrom
fredroy:constantsparsitysystem_fix_indices_overflow
Open

[LinearSystem] ConstantSparsityPatternSystem: change key type to support bigger meshes#6067
fredroy wants to merge 1 commit intosofa-framework:masterfrom
fredroy:constantsparsitysystem_fix_indices_overflow

Conversation

@fredroy
Copy link
Copy Markdown
Contributor

@fredroy fredroy commented Apr 3, 2026

Tried to increase the size of the beam in examples/Validation/cantilever_beam but came accross this error while running with 20x20x100 grid:
[ERROR] [ConstantSparsityPatternSystem(A)] Could not find index -446175222 (row 32074, col 32073) in the hash table
which smelled a lot like an overflow somewhere...

Culprit (thanks Claude) being the key type in the map of ConstantSparsityPatternSystem, which was a sofa::SignedIndex aka int32_t.
The flat index computation row + col * rows() overflows.

So the fix is to change this type to handle bigger values, with a int64_t

[with-all-tests]


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@fredroy fredroy added pr: fix Fix a bug pr: status wip Development in the pull-request is still in progress pr: AI-aided Label notifying the reviewers that part or all of the PR has been generated with the help of an AI pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Apr 3, 2026
@fredroy
Copy link
Copy Markdown
Contributor Author

fredroy commented Apr 3, 2026

[ci-build][with-all-tests]

@fredroy fredroy requested a review from alxbilger April 3, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: AI-aided Label notifying the reviewers that part or all of the PR has been generated with the help of an AI pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant