Fensalir/README.md
Meta Vens d755d9c5e0 Remove dead Saga library, obsolete AquaSynth alpha packages, closed scratch note
REC-109 / REC-019 dead-code subtraction pass on Fensalir.

Deleted, all re-verified fresh against origin/main (dc35ecc) and against
every other repo under F:/Projects, not just Fensalir:

- src/Saga/ (SagaOrgan.cs, Saga.csproj, README.md) and its Fensalir.sln
  project entry (GUID 30324495-56BE-4D45-80E8-CE03C24726C8, including its
  ProjectConfigurationPlatforms and NestedProjects lines). `rg -n
  'SagaOrgan|SagaFlowRequest|SagaCoriolisFrame|SagaForcingSource|
  SagaAdvectionSample|SagaCovariance2D' --glob '!src/Saga/SagaOrgan.cs' .`
  found zero consumers inside Fensalir; the same pattern run across the rest
  of F:/Projects (excluding Fensalir and this census doc) found only the
  census's own prose, no other repo referencing these symbols.

- packages/AquaSynth.Core.0.1.0-alpha.2.nupkg,
  packages/AquaSynth.Faust.0.1.0-alpha.2.nupkg,
  packages/AquaSynth.Faust.0.1.0-alpha.3.nupkg. Confirmed
  src/Aquarium.Engine/Aquarium.Engine.csproj:15 references only
  AquaSynth.Faust 0.1.0-alpha.4, whose nuspec pins Core alpha.3 (both kept).
  Verified by building Aquarium.Engine.csproj (with -p:CultLibRoot pointed
  at the sibling CultLib checkout, since the CultMath project reference is
  otherwise only resolvable from Fensalir's normal on-disk location next to
  CultLib) against the trimmed packages/ feed: restore and build succeeded,
  proving alpha.4/alpha.3 satisfy the manifest with the three obsolete
  files gone.

- state/scratch-fractal-surface-visible.md. `rg -n -F
  'scratch-fractal-surface-visible.md' .` found zero references inside
  Fensalir; the one repo-wide hit (gamecult-site's generated
  repo-doc-tree/fensalir.json) is a static catalog listing, not a code or
  build consumer. Content read in full: a closed "Kept/Changed/Still not
  good enough" retrospective note, not an open TODO, with no admission path
  into any durable doc.

Verification: dotnet build succeeded post-deletion for
Aquarium.Engine.Contracts, Aquarium.Engine (exercises the trimmed AquaSynth
package feed and the CultMath sibling reference), Aquarium.Engine.Fractal,
and Aquarium.Engine.Fractal.Tests (which also restores Aquarium.Zyphos and
Aquarium.Fensalir). `dotnet restore Fensalir.sln` itself fails in this
worktree because CultMath is a relative sibling-path reference
(../../../CultLib) that does not exist next to a temp worktree — a
pre-existing property of the manifest, not something this change caused;
per-project builds above cover the touched surfaces instead.

Not touched, out of scope for this pass: the inert render-graph
pass/camera/debug-view surface, Clear() no-ops, GetResource/GetRenderTarget
— all flagged in the same census section but requiring broader review.

Collision check: primary checkout (codex/cultmath-monorepo) has zero diff
against origin/main on every touched path. Executed in worktree
claude/dross-2026-09-13 off origin/main, not the primary checkout.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-13 14:38:54 +02:00

7.6 KiB

Fensalir

Fensalir icon

Fensalir is the native C# runtime and field engine under GameCult's interactive visual clients. It opens the window, owns the D3D12 frame, loads client runtimes behind contracts, keeps hot reload alive, mixes PCM audio, draws debug UI, and houses the reusable machinery for volumetric fields, fractal geometry, temporal evidence, and synth-backed sound.

The repo is not the Epiphany Aquarium client. Epiphany lives in GameCult/Aquarium-Engine and consumes Fensalir as the runtime dependency.

What Runs

The host executable in src/Aquarium.Engine loads a client assembly that implements IAquariumRuntime, then drives this loop:

Win32 input + window
  -> client runtime update
  -> AquariumFrame + AquariumSceneState
  -> D3D12 renderer passes
  -> DirectWrite debug overlay
  -> AquaSynth/WASAPI audio output

Clients declare render targets, cameras, shaders, SDF proxy objects, UI panels, audio buffers, synth patches, and frame state through Aquarium.Engine.Contracts. Fensalir lowers those declarations into native resources: D3D12 pipelines and command lists, shader reloads, presentation, audio playback, debug telemetry, and headless capture.

Spatial Evidence Machine

Fensalir's field work is not just "some fractal helpers." It is a spatio-temporal reservoir system for deciding which field evidence deserves rendering, fusion, and residency under a budget.

The working model is:

authored geometry, live sensors, IFS probes, simulation claims, direct meshes
  -> domain binding
  -> evidence candidates
  -> target evaluation
  -> resampled importance reservoirs
  -> temporal/spatial/domain reuse
  -> stable evidence tracks
  -> backend packets
  -> renderer, fusion, and TAA guide buffers

ResampledImportanceReservoir<TSample> owns the selected candidate, weight sum, candidate count, target value, and contribution weight. The track layer (TemporalSpatialEvidenceReservoir) adds stable keys, confidence smoothing, delay, velocity, expiry, and eviction so a field sample can persist long enough to become useful state instead of one-frame noise.

