Releases: stan-dev/stanc3
Releases · stan-dev/stanc3
v2.32.0-rc1 (10 April 2023)
Run make format, dune promote
v2.31.0 (21 November 2022)
- Improved the error message for bad multiple declarations. (#1239)
- Fixed a bug where using a C++ reserved word as a name in certain situations would prevent compilation. (#1243)
- Build binaries in parallel on Jenkins. (#1244)
- Added functions
complex_schur_decompose_t()
andcomplex_schur_decompose_u()
implementing the complex-valued Schur decomposition for matrices.(#1247) - Vectorized the
conj
function for complex types.(#1253) - CI change, build backwards-compatible Mac executables on flatiron mac. (#1255)
- Improved the error generated when a function is re-declared, or when a function is not given a definition. (#1256)
print
andreject
will now be listed as functions instanc --info
s output. (#1257)- Added quantile functions (inverse-CDFs)
std_normal_qf
andstd_normal_log_qf
.std_normal_qf
is a synonym forinv_Phi
, andstd_normal_log_qf
is the same but with the input on the log-scale.(#1258) - Fix using
reject()
with container types. (#1261) - Vectorized sampling statements can now be used with the truncation syntax
T[ , ]
(#1263) - Functions which return integer types are considered as "data" for purposes of data-only arguments.(#1265)
- The negation operator
-
can now accept arrays, e.g.array[N] int foo = {...}; print(-foo);
(#1266) - Exposes algebraic functions with a variadic arguments, using the following four functions:
solve_powell
,solve_powell_tol
,solve_newton
andsolve_newton_tol
. Relevant changes to Stan-math are already merged.(#1268)
v2.31.0-rc1 (8 November 2022)
Tagging v2.31.0-rc1
v2.30.1 (27 July 2022)
- Improved the pedantic mode warning for parameters without priors. The message now highlights when it is safe to ignore it.
- Fixed a bug in the memory pattern optimization where a for loop generated for the function inliner would prevent detection of for loops higher in the control flow graph.
- Fixed an issue with the function inliner when a function local variable had the same name as a variable in the calling scope.
- Fixed an issue where recursive functions which called themselves with a slice of their arguments would lead to infinite template expansion in C++ compilation.
- Fixed a bug in stanc.js where the stanc flags were not listed correctly in the generated C++.
- The imaginary components of complex vectors and matrices are now initialized to NaN to match the real component and behaviour of non-complex vectors and matrices.
v2.30.0 (1 July 2022)
Complex:
- Added complex containers:
complex_matrix
,complex_vector
, andcomplex_row_vector
with basic arithmetic support. (#1133) - Fixed indexing of a complex container to return the correct type. (#1158)
- Added many common linear algebra functions and container operations for complex types. (#1166)
- Fixed an issue reading in
complex_matrix
in the data block. (#1168) - Added vectorized signatures for
get_real
andget_imag
, e.g.get_real(complex_matrix) => matrix
. (#1169) - Added
fft
,inv_fft
,fft2
, andinv_fft2
to the language. (#1170) pow
(and subsequently the^
operator) now have overloads for complex containers. (#1186)to_complex
is now vectorized. This means signatures liketo_complex(matrix, matrix) => complex_matrix
are now available. (#1208)- Added signatures for addition, subtraction and division which mix scalars and complex vector types, broadcasting the scalar as appropriate. (#1212)
- Added
svd_U
,svd_V
,singular_values
,eigenvalues_sym
, andeigenvectors_sym
for complex inputs. (#1212)
New functions:
- Added
L1
andL2
norms. (#1140) - Added
log_determinant_spd
which is faster when the input matrix is known to be symmetric and positive definite. (#1178) - Added
wishart_cholesky_lpdf
andwishart_cholesky_rng
distribution functions. (#1188) - Added
multi_student_t_cholesky_lpdf
andmulti_student_t_cholesky_rng
distribution functions. (#1197) - Added
inv_wishart_cholesky_lpdf
andinv_wishart_cholesky_rng
distribution functions. (#1202) - Exposes inv_inc_beta. (#1211)
Misc:
- Re-enabled function inlining optimizations at O1. (#1097)
- Modified the optimizer to turn statements like
3 + 4i
intoto_complex(3,4)
directly. (#1112) - Added
cumulative_sum(Vector/RowVector)
forvar<Matrix>
types. (#1152) - Improved compile times by accumulating all template requirements into a single
require_all_t
on user defined functions. (#1157) - The
--info
and--debug-generate-data
commands now use the Yojson library for it's output. (#1161, #1175) - Bugfixed for output values in
write_array
that should beNaN
. (#1165) --dump-stan-math-signatures
now prints an entire signature on one line, no matter how long it is. (#1167)- Fix --debug-generate-data for ordered vector data types. (#1173)
- Exposed an overload for
cumulative_sum
which takes and returns an array of integers. (#1174) - The javascript interface (stancjs) now generates errors which look more like stanc3's by pointing out where in the supplied code the error occurred. (#1177)
- Cleaned up the internal structuring of modules in the compiler. (#1179)
- Cleaned up code for pretty printing the Middle Intermediate Representation (MIR). (#1180)
- Added
--debug-mem-patterns
flag, which will print out the memory type of variables (either Array of Structs or the more efficient Struct of Arrays pattern) when optimization is enabled. (#1185) - Allowed the adding of new distributions without requiring them to support deprecated suffixes. (#1191)
- Added
eigenvectors
andeigenvalues
functions which return the complex-valued eigenvectors or eigenvalues of a real (asymmetrix) matrix. (#1192) abs
is now vectorized for container types.fabs
is now deprecated, as all usages can be replaced withabs
thanks to array promotion rules. (#1195)- Made installing the developer tools for the Stanc repository an interactive script with error handling. (#1200)
- Internally clean up how variable declarations are represented. (#1203)
- Simplified internal representations in the compiler. (#1204)
- The pretty-printer now preserves multiple declarations in one line like
int a, b;
rather than splitting them into two declarations. (#1207) - Declarations are now allowed in places they previously would not parse, such as the only statement in the body of an if statement. (#1207)
./
,/
.*
, and*
now have consistent behavior with scalar arguments. (#1209)
v2.30.0-rc1
Tagging v2.30.0-rc1
v2.29.2 (25 March 2022)
- Fixed a bug fix with
--O1
when arrays declared in transformed parameters or model were assigned data. - Added missing signatures for
normal_id_glm_lpdf
. - Fixed a compilation error with forward declarations.
- Disabled AD level optimizations in
--O1
optimizations. - MIR pretty printing now always adds ( and ) around the ternary operator ?:
v2.29.1 (5 March 2022)
- Formatting without a | when only one argument is supplied to a distribution.
- Stanc previously would allow you to erroneously assign a function to a different functions name using =, which then failed in C++ compilation. This is now an error.
- Nonlinear transforms of the LHS of a tilde statement now produce warnings in pedantic mode.
- Improved type error messages for operators and tilde statements.
v2.29.0 (14 February 2022)
FEATURES
- Allow most reserved words in C++ (e.g.,
public
) to appear in a stan program; they will be changed by the compiler to_stan_<reserved word>
in the generated C++. (#962) - User defined functions can now be overloaded. Multiple definitions of the same function name are allowed if the arguments are different in each definition.(#1027)
- Improved error messages for incorrect variable declarations. (#1099)
- When an unknown identifier is encountered Stan will suggest nearby known names you might have meant (#1024)
- Extra semicolons in
data
orparameters
no longer produce syntax errors. (#988) - Improved error messages for incomplete probability library calls. (#1021)
- Added nicer error message when a comment is unterminated at end of input. (#1025)
- All internal compiler errors now include a link to the stanc3 issues page. (#1028)
- Improve error messages when a user tries to declare a function argument as a constrained type. (#1030)
- Replaced the use of the word twiddle with tilde in pedantic warning messages. (#1050)
- Allow user-defined densities over complex arguments and deeply nested arguments. (#1046)
- Added optimization layers
--O0
(default),--O1
, and--Oexperimental
- Turn back on allowing immediately assigned to decls not be NaN initialized at
O1
(#1029) - Allows
log_prob_impl
to use Struct of Arrays type for reverse mode autodiff atO1
(#955) - Issue a warning when a user has a model with unreachable statements, such as code following a
return
statement. (#1063) - The compiler can now compile or format standalone function definitions in a
.stanfunctions
file. These are compiled as if a normal Stan program was compiled withstanc3 --standalone-functions
and can be used with#include
statements in thefunctions
block (#1022) - The canonicalizer can now have each part enabled seperately. This can be done with commands like
stanc --auto-format --canonicalize=braces,deprecations <model>
. Current options aredeprecations
,braces
, andparenthesis
. (#1058) - Ensure the canonicalizer properly prints nested if-else statements. (#1055)
--auto-format
no longer prints code which originated from an#include
directive. This can be re-enabled by usingcanonicalize=includes
. (#1069)- When using
--auto-format
, the user can now pass--max-line-length=#
to set the column number at which the formatter will try to break lines. (#1068) - Tweak pretty-printing of if-else blocks. (#1008)
- Canonicalizer now adds brackets around single statements in if-else/for/while. (#1003)
- Expose
bernoulli_logit_glm_rng
functions. (#1034) - lchoose now has the same signatures as binomial_coefficient_log. (#1010)
- Added
ordered_probit_lpmf(array[] int, real, vector) => real
andordered_probit_lpmf(array[] int, real, array[] vector) => real
. (#1073) - Added additional
normal_id_glm
signatures. (#1084) - Added signatures for
inv_erfc
function. (#1090) - Added Differential-Algebraic Equation solver (
dae
,dae_tol
). (#1092) - Added
von_mises_cdf
,von_mises_lcdf
, von_mises_lccdf`. (#1085) - Added
loglogistic_lpdf
,loglogistic_log
,loglogistic_rng
andloglogistic_cdf
. (#1094)
DEPRECATIONS
- Added a warning for
matrix^scalar
that points users to.^
andmatrix_power()
. (#1026) - Warn about the following identifiers being reserved in a future version:
array
,upper
,lower
,offset
,multiplier
. (#1048) - The old form of declaring arrays like
real a[5]
, which has been deprecated since 2.26, now issues a warning. (#1072) - Marked existing syntax deprecations (e.g.,
<-
) as expiring in Stan 2.32.0. (#1044) - Deprecate nested multi-indexing on lvalues as it is inconsistent with rvalues.(#1059)
BUGFIXES
- Fixed an issue that arose during C++ compilation of models that used a variable with the same name as a Stan library function and called that function. (#1011)
- Fixed a bug where the lexer was allowing illegal variable names which began with an underscore. (#962)
- Fixed an issue with parser errors 'sticking around' on subsequent runs, which primarily affected the Javascript compiler. (#1074)
DEVELOPER
- Updated OCaml and build dependencies. (#1019)
- Create internal developer documentation at https://mc-stan.org/stanc3/stanc/. (#1006)
- stan2tfp now lives in a seperate repo at stan-dev/stan2tfp. (#1040)
- Refactored Stan typechecker. (#995)
- Replaces all references to Docker Hub for andrjohns images with stanorg. (#1017)
- Move docker to ci-scripts repository. (#1020)
- Refactored when logic for binaries builds and release. (#1018)
- Added optimization level flags, debug-* and dump-math-signatures flags to stancjs. (#1082)
- Compile Tests and Model end-to-end tests run now optionally only when test/integration/good has changed. (#1018)
v2.29.0-rc2
Tagging v2.29.0-rc2