AABB overlap bugs?

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

AABB overlap bugs?

Postby aitzolmuelas » Wed Jun 03, 2015 7:37 am

I just updated newton to get the fix mentioned in this post

viewtopic.php?f=12&t=8830

which by the way I had previously mentioned in this previous post

viewtopic.php?f=12&t=8809

The thing is, something is not working OK anymore, I assume due to the changes in the Broadphase: I haven't been able to check if more things are broken, but at least I can say the AABB overlap callback is no longer being called for triggers (all my prefiltering for triggers has ceased to work), and now all triggers are triggered by all bodies.
aitzolmuelas
 
Posts: 78
Joined: Wed Mar 25, 2015 1:10 pm

Re: AABB overlap bugs?

Postby Julio Jerez » Wed Jun 03, 2015 9:31 am

how can that be? I thought that part of the code did not change.
the aabb is called for this function.
void dgCollidingPairCollector::AddPair (dgContact* const contact, dgInt32 threadIndex)
can you set break point?

one of the new optimization of eth broad phase if the classify pair in three classes.
1-pair that just meet
2-Pair that are closet but that are moving
3-pair that are touching are no moving.

1) are treated like before, they are joint by a contact joint, and a pair is added to the pair of array
2) if two overlapping are closet and have a joint the they can be simply added to the list with checking that they are overlapping, there is where the huge saying, because now checking if a joint has a contact joint is almost contact time as opposed to before that was linear. but the still get a pair with a material.
3) if the pair has joint and are no moving the only the contact is validated, no nee to add top the pair array.

the other part is that the new broad phase if data parallel so multithreading is block free.
believe of not locks are the major deposable of delay spectrally with fast processor.

I discovered that using the concurrency analyzer that come with Visual studio 12, they trap atomic instruction and register as a block, and I can clear see the code is parallel by is like a many car on a multilane street buy with a traffic light at each corner. now is like many car on a wide high speed highway.

In eh next t few day the next change will be that the pair will no be save on a temp array, it will issue the barrow phase initially.
when profiling larger scene (4000 or more ) the generates up of 30000 pair, and that a lot of memory copy with is also slow with fast processor.

It is possible that with so mane changes I broke something.

Can you reproduce the test in the sandbox? one thong that may help wit the project that you are doing is if you make your own test demo in the sand box and then you can use that are to test bench

In the sand box you can see that some demos look silly like the PuckSlide, that was one user that made a commercial balling game. and that help a lot on testing.



this changes make the new broadphase about twice as fast.
Julio Jerez
Moderator
Moderator
 
Posts: 11043
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: AABB overlap bugs?

Postby aitzolmuelas » Wed Jun 03, 2015 11:16 am

