mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2026-10-17 11:45:43 +08:00
Summary: `TestICP.test_heterogeneous_inputs` has been failing intermittently for a long time. The seed was already bumped from 4 to 14 in D80625966 for the same reason, which relocated the failure rather than removing it. Root cause: the test aligned two independent random point clouds, and with `estimate_scale=True` that problem is ill-posed. ICP almost always collapses `X` onto a single point of `Y`, driving `s` to ~1e-16 and the rmse to zero. That solution fits perfectly, but the rotation of a cloud that has shrunk to a point is completely unconstrained, so the batched run and the per-cloud runs each returned an arbitrary, and different, `R`. Over 600 seeds of the old data ~45% of batch elements collapsed, and every element that exceeded the tolerance was a collapsed one, with `R` the only quantity that disagreed (`T`, `s` and `Xt` always matched). This is the same non-uniqueness that `corresponding_points_alignment` warns about with "Excessively low rank of cross-correlation". Which seeds tripped over it came down to float32 rounding: the batched path sums over the zero-weighted padding and the per-cloud path does not, so the two differ by ~1e-7, and that difference decides which arbitrary rotation comes out. It therefore moves with GPU model, BLAS version and TF32, which is why picking a seed was never a fix - forcing TF32 on makes seed 14 fail immediately. Fix: build `Y` as a rigidly moved copy of `X` plus a few extra points. The clouds still have different sizes within a batch and between `X` and `Y`, so the padding and masking path is exercised exactly as before, but the alignment now has a well-determined optimum that ICP cannot collapse. Also loosen `atol` from 1e-5 to 1e-4. That is needed independently of the collapse: the two runs sum a different number of terms and so round differently, and the legitimate deviation on `Xt` reaches 1.17e-5, above the old tolerance. That was a second latent failure waiting to happen. The test no longer emits the "Excessively low rank of cross-correlation" warning, which is the collapse disappearing. ___ Differential Revision: D117539518 fbshipit-source-id: 73e3d70a8f7547de7179b71e6a705fc37f4920c7