Propagate runtime config options about stack size #513
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Deep stacks, at least on the lazy impl, seem to be working as long as the runtime correctly gets the options about stack size.
This PR makes the
(deep, lazy)
test pass just by getting the config to the right places.Eager is still failing with call stack size exceeded with these changes.
The runtimeOpts given to stopifyLocally were not used to configure any starting stack sizes (they go to the Runner
Stopify/stopify/src/entrypoints/compiler.ts
Line 49 in 275d950
Stopify/stopify/src/runtime/abstractRunner.ts
Line 47 in 275d950
This commit does that configuration on the init() method. I'm not sure that's the right place, but it's where the estimator and some other config happen based on the opts field, so it seems reasonable.
Separately, this also adds (optional) params to newRTS to configure stack size (since those are the parameters the constructors of the various runtimes take). With just this change (e.g. without the new configuration in init() that sets fields on rts), you can get deep/lazy working by using e.g.
stopify.newRTS('lazy', 1000, 10)
before calling .run(). But since stopifyLocally takes the runtimeOpts, it seems right to use them somewhere (
Stopify/stopify/src/entrypoints/compiler.ts
Line 135 in 275d950
NB: I'm also only able to make this test run by removing
TextDecoder
andTextEncoder
fromknowns
incannotCapture.ts
(https://github.com/nuprl/Stopify/blob/master/stopify-continuations-compiler/src/common/cannotCapture.ts#L35). Would be useful to hear if others/the CI has the same issue; I don't want to add that change in case it breaks other things (someone added it deliberately at some point so there's got to be a reason they are there; a4deef9).I'm not sure what's going on there (I'm on Node 22,
TextDecoder
seems to be defined when Ieval
it in the REPL), I get this error: