Planning for 2.24 - halfway between releases of Math/Stan/Cmdstan/Stanc3

Hi all,

the last Cmdstan release was about 6 weeks ago and we are now ~6 weeks from the next planned release which is planned to happen on the 20th of July (the 18th is a Saturday). So this seems like a good point to regroup, see where we are at, and also do a last call for starting a project that you wish to get in 2.24.

Ongoing projects:

Disclaimer: I am listing stuff that I am aware of or involved in. There is a huge chance I missed a bunch, so please comment if I did. The list is in no particular order.

  • variadic ODEs

Math parts are under review, Stanc3 part is mostly ready but will need a refresher once the Math parts are finalized. I think the main question here is how to name the new functions.
Relevant PRs:, and @bbbales2 other than names this is mostly down to reviews now right?

  • adjoint ODEs

I am not completely sure on the details here, the math PR is open. Is this planned for 2.24?

  • binary vectorization framework

The core was merged in math. Now extending for complex inputs. There was a bump for exposing some functions that will be resolved with this PR So I think its mostly down to reviews @andrjohns?

  • interpolation

Not sure if this will be ready for the release. A preliminary Math PR is open and a design doc has also been discussed a lot. @pgree do you plan on working on this for 2.24 or the release after that?

  • Lambert_W functions

The math PR is I think ready, we need to then expose it in stanc3 which should be easy then need to add docs.

  • generalization of functions to accept Eigen expressions

That is an ongoing project that will not be finished until 2.24. The PRs in this project have uncovered some deficiencies in our testing that will need to be addressed.

  • static matrices

This is a huge project with some preliminary stuff already open in Math @stevebronder are you targeting 2.24 with preliminary stuff here or the release after that?

  • reverse mode specialization for add and subtract

This PR got stalled before the last release. It would be great to get this in for this one.

  • optimization in stanc3

The optimizations now pass all tests, we need to split them in different levels and add docs and then test it in the wild. @rybern you are mostly waiting on feedback on docs right?

  • OpenCL backend

We added more /prim matrix_cl overloads, the generator is mostly done. We are waiting for static matrices in order to expand the backend to more /rev functions which will be the final jump for the OpenCL backend.

  • minor languages stuff

@rybern is adding support for multiple declarations in one line plus refactoring the array declarations (support vector[2][3, 4] vector_name; ).

@nhuurre is adding support for

real L[K];
real U[K];
vector<lower = L, upper = U>[K] alpha;

This is all mostly awaiting reviews I think.

I am trying to expose unnormalized lpdfs/lpmfs outside of the tilde (~) statements via the _lupdf/_lupmf suffices: I am going to need some help getting this in the Stan manual once it gets merged. Will request for help then.

  • closures

see Closures discussion for all the details on that. Not sure if this is targeting 2.24.

  • profiling

see Proposal for profiling Stan models I fell a bit behind with this. I am planning on having a working version of this next week. We will see in 2 weeks if this has any chance of landing. I will definitely not try to push this in at the last minute.

  • set the number of threads in Cmdstan as a command line argument rather than an environment variable

See Documenting / rethinking environment var STAN_NUM_THREADS Will try to tackle this next week.

I will post the stuff that was already done in the reply to this post. If anyone wants to help with any of the ongoing stuff, you are all very welcome. Also please post any comments/suggestions on the release process.


Projects/larger things that happened since the 2.23 release:

Stan Math:




  • exposed the HMM functions
  • optimization is close to being ready for prime-time
  • pedantic mode
  • exposed reverse() and container construction utilities (linspaced array, identity matrix, etc.)
  • a bunch of bugfixes (MPI map_rect, array initalization, type for loop index,…)

Thanks for the summary Rok! Vectorising the remaining binary functions in math is just waiting on this pull to be reviewed, and adding the signatures is waiting on the stanc3 pull that you mentioned


Thanks @rok_cesnovar.

