Lower synthetic acoustic source candidates
This commit is contained in:
parent
1fd67e1ff4
commit
fdba81cac1
8 changed files with 145 additions and 5 deletions
|
|
@ -427,7 +427,11 @@ Let Fensalir fuse Mimir observations into field claims:
|
|||
Acceptance:
|
||||
|
||||
- one synthetic multi-camera marker creates a stable world-space claim;
|
||||
- one synthetic audio source creates a localizable confidence field;
|
||||
- implemented synthetic audio source proof: Mimir lowers an SRP/PHAT-style
|
||||
source candidate with calibration/source identity and a world-space confidence
|
||||
envelope, and Fensalir plans it as a `DebugOverlay` FieldEvidence packet;
|
||||
- next remaining acceptance item: one synthetic multi-camera marker creates a
|
||||
stable world-space claim;
|
||||
- claims can be inspected by source observation and calibration id.
|
||||
|
||||
### Phase 6: Program Output Receipts
|
||||
|
|
|
|||
|
|
@ -270,7 +270,10 @@ a named invariant that the native runtime cannot protect yet.
|
|||
and Fensalir selects audio-path `Phase` and `Confidence` claims as
|
||||
`DebugOverlay` backend packets. `--perfect-machine-profile-smoke` now proves
|
||||
the acoustic constraint is planned through FieldEvidence instead of deferred
|
||||
through a parallel acoustic packet.
|
||||
through a parallel acoustic packet. The same smoke now also proves the first
|
||||
Phase 5 synthetic audio-source candidate: an SRP/PHAT-style localization
|
||||
result is lowered with calibration/source identity and a world-space
|
||||
confidence envelope, then planned as a FieldEvidence `DebugOverlay` 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
|
||||
|
|
|
|||
|
|
@ -462,7 +462,12 @@ calibration constraints. Fensalir now selects audio-path `Phase` and
|
|||
`Confidence` claims as `DebugOverlay` backend packets, so calibration
|
||||
timing/path evidence can be inspected through the same FieldEvidence authority
|
||||
while true acoustic source candidates and confidence volumes remain later
|
||||
fusion work.
|
||||
fusion work. The first synthetic acoustic source candidate proof now exists:
|
||||
Mimir lowers an SRP/PHAT-style localized source with calibration/source
|
||||
identity and a world-space confidence envelope, and Fensalir plans it as a
|
||||
FieldEvidence `DebugOverlay` packet. Live room geometry must still come from an
|
||||
explicit measured coordinate frame, not inferred from the recent two-distance
|
||||
monitor notes.
|
||||
|
||||
The current teardown/migration map is
|
||||
`docs/fensalir-rendering-rebuild-migration.md`, paired with Fensalir's
|
||||
|
|
|
|||
|
|
@ -2176,6 +2176,22 @@ static int RunPerfectMachineProfileSmoke()
|
|||
[
|
||||
new MimirPairDelayObservation("mic-left", "mic-right", 0.0, 0.95)
|
||||
]);
|
||||
var acousticSourceFrame = lowerer.BuildAcousticSourceCandidateFrame(
|
||||
localization is null
|
||||
? []
|
||||
:
|
||||
[
|
||||
new MimirAcousticSourceFieldCandidate(
|
||||
"synthetic-speaker",
|
||||
"synthetic-tdoa-calibration",
|
||||
"synthetic-audio-source",
|
||||
"mimir-srp-phat-grid",
|
||||
localization.PositionMeters,
|
||||
MimirAcousticLocalizationConfigurations.SrpPhatGrid.TargetPositionUncertaintyMeters,
|
||||
localization.Score,
|
||||
1_000_000_000L)
|
||||
]);
|
||||
var acousticSourcePlan = AquariumFieldLoweringPlanner.Plan(acousticSourceFrame);
|
||||
var authority = new MimirAuthorityPolicyEvaluator().Evaluate(new MimirAuthorityEvaluationInput(
|
||||
"raven-scarlett-witness",
|
||||
new HashSet<string>(["known-node", "matching-codebook", "clock-fit-confidence", "response-profile"], StringComparer.Ordinal),
|
||||
|
|
@ -2201,7 +2217,7 @@ static int RunPerfectMachineProfileSmoke()
|
|||
Console.WriteLine(
|
||||
$"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}");
|
||||
$"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} sourceClaims={acousticSourceFrame.Claims.Count} sourcePlanned={acousticSourcePlan.Packets.Count} sourceDeferred={acousticSourcePlan.DeferredRequests.Count}");
|
||||
Console.WriteLine(
|
||||
$"perfect-machine-authority appliesTo=raven-scarlett-witness decision={authority.Decision} rule={authority.RuleId}");
|
||||
Console.WriteLine(
|
||||
|
|
@ -2236,6 +2252,11 @@ static int RunPerfectMachineProfileSmoke()
|
|||
acousticFieldEvidence.Claims.Count == 1 &&
|
||||
acousticPlan.Packets.Count == 1 &&
|
||||
acousticPlan.DeferredRequests.Count == 0 &&
|
||||
acousticSourceFrame.Claims.Count == 1 &&
|
||||
acousticSourcePlan.Packets.Count == 1 &&
|
||||
acousticSourcePlan.DeferredRequests.Count == 0 &&
|
||||
acousticSourceFrame.Claims[0].ClaimKey.Contains("synthetic-tdoa-calibration", StringComparison.Ordinal) &&
|
||||
acousticSourceFrame.Claims[0].ClaimKey.Contains("synthetic-audio-source", StringComparison.Ordinal) &&
|
||||
localization is { Score: > 0.90 } &&
|
||||
authority.Decision == MimirAuthorityDecision.TrustedEvidence &&
|
||||
transport.Transport?.Id == MimirNetworkTransportConfigurations.CultMeshTimingState.Id &&
|
||||
|
|
|
|||
|
|
@ -140,6 +140,16 @@ public sealed record MimirCalibrationConstraint(
|
|||
string UsableBandMask,
|
||||
double Confidence);
|
||||
|
||||
public sealed record MimirAcousticSourceFieldCandidate(
|
||||
string CandidateKey,
|
||||
string CalibrationId,
|
||||
string SourceId,
|
||||
string ProducerKey,
|
||||
System.Numerics.Vector3 PositionMeters,
|
||||
double RadiusMeters,
|
||||
double Confidence,
|
||||
long ObservedTimeNs);
|
||||
|
||||
public readonly record struct MimirSurfaceAxes(
|
||||
string X,
|
||||
string Y,
|
||||
|
|
|
|||
|
|
@ -114,6 +114,39 @@ public sealed class MimirFensalirFieldLowering(MimirFensalirLoweringOptions? opt
|
|||
return BuildFieldEvidenceFrame(windows, observations, [], intents);
|
||||
}
|
||||
|
||||
public AquariumFieldEvidenceFrame BuildAcousticSourceCandidateFrame(
|
||||
IEnumerable<MimirAcousticSourceFieldCandidate> sourceCandidates)
|
||||
{
|
||||
var domains = new List<AquariumFieldDomain>();
|
||||
var claims = new List<AquariumFieldClaim>();
|
||||
var candidates = new List<AquariumFieldCandidate>();
|
||||
var seenDomains = new HashSet<string>(StringComparer.Ordinal);
|
||||
|
||||
foreach (var sourceCandidate in sourceCandidates)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(sourceCandidate.CandidateKey))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var domain = DomainForAcousticSourceCandidate(sourceCandidate);
|
||||
AddDomain(domains, seenDomains, domain);
|
||||
|
||||
var claim = ClaimForAcousticSourceCandidate(sourceCandidate, domain.DomainKey);
|
||||
claims.Add(claim);
|
||||
candidates.Add(CandidateForClaim(claim, AquariumFieldGuide.Valid(claim.Confidence)));
|
||||
}
|
||||
|
||||
return new AquariumFieldEvidenceFrame
|
||||
{
|
||||
Domains = domains,
|
||||
Claims = claims,
|
||||
Candidates = candidates,
|
||||
AccumulationWindowSeconds = (float)options.AccumulationWindowSeconds,
|
||||
PresentationDelaySeconds = (float)options.PresentationDelaySeconds
|
||||
};
|
||||
}
|
||||
|
||||
private static void AddDomain(
|
||||
ICollection<AquariumFieldDomain> domains,
|
||||
ISet<string> seenDomains,
|
||||
|
|
@ -254,6 +287,23 @@ public sealed class MimirFensalirFieldLowering(MimirFensalirLoweringOptions? opt
|
|||
Vector3.Zero,
|
||||
"Mimir.Runtime");
|
||||
|
||||
private static AquariumFieldDomain DomainForAcousticSourceCandidate(MimirAcousticSourceFieldCandidate candidate)
|
||||
{
|
||||
var radius = Math.Max(0.01f, (float)candidate.RadiusMeters);
|
||||
var center = candidate.PositionMeters;
|
||||
var boundsRadius = new Vector3(radius);
|
||||
return new AquariumFieldDomain(
|
||||
DomainKeyForAcousticSourceCandidate(candidate),
|
||||
"",
|
||||
AquariumFieldDomainKind.AudioPath,
|
||||
Matrix4x4.Identity,
|
||||
Matrix4x4.Identity,
|
||||
center - boundsRadius,
|
||||
center + boundsRadius,
|
||||
Vector3.Zero,
|
||||
"Mimir.Runtime");
|
||||
}
|
||||
|
||||
private static AquariumFieldDomain DomainForSurfaceIntent(MimirSurfaceIntent intent) =>
|
||||
new(
|
||||
DomainKeyForSurfaceIntent(intent.IntentKey),
|
||||
|
|
@ -312,6 +362,31 @@ public sealed class MimirFensalirFieldLowering(MimirFensalirLoweringOptions? opt
|
|||
Confidence: confidence);
|
||||
}
|
||||
|
||||
private AquariumFieldClaim ClaimForAcousticSourceCandidate(
|
||||
MimirAcousticSourceFieldCandidate sourceCandidate,
|
||||
string domainKey)
|
||||
{
|
||||
var confidence = Clamp01((float)sourceCandidate.Confidence);
|
||||
var proposal = new AquariumFieldProposalPolicy(
|
||||
AquariumFieldProposalKind.CalibrationConstraint,
|
||||
SourcePdf: 1.0f,
|
||||
TargetContribution: confidence,
|
||||
RepresentedCandidateCount: 1,
|
||||
Seed: StableSeed(sourceCandidate.CandidateKey));
|
||||
|
||||
return new AquariumFieldClaim(
|
||||
ClaimKey: $"acoustic-source:{sourceCandidate.CalibrationId}:{sourceCandidate.SourceId}:{sourceCandidate.CandidateKey}",
|
||||
DomainKey: domainKey,
|
||||
ProducerKey: sourceCandidate.ProducerKey,
|
||||
Layer: AquariumFieldLayer.Form,
|
||||
Encoding: AquariumFieldEncoding.Confidence,
|
||||
Support: SupportForAcousticSourceCandidate(sourceCandidate),
|
||||
Proposal: proposal,
|
||||
PayloadHandle: sourceCandidate.CalibrationId,
|
||||
ObservedTimeNs: sourceCandidate.ObservedTimeNs,
|
||||
Confidence: confidence);
|
||||
}
|
||||
|
||||
private AquariumFieldClaim ClaimForSurfaceIntent(
|
||||
MimirSurfaceIntent intent,
|
||||
string domainKey,
|
||||
|
|
@ -427,6 +502,19 @@ public sealed class MimirFensalirFieldLowering(MimirFensalirLoweringOptions? opt
|
|||
TemporalUncertainty: uncertaintySeconds);
|
||||
}
|
||||
|
||||
private AquariumFieldSupport SupportForAcousticSourceCandidate(MimirAcousticSourceFieldCandidate sourceCandidate)
|
||||
{
|
||||
var radius = Math.Max(options.DefaultSupportRadius, (float)sourceCandidate.RadiusMeters);
|
||||
return new AquariumFieldSupport(
|
||||
Center: sourceCandidate.PositionMeters,
|
||||
Radius: new Vector3(radius),
|
||||
LocalFrame: Matrix4x4.Identity,
|
||||
ConservativeRadius: radius,
|
||||
ProjectedError: radius,
|
||||
Curvature: 0.0f,
|
||||
TemporalUncertainty: 0.0f);
|
||||
}
|
||||
|
||||
private AquariumFieldSupport SupportForSurfaceIntent(MimirSurfaceIntent intent)
|
||||
{
|
||||
var age = Math.Max(0.0f, (float)intent.SupportPolicy.MaximumAgeSeconds);
|
||||
|
|
@ -590,6 +678,9 @@ public sealed class MimirFensalirFieldLowering(MimirFensalirLoweringOptions? opt
|
|||
|
||||
private static string DomainKeyForCalibrationConstraint(string constraintKey) => $"mimir:calibration:{constraintKey}";
|
||||
|
||||
private static string DomainKeyForAcousticSourceCandidate(MimirAcousticSourceFieldCandidate candidate) =>
|
||||
$"mimir:acoustic-source:{candidate.CalibrationId}:{candidate.SourceId}:{candidate.CandidateKey}";
|
||||
|
||||
private static string DomainKeyForSurfaceIntent(string intentKey) => $"mimir:intent:{intentKey}";
|
||||
|
||||
private static float Clamp01(float value) => Math.Clamp(value, 0.0f, 1.0f);
|
||||
|
|
|
|||
|
|
@ -205,3 +205,4 @@
|
|||
{"ts": "2026-05-28T08:14:31+01:00", "type": "observation", "status": "ok", "note": "Physical mapping for monitor-routed complex-contour proof: asio-ch0/Input 1 is the shotgun, about 1.5 m from right monitor and 3.0 m from left; asio-ch1/Input 2 is the cardioid, about 0.5 m from left monitor and 1.5 m from right. Geometry should be used when interpreting 20260528-080727 path delays."}
|
||||
{"ts": "2026-05-28T08:20:48+01:00", "type": "verification", "status": "blocked", "note": "ASIO monitor split proof 20260528-081813 added --play-output-channel and captured output 0/output 1 separately. Loopback channels confirmed distinct ASIO output buffers, but physical mic delays were nearly identical across outputs (shotgun delta about 20.885 us; cardioid delta about 24.789 us), inconsistent with declared left/right monitor geometry. Downstream monitor routing/isolation must be verified before learning left/right acoustic paths."}
|
||||
{"ts": "2026-05-28T12:06:53+01:00", "type": "implementation", "status": "ok", "note": "Fensalir now selects FieldEvidence AudioPath Phase/Confidence claims as DebugOverlay backend packets, so Mimir acoustic calibration constraints are planned rather than deferred. Mimir profile smoke now reports acousticPlanned=1 acousticDeferred=0; acoustic source volumes remain Phase 5 fusion work."}
|
||||
{"ts": "2026-05-28T12:10:23+01:00", "type": "implementation", "status": "ok", "note": "Phase 5 synthetic audio-source proof added: Mimir lowers an SRP/PHAT-style localized source candidate with calibration/source identity and a world-space confidence envelope; Fensalir plans it as a FieldEvidence DebugOverlay packet. Live room geometry still needs an explicit coordinate frame before physical candidates become runtime truth."}
|
||||
|
|
|
|||
|
|
@ -498,7 +498,12 @@ accepted_design:
|
|||
calibration constraints. Fensalir now selects AudioPath Phase/Confidence
|
||||
claims as DebugOverlay backend packets, so acoustic calibration evidence is
|
||||
planned and inspectable through the FieldEvidence authority. Acoustic source
|
||||
candidates and confidence volumes remain Phase 5 fusion work.
|
||||
candidates and confidence volumes remain Phase 5 fusion work. The first
|
||||
synthetic acoustic source candidate proof now lowers an SRP/PHAT-style
|
||||
localization result with calibration/source identity and a world-space
|
||||
confidence envelope, and Fensalir plans it as a FieldEvidence DebugOverlay
|
||||
packet. Live room geometry still needs an explicit measured coordinate
|
||||
frame before those candidates become runtime truth.
|
||||
- `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