# Help with the Math library

**URL:** <https://discourse.mc-stan.org/t/help-with-the-math-library/7390>\
**Category:** Developers\
**Tags:** maintenance, math\
**Created:** [January 22, 2019, 4:37pm UTC](https://discourse.mc-stan.org/t/help-with-the-math-library/7390 "2019-01-22T16:37:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![syclik](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/syclik/32/6_2.png) [@syclik](https://discourse.mc-stan.org/u/syclik)\
**Post date:** [January 22, 2019, 4:37pm UTC](https://discourse.mc-stan.org/t/help-with-the-math-library/7390/1 "2019-01-22T16:37:36Z")

</div>

If anyone wants to help with the Math library, I could really use some help paying down technical debt. Some of these are easy and can be done independently, others are a little more complicated.

If you’d like to help, please reach out here. Prerequisites: templated C++ knowledge and an ability to not get super-frustrated with error novels.

Here are immediate things that come to mind:

1. Continuous integration.
  - ~~some of it got messed up over the years. Right now, I know it’s not checking `make test-math-dependencies`. We need to turn that back on, but we currently have errors that prevent us from turning that on.~~ fixed with [math#1107](https://github.com/stan-dev/math/pull/1107)
  - it looks like `make test-headers` is also broken (see [stan-dev/math#1106](https://github.com/stan-dev/math/issues/1106)). We will also need to fix that.

2. Generalized test framework for gradients. See [stan-dev/math#993](https://github.com/stan-dev/math/issues/993). This would make life easier for all developers in the future.
3. Flattening the `mat`, `arr`, `prim` folders. See [stan-dev/math#937](https://github.com/stan-dev/math/issues/937)

There are other things that would be really useful. Some things we desperately need and require less expertise:

1. Documenting and testing our template metaprograms in `meta`. We tend to forget what’s there and write new metaprograms. That’s not good.
2. Splitting the logic for `check_*` functions into `is_*` functions that return a `bool`. I’ve always wanted to expose all the `is_*` functions to the Stan language so it’s easier to error check. There’s no reason we don’t do this.

There’s a ton of other stuff… if anyone wants to help, please reach out.

edit: adding strikeout to what’s been accomplished.

---

<div class="post-metadata">

**Author:** ![Bob\_Carpenter](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bob_carpenter/32/9230_2.png) [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)\
**Post date:** [February 8, 2019, 12:50am UTC](https://discourse.mc-stan.org/t/help-with-the-math-library/7390/2 "2019-02-08T00:50:59Z")

</div>

> [@syclik](#):
>
> We need to turn that back on, but we currently have errors that prevent us from turning that on.

Can we just remove the tests that fail and leave the rest in place?

---

<div class="post-metadata">

**Author:** ![syclik](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/syclik/32/6_2.png) [@syclik](https://discourse.mc-stan.org/u/syclik)\
**Post date:** [February 8, 2019, 3:06pm UTC](https://discourse.mc-stan.org/t/help-with-the-math-library/7390/3 "2019-02-08T15:06:50Z")

</div>

> [@Bob\_Carpenter](#):
>
> Can we just remove the tests that fail and leave the rest in place?

Sorry, I should have been updating this thread. [stan-dev/math#1107](https://github.com/stan-dev/math/pull/1107) fixes the first bullet.

---

<div class="post-metadata">

**Author:** ![stevebronder](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/stevebronder/32/17242_2.png) [@stevebronder](https://discourse.mc-stan.org/u/stevebronder)\
**Post date:** [February 8, 2019, 3:11pm UTC](https://discourse.mc-stan.org/t/help-with-the-math-library/7390/4 "2019-02-08T15:11:52Z")

</div>

> [@syclik](#):
>
> Splitting the logic for `check_*` functions into `is_*` functions that return a `bool` . I’ve always wanted to expose all the `is_*` functions to the Stan language so it’s easier to error check. There’s no reason we don’t do this.

If I can get the rev branch of gpu stuff finished on Saturday I can volunteer to do this on Sunday

---

<div class="post-metadata">

**Author:** ![anon79882417](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@anon79882417](https://discourse.mc-stan.org/u/anon79882417)\
**Post date:** [February 14, 2019, 2:06am UTC](https://discourse.mc-stan.org/t/help-with-the-math-library/7390/5 "2019-02-14T02:06:46Z")

</div>

@syclik I can do whatever you think is appropriate

---

<div class="post-metadata">

**Author:** ![rok\_cesnovar](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@rok\_cesnovar](https://discourse.mc-stan.org/u/rok_cesnovar)\
**Post date:** [February 18, 2019, 6:47pm UTC](https://discourse.mc-stan.org/t/help-with-the-math-library/7390/6 "2019-02-18T18:47:23Z")

</div>

@syclik Is [https://github.com/stan-dev/math/issues/1106](https://github.com/stan-dev/math/issues/1106) still an open issue? Based on Bob’s comments in the discussion I am not sure whether its intended or not?

I am going to tackle some of the metaprograms documenting and tests in the coming days. I will be running some perf tests and will have some downtime to work on this.

---

<div class="post-metadata">

**Author:** ![syclik](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/syclik/32/6_2.png) [@syclik](https://discourse.mc-stan.org/u/syclik)\
**Post date:** [February 19, 2019, 2:57am UTC](https://discourse.mc-stan.org/t/help-with-the-math-library/7390/7 "2019-02-19T02:57:39Z")

</div>

@rok_cesnovar, thanks! You’re right… it’s been fixed. Thanks for helping clean up the issues; it’s really helpful and appreciated.
