Emit Mimir TubeSpline field lowerings

This commit is contained in:
Meta Vens 2026-05-26 23:01:05 +01:00
commit f536385e1a
7 changed files with 77 additions and 5 deletions

View file

@ -225,8 +225,9 @@ shared ABI; TubeField only owns the argument buffer it emits. TubeField
expansion is now gated by selected backend packets, so explicit lowering
metadata cannot bypass validation/planning authority. Validation also rejects
TubeSpline metadata whose claim is not Tube-encoded or whose resource differs
from the claim payload. That is engine ownership, not a reason for Mimir to
create a parallel renderer.
from the claim payload. Mimir's typed surface-intent lowering now emits the
matching TubeSpline metadata for audio spectrum/waveform Tube claims. That is
engine ownership, not a reason for Mimir to create a parallel renderer.
### 3. Calibration Constraint

View file

@ -198,7 +198,10 @@ a named invariant that the native runtime cannot protect yet.
backend packet plan; unplanned `TubeSplineLowering` records are counted but
not expanded. Fensalir validation also rejects TubeSpline lowering metadata
whose claim is not Tube-encoded or whose resource differs from the claim
payload.
payload. Mimir's typed surface-intent lowering now emits the matching
`AquariumFieldTubeSplineLowering` for audio spectrum/waveform Tube claims, so
the real Mimir producer supplies both the planned packet and the generated
mesh producer metadata.
- `MimirRuntime` queues bioacoustic timeline PCM through Fensalir audio when the
active timing witness is allowed. `MimirAudioSynchronizationSettings.Mode`
selects `chirp-only`, `passive`, or `hybrid`; passive disables active

View file

@ -352,6 +352,8 @@ state. The DrawIndexed indirect command signature has been lifted to the
generated-mesh lane instead of being TubeField-owned. TubeField expansion now
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.
The current teardown/migration map is
`docs/fensalir-rendering-rebuild-migration.md`, paired with Fensalir's

View file

