Skip to content

build: add dashbls runbench target - #8152

Closed
thepastaclaw wants to merge 5 commits into
dashpay:developfrom
thepastaclaw:claw/cj-20261114-204909-dbf6
Closed

thepastaclaw wants to merge 5 commits into
dashpay:developfrom
thepastaclaw:claw/cj-20261114-204909-dbf6

Conversation

@thepastaclaw

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

This applies the requested build-system follow-up from PR #8146. The dashbls benchmark source exists, but the autotools build did not declare dashbls/runbench as a target, so benchmark-enabled builds could not build it through the generated makefiles.

What was done?

Added the dashbls/runbench noinst program to src/Makefile.dashbls.include, guarded by ENABLE_BENCH and !ENABLE_FUZZ. The target lists the benchmark source and utility header, uses the dashbls internal include flags, and links through LIBDASHBLS, which resolves to the vendored blst/libblst.la convenience library in PR #8146 rather than an unrelated system blst.

Requested by knst via PastaClaw.

How Has This Been Tested?

  • Ran ./autogen.sh.
  • Configured a minimal macOS arm64 build with --disable-wallet --without-gui --disable-zmq --disable-tests --disable-fuzz-binary --enable-bench.
  • Verified the generated src/Makefile declares dashbls/runbench, its source/object rules, and the link recipe containing blst/libblst.la.
  • Built make -C src dashbls/runbench successfully.
  • Confirmed the resulting executable links only to system libSystem/libc++ and that the vendored src/blst/.libs/libblst.a contains the blst symbols.

Breaking Changes

None. This only adds the benchmark target when benchmarks are enabled and fuzzing is disabled.

🤖 Generated with Claude Code

PastaPastaPasta and others added 5 commits November 13, 2026 23:10
git-subtree-dir: src/blst
git-subtree-split: 54e6e55674722fc2797ebb4bbb71b26d881eb4b8
Merge commit 'eebe528c66888bda26bb033e70d6d37f9a26b9e8' as 'src/blst'.
Carries depends/patches/blst/no_asm_limbs.patch into the subtree. Upstream
vect.h picks 64-bit limbs on x86_64 and aarch64 even when __BLST_NO_ASM__
asks for the C implementation, and no_asm.h only defines the double-width
llimb_t for 32-bit limbs, so the MSan build (which needs the C code because
MSan cannot see through blst's assembly) does not compile. This is the only
local change to src/blst.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
blst was pinned twice: depends/packages/blst.mk for depends builds and a
copy of the same version, checksum and flags in the CI image for builds
against system libraries (linux64_asan), since no distribution packages
it. Build it from the src/blst subtree instead, as a libtool convenience
library next to dashbls and mimalloc, so the source tree is its only pin.

The build mirrors blst's build.sh: server.c (which #includes the rest of
the C sources) plus build/assembly.S, -fno-builtin, and __BLST_PORTABLE__
for runtime ADX dispatch. configure selects blst's C implementation and
leaves out the assembly on targets other than x86_64 and aarch64, where
blst has none, and with --with-asm=no, which the MSan job already passes
for secp256k1 and now also covers blst.

Drop the depends package, its patch (now carried in src/blst), the CI
image build, and the configure checks for an external libblst. Exclude
src/blst from lints and coverage like the other subtrees.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build the dashbls benchmark as its own autotools target when benchmarks are enabled, excluding fuzz builds. Link it through the vendored dashbls and blst convenience libraries.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@thepastaclaw

Copy link
Copy Markdown
Collaborator Author

Additional validation: ran ./src/dashbls/runbench successfully after the target build; signing, verification, batch verification, and serialization benchmark sections all completed.

@knst
knst marked this pull request as draft November 14, 2026 21:00
@thepastaclaw

thepastaclaw commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator Author

🕓 Review not started yet because this PR is a draft.

  • Request normal review — click when the PR is ready for review.
  • Request priority review — click to move this review to the front of the queue.

Commit f36df56. Normal review starts when eligible; priority review starts as soon as a slot is available.

@knst

knst commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

an overlap check followed by two 16-byte SSE moves.
PrivateKey::Serialize calls blst_lendian_from_scalar, a plain 32-byte copy loop in blst's C code. The disassembly shows it was compiled differently:

  • 1-bench (runbench-1, blst from depends): a byte-at-a-time loop, 32 iterations. Depends builds blst with linux_release_CFLAGS=-O2.
  • 2-bench (runbench-2, blst from src/blst): an overlap check followed by two 16-byte SSE moves. In-tree blst uses $(AM_CFLAGS) plus your configure CFLAGS, which I infer is -O3 from the C++ units (they record -g3 -O0 -O3).

@knst knst closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants