Closed amas0 closed 2 years ago
Thanks for the report. This does indeed look like a bug.
The fix should be easy. Will need tests in httpstan and pystan.
I wonder if this error is actually raised by stanc.
Likely relevant https://github.com/stan-dev/stanc3/pull/869
Yes, I think this will be solved by the PR referenced above. The root cause of the problem is that the integer division warning is somehow ending up in the C++ code. Such code will, of course, not compile.
The warning is printed to stdout in stanc3, it should be printed to stderr. This is what the PR is trying to address.
However I am not sure why that would cause it to end in the C++ code? Is pystan calling stanc3 so that it prints the C++ and consume the printed C++?
Yes, that's exactly what PyStan does.
The PR in stanc3 was merged so this issue was addressed upstream. I guess we can close?
I think we can close this after we upgrade our stanc.
Cool, then it has to wait for the next release.
That's correct. Let's keep this open until stanc makes a new release and httpstan uses it.
On Sun, Jul 11, 2021, at 10:18 AM, Rok Češnovar wrote:
Cool, then it has to wait for the next release.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stan-dev/httpstan/issues/566#issuecomment-877807912, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJQUBVUYMJCN3V5AM5FXU5LTXGR3NANCNFSM446DAYRA.
Found an issue where httpstan will return a error code 400 "Bad Request" when passing model code that contains integer division, which generates the return message:
To recreate, run
httpstan
as normal and run the following curl command:Note, this is the basic usage example in the README but with standard deviation 1/5 instead of 1. It should run for a bit as if it is building and then return the error. I conformed that the above model code will compile and sample properly if done with
cmdstan
directly.The model will compile without issue if the division is float division instead so the following works:
Somewhat of an odd issue, might have to do with how the model code is parsed when it receives it over HTTP? Not sure.
(As a side note, I found this issue when trying to run a model of mine -- turns out I had mis-specified the model and I didn't want integer division! Correctly specifying the model with float division fixed the issue... so in a way, this bug helped me find an error on my part :) still a bug though, it would seem )