Skip to content

Fix compile method examples - #1219

Closed
jgabry wants to merge 2 commits into
masterfrom
fix/compile-example-shared-exe
Closed

Fix compile method examples#1219
jgabry wants to merge 2 commits into
masterfrom
fix/compile-example-shared-exe

Conversation

@jgabry

@jgabry jgabry commented Jul 23, 2026

Copy link
Copy Markdown
Member

Submission Checklist

  • Run unit tests
  • Declare copyright holder and agree to license (see below)

Summary

The $compile() example recompiles the CmdStan example model with stan_threads = TRUE. Because pkgdown before building vignettes, the cmdstanr.Rmd vignette then reused that threaded executable and errored when trying to run sampling.

This was always happening, but before #1212 the threading metadata went undetected due to the case-sensitivity bug.

Copyright and Licensing

Please list the copyright holder for the work you are submitting
(this will be you or your assignee, such as a university or company):
Jonah

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses:

jgabry and others added 2 commits July 23, 2026 14:11
The model-method-compile example recompiled the CmdStan example model
examples/bernoulli/bernoulli with stan_threads=TRUE. When pkgdown runs
reference examples (run_dont_run = TRUE) before building vignettes, the
cmdstanr.Rmd vignette then reused that threaded executable and errored
in $sample() because threads_per_chain was not set. Compile a tempdir
copy instead so the shared executable is left unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The `$compile()` example recompiles the CmdStan example model
`examples/bernoulli/bernoulli` with `stan_threads = TRUE`. Because pkgdown
runs reference examples (`run_dont_run = TRUE`) before building vignettes,
the `cmdstanr.Rmd` vignette then reused that threaded executable and errored
in `$sample()`:

> The model executable was built with threading enabled but
> 'threads_per_chain' was not set!

This was always happening, but before #1212 the threading metadata went
undetected due to the case-sensitivity bug, so sampling silently proceeded.
@jgabry jgabry changed the title Fix/compile example shared exe Fix compile method examples Jul 23, 2026
@jgabry jgabry closed this Jul 23, 2026
@jgabry
jgabry deleted the fix/compile-example-shared-exe branch July 23, 2026 22:22
@codecov-commenter

codecov-commenter commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.84%. Comparing base (05d5fa5) to head (b67bae9).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1219      +/-   ##
==========================================
+ Coverage   91.76%   91.84%   +0.08%     
==========================================
  Files          15       15              
  Lines        6252     6244       -8     
==========================================
- Hits         5737     5735       -2     
+ Misses        515      509       -6     

☔ View full report in Codecov by Harness.
📢 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.

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