Fix Warp mesh Poisson residual conflicts#1666
Conversation
0feb1a6 to
c47250d
Compare
Greptile SummaryThis PR adds a post-pass conflict-pruning step to the Warp mesh Poisson disk sampler: after dart throwing completes, it rebuilds the hash grid over all accepted points and launches
Important Files Changed
Reviews (1): Last reviewed commit: "Fix Warp mesh Poisson residual conflicts" | Re-trigger Greptile |
| while wp.hash_grid_query_next(query, neighbor_idx): | ||
| if neighbor_idx >= sample_idx: | ||
| continue | ||
| if neighbor_idx >= accepted_positions.shape[0]: | ||
| continue | ||
|
|
||
| neighbor_radius = accepted_radii[neighbor_idx] | ||
| min_radius = wp.min(sample_radius, neighbor_radius) | ||
| if _points_too_close( | ||
| sample_position, | ||
| accepted_positions[neighbor_idx], | ||
| min_radius, | ||
| ): | ||
| accepted_alive[sample_idx] = 0 | ||
| return |
There was a problem hiding this comment.
Transitive over-pruning due to missing alive check on neighbors
The kernel never checks accepted_alive[neighbor_idx] before deciding to kill sample_idx. Every thread starts with all entries equal to 1 (from torch.ones), so in a chain A (idx=3) → B (idx=5) → C (idx=7) where A–B and B–C are both too close but A–C are not: thread 5 kills itself (conflict with 3), and thread 7 also kills itself (conflict with 5) — even though 5 will be removed and C is actually valid. The fix would be to add if accepted_alive[neighbor_idx] == 0: continue before the _points_too_close call, but a single parallel pass cannot see writes from sibling threads; correcting this correctly requires iterating the kernel until no more kills occur, or performing the pruning serially.
|
/blossom-ci |
|
@ktangsali could you take a quick look at this RC bug fix? It hardens the Warp mesh Poisson sampler against residual pair-distance conflicts. |
| while wp.hash_grid_query_next(query, neighbor_idx): | ||
| if neighbor_idx >= sample_idx: | ||
| continue | ||
| if neighbor_idx >= accepted_positions.shape[0]: | ||
| continue | ||
|
|
||
| neighbor_radius = accepted_radii[neighbor_idx] | ||
| min_radius = wp.min(sample_radius, neighbor_radius) | ||
| if _points_too_close( | ||
| sample_position, | ||
| accepted_positions[neighbor_idx], | ||
| min_radius, | ||
| ): | ||
| accepted_alive[sample_idx] = 0 | ||
| return |
c47250d to
ea27f61
Compare
|
/blossom-ci |
Prune residual accepted-point conflicts before returning Warp mesh Poisson samples.