Route acoustic proof through field evidence
This commit is contained in:
parent
aae7f9e4f3
commit
f9151b091b
7 changed files with 49 additions and 74 deletions
|
|
@ -85,9 +85,10 @@ Derived state:
|
|||
|
||||
- spectrum lines, debug views, screenshots, OBS bridge endpoints, FFmpeg/SRT
|
||||
helpers, and Eve dashboard feeds are views or diagnostics.
|
||||
- The old direct spline-spectrum dashboard and old direct GPU sensor frame
|
||||
bridge are silent. FieldEvidence owns spectrum and camera observation
|
||||
publication; screenshots and logs remain diagnostics.
|
||||
- The old direct spline-spectrum dashboard, direct GPU sensor frame bridge, and
|
||||
direct acoustic field frame proof are silent from Mimir's active bridge path.
|
||||
FieldEvidence owns spectrum, camera observation publication, and calibration
|
||||
constraints; screenshots and logs remain diagnostics.
|
||||
|
||||
Forbidden writers:
|
||||
|
||||
|
|
@ -402,8 +403,12 @@ Lower sync and calibration state into audio field constraints:
|
|||
|
||||
Acceptance:
|
||||
|
||||
- Fensalir can visualize acoustic confidence and constraints without receiving
|
||||
- implemented bridge proof: sync states lower into FieldEvidence calibration
|
||||
constraints instead of direct `AquariumAcousticFieldFrame` packets;
|
||||
- Fensalir can inspect acoustic confidence and constraints without receiving
|
||||
raw PCM as production truth;
|
||||
- no selected acoustic visualization/fusion lowering exists yet, so those
|
||||
claims defer until Fensalir owns that lowering;
|
||||
- Faust/native DSP remains the actuator for sample movement.
|
||||
|
||||
### Phase 5: Sensor Fusion Claims
|
||||
|
|
|
|||
|
|
@ -184,6 +184,11 @@ a named invariant that the native runtime cannot protect yet.
|
|||
Fensalir can now resolve those shared `Texture2D` resources by native D3D12
|
||||
handle and accepts Mimir video format names. `Mimir.BufferSmoke
|
||||
--fensalir-camera-observation-smoke` verifies the split.
|
||||
- Mimir's active proof path no longer uses the direct
|
||||
`AquariumAcousticFieldFrame` builder either. Sync states lower into
|
||||
FieldEvidence calibration constraints through `MapCalibrationConstraints`,
|
||||
and `--perfect-machine-profile-smoke` / `--perfect-machine-lowering-benchmark`
|
||||
now measure the same claim/defer path rather than a parallel acoustic packet.
|
||||
- Fensalir now owns the first in-process D3D12 field resource resolver cut:
|
||||
shared structured/curve buffer resources import/alias GPU-resident handles,
|
||||
and Fensalir-owned resources allocate GPU slots only when Fensalir is the
|
||||
|
|
|
|||
|
|
@ -364,6 +364,10 @@ requires a planned TubeField backend packet for the lowering's claim, and
|
|||
validation rejects TubeSpline metadata whose claim/resource authority is split.
|
||||
Mimir's typed surface-intent lowering now emits the matching TubeSpline
|
||||
lowering for audio spectrum/waveform Tube claims.
|
||||
Mimir's active proof path also no longer uses the direct
|
||||
`AquariumAcousticFieldFrame` builder: sync states lower into FieldEvidence
|
||||
calibration constraints and remain deferred until Fensalir owns a selected
|
||||
acoustic visualization/fusion lowering.
|
||||
|
||||
The current teardown/migration map is
|
||||
`docs/fensalir-rendering-rebuild-migration.md`, paired with Fensalir's
|
||||
|
|
|
|||
|
|
@ -1707,21 +1707,23 @@ static int RunPerfectMachineProfileSmoke()
|
|||
var lowerer = new MimirFensalirFieldLowering();
|
||||
var cameraFieldFrame = lowerer.BuildCameraObservationFrame([videoBuffer]);
|
||||
var cameraPlan = AquariumFieldLoweringPlanner.Plan(cameraFieldFrame);
|
||||
var acousticFrame = lowerer.BuildAcousticFieldFrame([
|
||||
new MimirAudioSynchronizationState(
|
||||
"loopback-scarlett-speakers",
|
||||
"scarlett-host-mic",
|
||||
192_000,
|
||||
61.25,
|
||||
61.25,
|
||||
0.319,
|
||||
0.875,
|
||||
0.94,
|
||||
[],
|
||||
1_000_000_000L,
|
||||
10,
|
||||
10)
|
||||
]);
|
||||
var syncState = new MimirAudioSynchronizationState(
|
||||
"loopback-scarlett-speakers",
|
||||
"scarlett-host-mic",
|
||||
192_000,
|
||||
61.25,
|
||||
61.25,
|
||||
0.319,
|
||||
0.875,
|
||||
0.94,
|
||||
[],
|
||||
1_000_000_000L,
|
||||
10,
|
||||
10);
|
||||
var acousticConstraints = new List<MimirCalibrationConstraint>(1);
|
||||
MimirFensalirBridgeMapper.MapCalibrationConstraints([syncState], acousticConstraints);
|
||||
var acousticFieldEvidence = lowerer.BuildFieldEvidenceFrame([], [], acousticConstraints, []);
|
||||
var acousticPlan = AquariumFieldLoweringPlanner.Plan(acousticFieldEvidence);
|
||||
var localizationGrid = MimirSrpPhatGridSolver.BuildGrid(
|
||||
new Vector3(-0.5f, 0.0f, 1.0f),
|
||||
new Vector3(0.5f, 0.0f, 1.0f),
|
||||
|
|
@ -1758,7 +1760,7 @@ static int RunPerfectMachineProfileSmoke()
|
|||
Console.WriteLine(
|
||||
$"perfect-machine-clock anchors={clock?.AnchorCount ?? 0} coverage={clock?.AnchorCoverage ?? 0:0.000} offset={clock?.SourceOffsetSamples ?? double.NaN:0.000} confidence={clock?.Confidence ?? 0:0.000}");
|
||||
Console.WriteLine(
|
||||
$"perfect-machine-fensalir cameraResources={cameraFieldFrame.Resources.Count} cameraClaims={cameraFieldFrame.Claims.Count} cameraPlanned={cameraPlan.Packets.Count} cameraDeferred={cameraPlan.DeferredRequests.Count} acousticConstraints={acousticFrame.Constraints.Count} timingConfidence={acousticFrame.TimingConfidence:0.000}");
|
||||
$"perfect-machine-fensalir cameraResources={cameraFieldFrame.Resources.Count} cameraClaims={cameraFieldFrame.Claims.Count} cameraPlanned={cameraPlan.Packets.Count} cameraDeferred={cameraPlan.DeferredRequests.Count} acousticClaims={acousticFieldEvidence.Claims.Count} acousticPlanned={acousticPlan.Packets.Count} acousticDeferred={acousticPlan.DeferredRequests.Count}");
|
||||
Console.WriteLine(
|
||||
$"perfect-machine-localization candidates={localizationGrid.Count} best=({localization?.PositionMeters.X ?? float.NaN:0.000},{localization?.PositionMeters.Y ?? float.NaN:0.000},{localization?.PositionMeters.Z ?? float.NaN:0.000}) score={localization?.Score ?? 0.0:0.000}");
|
||||
Console.WriteLine(
|
||||
|
|
@ -1792,7 +1794,9 @@ static int RunPerfectMachineProfileSmoke()
|
|||
cameraFieldFrame.Claims.Count == 2 &&
|
||||
cameraPlan.Packets.Count == 0 &&
|
||||
cameraPlan.DeferredRequests.Count == 2 &&
|
||||
acousticFrame.HasInput &&
|
||||
acousticFieldEvidence.Claims.Count == 1 &&
|
||||
acousticPlan.Packets.Count == 0 &&
|
||||
acousticPlan.DeferredRequests.Count == 1 &&
|
||||
localization is { Score: > 0.90 } &&
|
||||
authority.Decision == MimirAuthorityDecision.TrustedEvidence &&
|
||||
transport.Transport?.Id == MimirNetworkTransportConfigurations.CultMeshTimingState.Id &&
|
||||
|
|
@ -2051,8 +2055,10 @@ static int RunPerfectMachineLoweringBenchmark(int iterations)
|
|||
1)
|
||||
};
|
||||
var lowerer = new MimirFensalirFieldLowering();
|
||||
var calibrationConstraints = new List<MimirCalibrationConstraint>(states.Length);
|
||||
MimirFensalirBridgeMapper.MapCalibrationConstraints(states, calibrationConstraints);
|
||||
_ = lowerer.BuildCameraObservationFrame(buffers);
|
||||
_ = lowerer.BuildAcousticFieldFrame(states);
|
||||
_ = lowerer.BuildFieldEvidenceFrame([], [], calibrationConstraints, []);
|
||||
|
||||
var allocatedBefore = GC.GetAllocatedBytesForCurrentThread();
|
||||
var stamp = Stopwatch.GetTimestamp();
|
||||
|
|
@ -2062,10 +2068,10 @@ static int RunPerfectMachineLoweringBenchmark(int iterations)
|
|||
for (var iteration = 0; iteration < iterations; iteration++)
|
||||
{
|
||||
var cameraFrame = lowerer.BuildCameraObservationFrame(buffers);
|
||||
var acousticFrame = lowerer.BuildAcousticFieldFrame(states);
|
||||
var acousticFrame = lowerer.BuildFieldEvidenceFrame([], [], calibrationConstraints, []);
|
||||
cameraResources += cameraFrame.Resources.Count;
|
||||
cameraClaims += cameraFrame.Claims.Count;
|
||||
constraints += acousticFrame.Constraints.Count;
|
||||
constraints += acousticFrame.Claims.Count;
|
||||
}
|
||||
|
||||
var elapsed = Stopwatch.GetElapsedTime(stamp);
|
||||
|
|
|
|||
|
|
@ -114,55 +114,6 @@ public sealed class MimirFensalirFieldLowering(MimirFensalirLoweringOptions? opt
|
|||
return BuildFieldEvidenceFrame(windows, observations, [], intents);
|
||||
}
|
||||
|
||||
public AquariumAcousticFieldFrame BuildAcousticFieldFrame(IEnumerable<MimirAudioSynchronizationState> states)
|
||||
{
|
||||
var capacity = states.TryGetNonEnumeratedCount(out var count) ? count : 0;
|
||||
var orderedStates = new List<MimirAudioSynchronizationState>(capacity);
|
||||
foreach (var state in states)
|
||||
{
|
||||
orderedStates.Add(state);
|
||||
}
|
||||
|
||||
orderedStates.Sort(static (left, right) =>
|
||||
{
|
||||
var confidence = right.Confidence.CompareTo(left.Confidence);
|
||||
return confidence != 0
|
||||
? confidence
|
||||
: string.Compare(left.SourceId, right.SourceId, StringComparison.Ordinal);
|
||||
});
|
||||
|
||||
var constraints = new List<AquariumAcousticConstraint>(orderedStates.Count);
|
||||
foreach (var state in orderedStates)
|
||||
{
|
||||
if (state.Confidence <= 0.0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
constraints.Add(new AquariumAcousticConstraint(
|
||||
$"{state.ReferenceSourceId}->{state.SourceId}",
|
||||
AquariumAcousticConstraintKind.SpeakerProbe,
|
||||
Vector3.Zero,
|
||||
Vector3.Zero,
|
||||
RadiusMeters: 0.10f,
|
||||
Confidence: (float)Math.Clamp(state.Confidence, 0.0, 1.0),
|
||||
TimestampNs: state.UpdatedAtNs));
|
||||
}
|
||||
|
||||
var oracle = orderedStates.FirstOrDefault();
|
||||
return new AquariumAcousticFieldFrame
|
||||
{
|
||||
Constraints = constraints,
|
||||
TimingOracleNs = oracle?.UpdatedAtNs ?? 0,
|
||||
TimingConfidence = (float)Math.Clamp(oracle?.Confidence ?? 0.0, 0.0, 1.0),
|
||||
TimingUncertaintyMicroseconds = (float)(oracle == null
|
||||
? options.DefaultTimingUncertaintyMicroseconds
|
||||
: Math.Max(0.1, (1.0 - Math.Clamp(oracle.Confidence, 0.0, 1.0)) * options.DefaultTimingUncertaintyMicroseconds)),
|
||||
AccumulationWindowSeconds = (float)options.AccumulationWindowSeconds,
|
||||
PresentationDelaySeconds = (float)options.PresentationDelaySeconds
|
||||
};
|
||||
}
|
||||
|
||||
private static void AddDomain(
|
||||
ICollection<AquariumFieldDomain> domains,
|
||||
ISet<string> seenDomains,
|
||||
|
|
|
|||
|
|
@ -172,3 +172,4 @@
|
|||
{"ts": "2026-05-27T12:32:42+01:00", "type": "implementation", "status": "ok", "note": "Updated docs/fensalir-rendering-rebuild-migration.md so the rendering migration map matches the live spectrum TubeField path: newest-slot Float32 uploads, fixed source-lane capacity, RollingOffset ring addressing, Fensalir-owned valid-slot gating, stable claim-derived TubeField metadata ids, and the current budget levers."}
|
||||
{"ts": "2026-05-27T12:43:45+01:00", "type": "implementation", "status": "ok", "note": "Camera descriptors now lower through FieldEvidence instead of the retired direct GPU sensor frame bridge. GPU/native video handles declare shared Texture2D resources and camera claims; metadata-only cadence frames remain observations with no render payload, so missing pixels cannot become fake latest-window requests. --fensalir-camera-observation-smoke verifies the split and camera image claims defer until Fensalir owns a selected visual-fusion lowering."}
|
||||
{"ts": "2026-05-27T12:49:27+01:00", "type": "implementation", "status": "ok", "note": "Fensalir now resolves shared Texture2D field resources by native D3D12 handle and accepts Mimir video format names (Bgra8, Gray8/R8, Rg8, Nv12, LeapStereoIr). The camera observation bridge therefore produces resource declarations that can become real engine GPU resources before a selected camera/feature lowering exists."}
|
||||
{"ts": "2026-05-27T12:54:07+01:00", "type": "implementation", "status": "ok", "note": "Mimir's proof path no longer uses the direct AquariumAcousticFieldFrame builder. Sync states lower into FieldEvidence calibration constraints through MapCalibrationConstraints, and the profile/benchmark smokes now measure the claim/defer path until Fensalir owns a selected acoustic visualization/fusion lowering."}
|
||||
|
|
|
|||
|
|
@ -391,7 +391,10 @@ accepted_design:
|
|||
update.
|
||||
`MIMIR_SPECTRUM_TUBE_SUBDIVISIONS` controls the Mimir-requested Catmull-Rom
|
||||
subdivisions so Fensalir's TubeField truncation report has a direct cost
|
||||
lever.
|
||||
lever. Mimir's active proof path no longer uses the direct
|
||||
`AquariumAcousticFieldFrame` builder: sync states lower into FieldEvidence
|
||||
calibration constraints and remain deferred until Fensalir owns a selected
|
||||
acoustic visualization/fusion lowering.
|
||||
- `config/perfect-machine.example.json` declares live owners, sensors,
|
||||
reservoir views, and runtime policy.
|
||||
- `src/Mimir.Runtime/Synchronization` now includes the Perfect Machine module
|
||||
|
|
|
|||
Loading…
Reference in a new issue