Open blset opened 3 years ago
Thanks for the report. IIRC, the implentation of gen.c
was implented based on a early version of the haskell library.
Obviously, they're different languages, and Haskell's stack is on the heap and not the c stack, and is a bit lazier, so this wasn't the best choice.
Fortunately, there's been a bit on this front in our other implementations, so I think we should be able to relook at that, even if not everything applies.
You can also use a generator which doesn't shrink individual elements like this one.
@HuwCampbell I had this issue with more (overly?) complex gens and #18 fixed the issue!
There is a workaround with unix::rlimit_stack(cur = Inf)
but it is good to have it solved in the "backend"
Cool. I will endevour to make a release with these changes this week.
Correction, fixed it most of the time, in some sessions it still happens (there is some randomness in input size for my generators so that might be the reason why) but that is most likely more an issue with my gens and can be optimized.
If you can give an example showing where the stack is being blown I can have a look.
It happens somewhere in here https://github.com/kgoldfeld/simstudy/blob/main/tests/testthat/test-define_data.R but I'll have to take a closer look where exactly in the coming days.
I ran into the same problem, but using the current master (which includes #18) seems to fix the problem. (Installed with devtools::install_github("hedgehogqa/r-hedgehog")
Is that fix already part of the 0.1 release on CRAN?
Looks like it's not.
I will have a go at getting a release up, I haven't touched this project for a while, so it's likely I'll need to kick a few dependencies; we'll see how I go.
this smple gen
gen.element(1:100) |> gen.c(of = 1400)
produces the error Erreur : C stack usage 7972516 is too close to the limit
with