@ -542,7 +542,7 @@ static int RunFensalirFieldEvidenceSmoke()
var plan = AquariumFieldLoweringPlanner.Plan(frame);
Console.WriteLine(
$"fensalir-field-evidence-smoke domains={frame.Domains.Count} resources={frame.Resources.Count} claims={frame.Claims.Count} candidates={frame.Candidates.Count} packets={frame.BackendPackets.Count} requests={requests.Count} planned={plan.Packets.Count} deferred={plan.DeferredRequests.Count} errors={validation.HasErrors}");
$"fensalir-field-evidence-smoke domains={frame.Domains.Count} resources={frame.Resources.Count} claims={frame.Claims.Count} candidates={frame.Candidates.Count} tubeLowerings={frame.TubeSplineLowerings.Count} packets={frame.BackendPackets.Count} requests={requests.Count} planned={plan.Packets.Count} deferred={plan.DeferredRequests.Count} errors={validation.HasErrors}");
if (validation.HasErrors)
{
@ -557,6 +557,9 @@ static int RunFensalirFieldEvidenceSmoke()
frame.Resources[0].ResourceKey == MimirFensalirBridgeMapper.ResourceKeyForPayload(window.Payload) &&
frame.BackendPackets.Count == 0 &&
frame.Claims.Count == 3 &&
frame.TubeSplineLowerings.Count == 1 &&
frame.TubeSplineLowerings[0].ClaimKey == plan.Packets[0].ClaimKey &&
frame.TubeSplineLowerings[0].ResourceKey == frame.Resources[0].ResourceKey &&
frame.Claims.Any(claim => claim.PayloadHandle == frame.Resources[0].ResourceKey) &&
requests.Count == 3 &&
requests.All(static request => request.IsPendingBackendSelection) &&

View file

@ -25,6 +25,7 @@ public sealed class MimirFensalirFieldLowering(MimirFensalirLoweringOptions? opt
var candidates = new List<AquariumFieldCandidate>();
var packets = new List<AquariumFieldBackendPacket>();
var resources = new List<AquariumFieldResourceDeclaration>();
var tubeSplineLowerings = new List<AquariumFieldTubeSplineLowering>();
var seenResources = new HashSet<string>(StringComparer.Ordinal);
var seenDomains = new HashSet<string>(StringComparer.Ordinal);
@ -67,6 +68,10 @@ public sealed class MimirFensalirFieldLowering(MimirFensalirLoweringOptions? opt
claim.Confidence,
Math.Max(0.0f, (float)intent.SupportPolicy.MaximumAgeSeconds));
candidates.Add(CandidateForClaim(claim, guide));
if (TryBuildTubeSplineLowering(intent, claim, resources, out var tubeSplineLowering))
{
tubeSplineLowerings.Add(tubeSplineLowering);
}
}
return new AquariumFieldEvidenceFrame
@ -76,6 +81,7 @@ public sealed class MimirFensalirFieldLowering(MimirFensalirLoweringOptions? opt
Candidates = candidates,
BackendPackets = packets,
Resources = resources,
TubeSplineLowerings = tubeSplineLowerings,
AccumulationWindowSeconds = (float)options.AccumulationWindowSeconds,
PresentationDelaySeconds = (float)options.PresentationDelaySeconds
};
@ -433,6 +439,59 @@ public sealed class MimirFensalirFieldLowering(MimirFensalirLoweringOptions? opt
Proposal: claim.Proposal,
Guide: guide);
private static bool TryBuildTubeSplineLowering(
MimirSurfaceIntent intent,
AquariumFieldClaim claim,
IReadOnlyList<AquariumFieldResourceDeclaration> resources,
out AquariumFieldTubeSplineLowering lowering)
{
lowering = default;
if (claim.Encoding != AquariumFieldEncoding.Tube ||
string.IsNullOrWhiteSpace(claim.PayloadHandle))
{
return false;
}
var resource = resources.FirstOrDefault(resource => string.Equals(resource.ResourceKey, claim.PayloadHandle, StringComparison.Ordinal));
if (!resource.HasIdentity ||
resource.Kind is not (AquariumFieldResourceKind.StructuredBuffer or AquariumFieldResourceKind.CurvePointBuffer))
{
return false;
}
var width = Math.Max(2, resource.Width);
var height = Math.Max(1, resource.Height);
var axisStepX = width > 1 ? 10.0f / (width - 1) : 10.0f;
lowering = new AquariumFieldTubeSplineLowering(
LoweringKey: $"tube-spline:{intent.IntentKey}",
ClaimKey: claim.ClaimKey,
ResourceKey: resource.ResourceKey,
Width: width,
Height: height,
StrideBytes: Math.Max(4, resource.StrideBytes),
FirstColumn: 0,
ColumnCount: height,
ColumnStride: 1,
RollingModulo: height,
RollingOffset: 0,
Origin: new Vector3(-5.0f, 0.0f, 0.0f),
AxisStep: new Vector3(axisStepX, 0.0f, 0.0f),
ColumnStep: new Vector3(0.0f, 0.0f, 0.1f),
AmplitudePower: 2.0f,
AmplitudeScale: 1.0f,
NormalizeMin: 0.0f,
NormalizeMax: 1.0f,
BaseRadius: 0.012f,
RadiusScale: 0.030f,
Alpha: 0.92f,
Feather: 0.20f,
RampTexturePath: "",
RampResourceKey: "",
EmissionScale: 10.0f,
CatmullRomSubdivisions: 4).Normalized();
return true;
}
private AquariumFieldSupport SupportForTiming(long uncertaintyNs)
{
var radius = Math.Max(options.DefaultSupportRadius, (float)(Math.Max(0, uncertaintyNs) / 1_000_000_000.0));

View file

@ -155,3 +155,4 @@
{"ts": "2026-05-26T22:52:00+01:00", "type": "implementation", "status": "ok", "note": "Fensalir lifted the DrawIndexed indirect command signature from TubeField to the generated-mesh lane. TubeField still emits its own indirect argument buffer, but future pipeline-private generated mesh lowerings can share the same five-uint D3D12 DrawIndexedArguments ABI with their own producer buffers/material bindings."}
{"ts": "2026-05-26T22:55:00+01:00", "type": "implementation", "status": "ok", "note": "Fensalir TubeField expansion now follows selected backend packet authority. D3D12Renderer expands only TubeSplineLowerings whose claim has a planned TubeField packet; unplanned lowerings are counted in debug status instead of rendered. This prevents explicit lowering metadata from bypassing validation/planning."}
{"ts": "2026-05-26T22:58:00+01:00", "type": "implementation", "status": "ok", "note": "Fensalir validation now rejects TubeSpline lowering metadata if the referenced claim is not Tube-encoded or if the lowering resource differs from the claim payload resource. TubeField split authority is caught at validation, before renderer packet gating. Fensalir build/tests/headless reload passed."}
{"ts": "2026-05-26T23:03:00+01:00", "type": "implementation", "status": "ok", "note": "Mimir's typed Fensalir surface-intent lowering now emits AquariumFieldTubeSplineLowering metadata for audio spectrum/waveform Tube claims. The hardware-free field evidence smoke now proves one resource, three claims, one TubeSpline lowering, one planned TubeField packet, and two deferred non-backend claims; the DSL smoke still proves resource-bound TubeSpline lowering with ramp binding."}

View file

@ -347,7 +347,10 @@ accepted_design:
gated by the selected backend packet plan, so lowering metadata cannot
bypass validation/planning authority. Validation also rejects TubeSpline
lowering metadata if its claim is not Tube-encoded or if its resource does
not match the claim payload.
not match the claim payload. Mimir's typed surface-intent lowering now emits
TubeSpline lowering metadata for audio spectrum/waveform Tube claims, so the
generated mesh path is fed by real Mimir evidence rather than only the DSL
smoke.
- `config/perfect-machine.example.json` declares live owners, sensors,
reservoir views, and runtime policy.
- `src/Mimir.Runtime/Synchronization` now includes the Perfect Machine module