Skip to content

Test and run over the wasm boundary, and two decisions written down - #683

Merged
onatozmenn merged 1 commit into
mainfrom
issue-590-591-capabilities-and-nonstop
Jul 30, 2026
Merged

Test and run over the wasm boundary, and two decisions written down#683
onatozmenn merged 1 commit into
mainfrom
issue-590-591-capabilities-and-nonstop

Conversation

@onatozmenn

Copy link
Copy Markdown
Collaborator

Closes #590. Closes #591.

deed-wasm gets deed_test and deed_run alongside deed_check, same shape: write to a buffer from deed_alloc, call, read JSON back through deed_result_ptr/deed_result_len. test needs no capability decision at all, a test block takes no parameters so nothing in one can hold a capability.

#591: a page offers Io.write and Io.now, nothing else, decided rather than attempted and left to fail two different ways (Io.epoch has no fallible form on this target and traps; the directory operations fail safely but with a raw io::Error nobody chose to write). unsupported_capabilities reads main's row and turns every other Io operation into one sentence (this page does not offer `Io.save` yet), checked before anything runs rather than discovered by an OS error partway through.

#590: MAX_DEPTH already turns unbounded recursion (the only way to not return, since there is no while) into DEED6009 rather than a hang, on every host. The residual question, a fuel limit or a worker thread, is decided as the worker thread, and it is the page's job: a fuel limit would tax every embedder for a failure mode that is the existing "time and memory are also resources" open question, not a new one, and a page already has the tool that fits it. Both decisions and the reasoning are in design/04-capabilities.md.

A new test proves a mutually recursive Diverge program terminates with the depth error rather than hanging, run through deed_run itself.

Stacked on #682 (wasm entry point) for the deed-wasm crate; will show a clean diff once that merges.

…590, #591)

deed-wasm gets deed_test and deed_run alongside deed_check, same shape:
write to a buffer from deed_alloc, call, read JSON back through
deed_result_ptr/deed_result_len. test needs no capability decision at all,
a test block takes no parameters so nothing in one can hold a capability.

#591: a page offers Io.write and Io.now, nothing else, decided rather than
attempted and left to fail two different ways (Io.epoch has no fallible
form on this target and traps; the directory operations fail safely but
with a raw io::Error nobody chose to write). unsupported_capabilities reads
main's row and turns every other Io operation into one sentence
("this page does not offer `Io.save` yet"), checked before anything runs
rather than discovered by an OS error partway through.

#590: MAX_DEPTH already turns unbounded recursion (the only way to not
return, since there is no while) into DEED6009 rather than a hang, on every
host. The residual question, a fuel limit or a worker thread, is decided as
the worker thread, and it is the page's job: a fuel limit would tax every
embedder for a failure mode that is the existing "time and memory are also
resources" open question, not a new one, and a page already has the tool
that fits it. Both decisions and the reasoning are in design/04-capabilities.md.

A new test proves a mutually recursive Diverge program terminates with the
depth error rather than hanging, run through deed_run itself.
@onatozmenn
onatozmenn force-pushed the issue-590-591-capabilities-and-nonstop branch from 39cf5a1 to eb34f65 Compare July 30, 2026 23:29
@onatozmenn
onatozmenn merged commit ee5b2fc into main Jul 30, 2026
1 of 2 checks passed
@onatozmenn
onatozmenn deleted the issue-590-591-capabilities-and-nonstop branch July 30, 2026 23:30
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

Successfully merging this pull request may close these issues.

What capabilities a page can hand a program Running and testing a program in a page, including one that never stops

1 participant