Skip to main content

Module gpu_numeric

Module gpu_numeric 

Source
Expand description

Fixed-point numeric validation and calculation on the GPU via wgpu.

WGSL uses portable u32 wide multiply/divide (no i64), which Metal’s Naga path does not accept. Interest uses divisor 365 * 10_000 so that values scaled ×100 with rate in basis points match simple interest in the same scale as principal * rate_bp * days / (365 * 10000) in fixed-point arithmetic.

Structs§

GpuNumericEngine
Owns a wgpu device, queue, and compiled numeric compute pipeline.
NumericOutput
One output row per NumericRule (16-byte stride for WGSL storage arrays).
NumericRule
One row of input for the numeric compute shader (fixed-point ×100 on the wire).

Enums§

GpuErrorCode
Error codes returned per row from the compute shader (mirrors WGSL constants).
NumericRuleKind
Discriminant for NumericRule::rule_kind (must stay in sync with WGSL).