Document temporal reservoir ownership

This commit is contained in:
Meta Vens 2026-05-19 14:12:50 +01:00
commit 439aa3887a
4 changed files with 101 additions and 0 deletions

View file

@ -0,0 +1,96 @@
# Temporal Spatial Evidence Reservoir
## Objective
Aquarium owns resolved temporal spatial evidence. Producers may capture raw
camera frames, audio blocks, point claims, SDF probes, or calibration events, but
the shared stable-key history, delayed presentation, smoothing, confidence
weighting, expiry, and backend lowering belong to the Aquarium reservoir stack.
This serves both current customers:
- fractal rendering: SDF probes and selected-cut packets need bounded,
confidence-weighted detail that converges while the camera moves;
- Mimir/LocalCast sensor fusion: cameras and microphones need a delayed
coherence window before the resolved field is rendered.
## Pipeline
```text
raw producer samples
-> typed producer adapter
-> TemporalSpatialEvidenceObservation
-> TemporalSpatialEvidenceReservoir
-> TemporalSpatialEvidenceSample snapshot
-> TemporalSpatialEvidenceLowering
-> backend packet stream
-> D3D12 render/fusion/TAA
```
## Ownership
Raw sample reservoirs own capture-time retention only. LocalCastBridge's native
rolling reservoir is allowed to keep time-ordered camera/audio/sample handles,
typed views, latest-for-sensor lookup, and provenance filtering. It must not own
resolved spatial confidence, smoothed motion, render packet lowering, or TAA
history.
`TemporalSpatialEvidenceReservoir` owns stable spatial tracks:
- stable key identity;
- accumulation window and presentation delay;
- confidence-weighted smoothing;
- velocity prediction;
- history weight from confidence and sample age;
- expiry;
- max-track eviction by confidence and age.
`TemporalSpatialEvidenceLowering` owns packet conversions. Current lowerings:
- `TemporalGaussianObservation` -> evidence observation;
- evidence sample -> `AquariumTemporalSdfGaussian`;
- `AquariumGpuFusionSeed` -> evidence observation;
- evidence sample -> `AquariumGpuFusionSeed`.
Adapters own domain-specific interpretation before the reservoir. For example,
LocalCast may decide how a visual point maps to radii, color, falloff, and
shape power, but it then hands the result to the shared lowering path.
Renderer passes own backend packet layout and GPU execution. TAA owns pixel
history validation, not producer identity or stable-key accumulation.
## Invariants
- Stable-key spatial history has one owner: `TemporalSpatialEvidenceReservoir`.
- Consumers do not privately implement track dictionaries, smoothing, expiry, or
max-count eviction for resolved spatial evidence.
- Payload vectors are not ad hoc folklore. If a backend needs packed payload
fields, add or use a named lowering helper.
- Raw retention and resolved evidence are separate layers. Do not collapse
LocalCastBridge's raw rolling reservoir into Aquarium's resolved evidence
reservoir.
- Conservative bounds remain safety authority. Learned scoring or stochastic
sampling may prioritize work, but it must not replace bounds used for render
correctness.
## Current Consumers
`TemporalGaussianAccumulator` is a compatibility facade. It maps Gaussian
observations through `TemporalSpatialEvidenceLowering`, stores them in the
shared reservoir, and lowers snapshots back to `AquariumTemporalSdfGaussian`.
`LocalCastGpuFusionAccumulator` is also a facade. It maps LocalCast fallback
GPU fusion seeds into shared evidence observations and lowers snapshots back to
`AquariumGpuFusionSeed`.
`FractalContributionCache` is adjacent, not yet unified: it owns selected-cut
contribution estimates for authored fractal nodes. Future SDF probe evidence
should enter the shared reservoir when probe results become spatial samples;
node-summary scoring remains a separate LOD planning authority.
## Cut Line
Do not build a second temporal spatial evidence cache in a client repo. If a
consumer needs different sample semantics, add a producer adapter and a named
lowering helper. If it needs different retention semantics, extend the shared
reservoir only after stating the invariant the new behavior protects.

View file

