instance_id stringlengths 10 65 | repo stringlengths 5 59 | pr_number int64 1 313k | task_type stringclasses 1
value | base_commit stringlengths 40 40 | review_commit stringlengths 40 40 | title stringlengths 2 282 | body stringlengths 7 3k | patch stringlengths 202 204k | n_defects int64 1 72 | n_supported int64 1 65 | n_major int64 0 32 | defects stringlengths 140 18.8k | certifier_count int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
stan-dev__math__2743 | stan-dev/math | 2,743 | defect | 3074aa7abeca69acbf1e5cd9da3899584fdd0cda | ff89be9c9796e87a5d95c5879f6e0e691ec2b75c | From issue #2739, add new function stan::math::gradient | ## Summary
Add new function ``stan::math::gradient`` into rev/functor, which stores the evaluated gradient into an array. The other function stores the evaluated gradient into a ``Eigen::VectorXd``. These two functions have different signatures, based on the type in which the gradient is stored, and so shouldn't c... | diff --git a/stan/math/rev/functor/gradient.hpp b/stan/math/rev/functor/gradient.hpp
index df736cab4cd..e1d8e9a011a 100644
--- a/stan/math/rev/functor/gradient.hpp
+++ b/stan/math/rev/functor/gradient.hpp
@@ -5,6 +5,7 @@
#include <stan/math/rev/core.hpp>
#include <stan/math/prim/fun/Eigen.hpp>
#include <stdexcept>
+... | 3 | 3 | 0 | [{"id": "G0", "claim": "Use `x_var.coeff(i)` instead of `operator[]` to avoid the bounds check that the surrounding code already performs manually.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new tests should use std::vector instead of plain ... | null |
stan-dev__math__2744 | stan-dev/math | 2,744 | defect | 7faf9284ec604e36b7b38a23057285c8ec61304f | 2014d9d6a4a6d35289dda1495e1ceb5e86120fbb | Add `std_normal_log_qf` as prob function | ## Summary
Adds the quantile function of the standard normal density function with log input. This is an alternative pr to #2731 and puts the files in the `prob` folder. New folders are created for `rev` specialties of `prob` functions in `stan -> math -> rev -> prob` (and in the `fwd` folder) and their tests.
#... | diff --git a/stan/math/fwd.hpp b/stan/math/fwd.hpp
index 7f30955b0f2..3bab5be267f 100644
--- a/stan/math/fwd.hpp
+++ b/stan/math/fwd.hpp
@@ -11,6 +11,7 @@
#include <stan/math/fwd/meta.hpp>
#include <stan/math/fwd/fun.hpp>
#include <stan/math/fwd/functor.hpp>
+#include <stan/math/fwd/prob.hpp>
#include <stan/math/... | 8 | 8 | 3 | [{"id": "G0", "claim": "The test/unit/math/prim/prob/std_normal_log_qf_test.cpp fails in CI although it passes locally, and the cause needs to be found and fixed.", "category": "testing", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "The fwd derivative would be more numericall... | null |
stan-dev__math__2767 | stan-dev/math | 2,767 | defect | 882cd229970f098ca078cb5b87873967dc94698f | 38f01cf9619e6d08d7bdd7704fba4522d9f12edd | Numerically Stable gamma_lcdf Gradients | ## Summary
This PR adapts the improved `gamma_p` gradients from #780 for use with `gamma_lcdf`, to improve stability of estimation with large inputs.
## Tests
New `mix/prob` tests added for a range of inputs
## Side Effects
N/A
## Release notes
Improved numerical stability of `gamma_lcdf` gradients... | diff --git a/stan/math/prim/prob/gamma_lcdf.hpp b/stan/math/prim/prob/gamma_lcdf.hpp
index 19c15050873..b64f7598e41 100644
--- a/stan/math/prim/prob/gamma_lcdf.hpp
+++ b/stan/math/prim/prob/gamma_lcdf.hpp
@@ -7,7 +7,7 @@
#include <stan/math/prim/fun/digamma.hpp>
#include <stan/math/prim/fun/exp.hpp>
#include <stan/m... | 2 | 1 | 0 | [{"id": "G0", "claim": "gamma_lcdf could simply call gamma_p and log the result instead of the PR's manual gradient computation, and the reviewer asks whether that would work since it seems easier to understand.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim"... | null |
stan-dev__math__2771 | stan-dev/math | 2,771 | defect | 172c849c79c7e3c8ff5ecb2d2f74cf5443a29647 | f98013bbf19b9e741df02159baf13fbfb1e33936 | Add to_int function and tests | ## Summary
This PR adds a function for casting `double` and `std::vector<double>` inputs to `int` types. This is intended to only be exposed for use with `data real` and `array[] data real` types in Stan
## Tests
Prim tests added for correctness of return as well as throwing if the input is too large to be rep... | diff --git a/stan/math/prim/fun.hpp b/stan/math/prim/fun.hpp
index 8a7bc8d8ec0..89c74c0a97c 100644
--- a/stan/math/prim/fun.hpp
+++ b/stan/math/prim/fun.hpp
@@ -335,6 +335,7 @@
#include <stan/math/prim/fun/to_array_1d.hpp>
#include <stan/math/prim/fun/to_array_2d.hpp>
#include <stan/math/prim/fun/to_complex.hpp>
+#i... | 6 | 6 | 3 | [{"id": "G0", "claim": "Fix the typo \"iIteger\" in the @return line of the to_int doc comment.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The doc needs to document when the function throws — ultimately as a @throw for out-of-bounds and NaN in... | null |
stan-dev__math__2784 | stan-dev/math | 2,784 | defect | 9207233e3c5b1de14caff4cd29ae5873dfa30422 | bcfaec1de1679a9cfc216bac96f9caed12222716 | Improve Numerical Stability of Bernoulli CDF functions | ## Summary
This PR updates the Bernoulli CDF functions (`_cdf`, `_lcdf`, and `_lccdf`) to operate on the log scale as much as possible, to avoid issues with underflow and resolution around 1
## Tests
Additional `mix/prob` tests have been added to ensure that the gradients aren't impacted (`prim` behaviour cove... | diff --git a/stan/math/prim/prob/bernoulli_cdf.hpp b/stan/math/prim/prob/bernoulli_cdf.hpp
index 3e0154bb22d..259e7b44a5d 100644
--- a/stan/math/prim/prob/bernoulli_cdf.hpp
+++ b/stan/math/prim/prob/bernoulli_cdf.hpp
@@ -43,11 +43,14 @@ return_type_t<T_prob> bernoulli_cdf(const T_n& n, const T_prob& theta) {
retur... | 3 | 3 | 0 | [{"id": "G0", "claim": "In bernoulli_lcdf the misnamed `theta_vec` (which actually views log1m(theta)) should be renamed so it says what it holds.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "In bernoulli_cdf the misnamed `theta_vec` (which ac... | null |
stan-dev__math__2787 | stan-dev/math | 2,787 | defect | 9093f3828c75daebe4b494a1ff34383bc3c6307b | 65ae6ca84193ccb8ad0b940faa76806c2d01c7d6 | Allow varmat for owens_t | ## Summary
This adds an overload of `owens_t()` that works for mixes of `var<Matrix>`, `Matrix<var/double>`, and `var/double` types.
@andrjohns I added you as a reviewer here because I could use your help brainstorming a nice way to turn off the binary vectorization framework for when we have specializations that... | diff --git a/stan/math/prim/fun/owens_t.hpp b/stan/math/prim/fun/owens_t.hpp
index 0737b50cbcc..1ed13616b99 100644
--- a/stan/math/prim/fun/owens_t.hpp
+++ b/stan/math/prim/fun/owens_t.hpp
@@ -67,10 +67,11 @@ inline double owens_t(double h, double a) { return boost::math::owens_t(h, a); }
* @param b Second input
* ... | 3 | 3 | 1 | [{"id": "G0", "claim": "The doc comment on is_var_and_matrix_types should say 'at least one type has `scalar_type` var and at least one type is a matrix', since the current wording implies the check only returns true for a var type plus a separate matrix type and not for a `matrix<var>` type.", "category": "documentati... | null |
stan-dev__math__2792 | stan-dev/math | 2,792 | defect | e4b9bdece4250e3455d663e3155c1d3d4965c10d | 1398625e061de525c25aca3d34bd48c7a63c5303 | Expose hypergeometric_2F1 function | ## Summary
This PR adds the `hypergeometric_2F1` function, using the existing `grad_2f1` function to calculate the gradients.
## Tests
Minimal `mix` tests are added as the values are calculated using `boost::math::hypergeometric_pFq`, which is tested through the `hypergeometric_pFq` tests, and the gradients th... | diff --git a/stan/math/fwd/fun.hpp b/stan/math/fwd/fun.hpp
index fdbd08370f1..cd4f25d8e11 100644
--- a/stan/math/fwd/fun.hpp
+++ b/stan/math/fwd/fun.hpp
@@ -41,6 +41,7 @@
#include <stan/math/fwd/fun/gamma_p.hpp>
#include <stan/math/fwd/fun/gamma_q.hpp>
#include <stan/math/fwd/fun/grad_inc_beta.hpp>
+#include <stan/m... | 7 | 3 | 1 | [{"id": "G0", "claim": "The hypergeometric_2F1 overloads lack @tparam documentation for their template parameters, and this should be added to all of them.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The include guard in prim/fun/hypergeometric... | null |
stan-dev__math__2797 | stan-dev/math | 2,797 | defect | 15f1348c8b07964ff032ebf1271d5ab26360c332 | fce33cb35a7adf967749e11a4e4904c4c609c839 | Expose `hypergeometric_3F2` function | ## Summary
This PR renames and exposes the internal `F32` function as `hypergeometric_3F2`, and updates the calculations to be on the log-scale for additional stability.
The function currently uses autodiff for the gradients, even though there is also an internal `grad_F32` function, but I'll be updating that in ... | diff --git a/stan/math/fwd/fun/inv_inc_beta.hpp b/stan/math/fwd/fun/inv_inc_beta.hpp
index a4d11b053ab..ab095c557db 100644
--- a/stan/math/fwd/fun/inv_inc_beta.hpp
+++ b/stan/math/fwd/fun/inv_inc_beta.hpp
@@ -11,7 +11,7 @@
#include <stan/math/prim/fun/lbeta.hpp>
#include <stan/math/prim/fun/lgamma.hpp>
#include <sta... | 2 | 2 | 0 | [{"id": "G0", "claim": "The hypergeometric functions exposed by this PR, including hypergeometric_3F2, should (eventually) call Boost's implementations instead of relying on the hand-rolled power-series numerics.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "cla... | null |
stan-dev__math__2812 | stan-dev/math | 2,812 | defect | 15f1348c8b07964ff032ebf1271d5ab26360c332 | db8e851c40c796d93ea4e3f08eb469a65895ce6c | vectorize atan2 | ## Summary
Vectorized atan2 and added a unit test.
## Tests
There was no unit test for atan2 so I added for the scalar and vectorized cases.
## Release notes
The function `atan2` is vectorized on both the inputs.
## Checklist
- [x] Math issue #2809
- [x] Copyright holder: Sean Pinkney
Th... | diff --git a/stan/math/prim/fun/atan2.hpp b/stan/math/prim/fun/atan2.hpp
index d9711fcdb92..45bbfa2f07b 100644
--- a/stan/math/prim/fun/atan2.hpp
+++ b/stan/math/prim/fun/atan2.hpp
@@ -23,6 +23,23 @@ double atan2(T1 y, T2 x) {
return std::atan2(y, x);
}
+/**
+ * Enables the vectorised application of the atan2 fun... | 2 | 1 | 1 | [{"id": "G0", "claim": "Add `mix` tests for the vectorised atan2 implementations before merging.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The gradient calculations likely need a check for finite values, otherwise an infinite first argument results... | null |
stan-dev__math__2814 | stan-dev/math | 2,814 | defect | 15f1348c8b07964ff032ebf1271d5ab26360c332 | 974fe4a7a0a78ea9daec9e40c0b620c64bcf3fd3 | Feature/2704 Add complex Schur decomposition | ## Summary
Adds two new functions, `complex_schur_decompose_t` and `complex_schur_decompose_u`. These wrap Eigen and implement the [Schur Decomposition](https://en.wikipedia.org/wiki/Schur_decomposition) of a matrix.
This is mostly an update of code @bob-carpenter wrote during the initial effort to add complex m... | diff --git a/stan/math/prim/fun.hpp b/stan/math/prim/fun.hpp
index c6108b41a00..aac5428c208 100644
--- a/stan/math/prim/fun.hpp
+++ b/stan/math/prim/fun.hpp
@@ -46,6 +46,7 @@
#include <stan/math/prim/fun/cols.hpp>
#include <stan/math/prim/fun/columns_dot_product.hpp>
#include <stan/math/prim/fun/columns_dot_self.hpp... | 5 | 5 | 0 | [{"id": "G0", "claim": "The doxygen `@tparam value type of matrix` line names a template parameter that does not exist; it should refer to `M`.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The functions should accept size-0 input and return a 0x... | null |
stan-dev__math__2820 | stan-dev/math | 2,820 | defect | cd60e75a4e63fa5c321ed6effcf825adfbde92c0 | cbe1dd2f3970c985218570426e925f705b413ddf | Feature/issue 2828 algebra solver variadic | ## Summary
Expose signatures with variadic arguments for Stan's algebraic solvers. For each solver (Newton and Powell) introduce a version which admits tuning parameters and one which uses defaults. The new function names are: `algebra_solver_newton`, `algebra_solver_newton_tol`, `algebra_solver_powell`, and `algebr... | diff --git a/stan/math/rev/functor/algebra_solver_newton.hpp b/stan/math/rev/functor/algebra_solver_newton.hpp
index 04b426b212d..34806da522e 100644
--- a/stan/math/rev/functor/algebra_solver_newton.hpp
+++ b/stan/math/rev/functor/algebra_solver_newton.hpp
@@ -213,17 +213,64 @@ Eigen::Matrix<var, Eigen::Dynamic, 1> alg... | 7 | 7 | 4 | [{"id": "G0", "claim": "The TO DO comment in the test utility is a stray leftover and should be removed.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The commented-out old-signature call left in the test should be cleaned up.", "category": "ma... | null |
stan-dev__math__2838 | stan-dev/math | 2,838 | defect | b500cb64d972d81477051abfeffa6ed6b63e3b51 | fc7ed1f2f5aba5b09b2a91ef12b7956af47b71b1 | Feature/issue 2682 hcubature | ## Summary
Here, we add the multidimensional integration routine hcubature. We need this feature for issue #2682. This is a split from PR #2822.
We add the following files:
stan/math/prim/functor/hcubature.hpp
## Tests
We add the following files:
test/unit/math/prim/functor/hcubature_test.cpp
## Side E... | diff --git a/stan/math/prim/functor.hpp b/stan/math/prim/functor.hpp
index 0ec5c343ff7..5590b5115c5 100644
--- a/stan/math/prim/functor.hpp
+++ b/stan/math/prim/functor.hpp
@@ -9,6 +9,7 @@
#include <stan/math/prim/functor/finite_diff_gradient.hpp>
#include <stan/math/prim/functor/finite_diff_gradient_auto.hpp>
#incl... | 24 | 23 | 1 | [{"id": "G0", "claim": "The hcubature helpers carry many template parameters that are not needed; all except F and T_pars could be replaced with concrete types.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The dimension parameter is called n i... | null |
stan-dev__math__2846 | stan-dev/math | 2,846 | defect | f4c68170c1f1e9bc1284520560204ea9e76c62cd | 438d434f52d62b6e5948cab99638f27f3bc194c2 | Add overloads to eigendecomposition for complex matrices | ## Summary
This is a redo of #2732 which I finally got around to fixing the tests on.
This adds wrappers around Eigen's [ComplexEigenSolver](https://eigen.tuxfamily.org/dox/classEigen_1_1ComplexEigenSolver.html) class to add `eigenvalues` and `eigenvectors` functions defined over complex matrices.
## Tests
... | diff --git a/stan/math/prim/fun/eigenvalues.hpp b/stan/math/prim/fun/eigenvalues.hpp
index f7f20a172ea..e67eef48cd3 100644
--- a/stan/math/prim/fun/eigenvalues.hpp
+++ b/stan/math/prim/fun/eigenvalues.hpp
@@ -7,14 +7,28 @@
namespace stan {
namespace math {
-template <typename EigMat, require_eigen_matrix_dynamic_t<... | 4 | 3 | 1 | [{"id": "G0", "claim": "The eigenvalues and eigenvectors functions (including the new complex overloads) need doxygen documentation added.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "A 0x0 matrix input throws instead of returning a 0-vector of ... | null |
stan-dev__math__2853 | stan-dev/math | 2,853 | defect | 111f7832a17aa338bb454146f4ab3c6ba66c9e7f | 32d42fde88211bbc1d4e8cd0465d36161df512f0 | Add vectorised select(), any(), and all() functions | ## Summary
This PR extracts the vectorised `select()` function introduced in [this PR](https://github.com/stan-dev/math/pull/2784#discussion_r1010558801) (which in turn is adding the currently OpenCL-only function to the rest of the Math library), and also introduces the `any()` and `all()` helper functions.
The ... | diff --git a/stan/math/opencl/kernel_generator/select.hpp b/stan/math/opencl/kernel_generator/select.hpp
index 4894b1d8c0a..24b25e98534 100644
--- a/stan/math/opencl/kernel_generator/select.hpp
+++ b/stan/math/opencl/kernel_generator/select.hpp
@@ -3,6 +3,7 @@
#ifdef STAN_OPENCL
#include <stan/math/prim/meta.hpp>
+... | 20 | 18 | 6 | [{"id": "G0", "claim": "Utility functions like these should require or at least recommend tuple compatibility, i.e. gain tuple overloads for any() and all().", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The two-container overload should wrap y_true and... | null |
stan-dev__math__2858 | stan-dev/math | 2,858 | defect | 3cbf8e1d978a780d03b4e465fcc0fcd8ae53bde9 | 916076d3b392bda4fe076e401e7feb2bab28b0b9 | [BUGFIX] grad_2f1: Add minimum number of iterations and early stopping test | ## Summary
As mentioned in #2857, the `grad_2f1` function can falsely converge early when only calculating gradients w.r.t. a subset of parameters. This PR introduces a minimum number of iterations (5) to avoid this and a test to verify
## Tests
Test-case from #2857 added
## Side Effects
N/A
## Releas... | diff --git a/stan/math/prim/fun/grad_2F1.hpp b/stan/math/prim/fun/grad_2F1.hpp
index b0d096fb855..2d99c28c678 100644
--- a/stan/math/prim/fun/grad_2F1.hpp
+++ b/stan/math/prim/fun/grad_2F1.hpp
@@ -76,7 +76,7 @@ TupleT grad_2F1_impl_ab(const T1& a1, const T2& a2, const T3& b1, const T_z& z,
ScalarT inner_diff = 1;
... | 3 | 1 | 0 | [{"id": "G0", "claim": "A minimum of 5 iterations may be too few and 10 would be safer, though the threshold is acknowledged as fairly arbitrary.", "category": "correctness", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "spinkney asked for a grid search over possible iteration... | null |
stan-dev__math__2914 | stan-dev/math | 2,914 | defect | 46f3c59e63851451ed1bf9b64c8f57c89fa49e8e | ca3329dbab2ed8e139d51c4254b73e6181fd293a | Add rev functor to compute hessian-times-vector by finite differences | ## Summary
This adds a function analogous to `finite_diff_hessian_auto` for computing Hessian-vector products of functions which only support `rev` mode types. This can be done with only two calls to `gradient`, compared to the `2N` calls needed for the naive approach of using `finite_diff_hessian_auto` and then mul... | diff --git a/stan/math/rev/functor.hpp b/stan/math/rev/functor.hpp
index 9c7f8ed3312..4c6393c81aa 100644
--- a/stan/math/rev/functor.hpp
+++ b/stan/math/rev/functor.hpp
@@ -29,5 +29,6 @@
#include <stan/math/rev/functor/partials_propagator.hpp>
#include <stan/math/rev/functor/reduce_sum.hpp>
#include <stan/math/rev/f... | 3 | 3 | 1 | [{"id": "G0", "claim": "It is not valid to choose a different epsilon for each dimension, since that would effectively change the vector being multiplied with the Hessian.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "v_eps should be evaluated or w... | null |
stan-dev__math__2917 | stan-dev/math | 2,917 | defect | d88c95f310bf20ade640c1727460f3f7c7007971 | d8bd6d87551792d02e2bb634f6d9eef76f36ad16 | [BUGFIX] Fvar compatibility fixes for GLM Distributions | ## Summary
This PR implements a number of small patches for `fvar`/higher-order support with the GLM distributions
## Tests
New `mix` tests (using the AD testing-framework) added
## Side Effects
NA
## Release notes
Fixed fvar/higher-order autodiff compatibility with GLM distributions
## Checklis... | diff --git a/stan/math/prim/prob/bernoulli_logit_glm_lpmf.hpp b/stan/math/prim/prob/bernoulli_logit_glm_lpmf.hpp
index ffec07f2f8a..b23e2224f67 100644
--- a/stan/math/prim/prob/bernoulli_logit_glm_lpmf.hpp
+++ b/stan/math/prim/prob/bernoulli_logit_glm_lpmf.hpp
@@ -8,10 +8,11 @@
#include <stan/math/prim/fun/as_array_or... | 2 | 2 | 0 | [{"id": "G0", "claim": "Add a test case that also passes a vector of ints as y to the new bernoulli_logit_glm_lpmf mix test.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Add combinations of scalar and vector arguments to the values passed to the new G... | null |
stan-dev__math__2928 | stan-dev/math | 2,928 | defect | 34881d4b8b4d6bea963d2d69e2d12da8f723fb64 | 0ec5253c679eb373e117659d5d696667c88cb7d0 | Allow arena_matrix to use move semantics | ## Summary
This PR does two things
1. Allows `arena_matrix` to use move semantics
- If an `arena_matrix`' s constructor is passed an rvalue, instead of allocating memory onto the stack allocator and then doing a copy, `arena_matrix` now pushes that rvalue into a `chainable_ptr` that sits in the chainable stack... | diff --git a/doxygen/contributor_help_pages/common_pitfalls.md b/doxygen/contributor_help_pages/common_pitfalls.md
index f3e8fb817ad..9fecb241989 100644
--- a/doxygen/contributor_help_pages/common_pitfalls.md
+++ b/doxygen/contributor_help_pages/common_pitfalls.md
@@ -190,6 +190,38 @@ The general rules to follow for pa... | 13 | 13 | 3 | [{"id": "G0", "claim": "normal_log takes its arguments by forwarding references but should pass them on to normal_lpdf with std::forward, as the reviewer's suggestion block shows, instead of calling it unforwarded.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1... | null |
stan-dev__math__2929 | stan-dev/math | 2,929 | defect | 5d1fd38376d20a9da6368d8b16c2c02934c61991 | 4209cc95c80d2e8ba8120298731bb96d920d80a5 | Framework for generic fvar<T> support through finite-differences | ## Summary
This PR introduces a framework (`fvar_finite_diff`, open to name changes!) which can add `fvar<T>` support for an arbitrary function through finite-differences.
This is *NOT* intended as a replacement for analytic gradients or autodiff. Rather, for the functions in the math library which `fvar<T>` supp... | diff --git a/stan/math/fwd/functor.hpp b/stan/math/fwd/functor.hpp
index 9e7b7b5b605..bf0b2314dfc 100644
--- a/stan/math/fwd/functor.hpp
+++ b/stan/math/fwd/functor.hpp
@@ -3,7 +3,9 @@
#include <stan/math/fwd/functor/apply_scalar_unary.hpp>
#include <stan/math/fwd/functor/gradient.hpp>
+#include <stan/math/fwd/func... | 9 | 8 | 1 | [{"id": "G0", "claim": "Template parameter names should follow the codebase convention and drop the redundant trailing `T`, i.e. use `FuncTangent` and `InputArg` instead of `FuncTangentT` and `InputArgT`.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Al... | null |
stan-dev__math__2931 | stan-dev/math | 2,931 | defect | d4eab2773347ca6fbe03d49f70828c08ff248269 | 2e962242a1c10b7583484b909d30cdad1d4770fd | Add tuple-returning special functions | ## Summary
This adds the following functions which return tuples. Each is already implemented piecewise, these versions just reduce computation:
- `qr_thin`
- `eigendecompose_sym`
- `eigendecompose`
- `complex_schur_decompose`
- `svd`
- `csr_extract`
## Tests
Existing tests for the base functions were ... | diff --git a/stan/math/prim/fun.hpp b/stan/math/prim/fun.hpp
index fa50fec8117..11ba14123bd 100644
--- a/stan/math/prim/fun.hpp
+++ b/stan/math/prim/fun.hpp
@@ -64,6 +64,7 @@
#include <stan/math/prim/fun/cov_matrix_free.hpp>
#include <stan/math/prim/fun/cov_matrix_free_lkj.hpp>
#include <stan/math/prim/fun/crossprod... | 17 | 13 | 2 | [{"id": "G0", "claim": "In the sparse csr_extract overload, build the w vector with Eigen::Matrix<T, Dynamic, 1>::Zero(A.nonZeros()) instead of constructing then calling setZero().", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "In the sparse csr... | null |
stan-dev__math__2946 | stan-dev/math | 2,946 | defect | 9f2689e920f41cec1de74fc673cb4b99e20623ba | 94a6991a4c90db66b158a77466f445ce02b41b50 | Add binomial_logit_glm distribution | ## Summary
This PR adds the `binomial_logit_glm_lpmf` distribution, the binomial equivalent of the `bernoulli_logit_glm_lpmf`. Much of the log-probability and derivative construction is the same between the two, so this implementation closely follows the existing `bernoulli_logit_glm_lpmf` implementation.
## Test... | diff --git a/stan/math/prim/prob.hpp b/stan/math/prim/prob.hpp
index bfd8cfdc07e1..3af4c5763f6c 100644
--- a/stan/math/prim/prob.hpp
+++ b/stan/math/prim/prob.hpp
@@ -46,6 +46,7 @@
#include <stan/math/prim/prob/binomial_log.hpp>
#include <stan/math/prim/prob/binomial_logit_log.hpp>
#include <stan/math/prim/prob/bino... | 3 | 2 | 0 | [{"id": "G0", "claim": "The doc block of binomial_logit_glm_lpmf uses the wrong doc group (`\\ingroup multivar_dists` instead of `prob_dists`).", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The value-extraction bindings (`n_val`, `N_val`, and the... | null |
stan-dev__math__2961 | stan-dev/math | 2,961 | defect | c90b3bf09d8711f4255a141fc0f5a1b598501375 | fbcec85476ecd50aec96644affda454bf8cd180a | Re-Implementation of Hypergeometric PFQ gradient function | ## Summary
This PR rewrites the `grad_pFq` function to use a significantly simpler form of the gradient definition (now requiring only one infinite sum instead of two nested ones). The `grad_pFq` function now performs on par with the existing `grad_2F1` and `grad_3F2` functions in terms of both speed and accuracy.
... | diff --git a/stan/math/fwd/fun/hypergeometric_pFq.hpp b/stan/math/fwd/fun/hypergeometric_pFq.hpp
index 9738557d9e5..bb8a87afeb1 100644
--- a/stan/math/fwd/fun/hypergeometric_pFq.hpp
+++ b/stan/math/fwd/fun/hypergeometric_pFq.hpp
@@ -21,33 +21,38 @@ namespace math {
* @param[in] z Scalar z argument
* @return General... | 5 | 5 | 0 | [{"id": "G0", "claim": "Add documentation explaining the simplified way the derivatives are calculated.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The binarysign helper duplicates the existing sign function and should not live in this file.", ... | null |
stan-dev__math__2962 | stan-dev/math | 2,962 | defect | 2d7fbe246c533482a2701a8ef4ea379e26dab597 | dcac15f591c3901df9d6bea562d738626f0ad6e0 | Add Hypergeometric 1F0 function and gradients | ## Summary
This PR exposes the `hypergeometric_1f0` function from Boost and adds gradients. The gradients for the 1F0 are much simpler than the other hypergeometric series and can be expressed analytically (no need for the `grad_pFq` function)
## Tests
`prim` tests for values and throwing behaviour added, `mix... | diff --git a/stan/math/fwd/fun.hpp b/stan/math/fwd/fun.hpp
index cd4f25d8e11..37dbc449038 100644
--- a/stan/math/fwd/fun.hpp
+++ b/stan/math/fwd/fun.hpp
@@ -41,6 +41,7 @@
#include <stan/math/fwd/fun/gamma_p.hpp>
#include <stan/math/fwd/fun/gamma_q.hpp>
#include <stan/math/fwd/fun/grad_inc_beta.hpp>
+#include <stan/m... | 2 | 1 | 0 | [{"id": "G0", "claim": "Replace `auto` with explicit types in `hypergeometric_1f0` (return type in the fwd and prim overloads, and local variables like `a_val`/`z_val`), because overusing `auto` hurts readability.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": ... | null |
stan-dev__math__2971 | stan-dev/math | 2,971 | defect | c5e8f0844433af4d64ea8ac2086bdacd5e213477 | 0656caa06dda69d685dccbcd6db4336cf498572d | Add arena_matrix specialization for sparse matrices | ## Summary
While working on a branch to let Stan math use ctest and cmake I found a memory leak in the sparse matrix impl for vari. It was a confusing bug that had to deal with how Eigen's implimentation manages dynamic memory for sparse matrices. This PR removes the use of `chainable_alloc` and directly holding spa... | diff --git a/stan/math/rev/core/arena_matrix.hpp b/stan/math/rev/core/arena_matrix.hpp
index 84bb00bca7c..182972ae197 100644
--- a/stan/math/rev/core/arena_matrix.hpp
+++ b/stan/math/rev/core/arena_matrix.hpp
@@ -4,19 +4,15 @@
#include <stan/math/prim/fun/Eigen.hpp>
#include <stan/math/rev/core/chainable_alloc.hpp>
... | 7 | 7 | 1 | [{"id": "G0", "claim": "The sparse arena_matrix constructors do not pass the innerNonZerosPtr input through, and andrjohns asks whether that omission is intentional.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The sparse-sparse inplace_ops_impl (... | null |
stan-dev__math__2978 | stan-dev/math | 2,978 | defect | e43fc08ca3345113ab437954600bc4e2bfd7ee54 | 0d2a46a0732ba86e4569814a3f74579c6dfd7ce8 | fix assignment for nullptr var_value<matrix> and for assigning expressions |
## Summary
Fixes #2977 by forcing `arena_matrix` to perform a hard copy when using `operator=` from expressions made from other var matrices.
## Tests
Tests have been added to check assigning to a `var_value<Matrix>` when the inner `vari` is `nullptr` and for `var_value<Matrix>` when the rhs is an expressi... | diff --git a/stan/math/rev/core/arena_matrix.hpp b/stan/math/rev/core/arena_matrix.hpp
index 3d3b095fc74..d6a83f2b6f6 100644
--- a/stan/math/rev/core/arena_matrix.hpp
+++ b/stan/math/rev/core/arena_matrix.hpp
@@ -128,6 +128,15 @@ class arena_matrix : public Eigen::Map<MatrixType> {
Base::operator=(a);
return ... | 5 | 5 | 1 | [{"id": "G0", "claim": "The setZero() call added in the assignment reverse pass is causing OpenCL to fail to compile.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "The require_any_not_plain_type_t<T_, S> constraint on the new operator= overload is ... | null |
stan-dev__math__2979 | stan-dev/math | 2,979 | defect | e43fc08ca3345113ab437954600bc4e2bfd7ee54 | 61762166dfaafaa6af168140fb2f0e477362d22c | Added the Dirichlet-Multinomial distribution (issue 54) | ## Summary
This PR adds the Dirichlet-Multinomial distribution to the Stan math library. The Dirichlet-Multinomial (DirMult) distribution generalizes the Beta-Binomial distribution with more than two categories. It can also be seen as an over-dispersed multinomial distribution. It is implemented in other popular fra... | diff --git a/stan/math/prim/prob.hpp b/stan/math/prim/prob.hpp
index 3af4c5763f6..5bd3518777b 100644
--- a/stan/math/prim/prob.hpp
+++ b/stan/math/prim/prob.hpp
@@ -76,6 +76,9 @@
#include <stan/math/prim/prob/dirichlet_lpdf.hpp>
#include <stan/math/prim/prob/dirichlet_lpmf.hpp>
#include <stan/math/prim/prob/dirichle... | 3 | 3 | 1 | [{"id": "G0", "claim": "A test in test/unit/math/mix/prob/ using the expect_ad() framework should be added to check the gradients of the new function.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The dirichlet_multinomial_log.hpp file and its #include... | null |
stan-dev__math__2990 | stan-dev/math | 2,990 | defect | 013bb8bd123532d51e14271404cf180cee5ac632 | d92293612514def9e023a309699f41a70d227ed3 | Multi student t cholesky derivatives | ## Summary
This adds derivatives for the `multi_student_t_cholesky_lpdf`.
## Tests
Added a mix test.
## Side Effects
No.
## Release notes
Adds derivatives for the `multi_student_t_cholesky_lpdf`
## Checklist
- [x] Copyright holder: Sean Pinkney
The copyright holder is typically you or yo... | diff --git a/stan/math/prim/prob/multi_student_t_cholesky_lpdf.hpp b/stan/math/prim/prob/multi_student_t_cholesky_lpdf.hpp
index 6c116c994a5..088e8869f8b 100644
--- a/stan/math/prim/prob/multi_student_t_cholesky_lpdf.hpp
+++ b/stan/math/prim/prob/multi_student_t_cholesky_lpdf.hpp
@@ -4,23 +4,30 @@
#include <stan/math/... | 3 | 3 | 0 | [{"id": "G0", "claim": "The L_deriv partials matrix is created unconditionally even though it is only needed when the covariance term contributes, and the author wanted a way to create it only when that condition passes.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id... | null |
stan-dev__math__2992 | stan-dev/math | 2,992 | defect | ae90c3edca5d3b5e5234fdd6cbd1146f1666761d | 9442c29968b7ce0a0613552f64148b82f1e6f6dc | Add simplex row and column matrix constraints | ## Summary
This adds the functions `simplex_row_constrain` and `simplex_column_constrain` to be used by the stan language for matrices with simplexes along the rows or columns of the matrix. This is just the constrain version which is already a lot of code. I'm going to add the free functions in a separate PR
## ... | diff --git a/stan/math/prim/fun.hpp b/stan/math/prim/fun.hpp
index 59e087ec277..3c9186f6e33 100644
--- a/stan/math/prim/fun.hpp
+++ b/stan/math/prim/fun.hpp
@@ -315,8 +315,10 @@
#include <stan/math/prim/fun/select.hpp>
#include <stan/math/prim/fun/sign.hpp>
#include <stan/math/prim/fun/signbit.hpp>
+#include <stan/m... | 8 | 6 | 0 | [{"id": "G0", "claim": "Use an explicit return type (plain_type_t<Mat>) instead of `auto` on the prim simplex_column_constrain and simplex_row_constrain functions.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Consider consolidating the duplica... | null |
stan-dev__math__3033 | stan-dev/math | 3,033 | defect | 33b9a828bbcf927be839ee306f87a99c2f88b07c | 294f31296c52878d69322ba6d95d2db4c43d37cb | sqrt(x) gradient when x=0 | ## Summary
Quick fix for #3031
## Tests
New test cases for sqrt() and distance().
## Side Effects
No.
## Release notes
Give `sqrt(x)` a finite gradient at `x=0`. Allows `distance(x,y)` to work for `x=y` too.
## Checklist
- [x] Copyright holder: Niko Huurre
The copyright holder is typi... | diff --git a/stan/math/fwd/fun/sqrt.hpp b/stan/math/fwd/fun/sqrt.hpp
index e72bcea4a2f..3fcbf854c36 100644
--- a/stan/math/fwd/fun/sqrt.hpp
+++ b/stan/math/fwd/fun/sqrt.hpp
@@ -16,6 +16,8 @@ namespace math {
template <typename T>
inline fvar<T> sqrt(const fvar<T>& x) {
using std::sqrt;
+ if (value_of_rec(x.val_) ... | 1 | 1 | 0 | [{"id": "G0", "claim": "Brace the single-statement if bodies of the x=0 sqrt gradient guards added in stan/math/fwd/fun/sqrt.hpp and stan/math/rev/fun/sqrt.hpp, per the reviewer's suggestion blocks.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}] | null |
stan-dev__math__3048 | stan-dev/math | 3,048 | defect | b9d0a3329108c7cb83ff76f4b475c0aa166c77e3 | 33f0825af37e6141d81884101ded2da122e922e6 | Fix csr_matrix_times_vector linker error | ## Summary
Fixes https://github.com/stan-dev/rstanarm/issues/620 and cleans up `csr_matrix_times_vector`.
The `csr_matrix_times_vector` function was erroring when linking. @WardBrian and I suspect the issue has something to do with the length of the mangled names of either the vtable elements or the windows deb... | diff --git a/stan/math/prim/fun/value_of.hpp b/stan/math/prim/fun/value_of.hpp
index 7cc37ac9b2c..64286bbe0c3 100644
--- a/stan/math/prim/fun/value_of.hpp
+++ b/stan/math/prim/fun/value_of.hpp
@@ -67,7 +67,7 @@ inline auto value_of(const T& x) {
* @param[in] M Matrix to be converted
* @return Matrix of values
**/... | 4 | 2 | 1 | [{"id": "G0", "claim": "The two test cases commented out in to_soa_sparse_matrix_test.cpp should either be uncommented (preferably) or removed.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The reviewer asks to be walked through the const_casts added t... | null |
stan-dev__math__3099 | stan-dev/math | 3,099 | defect | f120c5e8e86c473f64ab222613e173acfa2648de | 40d0e4b7bf95d51f9159e1a0a8ffbaf4d1be32b2 | Add sum_to_zero constraint, free, and check | ## Summary
This adds the functions necessary to implement a `sum_to_zero` constraint. This is a vector with `sum(x) == 0`. The constraining transform is to add an element set to `-sum(previous elements)`, and the freeing transform just takes the first N-1 elements out.
Because this is linear, there is no jacobia... | diff --git a/stan/math/prim/constraint.hpp b/stan/math/prim/constraint.hpp
index 169fd8f2e31..5c494c83214 100644
--- a/stan/math/prim/constraint.hpp
+++ b/stan/math/prim/constraint.hpp
@@ -37,6 +37,8 @@
#include <stan/math/prim/constraint/stochastic_column_free.hpp>
#include <stan/math/prim/constraint/stochastic_row_... | 7 | 5 | 3 | [{"id": "G0", "claim": "The prim sum_to_zero_constrain should check for a size-0 input at the point where it sizes the output vector.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The sum check in check_sum_to_zero should be wrapped in unlikely() t... | null |
stan-dev__math__3101 | stan-dev/math | 3,101 | defect | f120c5e8e86c473f64ab222613e173acfa2648de | 8be67c6511cbbbf454b7253faf2fe145399dfdf6 | Add sum_to_zero constraint, free, and check based on ILR transform | ## Summary
This is an alternative to #3099 based on the discussion in the comments there. Rather than `x[1:N-1] = y; x[N] = -sum(y)` this uses a modification of the isometric log ratio (ILR) transformation for simplexes. The implementation is based on a single for-loop, but was adapted from Sean's code that used sev... | diff --git a/stan/math/prim/constraint.hpp b/stan/math/prim/constraint.hpp
index 169fd8f2e31..5c494c83214 100644
--- a/stan/math/prim/constraint.hpp
+++ b/stan/math/prim/constraint.hpp
@@ -37,6 +37,8 @@
#include <stan/math/prim/constraint/stochastic_column_free.hpp>
#include <stan/math/prim/constraint/stochastic_row_... | 6 | 6 | 0 | [{"id": "G0", "claim": "The documentation should also cite Filzmoser, Hron and Templ (2018) as the reference for the pivot-coordinates form of the ILR transform.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The loop counter should be handled in ... | null |
stan-dev__math__3126 | stan-dev/math | 3,126 | defect | 4a812be023c2b98c4ef97999985fd947cfc895fa | ca1c0cbb6d3aa31ce09641e6d360afcca4a1d75a | Feature/issue 3121 beta neg binomial rng | ## Summary
With this PR the rng of beta negative binomial distribution are added.
See issue #3121
Expressions involved :
for $$Y\sim \text{BNB}(r,\alpha,\beta)$$ we have
$$
\begin{align}
Y &\sim \text{NB}(r,p) \\
p &\sim {\textrm {Beta}}(\alpha ,\beta ),
\end{align}
$$
where $\text{NB}(y~|~... | diff --git a/stan/math/prim/prob.hpp b/stan/math/prim/prob.hpp
index 919f63b62c0..e04c7e87172 100644
--- a/stan/math/prim/prob.hpp
+++ b/stan/math/prim/prob.hpp
@@ -29,6 +29,7 @@
#include <stan/math/prim/prob/beta_neg_binomial_lccdf.hpp>
#include <stan/math/prim/prob/beta_neg_binomial_lcdf.hpp>
#include <stan/math/p... | 3 | 3 | 1 | [{"id": "G0", "claim": "Add `#include <stan/math/prim/fun/log.hpp>` at the top so the `stan::math::log` call in the odds-ratio computation can be written unqualified.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Change the signature to use `ty... | null |
stan-dev__math__3165 | stan-dev/math | 3,165 | defect | cf3d0dd37799b4aa03c75b8bfee057d37bed2c85 | 4cc48dc88c352e3053a78adde46ec79725df6116 | Minor fixes for hypergeometric 1F0 and 2F1 | ## Summary
As pointed out in [the stanc3 repo](https://github.com/stan-dev/stanc3/issues/1285), the hypergeometric 1F0 function naming is inconsistent with the others - using a lowercase 'f' (i.e., `hypergeometric_1f0` instead of `hypergeometric_1F0`)
Additionally, `hypergeometric_2F1` fails to compile if the sec... | diff --git a/stan/math/fwd/fun/hypergeometric_1F0.hpp b/stan/math/fwd/fun/hypergeometric_1F0.hpp
index b304d5c8381..5337f411f00 100644
--- a/stan/math/fwd/fun/hypergeometric_1F0.hpp
+++ b/stan/math/fwd/fun/hypergeometric_1F0.hpp
@@ -31,10 +31,10 @@ namespace math {
template <typename Ta, typename Tz, typename FvarT = ... | 5 | 4 | 0 | [{"id": "G0", "claim": "The `constexpr const char* function` variable this pull request adds in hypergeometric_1F0 appears to be unused.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "For consistency, hypergeometric_3F2 should also accept a row_... | null |
stan-dev__math__3169 | stan-dev/math | 3,169 | defect | 59c00146f918ea5ee4702d8980d93a7871364da2 | c00cd6e3481b5a7dce9767e981b19b7667032a7d | Add sum_to_zero_constrain and _free for matrix types | ## Summary
Closes #3132. This adds new overloads for `sum_to_zero_constrain` and `sum_to_zero_free` that accept Eigen Matrix types.
The return value of sum_to_zero_constrain sums to zero along each row and column (as well as the entire matrix summing to 0).
## Tests
I added existing tests based on the ones ... | diff --git a/stan/math/prim/constraint/sum_to_zero_constrain.hpp b/stan/math/prim/constraint/sum_to_zero_constrain.hpp
index f1bed92f505..19f330c5692 100644
--- a/stan/math/prim/constraint/sum_to_zero_constrain.hpp
+++ b/stan/math/prim/constraint/sum_to_zero_constrain.hpp
@@ -50,7 +50,7 @@ inline plain_type_t<Vec> sum_... | 3 | 1 | 0 | [{"id": "G0", "claim": "The variable b_i_x (the `auto b_i_x = ...` declaration the comment anchors to) could be declared with an explicit type instead of `auto`.", "category": "maintainability", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The matrix sum_to_zero_free loop sho... | null |
stan-dev__math__3171 | stan-dev/math | 3,171 | defect | bc4b4bc37ff87ea3466e295bb4edd36bd16d3abf | f55acbd7da01dd6bb3252b89b78ce90bfc3ba4a9 | Replace simplex transform with one based on the ILR transform | ## Summary
Closes #3170.
This updates the simplex transform and the stochastic matrices to use the ILR transform rather than stick breaking.
The stochastic matrices delegate more to the simplex functions for now, they could be rewritten for efficiency later.
Q: This completely replaces the existing functio... | diff --git a/stan/math/prim/constraint/simplex_constrain.hpp b/stan/math/prim/constraint/simplex_constrain.hpp
index 852123ddaee..eadef2aca31 100644
--- a/stan/math/prim/constraint/simplex_constrain.hpp
+++ b/stan/math/prim/constraint/simplex_constrain.hpp
@@ -3,10 +3,11 @@
#include <stan/math/prim/meta.hpp>
#inclu... | 10 | 7 | 0 | [{"id": "G0", "claim": "The final per-element loop in prim simplex_constrain should be replaced with the vectorized expression z.array() = (z.array() - max_val).exp() / d.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "There is a bug in the logic of... | null |
stan-dev__math__3191 | stan-dev/math | 3,191 | defect | 9f23455a2ed6896a31b83e8f8d5529dcdd74a65c | 15bd7a373f20bc4ce9da1de4c3607bb7604b3d30 | Allow forward_as to convert integers to doubles | ## Summary
Closes #3189.
Note that we will probably want to eventually remove this function (#3190), but for now this fixes the bug with `normal_id_glm_lpdf`.
## Tests
Added the reproducer from #3189 as a test
## Side Effects
None?
## Release notes
## Checklist
- [x] Copyright holder: (fill in cop... | diff --git a/stan/math/prim/meta/forward_as.hpp b/stan/math/prim/meta/forward_as.hpp
index 838e1d336fc..cfa2df88139 100644
--- a/stan/math/prim/meta/forward_as.hpp
+++ b/stan/math/prim/meta/forward_as.hpp
@@ -54,14 +54,43 @@ inline T_actual&& forward_as(T_actual&& a) { // NOLINT
* @return nothing, this always throws... | 1 | 1 | 1 | [{"id": "G0", "claim": "The arithmetic-arithmetic exclusion in the throwing overload should be narrowed to std::is_floating_point_v<std::decay_t<T_desired>> && std::is_integral_v<std::decay_t<T_actual>> instead of excluding all arithmetic type pairs.", "category": "correctness", "verdict": "supported", "priority": "P1"... | null |
stan-dev__math__3210 | stan-dev/math | 3,210 | defect | 699fb3537075cdd024e84adb57ae9398b910b29b | f8dfd1aaef085cf0291073fadaf66a2eece1dc8e | Laplace: Add mean argument to helper distributions | ## Summary
Closes #3202.
Adds a mean argument to the helpers. It is templated such that it can be a vector or scalar.
The `poisson_log_2` helper is redundant with this change and is therefore removed.
Additionally, it fixes the `y_index` argument to be 1-indexed to match the rest of Stan
## Tests
Ex... | diff --git a/stan/math/mix/prob/laplace_latent_bernoulli_logit_rng.hpp b/stan/math/mix/prob/laplace_latent_bernoulli_logit_rng.hpp
index 7fe8c7e7e339..ae720e7251cb 100644
--- a/stan/math/mix/prob/laplace_latent_bernoulli_logit_rng.hpp
+++ b/stan/math/mix/prob/laplace_latent_bernoulli_logit_rng.hpp
@@ -19,29 +19,33 @@ n... | 2 | 1 | 0 | [{"id": "G0", "claim": "The y_index argument to laplace_marginal_poisson_log_lpmf is 0-indexed and should be verified whether it should be 1-indexed to be consistent with the rest of Stan.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "pre_existing"}, {"id": "G1", "claim": "Because the... | null |
stan-dev__math__3266 | stan-dev/math | 3,266 | defect | 79e7dd4487967f4b947a16eaae91beaaf5138053 | 026b39a2a8a766d65d3496f69562a9c2aabbcee2 | super stable gamma_lccdf | ## Summary
This pr closes #3257. The `gamma_lccdf` experiences numerical instability for alpha approximately greater than 30. It’s due to gamma_q or grad_reg_inc_gamma. This pr rewrites the code to use gamma_p and grad_reg_lower_inc_gamma, which avoids potential instability in a tgamma(alpha) and digamma(alpha) call. ... | diff --git a/stan/math/prim/prob/gamma_lccdf.hpp b/stan/math/prim/prob/gamma_lccdf.hpp
index a670cefcecf5..e28ce1cba658 100644
--- a/stan/math/prim/prob/gamma_lccdf.hpp
+++ b/stan/math/prim/prob/gamma_lccdf.hpp
@@ -4,30 +4,84 @@
#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/err.hpp>
#include <stan/math... | 3 | 2 | 1 | [{"id": "G0", "claim": "The stan/math/fwd/ headers should not be included in this prim header; only the prim headers belong there.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The internal log_q_gamma_cf should declare an explicit return type instead o... | null |
stan-dev__math__3275 | stan-dev/math | 3,275 | defect | 42063be9833129cdf1d4b2299616ec8aba237d80 | 86ac5617162c98dcad1f1bb6fc240792db23185a | Fix gamma lccdf | ## Summary
This pr closes #3257. The `gamma_lccdf` experiences numerical instability for alpha approximately greater than 30. It’s due to gamma_q or grad_reg_inc_gamma. This pr rewrites the code to use gamma_p and grad_reg_lower_inc_gamma, which avoids potential instability in a tgamma(alpha) and digamma(alpha) call... | diff --git a/stan/math/prim/fun/log_gamma_q_dgamma.hpp b/stan/math/prim/fun/log_gamma_q_dgamma.hpp
new file mode 100644
index 00000000000..e264c5d50a5
--- /dev/null
+++ b/stan/math/prim/fun/log_gamma_q_dgamma.hpp
@@ -0,0 +1,156 @@
+#ifndef STAN_MATH_PRIM_FUN_LOG_GAMMA_Q_DGAMMA_HPP
+#define STAN_MATH_PRIM_FUN_LOG_GAMMA_... | 1 | 1 | 0 | [{"id": "G0", "claim": "The PR's gamma_lccdf implementation should be cleaned up before merging, adopting the cleanup changes SteveBronder prepared in his fix/gamma-lccdf-v3-review branch (e.g. .first/.second instead of the result struct, y_val naming, decay_t and (un)likely hints).", "category": "maintainability", "ve... | null |
stan-dev__math__3285 | stan-dev/math | 3,285 | defect | 2d953bf7985e0f58090620dabcac307d69354096 | 060a0df889dfab81f7599661561a71055e3d65f8 | add yule_simon_rng | ## Summary
With this PR the rng of Yule-Simon distribution are added.
See issue #3239
For $$Y\sim \text{Yule-Simon}(\alpha)$$:
$$
\Pr(Y=y\mid \alpha)= \alpha \mathrm{B}(y,\alpha+1) \quad y\in\{1,2,\dots\}
$$
$$\mathrm{B}$$ is the Beta function.
It has a Beta–Geometric mixture. To sample form $$Y$$,... | diff --git a/stan/math/prim/prob.hpp b/stan/math/prim/prob.hpp
index 0bdff9f5f70..308b084a165 100644
--- a/stan/math/prim/prob.hpp
+++ b/stan/math/prim/prob.hpp
@@ -320,5 +320,9 @@
#include <stan/math/prim/prob/wishart_cholesky_rng.hpp>
#include <stan/math/prim/prob/wishart_lpdf.hpp>
#include <stan/math/prim/prob/wi... | 2 | 2 | 0 | [{"id": "G0", "claim": "Since neg_binomial_rng is used anyway, the RNG should be vectorized end-to-end (drop the manual scalar_seq_view/VectorBuilder loop and compute p and odds_ratio_p directly on w) rather than looping scalar-by-scalar.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "intro... | null |
stan-dev__math__3297 | stan-dev/math | 3,297 | defect | 8ee3d9693ca4b07a13cfbe48e0da3896515638f1 | 8dcfbafc12a90ce3782fccbe19690d0813ec5605 | fix laplace_marginal optimization | ## Summary
laplace_marginal was failing with normal-normal model, in which case Newton should get to the mode in one step.
This fix was made with Claude assistance and the sufficiently detailed prompt was based on previous detailed analysis of behavior of Stan model included.
All code changes are by Claude. Belo... | diff --git a/stan/math/mix/functor/laplace_marginal_density_estimator.hpp b/stan/math/mix/functor/laplace_marginal_density_estimator.hpp
index 541dbe96fcc..fae7ba938ce 100644
--- a/stan/math/mix/functor/laplace_marginal_density_estimator.hpp
+++ b/stan/math/mix/functor/laplace_marginal_density_estimator.hpp
@@ -380,6 +... | 1 | 1 | 0 | [{"id": "G0", "claim": "The PR author (SteveBronder) says the new Wolfe-rejection handling re-runs update_fun at alpha=1 on the stale/reused curr memory instead of reusing the full-Newton-step results evaluated a few lines above, and states he will modify the code while keeping the backup Newton step check.", "category... | null |
stan-dev__stan__3153 | stan-dev/stan | 3,153 | defect | e043da75516985fa8e5ed32c826e19dc9f9a0730 | 321ad62f3f65faa2f6c0bc9e55a8a4ac144c0e8f | Issue/3151 laplace logging newlines | #### Submission Checklist
- [x] Run unit tests: `./runTests.py src/test/unit`
- [x] Run cpplint: `make cpplint`
- [x] Declare copyright holder and open-source license: see below
#### Summary
Remove spurious whitespace from messages sent to the logger. Added unit test to verify template parameter jacobian.
... | diff --git a/src/stan/services/optimize/laplace_sample.hpp b/src/stan/services/optimize/laplace_sample.hpp
index 81755bcdfe1..69a3a613edf 100644
--- a/src/stan/services/optimize/laplace_sample.hpp
+++ b/src/stan/services/optimize/laplace_sample.hpp
@@ -61,7 +61,7 @@ void laplace_sample(const Model& model, const Eigen::... | 4 | 3 | 0 | [{"id": "G0", "claim": "The nested refresh/write_array_msgs conditional should be a single combined condition (refresh > 0 && write_array_msgs.peek() != EOF), unless other output depends on the nesting.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "clai... | null |
stan-dev__stan__3173 | stan-dev/stan | 3,173 | defect | 4ec109a21e5bd1cd43eed724ef286aadec3b5e7a | 5061519c693d77bf92413a7f7caa12c65bfece28 | Standalone GQ: Output NaNs when exception is caught | #### Submission Checklist
- [x] Run unit tests: `./runTests.py src/test/unit`
- [x] Run cpplint: `make cpplint`
- [x] Declare copyright holder and open-source license: see below
#### Summary
Closes https://github.com/stan-dev/cmdstan/issues/1007. Since https://github.com/stan-dev/stanc3/pull/1165 we have mad... | diff --git a/src/stan/services/util/gq_writer.hpp b/src/stan/services/util/gq_writer.hpp
index 5d4566773ba..1f656d34d06 100644
--- a/src/stan/services/util/gq_writer.hpp
+++ b/src/stan/services/util/gq_writer.hpp
@@ -81,7 +81,6 @@ class gq_writer {
if (ss.str().length() > 0)
logger_.info(ss);
log... | 2 | 2 | 1 | [{"id": "G0", "claim": "Because the early `return` was removed, the conditional `logger_.info(ss)` after the catch duplicates the message already logged inside the catch block, so the conditional logging should be moved into the try block (and perhaps the logger itself should ignore empty string messages).", "category"... | null |
stan-dev__stan__3179 | stan-dev/stan | 3,179 | defect | da13a2f524c13794f1816ff79a69c9994c82f358 | aeb9eae6b05c03e45a082fdf5acae600c384044f | Expose new base class method 'unconstrain_array' |
#### Submission Checklist
- [x] Run unit tests: `./runTests.py src/test/unit`
- [x] Run cpplint: `make cpplint`
- [x] Declare copyright holder and open-source license: see below
#### Summary
This exposes the method added in https://github.com/stan-dev/stanc3/pull/1305 as a direct inverse function for `writ... | diff --git a/src/stan/model/model_base.hpp b/src/stan/model/model_base.hpp
index 45972db8284..2aaaeb3a0e8 100644
--- a/src/stan/model/model_base.hpp
+++ b/src/stan/model/model_base.hpp
@@ -368,6 +368,21 @@ class model_base : public prob_grad {
bool include_tparams = true, bool include_gqs = ... | 1 | 1 | 0 | [{"id": "G0", "claim": "Manage the test's inits var_context with a unique_ptr (via a helper function) instead of a raw new/delete.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
stan-dev__stan__3190 | stan-dev/stan | 3,190 | defect | 94233d9c81eaa447a1385da4761880ccc9cce95b | fc2f7ca9dfa1b39e6bce3b468e807e7c054d995e | Support Tuple indices in Stan CSV Header Reader | #### Submission Checklist
- [x] Run unit tests: `./runTests.py src/test/unit`
- [x] Run cpplint: `make cpplint`
- [x] Declare copyright holder and open-source license: see below
#### Summary
With Tuples, it will no longer be the case that names will always look like `x.1.2.1`. You can also have a tuple separ... | diff --git a/src/stan/io/json/json_data_handler.hpp b/src/stan/io/json/json_data_handler.hpp
index 73b35138a8e..b21db83e914 100644
--- a/src/stan/io/json/json_data_handler.hpp
+++ b/src/stan/io/json/json_data_handler.hpp
@@ -16,7 +16,7 @@
#include <utility>
#include <vector>
#include <boost/algorithm/string.hpp>
-#i... | 2 | 2 | 1 | [{"id": "G0", "claim": "The condition should use `variable.find_first_of(\":.\") != std::string::npos` instead of chained `find()` calls, which do not check for either character as written.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The single c... | null |
stan-dev__stan__3191 | stan-dev/stan | 3,191 | defect | 2338b544ed7bed8cef066ef3aa2f147a56f80bca | c48925caa93184ec115646733ebbc0965a82720b | Feature/3176 json | #### Submission Checklist
- [x] Run unit tests: `./runTests.py src/test/unit`
- [x] Run cpplint: `make cpplint`
- [x] Declare copyright holder and open-source license: see below
#### Summary
Add callback writer to output JSON data.
#### Intended Effect
Allow structured outputs in JSON format, per desig... | diff --git a/src/stan/callbacks/json_writer.hpp b/src/stan/callbacks/json_writer.hpp
new file mode 100644
index 00000000000..59274aca68d
--- /dev/null
+++ b/src/stan/callbacks/json_writer.hpp
@@ -0,0 +1,375 @@
+#ifndef STAN_CALLBACKS_JSON_WRITER_HPP
+#define STAN_CALLBACKS_JSON_WRITER_HPP
+
+#include <stan/math/prim/fu... | 14 | 11 | 6 | [{"id": "G0", "claim": "The added operator()(const std::tuple<Eigen::VectorXd, Eigen::VectorXd>&) overload of unique_stream_writer serves no purpose in this writer and should not be part of the change.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Becau... | null |
stan-dev__stan__3202 | stan-dev/stan | 3,202 | defect | ca02539f03e071108e8466fbe0f0991761dde1f1 | 59885de1464dc67dbb7d9cabfbb992bdb2f27fe4 | Issue/3200 pathfinder diagnostic | #### Submission Checklist
- [x] Run unit tests: `./runTests.py src/test/unit`
- [x] Run cpplint: `make cpplint`
- [x] Declare copyright holder and open-source license: see below
#### Summary
Add hooks to json_writer to put newlines around records and update single-path pathfinder accordingly.
- begin_reco... | diff --git a/src/stan/callbacks/json_writer.hpp b/src/stan/callbacks/json_writer.hpp
index 7f8d254e673..3dd3321f5e1 100644
--- a/src/stan/callbacks/json_writer.hpp
+++ b/src/stan/callbacks/json_writer.hpp
@@ -46,6 +46,7 @@ class json_writer {
void write_record_comma_if_needed() {
if (record_depth_ > 0 && record... | 5 | 4 | 2 | [{"id": "G0", "claim": "No pathfinder unit test checks the output files, so tests should be added covering single-path pathfinder's diagnostic output.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The newline handling is not clean — a new newline() fun... | null |
stan-dev__stan__3227 | stan-dev/stan | 3,227 | defect | 6d35a762bf56c72fef574302e5af4b9c70703625 | 28ea32713a8cdcfe3961e54f5469e3ed5578f92a | Make json_writer a structured_writer, improve output formatting | #### Submission Checklist
- [x] Run unit tests: `./runTests.py src/test/unit`
- [x] Run cpplint: `make cpplint`
- [x] Declare copyright holder and open-source license: see below
#### Summary
Follow up on #3191.
This PR:
- Improves the output of the JSON writer to be a bit more human readable (mainly by m... | diff --git a/src/stan/callbacks/json_writer.hpp b/src/stan/callbacks/json_writer.hpp
index 54f54bf3850..d9995ea1d77 100644
--- a/src/stan/callbacks/json_writer.hpp
+++ b/src/stan/callbacks/json_writer.hpp
@@ -3,6 +3,7 @@
#include <stan/math/prim/fun/Eigen.hpp>
#include <stan/math/prim/meta.hpp>
+#include <stan/call... | 4 | 2 | 1 | [{"id": "G0", "claim": "The `write_int_like` helper should be named `write_` (with a signature constrained to integral types via `stan::require_integral_t`) instead of accepting anything valid for `operator<<`.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim":... | null |
stan-dev__stan__3248 | stan-dev/stan | 3,248 | defect | 4637f9494db2d48d6dfd573505fe9053d0b4be5c | a4c1c5e1591b47678eed2f35d9701d10929a6931 | Feature/3247 json metric type - add field "metric_type" to metric.json file | #### Submission Checklist
- [x] Run unit tests: `./runTests.py src/test/unit`
- [x] Run cpplint: `make cpplint`
- [x] Declare copyright holder and open-source license: see below
#### Summary
Add field "metric_type" with values "diag_e", "dense_e", and "unit_e" to json metric file.
#### Intended Effect
... | diff --git a/src/stan/mcmc/hmc/base_hmc.hpp b/src/stan/mcmc/hmc/base_hmc.hpp
index d170ff4f6b3..9895b10f6ca 100644
--- a/src/stan/mcmc/hmc/base_hmc.hpp
+++ b/src/stan/mcmc/hmc/base_hmc.hpp
@@ -71,6 +71,7 @@ class base_hmc : public base_mcmc {
struct_writer.begin_record();
struct_writer.write("stepsize", get_n... | 2 | 2 | 1 | [{"id": "G0", "claim": "The metric_type field should be written before the actual metric itself in write_sampler_state_struct, so that a reader can pre-allocate for the metric before reading it.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The three pa... | null |
stan-dev__stan__3249 | stan-dev/stan | 3,249 | defect | 1c85085b596bca920f1a1fd216e6dcb1b4bd6974 | f2369aea3ad5576c03aea2e57cb274c87edb70e5 | Adds option to turn off psis resampling and lp calculation for pathfinder | #### Submission Checklist
- [x] Run unit tests: `./runTests.py src/test/unit`
- [x] Run cpplint: `make cpplint`
- [x] Declare copyright holder and open-source license: see below
#### Summary
Adds the request from @avehtari in #3242 to add an option for turning off resampling and calculating the lp.
If `p... | diff --git a/src/stan/services/pathfinder/multi.hpp b/src/stan/services/pathfinder/multi.hpp
index 585a5ebffa9..b46ace8a65e 100644
--- a/src/stan/services/pathfinder/multi.hpp
+++ b/src/stan/services/pathfinder/multi.hpp
@@ -77,6 +77,14 @@ namespace pathfinder {
* @param[in,out] parameter_writer output for parameter ... | 5 | 4 | 1 | [{"id": "G0", "claim": "The total elapsed time should also be printed when PSIS resampling was not performed.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The template Eigen::Array overload added to in_memory_writer in the pathfinder test util is ... | null |
stan-dev__stan__3266 | stan-dev/stan | 3,266 | defect | a0154340ce1f195de01839075adad25e10bf28d5 | 5630c51d0c4e0977ccf8ef003fb3a50af9611dc1 | Improved rhat diagnostic | #### Submission Checklist
- [ ] Run unit tests: `./runTests.py src/test/unit`
- [ ] Run cpplint: `make cpplint`
- [ ] Declare copyright holder and open-source license: see below
#### Summary
Solving issue #3269
Changes in compute_potential_scale_reduction, based on [Vehtari](https://arxiv.org/abs/1903.08008)
... | diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp
index 5ae43c8205c..17a0197104b 100644
--- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp
+++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp
@@ -8,6 +8,7 @@... | 13 | 11 | 2 | [{"id": "G0", "claim": "Store Eigen matrix sizes in `Eigen::Index` rather than `int` (making sizes that will not change const), including everywhere else that uses int for Eigen matrix sizes.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Keep t... | null |
stan-dev__stan__3298 | stan-dev/stan | 3,298 | defect | 7e76f26f347fcdcb71fcc28d23a527a220c6ce56 | 7647dc558ac591fd8786450776302442aec63701 | row/col stochastic matrix for deserializer and serializer | #### Submission Checklist
- [x] Run unit tests: `./runTests.py src/test/unit`
- [x] Run cpplint: `make cpplint`
- [x] Declare copyright holder and open-source license: see below
#### Summary
Adds the serializer and deserializer functions for those constraints
#### Intended Effect
Used upstream by compi... | diff --git a/make/cpplint b/make/cpplint
index 79b977478ea..2bdd7c5b408 100644
--- a/make/cpplint
+++ b/make/cpplint
@@ -1,4 +1,4 @@
-PYTHON ?= python
+PYTHON ?= python3
.PHONY: cpplint
cpplint:
diff --git a/src/stan/io/deserializer.hpp b/src/stan/io/deserializer.hpp
index ae3490010c8..0c51a9eb90e 100644
--- a/src/... | 1 | 1 | 0 | [{"id": "G0", "claim": "For consistency, call the existing math overload that checks the template parameter (stochastic_row_constrain/stochastic_column_constrain with the Jacobian template argument) instead of branching on Jacobian locally, for both the row and the column stochastic reader.", "category": "design", "ver... | null |
stan-dev__stan__3303 | stan-dev/stan | 3,303 | defect | cd8b2e0e6c0b28658754bd12c239a29f7cac01c5 | f185f0815fdc41585f81539528c0ee837f0628e2 | Fix and add unit tests for issue 3071 - adaptive sampler runs on models w/ zero params. | #### Submission Checklist
- [x] Run unit tests: `./runTests.py src/test/unit`
- [x] Run cpplint: `make cpplint`
- [x] Declare copyright holder and open-source license: see below
#### Summary
PR https://github.com/stan-dev/stan/pull/3071 had a failing unit test; this PR fixes that test and adds a test to demo... | diff --git a/src/test/test-models/good/services/zero_params.stan b/src/test/test-models/good/services/zero_params.stan
new file mode 100644
index 00000000000..46cb64ecfe8
--- /dev/null
+++ b/src/test/test-models/good/services/zero_params.stan
@@ -0,0 +1,7 @@
+transformed data {
+ int N = 2;
+}
+generated quantities {
... | 1 | 1 | 0 | [{"id": "G0", "claim": "The rewritten read_dense_sz0 test is incorrect and should keep using create_unit_e_dense_inv_metric (just not typed as io::dump), following the `auto` style used elsewhere in the file.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
stan-dev__stan__3318 | stan-dev/stan | 3,318 | defect | 595ae416900093bdaa1309634c927a4814038b49 | fa3a6fa2d0ebfefdd0e046ccdae921aa539ab007 | chainset::quantiles function catches exceptions raised by stan::math::quantiles when sample contains NaN's | #### Submission Checklist
- [x] Run unit tests: `./runTests.py src/test/unit`
- [ ] Run cpplint: `make cpplint`
- [x] Declare copyright holder and open-source license: see below
#### Summary
For samples where one or more draws is NaN, function `stan::math::quantiles` throws a `std::invalid_argument` exceptio... | diff --git a/src/stan/io/stan_csv_reader.hpp b/src/stan/io/stan_csv_reader.hpp
index 0ca732e32b4..36e5ec551d5 100644
--- a/src/stan/io/stan_csv_reader.hpp
+++ b/src/stan/io/stan_csv_reader.hpp
@@ -334,7 +334,12 @@ class stan_csv_reader {
for (int col = 0; col < cols; col++) {
std::getline(ls, line, ... | 5 | 5 | 1 | [{"id": "G0", "claim": "The stan csv reader parses numbers with istream operator>>, which is not defined for nan or infinite values, so nan draws are silently treated as zero in a platform-dependent way; csv_reader should use std::stod rather than a stringstream and >>.", "category": "correctness", "verdict": "supporte... | null |
standard__standard__1775 | standard/standard | 1,775 | defect | 40f573d57e791b6c46e1b3508ef67ddfe65995fa | 91e5a093b9a07bce7f7f53a929d4577c22872ee8 | fix: update `eslint-config-standard-jsx` | We need https://github.com/standard/eslint-config-standard-jsx/pull/44 to fix #1548
**What is the purpose of this pull request? (put an "X" next to item)**
[ ] Documentation update
[x] Bug fix
[ ] New feature
[ ] Other, please explain:
**What changes did you make? (Give an overview)**
Ensuring the `ecmaV... | diff --git a/package.json b/package.json
index 7f5f7adae..e41d0b903 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,7 @@
"dependencies": {
"eslint": "^8.8.0",
"eslint-config-standard": "17.0.0-1",
- "eslint-config-standard-jsx": "11.0.0-0",
+ "eslint-config-standard-jsx": "11.0.0-1",
"... | 1 | 1 | 1 | [{"id": "G0", "claim": "Add a test case like the one inside eslint-config-standard to guard the updated eslint-config-standard-jsx config against regression.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
standard__standard__1829 | standard/standard | 1,829 | defect | 8d832307d9f4e5875c7c32487e596d29db2cf10f | c36babb35d7728a7ce161ac820169804ff31dcab | Fix test of silent exit on unsupported node.js versions | **What is the purpose of this pull request? (put an "X" next to item)**
[ ] Documentation update
[x] Bug fix
[ ] New feature
[ ] Other, please explain:
**What changes did you make? (Give an overview)**
* Used `version-guard` for the silent exit (this helped identify a mismatch in the version set in `bin/cmd... | diff --git a/.github/workflows/old-test.yml b/.github/workflows/old-test.yml
index 37bc793b8..5261f37e7 100644
--- a/.github/workflows/old-test.yml
+++ b/.github/workflows/old-test.yml
@@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
- node-version: [0.10.48]
+ node-version: [0.10.48, 4]
ste... | 2 | 1 | 0 | [{"id": "G0", "claim": "Explain or drop the `--ignore-scripts` flag newly added to the CI `npm install` steps (it is unexplained and out of scope), and consider setting `ignore-scripts=true` in a root `.npmrc` instead.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1"... | null |
stanford-centaur__smt-switch__102 | stanford-centaur/smt-switch | 102 | defect | 8725a64ba57ce1cddb822d9a527a5ace223271b4 | fbc5506dd56ba505355335bd90e72d574f34636b | Option to include BVAnd/BVOr ops in conjunctive/disjunctive partition | Allows include `bvand` or `bvor` in partition util functions if they are over one-bit bit-vectors. This can be used with boolector which represents booleans as bit-vectors of size one. | diff --git a/include/utils.h b/include/utils.h
index 33f2b00d8..5c3c21ef8 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -50,10 +50,19 @@ inline void Log(std::string msg)
}
}
+namespace smt {
+
// term helper methods
-void conjunctive_partition(const smt::Term &term, smt::TermVec &out);
+void op_partition... | 1 | 1 | 0 | [{"id": "G0", "claim": "Add comments in include/utils.h documenting the new include_bvand/include_bvor parameters of conjunctive_partition/disjunctive_partition, especially the 1-bit bit-vector behavior.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
stanford-centaur__smt-switch__220 | stanford-centaur/smt-switch | 220 | defect | 68a0a4180aefb4de756178c7a42b79d73db1243e | 901afe332bad1e107fb4b8687365d0f33fbffc27 | Various small fixes for Z3 backend | This includes:
* fixes for `make_term(string, sort)`
* fix for `term->to_int`
* adds `BVComp` operator
* compiles Z3 with `--single-threaded` which helped with static linking, but is not a great long term solution
* fixes for quantifiers | diff --git a/CMakeLists.txt b/CMakeLists.txt
index 232636320..ca6992f90 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -99,7 +99,7 @@ if (BUILD_PYTHON_BINDINGS)
find_package(Python3 COMPONENTS Interpreter Development)
endif()
-if (BUILD_CVC4 OR BUILD_MSAT OR BUILD_YICES2)
+if (BUILD_CVC4 OR BUILD_MSAT OR BUI... | 3 | 2 | 0 | [{"id": "G0", "claim": "The comment at the top of contrib/setup-z3.sh about issues creating a static binary with z3 is unclear about what it is supposed to mean to the reader.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The change from make_ter... | null |
stanford-centaur__smt-switch__255 | stanford-centaur/smt-switch | 255 | defect | 5c0c1a0f3ef1e4578f6a8dad066a155fa3eb15fd | 941a25fc3ac78db26eda8ee8ff991069a7145faa | Fix: keep track of symbol declarations in Yices2 and Z3 | To match other solvers, keep track of declared symbols and throw exception if trying to redeclare. I looked into the APIs a bit and it doesn't seem like there's a way to do this without externally keeping a set of used symbols. For Yices2, this is because it has a global symbol table and we want to only enforce this fo... | diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt
index 5f861088e..2c811367d 100644
--- a/tests/unit/CMakeLists.txt
+++ b/tests/unit/CMakeLists.txt
@@ -15,6 +15,7 @@ switch_add_unit_test(unit-solving-interface)
switch_add_unit_test(unit-sort)
switch_add_unit_test(unit-sort-inference)
switch_add_unit... | 1 | 1 | 1 | [{"id": "G0", "claim": "Redeclaring a symbol in an incremental context (e.g. the linked legal SMT-LIB input) would now wrongly trigger an exception, and if that is not considered a problem, a corresponding test should be added.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"... | null |
stanford-centaur__smt-switch__346 | stanford-centaur/smt-switch | 346 | defect | f306626821b0fcef13f034150663ecca48713214 | 4a77a289c60d24315c0431372be0accf020733a5 | Add datatype support for z3 | Hi all,
I'm trying to play with smt-switch and decide to add z3 backend support for datatypes. Any feedback is welcome. | diff --git a/.gitignore b/.gitignore
index 4eb89f3ea..b01e63ad1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,3 +42,5 @@ deps/CVC4/
deps/
local/
+.cache/
+.vscode/
diff --git a/contrib/setup-z3.sh b/contrib/setup-z3.sh
index a04c25a3a..93821e748 100755
--- a/contrib/setup-z3.sh
+++ b/contrib/setup-z3.sh
@@ -1,13 ... | 8 | 5 | 0 | [{"id": "G0", "claim": "The new core-count detection block perhaps does not belong in this PR and could move to a separate PR, giving the user an option to choose the number of cores.", "category": "design", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "If the switch to cmake ... | null |
stanford-centaur__smt-switch__60 | stanford-centaur/smt-switch | 60 | defect | b843f56066b37f67d273b7fd8fa382d3c0936232 | 89365b4b800b604add1d94631ab3c718c3590dde | Add unsat core support | Adds support for querying backend solvers for unsat cores. After some discussion, we decided the interface should use `check_sat_assuming`. Thus, after a call to `check_sat_assuming`, `get_unsat_core` will return a vector with a subset of the assumptions that are sufficient to make the assertions unsat. | diff --git a/btor/include/boolector_solver.h b/btor/include/boolector_solver.h
index ff58cdc78..b39d3556c 100644
--- a/btor/include/boolector_solver.h
+++ b/btor/include/boolector_solver.h
@@ -23,7 +23,7 @@ class BoolectorSolver : public AbsSmtSolver
{
public:
// might have to use std::unique_ptr<Btor>(boolector_... | 5 | 5 | 1 | [{"id": "G0", "claim": "The design of generating unsat cores by tracking assumptions at the smt-switch level (solving with assumptions instead of assertions) is complicated and may lose performance; the messages ask whether a better interface (e.g. tagging assertions, or CVC4's getUnsatAssumptions) should be used inste... | null |
stanford-centaur__smt-switch__81 | stanford-centaur/smt-switch | 81 | defect | 8419640f7cca849c4f75d3000b783b99dd708d9d | 5bd71ccdbe37180d79bfdd8598dae1ad2821aa90 | 2nd part of sort casting PR | This one uses the method from https://github.com/makaimann/smt-switch/pull/78 in the term translator to make sure terms are well-sorted on the fly when translating. | diff --git a/btor/src/boolector_term.cpp b/btor/src/boolector_term.cpp
index 3ceb3569f..6eb0fe083 100644
--- a/btor/src/boolector_term.cpp
+++ b/btor/src/boolector_term.cpp
@@ -50,7 +50,9 @@ const std::unordered_map<BtorNodeKind, PrimOp> btorkind2primop({
{ BTOR_PARAM_NODE, NUM_OPS_AND_NULL },
{ BTOR_BV_SLICE... | 3 | 2 | 1 | [{"id": "G0", "claim": "Add an example to the TermTranslator class documentation illustrating the scenario where translating terms from more than one solver fails.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The reviewer questions whether TermT... | null |
stanford-centaur__smt-switch__84 | stanford-centaur/smt-switch | 84 | defect | 231c1a492e3c9fd9c73bae95ad8227ce0decfc44 | 29a05acbee9b34ca421ed4c45b3b929d4f9b450c | Fix for constant array term iteration in CVC4 + tests | Smt-switch uses term iteration to get the constant array base of a constant array. For example, if `t` is a constant array, the base is `*(t->begin())`. CVC4 does not have this same representation. Previously, term iteration for the CVC4 backend used the `::CVC4::api::Term::const_iterator` directly. This PR would inste... | diff --git a/cvc4/include/cvc4_term.h b/cvc4/include/cvc4_term.h
index a59f5c622..6a2ec828e 100644
--- a/cvc4/include/cvc4_term.h
+++ b/cvc4/include/cvc4_term.h
@@ -44,22 +44,22 @@ namespace smt {
class CVC4TermIter : public TermIterBase
{
public:
- CVC4TermIter(const ::CVC4::api::Term::const_iterator term_... | 2 | 2 | 2 | [{"id": "G0", "claim": "The copy constructor should copy the other iterator's term member, not self-assign, i.e. `term = it.term` as in the suggestion block.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "operator!= should compare against it.term, n... | null |
stanford-futuredata__ColBERT__140 | stanford-futuredata/ColBERT | 140 | defect | 6914396f4dcd3d5ec33f7a82c13e4af67e82b1d0 | 8930e6bde92cce37d5265955393b65ffdf494cf2 | Incremental indexing v2 | I refactored the remove-passages functionality into the new API. Now the user can either update only the Searcher (avoids reloading whole index), or choose to have their update persisted to disk as well.
I'll implement the add-passages part soon, with the same optional persist-to-disk functionality -- hopefully bef... | diff --git a/colbert/__init__.py b/colbert/__init__.py
index 907bec97..1c2ee8a6 100644
--- a/colbert/__init__.py
+++ b/colbert/__init__.py
@@ -1,5 +1,6 @@
from .trainer import Trainer
from .indexer import Indexer
from .searcher import Searcher
+from .incremental_indexer import PassageRemover, PassageAppender
-from... | 7 | 6 | 2 | [{"id": "G0", "claim": "Rename the loop variable `l` in `_remove_pid_from_ivf` to `length` because `l` is easily confused with `1`.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Persisting to disk should be a separate function that commits all ... | null |
stanford-futuredata__ColBERT__205 | stanford-futuredata/ColBERT | 205 | defect | 83658dcab6b48ec089c186508355b55efb6e2ba8 | 45095d710a7d6cea3a856d915e3032560d35c123 | Adding index coalescing script | Usage:
python -m colbert.utils.coalesce --input=/pathto/msmarco.index/
--output=/pathto/msmarco_single.index/ | diff --git a/colbert/utils/coalesce.py b/colbert/utils/coalesce.py
new file mode 100644
index 00000000..fb535fa2
--- /dev/null
+++ b/colbert/utils/coalesce.py
@@ -0,0 +1,80 @@
+import os
+import argparse
+import torch
+from tqdm import tqdm
+import ujson
+
+
+def main(args):
+ num_chunks = args.index_size
+
+ in_... | 1 | 1 | 0 | [{"id": "G0", "claim": "num_chunks should be read from the provided index (its metadata) rather than having the user specify it via a required CLI flag.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
stanford-futuredata__macrobase__114 | stanford-futuredata/macrobase | 114 | defect | 352049f82edc071c64100dfcbf6a78db54069364 | 57f4f0404b6a5e6ba8c9a859d7529cb4112ce03e | TreeKDE bugfix, consistent data ordering, classifier dumping | Preparing some groundwork for running experiments on tree base KDE. There are three main changes here:
1) Added a new type of classifier, DumpClassifier.
It just wraps another classifier, forwards its output, but also dumps the data to a file. Dumping can be enabled or disabled in the standard pipeline with a conf fl... | diff --git a/conf/local_kde.yaml b/conf/local_kde.yaml
new file mode 100644
index 000000000..f8a452f4b
--- /dev/null
+++ b/conf/local_kde.yaml
@@ -0,0 +1,28 @@
+macrobase.query.name: testTasks
+
+macrobase.loader.loaderType: CSV_LOADER
+macrobase.loader.csv.file: test_data/us_energy_0p1.csv.gz
+macrobase.loader.csv.com... | 8 | 6 | 0 | [{"id": "G0", "claim": "The percentile cutoff (and related median/max) statistics in BatchingPercentileClassifier should be logged at debug rather than info.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new OutlierClassifierImpl abstract c... | null |
stanford-futuredata__macrobase__116 | stanford-futuredata/macrobase | 116 | defect | d20a5c65248bc51740a54144c61d4292b3c0b7cb | 7c46de1a1286ba3987b9723f88a208b4fab288b2 | Arbitrary pipelines from command line. | This PR allows users to run arbitrary pipelines from the command line.
Major changes:
- Removes the `batch` and `streaming` commands from the MacroBase Dropwizard application.
- Adds a new `pipeline` command to the MacroBase Dropwizard application.
- `pipeline` dynamically constructs a `Pipeline` instance with class d... | diff --git a/bench/batch_template.conf b/bench/batch_template.conf
index 1820368d8..cd91f9da3 100644
--- a/bench/batch_template.conf
+++ b/bench/batch_template.conf
@@ -1,4 +1,6 @@
macrobase.query.name: %(macrobase.query.name)s
+macrobase.pipeline.class: macrobase.analysis.pipeline.BasicBatchedPipeline
+
macrobase.lo... | 3 | 2 | 0 | [{"id": "G0", "claim": "bin/batch.sh and bin/streaming.sh are pretty much identical, so they should be merged into one script (e.g. taking the config file as the first argument) or forced to batch/streaming via command line arguments.", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "pre_exist... | null |
stanford-futuredata__macrobase__117 | stanford-futuredata/macrobase | 117 | defect | d20a5c65248bc51740a54144c61d4292b3c0b7cb | 43322388bbcfeefa33b5688a9577e2e2c0409d0f | GridDumpingPipeline | Creates a new pipeline that will dump scores both into a density grid and before/after score pairs of batchFeatureTransform
main goal of this PR is to be able to dump scored grid of the data
| diff --git a/bin/grid.sh b/bin/grid.sh
new file mode 100755
index 000000000..b9b6be7eb
--- /dev/null
+++ b/bin/grid.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+conf_file=${1:-"conf/batch.yaml"}
+
+set -x
+
+java ${JAVA_OPTS} -cp "src/main/resources/:target/classes:target/lib/*:target/dependency/*" macrobase.MacroBase grid $conf_fil... | 2 | 1 | 0 | [{"id": "G0", "claim": "Code that the upcoming command-line refactor makes unnecessary (such as the standalone MacroBaseGridCommand) is only acceptable temporarily and should be removed once that refactor lands.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G... | null |
stanford-futuredata__macrobase__176 | stanford-futuredata/macrobase | 176 | defect | 5b6b6503279bde0b92581160f62035d1f247e139 | b8680ef5ce8f117fc6e69c8172764aafa71b7afd | Batch window average | The commit includes the following changes:
- Rename WINDOW_SIZE in MacroBaseConf to TIME_WINDOW, to make it clear that
- Change Datum's time type from int to long, since int might be too small to express large time intervals in miliseconds
- Implemented batch window average
| diff --git a/contrib/src/main/java/macrobase/analysis/stats/MovingAverage.java b/contrib/src/main/java/macrobase/analysis/stats/MovingAverage.java
index 6f78ff316..0b17bc6d9 100644
--- a/contrib/src/main/java/macrobase/analysis/stats/MovingAverage.java
+++ b/contrib/src/main/java/macrobase/analysis/stats/MovingAverage.... | 2 | 2 | 0 | [{"id": "G0", "claim": "BatchWindowAvg should accumulate the average in a double[] instead of a RealVector, since double[] is faster and an ArrayRealVector can be created from it at the end.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Was there a... | null |
stanford-futuredata__macrobase__177 | stanford-futuredata/macrobase | 177 | defect | 5b6b6503279bde0b92581160f62035d1f247e139 | cc8aad861d81afa50fbb300df9166f3fe714fc76 | Autocorrelation and TimeDatumStream | More preparations for ASAP:
- Implemented autocorrelation via FFT
- Implemented TimeDatumStream, which allows draining by duration | diff --git a/contrib/src/main/java/macrobase/analysis/pipeline/stream/TimeDatumStream.java b/contrib/src/main/java/macrobase/analysis/pipeline/stream/TimeDatumStream.java
new file mode 100644
index 000000000..2391ea57a
--- /dev/null
+++ b/contrib/src/main/java/macrobase/analysis/pipeline/stream/TimeDatumStream.java
@@ ... | 5 | 5 | 0 | [{"id": "G0", "claim": "GaussianTest.testFitGaussian failed because the 0.01 tolerance in assertArrayEquals is too tight for the fitted covariances; increase the epsilon.", "category": "testing", "verdict": "supported", "priority": "P0", "scope": "pre_existing"}, {"id": "G1", "claim": "ACF_THRESH should be an instance ... | null |
stanford-futuredata__macrobase__189 | stanford-futuredata/macrobase | 189 | defect | f6f24ead27874cf62fa7a797fde4af8e190d3d6a | d3e9ddb11f811d34f7d1224d3cc993f55c0598f5 | Allow overweight items in AChao sampler | Two fixes to the core reservoir sampler:
1. p(insertion) should be (res_size * weight) / (total weight in res). Before, we only had (weight) / (total weigh in res), which is incorrect.
2. We haven't been handling "overweight" items, where (res_size * weight) / (total weight) > 1. The right thing to do here ([sour... | diff --git a/core/src/main/java/macrobase/analysis/sample/AChao.java b/core/src/main/java/macrobase/analysis/sample/AChao.java
index 9c3eba91d..ee52ceea6 100644
--- a/core/src/main/java/macrobase/analysis/sample/AChao.java
+++ b/core/src/main/java/macrobase/analysis/sample/AChao.java
@@ -1,18 +1,45 @@
package macrobas... | 2 | 1 | 0 | [{"id": "G0", "claim": "The reviewer questions why the assertion that the overweight-items list never exceeds reservoirCapacity is guaranteed, noting the list could be very big, and suggests taking only the first n elements instead.", "category": "correctness", "verdict": "opposed", "priority": "P2", "scope": "introduc... | null |
stanford-futuredata__macrobase__200 | stanford-futuredata/macrobase | 200 | defect | 97c87776ffed0baf14d9bd4f051eb733dee27924 | abdd6c2506a9007756e7088956f53ad61006b58e | Fixing UI for CSV Compatibility | Results from CSV files can now be plotted and explored.
Results are minimized by default, ordered by OI-Ratio; no sort panel.
Results are color coded based on severity (hardcoded thresholds).
| diff --git a/conf/batch.yaml b/conf/batch.yaml
index 11a890357..b3b355650 100644
--- a/conf/batch.yaml
+++ b/conf/batch.yaml
@@ -9,7 +9,7 @@ macrobase.analysis.transformType: MAD_OR_MCD
macrobase.loader.db.baseQuery: SELECT * FROM sensor_data_demo;
-macrobase.analysis.minSupport: 0.001
+macrobase.analysis.minSuppo... | 7 | 7 | 1 | [{"id": "G0", "claim": "The PR should add tests for the new getRows/includeRow functions added to CSVIngester (and the DataIngester default).", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "RiskRatioResult's accessors can simply be get() and getCorrected... | null |
stanford-futuredata__macrobase__209 | stanford-futuredata/macrobase | 209 | defect | 6407090419b8f9fddf7399bdec2adad8874db040 | 19654c269297f32602273e9a6c70c439a6487ae3 | Separating fpg and apriori code, cleanup | Adding new explanation result classes that keep track of
raw counts for both interpretability and extensibility. This involved
separating the fpg and apriori dependencies, in the future we can merge
fpgrowth to use the new code.
Compare ItemsetResult with ExplanationResult, note how ExplanationResult is easier to... | diff --git a/build.sh b/build.sh
new file mode 100755
index 000000000..44cfe067c
--- /dev/null
+++ b/build.sh
@@ -0,0 +1 @@
+cd lib; mvn install; cd ../core ; mvn clean ; mvn package ; cd ../
diff --git a/core/src/main/java/edu/stanford/futuredata/macrobase/pipeline/BasicBatchPipeline.java b/core/src/main/java/edu/stan... | 7 | 3 | 0 | [{"id": "G0", "claim": "Add a config option to set the maximum order of itemsets mined by the apriori summarizer instead of the hard-coded limit of 3.", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "Prefer enums over string parameters for selecting the ... | null |
stanfordnlp__dspy__1502 | stanfordnlp/dspy | 1,502 | defect | 1695870fa270fc06eb3c1e26510efd2b4cb09e3a | 974937d7762eb124f5e84f4d99daecd14587379d | Typo/nit fixes and add tests for BoostrapWithRandomSearch | Fix a few odds in the BootstrapFewShotWithRandomSearch optimizer:
- Zombie code should be deleted.
- f-string for print/logging.
- variable names like `program2` are confusing.
Also added basic unit test case for BootstrapFewShotWithRandomSearch. | diff --git a/dspy/teleprompt/random_search.py b/dspy/teleprompt/random_search.py
index 23e3e03dd6..ecfdff4b3a 100644
--- a/dspy/teleprompt/random_search.py
+++ b/dspy/teleprompt/random_search.py
@@ -48,16 +48,10 @@ def __init__(
self.max_num_samples = max_bootstrapped_demos
self.max_errors = max_error... | 3 | 1 | 0 | [{"id": "G0", "claim": "The pull request should put back the commented-out max_num_traces code it removed from random_search.py, keeping the commented code as-is until integration decisions are made.", "category": "design", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The debug... | null |
stanfordnlp__dspy__1556 | stanfordnlp/dspy | 1,556 | defect | b3ecf879cc18d6c15a2b8654d217cc34a66489fe | 90a52c410bb0973b72a55604524cee16ea60d7a3 | Fix signature saving at Predict saving | resolve #1045
Change summary:
- Add a `dump_state`/`load_state` pair to Signature class for better modularization.
- Remove the `save_verbose` option, as it doesn't make sense to change input fields to output fields at loading time. As we are doing "weights-only" saving, the signatures' architecture should matc... | diff --git a/dspy/predict/predict.py b/dspy/predict/predict.py
index 236997e8f7..f01c6862c9 100644
--- a/dspy/predict/predict.py
+++ b/dspy/predict/predict.py
@@ -1,16 +1,15 @@
+import logging
import random
+from functools import lru_cache
from pydantic import BaseModel
import dsp
from dspy.predict.parameter im... | 1 | 1 | 1 | [{"id": "G0", "claim": "Introducing an explicit load_state for signatures is risky because its usage may not involve a deep copy, so it can mutate a signature object in place.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
stanfordnlp__dspy__1609 | stanfordnlp/dspy | 1,609 | defect | 16ceaba5f7126ca86e5b50b669975c926b9f8f55 | cdd4cbc61536b2d68aeb1df8f71b51bf4f8e65d3 | Fix TypedPredictor formatting with list output values | Fixes #1567 | diff --git a/dspy/adapters/chat_adapter.py b/dspy/adapters/chat_adapter.py
index 5a20dcff32..27e853213b 100644
--- a/dspy/adapters/chat_adapter.py
+++ b/dspy/adapters/chat_adapter.py
@@ -2,16 +2,34 @@
import json
import re
import textwrap
-from typing import get_args, get_origin
+from typing import Any, Dict, KeysVi... | 6 | 2 | 1 | [{"id": "G0", "claim": "The pull request currently leaves plenty of tests failing (new tests from #1595), so it should not be merged until they pass.", "category": "testing", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "Regression test coverage should be added before merge to... | null |
stanfordnlp__dspy__1735 | stanfordnlp/dspy | 1,735 | defect | 1bab822b366785698883802d48f4078590dee8a6 | 7c51351cbbb81da7848f1c302db4629cf6fbe8a7 | Add `dspy.Embedding` | Very simple `dspy.Embedding` supports:
- Hosted embedding model, we use litellm to send the request, and only take the embedding fields from the response.
- Custom embedding model, users can pass a custom callable to `dspy.Embedding`, and the output is just the custom callable's output.
Added unit test for both ... | diff --git a/dspy/clients/__init__.py b/dspy/clients/__init__.py
index 079dc5420f..12105fe604 100644
--- a/dspy/clients/__init__.py
+++ b/dspy/clients/__init__.py
@@ -1 +1,12 @@
-from .lm import LM
\ No newline at end of file
+from .lm import LM
+import litellm
+import os
+from pathlib import Path
+from litellm.caching... | 3 | 1 | 1 | [{"id": "G0", "claim": "Setting LITELLM_LOCAL_MODEL_COST_MAP (and the litellm cache configuration) in dspy/clients/__init__.py needs to be done before LiteLLM is imported anywhere in DSPy for it to have an effect.", "category": "correctness", "verdict": "opposed", "priority": "P1", "scope": "introduced"}, {"id": "G1", ... | null |
stanfordnlp__dspy__1770 | stanfordnlp/dspy | 1,770 | defect | 0d6b4c2ccf4e0d318193bbec266e6d20c85fc1a1 | 8d8480b48adb0280686fa768fbafcdfa007fe9fc | Databricks finetuning integration | Add Databricks finetuning support.
Most of the complexity results from orchestrating the databricks jobs, this integration handles the following things:
- Create a directory in Databricks Unity Catalog and upload the training data to the directory.
- Kick off the finetuning job.
- After the finetuning is done,... | diff --git a/dspy/__init__.py b/dspy/__init__.py
index 9120f5625d..3b080f1341 100644
--- a/dspy/__init__.py
+++ b/dspy/__init__.py
@@ -66,6 +66,8 @@
BootstrapFewShot = dspy.teleprompt.BootstrapFewShot
BootstrapFewShotWithRandomSearch = dspy.teleprompt.BootstrapFewShotWithRandomSearch
BootstrapRS = dspy.teleprompt.Bo... | 1 | 1 | 1 | [{"id": "G0", "claim": "The wait-for-run and endpoint-deployment logic should live in launch() rather than inside finetune(), which currently blocks until the run finishes and deploys before returning.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
stanfordnlp__dspy__1801 | stanfordnlp/dspy | 1,801 | defect | be83528bc4f0b19a0fbcadf7c095b453347458e2 | d31c63d2f9fb889cc496b7a2db122c80e6d2d9dd | Allow for arbitrary examples containing DSPy.Images | Inspired by #1763 and to close #1767.
Supports using, saving, and loading arbitrary python objects containing images inside examples/signatures.
Prior to this you could only use a single dspy.Image in a signature.
The it does this is through changing how dspy.Images are serialized. The example will turn into `<DSP... | diff --git a/dspy/adapters/chat_adapter.py b/dspy/adapters/chat_adapter.py
index 0b1740542d..0b14d4cd52 100644
--- a/dspy/adapters/chat_adapter.py
+++ b/dspy/adapters/chat_adapter.py
@@ -3,7 +3,7 @@
from dsp.adapters.base_template import Field
from dspy.signatures.signature import Signature
from .base import Adapter... | 4 | 3 | 1 | [{"id": "G0", "claim": "In examples/vlm/mmmu.ipynb the images input field's description should read \"A list of images\" instead of \"An image\", since the field was changed to List[dspy.Image].", "category": "documentation", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Remov... | null |
stanfordnlp__dspy__1881 | stanfordnlp/dspy | 1,881 | defect | 97ca14cdae61b14bb1c2d520ba559e710d2cb7f6 | 7a1a84fe19a6a419da019bb56714785ac7f812bd | Support structured outputs response format based on signature in JSON adapter | Support structured outputs response format based on signature in JSON adapter | diff --git a/dspy/adapters/json_adapter.py b/dspy/adapters/json_adapter.py
index afe2e8c4e9..0e6e1712a9 100644
--- a/dspy/adapters/json_adapter.py
+++ b/dspy/adapters/json_adapter.py
@@ -2,13 +2,15 @@
import enum
import inspect
import json
+import logging
import textwrap
+from copy import deepcopy
from typing impo... | 4 | 3 | 3 | [{"id": "G0", "claim": "The new `_get_structured_outputs_response_format` helper and the structured-outputs request path it enables need test coverage.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Commenting out `@functools.lru_cache` on `cached_litel... | null |
stanfordnlp__dspy__1889 | stanfordnlp/dspy | 1,889 | defect | 69e7bde4864395eb763ed0597587eacbdad30f7f | aa0c0555e6aa6aae229b8a909337074f082da0d9 | Improve DSPy saving | We are reworking DSPy saving in order to make it more robust:
- Introduce whole model saving, users can specify `state_only=False` to save the model architecture along with the state. This is done via cloudpickle.
- Improve the state-only saving to support json and pickle, which resolves the problem that some demos... | diff --git a/dspy/__init__.py b/dspy/__init__.py
index 9e3e85fd2f..1715bfb06e 100644
--- a/dspy/__init__.py
+++ b/dspy/__init__.py
@@ -15,6 +15,7 @@
from dspy.adapters import * # isort: skip
from dspy.utils.logging_utils import configure_dspy_loggers, disable_logging, enable_logging
from dspy.utils.asyncify import a... | 5 | 5 | 2 | [{"id": "G0", "claim": "The save/load API should not have a `use_json` flag; the json/pickle format should be inferred from the file path suffix instead.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The `return_self` flag on Predict.load should be remo... | null |
stanfordnlp__dspy__7861 | stanfordnlp/dspy | 7,861 | defect | 1e69e7e5fb66ed7a453e900ac3537f3ae55ef5e2 | e4f2c008e12f40b6c184caef19f9cbc52c29dac0 | Fix save predict model with LM | This PR enables the serialization of dspy.LM to fix the issue of model saving.
Resolve #7852 | diff --git a/dspy/clients/lm.py b/dspy/clients/lm.py
index 6f5468b84e..617f532230 100644
--- a/dspy/clients/lm.py
+++ b/dspy/clients/lm.py
@@ -246,6 +246,10 @@ def copy(self, **kwargs):
new_instance.kwargs[key] = value
return new_instance
+
+ def dump_state(self):
+ # TODO: cal... | 3 | 3 | 2 | [{"id": "G0", "claim": "Callbacks do not belong to the LM state, so dump_state should not save them (rather than just noting they cannot be saved).", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "dump_state should explicitly list the attributes to save in... | null |
stanfordnlp__dspy__7991 | stanfordnlp/dspy | 7,991 | defect | 4b07ae5a9f9833cfb0e1b443899a4e0ec84e8341 | 6f7e8a4287f2f70ba5691d79b6fadbdea72aa727 | Refactor evaluate and introduce construct_result_table method | We want to make `result_df` of the evaluate call available outside of the `Evaluate.__call__` method. In this PR, we refactored the logic flow and introduced `construct_result_table` method that will be patched by tracing tools. | diff --git a/dspy/evaluate/evaluate.py b/dspy/evaluate/evaluate.py
index 50be80a1e7..d98f8755f8 100644
--- a/dspy/evaluate/evaluate.py
+++ b/dspy/evaluate/evaluate.py
@@ -1,6 +1,6 @@
import logging
import types
-from typing import TYPE_CHECKING, Any, Callable, List, Optional
+from typing import TYPE_CHECKING, Any, Ca... | 1 | 1 | 1 | [{"id": "G0", "claim": "The display_table parameter should not be typed and documented as Tuple[bool, int]; the reviewer suggests a Union and, ultimately, just the int max-rows number.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
stanfordnlp__dspy__8003 | stanfordnlp/dspy | 8,003 | defect | fd67cf09b82e4529459d8616bc481c3c33312208 | 9145f40838c323edb3c106080c77cae8a6dccf9e | Change the output interface of evaluate | In this PR, we change the output interface of `Evaluate.__call__`.
Instead of returning either score, (score, outputs), (score, scores, outputs) based on arguments, it will always return EvaluationResult containing the following fields:
- score: A float percentage score (e.g., 67.30) representing overall performanc... | diff --git a/dspy/evaluate/evaluate.py b/dspy/evaluate/evaluate.py
index 4fcc1f76c1..94a686e89c 100644
--- a/dspy/evaluate/evaluate.py
+++ b/dspy/evaluate/evaluate.py
@@ -56,8 +56,6 @@ def __init__(
display_progress: bool = False,
display_table: Union[bool, int] = False,
max_errors: int = 5,
... | 3 | 2 | 1 | [{"id": "G0", "claim": "The extra all_scores/all_outputs fields on the Prediction returned by Evaluate.__call__ are unnecessary; it can simply carry the per-example outputs instead.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "In Prediction.__eq__, the... | null |
stanfordnlp__dspy__8011 | stanfordnlp/dspy | 8,011 | defect | a48eff096df0a2ac694403647dbd07edd6933cf3 | 1ebea1c80358d2d0788b081f437ffa6e4c827fee | Introduce two step adapter | This PR introduces a new adapter that calls a reasoning model to produce a text and then let a smaller model parse the text and extract structured data.
## Quick testing
**Math subset**
Two step adapter using o3-mini as the main LM and 4o-mini as an extractor increases the performance on 50 sample subsets of t... | diff --git a/dspy/__init__.py b/dspy/__init__.py
index 70e7de708a..3e440344a1 100644
--- a/dspy/__init__.py
+++ b/dspy/__init__.py
@@ -8,7 +8,7 @@
from dspy.evaluate import Evaluate # isort: skip
from dspy.clients import * # isort: skip
-from dspy.adapters import Adapter, ChatAdapter, JSONAdapter, Image, History ... | 12 | 10 | 1 | [{"id": "G0", "claim": "The comment \"Format demos in a natural way\" is unclear without looking at the code and can be deleted.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The docstring example should be simplified to `cot = dspy.ChainOfThou... | null |
stanfordnlp__dspy__8014 | stanfordnlp/dspy | 8,014 | defect | e5dac27366ffa79b13d6f335fd33e7bdcadbf900 | d96804c649f0d477c0e5bf219e9dddd0aecb04df | Add usage tracking | Per community request, we are adding usage tracking for DSPy program. As an overview:
- We track the LM usage in the openai (litellm) format for each program call
- Local cache hit will cause no usage
- If multiple LMs are used in the process, they will be tracked separately.
- The returned usage is a dictionary... | diff --git a/dspy/__init__.py b/dspy/__init__.py
index 74cad5a39d..70e7de708a 100644
--- a/dspy/__init__.py
+++ b/dspy/__init__.py
@@ -13,6 +13,7 @@
from dspy.utils.asyncify import asyncify
from dspy.utils.saving import load
from dspy.utils.streaming import streamify
+from dspy.utils.usage_tracker import track_usage... | 6 | 3 | 1 | [{"id": "G0", "claim": "If a program's output field is already named `lm_usage`, assigning `output.lm_usage = usage_tracker.get_total_tokens()` would clash with that field, so the collision should be made more robust (the author proposed changing the property to a method).", "category": "design", "verdict": "supported"... | null |
stanfordnlp__dspy__8130 | stanfordnlp/dspy | 8,130 | defect | 103d3d7b336c58c3ab659d002b2a7b57766937c2 | 94fd6c5337753a2300c0358b80917ed6feb9e2ac | Add `dspy.Tool.from_mcp_tool` | This PR introduces a util method to convert an MCP tool into a DSPy async tool. Taking over https://github.com/stanfordnlp/dspy/pull/8128, and combined with the follow-up change of async tool execution mentioned [here](https://github.com/stanfordnlp/dspy/pull/8106#discussion_r2059439157), we will enable DSPy users to u... | diff --git a/dspy/utils/__init__.py b/dspy/utils/__init__.py
index 84178e4910..17a3637fde 100644
--- a/dspy/utils/__init__.py
+++ b/dspy/utils/__init__.py
@@ -1,6 +1,7 @@
from dspy.utils.callback import BaseCallback, with_callbacks
from dspy.utils.dummies import DummyLM, DummyVectorizer, dummy_rm
from dspy.streaming... | 1 | 1 | 1 | [{"id": "G0", "claim": "The new `convert_mcp_tool` export in dspy.utils should perhaps instead be exposed as `dspy.Tool.from_mcp(...)` on the Tool class.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
stanfordnlp__dspy__8217 | stanfordnlp/dspy | 8,217 | defect | 21ff0dc3ac0b02f0fcce8f742fc3e44e525b13b6 | 0a7b2d4499828eb591449ab318f02446d4a34833 | Provide a standard base class for creating custom Signature field type | Modifying from #8210 by @arnavsinghvi11.
`dspy.BaseType` will be the base class for custom types for signature usage, including `dspy.Image`, `dspy.Audio` and so on.
`dspy.History` does not subclass from `dspy.BaseType` because it needs to modify the signature and get formatted as multiturn messages. | diff --git a/dspy/__init__.py b/dspy/__init__.py
index 775018d61b..5ce495e078 100644
--- a/dspy/__init__.py
+++ b/dspy/__init__.py
@@ -8,7 +8,7 @@
from dspy.evaluate import Evaluate # isort: skip
from dspy.clients import * # isort: skip
-from dspy.adapters import Adapter, ChatAdapter, JSONAdapter, TwoStepAdapter,... | 5 | 4 | 1 | [{"id": "G0", "claim": "The reserved custom-type delimiter literals in dspy/adapters/types/base_type.py should be extracted into a named constant instead of being repeated inline.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "split_message_cont... | null |
stanfordnlp__dspy__8246 | stanfordnlp/dspy | 8,246 | defect | 0c7395e237e5409fb5046b7e75ad60d58319e977 | f046178bbb991d94b3693ff85c79d09e995369d0 | Run tests with extra dependencies separately | Currently, the ci pipeline installs all dependencies and runs all tests at a time. But we want to confirm if core tests are passed successfully with minimum dependencies. This PR separate the test steps into two; core dependencies and extra dependencies. This is a prerequisite for the upcoming separation of large depen... | diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml
index 7f077966a6..1c6d9f79c3 100644
--- a/.github/workflows/run_tests.yml
+++ b/.github/workflows/run_tests.yml
@@ -83,6 +83,10 @@ jobs:
args: check --fix-only
- name: Run tests with pytest
run: uv run -p .venv pyt... | 3 | 2 | 0 | [{"id": "G0", "claim": "The split into a separate extra-tests step may not be needed: with uv installing all deps takes <1s, the split adds overhead, and the `extra` marker currently has only one test case.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Th... | null |
stanfordnlp__dspy__8394 | stanfordnlp/dspy | 8,394 | defect | 3ded7a6266514c1569452b0e26bcd4e75c1ee6db | 5c741362912f453c53181ac7694ae6244d2e37c6 | compute cache key once | Resolves #8393
Cache key is computed only for incoming request, therefore any modifications made to request by external calls (eg to LiteLLM.completion) does not impact cache. | diff --git a/dspy/clients/cache.py b/dspy/clients/cache.py
index bfa7dbde8b..6abbf7ca72 100644
--- a/dspy/clients/cache.py
+++ b/dspy/clients/cache.py
@@ -96,13 +96,7 @@ def transform_value(value):
params = {k: transform_value(v) for k, v in request.items() if k not in ignored_args_for_cache_key}
retu... | 2 | 2 | 1 | [{"id": "G0", "claim": "The signature of `get` must not be changed from taking a request to taking a precomputed key, because the case where users directly call `get` still has to be handled.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The request get... | null |
stanfordnlp__dspy__8395 | stanfordnlp/dspy | 8,395 | defect | 6e6c378c229a389b904189e24178dd2a5f186391 | 6c9ac55f29d695414ad860fb6e19cc2e1517ad65 | Clean up ChainOfThoughtWithHint in DSPy 3.0 | ## Why
Per suggestion from https://github.com/stanfordnlp/dspy/pull/8382#issuecomment-2975037457, clean up ChainOfThoughtWithHint in DSPy 3.0.
## What
Clean up `ChainOfThoughtWithHint` in DSpy 3.0. DSPy 3.0 is till in pre-release. This PR should be able to catch the 3.0 release train.
| diff --git a/docs/docs/api/modules/ChainOfThoughtWithHint.md b/docs/docs/api/modules/ChainOfThoughtWithHint.md
deleted file mode 100644
index 8ced3770d1..0000000000
--- a/docs/docs/api/modules/ChainOfThoughtWithHint.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# dspy.ChainOfThoughtWithHint
-
-<!-- START_API_REF -->
-::: dspy.Cha... | 1 | 1 | 1 | [{"id": "G0", "claim": "The remaining ChainOfThoughtWithHint references (the TODO-marked Banking77 example in the docs) should be cleaned up in this same PR so the docs do not link to the newly removed public API.", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
stanfordnlp__dspy__8478 | stanfordnlp/dspy | 8,478 | defect | dc9da7a97b263649f8d0a80ae7e5ae89d7baf192 | 124ad8adbecebc7b37434ec129943783722125fb | Add token streaming support for XMLAdapter | Support XMLAdapter in `StreamListener`
## Note
This PR is generated by [OpenAI codex](https://openai.com/codex/), I am testing how deep it can understand DSPy codebase with this specific use case.
It passes on my tests:
```
import asyncio
import dspy
# lm = dspy.LM("gemini/gemini-2.5-flash-preview-04... | diff --git a/dspy/streaming/streaming_listener.py b/dspy/streaming/streaming_listener.py
index 1cedeeaeda..fb3ebbe3d7 100644
--- a/dspy/streaming/streaming_listener.py
+++ b/dspy/streaming/streaming_listener.py
@@ -7,6 +7,7 @@
from dspy.adapters.chat_adapter import ChatAdapter
from dspy.adapters.json_adapter import... | 5 | 4 | 0 | [{"id": "G0", "claim": "start_indicator should be made an instance variable, like start_identifier and end_identifier, instead of a local assigned in each branch.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "A constant should be defined for the list of... | null |
stanfordnlp__dspy__8534 | stanfordnlp/dspy | 8,534 | defect | 33da561aeb38ceb381f61bc99b1b67729baa5477 | 881304900ea840766e5bc57d4678261f373c81c7 | Resolve "$def" for nested tool arg type | Previously when an argument is of type `list[MyPydanticModel]`, then `$def` will be kept inside the json schema. To talk to the LM, we should fully resolve these references. | diff --git a/dspy/adapters/types/tool.py b/dspy/adapters/types/tool.py
index b3e6b45101..843eceed17 100644
--- a/dspy/adapters/types/tool.py
+++ b/dspy/adapters/types/tool.py
@@ -103,7 +103,7 @@ def _parse_function(self, func: Callable, arg_desc: dict[str, str] | None = None
v_json_schema = _resolve_js... | 2 | 1 | 1 | [{"id": "G0", "claim": "The reviewer asks whether it is intentional that the async dummy fixture keeps `notes` an optional str while the sync twin was updated to `list[Note]`, leaving the async path inconsistent with the nested-type case this PR handles.", "category": "correctness", "verdict": "supported", "priority": ... | null |
stanfordnlp__dspy__8566 | stanfordnlp/dspy | 8,566 | defect | 80412ce96d70fdb64dcf2c63940f511d6f89ca44 | c4464c86833223126d5b787cfcf9bc08b0d2f553 | fix(dspy): Fix MCP tool conversion when schema has no input params | ## 📝 Changes Description
Update `convert_input_schema_to_tool_args()` to return `None` when the schema does not have properties.
Then, use a no-argument function instead of an arbitrary argument function in `convert_mcp_tool()` to ensure the resulting `Tool` has `has_kwargs=False`.
Fixes #8565
## ✅ Contrib... | diff --git a/dspy/adapters/types/tool.py b/dspy/adapters/types/tool.py
index 843eceed17..a9ca6aa506 100644
--- a/dspy/adapters/types/tool.py
+++ b/dspy/adapters/types/tool.py
@@ -338,7 +338,7 @@ def resolve_refs(obj: Any) -> Any:
def convert_input_schema_to_tool_args(
schema: dict[str, Any],
-) -> tuple[dict[st... | 3 | 3 | 0 | [{"id": "G0", "claim": "Why does the PR make convert_input_schema_to_tool_args return None instead of {} when the schema has no `properties` — questioning whether the None-return is needed at all?", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Is the new... | null |
stanfordnlp__dspy__8605 | stanfordnlp/dspy | 8,605 | defect | 6259dc46e9c07fe79e2bc7f21506e8a8105f4634 | 5d8071f3ba4718d6cd394518788445d9fa840d08 | Use json mode for serialization | Use json model when serializing Pydantic models to serialize pydantic special types like `pydantic.HttpUrl`
Resolve #8595 | diff --git a/dspy/clients/cache.py b/dspy/clients/cache.py
index 7ba9b0e573..7a9885f1bc 100644
--- a/dspy/clients/cache.py
+++ b/dspy/clients/cache.py
@@ -75,7 +75,7 @@ def transform_value(value):
if isinstance(value, type) and issubclass(value, pydantic.BaseModel):
return value.model_json... | 3 | 3 | 0 | [{"id": "G0", "claim": "Use double quotes for mode=\"json\" in the serialize_object comment so it is consistent with the code.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Rename the vague test name test_pydantic_special_type_serialization to ... | null |
stanfordnlp__dspy__8607 | stanfordnlp/dspy | 8,607 | defect | 6259dc46e9c07fe79e2bc7f21506e8a8105f4634 | 3463eb1ea50680009ce1b981df53ab832056ac49 | Fix infinite growing trace and add tests | We introduced `disable_history` in the past, but `dspy.settings.trace` can still grow infinitely. Technically it's able to be disabled by `dspy.configure(trace=None)`, but we still need a safeguard for the default path.
fix #8604
After this PR, even if users don't explicitly disable history and trace, the memo... | diff --git a/dspy/clients/base_lm.py b/dspy/clients/base_lm.py
index 5247dda718..f0fe486da8 100644
--- a/dspy/clients/base_lm.py
+++ b/dspy/clients/base_lm.py
@@ -5,7 +5,6 @@
from dspy.utils.callback import with_callbacks
from dspy.utils.inspect_history import pretty_print_history
-MAX_HISTORY_SIZE = 10_000
GLOBAL... | 2 | 1 | 1 | [{"id": "G0", "claim": "Using the thread-local setting `settings.max_history_size` to bound GLOBAL_HISTORY may not work properly (the cap on the global, non-thread-local list would follow whichever thread's context is active, e.g. after calls made outside a `dspy.context(max_history_size=...)` block), so this change sh... | null |
stanfordnlp__dspy__8614 | stanfordnlp/dspy | 8,614 | defect | 3e354a675c2fae7d1b6a1a3ea5a7e6241b8e9eb1 | 9b411019ef1a7bc90e06d580a13dce631b06997e | Custom BAMLAdapter to improve structured outputs | Closes #8613.
This PR provides a custom adapter named `BAMLAdapter` that subclasses the existing `JSONAdapter` to improve the quality of structured outputs generated by DSPy pipelines. The proposed adapter is inspired by another open source (Apache 2 licensed) project called [BAML](https://github.com/BoundaryML/baml... | diff --git a/dspy/adapters/baml_adapter.py b/dspy/adapters/baml_adapter.py
new file mode 100644
index 0000000000..fe41f2a74b
--- /dev/null
+++ b/dspy/adapters/baml_adapter.py
@@ -0,0 +1,312 @@
+"""
+Custom adapter for improving structured outputs using the information from Pydantic models.
+Based on the format used by ... | 4 | 3 | 2 | [{"id": "G0", "claim": "BAMLAdapter need not re-implement format_task_description because the method is already implemented in ChatAdapter, i.e. the code is redundant.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The adapter is misleadingly na... | null |
stanfordnlp__dspy__8692 | stanfordnlp/dspy | 8,692 | defect | 6bea90f792c5dcc759089523cc2dd74cc9e36b3e | 56147d450705e5157b46d270f0122de6225fc820 | Support OpenAI response api in LM | Support https://platform.openai.com/docs/api-reference/responses/create
```python
import dspy
dspy.settings.configure(lm=dspy.LM(
"openai/gpt-4.1-mini",
temperature=1.0,
max_tokens=20_000,
model_type="responses",
),)
dspy.Predict("question -> answer")(question="1+1")
-> Prediction(
answ... | diff --git a/dspy/clients/base_lm.py b/dspy/clients/base_lm.py
index c0550b28ea..6aa4e8f84f 100644
--- a/dspy/clients/base_lm.py
+++ b/dspy/clients/base_lm.py
@@ -48,9 +48,17 @@ def __init__(self, model, model_type="chat", temperature=0.0, max_tokens=1000, c
self.kwargs = dict(temperature=temperature, max_toke... | 3 | 2 | 0 | [{"id": "G0", "claim": "Remove the 'merged_kwargs' parameter from the _process_response docstring since it is not part of the method signature.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Extract the message transformation logic duplicated betw... | null |
stanfordnlp__dspy__8712 | stanfordnlp/dspy | 8,712 | defect | 361473cb5fe29c91d0ee7b4fddc2967115f4f80f | ccbb7a3d8df18d51653f30431ad14ceb7d2d3d23 | Add experimental annotation | Add experimental annotation so that users can know in which APIs they should expect breaking changes | diff --git a/dspy/teleprompt/gepa/gepa.py b/dspy/teleprompt/gepa/gepa.py
index a4ea0878c3..8623ecc0de 100644
--- a/dspy/teleprompt/gepa/gepa.py
+++ b/dspy/teleprompt/gepa/gepa.py
@@ -7,6 +7,7 @@
from dspy.clients.lm import LM
from dspy.primitives import Example, Module, Prediction
from dspy.teleprompt.teleprompt imp... | 5 | 4 | 2 | [{"id": "G0", "claim": "The regex match in _get_min_indent_of_docstring could return None, causing an AttributeError when .group() is called, so add a null check or a safer approach.", "category": "correctness", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The type hints on e... | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.