MADEAPPS / newton-dynamics

Newton Dynamics is an integrated solution for real time simulation of physics environments.
http://www.newtondynamics.com
Other
936 stars 182 forks source link

4.0 Assert ndArray #258

Closed kklouzal closed 2 years ago

kklouzal commented 2 years ago

image Assert during call to update world. Call stack:

ndNewton_d.dll!dArray<ndBodyKinematic *>::operator[](int i) Line 114 C++ ndNewton_d.dll!ndDynamicsUpdate::Update() Line 2031 C++ ndNewton_d.dll!ndWorld::SubStepUpdate(float timestep) Line 560 C++ ndNewton_d.dll!ndWorld::ThreadFunction() Line 476 C++ ndNewton_d.dll!ndWorldDefaultScene::ThreadFunction() Line 54 C++ ndNewton_d.dll!dThread::ThreadFunctionCallback() Line 111 C++ [External Code]

This was using the latest code commit https://github.com/MADEAPPS/newton-dynamics/commit/21980c1b9638f2d8694081ae08881b00061de3fa

JulioJerez commented 2 years ago

the trace stack does not say much. did this happen is the sandbox demos. My guess is that I probably commit a work in progress

I am trying to add some solver optimization and refactoring, and may that solve has some debug test, but that souel never happens. give me some time to verify that the current commit is right.

kklouzal commented 2 years ago

Yes same error here happens trying to run test cpp. Probably accidently committed a work in progress :) I have gone back to using a previous commit for now.

JulioJerez commented 2 years ago

Ah OK, I will check it out tonight.

On Wed, Dec 8, 2021, 2:55 PM Kyle Klouzal @.***> wrote:

Yes same error here happens trying to run test cpp. Probably accidently committed a work in progress :) I have gone back to using a previous commit for now.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MADEAPPS/newton-dynamics/issues/258#issuecomment-989293409, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6EPJHJPDKUMB2Z7L4AU3DUP7O77ANCNFSM5JS32SLQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

JulioJerez commented 2 years ago

ok I just merged the changes that for the new solver and as I suspected the assert was caused by some debug code I added to compare the result of the new solver to the old solve, I have too, by after commenting it out is not longer happening this code

//xxxx++;
//if (xxxx == 100)
//{
//  const ndArray<ndBodyKinematic*>& x = m_world->GetScene()->GetActiveBodyArray();
//  ndBodyKinematic* body = x[4];
//  body->m_equilibrium = 0;
//  body->m_veloc.m_z = 10.0f;
//}
JulioJerez commented 2 years ago

my guess is that all those other asserts are generated by the solver assuming is running a specific test demo, If you sync the bug should go away.

after you sync you will have to make some changes since I renamed some of the base classes to have the nd prefix instead of teh d which can conflict with some classes in 3.14

kklouzal commented 2 years ago

Yes this has been resolved with the latest sync. Great job thank you!