-
Notifications
You must be signed in to change notification settings - Fork 11
Increase asyncify stack size #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for distracted-dubinsky-fd8a42 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Preview build will be at |
94c0530
to
bb816cc
Compare
I use the following test to determine maximum stack depth when calling a function:
That works only when Otherwise, you can make a simple fixed-depth test like this:
|
Pick the first power of two where we fail with a pystack exhausted error in MicroPython rather than an asyncify-related error.
bb816cc
to
8802c14
Compare
Yeah that makes sense. I got fixated on the structure of the original example. I've updated it to be a Python example alongside the others. Both examples you give work for me without enabling MICROPY_STACK_CHECK. If I do enable MICROPY_STACK_CHECK (which is enabled for the CODAL port) I see worse behaviour:
Some of that (the mp_js_force_stop bit at least) seems like it might be a knock-on error from whatever originally goes wrong. For the moment at least, I think it makes sense to go with the PR as I've just updated it. |
</option> | ||
<option value="sound_effects_user">Sound effects (user)</option> | ||
<option value="speech">Speech</option> | ||
<option value="stack_size">Stack size</option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds the example to the list in the demo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, very nice!
This fixes the example on #105.
I've added the debug script that I used, which I aspire to turn into an automated test in future.
The value does seem rather large but not really significant in a browser context. I've not explored whether it's possible to optimise our asyncify use.
I found an analogous issue in a JS interpreter here: justjake/quickjs-emscripten#112