Mimir/docs/fensalir-reservoir-daemon.md
2026-06-04 23:59:07 +01:00

5 KiB

Fensalir Reservoir Daemon

Objective

Move heavy field reconstruction out of the interactive Mimir editor. The editor should present synced video feeds and controls responsively. A separate Fensalir reservoir daemon should drink from the Well, spend whatever CPU/GPU budget is assigned, and publish typed reservoir/program surfaces.

Authority Map

Owner: the Fensalir reservoir daemon owns reservoir work selection, GPU residency, temporal reuse, fusion kernels, worker scheduling, and publication of reservoir-derived program surfaces.

Inputs: typed Well pages, configured composite state, live timing policy, feature-signal documents, calibration state, Fensalir-owned texture leases, and explicit budget settings.

Outputs: typed CultMesh/CultCache reservoir status, program texture/fence surfaces, optional diagnostic Eve surfaces, and OBS-facing shared texture or plugin feeds.

Derived state: Mimir editor telemetry, preview rectangles, Odin/Eve dashboard rows, and OBS plugin status are observers. They do not decide reservoir work.

Forbidden writers: the interactive editor render loop must not run temporal reservoir history just because it is presenting a backbuffer. Field diagnostics must be opt-in. A camera FieldEvidenceFrame claim must not impersonate a flat video compositor.

Shared paths: direct user placement, configured Well composites, OBS output, daemon diagnostics, and future Eve room lowerings must all reference the same source ids, timing state, and placement/composite document. Manual UI placement and daemon program output may differ only through an explicit selected composite/version.

Deletion line: old app-hosted reservoir proof visuals remain diagnostic only. They cannot be the default Mimir program output while the current goal is synced video presentation.

Current Scar

On 2026-06-02 the Mimir editor became unresponsive because Fensalir ran reservoir history presentation on a video-only frame. The renderer now gates that pass behind source-derived reservoir-producing input, and the live video-only app log showed reservoir-update n/a.

The remaining gap is real: Fensalir still lacks a flat program-layer video backend that draws Fensalir-owned camera texture leases as 2D synced layers. That backend is separate from the reservoir daemon. Build it as the editor's presentation path; do not smuggle it through field diagnostics.

Current Daemon Cut

src/Mimir.FensalirDaemon is the first owner-shaped daemon:

  • eats CultCache through state/fensalir-daemon.ccmp, using the canonical MessagePack CultCache backing store;
  • drinks Well JSONL logs containing mimir.well_snapshot.v1, mimir.well_capture_page.v1, and mimir.well_stream_pressure.v1;
  • publishes typed mimir.fensalir_daemon_state.v1 state;
  • speaks a CultNet-shaped WebSocket Eve provider at /eve/deck;
  • speaks binary CultMesh dashboard documents at /eve/deck/cultmesh;
  • exposes /health and /eve/deck/manifest;
  • presents a retained cultmesh.eve_surface.v0 surface with compact text and metrics that Eve GUI and Odin/Nightwing TUI can lower.

Start it with:

powershell -ExecutionPolicy Bypass -File .\scripts\start-fensalir-daemon.ps1

The launcher writes a supervisor manifest under artifacts/runtime/fensalir-daemon-* with a semantic provider spec and bridge routes:

mimir-fensalir-daemon|Mimir Fensalir Daemon|asgard.starfire.mimir-fensalir/eve/tui
bridge: ws://127.0.0.1:8799/eve/deck
bridge: ws://127.0.0.1:8799/eve/deck/cultmesh

The current worker mode is surface-owner-installed: kernel scheduling, GPU-resident reservoir compute, and actual fused program-surface publication belong behind this daemon next. Do not move those back into the editor.

Worker-State Cut

Mimir.FensalirDaemon now also publishes mimir.fensalir_reservoir_worker_state.v1 beside the daemon summary state. The worker state is the owner surface for reservoir job selection and pressure:

  • capture pages enqueue reservoir jobs only when they contain accepted timing slices;
  • mimir.cultmesh_stream_frame.v1 records enqueue fine-grained reservoir jobs from timed stream frames, including paged, inline, native, or shared-handle body transport evidence;
  • unusable pages are dropped with rejection reasons instead of being hidden by the editor;
  • queue depth, running jobs, completed jobs, dropped jobs, timing confidence, accepted/rejected slice counts, and estimated GPU queue milliseconds are persisted in CultCache;
  • mimir.fensalir_reservoir_pressure.v1 reports Well poll/publish pressure, capture bytes, ready-slice ratio, timing confidence, max presentation distance, GPU queue milliseconds, and drop causes for missing bodies, unavailable fences, or degraded timing;
  • Eve surfaces bind worker metrics to the worker document, not to ad hoc renderer telemetry.

The current worker still simulates cost from capture-page shape and configured CPU/GPU share. That is intentional scaffolding: the next cut replaces the cost model with real GPU/Faust/Fensalir kernel dispatch while preserving the same owner and state contract.