Yes, I need feedback on documentation at Adding optimization documentation · Issue #193 · stan-dev/docs · GitHub and at Adding Pedantic Mode documentation · Issue #194 · stan-dev/docs · GitHub, and I need to know where these should end up to make a pull request.

By the way, I’ve also started working on adding tuples to the language. That will probably take me at least a couple weeks before I’m ready for review.


is there a chance to see an example of HMM usage in Stan user manual?

The currently exposed signatures are

matrix hmm_hidden_state_prob(matrix, matrix, vector)
int[] hmm_latent_rng(matrix, matrix, vector)
real hmm_marginal(matrix, matrix, vector)

The docs have not been added to the manual yet. The relevant PRs are, and


So this seems like a good point to regroup, see where we are at, and also do a last call for starting a project that you wish to get in 2.24.

Thank you! It is time to do those things.

variadic ODEs - I think this should be able to make it in easily. The math pull request is fully tested and ready for review, and you did all the language stuff. It’s still waiting on the design-doc to be approved (and there are a few decidables that go with that).

adjoint ODEs - Bounce this to 2.25. It is implemented but it’s not obviously fast or good (yet). Needs work.

reverse mode specialization for add and subtract - This one will get replaced by the static matrices. We could just axe it if @anon75146577 is cool with that.


Axe away

Thanks for the list. I’m always amazed at how much is going on when I look at it in this form. I’m very psyched about the binary vectorization and HMMs. If we can push the matrix expressions further, that’s also going to be big, but not as big as immutable matrices. But those aren’t likely to be done in 6 weeks.

1 Like

Thanks for putting this all together Rok!!

Yes this is going to be merged v soon

Would be cool but static matrices will probably not hit till the release after this one

1 Like

Does this mean i should finish off the add/subtract thing?

If it’s not too much work…go ahead and finish is what I would say. The static matrix thing is huge and this pr should give nice speed ups right away.

It’s no real effort. I just got COVID-distracted.

Yeah I’d go for it

for CmdStan, I’d like to try to implement in time for this release - allow users to specify the set of quantiles displayed by bin/stansummary.



Sorry to bother… more distractions? I see the PR still in the list of open ones. Do you need help on this one; so is there a need to find someone to help you finishing this?

Bumping this thread once more.

The plan is to have the feature freeze next Monday midnight anywhere on earth ( And then the release on the 20th of July.

While I think the next release is already looking to have a bunch of very nice features, there are a few projects that would be nice to have that are close to being ready but might require an extension to get them implemented without a ton of time pressure:

  • variadic ODEs

@bbbales2 @wds15 do you have a feeling on whether this is going to come down to the last hours?

  • binary vectorization framework

@andrjohns as far as I understand this is ready (except for exposing in stanc3) but was paused due to the “beta” function name shadowing stuff. Would it make sense to add the rest of them before we settle the shadowing names debate? Just exposing is simple, the harded part would be docing, but that can also be done during the feature freeze (but has to be done for the release).

  • exposing multinomial_logit_lpmf and poisson binomial pmf/rng/cdf/ccdf in stanc3 and adding docs

Any thoughts on moving the release back a week to the 27th and have the feature freeze on the 20th? Or should we stick with the initial plan? I am personally fine either way.

I still have one (math) PR which I’ll be opening in a few hours to handle cases where the inputs are a combination of integer and double/autodiff vectors, since Eigen doesn’t like mixing vectors of different types. Once that’s in, adding the rest of the functions will be pretty quick but I don’t think I’ll get the signatures and tests into stanc3 before the feature freeze

I’m for delaying a week. It will be cramped to get the ODE stuff done by the 13th.

pushing the release back is OK by me.
at what point do we start cutting RC’s and calling for user testing?
how long is the RC test phase? until no (serious) bugs are reported?

these would be great features to have in the release - I’m all for taking the time
to get things correct, documented, and tested.