Report stereo depth dispatch readiness

This commit is contained in:
Meta Vens 2026-05-30 00:44:04 +01:00
commit 9e0709ef23
4 changed files with 72 additions and 2 deletions

View file

@ -390,7 +390,10 @@ Add contributors in this order:
depth dispatch metadata is now typed as `AquariumFieldStereoDepthLowering`:
it must bind the Height claim to shader-readable left/right texture
resources, a calibrated camera pair/profile, and a compute-writable disparity
`SurfacePage`.
`SurfacePage`. The D3D12 renderer now accounts for dispatch-ready stereo
lowerings only when the planned Height claim and all three resolved resources
are present; it reports that readiness separately from the not-yet-installed
SGM kernel.
Exit gate:

View file

@ -309,6 +309,9 @@ public sealed class D3D12Renderer : IAquariumRenderer
private int activeTubeFieldSkippedDrawBatches;
private int activeTubeFieldUnplannedLowerings;
private int activeTubeFieldInvalidColumns;
private int activeStereoDepthDispatchReadyLowerings;
private int activeStereoDepthUnplannedLowerings;
private int activeStereoDepthUnresolvedLowerings;
private int activeFieldResourceUploadCount;
private int activeFieldResourceUploadSkippedCount;
private Viewport viewport;
@ -3352,6 +3355,54 @@ public sealed class D3D12Renderer : IAquariumRenderer
return planned;
}
private void EvaluateStereoDepthLowerings()
{
activeStereoDepthDispatchReadyLowerings = 0;
activeStereoDepthUnplannedLowerings = 0;
activeStereoDepthUnresolvedLowerings = 0;
if (activeFieldEvidenceFrame.StereoDepthLowerings.Count == 0)
{
return;
}
var plannedClaims = PlannedStereoDepthClaimKeys();
foreach (var lowering in activeFieldEvidenceFrame.StereoDepthLowerings)
{
if (!plannedClaims.Contains(lowering.ClaimKey))
{
activeStereoDepthUnplannedLowerings++;
continue;
}
if (!lowering.IsValid ||
!fieldResourceRegistry.TryGetTexture2D(lowering.LeftResourceKey, out _) ||
!fieldResourceRegistry.TryGetTexture2D(lowering.RightResourceKey, out _) ||
!fieldResourceRegistry.TryGetSurfacePage(lowering.DisparityResourceKey, out var disparity) ||
!disparity.AllowsUnorderedAccess)
{
activeStereoDepthUnresolvedLowerings++;
continue;
}
activeStereoDepthDispatchReadyLowerings++;
}
}
private HashSet<string> PlannedStereoDepthClaimKeys()
{
var planned = new HashSet<string>(StringComparer.Ordinal);
foreach (var packet in activeFieldLoweringPlan.Packets)
{
if (packet.Backend == AquariumFieldBackendKind.SurfacePage &&
packet.Encoding == AquariumFieldEncoding.Height)
{
planned.Add(packet.ClaimKey);
}
}
return planned;
}
private void UploadFieldResourceData(ID3D12GraphicsCommandList activeCommandList, FrameResources frameResources)
{
foreach (var upload in activeFieldEvidenceFrame.ResourceUploads)
@ -3520,6 +3571,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
activeFieldLoweringPlan = activeFieldEvidenceValidation.HasErrors
? AquariumFieldLoweringPlan.Empty
: AquariumFieldLoweringPlanner.Plan(activeFieldEvidenceFrame);
EvaluateStereoDepthLowerings();
activeFractalProgramTransforms = activeFractalReservoirField.HasInput && scene.FractalReservoirField.ProgramTransforms.Count > 0
? scene.FractalReservoirField.ProgramTransforms as AquariumPackedFractalIfsTransform[] ?? scene.FractalReservoirField.ProgramTransforms.ToArray()
: [];
@ -4074,6 +4126,16 @@ public sealed class D3D12Renderer : IAquariumRenderer
$"segment budget {MaxTubeFieldSegments:N0}");
}
if (activeFieldEvidenceFrame.StereoDepthLowerings.Count > 0)
{
Console.WriteLine(
$"D3D12 stereo depth: lowerings {activeFieldEvidenceFrame.StereoDepthLowerings.Count:N0}; " +
$"dispatch-ready {activeStereoDepthDispatchReadyLowerings:N0}; " +
$"unplanned {activeStereoDepthUnplannedLowerings:N0}; " +
$"unresolved {activeStereoDepthUnresolvedLowerings:N0}; " +
"kernel not installed");
}
if (accumulatedTimingFrames > 0)
{
var scale = 1.0 / accumulatedTimingFrames;

View file

@ -307,3 +307,4 @@
{"timestamp":"2026-05-30T02:10:00+01:00","topic":"reservoir-spatial-budget-debug","lesson":"The spatial reuse sampling budget now has a visible owner-layer probe. Render debug mode 20, Reservoir Spatial Budget, colors work-grid pixels that spend 3x3 spatial reuse green and skipped pixels blue; capture-reservoir-mode-sequence.ps1 names the mode spatial-budget. Smoke reservoir-sequence-20260530-003746-* captured the debug view at native scale 0.5/spatial budget 0.5. A bitmap probe on the 304x141 present output counted 32078 green pixels, 6818 blue pixels, and 3968 filtering/other pixels, proving the budget branch is observable where the user sees it.","files":["src/Aquarium.Engine.Contracts/GraphicsSettings.cs","src/Aquarium.Engine/Render/D3D12Renderer.cs","src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl","scripts/capture-reservoir-mode-sequence.ps1","tests/Aquarium.Engine.Tests/FieldReservoirAbiTests.cs","docs/perfect-fensalir-machine-roadmap.md","state/map.yaml","state/scratch.md"],"source":"artifacts/fensalir-captures/reservoir-sequence-20260530-003746-*"}
{"timestamp":"2026-05-30T00:29:26+01:00","topic":"surfacepage-uav-depth-socket","lesson":"SurfacePage resources can now be GPU-resident unordered-access outputs as well as shader-readable pages. D3D12FieldTexture2D tracks UAV capability, creates UAV descriptors, and D3D12FieldResourceRegistry resolves UnorderedAccess SurfacePages while reusing empty pages across version changes when shape/format/access are unchanged. This gives Mimir stereo-depth/height outputs a real compute-writable resource socket without private output textures or CPU readback.","files":["src/Aquarium.Engine/Render/D3D12FieldTexture2D.cs","src/Aquarium.Engine/Render/D3D12FieldResourceRegistry.cs","tests/Aquarium.Engine.Tests/D3D12SharedTextureInteropTests.cs","docs/perfect-fensalir-machine-roadmap.md","state/map.yaml"],"source":"dotnet test tests/Aquarium.Engine.Tests/Aquarium.Engine.Tests.csproj --filter RegistryResolvesUnorderedAccessSurfacePageForComputeDepthOutput"}
{"timestamp":"2026-05-30T00:37:29+01:00","topic":"stereo-depth-lowering-contract","lesson":"FieldEvidence now carries typed stereo-depth lowering metadata for future D3D12 SGM dispatch. AquariumFieldStereoDepthLowering binds a Height claim to shader-readable left/right texture resources, profile/calibration/camera-pair identity, depth range/disparity settings, and a compute-writable UAV disparity SurfacePage. Validation rejects claim encoding mismatches, payload/resource mismatches, non-UAV disparity outputs, and missing/non-readable inputs. This keeps Mimir libSGM-provenance depth inside Fensalir resource authority rather than a private texture, CPU readback, CUDA, or TensorRT path.","files":["src/Aquarium.Engine.Contracts/Render/AquariumFieldEvidence.cs","tests/Aquarium.Engine.Tests/FieldEvidenceContractTests.cs","docs/perfect-fensalir-machine-roadmap.md","state/map.yaml"],"source":"dotnet test tests/Aquarium.Engine.Tests/Aquarium.Engine.Tests.csproj --filter StereoDepth"}
{"timestamp":"2026-05-30T00:43:53+01:00","topic":"stereo-depth-dispatch-readiness","lesson":"D3D12Renderer now evaluates stereo-depth lowerings for dispatch readiness without installing a fake depth kernel. A lowering is counted ready only when the SurfacePage Height claim is planned, left/right input Texture2D resources resolve through the field resource registry, and the disparity SurfacePage resolves with UAV capability. Capacity logs report ready/unplanned/unresolved counts and explicitly say the kernel is not installed.","files":["src/Aquarium.Engine/Render/D3D12Renderer.cs","docs/perfect-fensalir-machine-roadmap.md","state/map.yaml"],"source":"dotnet build src/Aquarium.Engine/Aquarium.Engine.csproj --no-restore"}

View file

@ -256,7 +256,11 @@ next_actions:
Texture2D or RollingTexture resources, profile/calibration/camera-pair
identity, and coherent output shape/range. This keeps Mimir's libSGM-shaped
D3D12 depth path inside typed field/resource authority instead of a private
texture or CUDA/TensorRT dependency. VolumeTexture
texture or CUDA/TensorRT dependency. The D3D12 renderer now evaluates
stereo-depth dispatch readiness without writing fake depth: a lowering is
ready only when its Height claim is planned and left/right input textures
plus UAV disparity SurfacePage resolve through the field resource registry;
capacity logs still state that the kernel is not installed. VolumeTexture
resources now have the same
first resolver shape: contracts and DSL can declare GPU-resident 3D
textures with dimensions, depth, format, and version, and the D3D12 registry