You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
id: design: hot-swap alternatives — Wasm-component instantiation vs process restart with compile cache vs interpreted behavior layer #5996
Part of the worlds design program: #5955. Wave-2 follow-up from the prior-art research (Lane B item 6); parent topic issue: #5964. Research source: workspace/scratch/worlds-capabilities-brief-2026-11-04/prior-art-research.md.
Scope
Roc itself offers no runtime module hot-swap (see the shared-library reality-check follow-up under #5955). Compare the three mechanisms that can deliver per-tick user-function switching for #5964, and pick the v1 mechanism:
Wasm target + component-model dynamic instantiation — components import only declared WIT interfaces (link/instantiation error on mismatch). Caveat from the research: in practice most tooling statically links components before shipping; dynamic hot-load/link of arbitrary components remains immature (Bytecode Alliance WASI 0.3-era discussion: https://news.ycombinator.com/item?id=48504063). Schedule risk is real.
Data-driven behavior layer — user behavior expressed as interpreted data/scripts inside a compiled world (the pattern every interpreted programmable world used: MOO verbs, LSL script replacement).
Evaluation axes
Swap latency at tick boundary; isolation strength; metering compatibility (per-function gas/timeout research under #5955); determinism for replay; implementation cost against the current host (pkgs/id/src/world_compile.rs, pkgs/id/src/world_session/).
Done looks like
A decision doc naming the v1 mechanism, the rejected alternatives with reasons, and what would trigger revisiting the decision.
Ruling — C3/C4 pillar affirmation applies to this alternatives exploration (Drew, 2026-11-04 23:57 CST; primary record on #5964).
User-code handling is one of the two platform pillars ("very big parts of making this a platform that other people can build on top of, interact with, and reason about" — the other is fuel budgets, #5966). Evaluate the alternatives here under the iteration doctrine: thorough research, test findings, hunt for holes and gaps, and expect multiple reworks/rebuilds before the right solution lands. A candidate that only works as a test-environment, us-only mechanism is acceptable for now; a candidate that is an architectural dead end for later high user-friendliness is not.
Verdict: well-formed, tightly scoped decision-design ticket — stays OPEN. Its whole remaining work is the one decision doc it names; no split needed, no implementation in scope.
The evaluation ground exists at current main: pkgs/id/src/world_compile.rs (~65 KB) and pkgs/id/src/world_session/ (mod.rs, types.rs, tests.rs, contract_tests.rs) — the three candidate mechanisms are to be costed against this real host, as the issue's evaluation axes require, not in the abstract.
Design path scoped: one decision doc naming the v1 mechanism, rejected alternatives with reasons, and explicit revisit triggers (the issue's "Done looks like"), written against the five stated axes (swap latency at tick boundary, isolation, metering compatibility, replay determinism, implementation cost vs the current host). Any implementation follows as separate tickets filed from that doc — none spawned now (premature: the decision is the work).
PR shepherd — PR #7637 (task 17307, lane code-i, 2026-11-16)
Action: merged (d63abfeb, merge commit, 2026-11-16 10:56Z). Docs-only: one new file, doc/2026-11-08T10-26-00Z_design_id5996_hot_swap_decision/…md (66 added lines, 0 deletions).
State check before merge: PR OPEN, not a draft, MERGEABLE, no held / user/owned / do-not-merge / do-not-auto-edit labels, no review decision blocking, no competing decision record on main (no other doc mentions instance-per-function).
The failing check is stale, not caused by this PR:basic: scripts-test (3.12 and 3.14) failed in a run from 2026-11-09 against an older base; scripts-test on main has completed green repeatedly since (most recent completed run before the merge: 2026-11-16 09:53Z, success). A docs-only addition cannot regress that suite.
Drift worth a follow-up (not blocking the decision): the record cites pkgs/id/src/world_compile.rs and pkgs/id/src/sandbox.rs at evidence baseline 0865aad9; after the id crate split those now live at pkgs/id/crates/id-worlds/src/world_compile.rs and …/sandbox.rs. The decision itself is unaffected — the mechanism it picks (instance-per-function restart with snapshot handoff) is still the current host's shape — but a reader following the paths at HEAD will not find them.
One loose end, fixed here: the shepherd flagged path drift — the record cites pkgs/id/src/world_compile.rs, pkgs/id/src/sandbox.rs (and pkgs/id/src/world_session/), which moved in the id crate split to pkgs/id/crates/id-worlds/src/… (verified at HEAD). Rather than rewriting a decision record's historical text, I am adding a dated path-correction note to the doc via a small docs PR, then closing this issue as done.
Drift fix: PR docs(id): path-correction note for the #5996 hot-swap decision record #10922 adds a dated path-correction note to the record: pkgs/id/src/world_compile.rs → pkgs/id/crates/id-worlds/src/world_compile.rs, pkgs/id/src/sandbox.rs → pkgs/id/crates/id-worlds/src/sandbox.rs, pkgs/id/src/world_session/ → pkgs/id/crates/id-worlds/src/world_session/ (all verified at HEAD; additive note, the historical text unchanged).
Verdict: already resolved before this claim; no new work, no follow-on packet needed. Task 19949 completes as already_done. No hard-stop labels present; no in-flight queue/work labels remain on the issue.
Activity
developing-today commentedon Nov 5, 2026
CODE-1662
dezren39 commentedon Nov 5, 2026
Ruling — C3/C4 pillar affirmation applies to this alternatives exploration (Drew, 2026-11-04 23:57 CST; primary record on #5964).
User-code handling is one of the two platform pillars ("very big parts of making this a platform that other people can build on top of, interact with, and reason about" — the other is fuel budgets, #5966). Evaluate the alternatives here under the iteration doctrine: thorough research, test findings, hunt for holes and gaps, and expect multiple reworks/rebuilds before the right solution lands. A candidate that only works as a test-environment, us-only mechanism is acceptable for now; a candidate that is an architectural dead end for later high user-friendliness is not.
dezren39 commentedon Nov 5, 2026
Triage — task 10362 (lane code-e, 2026-11-05)
Verdict: well-formed, tightly scoped decision-design ticket — stays OPEN. Its whole remaining work is the one decision doc it names; no split needed, no implementation in scope.
Verified fresh this pass:
main:pkgs/id/src/world_compile.rs(~65 KB) andpkgs/id/src/world_session/(mod.rs,types.rs,tests.rs,contract_tests.rs) — the three candidate mechanisms are to be costed against this real host, as the issue's evaluation axes require, not in the abstract.Ordering / inputs the decision doc must consume (recorded so the pass doesn't start cold):
Design path scoped: one decision doc naming the v1 mechanism, rejected alternatives with reasons, and explicit revisit triggers (the issue's "Done looks like"), written against the five stated axes (swap latency at tick boundary, isolation, metering compatibility, replay determinism, implementation cost vs the current host). Any implementation follows as separate tickets filed from that doc — none spawned now (premature: the decision is the work).
Queue: task 10362 completes as
triaged.14 remaining items
Merge pull request #7637 from developing-today/queue/12996-5996-hot-s…
dezren39 commentedon Nov 16, 2026
PR shepherd — PR #7637 (task 17307, lane code-i, 2026-11-16)
d63abfeb, merge commit, 2026-11-16 10:56Z). Docs-only: one new file,doc/2026-11-08T10-26-00Z_design_id5996_hot_swap_decision/…md(66 added lines, 0 deletions).MERGEABLE, noheld/user/owned/do-not-merge/do-not-auto-editlabels, no review decision blocking, no competing decision record onmain(no other doc mentionsinstance-per-function).basic: scripts-test(3.12 and 3.14) failed in a run from 2026-11-09 against an older base;scripts-testonmainhas completed green repeatedly since (most recent completed run before the merge: 2026-11-16 09:53Z, success). A docs-only addition cannot regress that suite.pkgs/id/src/world_compile.rsandpkgs/id/src/sandbox.rsat evidence baseline0865aad9; after the id crate split those now live atpkgs/id/crates/id-worlds/src/world_compile.rsand…/sandbox.rs. The decision itself is unaffected — the mechanism it picks (instance-per-function restart with snapshot handoff) is still the current host's shape — but a reader following the paths at HEAD will not find them.status:in-review: the decision is recorded; implementation of the chosen mechanism is filed from id: design: dynamic user functions — server-compiled DLLs, hot-swap into running worlds without world recompile #5964 per the record's own scope.dezren39 commentedon Nov 17, 2026
🤖 Agent note · picked up
doc/2026-11-08T10-26-00Z_design_id5996_hot_swap_decision/— v1 = mechanism 2 (restart with warm compile cache) realized as instance-per-function restart with snapshot handoff. The shepherd's note (task 17307) records that implementation of the chosen mechanism is filed from id: design: dynamic user functions — server-compiled DLLs, hot-swap into running worlds without world recompile #5964 per the record's own scope — nothing implementation-shaped remains on this issue.pkgs/id/src/world_compile.rs,pkgs/id/src/sandbox.rs(andpkgs/id/src/world_session/), which moved in the id crate split topkgs/id/crates/id-worlds/src/…(verified at HEAD). Rather than rewriting a decision record's historical text, I am adding a dated path-correction note to the doc via a small docs PR, then closing this issue as done.Merge pull request #10922 from developing-today/queue/18416-5996-doc-…
dezren39 commentedon Nov 17, 2026
🤖 Agent note · done — decision recorded, drift corrected, closing
doc/2026-11-08T10-26-00Z_design_id5996_hot_swap_decision/names the v1 mechanism (mechanism 2 — restart with a warm compile cache — realized as instance-per-function restart with snapshot handoff), the rejected alternatives with reasons, and the revisit triggers — exactly this issue's "Done looks like". PR docs(id): hot-swap alternatives decision — v1 is instance-per-function restart (#5996) #7637 merged 2026-11-16T10:56:44Z (task 17307 shepherd note), which also records that implementation of the chosen mechanism is filed from id: design: dynamic user functions — server-compiled DLLs, hot-swap into running worlds without world recompile #5964 per the record's own scope — nothing implementation-shaped was ever tracked here.pkgs/id/src/world_compile.rs→pkgs/id/crates/id-worlds/src/world_compile.rs,pkgs/id/src/sandbox.rs→pkgs/id/crates/id-worlds/src/sandbox.rs,pkgs/id/src/world_session/→pkgs/id/crates/id-worlds/src/world_session/(all verified at HEAD; additive note, the historical text unchanged).dezren39 commentedon Nov 17, 2026
🤖 Agent note · done (already_done)