ARM64 NUDUPL VDF path + cross-platform build/CI fixes#298
Open
ARM64 NUDUPL VDF path + cross-platform build/CI fixes#298
Conversation
Route ARM builds through the C++ NUDUPL squaring loop, guard x86-only codepaths, and update build/CI tooling for better macOS arm64, Linux aarch64, Windows, and workflow reliability. Also document benchmark and fast prover test usage.
emlowe
reviewed
Feb 5, 2026
emlowe
reviewed
Feb 5, 2026
|
|
||
| uint64 actual_iterations=repeated_square_fast(square_state, f, D, L, num_iterations, batch_size, weso); | ||
| actual_iterations = repeated_square_fast(square_state, f, D, L, num_iterations, batch_size, weso); | ||
| #endif |
Contributor
There was a problem hiding this comment.
how about reversing this as well
if defined(ARCH_X64)
do thing
else
do fallback thing
Contributor
There was a problem hiding this comment.
like what was done in vdf_bench.cpp
Member
Author
There was a problem hiding this comment.
Will address the similar issue above which was left in for the same dubious reasons
Select asm objects only for x86_64 builds and invert the squaring path selection so non-x86 targets use NUDUPL by default.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
prover_testto keep CI runtime reasonable.Benchmark (NUDUPL)
On macOS arm64,
./vdf_bench square 5000000reports ~292K iterations/sec (example run:Time: 17123 ms; speed: 292.0K ips).Test plan
cd src && make optimized=1 -f Makefile.vdf-client && ./vdf_bench square 5000000Note
High Risk
Changes the core VDF squaring loop selection and optimizes inner arithmetic routines with thread-local GMP scratch state, which can impact correctness/performance across architectures if any subtle math or lifecycle assumptions are wrong.
Overview
Adds a non-x86 VDF execution path using the C++ NUDUPL implementation and gates the phased/asm pipeline to
ARCH_X86/ARCH_X64only. This includes a newrepeated_square_nuduplloop for ARM/non-x86, plus cross-arch guards in hot math code (vdf.h,vdf_bench.cpp,avx512_integer.h,callback.h) and build system tweaks so non-x86 builds don’t link x86 asm objects.Optimizes and instruments NUDUPL hot loops by reusing thread-local GMP temporaries in
qfb_nuduplandmpz_xgcd_partial, adding optional profiling hooks (chiavdf_profile.h), and improving portability (MSVCclzfallbacks). Test/CI behavior is adjusted with aCHIAVDF_PROVER_TEST_FASTmode forprover_test, expanded macOS arm64 testing, more robust apt installs, and Rust fuzzing changes (per-target matrix + caching + cappedprovefuzz iterations to prevent CI OOM).Written by Cursor Bugbot for commit 41fbbed. This will update automatically on new commits. Configure here.