Skip to content

id: design: dynamic user functions — server-compiled DLLs, hot-swap into running worlds without world recompile #5964

Open

Description

@dezren39

Part of the worlds design program: #5955. Statements S36–S38 and S45 of the 2026-11-04 brief. This is the V3 stage of the program.

Requirement (Drew, in substance)

User-level code should be passable into a running world without recompiling the whole world:

  • At least in one version of the compiler there is a way to make a DLL. The server side compiles that DLL itself — user code is never trusted pre-compiled.
  • The platform then places the DLL in the appropriate location for the world-side code to call it.
  • If a user changes what's running, the world-side code picks it up as soon as it's compiled and available to be hot-swapped in.
  • Trust chain: the server can trust the code because it did the compilation itself; and the only non-pure things the user function can do are from the server's own platform being passed to it by the world author — and the world author can trust that chain too.

Design points to settle

  • Interface contract: what signature/shape a user DLL exposes, and how the world discovers and binds it (name, version, interface hash). Mismatch behavior: refuse, fall back to previous version, or run the user's prior published code (see the compile-economics child — "keep running what you'd already published" is the stated default).
  • Swap semantics: swap at tick boundary only? In-flight calls finish on the old code — state handoff between versions (the function's state is the world's problem, the function's problem, or serialized through a defined state type?).
  • Which Roc compiler line actually supports the DLL path Drew remembers, and what it costs us to build on it (pin vs track).
  • Isolation: a user DLL crashing or hanging must not take the world down (budgets: server-invariants child; per-function enforcement: gas/timeout research child).
  • Distinction from the authoring hot-swap loop (id world dev, #558 / #5541): that swaps world code for its author during development; this swaps per-user functions inside a live world for its players. Reuse its mechanics where they fit, but the trust and budget models differ.

Related

  • Programming-model child of #5955 (functions passed by the world are the static case of this)
  • Per-user function mapping child of #5955 (the consumer of this mechanism)
  • Compile chain today: pkgs/id/src/world_compile.rs

Done looks like

A design doc: DLL interface contract, server compile pipeline, placement/binding, swap semantics incl. failure fallbacks, and the trust argument written out end-to-end.

Activity

  1. added
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    kind/designA design proposal (design-architect): multi-step, phased, decision-bearing
    on Nov 5, 2026
  2. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Wave-2 tie-in (finding F3) + contradiction C3.

    • F3 — already decided, inherited as a constraint (2026-10-08, founding session): "a server can also control access by what functions it allows in the roc interface and by only accepting untrusted code in source form, compiling the roc code itself and only using trusted sources." Source-only + server-compiles is not an open question in this design; it is the shipped posture and the brief's own trust argument.
    • C3 — WORKING INTERPRETATION — shown to Drew in the main chat 2026-11-04 ~23:06 and not objected to; recorded here as an interpretation, not a ruling. User-supplied hot-swapped functions move the 2026-10-31 boundary that native code is admin-installed and never peer-distributed. They reconcile via the brief's server-compiles-from-source rule, and this design must state the new boundary explicitly as a design constraint: server-compiled-from-source user functions are inside the boundary; shipped/pre-compiled binaries are not.

    Record: workspace/scratch/worlds-capabilities-brief-2026-11-04/conversation-tie-ins.md (F3, C3).

  4. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Wave-2 follow-ups filed from the prior-art research (Lane B). Granular sub-scopes of this issue, each carrying the relevant research findings + citations:

    Research source: workspace/scratch/worlds-capabilities-brief-2026-11-04/prior-art-research.md. Full wave-2 mapping: workspace/scratch/worlds-capabilities-brief-2026-11-04/wave2-map.md.

  5. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Ruling — C3/C4 affirmed as platform pillars, with an iteration doctrine (Drew, 2026-11-04 23:57 CST).

    Handling user code (this issue: server-compiled DLLs, hot-swap) and fuel budgets (#5966) are, in Drew's words, "very big parts of making this a platform that other people can build on top of, interact with, and reason about." They are top-importance, not side features.

    Doctrine for this work:

    • Thorough research first; test what we find; actively look for holes and gaps.
    • Expect to rework and rebuild multiple times before landing at the right solution — iteration is the plan, not a failure mode.
    • Initial implementations may be locked to us in a test environment and need not be user-friendly in any way — but everything built must have at least the capability to become highly user-friendly later. No architectural dead ends on UX.

    C3 substance stands as interpreted: user code is source-only, server-compiled (which is what reconciles hot-swap with the Oct 31 native trust boundary — see also #5996 for the alternatives exploration).

  6. added
    queue/queuedHas a queued task in the Supabase agent queue
    task/triageQueue packet kind: verify, reproduce, and route this item
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 5, 2026
  7. 162 remaining items

  8. removed
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 8, 2026
  9. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  10. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 8, 2026
  11. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    Task 13258 (small_fix, PR #None): picked up by lane code-v, assigned_lane=opencode — handed off to the opencode claimant, which launches the bound session. Issue #5964 state OPEN. This worker will not work task 13258 directly.

  12. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor

    🤖 Agent note · handed off

  13. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  14. added
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 8, 2026
  15. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · blocked (packet defect)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingpriority/normalOrdinary priority (the default)queue/blockedQueue or user escalation statestatus/blockedQueue or user escalation statetask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions