EDIT (2020/07/17): Sub-issue of #13506
See:
https://github.com/RobotLocomotion/drake/pull/13505#pullrequestreview-425063885
@SeanCurtis-TRI Passing the buck to you on this one ;) Feel free to reassign!
\cc @DamrongGuoy @sherm1
Adding @rpoyner-tri to this. Possibly a different problem than #13506 which has fewer moving parts.
I remember something that I saw in FCL long time ago. I mention here in case it is relevant.
I saw these lines in FCL:
NodeType* p = n->parent;
if(p > n)
It compares two pointers p and n. It's inside a function named sort (but it does not look like sorting to me) :
template<typename BV>
typename HierarchyTree<BV>::NodeType* HierarchyTree<BV>::sort(NodeType* n, NodeType*& r)
It is called when we balance the bounding-volume-hierarchy tree in FCL in:
template<typename BV>
void HierarchyTree<BV>::balanceIncremental(int iterations)
I'm not claiming that it definitely causes the non-determinism that we saw. Without spending more time, I cannot understand what the code is doing. Furthermore, I do not know whether it is called by Eric's example.
EDIT(eric): Permalink'd
Interesting -- would definitely cause different behavior with randomized addresses.
BTW I gave @rpoyner-tri a small patch that would protect Drake from FCL's BVH's re-ordering of pairs. (It can be found here). By report, it eliminated some of the problem, but not all of the problem.
My claims are these:
Therefore, I will close this ticket in favor of #13736 and do what I can to sharpen up the remaining tickets.