Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find a proper solution to quadtree integer overflows #2

Open
grtlr opened this issue Dec 11, 2024 · 0 comments
Open

Find a proper solution to quadtree integer overflows #2

grtlr opened this issue Dec 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@grtlr
Copy link
Owner

grtlr commented Dec 11, 2024

The quad tree is currently based on integer boundaries. These can overflow for sufficiently large values, which can happen if the forces make the nodes fly away with a high velocity.

To solve this, we currently clamp the particles to i32::MIN and i32::MAX to prevent that from happening (we use i64 boundaries).

Still, if the user supplies values that are too large the quadtree::cover can crash.

We should fix this overall situation by correctly setting (i.e. clamping) the quad tree boundaries.

@grtlr grtlr added the bug Something isn't working label Dec 11, 2024
@grtlr grtlr changed the title Find a proper solution to the integer overflows in quad tree Find a proper solution to quadtree integer overflows Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant