Start Fensalir from online Verse supervisor
This commit is contained in:
parent
ce77e4907c
commit
20f92b50b8
5 changed files with 119 additions and 6 deletions
|
|
@ -51,6 +51,10 @@ confidence, and estimated GPU queue pressure are now CultCache/Eve-visible.
|
|||
The current worker uses a budget-derived cost model; real Fensalir GPU kernels
|
||||
and Faust-assisted feature signals should replace that cost model without
|
||||
moving ownership back into the editor.
|
||||
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.
|
||||
|
||||
Any path that only paints pixels is not the spatiotemporal machine, but the
|
||||
editor still needs a real flat video compositor backend. The current
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ param(
|
|||
[string]$ConfigPath = "E:\Projects\Mimir\config\mimir-runtime.well.local.json",
|
||||
[string]$WellPublishUrl = "ws://127.0.0.1:8796/eve/periwinkle",
|
||||
[string]$RecorderRoot = "C:\Users\Meta\Videos\Mimir\VerseCaptures",
|
||||
[int]$FensalirPort = 8799,
|
||||
[int]$FensalirWorkerMs = 2,
|
||||
[int]$FensalirMaxReservoirQueue = 120,
|
||||
[int]$DurationSeconds = 0,
|
||||
[int]$MoveFps = 120,
|
||||
[int]$MoveFftSize = 256,
|
||||
|
|
@ -14,6 +17,7 @@ param(
|
|||
"move-00-06-f5-23-e2-d1=/dev/hidraw3:#00a8ff"
|
||||
),
|
||||
[switch]$SkipRuntime,
|
||||
[switch]$SkipFensalir,
|
||||
[switch]$SkipMoves,
|
||||
[switch]$SkipNightwing,
|
||||
[switch]$DryRun
|
||||
|
|
@ -100,6 +104,7 @@ $manifest = [ordered]@{
|
|||
subscribeUrl = $SubscribeUrl
|
||||
wellPublishUrl = $WellPublishUrl
|
||||
recorderRoot = $RecorderRoot
|
||||
fensalirPort = $FensalirPort
|
||||
configPath = $ConfigPath
|
||||
startedAt = (Get-Date).ToString("o")
|
||||
durationSeconds = $DurationSeconds
|
||||
|
|
@ -114,6 +119,7 @@ if (-not $DryRun) {
|
|||
Where-Object {
|
||||
($_.CommandLine -match "Mimir.EveSensorReceiver" -and $_.CommandLine -match "--port 8796") -or
|
||||
($_.CommandLine -match "Mimir.VerseRecorder") -or
|
||||
($_.CommandLine -match "Mimir.FensalirDaemon") -or
|
||||
($_.CommandLine -match "Mimir.Well") -or
|
||||
($_.CommandLine -match "Mimir.BufferSmoke" -and $_.CommandLine -match "--poll-ms")
|
||||
} |
|
||||
|
|
@ -147,6 +153,7 @@ $recorderArgs = @(
|
|||
"--",
|
||||
"--url", $SubscribeUrl,
|
||||
"--out-dir", $RecorderRoot,
|
||||
"--run-id", $runId,
|
||||
"--write-bodies", "true",
|
||||
"--body-page-bytes", "134217728"
|
||||
)
|
||||
|
|
@ -157,6 +164,33 @@ if ($DurationSeconds -gt 0) {
|
|||
$recorder = Start-LoggedProcess -Name "verse-recorder" -FilePath "dotnet" -ArgumentList $recorderArgs
|
||||
if ($recorder) { $manifest.processes["verseRecorderPid"] = $recorder.Id }
|
||||
|
||||
if (-not $SkipFensalir) {
|
||||
$fensalirWellLog = Join-Path (Join-Path $RecorderRoot $runId) "observations.jsonl"
|
||||
$fensalirCache = Join-Path $runDir "fensalir-daemon.ccmp"
|
||||
$fensalir = Start-LoggedProcess `
|
||||
-Name "fensalir-daemon" `
|
||||
-FilePath "dotnet" `
|
||||
-ArgumentList @(
|
||||
"run",
|
||||
"--project",
|
||||
(Join-Path $repo "src\Mimir.FensalirDaemon\Mimir.FensalirDaemon.csproj"),
|
||||
"--",
|
||||
"--port", "$FensalirPort",
|
||||
"--well-log", $fensalirWellLog,
|
||||
"--cultcache", $fensalirCache,
|
||||
"--poll-ms", "50",
|
||||
"--worker-ms", "$FensalirWorkerMs",
|
||||
"--max-reservoir-queue", "$FensalirMaxReservoirQueue"
|
||||
)
|
||||
if ($fensalir) {
|
||||
$manifest.processes["fensalirDaemonPid"] = $fensalir.Id
|
||||
$manifest.processes["fensalirWellLog"] = $fensalirWellLog
|
||||
$manifest.processes["fensalirCultCache"] = $fensalirCache
|
||||
$manifest.processes["fensalirProviderSpec"] = "mimir-fensalir-daemon|Mimir Fensalir Daemon|ws://127.0.0.1:$FensalirPort/eve/deck"
|
||||
Wait-HttpHealth -Url "http://127.0.0.1:$FensalirPort/health"
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $SkipNightwing) {
|
||||
if ($DryRun) {
|
||||
Write-Host "DRY Nightwing stage and witness start on $NightwingHost"
|
||||
|
|
@ -307,7 +341,9 @@ if (-not $SkipRuntime) {
|
|||
"--capture-pages", "true",
|
||||
"--capture-ms", "250",
|
||||
"--capture-max-body-bytes", "4194304",
|
||||
"--capture-inline-bodies", "true"
|
||||
"--capture-inline-bodies", "false",
|
||||
"--stream-frames", "true",
|
||||
"--stream-frame-inline-bodies", "true"
|
||||
) `
|
||||
-Environment @{
|
||||
"MIMIR_RUNTIME_CONFIG" = $ConfigPath
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@ using System.Text.Json.Nodes;
|
|||
|
||||
var options = VerseRecorderOptions.Parse(args);
|
||||
Directory.CreateDirectory(options.OutputDirectory);
|
||||
var runId = DateTimeOffset.Now.ToString("yyyyMMdd-HHmmss");
|
||||
var runId = string.IsNullOrWhiteSpace(options.RunId)
|
||||
? DateTimeOffset.Now.ToString("yyyyMMdd-HHmmss")
|
||||
: options.RunId;
|
||||
var runDirectory = Path.Combine(options.OutputDirectory, runId);
|
||||
Directory.CreateDirectory(runDirectory);
|
||||
var jsonlPath = Path.Combine(runDirectory, "observations.jsonl");
|
||||
|
|
@ -35,6 +37,11 @@ await File.WriteAllTextAsync(
|
|||
directory = bodyPager.BodyDirectory,
|
||||
index = bodyPager.IndexPath,
|
||||
document = "mimir.recorder_body_index.v1",
|
||||
acceptedBodyDocuments = new[]
|
||||
{
|
||||
"mimir.cultmesh_stream_frame.v1",
|
||||
"mimir.well_capture_page.v1",
|
||||
},
|
||||
},
|
||||
},
|
||||
new JsonSerializerOptions { WriteIndented = true }));
|
||||
|
|
@ -80,6 +87,11 @@ while (!stopping.IsCancellationRequested)
|
|||
if (DateTimeOffset.UtcNow - lastMeter >= TimeSpan.FromSeconds(options.MeterSeconds))
|
||||
{
|
||||
await output.FlushAsync();
|
||||
if (bodyPager is not null)
|
||||
{
|
||||
await bodyPager.FlushAsync(stopping.Token).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
Console.Error.WriteLine($"verse-recorder observations={count} path={jsonlPath}");
|
||||
lastMeter = DateTimeOffset.UtcNow;
|
||||
}
|
||||
|
|
@ -134,6 +146,7 @@ static async Task<string?> ReceiveTextAsync(ClientWebSocket socket, Cancellation
|
|||
internal sealed record VerseRecorderOptions(
|
||||
Uri Url,
|
||||
string OutputDirectory,
|
||||
string RunId,
|
||||
double Seconds,
|
||||
double ReconnectSeconds,
|
||||
double MeterSeconds,
|
||||
|
|
@ -149,6 +162,7 @@ internal sealed record VerseRecorderOptions(
|
|||
return new VerseRecorderOptions(
|
||||
new Uri(ParseString(args, "--url", "ws://127.0.0.1:8796/eve/periwinkle/subscribe")),
|
||||
ParseString(args, "--out-dir", defaultOutput),
|
||||
ParseString(args, "--run-id", ""),
|
||||
ParseDouble(args, "--seconds", 0.0),
|
||||
ParseDouble(args, "--reconnect-seconds", 2.0),
|
||||
ParseDouble(args, "--meter-seconds", 5.0),
|
||||
|
|
@ -240,8 +254,17 @@ internal sealed class MimirRecorderBodyPager : IAsyncDisposable
|
|||
return text;
|
||||
}
|
||||
|
||||
if (root is not JsonObject rootObject ||
|
||||
!string.Equals(rootObject["document"]?.GetValue<string>(), "mimir.well_capture_page.v1", StringComparison.Ordinal) ||
|
||||
if (root is not JsonObject rootObject)
|
||||
{
|
||||
return text;
|
||||
}
|
||||
|
||||
if (string.Equals(rootObject["document"]?.GetValue<string>(), "mimir.cultmesh_stream_frame.v1", StringComparison.Ordinal))
|
||||
{
|
||||
return await PageStreamFrameBodyAsync(rootObject, text, stopping).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (!string.Equals(rootObject["document"]?.GetValue<string>(), "mimir.well_capture_page.v1", StringComparison.Ordinal) ||
|
||||
rootObject["samples"] is not JsonArray samples)
|
||||
{
|
||||
return text;
|
||||
|
|
@ -286,6 +309,41 @@ internal sealed class MimirRecorderBodyPager : IAsyncDisposable
|
|||
: text;
|
||||
}
|
||||
|
||||
private async Task<string> PageStreamFrameBodyAsync(
|
||||
JsonObject rootObject,
|
||||
string originalText,
|
||||
CancellationToken stopping)
|
||||
{
|
||||
if (rootObject["body"] is not JsonObject bodyObject ||
|
||||
!string.Equals(bodyObject["status"]?.GetValue<string>(), "inline", StringComparison.Ordinal) ||
|
||||
!string.Equals(bodyObject["encoding"]?.GetValue<string>(), "base64", StringComparison.Ordinal))
|
||||
{
|
||||
return originalText;
|
||||
}
|
||||
|
||||
var encoded = bodyObject["data"]?.GetValue<string>();
|
||||
if (string.IsNullOrWhiteSpace(encoded))
|
||||
{
|
||||
return originalText;
|
||||
}
|
||||
|
||||
byte[] bytes;
|
||||
try
|
||||
{
|
||||
bytes = Convert.FromBase64String(encoded);
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
return originalText;
|
||||
}
|
||||
|
||||
var bodyId = rootObject["bodyId"]?.GetValue<string>() ?? Guid.NewGuid().ToString("N");
|
||||
var bodyRef = await WriteBodyAsync(bodyId, bytes, rootObject, stopping).ConfigureAwait(false);
|
||||
rootObject.Remove("body");
|
||||
rootObject["bodyRef"] = bodyRef;
|
||||
return rootObject.ToJsonString();
|
||||
}
|
||||
|
||||
private async Task<JsonObject> WriteBodyAsync(
|
||||
string bodyId,
|
||||
byte[] bytes,
|
||||
|
|
@ -353,13 +411,23 @@ internal sealed class MimirRecorderBodyPager : IAsyncDisposable
|
|||
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
await FlushAsync(CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
if (currentPage is not null)
|
||||
{
|
||||
await currentPage.FlushAsync().ConfigureAwait(false);
|
||||
await currentPage.DisposeAsync().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
await indexWriter.FlushAsync().ConfigureAwait(false);
|
||||
await indexWriter.DisposeAsync().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task FlushAsync(CancellationToken stopping)
|
||||
{
|
||||
if (currentPage is not null)
|
||||
{
|
||||
await currentPage.FlushAsync(stopping).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
await indexWriter.FlushAsync().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -361,3 +361,4 @@
|
|||
{"ts": "2026-06-02T17:22:39+01:00", "type": "implementation", "status": "ok", "note": "2026-06-02: Mimir editor responsiveness scar/fix. Fensalir reservoir history is now gated by source-derived reservoir-producing inputs instead of running on every scene presentation. Live video-only editor run artifacts/runtime/program-texture-video-only-fast-20260602-172059 showed reservoir-update n/a and CPU frame about 8-9 ms. Remaining gap is architectural: FieldEvidenceFrame camera Texture2D declarations are not a flat video compositor backend, so live synced camera feeds need an explicit Fensalir 2D program-layer draw path or a separate Fensalir reservoir daemon output surface."}
|
||||
{"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."}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,10 @@ invariants:
|
|||
jobs, timing confidence, and estimated GPU queue pressure. The editor may
|
||||
observe these values but must not repair, schedule, or publish reservoir
|
||||
work.
|
||||
`scripts/start-online-verse-daemons.ps1` now passes its run id into
|
||||
`Mimir.VerseRecorder` and starts Fensalir against that exact recorder
|
||||
`observations.jsonl`; discovery scans are fallback behavior, not the online
|
||||
authority path.
|
||||
- `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