@ -155,3 +155,4 @@
{"timestamp":"2026-05-19T14:43:00+01:00","topic":"fractal-contribution-cache-live-loop","lesson":"Fractal contribution planning now has a live cache loop. `FractalContributionCache` builds a resource plan from current summaries and cached states, stochastically observes only budgeted update nodes, updates estimator confidence, and lets Zyphos reuse compiled brush packets by selected-cut key instead of freezing the whole render plan by camera bucket. Static plan caches are not acceptable for stochastic LOD because they stop learning.","files":["src/Aquarium.Engine.Fractal/Lod/FractalContributionCache.cs","src/Aquarium.Zyphos/ZyphosFractalTerrain.cs","tests/Aquarium.Engine.Fractal.Tests/FractalContributionCacheTests.cs"],"source":"follow-up after resource observability revealed the old bucket plan cache prevented continual cache updates"}
{"timestamp":"2026-05-19T15:12:00+01:00","topic":"localcast-shared-temporal-reservoir","lesson":"LocalCast fallback GPU fusion history now delegates to `TemporalSpatialEvidenceReservoir`. `LocalCastGpuFusionAccumulator` maps LocalCast GPU fusion seeds into shared evidence observations and lowers reservoir samples back into `AquariumGpuFusionSeed`; it no longer owns separate stable-key history, smoothing, expiry, or max-count logic. This is the first consumer-side takeover of duplicated temporal reservoir code.","files":["src/Aquarium.LocalCast/LocalCastGpuFusionAccumulator.cs","src/Aquarium.Engine.Fractal/Temporal/TemporalSpatialEvidenceReservoir.cs","docs/temporal-sdf-gaussian-field.md"],"source":"user made Aquarium responsible for resolving temporal reservoir sampling architecturally and taking over consumer half-versions"}
{"timestamp":"2026-05-19T15:29:00+01:00","topic":"temporal-evidence-lowering-boundary","lesson":"Shared temporal evidence now has named lowering helpers. `TemporalSpatialEvidenceLowering` converts Gaussian observations and GPU fusion seeds to/from reservoir samples, so consumer adapters do not privately pack Payload0/Payload1 conventions. Keep new reservoir consumers on this lowering seam unless they need a genuinely new payload contract.","files":["src/Aquarium.Engine.Fractal/Temporal/TemporalSpatialEvidenceLowering.cs","src/Aquarium.Engine.Fractal/Temporal/TemporalGaussianAccumulator.cs","src/Aquarium.LocalCast/LocalCastGpuFusionAccumulator.cs","tests/Aquarium.Engine.Fractal.Tests/TemporalSpatialEvidenceLoweringTests.cs"],"source":"follow-up after moving LocalCast history onto the shared reservoir; adapter payload packing needed to become a tested engine boundary"}
{"timestamp":"2026-05-19T15:46:00+01:00","topic":"temporal-reservoir-ownership-contract","lesson":"The temporal spatial evidence reservoir now has an explicit architecture contract. Raw sample reservoirs keep capture-time handles and ordering; Aquarium's `TemporalSpatialEvidenceReservoir` owns stable resolved spatial history; `TemporalSpatialEvidenceLowering` owns backend packet conversion; TAA owns pixel history. This prevents consumer repos from growing parallel half-reservoirs while preserving LocalCastBridge's lower-level raw rolling reservoir authority.","files":["docs/temporal-spatial-evidence-reservoir.md","state/map.yaml","state/memory.json"],"source":"user made Aquarium responsible for resolving temporal reservoir sampling architecturally across consumer repos"}

View file

