Skip to content

Conversation

@VisruthSK
Copy link
Member

Added Stan r-universe and cmdstanr as a dependency so some tests aren't skipped. Didn't touch description, so cmdstanr is not suggested or anything, just added in the builds so a suite of tests aren't skipped. (check in action logs?)

Used in both the R CMD CHECK and coverage actions.

Fixes #398.

@VisruthSK VisruthSK requested a review from jgabry December 8, 2025 03:50
@VisruthSK
Copy link
Member Author

The issue in the vignette (visual-mcmc-diagnostics.Rmd) seems to be a Mac specific error (RNG issue?), not sure why its only being caught on this branch.

@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.13%. Comparing base (21b05b5) to head (7f61302).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #399      +/-   ##
==========================================
+ Coverage   99.09%   99.13%   +0.03%     
==========================================
  Files          35       35              
  Lines        5750     5750              
==========================================
+ Hits         5698     5700       +2     
+ Misses         52       50       -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.

@jgabry
Copy link
Member

jgabry commented Dec 8, 2025

The issue in the vignette (visual-mcmc-diagnostics.Rmd) seems to be a Mac specific error (RNG issue?), not sure why its only being caught on this branch.

Yeah there's a part in that vignette where we want to show some diagnostic plots and we need enough divergences from HMC for the plot to make sense. So we have a check to make sure that happens. The problem is that on different systems the same seed can result in slightly different results (if hardware is different or toolchain is different, etc.). I haven't seen this happen in a while though. We might need to go in and try a different seed here:

fit_cp <- sampling(schools_mod_cp, data = schools_dat, seed = 803214055, control = list(adapt_delta = 0.9))

@jgabry
Copy link
Member

jgabry commented Dec 8, 2025

Added Stan r-universe and cmdstanr as a dependency so some tests aren't skipped.

Seems to still be skipping a test due to not finding cmdstanr:

https://github.com/stan-dev/bayesplot/actions/runs/20016348876/job/57396448626?pr=399#step:7:195

@VisruthSK
Copy link
Member Author

Huh none of them are running, that's strange. I'll look into this

@jgabry
Copy link
Member

jgabry commented Dec 9, 2025

It's also fine to just not use cmdstanr on GHA if this takes a while to figure out. Not the highest priority (if you're looking for things to do I can find other ones if this ends up being a pain). But if you are going to try adding cmdstanr to Suggests like in your latest commit then I think you'll also have to add the Additional_repositories field in the DESCRIPTION file and point it to https://stan-dev.r-universe.dev/.

@VisruthSK
Copy link
Member Author

I think we're getting somewhere though--I think the last Windows run didn't skip any tests and code coverage did increase which I'm thinking (hoping?) is due to those extra tests running.

@VisruthSK
Copy link
Member Author

I was running into an issue with rstan relying on a deprecated boost RNG (l'ecuyer), so for testing I bumped the DESCRIPTION's rstan version to 2.36 and everything works (except for the mac divergence thing)

@VisruthSK
Copy link
Member Author

Seems like using seed = 20251208 for fit_cp worked?

@VisruthSK
Copy link
Member Author

Tests don't seem to be skipped either, is it ok to bump the rstan dependency @jgabry? It should be possible to not update it and just figure out dependencies but it'll be a bit more of a pain. 2.36 is agressive too, just needs to be a version which resolved this issue.

@jgabry
Copy link
Member

jgabry commented Dec 10, 2025

The issue with bumping the RStan version in DESCRIPTION that CRAN only has 2.32.7. We can certainly bump the version to at least 2.32 but I'm not sure if that's sufficient (I guess we could force GHA to use a more recent version as long as we don't require that in DESCRIPTION). What I don't understand is why we're only having this issue with this PR. Other recent PRs passed all checks on GHA without issue. Any ideas?

@VisruthSK
Copy link
Member Author

Oh right I forgot 2.32.7 was the latest CRAN release. Hm. I added the Stan R universe repository so I'm guessing that's changing the generated lockfile and some dependencies are getting pinned to incompatible versions. Should undo the description change and run pak locally to see what versions it pins. I also need to read into what exactly extra-repositories: 'https://stan-dev.r-universe.dev' does to the repos option. We could also just build cmdstanr from source right?

Does the R universe host old versions or just the latest release and devel binaries? If its the latter that's probably the issue since I'd hazard the newest cmdstanr version would force some other packages to be pinned to newer versions too

@jgabry
Copy link
Member

jgabry commented Dec 10, 2025

Does the R universe host old versions or just the latest release and devel binaries? If its the latter that's probably the issue since I'd hazard the newest cmdstanr version would force some other packages to be pinned to newer versions too

I'm not entirely sure, but I think just the latest.

@VisruthSK
Copy link
Member Author

stan-dev/rstan#1152

If a new rstan CRAN version is going to be released that should fix the issues here, but I still not entirely sure why this is only happening now.

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.

Add cmdstanr to GHA workflows

4 participants