vibeproj.transcendentals

Hardware-aware transcendental implementation registry and resolver.

The registry describes CUDA implementation variants; it does not contain CUDA source and it does not choose numeric compute precision. Device discovery is lazy so importing vibeproj never imports CuPy or queries a device.

Attributes

Classes

TranscendentalOperation

Operations with independently selectable transcendental strategies.

DeviceCapability

Device facts used by the strategy resolver.

AccuracyContract

Validated error bounds relative to native fp64 execution.

StrategyImplementation

Immutable implementation metadata exposed by registry introspection.

StrategyDecision

Immutable resolved decision, including fallback reason and workload size.

ProjectionImplementation

Resolved implementation for one projection stage.

ExecutionContext

Deeply immutable dispatch plan shared by every stage in one call.

StrategyExplanation

Immutable public explanation for every stage in one transform direction.

Functions

projection_strategy_domain(→ str)

Return the canonical dispatch domain for one concrete projection stage.

projection_strategy_domains(→ tuple[str, Ellipsis])

Return registry domains module-level warm-up must resolve for a target.

normalize_transcendental_policy(→ TranscendentalPolicy)

Validate and normalize a public transcendental policy.

normalize_compute_precision(→ ComputePrecision)

Validate numeric compute precision independently of strategy policy.

list_transcendental_strategies(...)

Return the immutable built-in transcendental strategy registry.

detect_device_capability(→ DeviceCapability)

Lazily describe the current execution device.

resolve_transcendental_strategy(→ StrategyDecision)

Resolve a public policy to an accuracy-qualified implementation.

Module Contents

vibeproj.transcendentals.TranscendentalPolicy
vibeproj.transcendentals.ComputePrecision
vibeproj.transcendentals.NATIVE_LIBDEVICE = 'native.libdevice'
vibeproj.transcendentals.HELMERT_FIXED_Q62 = 'helmert.fixed_q62'
vibeproj.transcendentals.TMERC_FIXED_Q62 = 'tmerc.forward.fixed_q62'
vibeproj.transcendentals.SINU_FORWARD_FIXED_Q62 = 'sinu.forward.fixed_q62'
vibeproj.transcendentals.SINU_INVERSE_CONVERGENT_NEWTON = 'sinu.inverse.convergent_newton'
vibeproj.transcendentals.SINU_INVERSE_MERIDIONAL_RECURRENCE = 'sinu.inverse.meridional_recurrence'
vibeproj.transcendentals.ORTHO_FORWARD_FIXED_Q62 = 'ortho.forward.fixed_q62'
vibeproj.transcendentals.ORTHO_INVERSE_GUARDED_REFRAME = 'ortho.inverse.guarded_reframe'
vibeproj.transcendentals.GNOM_INVERSE_GUARDED_RSQRT_REFRAME = 'gnom.inverse.guarded_rsqrt_reframe'
vibeproj.transcendentals.STERE_INVERSE_FIXED_Q62 = 'stere.inverse.fixed_q62'
vibeproj.transcendentals.GEOS_FORWARD_FIXED_Q62 = 'geos.forward.fixed_q62'
vibeproj.transcendentals.LAEA_FORWARD_POLAR_FIXED_Q62 = 'laea.forward.polar.fixed_q62'
vibeproj.transcendentals.LCC_FORWARD_CONFORMAL_REFRAME = 'lcc.forward.conformal_reframe'
vibeproj.transcendentals.LCC_INVERSE_CONFORMAL_REFRAME = 'lcc.inverse.conformal_reframe'
vibeproj.transcendentals.KROVAK_INVERSE_GUARDED_LOG_RATIO = 'krovak.inverse.guarded_log_ratio'
vibeproj.transcendentals.MERC_FORWARD_ELLIPSOIDAL_PRODUCT_POLY = 'merc.forward.ellipsoidal.product_poly'
vibeproj.transcendentals.MERC_FORWARD_SPHERICAL_PRODUCT_POLY = 'merc.forward.spherical.product_poly'
vibeproj.transcendentals.MERC_INVERSE_EXP_SERIES = 'merc.inverse.exp_series'
vibeproj.transcendentals.PROJECTION_FIXED_Q62_MAX_SCALE_M = 6400000.0
vibeproj.transcendentals.TMERC_FIXED_Q62_MIN_ELEMENTS = 256
vibeproj.transcendentals.HELMERT_FIXED_Q62_MIN_ELEMENTS = 131072
vibeproj.transcendentals.SINU_FORWARD_FIXED_Q62_MIN_ELEMENTS = 524288
vibeproj.transcendentals.SINU_INVERSE_CONVERGENT_NEWTON_MIN_ELEMENTS = 1
vibeproj.transcendentals.ORTHO_FORWARD_FIXED_Q62_MIN_ELEMENTS = 262144
vibeproj.transcendentals.ORTHO_INVERSE_GUARDED_REFRAME_MIN_ELEMENTS = 524288
vibeproj.transcendentals.STERE_INVERSE_FIXED_Q62_MIN_ELEMENTS = 1000000
vibeproj.transcendentals.GEOS_FORWARD_FIXED_Q62_MIN_ELEMENTS = 2097152
vibeproj.transcendentals.LAEA_FORWARD_POLAR_FIXED_Q62_MIN_ELEMENTS = 1048576
vibeproj.transcendentals.LCC_FORWARD_CONFORMAL_REFRAME_MIN_ELEMENTS = 65536
vibeproj.transcendentals.LCC_INVERSE_CONFORMAL_REFRAME_MIN_ELEMENTS = 128
vibeproj.transcendentals.KROVAK_INVERSE_GUARDED_LOG_RATIO_MIN_ELEMENTS = 0
vibeproj.transcendentals.MERC_FORWARD_SPHERICAL_PRODUCT_POLY_MIN_ELEMENTS = 262144
vibeproj.transcendentals.MERC_INVERSE_EXP_SERIES_MIN_ELEMENTS = 65536
vibeproj.transcendentals.projection_strategy_domain(projection: str, direction: str, computed: dict) str

