You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
GC-RANSAC and MAGSAC++ results aren't reproducible: their samplers are seeded from random_device #72
GC-RANSAC's samplers seed their generator from std::random_device (uniform_random_generator.h L47-L53), and HomLib can't pass a seed. So the GC-RANSAC and MAGSAC++ results differ from run to run:
the tests that use them need @retry (27 in test_gcransac_integration.py and test_sampler_scores.py);
benchmark runs aren't repeatable, unlike those with LOMSAC, which takes a seed.
danini/graph-cut-ransac#51 (not merged) adds a process-wide seed. Until then, HomLib could use a fixed copy of uniform_random_generator.h that takes a seed, as #68 does for GCRANSAC.h: the samplers include it as "uniform_random_generator.h" from samplers/, a different directory, so the copy is found first. The seed would then be a setting of HomLib's GC-RANSAC and MAGSAC++, as it is for LOMSAC.
Yes, partly: SupeRANSAC's samplers use a generator with a fixed seed, so they are reproducible, but HomLib's non-minimal step shuffles the inliers with a generator seeded from std::random_device (solver_utils.h), and GC-RANSAC, MAGSAC++ and SupeRANSAC all use it. So SupeRANSAC runs differ too. I'm preparing a PR with a seed setting; SupeRANSAC's settings are its own struct, so for it the seed would go through HomLib's Python wrapper. #73 changes the same lines, so I'll adapt to whichever lands first.
Yes, this one is still open: #68 and #70 fixed crashes, not reproducibility. GC-RANSAC and MAGSAC++ still seed their samplers from std::random_device, and HomLib's non-minimal step still shuffles with an unseeded generator (which affects SupeRANSAC too). I have a PR in progress that adds a seed setting to the three backends; since it touches the same lines as #73 and #76, I'll post it once those settle.
Activity
marcusvaltonen commentedon Nov 9, 2026
SupeRANSAC too right?
f-dy commentedon Nov 9, 2026
Yes, partly: SupeRANSAC's samplers use a generator with a fixed seed, so they are reproducible, but HomLib's non-minimal step shuffles the inliers with a generator seeded from
std::random_device(solver_utils.h), and GC-RANSAC, MAGSAC++ and SupeRANSAC all use it. So SupeRANSAC runs differ too. I'm preparing a PR with aseedsetting; SupeRANSAC's settings are its own struct, so for it the seed would go through HomLib's Python wrapper. #73 changes the same lines, so I'll adapt to whichever lands first.marcusvaltonen commentedon Nov 9, 2026
Any outstanding issues with #68 and #70 are merged?
f-dy commentedon Nov 10, 2026
Yes, this one is still open: #68 and #70 fixed crashes, not reproducibility. GC-RANSAC and MAGSAC++ still seed their samplers from
std::random_device, and HomLib's non-minimal step still shuffles with an unseeded generator (which affects SupeRANSAC too). I have a PR in progress that adds aseedsetting to the three backends; since it touches the same lines as #73 and #76, I'll post it once those settle.GC-RANSAC and MAGSAC++: a seed setting, for reproducible results (#72) (