Document Eve Direct2D client surface

This commit is contained in:
Meta Vens 2026-05-31 03:22:38 +01:00
commit 9ae61eb5a6
5 changed files with 72 additions and 0 deletions

View file

@ -33,6 +33,11 @@ audio buffers, synth patches, and frame state through
resources: D3D12 pipelines and command lists, shader reloads, presentation,
audio playback, debug telemetry, and headless capture.
Fensalir's DirectWrite/Direct2D overlay is also an Eve client surface. It should
consume the shared Eve/CultMesh UI document contract and lower it into
`AquariumUiDocument`, while provider repos keep ownership of dashboard state and
commands. See `docs/eve-direct2d-client-surface.md`.
## Spatial Evidence Machine
Fensalir's field work is not just "some fractal helpers." It is a

View file

@ -44,6 +44,9 @@ and UI as living objects.
- Debug overlay is allowed, but it is explicit chrome.
- Overlay text uses DirectWrite and stays out of the HDR scene unless a feature
intentionally projects it into the world.
- The DirectWrite/Direct2D overlay is a valid Eve client surface when it
renders shared CultMesh UI documents through `AquariumUiDocument`. It does not
own provider state or dashboard semantics.
- Diegetic labels and menus should anchor to world objects and unfold locally.
- Object-owned controls beat global panels.
- Crisp text, focus, keyboard input, and accessibility are real requirements,

View file

@ -0,0 +1,59 @@
# Eve Direct2D Client Surface
Fensalir's DirectWrite/Direct2D overlay is an Eve client surface.
That means it should consume the same CultMesh UI surface documents as the
browser, iOS, Android, and Flutter clients. It should not become a second
dashboard language or an app-specific policy owner. The provider still owns
state and side effects; Fensalir owns the native desktop/runtime lowering.
## Authority Map
- Owner: provider repos own surface state, accepted commands, and meaning.
- Input document: the shared Eve/CultMesh surface contract owns panels, nodes,
assets, commands, selection, and state paths.
- Lowering: Fensalir translates the surface document into `AquariumUiDocument`
panels and controls.
- Renderer: `DirectWriteOverlay` draws the resulting panels through the
D3D11-on-12 Direct2D bridge after the D3D12 scene.
- Output: Fensalir emits user commands back through the same Eve/CultNet command
path as browser and mobile clients.
## Current Landing Zone
The existing engine contract already has the right narrow surface:
- `AquariumUiDocument`
- `AquariumUiPanel`
- `AquariumUiControl`
- `D3D12Renderer.UpdateUi`
- `DirectWriteOverlay`
The first implementation should add an adapter from the shared Eve surface
document into `AquariumUiDocument`. Do not bypass that path by teaching the
renderer about VoidBot, Mimir, or any provider-specific dashboard. Provider
specificity belongs in the provider document.
## Invariants
- Browser Eve remains the behavior and layout reference.
- Direct2D is a renderer for the shared contract, not the contract owner.
- Fensalir may own native text metrics, focus, keyboard, pointer dispatch,
opacity, panel positioning, and GPU/CPU timing telemetry.
- Fensalir must not own app-specific command semantics.
- Images and media assets need explicit asset handles/cache keys before they are
renderer inputs.
- High-frequency sensor data stays in the timestamped sensor path, not in UI
panel state.
## First Cut
1. Define the shared Eve surface DTO in a neutral contract package or mirror the
first schema in Fensalir as an adapter boundary.
2. Map simple nodes into `AquariumUiPanel` and existing controls:
readouts, buttons, toggles, sliders, options, text boxes, tree items, and
detail panes.
3. Route control activation back to a provider command sink.
4. Add a replay smoke using a recorded VoidBot/Mimir surface fixture.
5. Compare the Direct2D rendering against the browser reference fixture before
adding provider-specific polish.

View file