Actually, it's turning out to be more complicated than I first described. The aabb callback is being called, but weird things happen to broadphase: contacts too early or too late, sometimes when no visual contact can be perceived between the AABBS. It seems to depend a lot on the types of body involved.
This is still confusing, so do not bother yet: I will keep on testing and try to reproduce behaviour in the newton sandbox demos (haven't started yet). I will post again when I have something more concise, sorry for blaming the callback before I knew what it was ;P.
aitzolmuelas
 
Posts: 78
Joined: Wed Mar 25, 2015 1:10 pm

Re: AABB overlap bugs?

Postby Julio Jerez » Wed Jun 03, 2015 12:06 pm

aitzolmuelas wrote:I will keep on testing and try to reproduce behaviour in the newton sandbox demos (haven't started yet)

that will be the best to do. also I am completing the serialization so that scene can be exported more easy, the weekend I will add serialization to the managers.

this way you might be able to expert your scene and load in the sandbox, then It can be debugger there. and if you think is some that I can fix you can send it to me for testing.
for now if you add you own test base that will simply thing a lot for everyone.
Julio Jerez
Moderator
Moderator
 
Posts: 11043
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: AABB overlap bugs?

Postby aitzolmuelas » Wed Jun 03, 2015 12:31 pm

I managed to narrow down something for sure: the aabb callback is called, it returns FALSE, and yet the two bodies involved end up generating contact joints somehow (don't know if this is much help, I still have to try to reproduce in newton sandbox).
aitzolmuelas
 
Posts: 78
Joined: Wed Mar 25, 2015 1:10 pm

Re: AABB overlap bugs?

Postby aitzolmuelas » Wed Jun 03, 2015 12:50 pm

To be more specific, the two bodies involved are
- a NewtonCreateKinematicBody with NewtonCollisionSetMode( 0 ) [aka a trigger]
- a NewtonCreateDynamicBody with valid mass (also happens if this is a NewtonCreateKinematicBody with valid mass and NewtonBodySetCollidable( 1 ) )
Also, the contacts remain for some time after the bodies cease to collide (really weird behaviour, if tomorrow I haven't been able to reproduce in sandbox yet, I might try to send you a video of what happens to give a clearer explanation).
aitzolmuelas
 
Posts: 78
Joined: Wed Mar 25, 2015 1:10 pm

Re: AABB overlap bugs?

Postby Julio Jerez » Wed Jun 03, 2015 1:25 pm

Oh I see return false in not abided by the engine.
I will try to test that tonight.
I see if I can make a simple trigger demo with more than on type of triggers.

A video will be nice to see the bug yes.
Julio Jerez
Moderator
Moderator
 
Posts: 11043
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: AABB overlap bugs?

Postby aitzolmuelas » Thu Jun 04, 2015 6:27 am

Not much, but I have narrowed down the appearance of the problems to this commit:

https://github.com/MADEAPPS/newton-dyna ... a6ff6a960d

Ill keep working on trying to reproduce or narrow it further to specific changes
aitzolmuelas
 
Posts: 78
Joined: Wed Mar 25, 2015 1:10 pm

Re: AABB overlap bugs?

Postby aitzolmuelas » Thu Jun 04, 2015 1:16 pm

This is getting weirder and weirder... I have managed to narrow down the problem, but I still cannot understand the sequence of events that causes it: basically, the problem appears when the variable dgContact::m_positAcc is initialised (dgContact.cpp). I know it does not sound right, but I have checked it many times: if I init the value to something greater than the value of m_linearContactError2, like 1.0f, the problems disappear, but I still haven't figured out exactly what is being done with this value.
The problem did not arise earlier because if the value was not initialised in the ctor, it had garbage, which rarely was close enough to zero.
I am glad I have located the 'thing' but I still do not understand why initialising the value to zero breaks stuff for me, and I am really sorry if I am making this very confusing, maybe I am doing something else wrong? I will try to double-check tomorrow, or actually find time to test it in the sandbox.
aitzolmuelas
 
Posts: 78
Joined: Wed Mar 25, 2015 1:10 pm

Re: AABB overlap bugs?

Postby Julio Jerez » Thu Jun 04, 2015 1:37 pm

the best thong is to make a small demo for the sand box
I the add that the demo list and from there you use to reproduce any bug, it saves lot of time
Julio Jerez
Moderator
Moderator
 
Posts: 11043
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: AABB overlap bugs?

Postby aitzolmuelas » Thu Jun 04, 2015 3:24 pm

OK, I just saw you mentioned the function to serialize everything to file, I will try that tomorrow, see if i can get the same results.
aitzolmuelas
 
Posts: 78
Joined: Wed Mar 25, 2015 1:10 pm

Re: AABB overlap bugs?

Postby Julio Jerez » Thu Jun 04, 2015 3:57 pm

yes that a very good idea. what you can ado is that you can add the call backs and then in the demo you make a blank demo that load the serialize scene and the you create you use object.

I can make a exmple fo people using as template.
Julio Jerez
Moderator
Moderator
 
Posts: 11043
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: AABB overlap bugs?

Postby Julio Jerez » Mon Jun 08, 2015 1:02 pm

Ok I was going to commit 3.12 on top of 3.13 but before that I gave another look at the optimization that I made. I believe I found the bug and I fixed , if not, this was a bad bug that may cause the weird behavior you are seeing.

Please see if the committed I made last night fix the estrange bug before doing a drastic measure like rolling back to 3.12
Please try it again, see if works.
Julio Jerez
Moderator
Moderator
 
Posts: 11043
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: AABB overlap bugs?

Postby aitzolmuelas » Tue Jun 09, 2015 5:06 am

I found some errors in my initialization and initial setup of bodies due to some tests I had not cleaned up properly, and the most bizarre behaviours have vanished (sorry for the mess up).
However, I tested the latest revisions (with the fix you mentioned) and I still have the problem where all triggers are triggered by everything, even though most pairs have been filtered in the aabbOverlap callback. I would test some more, but right now I have to get on with something else, so I have been forced to revert to the latest working revision.
I hope I can get back to investigating this ASAP, and sorry again for the confusion :oops:
aitzolmuelas
 
Posts: 78
Joined: Wed Mar 25, 2015 1:10 pm

Re: AABB overlap bugs?

Postby Julio Jerez » Tue Jun 09, 2015 10:30 am

I am so confused now, when I test all the demos in the sand box they all work.
Julio Jerez
Moderator
Moderator
 
Posts: 11043
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Next

Return to Bugs and Fixes

Who is online

Users browsing this forum: Shaderman and 2 guests