Skip to content
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 complex matrix division miscompilation #1421

Merged
merged 2 commits into from
May 3, 2024

Conversation

WardBrian
Copy link
Member

Submission Checklist

  • Run unit tests
  • Documentation
    • If a user-facing facing change was made, the documentation PR is here:
    • OR, no user-facing changes were made

Release notes

Fixed an issue where operator/ was not generating the correct C++ for complex linear algebra types.

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)

Copy link
Contributor

@SteveBronder SteveBronder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -241,6 +251,8 @@ and lower_operator_app op es_in =
| Minus -> lower_binary_op Subtract "stan::math::subtract" es
| Times -> lower_binary_op Multiply "stan::math::multiply" es
| Divide | IntDivide ->
(* XXX: This conditional is probably a sign that we need to rethink how we store Operators
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is XXX? Should this just be NOTE:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've used XXX as basically a FIXME, e.g.

(* XXX move these to a backend specific file?*)
| FnReadParam of

(* XXX fix this up to work with more RNGs *)
| _ -> UReal in

I'm not sure when it started, just that I'm pretty sure it was before my time.

Copy link

codecov bot commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.83%. Comparing base (9e9953f) to head (5b4e80b).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1421      +/-   ##
==========================================
+ Coverage   89.81%   89.83%   +0.01%     
==========================================
  Files          63       63              
  Lines       10480    10484       +4     
==========================================
+ Hits         9413     9418       +5     
+ Misses       1067     1066       -1     
Files Coverage Δ
src/stan_math_backend/Lower_expr.ml 93.48% <100.00%> (+0.33%) ⬆️

@WardBrian WardBrian merged commit 2c42646 into master May 3, 2024
3 checks passed
@WardBrian WardBrian deleted the fix/complex-matrix-division-miscompilation branch May 3, 2024 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants