Bench pr 35215 #35739

pull andrewtoth wants to merge 67 commits into bitcoin:master from bitcoin-dev-tools:bench-pr-35215 changing 51 files +8353 −135
  1. andrewtoth commented at 11:07 PM on July 16, 2026: contributor

    No description provided.

  2. benchcoin: add tooling
    Adds build configuration, benchmarking CI workflows, Python
    dependencies, plotting tools, and documentation for benchcoin.
    
    Co-authored-by: David Gumberg <davidzgumberg@gmail.com>
    Co-authored-by: Lőrinc <pap.lorinc@gmail.com>
    749d1edb09
  3. don't compare to master in prs cc5ded79ab
  4. only run single bins in prs 6692892ac3
  5. rebase at 0100 GMT d2f0c02017
  6. make charts taller abd1664e8d
  7. update machine configs and charts 4c02923795
  8. fix nightly chart display and machine spec detection
    - Fix empty chart: use get_chart_data() instead of to_dict() so JS
      filters can match config strings ("450", "32000") instead of objects
    - Capture machine specs on self-hosted runner during build job and pass
      via --machine-specs flag to nightly append, instead of detecting on
      the ubuntu-latest publish runner
    206c00f719
  9. chart: make chart series dynamic and unique ebe7de65af
  10. rename history file 669dac82a8
  11. use better colours in charts f1d53285c3
  12. don't use inline html e5d485523c
  13. use commit date in chart data points 5b80732c76
  14. use nix flake in both publish workflow steps 3dda5b15b9
  15. fix nightly-history mismatch 00726a4f40
  16. fix instrumented suffixes in reports 13855e7489
  17. add clickable plotly links 62eb3470a5
  18. use corect path in index 1227da1306
  19. use scatter plot for leveldb compaction 3908dbfc7d
  20. add debug logs to artifacts 973d6f5ed1
  21. dynamic charts test a02242d783
  22. fix theme render order 1ae62cb302
  23. add ruff and ty to flake d649425335
  24. support a full IBD PR run 6809a91b40
  25. Generate static debug.log plots during report generation
    Run LogParser + PlotGenerator from bench/analyze.py during artifact
    copying to produce static PNG charts from debug.log files. This
    pre-generates the same 11 chart types that were previously rendered
    client-side via JavaScript.
    
    Changes to report.py:
    - Import HAS_MATPLOTLIB, LogParser, PlotGenerator from bench.analyze
    - _copy_network_artifacts: generate plots after each debug.log with
      "{network}-{name}" prefix (e.g. "450-uninstrumented-pr")
    - _copy_artifacts: generate plots for single-directory mode, including
      when input_dir == output_dir
    - _prepare_graphs_data: add "plots" key with relative paths to PNGs
    - generate(): reorder to copy artifacts before HTML rendering so
      _prepare_graphs_data can find the generated plot files
    
    Plot generation is guarded by HAS_MATPLOTLIB for graceful fallback
    when matplotlib is unavailable.
    4ab35c7e2d
  26. Replace client-side debug.log charts with static images
    The pr-report.html template previously included debug-log-charts.html
    which fetched multi-hundred-MB debug.log.gz files in the browser,
    decompressed them with pako.js, parsed every line, and rendered 11
    Plotly charts client-side. This made report pages unresponsive.
    
    Now that report.py pre-generates the charts as static PNGs:
    - pr-report.html: replace the debug-log-charts.html include with an
      img loop over graph.plots, using loading="lazy"
    - debug-log-charts.html: delete (344 lines of client-side JS)
    - base.html: remove pako.js and Plotly CDN scripts (both are
      independently included by pr-chart.html and nightly-chart.html
      via their own script tags)
    
    The debug.log download link is preserved.
    8254ef15c1
  27. Update bench/README.md to reflect current CLI interface
    Rewrite to document the TOML config + matrix entry workflow,
    removing stale references to the old two-commit comparison CLI,
    --datadir requirement, profiles, and BENCH_DATADIR env var.
    daf2270249
  28. Stop publishing debug.log.gz to gh-pages, link to CI artifacts instead
    Debug logs were consuming 388MB on gh-pages. They are already uploaded
    as CI artifacts with 90-day retention during benchmark runs.
    
    - Remove gzip compression and copying of debug logs in report generation
    - Remove debug log extraction in publish-results workflow
    - Replace per-graph "Download debug.log" links with a single link to
      the CI run page where artifacts can be downloaded
    - Keep matplotlib plot generation from debug logs (plots are still
      generated during report phase, just the raw logs aren't published)
    66c1f835a3
  29. Wait for Pages deployment before commenting on PR
    The PR comment with result links was posted before GitHub Pages
    finished deploying, leading to broken links. Add a wait-for-pages
    job that polls for the pages-build-deployment run matching our
    exact gh-pages commit, then blocks until it completes.
    f749534a41
  30. Sort PR results index numerically instead of lexicographically 201a738c00
  31. set prune height to 1_000_000MB
    Previously, prune=10000 was causing flushes of the UTXO set when block
    pruning was taking please, resulting in logs like:
    
    ❯ zcat 32000-instrumented-pr-debug.log.gz | rg UTXO
    2026-02-12T07:22:57Z * Using 31990.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space)
    2026-02-12T07:28:51Z [warning] Flushing large (2 GiB) UTXO set to disk, it may take several minutes
    2026-02-12T07:33:10Z [warning] Flushing large (3 GiB) UTXO set to disk, it may take several minutes
    2026-02-12T07:37:23Z [warning] Flushing large (4 GiB) UTXO set to disk, it may take several minutes
    2026-02-12T07:42:03Z [warning] Flushing large (4 GiB) UTXO set to disk, it may take several minutes
    2026-02-12T07:46:34Z [warning] Flushing large (5 GiB) UTXO set to disk, it may take several minutes
    2026-02-12T07:51:10Z [warning] Flushing large (6 GiB) UTXO set to disk, it may take several minutes
    2026-02-12T07:55:57Z [warning] Flushing large (7 GiB) UTXO set to disk, it may take several minutes
    2026-02-12T08:00:35Z [warning] Flushing large (8 GiB) UTXO set to disk, it may take several minutes
    2026-02-12T08:05:16Z [warning] Flushing large (8 GiB) UTXO set to disk, it may take several minutes
    2026-02-12T08:10:00Z [warning] Flushing large (8 GiB) UTXO set to disk, it may take several minutes
    2026-02-12T08:14:36Z [warning] Flushing large (8 GiB) UTXO set to disk, it may take several minutes
    2026-02-12T08:16:47Z [warning] Flushing large (8 GiB) UTXO set to disk, it may take several minutes
    
    and generally interrupting benchmarking. Remove this effect by setting
    prune to such a high value it will never trigger.
    
    Prune is **required** to permit us to continue syncing from a pruned
    datadir.
    e00c82f058
  32. Include prune in nightly chart series key 8f20b4025a
  33. Fix numeric sort crash on pr-main directory 25326caa96
  34. Restore debug log extraction for PNG plot generation
    ec9395419a removed debug log copying to stop publishing raw logs to
    gh-pages (388MB). But it also removed the extraction step that makes
    debug logs available during report generation, so matplotlib had no
    input files and PNG charts silently stopped appearing in PR reports.
    
    Restore the copy of debug-logs-${network} artifacts into the results
    directory before report generation. The raw logs are still not committed
    to gh-pages — only the small pre-rendered PNGs in plots/ are.
    c9df434340
  35. use local bitcoin node to test region network issues baf6eb5810
  36. pin nightly benchmark job order: 450 before 32000
    Replace the matrix strategy with explicit sequential jobs so the
    450 benchmark always runs first in a consistent cache state, and
    the 32000 benchmark always runs second.
    bcc34acdd0
  37. run fstrim before each benchmark for consistent SSD performance
    Weekly fstrim.timer on the runner caused a ~25% speedup every Monday
    (Sunday night run). Running fstrim in the prepare script before each
    benchmark ensures consistent write performance regardless of when
    the system timer last ran.
    
    Follows the same suid wrapper pattern as drop-caches.
    38924e0ee7
  38. Revert "use local bitcoin node to test region network issues"
    This reverts commit fd8bdf64ec654c3dbc8677a2bfffa005cbac5ed0.
    c19edd12e9
  39. fstrim the mount point, not a subdirectory
    FITRIM ioctl requires the filesystem mount point. Resolve it from
    the tmp_datadir path by walking up to the mount boundary.
    d52a97db5a
  40. show manual nightly re-runs as scatter points on chart
    Manual (workflow_dispatch) runs are now stored separately from scheduled
    nightly runs. Scheduled runs still dedup by (date, commit, dbcache) to
    handle retries. Manual runs always append, appearing as diamond markers
    on the chart alongside the nightly trend line.
    
    Also ruff format.
    b2218532f6
  41. Compare PR benchmarks against median of last 7 nightly runs f95e18193a
  42. merge manual nightly runs into their series on the chart
    Manual (workflow_dispatch) runs no longer get a separate "(manual)"
    legend entry with diamond markers. They appear as regular points in
    the same series trace as scheduled runs.
    f8e57f3a9f
  43. Add assumevalid=0 benchmark runs to PR workflow
    Adds a separate benchmark job (benchmark-noav) that runs IBD with
    -assumevalid=0 to measure full script verification performance.
    Uses a dedicated TOML config with uninstrumented-only matrix, and
    prefixes artifacts with noav- so the publish workflow can handle
    them alongside existing runs.
    68407e21d8
  44. nix: update flamegraph 3d60b1eeaf
  45. nix: bump nixpkgs 6d3f03d177
  46. bump flakegraph package hashes 7f25b9701e
  47. bump GH actions versions d89bff4a55
  48. Add experiment-driven benchmark runner
    Move benchmark shape into declarative experiment manifests so subjects, profiles, and derived comparisons can change without invasive workflow edits. This gives PR, nightly, and differential flamegraph runs the same high-level interface while keeping the existing build and benchmark phases as implementation details.
    
    Record perf artifacts from instrumented runs and derive flamegraph outputs from the hyperfine cleanup hook. This keeps artifact conversion out of the measured command and gives comparisons a stable raw profile input.
    
    Cut PR and nightly workflows over to experiment output trees and drop active no-assume-valid benchmarking. Historical noav result parsing is left in report generation so old published pages continue to render.
    dbffd39257
  49. Retire matrix benchmark configs
    Make experiment manifests the only public benchmark shape. The old run command, BenchmarkConfig module, and bench/configs TOML files duplicated profile semantics now owned by Experiment.
    
    Introduce RunSpec as the internal contract consumed by BenchmarkPhase. Nightly history now records config snapshots from experiment manifests instead of loading legacy benchmark configs.
    57e775acc7
  50. Add experiment artifact store
    Centralize experiment artifact layout and write artifacts.json so workflows and derivations no longer need to duplicate run directory conventions.
    
    Update PR publish and nightly append workflows to read result, debug, flamegraph, and profile metadata from the artifact manifest instead of hardcoded experiment-output paths.
    f45225cb8b
  51. Split experiment planning from execution
    Make experiment selection produce explicit build, run, and comparison tasks before any execution starts. This keeps validation and filtering separate from the runner and gives dry-run output the same source of truth as real runs.
    
    The runner now consumes the plan directly, which makes profile-scoped comparison derivations explicit and reduces the amount of scheduler logic embedded in execution.
    e7df211964
  52. Replace phase config with environments
    Separate process-level execution settings from benchmark run specs so build, benchmark, and experiment phases no longer depend on the broad Config object.
    
    The CLI still resolves bench.toml, environment variables, and arguments in one place, then hands phases small environment objects with only the flags and paths they need. Build dry-runs now return before saving or restoring git state.
    fccff170d2
  53. Report from experiment artifacts
    Make CI report generation consume artifacts.json directly instead of rebuilding profile inputs as network-named directories. The report model now carries profile metadata through rendering and combined results output.
    
    This removes the old noassumevalid display path and drops the unused multi-network report CLI surface, leaving single-run reports and experiment-manifest reports as the two supported modes.
    43369bb18f
  54. Isolate experiment subject resolution
    Move commit and binary subject handling behind a resolver so the experiment runner executes a plan without also owning subject acquisition policy.
    
    This makes future subject sources, such as prebuilt artifact lookups or named branch refs, a localized change instead of another branch in the runner loop.
    bd59b81b83
  55. Deepen benchmark CI result interfaces
    Move CI-facing result selection into benchcoin so workflow code no longer has to understand artifact manifest internals, profile naming, or report JSON shape. Recording run config snapshots in artifacts keeps dbcache and instrumentation identity local to the experiment output, which makes publishing and nightly history less brittle.
    513034661d
  56. Load experiment artifacts through catalog
    Report generation and nightly history should not know the raw artifacts.json run schema. A typed catalog interface keeps path resolution and manifest field knowledge local to ArtifactStore, so future artifact layout changes have one place to update.
    e3ce1b8175
  57. align times and runs 23c67b929a
  58. Increase nightly benchmark checkout depth
    The nightly benchmark derives the Bitcoin commit by running merge-base against upstream/master. The current benchcoin stack is deeper than the old shallow checkout, so merge-base failed before the experiment could start. Use a bounded but larger fetch depth to keep the job lightweight while covering the current stack.
    db6ebd275e
  59. Report experiment run times by config
    Use experiment config snapshots when formatting PR report labels and summaries so profile-specific bitcoind arguments are visible in published results. This keeps default nightly-comparable runs on the existing comparison path while allowing exploratory matrices without matching nightly baselines to publish their raw run times.
    185c08e088
  60. Darken chart palette for tooltip contrast
    Plotly can render hover and legend text using trace colors on white surfaces. The previous palette included very light entries, especially the lime series, which made labels hard to read.
    
    Keep the existing ten-slot palette and deterministic color indexes, but replace each slot with a darker same-hue color that clears normal text contrast against white.
    ae1f201a43
  61. Update report summary test label
    The report summary formatter now uses config snapshot labels so PR comments preserve dbcache units and any extra bitcoind arguments consistently.
    
    Refresh the CI interface assertion to match that canonical label instead of the older display-only "450 MB" spelling.
    f1180c90f3
  62. test: add shared SipHash vectors
    Add deterministic fixed-width and block-sequence SipHash-2-4 vectors before refactoring the implementation.
    
    Validate the shared JSON with `CSipHasher`, the applicable `PresaltedSipHasher` overloads, and the independent Python implementation.
    Move randomized generic/fixed comparisons to the integer fuzzer.
    
    The later SipHash-1-3-UJ tests can add expected outputs and comparisons to the same inputs.
    Migrating the separate 0-63-byte `siphash_4_2_testvec` incremental-write test to JSON is out of scope.
    
    Co-authored-by: Pieter Wuille <pieter@wuille.net>
    642ec43cfd
  63. refactor: simplify adding SipHash variants
    Make the new SipHash-1-3-UJ construction smaller and easier to verify by extracting the round, normal-block, and finalization logic duplicated across `CSipHasher` and the fixed-width `PresaltedSipHasher` paths.
    The following commits can then focus on the differences from SipHash-2-4.
    
    Co-authored-by: Pieter Wuille <pieter@wuille.net>
    f39a5183ee
  64. crypto: add generic SipHash-1-3-UJ
    Add `SipHasher13UJ`, a block-oriented SipHash-1-3-UJ implementation accepting arbitrarily mixed 64-bit normal blocks and 256-bit jumboblocks.
    Use this generic interface as the executable specification for the fixed-width implementation added next.
    
    Co-authored-by: Lőrinc <pap.lorinc@gmail.com>
    Co-authored-by: Jean-Philippe Aumasson <jeanphilippe.aumasson@gmail.com>
    fe0ec599ca
  65. crypto: add fixed-width SipHash-1-3-UJ
    Add `PresaltedSipHasher13UJ` for one `uint256` jumboblock, optionally followed by one 64-bit normal block.
    Implement these paths directly in the header because the new hasher benefits from inlining, unlike the existing SipHash implementation.
    
    Co-authored-by: Lőrinc <pap.lorinc@gmail.com>
    19782c177b
  66. test: add SipHash-1-3-UJ coverage
    Add SipHash-1-3-UJ expected outputs to the shared vectors and check block-encoding invariants and that the standard and UJ finalizers remain distinct.
    Compare the generic and fixed-width implementations for every overlapping input and fuzz the same equivalence.
    The UJ expected outputs were generated by a reference implementation that Claude Opus 4.8 produced from only the `SipHasher13UJ` class comment.
    
    Co-authored-by: Lőrinc <pap.lorinc@gmail.com>
    813c6177c2
  67. bench: add fixed-width SipHash benchmarks
    Add 32- and 36-byte benchmarks for SipHash-2-4 and SipHash-1-3-UJ after establishing their shared correctness coverage.
    Keep all four measurements together so both fixed shapes can be compared before changing `SaltedOutpointHasher`.
    
    Co-authored-by: Pieter Wuille <pieter@wuille.net>
    fc6c0802dc
  68. coins: use SipHash-1-3-UJ for outpoint hashing
    Switch `SaltedOutpointHasher` to `PresaltedSipHasher13UJ`, accelerating the coins cache and other in-memory outpoint tables while preserving the public wrapper type.
    Its salted outputs are process-local and must not be persisted, serialized, or compared across processes.
    
    Co-authored-by: Pieter Wuille <pieter@wuille.net>
    f22d89a5c6
  69. andrewtoth closed this on Jul 16, 2026

  70. l0rinc commented at 11:21 PM on July 16, 2026: contributor

    You forgot to delete AssumeUTXO and the GUI

Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-07-30 05:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me