vibespatial.constructive.measurement

GPU-accelerated area and length measurement kernels.

Tier 1 NVRTC kernels (ADR-0033) for computing geometric area and length directly from OwnedGeometryArray coordinate buffers. ADR-0002 METRIC class precision dispatch: fp32 + Kahan + coordinate centering on consumer GPUs, native fp64 on datacenter GPUs.

Zero host/device transfers mid-process. When data is already device-resident (vibeFrame path), kernels read directly from DeviceFamilyGeometryBuffer pointers with no copy.

Functions

area_expression_owned(owned, *[, source_token])

Compute geometry area as a private device expression.

length_expression_owned(owned, *[, source_token])

Compute geometry length as a private device expression.

area_owned(→ numpy.ndarray)

Compute area directly from OwnedGeometryArray coordinate buffers.

length_owned(→ numpy.ndarray)

Compute length directly from OwnedGeometryArray coordinate buffers.

Module Contents

vibespatial.constructive.measurement.area_expression_owned(owned: vibespatial.geometry.owned.OwnedGeometryArray, *, source_token: str | None = None)

Compute geometry area as a private device expression.

Physical shape: segmented polygon/multipolygon metric reduction to one fp64 device value per source row. Native-backed public geometry.area may export this same vector to a public Series, but native row-flow and grouped reducers consume it before that compatibility boundary.

vibespatial.constructive.measurement.length_expression_owned(owned: vibespatial.geometry.owned.OwnedGeometryArray, *, source_token: str | None = None)

Compute geometry length as a private device expression.

Physical shape: segmented line/ring metric reduction to one fp64 device value per source row. The sanctioned consumers match area expressions: native row-flow and grouped reducers.

vibespatial.constructive.measurement.area_owned(owned: vibespatial.geometry.owned.OwnedGeometryArray, *, dispatch_mode: vibespatial.runtime.ExecutionMode | str = ExecutionMode.AUTO, precision: vibespatial.runtime.precision.PrecisionMode | str = 'auto') numpy.ndarray

Compute area directly from OwnedGeometryArray coordinate buffers.

GPU path uses ADR-0002 METRIC-class precision dispatch. Returns float64 array of shape (row_count,).

Zero host/device transfers mid-process. When owned.device_state is populated (vibeFrame path), GPU kernels read directly from device pointers with no copy.

vibespatial.constructive.measurement.length_owned(owned: vibespatial.geometry.owned.OwnedGeometryArray, *, dispatch_mode: vibespatial.runtime.ExecutionMode | str = ExecutionMode.AUTO, precision: vibespatial.runtime.precision.PrecisionMode | str = 'auto') numpy.ndarray

Compute length directly from OwnedGeometryArray coordinate buffers.

For Polygons, measures the perimeter (all rings including holes). For LineStrings, measures total segment length. Points return 0.0.

GPU path uses ADR-0002 METRIC-class precision dispatch. Returns float64 array of shape (row_count,).

Zero host/device transfers mid-process. When owned.device_state is populated (vibeFrame path), GPU kernels read directly from device pointers with no copy.