First off, most of Stan and Math will work in Windows. I’m going to guess Windows users aren’t pushing into the areas where it’s not building, but we should fix it.
Second, this is a call for help. I don’t know how to fix everything on Windows. If you have some time and expertise to help, please do.
I am offering my help. I propose we start by making a list of tests that are not building on Windows to identify all the issues. I am going to post it on the issue linked above.
Thanks, @rok_cesnovar. Please feel free to update the top-level issue to reflect that. (If you don’t have permissions, I can try to trace through to give you permissions).
@ahartikainen, we’re only testing with one compiler: RTools g++. I don’t know which one that is on your list. And… whoops. I think it’s all building now with @rok_cesnovar’s help. I think it’s not passing tests. (I’m going to update the thread title to reflect that.)
The segfault occurs in this call of the run function on the Eigen::matrix_exp_computeUV.
This is called here in the matrix_exp function that is called in the /rev/matrix_exp_multiply function here
I am not really sure what this does, maybe @yizhang (I think he is the main author of this code, hope I am not wrong) can give us some insight or any ideas why this could fail (on Windows).
I’m digging and seeing some craziness. My best guess at this point is that there’s something that’s using uninitialized memory and for some reason, the Windows run is picking up on it.
The craziness… I’m seeing different autodiff stack sizes on Mac and Windows. I don’t see it failing where you see it, @rok_cesnovar. I’m seeing it in the multiple grad calls with set_zero_adjoint() used to clear it out. I don’t think that’s the right pattern for this type of test, but I’ll have to dig further.
Anyway, the craziness:
On Windows. Stacksize with the var x double test: 2821.
On Mac, same test: 64.
This is just an update. I’ll need to dig further. @yizhang, mind helping out? Am I missing something?
Yikes. It’s hard to imagine what could go wrong on Windows with stack size. These stack-size tests have proven to be super useful, so thanks for including them in the first place!
Quick update. I’ve been banging my head on this on and off. I think there’s some unsafe memory handling in the matrix_exp() function. I’ve gotten seg faults on my Mac too. This is something we need to fix.
@Bob_Carpenter has suggested using the adjoint vector product to deal with the memory. I think that’s a great idea.
It’s a heisenbug, which is telling me that it’s in the memory handling somewhere. And I’ve been able to get it to fail sporadically on Mac too (multiple machines), so I’m convinced it’s a problem.
I’ve been trying to hunt this down on a branch: feature/daniel-windows. That branches off the fix for Windows branch. I’m leaving that branch alone until I know what’s going on here.