Skip to content

Conversation

@Zeblote
Copy link
Collaborator

@Zeblote Zeblote commented Jan 29, 2025

If a contact buffer has exactly 256 contacts in it, the endIndex on its last StrideBatch will overflow from 256 to 0, causing it to fail to copy the last batch of contacts but still setting the output count to include it, sending uninitialized garbage data into the solver, which kills the simulation very quickly.

Example of 256 input contacts to the function
image

Corresponding grouped output contacts, note the last group is garbage
image

The root cause is this u8 overflowing back to 0
image

We can fix it easily by using PxU16 instead so it can hold the proper count

cc @PierreTerdiman

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.

1 participant