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 two issues with tuple functions #1356

Merged
merged 16 commits into from
Sep 8, 2023
Merged

Fix two issues with tuple functions #1356

merged 16 commits into from
Sep 8, 2023

Conversation

WardBrian
Copy link
Member

  1. Accidentally returning a reference
  2. Integer arguments failed under certain circumstances, are now templated

These were found because the Stan tests were raising a -Wreturn-stack-address warning. We should try to catch those types of things in stanc going forward.

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 a few issues with the C++ generated for functions which accept tuples as arguments.

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)

1. Accidentally returning a reference

2. Integer arguments failed under certain circumstances, are now templated
@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

Merging #1356 (45e4b82) into master (743d0dd) will increase coverage by 0.04%.
Report is 2 commits behind head on master.
The diff coverage is 97.89%.

❗ Current head 45e4b82 differs from pull request most recent head ca286a2. Consider uploading reports for the commit ca286a2 to get more accurate results

@@            Coverage Diff             @@
##           master    #1356      +/-   ##
==========================================
+ Coverage   89.39%   89.44%   +0.04%     
==========================================
  Files          65       65              
  Lines       10607    10644      +37     
==========================================
+ Hits         9482     9520      +38     
+ Misses       1125     1124       -1     
Files Changed Coverage Δ
src/stan_math_backend/Cpp.ml 86.18% <90.90%> (+0.21%) ⬆️
src/stan_math_backend/Lower_functions.ml 98.80% <98.21%> (+0.13%) ⬆️
src/analysis_and_optimization/Memory_patterns.ml 90.57% <100.00%> (ø)
src/frontend/Ast_to_Mir.ml 94.25% <100.00%> (+0.07%) ⬆️
src/stan_math_backend/Lower_expr.ml 92.85% <100.00%> (ø)
src/stan_math_backend/Lower_program.ml 99.18% <100.00%> (ø)

... and 1 file with indirect coverage changes

@WardBrian
Copy link
Member Author

IMO this will justify a 2.33.1, but the nice thing is the only thing that would be different between the two versions is the Stanc executables.

@rok-cesnovar @serban-nicusor-toptal

@rok-cesnovar
Copy link
Member

Great catch. Do we wait for a few days or just do the patch release?

@WardBrian
Copy link
Member Author

@SteveBronder and I still want to take a slightly deeper look at this, so it might be nice to also see if anything else comes in in the next couple days

@WardBrian
Copy link
Member Author

Ok I think this is finally ready for review @SteveBronder

It's a bit tricky but honestly I think I like the code better now than before.

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.

Two minor comments but imo looks good!

src/frontend/Ast_to_Mir.ml Outdated Show resolved Hide resolved
test/integration/good/code-gen/cpp.expected Outdated Show resolved Hide resolved
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!

@WardBrian WardBrian merged commit 934496d into master Sep 8, 2023
@WardBrian WardBrian deleted the fix/tuple-arg-passing branch September 8, 2023 19:54
@WardBrian
Copy link
Member Author

@rok-cesnovar @serban-nicusor-toptal I think we should try to do 2.33.1 in the middle of next week, giving a few more days for new issues to come in.

At the moment it would just be the 2.33.0 branches from all the repos except for stanc3

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.

3 participants