Closed pachadotdev closed 1 year ago
@s3alfisc this is the kind of issue that I find when writing C++ Over the last year I have made decent success porting fixest to a more "neutral" and "modern" C++. It would be great to have the same engine for both Python and R, like Arrow does. Will you be interested in making it happen? pybind11 seems to be the same as cpp11 (R package), so the integration is not so bad.
also, I made progress at identifying my issues because @lrberge also answered one of my questions on SO
Hi @pachadotdev, of course, I would be more than happy to!
great! I'll add u to this repository then is it ok to email you later?
@s3alfisc I updated the bug description
this is some progress, because I have moved the C++ to a more "unsweetened" C++ style, which we can then use with Python
Why
fixef()
fails?The issue is that the C++ function
cpp_get_fe_gnl_()
doesn't like the matrixobsCluster
, which is a matrix of integers. If we cast it as integer in R, the R session crashes with a 'memory not mapped' message. If we pass it as a double with no cast, the function does nothing and returns an error of 'double vs integer'.The problematic functions in my code are
R output
I included a line by line example here https://github.com/pachadotdev/fixest2/blob/cpp11_wip/dev/gdb-debug-4.R to generate the error.
Valgrind output
To dig this a bit I used valgrind by following these steps https://github.com/pachadotdev/fixest2/tree/cpp11_wip#debugging.
The result is