Stop generating unnecessary omni indexes in C++#1508
Conversation
|
Once this is merged I plan on adding the test added here to https://github.com/stan-dev/performance-tests-cmdstan/tree/master/optimizer-stress-models -- since this is a runtime error, testing the result of actually running it will be more useful |
|
I couldn't tell from the PR title what was being done here. I hope the intention is to fix the bug so that the program you list works as intended. In the end, I'd look at not just P.S. I had no idea that there is a |
Yes. If the left-hand-side of an assignment is indexed only with what we call "omni" indexes (blank or |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1508 +/- ##
==========================================
+ Coverage 89.55% 89.56% +0.01%
==========================================
Files 66 66
Lines 9695 9698 +3
==========================================
+ Hits 8682 8686 +4
+ Misses 1013 1012 -1
🚀 New features to boost your workflow:
|
I ran into this while looking at #1295 and it seemed much easier to fix:
If we are using
--O1, with code like:ends up generating an exception complaining that
xhas size0.This case is correctly (...ish, see #1295!) handled when the code is omits the omni indexing, and when
the only indexing done is omni, the extra checks that get done are completely redundant, so we
can in fact just omit them entirely.
Submission Checklist
Release notes
Fixed a bug with assigning to an entire vector or matrix using
:with the--O1flag.Copyright and Licensing
By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)