vibespatial.constructive.make_valid_gpu¶
GPU-resident make_valid batch repair pipeline (ADR-0019 + ADR-0033).
Phase 16: Batch repolygonization. All invalid polygons are collected into one contiguous batch and processed through the GPU repair pipeline together, eliminating the per-polygon Python loop. shapely.polygonize and shapely.make_valid are no longer used in the primary GPU path.
- Pipeline stages (batched across invalid polygon rows):
Phase A: capacity-backed ring closure, duplicate removal, and orientation Phase B: canonical OGC device validity rowset Phase C: shared overlay sweep, streamed split events, and complete-row paging Phase D: positive bounded-face polygonization and sparse repaired-row scatter Phase E: native area/lower-dimensional composition for terminal export
All kernels use fp64 compute (CONSTRUCTIVE class per ADR-0002). Tier 1: NVRTC for geometry-specific work. Tier 3a: CCCL for scan/sort/compact. Tier 2: CuPy for element-wise ops.
Attributes¶
Classes¶
Complete device-resident result of GPU make_valid repair. |
Functions¶
|
GPU-resident batch repair of invalid polygon geometries (Phase 16). |
Module Contents¶
- vibespatial.constructive.make_valid_gpu.cp = None¶
- class vibespatial.constructive.make_valid_gpu.GPURepairResult¶
Complete device-resident result of GPU make_valid repair.
- repaired_owned: vibespatial.geometry.owned.OwnedGeometryArray | None¶
- repaired_count: int¶
- gpu_phases_used: tuple[str, Ellipsis]¶
- vibespatial.constructive.make_valid_gpu.gpu_repair_invalid_polygons(owned: vibespatial.geometry.owned.OwnedGeometryArray, invalid_rows: object, geometries: numpy.ndarray | None = None, *, method: str = 'linework', keep_collapsed: bool = True) GPURepairResult | None¶
GPU-resident batch repair of invalid polygon geometries (Phase 16).
Implements the full make_valid pipeline on GPU with batch processing: 1. Collect invalid polygon coordinates into a device repair batch. 2. Normalize rings through capacity-backed closure/dedup/orientation. 3. Select still-invalid rows with the canonical OGC validity expression. 4. Polygonize those rows through shared paged overlay topology. 5. Merge valid repaired rows back into original logical order on device.
When
owned.device_stateis available, the coordinate pipeline and its compact logical/family rowsets stay device-resident. The result carries a completerepaired_ownedarray so callers can stay on device (ADR-0005).Returns None if GPU repair is not applicable (no GPU, no polygon families, or CuPy not available).
Parameters¶
owned : OwnedGeometryArray with device_state invalid_rows : indices of invalid rows to repair geometries : optional shapely geometry array (unused in device path) method : repair method (only “linework” supported on GPU) keep_collapsed : whether to keep collapsed geometries