vibespatial.geometry.equality

GPU-accelerated geometry equality operations.

geom_equals_exact: element-wise coordinate comparison with tolerance.

Tier 1 NVRTC kernel for per-pair coordinate comparison (ADR-0033). ADR-0002: PREDICATE class, dual fp32/fp64 via PrecisionPlan.

geom_equals_identical: strict byte-level coordinate equality (tolerance=0).

Delegates to geom_equals_exact with tolerance=0 — no separate kernel.

geom_equals: normalize-then-compare (composes normalize + equals_exact).

Inherits dual-precision from both operations.

Attributes

Functions

requires_mixed_family_topology_fallback(→ bool)

geom_equals_exact_owned(→ numpy.ndarray)

Element-wise geometry equality with tolerance.

geom_equals_identical_owned(→ numpy.ndarray)

Element-wise strict geometry identity (bitwise coordinate equality).

geom_equals_owned(→ numpy.ndarray)

Element-wise topological geometry equality.

Module Contents

vibespatial.geometry.equality.logger
vibespatial.geometry.equality.requires_mixed_family_topology_fallback(left: vibespatial.geometry.owned.OwnedGeometryArray, right: vibespatial.geometry.owned.OwnedGeometryArray) bool
vibespatial.geometry.equality.geom_equals_exact_owned(left: vibespatial.geometry.owned.OwnedGeometryArray, right: vibespatial.geometry.owned.OwnedGeometryArray, tolerance: float, *, dispatch_mode: vibespatial.runtime.ExecutionMode | str = ExecutionMode.AUTO) numpy.ndarray

Element-wise geometry equality with tolerance.

Returns a bool array of shape (row_count,). GPU path compares coordinate buffers directly (no Shapely round-trip). Falls back to Shapely for row count below threshold or when GPU is unavailable.

vibespatial.geometry.equality.geom_equals_identical_owned(left: vibespatial.geometry.owned.OwnedGeometryArray, right: vibespatial.geometry.owned.OwnedGeometryArray, *, dispatch_mode: vibespatial.runtime.ExecutionMode | str = ExecutionMode.AUTO) numpy.ndarray

Element-wise strict geometry identity (bitwise coordinate equality).

Equivalent to geom_equals_exact(..., tolerance=0) — delegates to the same NVRTC kernel infrastructure with zero tolerance.

Returns a bool array of shape (row_count,). Null geometries always compare as False (Shapely convention).

vibespatial.geometry.equality.geom_equals_owned(left: vibespatial.geometry.owned.OwnedGeometryArray, right: vibespatial.geometry.owned.OwnedGeometryArray, *, dispatch_mode: vibespatial.runtime.ExecutionMode | str = ExecutionMode.AUTO) numpy.ndarray

Element-wise topological geometry equality.

For same-family pairs, topological equality is implemented as structural equality after normalization. Mixed-family valid pairs, such as Polygon vs single-part MultiPolygon, require the full Shapely topology path.

Both sub-operations have GPU paths, so the full pipeline runs on device when GPU is available. Zero D2H transfers until the final bool array is returned by geom_equals_exact_owned.

Returns a bool array of shape (row_count,). Null geometries always compare as False (Shapely convention).