Three stacked optimizations, each verified bit-exact against the CPU
reference (qp-poseidon-core) by the dual-shader component suite and a
new GPU/CPU parity example:
- mining_u64.wgsl: native 64-bit Goldilocks arithmetic with plonky2-style
lazy reduction, used automatically when the adapter supports
SHADER_INT64 (all Apple Silicon, NVIDIA, modern AMD). mining.wgsl
remains the 32-bit fallback. (+50%)
- Midstate precompute: the first two of five sponge permutations absorb
the header and high nonce half, both constant per batch; they are now
computed once on the CPU (pow_core::mining_midstate) and resumed on
the GPU. Batches are clamped so nonces never carry past 2^256. (+77%)
- Lazy second squeeze: the first squeeze yields the most significant 256
bits of the hash, which decide hash-vs-target unless exactly equal to
the target's high half, so the common reject path skips the final
permutation. (+56%)
Apple M4 throughput: 2.81 -> 11.4 MH/s at the default 1M batch
(criterion large_range_1m/gpu: 355.8ms -> 86.3ms, -75.7%).
Also:
- Fix criterion GPU bench crash: thread-local worker resources are now
tagged with an engine id so multiple GpuEngines per process never mix
devices.
- Fix stale end-to-end test harness (6-binding layout) and run the full
component suite against both shader variants.
- New examples: hashrate, gpu_cpu_parity (25 jobs incl. 2^256-boundary
crossing), gpu_features.
- Add Apple M5 family GPU tiers.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* single hash, new poseidon
* fix build
* new poseidon api
* fmt
* fix race condition with stale jobs being reported
* fmt
* fix deps
* format toml
remove stale comments
---------
Co-authored-by: Nikolaus Heger <nheger@gmail.com>
* implement quic
* simpler names
* simplify worker logic
* simplify gpu configuration logic
* miner initiates and picks random start nonce
* remove mining service
* clean up logs and remove unused engines
* clean up metrics
* metrics fix
* shared worker pool, cpu driven cancellation
just 10x the gpu thru-put, no more batch-size on gpu
* fmt
* non-local git
* taplo derp
* fix the benches
* handle stale results correctly in gpu
* more accurate gpu hashrate
* fmt
* remove unused
* handle duplicate solutions, cli controls gpu cancel frequency
* put plonky2 back
* demote noisy log
* support new pow algo, remove montgomery
* format
* remove redundant check
* use local poseidon until we release
* back to release
* remove unnecessary fxn
* comment out cuda for now
* comment out open-cl
* fix more tests
* remove cuda jobs
- Switch toolchain to stable with clippy and rustfmt components - Clean
up Clippy warnings with inline format args and hygiene fixes - Add GPU
engine placeholders (gpu-cuda, gpu-opencl) in CLI and service - Return
clear runtime error and exit for unimplemented GPU engines - Format all
TOML files with Taplo and ensure taplo fmt --check passes - Improve
mining nonce partitioning for safe range splits - Update tests to pass
cleanly on stable without warnings
Convert repository into Cargo workspace with modular crates
- Split code into workspace members: miner-cli, miner-service, pow-core,
engine-cpu, engine-gpu-cuda, engine-gpu-opencl, metrics - Moved QPoW
math logic into local pow-core crate with compatibility API and
incremental helpers - Defined MinerEngine trait and baseline CPU engine
in engine-cpu crate - Rewrote service layer in miner-service: job
management, HTTP API, engine orchestration - Added CLI binary crate
miner-cli with flags: --port, --num-cores, --metrics-port, --engine -
Implemented runtime toggle for Prometheus metrics exporter enabled only
when --metrics-port provided - Deprecated root src/lib.rs and
src/main.rs with notices pointing to new CLI/workspace entrypoints