Skip to content

Conversation

@mhauru
Copy link
Member

@mhauru mhauru commented Oct 23, 2025

A PR to accumulate breaking changes, to be released as v0.42.

@github-actions
Copy link
Contributor

Turing.jl documentation for PR #2702 is available at:
https://TuringLang.github.io/Turing.jl/previews/PR2702/

@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

❌ Patch coverage is 88.23529% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.52%. Comparing base (905f7fa) to head (7835d7f).

Files with missing lines Patch % Lines
src/mcmc/gibbs.jl 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2702      +/-   ##
==========================================
+ Coverage   86.45%   86.52%   +0.06%     
==========================================
  Files          21       21              
  Lines        1418     1410       -8     
==========================================
- Hits         1226     1220       -6     
+ Misses        192      190       -2     

☔ 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.

Following on from:

- TuringLang/AbstractMCMC.jl#182 Adding the
interface function `AbstractMCMC.getstats`
- TuringLang/AdvancedHMC.jl#471 and
TuringLang/AdvancedMH.jl#119 Implementing them
for AdvancedHMC and AdvancedMH

this PR changes Turing's external sampler interface to exclusively use
AbstractMCMC functions. **With this PR, anyone who defines an external
sampler will only need to depend on AbstractMCMC (which they presumably
already do, because it is a sampler) and LogDensityProblems (which is
already a dep of AbstractMCMC).** No need for a Turing extension.

To be precise, it makes the following changes:

- Previously where one had to define `Turing.Inference.getparams`, now
one has to define `AbstractMCMC.getparams`.
- Previously there was no way to include sampler stats in the resulting
chain, now one can define `AbstractMCMC.getstats`.
- The default for `Turing.Inference.isgibbscomponent` is changed to
`true`, so that external sampler packages don't need to override it
(unless absolutely necessary).

As an example implementation, this PR contains a test mock (note how it
doesn't require a Turing dep):


https://github.com/TuringLang/Turing.jl/blob/06752c41a97cd0dc37bb8700ab7a2d06f50f4f76/test/mcmc/external_sampler.jl#L20-L74
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