mirror of
https://github.com/luxfi/precompile.git
synced 2026-07-27 03:33:45 +00:00
Align to the latest GPU-dispatch substrate: accel v1.3.1 now resolves the luxgpu pkg-config, gpu v1.1.2 is the libluxgpu binding. Zero API-drift — go build ./... and the full 54-package test link are green. Add precompile/dispatch: the single authority for GPU-batch-vs-CPU dispatch of the crypto/PQ/ZK/curve primitives. It lives in its own package so libluxgpu linkage stays opt-in — the 54 families that do not use the GPU never link the substrate, which also keeps them clear of the crypto _sha256/slhdsa link. A GPU batch kernel may back a precompile only when a parity test here proves it byte-equal to that precompile's CPU oracle; until then the CPU oracle is the single source of truth (consensus determinism). parity_test.go runs the real Metal kernels against the oracles and proves the current divergence (Poseidon2 by construction, BLS12-381 MSM by wire encoding), guarding the wiring decision in one place. No family is wired to a GPU kernel: every signature family diverges by context-binding, host-prehash framing, or partial-vs-full operation, so the CPU oracles and their regression tests stand unchanged and green. Co-authored-by: Hanzo Dev <dev@hanzo.ai>