Closed WardBrian closed 1 week ago
That would be nice where it's possible. I wonder if there is a linter rule we could turn on, because enforcing it manually seems impossible to do consistently.
Thank you for the fast fix!
Name | Old Result | New Result | Ratio | Performance change( 1 - new / old ) |
---|---|---|---|---|
arma/arma.stan | 0.31 | 0.29 | 1.06 | 5.63% faster |
low_dim_corr_gauss/low_dim_corr_gauss.stan | 0.01 | 0.01 | 1.18 | 15.17% faster |
gp_regr/gen_gp_data.stan | 0.02 | 0.02 | 1.02 | 1.94% faster |
gp_regr/gp_regr.stan | 0.09 | 0.09 | 1.05 | 5.0% faster |
sir/sir.stan | 68.64 | 69.81 | 0.98 | -1.69% slower |
irt_2pl/irt_2pl.stan | 3.87 | 3.97 | 0.98 | -2.45% slower |
eight_schools/eight_schools.stan | 0.06 | 0.06 | 1.01 | 1.38% faster |
pkpd/sim_one_comp_mm_elim_abs.stan | 0.25 | 0.25 | 1.0 | -0.41% slower |
pkpd/one_comp_mm_elim_abs.stan | 19.18 | 19.7 | 0.97 | -2.71% slower |
garch/garch.stan | 0.42 | 0.45 | 0.94 | -6.6% slower |
low_dim_gauss_mix/low_dim_gauss_mix.stan | 2.66 | 2.6 | 1.02 | 2.18% faster |
arK/arK.stan | 1.78 | 1.75 | 1.02 | 1.57% faster |
gp_pois_regr/gp_pois_regr.stan | 2.9 | 2.78 | 1.04 | 4.27% faster |
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan | 8.69 | 8.41 | 1.03 | 3.22% faster |
performance.compilation | 181.06 | 178.74 | 1.01 | 1.28% faster |
Mean result: 1.0213906121792329
Jenkins Console Log Blue Ocean Commit hash: 5d05984ce6b87a1c09f4a75b73535b72bc57f54b
Summary
Reported by @tillahoffmann on the forums: https://discourse.mc-stan.org/t/debugging-gp-matern32-cov/35502.
One of the overloads of
gp_matern32_cov
was usingx_size
to index over a variable that actually had lengthl_size
. Presumably a copy/paste error.Tests
I added a minified version of their reproducer. The behavior is undefined in the bug case, so unfortunately the test is not guaranteed to fail on all systems if the bug is re-introduced.
Side Effects
None
Release notes
Fixed an indexing bug inside gp_matern32_cov
Checklist
[x] Copyright holder: Simons Foundation
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
[x] the basic tests are passing
./runTests.py test/unit
)make test-headers
)make test-math-dependencies
)make doxygen
)make cpplint
)[x] the code is written in idiomatic C++ and changes are documented in the doxygen
[x] the new changes are tested