diff --git a/src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl b/src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl index 92b06f4..cb779a2 100644 --- a/src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl +++ b/src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl @@ -462,7 +462,7 @@ ResolveOut D3D12ResolvePS(VertexOut input) } else if (renderDebugMode >= 11.5 && renderDebugMode < 12.5) { - finalColor = float3(currentReservoirConfidence, currentTemporalDetail, combinedHistoryWeight); + finalColor = float3(currentReservoirConfidence, saturate(reservoirSampleAge / MAX_HISTORY_AGE), currentReservoirDomainValidity); } ResolveOut output; output.finalColor = float4(finalColor, 1.0); diff --git a/state/evidence.jsonl b/state/evidence.jsonl index fd874d1..23bd2d8 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -207,3 +207,4 @@ {"timestamp":"2026-05-21T11:45:00+01:00","topic":"residual-to-focus-analyzer","lesson":"Visual parity now produces a tested reservoir-pressure suggestion. FractalHistogramResidualFocus estimates focus XY/radius/strength from positive reference-minus-candidate histogram residuals; matching histograms return zero focus. tools/Aquarium.Fractal.Receipt reports SuggestedPriorityFocus for each visual parity view. A GTX 1070 smoke receipt with 65,536 flame splats and 50k CPU reference samples in -2..2 scored 67.07% and suggested focus 0.544,-0.284,1.824,0.988, proving the diagnostic can emit a concrete next-frame pressure window instead of only a score.","files":["src/Aquarium.Engine.Fractal/Grammar/FractalHistogramResidualFocus.cs","tests/Aquarium.Engine.Fractal.Tests/FractalHistogramResidualFocusTests.cs","tools/Aquarium.Fractal.Receipt/Program.cs","state/map.yaml","state/memory.json"],"source":"continued after adding PriorityFocus so parity residuals could become actionable cache pressure instead of human-only visual diagnosis"} {"timestamp":"2026-05-21T11:55:00+01:00","topic":"adaptive-focus-receipt-loop","lesson":"The receipt harness can now close the first residual feedback loop over the same GPU-resident resources. --adaptive-focus requires warmup and readback, runs the warmup epoch, builds visual parity, applies the first view's suggested priority focus to subsequent measured frames, then reports the adaptive focus in the JSON/console receipt. On the local GTX 1070 mixed flame smoke, the previous non-adaptive setup scored 67.07%; adaptive focus suggested 0.516,-0.302 radius 1.794 strength 1 and measured 70.89% at 0.160 ms/frame. This is not final runtime architecture because it uses a blocking readback between epochs, but it proves feedback improves the cache target before building the delayed/GPU-side path.","files":["tools/Aquarium.Fractal.Receipt/Program.cs","state/map.yaml","state/memory.json"],"source":"continued from residual-to-focus analyzer into a measurable adaptive reservoir control loop"} {"timestamp":"2026-05-21T12:05:00+01:00","topic":"fractal-splat-taa-guide-schema","lesson":"D3D12FractalSplatRender now writes the shared reservoir/TAA guide schema instead of leaking backend layer validation into resolver fields. The guide is x combined reservoir confidence, y sample age in frames from the oldest resident Form/Appearance/Transport row update, z domain validity, w invalidation code. This matches D3D12Post.hlsl expectations and docs/temporal-spatial-evidence-reservoir.md; the previous x/y/z = SDF/PBR/radiosity validation mapping made the resolver interpret PBR validation as sample age and radiosity validation as domain validity.","files":["src/Aquarium.Engine/Render/Shaders/D3D12FractalSplatRender.hlsl","state/map.yaml","state/memory.json"],"source":"continued TAA/reservoir integration after noticing the live guide buffer violated its own documented schema"} +{"timestamp":"2026-05-21T12:10:00+01:00","topic":"reservoir-guide-debug-view","lesson":"Render debug mode 12 now visualizes the reservoir/TAA guide schema directly: red is current reservoir confidence, green is normalized guide sample age, and blue is domain validity. The previous debug view mixed confidence, temporal detail, and history weight, which made the labeled guide mode unable to diagnose guide-buffer bugs.","files":["src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl","state/map.yaml","state/memory.json"],"source":"continued after fixing the fractal guide producer and checking whether the visible debug mode matched the schema"} diff --git a/state/map.yaml b/state/map.yaml index 40cf252..34fa2e6 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -154,6 +154,7 @@ renderer_state: - Fractal reservoir update selection now accepts a four-scalar PriorityFocus window: focus XY, radius, and strength. Under budget, D3D12FractalReservoirCompute samples a few stochastic candidate rows and prefers rows near the focus while preserving random exploration; full-refresh passes still map directly over every row. Zyphos derives the focus from the selected camera/domain target so zoomed domains can pressure reservoir work toward the visible region instead of treating every resident splat as equally urgent. The receipt harness exposes the same pressure through `--priority-focus` for focused GPU tests. - The live GPU splat packet now carries a Form encoding tag in the existing material/confidence lane without changing the 80-byte stride. Flame-mode compute writes Density encoding; the visible fractal splat renderer uses two explicit graphics pipeline states over the same GPU-resident buffers: opaque signed-distance surface splats depth-test/write through D3D12FractalSurfaceSplatPS, while density/extinction splats run through D3D12FractalTransparentSplatPS with depth disabled and additive color-only blending. This is not full volume ray integration, but it makes depth/blend ownership explicit without adding a parallel transparent reservoir or buffer. - Fractal splat render now writes the documented reservoir/TAA guide schema: x = combined reservoir confidence, y = sample age in frames, z = domain validity, w = invalidation code. Form/Appearance/Transport validation stays internal to the splat shader and no longer masquerades as guide-buffer age/validity. + - Render debug mode 12, `Reservoir/TAA Guide`, now displays the same schema it names: red confidence, green normalized sample age, blue domain validity. - The first visual parity receipt compares GPU flame splat XY histograms against the CPU flame oracle. With 250,000 GPU readback splats and 1,000,000 CPU reference samples in 128x128 bounds -8,-8,8,8, the mixed flame fixture scores 84.05% distribution parity at frame 1, 84.10% at frame 5, 84.20% at frame 20, and 84.24% after the 60-frame/10-warmup receipt, with cosine similarity around 0.9955. This is a stable sampler score, not proof of learned convergence; visual-error feedback is still future work. - View-conditioned visual parity now scores named camera windows instead of trusting one global histogram. For the depth-16 flame receipt, global -8..8 scores 97.09%, mid -1..1 scores 91.93%, close -0.5..0.5 scores 88.97%, and micro -0.25..0.25 scores 82.05% with 2,656 starved reference bins and 17.95% underrepresented mass. This is the current hard loss: the reservoir is not yet spending work based on camera-conditioned underrepresentation. - FractalHistogramResidualFocus is the first pure residual-to-priority seam: given reference and candidate histograms, it estimates a focus center/radius/strength from underrepresented probability mass. tools/Aquarium.Fractal.Receipt now reports this suggested focus for each visual parity view, turning parity failure into a concrete reservoir pressure input instead of a contact-sheet shrug. diff --git a/state/memory.json b/state/memory.json index d93d985..e816a14 100644 --- a/state/memory.json +++ b/state/memory.json @@ -113,6 +113,7 @@ "FractalGpuProgramCompiler can lower the proven FLAM3-style flame subset into GPU program rows for D3D12FractalReservoirCompute's explicit flame 2D program mode. Flame mode owns a 32-byte AquariumPackedFractalFlameState UAV row per resident splat; touched rows advance persistent chaos-game state instead of replaying from the origin. The cache has two phases: full-population acquisition, then budgeted stochastic maintenance. On 2026-05-21 the GTX 1070 ran JWildfire FARender selftest.flame with 2,000,000 splats, 2,000,000 flame states, three 2,000,000-row first-slice Form/Appearance/Transport reservoir layers, 8 full acquisition frames, steady 50,000 splat updates/frame, 15,000 reservoir updates/pass/frame, depth 8, at 1.011 ms/frame / 988.8 FPS equivalent, 84.85% CPU-slice distribution parity, checksum 0xC633FADC3BD7E5BE. Without acquisition, the same steady budget scored only 32.64%; do not confuse a cold persistent cache with a bad sampler.", "The live GPU splat packet carries a Form encoding tag in an existing material/confidence lane so flame-mode compute can mark splats as Density without changing the 80-byte hot stride. D3D12FractalSplatRender now compiles separate surface and transparent graphics pipeline states over the same GPU-resident buffers: signed-distance surface claims depth-test/write as opaque geometry, while density/extinction claims use a depth-disabled additive color-only pass. This is a field-aware debug/consumption path, not full volume ray integration; do not add a second transparent reservoir or buffer unless a measured resolve need beats the shared packet invariant.", "Fractal splat reservoir guide output must obey the shared TAA guide schema: x confidence, y sample age, z domain validity, w invalidation code. Do not pack Form/Appearance/Transport validation into guide x/y/z; those are backend layer diagnostics, not resolver semantics.", + "Render debug mode 12 is the Reservoir/TAA Guide view and should display guide semantics directly: confidence, normalized sample age, and domain validity.", "The first visual parity metric compares GPU flame splat XY histograms against the local CPU flame oracle. With 250,000 GPU readback splats, 1,000,000 CPU reference samples, 128x128 bounds -8,-8,8,8, and the mixed FLAM3-style fixture, distribution score is 84.05% at frame 1, 84.10% at frame 5, 84.20% at frame 20, and 84.24% after the 60-frame/10-warmup receipt; cosine similarity stays about 0.9955. This is high distribution similarity but not learned convergence: the current reservoir path initializes splats and stochastically replaces them, without visual-error feedback or ReSTIR/MIS target correction yet.", "Global flame parity is not enough. View-conditioned parity now scores named viewport bounds and reports GPU/reference hits, starved reference bins, and underrepresented mass. First depth-16 GTX 1070 receipt with 250k GPU readback splats vs 1M CPU samples: global -8..8 scores 97.09%, mid -1..1 scores 91.93%, close -0.5..0.5 scores 88.97%, micro -0.25..0.25 scores 82.05% with 2,656 starved bins and 17.95% underrepresented mass. This proves the current reservoir is fast but not view-adaptive; next work needs camera-conditioned target weights and underrepresented-region feedback.", "FractalHistogramResidualFocus converts visual parity residuals into a tested focus window: underrepresented reference mass determines center, radius, and strength. tools/Aquarium.Fractal.Receipt prints the suggested focus per visual parity view so a bad contact sheet now yields a concrete reservoir-pressure input for the next adaptive loop.",