Return the canonical dispatch domain for one concrete projection stage.

vibeproj.transcendentals.projection_strategy_domains(projection: str, direction: str) tuple[str, Ellipsis]

Return registry domains module-level warm-up must resolve for a target.

class vibeproj.transcendentals.TranscendentalOperation

Bases: str, enum.Enum

Operations with independently selectable transcendental strategies.

HELMERT = 'helmert'
PROJECTION = 'projection'
TMERC_FORWARD = 'tmerc.forward'
class vibeproj.transcendentals.DeviceCapability

Device facts used by the strategy resolver.

backend: DeviceBackend
compute_capability: tuple[int, int] | None = None
fp32_to_fp64_ratio: int | None = None
name: str | None = None
device_id: int | None = None
class vibeproj.transcendentals.AccuracyContract

Validated error bounds relative to native fp64 execution.

reference: str
max_horizontal_error_m: float
max_vertical_error_m: float | None = None
notes: str = ''
max_physical_scale_m: float | None = None
class vibeproj.transcendentals.StrategyImplementation

Immutable implementation metadata exposed by registry introspection.

min_elements is the runtime crossover used by "auto" after device, domain, and precision qualification. Explicit "accelerated" requests do not apply that size threshold.

implementation_id: str
operation: TranscendentalOperation
family: str
supported_policies: tuple[TranscendentalPolicy, Ellipsis]
supported_backends: tuple[DeviceBackend, Ellipsis]
supported_compute_capabilities: tuple[tuple[int, int], Ellipsis]
min_fp32_to_fp64_ratio: int | None
supported_compute_precisions: tuple[ComputePrecision, Ellipsis]
min_elements: int
domains: tuple[str, Ellipsis]
accuracy: AccuracyContract
native_fallback: bool
priority: int = 0
class vibeproj.transcendentals.StrategyDecision

Immutable resolved decision, including fallback reason and workload size.

operation: TranscendentalOperation
requested_policy: TranscendentalPolicy
implementation_id: str
family: str
reason: str
fallback: bool
accuracy: AccuracyContract
device: DeviceCapability
domain: str
workload_size: int | None
class vibeproj.transcendentals.ProjectionImplementation

Resolved implementation for one projection stage.

projection: str
direction: str
domain: str
implementation_id: str
class vibeproj.transcendentals.ExecutionContext

Deeply immutable dispatch plan shared by every stage in one call.

precision: ComputePrecision
transcendentals: TranscendentalPolicy
device: DeviceCapability
workload_size: int | None
projection_implementations: tuple[ProjectionImplementation, Ellipsis]
helmert_implementation: str
decisions: tuple[StrategyDecision, Ellipsis]
projection_implementation(projection: str, direction: str, domain: str | None = None) str
class vibeproj.transcendentals.StrategyExplanation

Immutable public explanation for every stage in one transform direction.

requested_policy: TranscendentalPolicy
direction: Literal['FORWARD', 'INVERSE']
device: DeviceCapability
workload_size: int | None
decisions: tuple[StrategyDecision, Ellipsis]
vibeproj.transcendentals.normalize_transcendental_policy(value: str) TranscendentalPolicy

Validate and normalize a public transcendental policy.

vibeproj.transcendentals.normalize_compute_precision(value: str) ComputePrecision

Validate numeric compute precision independently of strategy policy.

vibeproj.transcendentals.list_transcendental_strategies() tuple[StrategyImplementation, Ellipsis]

Return the immutable built-in transcendental strategy registry.

Entries expose stable IDs, hardware/domain/precision qualifications, min_elements crossover thresholds, accuracy contracts, and native fallback behavior. Returning a tuple of frozen dataclasses prevents callers from changing global dispatch policy.

vibeproj.transcendentals.detect_device_capability(xp=None, *, device_id: int | None = None) DeviceCapability

Lazily describe the current execution device.

Passing NumPy (or another host array module) returns a CPU capability without importing CuPy. With no argument, CuPy is imported lazily and the current CUDA device is queried when available.

vibeproj.transcendentals.resolve_transcendental_strategy(operation: TranscendentalOperation | str, policy: TranscendentalPolicy = 'auto', *, device: DeviceCapability | None = None, domain: str = 'global', precision: str = 'fp64', workload_size: int | None = None, _normalized: bool = False) StrategyDecision

Resolve a public policy to an accuracy-qualified implementation.

precision accepts "auto", "fp64", "fp32", or "ds" and remains independent of policy. For policy="auto", a concrete workload_size must meet the selected implementation’s min_elements; None represents compile/explain planning and selects an otherwise qualified implementation. Explicit "accelerated" ignores the workload threshold but returns an observable native fallback when other qualifications are not met.