vibespatial.constructive.shared_paths

GPU-accelerated shared_paths (binary constructive).

Detects collinear overlapping segments shared between two linear geometries and classifies them as forward (same direction) or backward (opposite direction). Returns a numpy array of Shapely GeometryCollection objects, each containing two MultiLineStrings: [forward_paths, backward_paths].

Architecture (ADR-0033): Tier 1 NVRTC – geometry-specific inner loops iterating all segment pairs across two geometries to detect collinearity and overlap.

Precision (ADR-0002): CONSTRUCTIVE class – stays fp64 on all devices per policy. PrecisionPlan wired through dispatch for observability.

Zero D2H transfers in the hot path. Geometry data stays device-resident; only the final shared segment coordinates (small output) cross the bus for GeometryCollection assembly on host.

Attributes

Functions

shared_paths_owned(→ numpy.ndarray)

Element-wise shared_paths between two OwnedGeometryArrays.

Module Contents

vibespatial.constructive.shared_paths.logger
vibespatial.constructive.shared_paths.shared_paths_owned(left: vibespatial.geometry.owned.OwnedGeometryArray, right: vibespatial.geometry.owned.OwnedGeometryArray, *, dispatch_mode: vibespatial.runtime.ExecutionMode | str = ExecutionMode.AUTO, precision: vibespatial.runtime.precision.PrecisionMode | str = PrecisionMode.AUTO) numpy.ndarray

Element-wise shared_paths between two OwnedGeometryArrays.

Returns a numpy array of Shapely GeometryCollection objects. Each GeometryCollection contains two MultiLineStrings:

  • geoms[0]: forward shared paths (same direction)

  • geoms[1]: backward shared paths (opposite direction)

Supports pairwise (N vs N) and broadcast-right (N vs 1) modes.