Skip to content
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

Support an actor mode for pipelines #760

Open
thewtex opened this issue Feb 13, 2023 · 3 comments
Open

Support an actor mode for pipelines #760

thewtex opened this issue Feb 13, 2023 · 3 comments
Milestone

Comments

@thewtex
Copy link
Member

thewtex commented Feb 13, 2023

This mode would enable working with pipelines following the Actor Model in addition to use as a pure function.

For Emscripten:

For WASI:

  • And an actor: boolean option to run_pipeline
  • Return an actor for re-use -- the last positional output? The wasm runtime store?
  • Do not run destructor's at the end of execution.
  • Run stackSave and stackRestore?
@floryst
Copy link
Member

floryst commented Feb 13, 2023

Should we expect pipelines operating in such fashion to call into main()? Or should we ccall into some other entrypoint we define? The former handles allocating args, while I'm not sure about the latter.

@thewtex
Copy link
Member Author

thewtex commented Feb 14, 2023

Yes, actors can allocate their own internal memory and manage their own internal state. For reasons of efficiency and safety, inputs and outputs are allocated, "lowered" and "lifted" by itk-wasm bindgen or, eventually, wit bindgen.

@floryst
Copy link
Member

floryst commented Oct 2, 2023

Update: I encountered the stack leak behavior in itk-wasm@1.0.0-b.141 when calling readImageBlob many times using the same webworker. I fixed it by patching the itk-image-io files to call stackSave/stackRestore inside callMain(). I haven't evaluated this yet in VolView.

thewtex added a commit to thewtex/ITK-Wasm that referenced this issue Oct 11, 2023
thewtex added a commit to thewtex/ITK-Wasm that referenced this issue Oct 11, 2023
Addresses issues with multiple invocations. InsightSoftwareConsortium#760

Co-authored-by: Forrest Li <forrest.li@kitware.com>
github-actions bot pushed a commit that referenced this issue Oct 13, 2023
# [1.0.0-b.148](itk-wasm-v1.0.0-b.147...itk-wasm-v1.0.0-b.148) (2023-10-13)

### Bug Fixes

* **emscripten:** save and restore the stack with a run ([e99c3e4](e99c3e4)), closes [#760](#760)

### Features

* **bindgen:** add pyproject.toml short description for wheel summary ([5c1a3a5](5c1a3a5)), closes [#949](#949)
* **itk-wasm-cli:** Update default Docker image for 20231011-0ed0113b ([24f8230](24f8230))
* **itk-wasm-cli:** Update default Docker image for 20231011-b6214540 ([13150e6](13150e6))
* **itk-wasm-cli:** Update default Docker image for 20231012-93cb7447 ([9d5cd0d](9d5cd0d))
* support dynamic emscripten module import in web workers ([93cb744](93cb744))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants