-
Notifications
You must be signed in to change notification settings - Fork 365
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
WASM: Some collisions are ignored in Safari #577
Comments
Upon further investigation, it seems that even if I do not use any threads, simply compiling with multiple threads is enough to trigger the issue with Safari. |
I'm sorry, I don't own a Mac so I have no way to help you with this. Maybe I have an idea if you post a movie of the behavior, but this is a long shot. |
physics_jolt.mp4Sure, here is a video. |
If you're running with 0 threads then that rules out any race conditions so it sounds like this is really a problem with the compiler or the browser (most likely the latter if the same thing runs fine on other browsers). This is something that would need to be debugged to see if there is a workaround possible. E.g. do you get to PhysicsSystem::ProcessBodyPair for the chair vs ground and does it find any collisions there. |
Thank you for the feedback; I will start by updating emscripten to the latest version; then start digging into the physics to figure out where it fails; but it does feel like the work could be somehow shared with a "ghost thread" which is not doing the job. |
The error is very vague, can you show what you changed? |
To add to the above; the QuadTree error is happening whenever a body is added (BodyInterface->AddBody); even if the body is but a simple sphere. |
will start corrupting memory when there are more jobs than cMaxJobCount and those jobs will not get executed because in the run you and with cMaxJobs - 1 (not sure if this happens in your case). |
For sure; but as mentioned, it was for testing purpose with a simple environment where I did not expect more than 1024 jobs per barrier. It worked just fine on Chrome but made no difference on Safari. |
The assert that is triggering is part of an integrity check of the tree. It could mean that the tree was corrupted earlier on (e.g. during the Update), but it could also mean that you are sharing bodies between multiple PhysicsSystems (this is not allowed). |
I would have to check again, but I am pretty sure the issue was happening even before the very first update; perhaps I will just run the helloworld example on Safari, see what happens. |
I created a single threaded job system here: https://github.com/jrouwe/JoltPhysics/tree/feature/single_threaded_job_system Perhaps you can try that out. |
If that doesn't help, I suggest we close this ticket as I can't really fix a browser bug. |
Thank you, I will try it out. |
Thanks for testing! |
I am currently using Jolt as part of a C++ engine compiled to WASM (both are compiled together so the cmakelist parameters are identical); which works fine with chrome on windows but I am encountering some issues on mac (M2 chipset):
As mentioned, the issue is only happening on macs, so it might be related to the chipset; although the behavior is quite different between chrome and safari.
Compiling parameters:
The text was updated successfully, but these errors were encountered: