vibespatial.spatial.point_grid_index

Reusable dense-cell index for conservative point-tree candidates.

The carrier stores each point exactly once. Predicate queries may consume its cell-aligned bbox superset because an exact predicate immediately refines the relation. Bbox-only queries continue to use the exact Morton path.

Classes

PreparedPointGridIndex

Device-resident point rows grouped into a fixed square grid.

Functions

point_grid_index_kernels()

point_grid_preflight(...)

Inspect grid shape and bytes without building or querying the provider.

prepare_point_grid_index(...)

Build or return the NativeSpatialIndex-owned dense point grid.

point_grid_relation_superset_query(native_index, ...)

Materialize one admitted full relation candidate superset.

point_grid_superset_query(...)

Return cell-conservative pairs for immediate exact refinement.

point_grid_query_row_partitions(...)

Plan query-row slices whose point-grid supersets fit a pair budget.

point_grid_candidate_not_in_other_superset(...)

Mark candidates absent from an aligned point grid's prior superset.

Module Contents

class vibespatial.spatial.point_grid_index.PreparedPointGridIndex

Device-resident point rows grouped into a fixed square grid.

grid_size: int
cache_key: object
precision_plan: object
readiness: object
xmin: float
ymin: float
xmax: float
ymax: float
sorted_tree_rows: object
cell_counts: object
cell_offsets: object
integral_counts: object
property device_bytes: int
vibespatial.spatial.point_grid_index.point_grid_index_kernels()
vibespatial.spatial.point_grid_index.point_grid_preflight(native_index, *, query_count: int, pair_budget: int, force_eligible: bool = False) tuple[vibespatial.spatial.point_partition.PointPartitionPreflight | None, vibespatial.spatial.point_partition.PointPartitionDecline | None]

Inspect grid shape and bytes without building or querying the provider.

vibespatial.spatial.point_grid_index.prepare_point_grid_index(native_index, *, query_count: int = 0, pair_budget: int = 0, force_eligible: bool = False, admission=None) tuple[PreparedPointGridIndex | None, vibespatial.spatial.point_partition.PointPartitionDecline | None]

Build or return the NativeSpatialIndex-owned dense point grid.

vibespatial.spatial.point_grid_index.point_grid_relation_superset_query(native_index, query_bounds)

Materialize one admitted full relation candidate superset.

Relation-producing public APIs are pair-shaped by contract. They retain a single named allocation fence for the exact output capacity, then use the same provenance-bound guarded scatter as bounded reducers.

vibespatial.spatial.point_grid_index.point_grid_superset_query(native_index, query_slice: vibespatial.spatial.point_partition.PointPartitionQuerySlice) vibespatial.spatial.query_types._DeviceCandidates | None

Return cell-conservative pairs for immediate exact refinement.

vibespatial.spatial.point_grid_index.point_grid_query_row_partitions(native_index, query_bounds, *, pair_budget: int, force_eligible: bool = False, admission=None) tuple[vibespatial.spatial.point_partition.PointPartitionQueryPlan | None, vibespatial.spatial.point_partition.PointPartitionDecline | None]

Plan query-row slices whose point-grid supersets fit a pair budget.

Fixed-size row blocks are reduced on-device and cross once as compact planning metadata. Greedy block slices use exact count sums as capacities, so every admitted tile fits pair_budget without a per-tile allocation fence, padded launch, or full row-count export. Oversized blocks are refined down to single-row metadata; consumers then scan those rows in bounded dense tree-row tiles.

vibespatial.spatial.point_grid_index.point_grid_candidate_not_in_other_superset(native_index, prior_plan: vibespatial.spatial.point_partition.PointPartitionQueryPlan, candidate_query_rows, candidate_tree_rows)

Mark candidates absent from an aligned point grid’s prior superset.

This is an internal paired-reduction primitive. Candidate rows refer to two aligned point columns, so candidate_tree_rows can address the geometry owned by flat_index directly. Oversized query rows are marked already seen because their prior reduction scanned every aligned tree row.