@ -306,6 +306,7 @@
{"timestamp":"2026-05-30T01:58:00+01:00","topic":"reservoir-spatial-reuse-budget","lesson":"The renderer now has a first runtime sampling budget inside the reservoir history update owner. GraphicsSettings.FieldReservoirSpatialReuseBudget flows through UI, runtime options, CLI/env overrides, capture scripts, frame constants, and D3D12ReservoirHistoryUpdateCS. Current and temporal rows are still written for every reservoir work-grid pixel; only the 3x3 spatial neighbor reuse pass is spent on the deterministic budget phase. The default is 0.5, so the machine combines half presentation grid reservoir surfaces with half spatial reuse sampling by default. Smoke reservoir-sequence-20260530-003006-* compared native scale 0.5/spatial budget 0.5 against reference scale 0.75/spatial budget 1.0; masked reference-error-native covered 3.8261% of frame pixels, and reservoir-budget-pressure-20260530-003006.* found the top 5/50 tiles carried 90.8321% of measured reference-error delta.","files":["src/Aquarium.Engine.Contracts/GraphicsSettings.cs","src/Aquarium.Engine/AquariumHost.cs","src/Aquarium.Engine/Render/D3D12Renderer.cs","src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl","scripts/capture-fensalir-frame.ps1","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-003006-*"}
{"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-30T22:02:00+01:00","topic":"d3d12-resize-reference-release","lesson":"The Fensalir resize crash was a hidden-reference ownership bug in the swapchain path. Resize disposed DirectWrite overlays and D3D11-on-12 wrapped backbuffers, but the D3D11 immediate context could still retain references unless it was explicitly cleared and flushed before IDXGISwapChain::ResizeBuffers. Resize now clears/flushes the overlay context and drops program-output shared textures before recreating size-dependent surfaces. A visible dev slot survived seven programmatic window resizes and logged target rebuilds without stderr.","files":["src/Aquarium.Engine/Render/D3D12Renderer.cs","tests/Aquarium.Engine.Tests/D3D12ResizeTests.cs","state/scratch.md","state/map.yaml"],"source":"artifacts/dev-reload/latest.out.log"}
{"timestamp":"2026-05-31T02:58:00+01:00","topic":"eve-direct2d-client-surface","lesson":"Fensalir's DirectWrite/Direct2D overlay is a first-class Eve client surface. It should consume shared Eve/CultMesh UI documents and lower them into AquariumUiDocument, while provider repos keep ownership of dashboard state, accepted commands, and app-specific semantics.","files":["docs/eve-direct2d-client-surface.md","README.md","docs/aquarium-engine-doctrine.md","state/map.yaml"],"source":"Eve cross-client surface cut"}
{"timestamp":"2026-05-30T22:24:00+01:00","topic":"reservoir-reconstruction-loss-curve","lesson":"Reservoir superresolution quality now has a curve metric instead of only smoke deltas. measure-reservoir-loss-curve.ps1 reads candidate/reference sequence manifests and reports MAE, MSE, RMSE, PSNR, changed pixels, max channel delta, and optional disocclusion/rejection-masked loss. The 320x180 smoke sweep reservoir-sequence-20260530-221043-* compared native scale 0.5/spatial budget 0.5 against reference scale 0.75/spatial budget 1.0 at ready frames 1,2,4,8. Whole-frame PSNR was 21.668, 20.981, 20.911, and 21.690 dB; the non-monotonic curve means current sampling/reconstruction is not yet converging cleanly against the higher-budget reference. Performance still needs GPU timestamp queries; capture wall time is process-level and not a pass cost metric.","files":["scripts/measure-reservoir-loss-curve.ps1","scripts/capture-reservoir-mode-sequence.ps1","state/scratch.md","state/map.yaml"],"source":"artifacts/fensalir-captures/reservoir-loss-curve-20260530-221043.csv"}
{"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"}

View file

@ -127,6 +127,10 @@ invariants:
resource in `Common` so OBS/EVE/native consumers can transition it for
GPU-side reads without inheriting Fensalir's internal copy-destination
state.
- Fensalir's DirectWrite/Direct2D overlay is an Eve client surface for shared
CultMesh UI documents. The adapter should lower those documents into
`AquariumUiDocument` and route commands back through Eve/CultNet; provider
repos still own dashboard state, accepted commands, and meaning.
- Planetary ocean/atmosphere flow is an engine field organ when reduced to
reusable stochastic advection machinery. Fensalir owns cube-sphere flow
addressing, dataset provenance, model contracts, stochastic advection