line trace determinism


i am using the version of physx that is in UE4 21.1 on windows10 64bit. I am making a sort of puzzle game and am building a triangular mesh as the game is played. What i noticed is, when the mesh grows a certain size the line trace results seem to change for the geometry that was there before (the whole mesh is recooked when something is added). Is this expected behavior and is there any way to mitigate it?

If the mesh changes, it will result in a bit different midphase structure. This may result in a different order of triangles that are passed to the line intersection and it might be the case that a different triangle is accepted because of tolerances, which are based on a size.
Anyway could you please check the problem in PVD (PhysX Visual Debugger)? You should see the raycasts there (if PxPvdSceneFlag::eTRANSMIT_SCENEQUERIES is used, I think UE does transmit the scene queries by default). If you could isolate the problem, you can attach it here, so we can take a look.