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

QbvhUpdateWorkspace stack depth change u8 to u16 to prevent overflow #169

Closed
wants to merge 1 commit into from

Conversation

honnisha
Copy link

QbvhUpdateWorkspace stack depth can be more than 255, so I changed u8 to u16.

After this change, I no longer received the error:
attempt to add with overflow
on the line:
workspace.stack.push((child, depth + 1));

Related error:
dimforge/rapier#532

@honnisha honnisha changed the title QbvhUpdateWorkspace stack depth change u8 to u16 QbvhUpdateWorkspace stack depth change u8 to u16 to prevent overflow Oct 15, 2023
@axelmagn
Copy link

axelmagn commented Mar 8, 2024

bump on this? I think it would fix #146, and no discussion for half a year. I just wrote a similar patch before seeing that there's already an open PR.

@sebcrozet
Copy link
Member

Unfortunately, this is not a valid fix. The problem here is that the incremental update tends to make the tree more progressively more degenerate (increasingly deep). Changing the depth type only hides the actual problem.
A fix here needs to rework the way rebalancing is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants