Skip to content

Spike: hot reload for compiled programs (fast restart vs in-process patching) #500

Open

Description

@blacktrs

Question

Can a compiled Manticore program pick up a source change without a full restart ("hot reload"), and at what cost in complexity? Time-boxed research, not a delivery commitment. Part of epic #498.

Hypotheses to test

  1. Fast restart (baseline): watch → incremental build → relink → exec, with the listening socket handed over (fd inheritance / SO_REUSEPORT). Measure end-to-end latency and whether clients see a gap. Depends on Epic: incremental compilation #498 layers 3 and 5.
  2. In-process patching: changed units built as .so/.dylib, loaded with dlopen, calls routed through a pointer table. Dev-mode only (-O0, no inlining, no monomorphization across units). Patch function bodies whose signature and class layout are unchanged; anything else falls back to (1).

Known blockers to investigate for (2)

  • Static link vs dlopen (needs a dynamic dev build).
  • Class layout from MemoryAbi: live objects of a changed class.
  • Cross-unit code from Monomorphize, InlineClosures, linkonce_odr.
  • Static props as external-linkage globals.
  • macOS code signing on loaded images.

Deliverable

A short write-up (docs/design/hot-reload.md) with: a minimal prototype of (1), a feasibility verdict on (2) with a toy example (one function body swapped in a running process), measured latencies, and a go/no-go recommendation. No production code required.

Exit criteria

  • (1) prototype works on Linux and reports latency.
  • (2) either a working toy swap, or the specific blocker that kills it, documented.
  • Decision recorded: pursue as a feature, or close.

Activity

  1. added
    enhancement
    needs-design
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementneeds-design

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions