Skip to content

Block mala fix#10

Merged
rsenne merged 8 commits into
mainfrom
BlockMALA_fix
May 2, 2026
Merged

Block mala fix#10
rsenne merged 8 commits into
mainfrom
BlockMALA_fix

Conversation

@rsenne
Copy link
Copy Markdown
Owner

@rsenne rsenne commented Apr 29, 2026

This pull request introduces a comprehensive benchmarking framework for ParallelMCMC.jl, including automated CI benchmarking on pull requests, new benchmark scripts, and improved documentation. The main goal is to detect and prevent performance regressions by comparing PRs against the base branch, with clear reporting and failure thresholds. Several code formatting and documentation improvements are also included.

Automated Benchmarking and CI Integration:

  • Added a new GitHub Actions workflow (.github/workflows/Benchmarks.yml) that runs benchmarks on pull requests, compares results to the base branch, and uploads detailed reports. The workflow includes environment setup, separate checkouts for base and PR, benchmark execution, result comparison, and artifact upload.

  • Introduced a regression comparison script (benchmarks/ParallelMCMCBenchmarks/scripts/compare_pr_benchmarks.jl) that compares benchmark results, applies configurable thresholds for warnings and failures, and generates Markdown summaries for CI job outputs.

Benchmark Suite and Documentation:

  • Added a dedicated benchmark suite (benchmarks/ParallelMCMCBenchmarks) with a README describing the PR regression suite, how to run and compare benchmarks locally, and notes about GPU benchmarking.

  • Updated the benchmarks' Project.toml to include the TOML dependency required by the new comparison script.

Documentation and Usability Improvements:

  • Significantly enhanced the main README.md with a project logo, illustrative animation, algorithm description, quickstart guide, and improved contributing instructions.

Code Formatting and Minor Improvements:

  • Reformatted and cleaned up several benchmark scripts for consistency and readability, such as using compact argument lists and fixing minor formatting issues in function calls. [1] [2] [3] [4] [5] [6] [7] [8]
  • Adjusted default test values for trajectory lengths in one benchmark script to use larger values.

These changes collectively establish a robust performance regression framework, improve developer workflow, and enhance project documentation.

Copilot AI review requested due to automatic review settings April 29, 2026 19:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a PR-time benchmarking/regression framework for ParallelMCMC.jl and, alongside that, refactors core MALA/DEER paths to reduce allocations (workspaces, in-place batched primitives) and improve docs/tests around the new behaviors.

Changes:

  • Add a PR regression benchmark suite + scripts and a GitHub Actions workflow to run/compare benchmarks on pull requests.
  • Refactor MALA and DEER internals to use reusable workspaces and add copy_result behavior in DEER.solve to control output aliasing.
  • Expand/adjust tests and documentation to reflect new defaults (e.g., :stoch_diag) and new behaviors (workspace reuse, copy semantics).

Reviewed changes

