Skip to content

Conversation

@penelopeysm
Copy link
Member

@penelopeysm penelopeysm commented Nov 24, 2025

Prior to this PR, if you called

sample(model, spl, MCMCThreads(), N, n; check_model=false)

the model checking here

check_model && _check_model(model, spl)

would be correctly skipped. The problem is that this calls AbstractMCMC.mcmcsample, which then calls the single-threaded sample, but the check_model argument is not passed down, so it defaults to true which then checks the model(!!)

This PR fixes it by simply passing check_model=false through. (The point of explicitly setting it to false is that if the user wanted the check, it would be done on the line above already, there's no need to check the model N+1 times.)

The added test fails on main and passes on this PR.

@github-actions
Copy link
Contributor

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

@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.80%. Comparing base (ed7f76c) to head (7a64206).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2721   +/-   ##
=======================================
  Coverage   86.80%   86.80%           
=======================================
  Files          22       22           
  Lines        1455     1455           
=======================================
  Hits         1263     1263           
  Misses        192      192           

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

@penelopeysm penelopeysm merged commit c4a98a5 into main Nov 24, 2025
28 checks passed
@penelopeysm penelopeysm deleted the py/checkmodel branch November 24, 2025 21:48
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