rstan icon indicating copy to clipboard operation
rstan copied to clipboard

Compatibility with changes in Stan RNG type

Open andrjohns opened this issue 11 months ago • 1 comments

For the 2.32 -> 2.36+ transition, we need to account for the changes in Stan's rng otherwise CRAN rstan won't build against the next StanHeaders:

Module.cpp:106:21: error: no viable conversion from 'rng_t' (aka 'mixmax_engine<17, 36, 0>') to 'boost::ecuyer1988' (aka 'additive_combine_engine<linear_congruential_engine<unsigned int, 40014, 0, 2147483563>, linear_congruential_engine<unsigned int, 40692, 0, 2147483399>>')
  106 |   boost::ecuyer1988 rng = stan::services::util::create_rng(random_seed, id);
      |                     ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We could workaround this with some very minor changes: diff against CRAN rstan

@bgoodri @hsbadr do those seem reasonable to add as an update to CRAN?

andrjohns avatar Jan 22 '25 15:01 andrjohns

I think so. Stan changing the RNG is probably going to cause a lot of unit test failures in packages that test whether the average of a finite number of MCMC draws is within tolerance of an arbitrary number, but we will just have to open a bunch of PRs about that.

In addition, it seems that Stan-related packages sometimes but not always have build problems under clang++ when configured to use the C23 standard in addition to the C++17 standard. I don't really know why that is happening yet, but we are going to have to figure it out.

bgoodri avatar Jan 22 '25 16:01 bgoodri