Skip to main content

Module basis

Module basis 

Source
Expand description

Adaptive multimodular basis.

Where the original engine used a fixed 32-prime channel set (a fixed dynamic range that silently aliased on overflow), Basis provisions as many primes as the computation’s height demands (see crate::bounds), then CRT + rational-reconstructs once at the boundary.

All primes live in the open interval (2^15, 2^16). That makes them GPU-eligible: the product of two residues is < 2^32, so the naive WGSL (a*b) % m is safe, and each channel contributes ~16 bits of range.

Structs§

Basis
An ordered, extensible set of pairwise-coprime moduli.

Constants§

PRIME_MAX
Upper bound (exclusive) for basis primes: 2^16.
PRIME_MIN
Lower bound (exclusive) for basis primes: 2^15.