Copilot reviewed 35 out of 39 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
test/test-Jacobian-Estimator.jl Adds a tagged vector test to validate “x-like” storage defaults and some formatting cleanup.
test/test-GPU-MALA.jl Minor formatting cleanup.
test/test-GPU-DEER.jl Formatting changes to GPU recursion construction and testset layout.
test/test-Deer-vs-MALA.jl Adds tests for workspace result copying/aliasing semantics and formatting cleanup.
test/test-DEERScan.jl Adds a CPU scan correctness testset and tweaks tolerances/formatting.
test/test-DEER-Turing-Logistic.jl Formatting changes and minor refactors in test setup.
test/test-DEER-Interface.jl Adds validation test for unsupported jacobian mode and formatting cleanup.
test/test-Adaptive-MALA.jl Adds tests for the new in-place step API and workspace presence in state.
test/test-AbstractMCMC-Interface.jl Adds tests asserting workspace reuse in AbstractMCMC state.
src/interface.jl Introduces sampler state workspaces, in-place stepping usage, new PR-sampling path, Jacobian mode validation, and additional DEER solve wiring.
src/MALA/MALA.jl Adds/exports in-place step APIs and batched workspaces; refactors mass-matrix ops to in-place forms; adds batched in-place kernels.
src/DEER/DEERScan.jl Refactors scan implementation (less prefix copying, early return) and formatting improvements.
src/DEER/DEER.jl Adds workspace buffers, improves array-copy patterns, updates Hutchinson probe buffer allocation to be “x-like”, and adds copy_result behavior to solve.
docs/src/index.md Adds logo/animation, improves landing page narrative, updates installation snippet and quickstart defaults.
docs/src/assets/make_julia_deer_gif.jl Adds a script to regenerate the landing-page GIF asset.
docs/src/95-reference.md Updates reference layout and adds low-level namespace docs links.
docs/src/91-developer.md Updates local docs build instructions to match CI and simplifies release checklist.
docs/src/90-contributing.md Rewrites contributing guidance for clarity and links to CoC.
docs/src/20-algorithms.md Updates algorithm doc wording and clarifies supported Jacobian modes + copy_result semantics.
docs/src/10-getting-started.md Updates default Jacobian mode in examples and adjusts AD example.
docs/make.jl Updates Documenter repo configuration and HTML settings.
benchmarks/ParallelMCMCBenchmarks/src/runners/mala_runner.jl Updates runner to use in-place stepping + workspace reuse.
benchmarks/ParallelMCMCBenchmarks/src/pr_suite.jl Adds the PR regression benchmark suite module and result writers.
benchmarks/ParallelMCMCBenchmarks/src/models/bayes_logreg.jl Refactors logistic regression model closures toward fewer allocations / buffer reuse.
benchmarks/ParallelMCMCBenchmarks/src/ParallelMCMCBenchmarks.jl Exports and includes the PR benchmark suite module.
benchmarks/ParallelMCMCBenchmarks/scripts/profile_deer_logreg_components.jl Adjusts profiling script formatting and sets copy_result=false for workspace reuse.
benchmarks/ParallelMCMCBenchmarks/scripts/prof_view.jl Formatting and sets copy_result=false for workspace reuse.
benchmarks/ParallelMCMCBenchmarks/scripts/pr_benchmarks.jl Adds CLI runner for the PR benchmark suite (TOML + Markdown outputs).
benchmarks/ParallelMCMCBenchmarks/scripts/new_bench.jl Formatting + sets copy_result=false for workspace reuse.
benchmarks/ParallelMCMCBenchmarks/scripts/compare_pr_benchmarks.jl Adds CI-oriented benchmark comparison + Markdown summary generator.
benchmarks/ParallelMCMCBenchmarks/scripts/bench_mala_bayes.jl Formatting cleanup in benchmark script.
benchmarks/ParallelMCMCBenchmarks/scripts/bench_deer_logreg.jl Updates default T sweep values and formatting improvements.
benchmarks/ParallelMCMCBenchmarks/README.md Adds documentation for the PR regression benchmark suite and thresholds.
benchmarks/ParallelMCMCBenchmarks/Project.toml Adds TOML dependency for result reading/writing.
README.md Major README refresh with images, narrative, and updated quickstart.
.gitignore Ignores benchmark output artifacts and .codex.
.github/workflows/Benchmarks.yml Adds PR benchmark workflow: run base/head benchmarks, compare, upload artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/interface.jl Outdated
Comment thread benchmarks/ParallelMCMCBenchmarks/scripts/pr_benchmarks.jl Outdated
Comment thread docs/src/95-reference.md
Comment thread benchmarks/ParallelMCMCBenchmarks/src/models/bayes_logreg.jl
Comment thread src/DEER/DEER.jl Outdated
Comment thread .github/workflows/Benchmarks.yml
Comment thread .github/workflows/Benchmarks.yml Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

❌ Patch coverage is 84.95146% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.91%. Comparing base (4fc73d4) to head (3599e3f).
⚠️ Report is 32 commits behind head on main.

Files with missing lines Patch % Lines
src/interface.jl 86.36% 24 Missing ⚠️
src/MALA/MALA.jl 85.97% 23 Missing ⚠️
src/DEER/DEER.jl 69.38% 15 Missing ⚠️

❌ Your patch status has failed because the patch coverage (84.95%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (88.91%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #10      +/-   ##
==========================================
+ Coverage   85.01%   88.91%   +3.89%     
==========================================
  Files           4        6       +2     
  Lines         467     1046     +579     
==========================================
+ Hits          397      930     +533     
- Misses         70      116      +46     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rsenne rsenne merged commit a7eafc2 into main May 2, 2026
2 of 5 checks passed
@rsenne rsenne deleted the BlockMALA_fix branch May 2, 2026 01:46
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.

2 participants