Expand description
Base analyzer and multimodular basis provisioner.
The original module tried to “activate only the primes dividing the natural base” and leave the rest idle to save power. That is mathematically unsound: CRT reconstruction needs all channels, so dropping channels makes the result recoverable only modulo a tiny number — useless.
This reframed dispatcher does the two jobs that are actually well-posed:
- Exactness / base analysis. Report the natural base (LCM of the radicals of the operands’ denominators) and whether a result is exact in a base. This classifies the answer; it never skips arithmetic.
- Basis provisioning. Estimate the result’s bit-height and grow the
Basisso the multimodular pipeline has enough primes to CRT + rational-reconstruct without aliasing.
It also exposes the per-value channel validity mask: the channels whose prime divides a value’s denominator are non-integral at that prime and are excluded from that value’s reconstruction. This is correctness bookkeeping for one number — never a global optimization.
Structs§
- Dispatch
Plan - A plan describing the base structure and basis requirements of an operation.
- Dispatcher
- Analyzes operands and provisions the adaptive basis.