Add single tube proof controls

This commit is contained in:
Meta Vens 2026-05-28 14:01:54 +01:00
commit 69970302b8
2 changed files with 65 additions and 21 deletions

View file

@ -55,6 +55,7 @@ public sealed class MimirRuntime : IAquariumRuntime, IAquariumRuntimeServicesRec
private readonly float calibrationGain;
private readonly float watermarkGain;
private readonly bool syntheticSpectrumPreview;
private readonly bool syntheticSingleTubePreview;
private readonly MimirBioacousticContestantRenderer? complexContourWitness;
private int lastPollCount;
private float runtimeSeconds;
@ -133,6 +134,16 @@ public sealed class MimirRuntime : IAquariumRuntime, IAquariumRuntimeServicesRec
calibrationGain = settings.Audio.CalibrationGain;
watermarkGain = settings.Audio.WatermarkGain;
syntheticSpectrumPreview = IsTruthy(Environment.GetEnvironmentVariable("MIMIR_SYNTHETIC_SPECTRUM_PREVIEW"));
syntheticSingleTubePreview = IsTruthy(Environment.GetEnvironmentVariable("MIMIR_SYNTHETIC_SINGLE_TUBE_PREVIEW"));
if (syntheticSingleTubePreview)
{
GraphicsSettings = new GraphicsSettings(
RenderDebugMode: 0,
SceneExposure: 1.0f,
BloomIntensity: 0.075f,
BloomVeilIntensity: 0.0f);
}
obsStemPublisher = CreateObsStemPublisher();
complexContourWitness = settings.Audio.EnableComplexContourRuntime
? new MimirBioacousticContestantRenderer(
@ -168,15 +179,21 @@ public sealed class MimirRuntime : IAquariumRuntime, IAquariumRuntimeServicesRec
var channelCount = Math.Max(1, lastAudioSpectra.Count);
var fieldEvidenceFrame = BuildFieldEvidenceFrame();
var windowCount = Math.Max(1, spectrumHistory.Count);
var (splineMin, splineMax) = SpectrumSplineAabb(channelCount, windowCount);
var (splineMin, splineMax) = syntheticSingleTubePreview
? (new Vector3(-5.76643f, -1.0f, 0.0f), new Vector3(5.76643f, 1.0f, 0.0f))
: SpectrumSplineAabb(channelCount, windowCount);
var cameraTarget = (splineMin + splineMax) * 0.5f;
var cameraPosition = SpectrumCameraPosition(
channelCount,
windowCount,
cameraTarget,
spectrumCameraDistanceMultiplier,
spectrumCameraAngleDegrees);
var cameraFrustum = FitSpectrumCameraFrustum(splineMin, splineMax, cameraPosition, cameraTarget);
var cameraPosition = syntheticSingleTubePreview
? new Vector3(0.0f, 0.0f, -18.367355f)
: SpectrumCameraPosition(
channelCount,
windowCount,
cameraTarget,
spectrumCameraDistanceMultiplier,
spectrumCameraAngleDegrees);
var cameraFrustum = syntheticSingleTubePreview
? new AquariumCameraFrustum(-0.036f, 0.036f, -0.02025f, 0.02025f, 0.1f, 100.0f)
: FitSpectrumCameraFrustum(splineMin, splineMax, cameraPosition, cameraTarget);
lastSpectrumFrustum = cameraFrustum;
lastSpectrumCameraPosition = cameraPosition;
lastSpectrumCameraTarget = cameraTarget;
@ -190,6 +207,7 @@ public sealed class MimirRuntime : IAquariumRuntime, IAquariumRuntimeServicesRec
new AquariumSceneState
{
TraceHeightFieldSurface = false,
UseStudioBackground = !syntheticSingleTubePreview,
UseStarfieldBackground = obsProofVisualEnabled,
SdfObjects = obsProofVisualEnabled ? BuildObsProofSdfObjects(runtimeSeconds) : [],
SdfLights = obsProofVisualEnabled ? BuildObsProofSdfLights(runtimeSeconds) : [],
@ -346,7 +364,8 @@ public sealed class MimirRuntime : IAquariumRuntime, IAquariumRuntimeServicesRec
.Max());
var historyCount = historyFrames.Length;
var sourceCount = sourceIds.Length;
var activeColumnCount = checked(sourceCount * historyCount);
var renderedHistoryCount = syntheticSingleTubePreview ? 1 : historyCount;
var activeColumnCount = checked(sourceCount * renderedHistoryCount);
var resourceColumnCapacity = checked(spectrumSourceLaneCapacity * SpectrumHistoryWindowCount);
var newestHistorySlot = PositiveModulo(-historyFrames[0].Sequence, SpectrumHistoryWindowCount);
var rollingOffset = checked(newestHistorySlot * spectrumSourceLaneCapacity);
@ -413,7 +432,8 @@ public sealed class MimirRuntime : IAquariumRuntime, IAquariumRuntimeServicesRec
SpectrumRampResourceKey,
SpectrumRampTexturePath,
version: 1);
var axisStepX = width > 1 ? 10.0f / (width - 1) : 10.0f;
var axisLength = syntheticSingleTubePreview ? 11.53286f : 10.0f;
var axisStepX = width > 1 ? axisLength / (width - 1) : axisLength;
var claims = new List<AquariumFieldClaim>(sourceCount);
var candidates = new List<AquariumFieldCandidate>(sourceCount);
var lowerings = new List<AquariumFieldTubeSplineLowering>(sourceCount);
@ -428,7 +448,7 @@ public sealed class MimirRuntime : IAquariumRuntime, IAquariumRuntimeServicesRec
};
var sourceProposal = proposal with
{
RepresentedCandidateCount = historyCount,
RepresentedCandidateCount = renderedHistoryCount,
Seed = unchecked(proposal.Seed + (uint)sourceIndex),
};
claims.Add(new AquariumFieldClaim(
@ -457,25 +477,27 @@ public sealed class MimirRuntime : IAquariumRuntime, IAquariumRuntimeServicesRec
Height: resourceColumnCapacity,
StrideBytes: sizeof(float),
FirstColumn: sourceIndex,
ColumnCount: historyCount,
ColumnCount: renderedHistoryCount,
ColumnStride: spectrumSourceLaneCapacity,
RollingModulo: resourceColumnCapacity,
RollingOffset: rollingOffset,
Origin: new Vector3(-5.0f, sourceIndex * SpectrumChannelSeparation, 0.0f),
Origin: syntheticSingleTubePreview
? new Vector3(-axisLength * 0.5f, 0.0f, 0.0f)
: new Vector3(-5.0f, sourceIndex * SpectrumChannelSeparation, 0.0f),
AxisStep: new Vector3(axisStepX, 0.0f, 0.0f),
ColumnStep: new Vector3(0.0f, 0.0f, SpectrumWindowDepthSeparation),
AmplitudePower: 2.0f,
AmplitudeScale: SpectrumAmplitudeHeight,
AmplitudeScale: syntheticSingleTubePreview ? 0.0f : SpectrumAmplitudeHeight,
NormalizeMin: 0.0f,
NormalizeMax: 1.0f,
BaseRadius: 0.012f,
RadiusScale: 0.030f,
Alpha: 0.92f,
Feather: 0.20f,
BaseRadius: syntheticSingleTubePreview ? 1.0f : 0.012f,
RadiusScale: syntheticSingleTubePreview ? 0.0f : 0.030f,
Alpha: 1.0f,
Feather: syntheticSingleTubePreview ? 0.02f : 0.20f,
RampTexturePath: SpectrumRampTexturePath,
RampResourceKey: SpectrumRampResourceKey,
EmissionScale: 10.0f,
CatmullRomSubdivisions: spectrumTubeSubdivisions).Normalized());
EmissionScale: syntheticSingleTubePreview ? 16.0f : 10.0f,
CatmullRomSubdivisions: syntheticSingleTubePreview ? 1 : spectrumTubeSubdivisions).Normalized());
}
return new AquariumFieldEvidenceFrame
@ -1097,7 +1119,7 @@ public sealed class MimirRuntime : IAquariumRuntime, IAquariumRuntimeServicesRec
var stopwatch = Stopwatch.StartNew();
lastAudioSpectra = spectrumAnalyzer.Analyze(synchronization.Buffers.Buffers, audioSyncSettings.ReferenceSourceId);
if (lastAudioSpectra.Count == 0 && syntheticSpectrumPreview)
if (lastAudioSpectra.Count == 0 && (syntheticSpectrumPreview || syntheticSingleTubePreview))
{
lastAudioSpectra = GenerateSyntheticSpectrumPreview(runtimeSeconds);
}
@ -1377,6 +1399,27 @@ public sealed class MimirRuntime : IAquariumRuntime, IAquariumRuntimeServicesRec
private static IReadOnlyList<MimirAudioSpectrumSnapshot> GenerateSyntheticSpectrumPreview(float timeSeconds)
{
if (IsTruthy(Environment.GetEnvironmentVariable("MIMIR_SYNTHETIC_SINGLE_TUBE_PREVIEW")))
{
const int singleTubeBandCount = 2;
var bands = Enumerable.Repeat(-40.0, singleTubeBandCount).ToArray();
return
[
new MimirAudioSpectrumSnapshot(
"preview-tube",
"Single Tube Proof",
192000,
8192,
8192,
0.24,
0.56,
-78.0,
[],
bands,
(long)(timeSeconds * 1_000_000_000.0)),
];
}
const int bandCount = 48;
var snapshots = new MimirAudioSpectrumSnapshot[4];
for (var channel = 0; channel < snapshots.Length; channel++)

View file

@ -210,3 +210,4 @@
{"ts": "2026-05-28T12:14:54+01:00", "type": "implementation", "status": "ok", "note": "Rendering migration Phase 6 reconciled as structurally complete: OBS consumes final Mimir/Fensalir program surfaces and stems through the native plugin, with recorded live texture, ring, producer-fence, and consumer-fence proofs. Raw feeds remain debug inputs, not synchronization truth."}
{"ts": "2026-05-28T12:42:24+01:00", "type": "implementation", "status": "ok", "note": "TubeField demo now uses the reservoir/TAA guide path honestly: Fensalir's TubeField pixel shader writes stable field id plus real tube normals into metadata and coverage/confidence into reservoirGuide, so post resolve can validate history with the same spatiotemporal guide surfaces used by other field paths. Live synthetic spectrum demo log at artifacts/runtime/mimir-spectrum-reservoir-demo.log showed 4 planned TubeField packets, 0 deferred, 0 unplanned, 0 truncated."}
{"ts": "2026-05-28T12:58:22+01:00", "type": "implementation", "status": "ok", "note": "TubeField render now binds Fensalir's engine blue-noise texture and jitters the tube-local SDF sample inside the generated proxy fragment shader before writing coverage/normals/reservoir guide data. The pass also uses scene depth so opaque generated field geometry resolves by nearest surface instead of draw order. Live demo compiled and planned 4 TubeField packets with 0 deferred/0 truncated; screenshot still shows generated segment structure, so the final smooth tube marcher remains a renderer-quality cut."}
{"ts": "2026-05-28T14:00:43+01:00", "type": "decision", "status": "ok", "note": "Tube proof render now uses Blender 5.1 OCIO ACES 2.0 sRGB transform baked into Fensalir post, eight-octave Sonic Ether-style normalized bloom, and an explicit scene-state bit to disable studio background for dark proof scenes. Current proof capture is artifacts/runtime/mimir-single-tube-headless-aces2-sebloom-core-preserve.png; core/halo are close enough to continue, remaining deltas are capsule geometry/cap shading rather than tone-map authority."}