zeekay 7c31eb595d thresholdvm: GPU substrate bridge via dlopen+dlsym to mpcvm host launchers
Wires the M-Chain ThresholdVM Go package to per-backend GPU plugins
in lux-private/gpu-kernels/backends/<X>/. Same 3-file pattern as
chains/evm/cevm but with runtime dlopen instead of compile-time
pkg-config. Bridge is a strict positive overlay — never a hard dep.

Files (under thresholdvm/):
- thresholdvm_gpu.go       (cgo)  : dlopen+dlsym; GPUBackend struct with
                                    CeremonyApply, KeyShareApply,
                                    ContributionApply, MPCTransition
- thresholdvm_gpu_nocgo.go (!cgo) : ErrGPUNotAvailable stub mirroring
                                    the cgo type surface
- backend.go               (cgo)  : init() probe — cuda -> hip -> metal
                                    -> vulkan -> webgpu, candidate paths
                                    from LUXCPP_PREFIX +
                                    LUX_PRIVATE_GPU_KERNELS_DIR
- thresholdvm_gpu_test.go         : 4 tests across both build flavors

Symbols (per backend X in {cuda, hip, metal, vulkan, webgpu}):
- lux_<X>_mpcvm_ceremony_apply  (begin/cancel + contribution dedup)
- lux_<X>_mpcvm_ceremony_sweep  (DKG finalize -> key share assignment)
- lux_<X>_mpcvm_compute_leaves  (parallel keccak per slot)
- lux_<X>_mpcvm_compose_root    (serial fold + epoch advance)

Wire structs (GPU- prefix to avoid collision with the domain KeyShare
interface in protocols.go) match ops/mpcvm/cuda/mpcvm_kernels_common.cuh
__align__(16) layouts byte-for-byte. sizeof asserts at package init()
+ TestGPULayoutSizes — any drift fails fast.

Corona = R-LWE threshold sig (active PQ variant per project memory).
Pulsar = threshold ML-DSA. Magnetar = threshold SLH-DSA (not built yet).
Bridge dispatches Corona on CeremonyOp.kind in {Corona DKG, Corona Sign}.

Constraints honored:
- Existing thresholdvm vm.go core paths NOT modified — bridge is opt-in
- Both build flavors compile: go build + CGO_ENABLED=0 go build
- Tests pass: 4/4 under cgo, 4/4 under nocgo, race-clean

Env knobs:
- LUX_THRESHOLDVM_GPU_BACKEND=cuda|hip|metal|vulkan|webgpu|none
- LUX_THRESHOLDVM_GPU_DEBUG=1
- LUXCPP_PREFIX, LUX_PRIVATE_GPU_KERNELS_DIR
2026-06-05 15:00:10 -07:00

Lux Chains

Independent VM plugin binaries for the Lux Network.

Each directory builds to a standalone binary that the Lux node loads as a plugin via --plugin-dir.

Build

make            # build all VMs
make evm        # build one VM
make test       # test all

Install

lpm install evm
lpm install dexvm

Or copy binaries to ~/.lux/plugins/<vmid>.

VMs

VM Chain Purpose
evm C-Chain EVM smart contracts
dexvm D-Chain Decentralized exchange
aivm A-Chain AI/ML inference
bridgevm B-Chain Cross-chain bridge
graphvm G-Chain GraphQL data layer
identityvm I-Chain Decentralized identity
keyvm K-Chain Key management
oraclevm O-Chain Oracle/off-chain data
quantumvm Q-Chain Post-quantum consensus signing (Pulsar)
relayvm R-Chain Cross-chain relay
servicenodevm S-Chain Service node registry
teleportvm T-Chain Unified teleport (bridge + relay + oracle)
thresholdvm (MPC) M-Chain MPC ceremonies (CGGMP21, FROST, Pulsar-general) — bridge custody for external wallets
thresholdvm (FHE) F-Chain FHE compute + TFHE bootstrap-key generation (encrypted EVM)
zkvm Z-Chain Groth16 over BLS12-381 (rolls N × ML-DSA-65 sigs into 192-byte proof)
S
Description
Independent VM plugin binaries for the Lux Network
Readme BSD-3-Clause
21 MiB
Languages
Go 98.2%
C 1.7%
Shell 0.1%