Every sample declares both layer and encoding. The current layer split is:

  • Form: shape evidence such as SDF, height, displacement, and occupancy.
  • Appearance: material, albedo, emission, feature, and surface claims.
  • Transport: density, extinction, phase, radiance, confidence, fog, smoke, plasma, and other volumetric participation claims.

The same reservoir spine serves fractal rendering and Mimir-style sensor fusion. The renderer-facing TAA guide uses confidence, sample age, domain validity, and invalidation codes so temporal reuse can be explained instead of merely hoped for. CPU reservoirs, fractal probe samples, track state, and validator coverage exist now; full GPU reservoir storage and page residency are the next steel that still needs bolting down.

The reservoir spine is not a vow of poverty against geometry. Adaptive IFS probing and sensor fusion are producer families, not the only lawful entrance into the frame. Direct SDF proxy passes, texture-driven tube fields, volumetric envelopes, and traditional mesh geometry may all contribute when they emit the shared scene packet: color/travel, metadata, control, depth where applicable, and reservoir-guide evidence for temporal validation. Meshes are not heresy; unaccountable geometry is.

Fractal And Volumetric Field DSL

src/Aquarium.Engine.Fractal is the home of the fractal field language. The intent is a semantic volumetric DSL, not a decorative shader toy.

The path is:

client intent, world seed, agent state
  -> .aquageo domain roots
  -> semantic IFS brush grammar
  -> ownership tree
  -> node summaries
  -> contribution cache and residency hints
  -> backend packets
  -> height, SDF, density, extinction, material, and debug passes

.aquageo documents describe domains and claims. IFS brushes contribute coherent field evidence rather than isolated meshes: height ripples, signed distance surfaces, density/extinction volumes, projected fields, and material or feature channels can all be expressed as claims attached to a domain. Node summaries and contribution caches let Fensalir choose what to evaluate, reuse, or evict without pretending the whole fractal world fits in one eager pass.

The Fensalir splash client and Zyphos terrain work are demo clients for this machinery. They exist to force the field DSL to survive real rendering pressure: fractal art reconstruction, planetary domains, field lowering, and debug evidence all share the same contract surface.

AquaSynth Integration

Fensalir also owns the audio lane. AquariumSynthHost consumes client AquariumAudioDocument PCM buffers and AquariumSynthDocument patch state, compiles Faust DSP through AquaSynth, and sends rendered buffers to WASAPI.

The synth path currently includes:

  • per-patch desired/ready/failed compile keys;
  • debounced async Faust compilation from the bundled Synth source directory;
  • cached rendered sound buffers by patch and gain;
  • trigger revision and interval playback;
  • master gain, patch gain, compile status documents, and debug synth support.

Clients say what sound should exist. Fensalir handles patch compilation, buffering, playback, and failure reporting without requiring the client to know how WASAPI or Faust got invited to the party.

Projects

  • src/Aquarium.Engine.Contracts: public client/runtime contracts.
  • src/Aquarium.Engine: Win32 host, D3D12 renderer, reload transport, debug UI, audio/synth host, bundled assets, and renderer-owned shaders.
  • src/Aquarium.Engine.Fractal: .aquageo, IFS/fractal fields, temporal reservoirs, evidence tracks, contribution cache, and lowering machinery.
  • src/Aquarium.Fensalir: Fensalir splash/art reconstruction demo.
  • src/Aquarium.Sample.Minimal: tiny client proving the runtime boundary.
  • src/Aquarium.Zyphos: planetary/fractal terrain demo.
  • tools/Aquarium.Fractal.Receipt: CPU/GPU fractal receipt harness.

The assemblies still use Aquarium.* names for API continuity. That naming is legacy surface, not current repo ownership.

Build

Requirements:

  • Windows
  • .NET SDK matching global.json
  • sibling CultLib repo currently expected at E:\Projects\CultLib; CultMath is consumed from CultLib/packages/cultmath
dotnet build Fensalir.sln

Run

Run the Fensalir splash demo:

.\scripts\dev-reload.ps1 -ClientProject src\Aquarium.Fensalir\Aquarium.Fensalir.csproj

Run headless:

.\scripts\dev-reload.ps1 -Headless -RetainSlots 4 -ClientProject src\Aquarium.Fensalir\Aquarium.Fensalir.csproj

Watch and reload on source changes:

.\scripts\dev-watch.ps1 -ClientProject src\Aquarium.Fensalir\Aquarium.Fensalir.csproj

Run another client by changing -ClientProject.

Research And State

  • docs/: live engine architecture and subsystem notes.
  • research/: rendering/fractal/D3D12 research that informs implementation.
  • state/: persistent project memory for future agents.

Start with:

  • docs/engine-client-boundary.md
  • docs/hlsl-renderer.md
  • docs/perfect-machine-architecture.md
  • docs/temporal-spatial-evidence-reservoir.md
  • research/rendering/fractal-brush-architecture-plan.md
  • research/README.md
  • state/README.md

Boundary

Fensalir owns reusable runtime, renderer, field, reservoir, and synth authority. Client repos own meaning. If a feature requires app-specific policy, role names, story state, or client layout semantics, it belongs outside the engine unless it has been reduced to a reusable data-only contract.