Consume stream frames in Fensalir daemon
This commit is contained in:
parent
20f92b50b8
commit
0037eb87f2
5 changed files with 82 additions and 1 deletions
|
|
@ -92,6 +92,9 @@ 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,
|
||||
|
|
|
|||
|
|
@ -55,6 +55,9 @@ The online supervisor now gives `Mimir.VerseRecorder` the supervisor `runId`
|
|||
and starts `Mimir.FensalirDaemon` against that exact
|
||||
`VerseCaptures/<runId>/observations.jsonl`, with a run-local CultCache. Fensalir
|
||||
no longer has to discover the Well stream by scanning old artifacts.
|
||||
Fensalir also consumes `mimir.cultmesh_stream_frame.v1` as the fine-grained
|
||||
stream lane, so accepted timed frames can feed reservoir jobs before a whole
|
||||
capture-page batch is useful.
|
||||
|
||||
Any path that only paints pixels is not the spatiotemporal machine, but the
|
||||
editor still needs a real flat video compositor backend. The current
|
||||
|
|
|
|||
|
|
@ -351,6 +351,26 @@ internal sealed class FensalirDaemonState : IAsyncDisposable
|
|||
return true;
|
||||
}
|
||||
|
||||
if (kind == "mimir.cultmesh_stream_frame.v1")
|
||||
{
|
||||
var captureSequence = (long)DaemonUtil.JsonNumber(root, "captureSequence");
|
||||
reservoirWorker.Enqueue(BuildStreamFrameReservoirJob(root, current, captureSequence));
|
||||
var stream = DaemonUtil.JsonGet(root, "stream");
|
||||
next = current with
|
||||
{
|
||||
UpdatedAtUtc = DateTimeOffset.UtcNow.ToString("O"),
|
||||
Status = "drinking-stream-frames",
|
||||
WellSource = string.IsNullOrWhiteSpace(options.WellLogPath) ? "missing" : options.WellLogPath,
|
||||
LastCaptureSequence = captureSequence,
|
||||
Notes = [
|
||||
$"stream={DaemonUtil.JsonText(stream, "streamId") ?? "unknown"}",
|
||||
$"kind={DaemonUtil.JsonText(stream, "kind") ?? "unknown"}",
|
||||
"reservoir-worker=stream-frame-lane"
|
||||
],
|
||||
};
|
||||
return true;
|
||||
}
|
||||
|
||||
if (kind == "mimir.well_stream_pressure.v1")
|
||||
{
|
||||
var poll = DaemonUtil.JsonGet(root, "poll");
|
||||
|
|
@ -387,7 +407,7 @@ internal sealed class FensalirDaemonState : IAsyncDisposable
|
|||
options.GpuBudget,
|
||||
options.CpuBudget,
|
||||
"surface-owner-installed",
|
||||
["cultcache-state", "cultnet-websocket", "cultmesh-eve-dashboard", "well-tail"],
|
||||
["cultcache-state", "cultnet-websocket", "cultmesh-eve-dashboard", "well-tail", "stream-frame-tail"],
|
||||
["reservoir kernels pending"],
|
||||
0,
|
||||
0,
|
||||
|
|
@ -544,6 +564,58 @@ internal sealed class FensalirDaemonState : IAsyncDisposable
|
|||
Math.Max(0, current.AudioSources),
|
||||
Math.Max(0, current.VideoSources));
|
||||
}
|
||||
|
||||
private static ReservoirJob BuildStreamFrameReservoirJob(JsonElement root, MimirFensalirDaemonStateDocument current, long captureSequence)
|
||||
{
|
||||
var slice = DaemonUtil.JsonGet(root, "slice");
|
||||
var stream = DaemonUtil.JsonGet(root, "stream");
|
||||
var frame = DaemonUtil.JsonGet(root, "frame");
|
||||
var sample = DaemonUtil.JsonGet(root, "sample");
|
||||
var body = DaemonUtil.JsonGet(root, "body");
|
||||
var bodyRef = DaemonUtil.JsonGet(root, "bodyRef");
|
||||
var kind = DaemonUtil.JsonText(stream, "kind") ?? DaemonUtil.JsonText(sample, "Kind", "kind") ?? "";
|
||||
var status = DaemonUtil.JsonText(slice, "status", "Status") ?? "";
|
||||
var confidence = DaemonUtil.JsonNumber(slice, "timingConfidence", "TimingConfidence");
|
||||
var accepted = string.Equals(status, "Ready", StringComparison.OrdinalIgnoreCase) && confidence >= 0.20 ? 1 : 0;
|
||||
var reasons = new SortedSet<string>(StringComparer.Ordinal);
|
||||
if (accepted == 0)
|
||||
{
|
||||
reasons.Add(string.IsNullOrWhiteSpace(status) ? "missing-status" : $"slice-{status.ToLowerInvariant()}");
|
||||
if (confidence < 0.20)
|
||||
{
|
||||
reasons.Add("low-timing-confidence");
|
||||
}
|
||||
}
|
||||
|
||||
var bodyStatus = DaemonUtil.JsonText(body, "status") ?? "";
|
||||
var hasBodyRef = bodyRef.ValueKind == JsonValueKind.Object;
|
||||
var transport = DaemonUtil.JsonText(frame, "bodyTransport") ?? bodyStatus;
|
||||
if (string.Equals(transport, "metadata-only", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(bodyStatus, "empty", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
reasons.Add("body-metadata-only");
|
||||
accepted = 0;
|
||||
}
|
||||
|
||||
var videoSources = string.Equals(kind, "Video", StringComparison.OrdinalIgnoreCase) ? 1 : 0;
|
||||
var audioSources = string.Equals(kind, "Audio", StringComparison.OrdinalIgnoreCase) ? 1 : 0;
|
||||
return new ReservoirJob(
|
||||
captureSequence,
|
||||
1,
|
||||
accepted,
|
||||
accepted == 1 ? 0 : 1,
|
||||
(long)DaemonUtil.JsonNumber(slice, "canonicalStartNs", "CanonicalStartNs"),
|
||||
(long)DaemonUtil.JsonNumber(slice, "canonicalEndNs", "CanonicalEndNs"),
|
||||
confidence,
|
||||
Math.Abs((long)DaemonUtil.JsonNumber(slice, "distanceFromPresentationNs", "DistanceFromPresentationNs")),
|
||||
0.0,
|
||||
current.PollAverageMs,
|
||||
current.PublishAverageMs,
|
||||
$"streamFrame/{DaemonUtil.JsonText(stream, "streamId") ?? "unknown"}:{(hasBodyRef ? "paged" : transport)}",
|
||||
reasons.ToArray(),
|
||||
audioSources,
|
||||
videoSources);
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ReservoirWorkerState
|
||||
|
|
|
|||
|
|
@ -362,3 +362,4 @@
|
|||
{"ts": "2026-06-02T17:38:35+01:00", "type": "implementation", "status": "ok", "note": "2026-06-02: Added Mimir.FensalirDaemon as the first Well-drinking Fensalir reservoir owner surface. It tails Well JSONL documents, persists mimir.fensalir_daemon_state.v1 in state/fensalir-daemon.ccmp via CultCache MessagePack, serves /health and /eve/deck/manifest, and publishes Eve dashboard state over JSON WebSocket plus binary CultMesh mimir.eve_dashboard_state.v1 at /eve/deck/cultmesh. Smoke run fensalir-daemon-20260602-173556 reported health status=drinking-capture-pages and binary provider=mimir-fensalir-daemon nodes=4 surface=mimir.fensalir-daemon.surface. Current workerMode is surface-owner-installed; dense GPU kernels and fused program output still belong behind this daemon."}
|
||||
{"ts": "2026-06-02T18:09:09+01:00", "type": "implementation", "status": "ok", "note": "2026-06-02: Extended Mimir.FensalirDaemon from surface owner to reservoir scheduler owner. Added mimir.fensalir_reservoir_worker_state.v1 plus daemon summary worker counters, queue/running/completed/dropped job telemetry, accepted/rejected capture slice accounting, timing-confidence and GPU-queue pressure. Verified isolated daemon build succeeded and disposable fixture capture page completed one reservoir job with droppedJobs=0 while an empty smoke capture page was dropped as unusable."}
|
||||
{"ts": "2026-06-02T18:14:37+01:00", "type": "implementation", "status": "ok", "note": "2026-06-02: Wired Fensalir daemon into the online Verse supervisor. VerseRecorder now accepts --run-id, start-online-verse-daemons passes the supervisor runId, and FensalirDaemon starts against the exact VerseCaptures/<runId>/observations.jsonl with a run-local CultCache instead of artifact discovery. Dry-run verified relay, recorder, and Fensalir command shapes; VerseRecorder and FensalirDaemon builds passed."}
|
||||
{"ts": "2026-06-02T18:17:56+01:00", "type": "implementation", "status": "ok", "note": "2026-06-02: Fensalir daemon now consumes mimir.cultmesh_stream_frame.v1 as a fine-grained reservoir job lane in addition to well_capture_page batches. Timed frames with usable body/native/shared transport enqueue jobs; metadata-only or low-confidence frames drop with reasons. Isolated build passed and a stream-frame fixture on port 8802 completed one worker job with droppedJobs=0."}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ invariants:
|
|||
`Mimir.VerseRecorder` and starts Fensalir against that exact recorder
|
||||
`observations.jsonl`; discovery scans are fallback behavior, not the online
|
||||
authority path.
|
||||
`mimir.cultmesh_stream_frame.v1` records are also accepted as fine-grained
|
||||
reservoir jobs when their slice timing and body transport are usable.
|
||||
- `FieldEvidenceFrame` is not a flat video compositor. Camera Texture2D
|
||||
resources and claims are typed evidence declarations; they do not draw live
|
||||
Fensalir-owned texture leases as 2D program layers until Fensalir has an
|
||||
|
|
|
|||
Loading…
Reference in a new issue