-
-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix] add to_arena() when only the first argument is a matrix<var> for elt_multiply #2130
Conversation
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
@@ -67,7 +67,7 @@ auto elt_multiply(const Mat1& m1, const Mat2& m2) { | |||
return ret_type(ret); | |||
} else if (!is_constant<Mat2>::value) { | |||
arena_t<Mat2> arena_m2 = m2_ref; | |||
auto arena_m1 = value_of(m1_ref); | |||
auto arena_m1 = to_arena(value_of(m1_ref)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm there really isn't a way to write a test for this sorta thing is there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve. Leaving this open if you (@SteveBronder) wanted to talk about how we could go about testing this.
If you want to merge and talk about that somewhere else, that's fine with me.
I guess how did you discover it? I assume something segfaulted? Can we turn on the address sanitizer for our tests? That's more aggressive about checking memory I thought. |
Yeah my computer crashed and I was like, "Well that's not good". I think using the address sanitizer is a good idea here. We would need to make sure all the tests call |
Cool. If you don't get around to testing the address sanitizer today, then document this as an issue I suppose. Don't wanna forget about this one cause it's sneaky. |
We talked about something similar with Tadej. Would running such tests weekly + valgrind tests work? Can make an issue and set that up. |
Well if the address sanitizer can catch these errors then could we just turn it on with the unit tests? Or are the unit tests too messy to do that? Or is the sanitizer too slow? I definitely wouldn't want to run valgrind on the unit tests on commit. It would take a week to finish. |
I would definitely run that with unit tests. I can imagine the sanitizer also takes some additional time? If its not much then we can just add it to commit tests yeah.
Yep. |
Summary
Just a quick bug fix, I forgot to wrap the non-var matrix in
to_arena()
inelt_multiply
Tests
No new tests, would there be some way to auto catch these sort of things?
Side Effects
Release notes
Checklist
Math issue #(issue number)
Copyright holder: Steve Bronder
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
the basic tests are passing
./runTests.py test/unit
)make test-headers
)make test-math-dependencies
)make doxygen
)make cpplint
)the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested