Skip to content

test dbcache vs maxsigcache sizing - #192

Open
willcl-ark wants to merge 59 commits into
masterfrom
resource-profiling
Open

test dbcache vs maxsigcache sizing#192
willcl-ark wants to merge 59 commits into
masterfrom
resource-profiling

Conversation

@willcl-ark

Copy link
Copy Markdown

test a few dbcache + maxsigcachesize configurations for basic trends

willcl-ark and others added 30 commits July 8, 2026 04:09
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>
- 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
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.
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.
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.
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)
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.
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.
willcl-ark added 15 commits July 8, 2026 04:09
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Benchmark Results

Comparison to nightly master (median of last 7 runs):

  • dbcache=32000MiB, maxsigcachesize=256: 66.6 min
  • dbcache=32000MiB, maxsigcachesize=32: 64.8 min
  • dbcache=32000MiB, maxsigcachesize=512: 65.8 min
  • dbcache=4096MiB, maxsigcachesize=128: 50.8 min
  • dbcache=4096MiB, maxsigcachesize=256: 50.8 min
  • dbcache=4096MiB, maxsigcachesize=32: 50.7 min
  • dbcache=450MiB, maxsigcachesize=128: 50.3 min
  • dbcache=450MiB, maxsigcachesize=32: 49.4 min
  • dbcache=450MiB, maxsigcachesize=8: 48.9 min

View detailed results
View nightly trend chart

@willcl-ark
willcl-ark force-pushed the master branch 6 times, most recently from 34ae8da to f1180c9 Compare July 15, 2026 03:53
@willcl-ark
willcl-ark force-pushed the master branch 5 times, most recently from 53345d8 to 616e2e3 Compare July 24, 2026 04:08
@willcl-ark
willcl-ark force-pushed the master branch 3 times, most recently from a54537e to 3a3f423 Compare July 27, 2026 04:31
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.

1 participant