vibespatial.spatial.query_types

Attributes

Exceptions

CandidateRelationCapacityError

A concrete candidate relation cannot fit in device memory.

Classes

SpatialQueryExecution

RegularGridPointIndex

DeviceSpatialJoinResult

Device-resident spatial join index pairs (Phase 2 zero-copy overlay).

SpatialJoinIndices

ADR-0042: Typed contract for low-level spatial kernel index output.

Functions

available_device_memory_bytes(→ int | None)

Return bytes remaining in the active query allocation envelope.

require_device_candidate_pair_capacity(→ int)

Admit pair output and scratch against reserved currently free memory.

validate_device_candidate_error_flags(→ None)

Fail closed once after all ordered guarded scatters have completed.

Module Contents

vibespatial.spatial.query_types.SUPPORTED_GEOM_TYPES
exception vibespatial.spatial.query_types.CandidateRelationCapacityError

A concrete candidate relation cannot fit in device memory.

vibespatial.spatial.query_types.available_device_memory_bytes() int | None

Return bytes remaining in the active query allocation envelope.

vibespatial.spatial.query_types.require_device_candidate_pair_capacity(total_pairs: int, *, relation_name: str, device_capacity_bytes: int | None = None, temporary_bytes: int = 0) int

Admit pair output and scratch against reserved currently free memory.

vibespatial.spatial.query_types.validate_device_candidate_error_flags(error_flags: Any, *, reason: str = 'device candidate post-launch fault validation planning packet') None

Fail closed once after all ordered guarded scatters have completed.

class vibespatial.spatial.query_types.SpatialQueryExecution
requested: vibespatial.runtime.ExecutionMode
selected: vibespatial.runtime.ExecutionMode
implementation: str
reason: str
class vibespatial.spatial.query_types.RegularGridPointIndex
origin_x: float
origin_y: float
cell_width: float
cell_height: float
cols: int
rows: int
size: int
class vibespatial.spatial.query_types.DeviceSpatialJoinResult

Device-resident spatial join index pairs (Phase 2 zero-copy overlay).

Holds left and right index arrays as CuPy int32 device arrays, eliminating the D->H->D round-trip when both sides of an overlay have owned (device-resident) geometry backing.

Use to_host() when host-side numpy arrays are needed (e.g., for pandas attribute assembly or Shapely fallback paths).

d_left_idx: Any
d_right_idx: Any
sorted_by_left: bool = False
left_to_host(*, reason: str = 'device spatial join left-index crossed to host for public index export') numpy.ndarray

Copy left index array to host as a numpy int32 array.

right_to_host(*, reason: str = 'device spatial join right-index crossed to host for public index export') numpy.ndarray

Copy right index array to host as a numpy int32 array.

to_host() tuple[numpy.ndarray, numpy.ndarray]

Copy index arrays to host as numpy int32 arrays.

property size: int

Number of index pairs.

class vibespatial.spatial.query_types.SpatialJoinIndices

ADR-0042: Typed contract for low-level spatial kernel index output.

Device-native workflows may carry richer result objects, but the low-level spatial-query seam still uses integer index arrays. This frozen dataclass enforces that dtype invariant at construction time.

left: numpy.ndarray
right: numpy.ndarray
classmethod from_raw(left, right) SpatialJoinIndices

Validate and coerce raw arrays into the canonical index form.