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 R example and run examples in CI #122

Merged
merged 4 commits into from
May 11, 2023
Merged

Fix R example and run examples in CI #122

merged 4 commits into from
May 11, 2023

Conversation

WardBrian
Copy link
Collaborator

This closes #121 by removing the extra argument (left over from pre- #98) and also adds a line to run each example program as part of our CI to make sure they stay up-to-date.

Copy link
Collaborator

@bob-carpenter bob-carpenter left a comment

Choose a reason for hiding this comment

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

thanks. looks good.

@bob-carpenter
Copy link
Collaborator

The PR looks OK, but there's still a failing test on the Julia side.

@WardBrian
Copy link
Collaborator Author

I can’t figure out the Julia test failure. My current guess is it’s an issue with Julia 1.9.0 which was released yesterday

@roualdes
Copy link
Owner

I've got to move on to other things for now, but here's a quick update on my progress so far. Julia 1.8 and 1.9 output different error messages when tested against the same faulty Stan programs.

  • Load the Stan program test_models/throw_data/throw_data.stan:

Julia 1.8: ERROR: construct(, 204) failed with exception: Exception: find this text: datafails

Julia 1.9: ERROR: construct(, 204) failed with unknown exception

  • Run BridgeStan.log_density(model, rand(1)) with Stan program test_models/throw_lp/throw_lp.stan:

Julia 1.8: ERROR: log_density() failed with exception: Exception: find this text: lpfails

Julia 1.9: ERROR: log_density() failed with unknown exception

What seems odd to me is the differences between these error messages comes from the C++ file bridgestan.cpp. The C++ try-catch is catching different exceptions based on the Julia version. I don't immediately understand this.

The quickest/hackiest fix would be to change line 9 in the file julia/test/model_tests.jl from if VERSION >= v"1.8" to if VERSION == v"1.8". Is this a reasonable temporary fix, while we create a new issue focused on Julia 1.9 and move away from this Rlang PR?

@WardBrian
Copy link
Collaborator Author

I've also spent some time running it down and just filed an issue with Julia: JuliaLang/julia#49772.
I believe this is a legitimate bug in Julia that has nothing to do with BridgeStan specifics. I'm happy to either bin Julia 1.8 in our test suite until it is resolved or merge with the one test failing.

@WardBrian WardBrian merged commit 6026f40 into main May 11, 2023
@WardBrian WardBrian deleted the fix/example-extra-arg branch May 11, 2023 19:21
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.

Error in R/example.R
3 participants