@ -68,6 +68,7 @@ current_model:
native_spine: docs/vortice-spine.md
tsr_inspired_taa_spec: docs/tsr-inspired-taa-spec.md
temporal_sdf_gaussian_field: docs/temporal-sdf-gaussian-field.md
temporal_spatial_evidence_reservoir: docs/temporal-spatial-evidence-reservoir.md
input: docs/input.md
zyphos_eusocial_sync: docs/zyphos-eusocial-sync.md
hdr_pbr_presentation: research/rendering/hdr-pbr-presentation.md
@ -113,6 +114,7 @@ renderer_state:
- Aquarium owns the temporal SDF Gaussian field renderer boundary: clients can publish `AquariumTemporalGaussianField`, `TemporalGaussianAccumulator` can buffer stable keyed observations in world space, and D3D12 lowers those packets into an instanced compact-kernel splat pass that writes normal scene color/travel/metadata/control targets.
- Temporal Gaussian accumulation now lowers through `TemporalSpatialEvidenceReservoir`, a renderer-agnostic stable-key reservoir for confidence-weighted spatial samples with presentation delay, smoothing, velocity prediction, expiry, and max-track eviction. Gaussian splats are one lowering; fractal SDF probe evidence and Mimir sensor-fusion features should use the same reservoir shape when they need delayed coherence solving.
- LocalCast fallback GPU fusion history delegates to `TemporalSpatialEvidenceReservoir`. `LocalCastGpuFusionAccumulator` is now an adapter that maps LocalCast stable seeds into shared evidence observations and back into GPU fusion seeds; it does not own a parallel temporal sampling algorithm.
- The temporal reservoir ownership contract lives in docs/temporal-spatial-evidence-reservoir.md. Raw producer reservoirs own capture-time retention; Aquarium's temporal spatial evidence reservoir owns stable resolved spatial history; lowerings own backend packet conversion; TAA owns pixel history validation.
- Isolated Epiphany agent preview renders run through the real D3D12 renderer from src/Aquarium.Epiphany.AgentPreview; preview isolation is owned by a preview-only scene shader, while the engine exposes only final-frame PNG capture.
- Zyphos is the first nontrivial non-Epiphany client: a planetary-scale demo with spherical-domain terrain, atmospheric rim lighting, night-side glints, fixed-sky Umbros, and first-pass eclipse cadence.
- Zyphos/Umbros render-scale binary constants live in src/Aquarium.Zyphos/ZyphosUmbrosSystem.cs: Umbros is modeled as a 0.9-radius mutually tidally locked twin at 8 Zyphos radii, while the dim primary star phase moves through the Zyphos-local frame.
@ -165,6 +167,7 @@ next_actions:
- Follow docs/zyphos-eusocial-sync.md and E:\Projects\Eusocial Interbeing\Eusocial Interbeing\World\Zyphos Simulation Brief.md before turning Zyphos visual choices into setting claims.
- Follow docs/tsr-inspired-taa-spec.md when changing current temporal diagnostics.
- Use docs/temporal-sdf-gaussian-field.md before wiring LocalCastBridge visual sensor fusion into Aquarium or scaling the temporal Gaussian renderer beyond the current bounded instanced pass.
- Use docs/temporal-spatial-evidence-reservoir.md before adding any stable-key temporal spatial cache, sensor-fusion accumulator, SDF probe reservoir, or new evidence packet lowering.
- Promote future runtime knobs into typed CultCache documents before they become process folklore.
- Next Face voice slice: replace text-only input with microphone/WebRTC or a native capture bridge, bind endpoint anchors to real Face/body spatial projections instead of manual XY rows, then move the transport contract from Codex JSON-RPC compatibility toward a typed CultNet FaceVoiceSession once Epiphany advertises that surface.
- Keep Aquarium and Epiphany in one repo until the contracts and graph API are stable enough for Epiphany to move out without carrying engine policy or reload folklore with it.

View file

@ -83,6 +83,7 @@
"Temporal Gaussian splats lower through TemporalSpatialEvidenceReservoir: stable keyed observations become delayed, smoothed, confidence-weighted tracks with velocity prediction, expiry, and max-track eviction before backend packet lowering. Treat Gaussian fields, fractal SDF probes, and Mimir sensor-fusion features as different evidence producers for this reservoir shape, not separate accumulator folklore.",
"LocalCastGpuFusionAccumulator must remain a thin adapter over TemporalSpatialEvidenceReservoir. LocalCast may own mapping from visual points/seeds into evidence payloads, but it must not grow a second stable-key history, smoothing, expiry, or sample-budget algorithm.",
"TemporalSpatialEvidenceLowering owns conversion between shared evidence samples and backend packets such as TemporalGaussianObservation, AquariumTemporalSdfGaussian, and AquariumGpuFusionSeed. Consumers should not pack Payload0/Payload1 by private convention when a lowering helper exists.",
"The temporal reservoir ownership contract lives in docs/temporal-spatial-evidence-reservoir.md: raw producer reservoirs own capture-time retention; Aquarium's TemporalSpatialEvidenceReservoir owns stable resolved spatial history; lowerings own backend packet conversion; TAA owns pixel history validation. Do not let consumer repos build parallel stable-key spatial evidence caches.",
"Zyphos fractal stress data should keep authored topology richer than the first renderer backend: both Zyphos and Umbros expose lat/long, surface, object-scale, and cube-tile domains in `.aquageo`, with explicit continent/forest/tree/leaf/coast/pebble and crater/boulder/pebble recursion. The current D3D12 height-field stress table uploads 64 shaped 2D brushes and the SDF planet shaders carry separate cheap bounded quadtree-style relief.",
"The `.aquageo` compiler must preserve each tile declaration as its own ownership-tree node. Collapsing every claim under the final tile makes the authored multi-domain world a lie even if the brush count looks impressive.",
"Zyphos passes cube-tile domain metadata through height brush packets and binds those packets into the SDF pass. The planet shader may use authored brush packets for post-hit material/detail evaluation; traced geometry must wait for selected-cut/resident packet policy so SDF distance loops do not evaluate every brush at every step.",