Record GPU-resident Fensalir buffer invariant

This commit is contained in:
Meta Vens 2026-05-26 18:51:47 +01:00
commit 0a72126bbb
5 changed files with 44 additions and 26 deletions

View file

@ -184,10 +184,12 @@ Mimir may mint stable resource keys from native/GPU handles, but Fensalir owns
resolution. A DSL packet may reference `mimir:resource:*`; it may not treat a
bare string as payload truth. In the same runtime, a Mimir-declared buffer is a
Fensalir resource slot once the declaration is accepted; native/shared handle
metadata is an import edge, not a separate payload authority. If the resource
contract is absent, expired, duplicated, CPU-only, or incompatible with the
selected backend, lowering must defer instead of rendering a lie with nice
lighting.
metadata is an import edge, not a separate payload authority. Rendering-relevant
buffers move to GPU residency as early as possible and stay there; Fensalir
passes resource handles/SRVs/UAVs between compute and render lowerings instead
of copying samples back to CPU. If the resource contract is absent, expired,
duplicated, CPU-only, or incompatible with the selected backend, lowering must
defer instead of rendering a lie with nice lighting.
Current proof surface:
@ -200,10 +202,13 @@ Current proof surface:
`TubeField` packet with no deferred requests.
Fensalir now owns the first D3D12 resource resolver cut below this contract:
declared structured/curve buffers allocate, reuse, and retire engine-owned GPU
slots under their resource keys. Current blocker for visible rendering is
shader binding: selected `TubeField` packets must consume those resolved slots
through a concrete lowering. Texture, mesh, surface-page, and volume resolvers
shared structured/curve buffers import/alias GPU-resident resources by handle,
while Fensalir-created resources allocate GPU slots only when Fensalir is the
producer. The DSL can describe a 2D rolling float buffer as Catmull-Rom XY
tubes with modulo column addressing, amplitude power/normalization, radius,
ramp texture path, and emission scale. Current blocker for visible rendering is
shader binding/expansion: selected `TubeField` packets must consume those
resolved GPU slots directly. Texture, mesh, surface-page, and volume resolvers
remain explicit future engine cuts. That is engine ownership, not a reason for
Mimir to create a parallel renderer.

View file

@ -161,11 +161,15 @@ a named invariant that the native runtime cannot protect yet.
evidence compiler can bind a declared resource and produce one planned
`TubeField` packet with no deferred requests.
- Fensalir now owns the first in-process D3D12 field resource resolver cut:
declared structured/curve buffer resources allocate, reuse, and retire
engine-owned GPU slots under the resource key. Mimir-declared buffers are
Fensalir buffers in the same runtime. Visible rendering still needs the
TubeField shader binding that consumes those resolved slots; texture,
mesh, surface-page, and volume resource kinds remain future engine cuts.
shared structured/curve buffer resources import/alias GPU-resident handles,
and Fensalir-owned resources allocate GPU slots only when Fensalir is the
producer. Mimir-declared rendering buffers are Fensalir GPU resources in the
same runtime and should not round-trip through CPU payloads. The TubeField DSL
can now describe a 2D rolling float buffer as Catmull-Rom XY tubes with
modulo column addressing, amplitude power/normalization, radius, ramp texture
path, and emission scale. Visible rendering still needs shader-side expansion
and binding over those GPU-resident slots; texture, mesh, surface-page, and
volume resource kinds remain future engine cuts.
- `MimirRuntime` queues bioacoustic timeline PCM through Fensalir audio when the
active timing witness is allowed. `MimirAudioSynchronizationSettings.Mode`
selects `chirp-only`, `passive`, or `hybrid`; passive disables active

View file

@ -322,18 +322,22 @@ residency, shader access, format, shape, valid time range, version, and native
handle metadata. Field claims and lowering requests reference those
`mimir:resource:*` keys. The handle string is only a name; Fensalir validation,
planning, and renderer-owned resource slots own typed resource resolution before
shader lowering. Mimir-declared buffers are Fensalir buffers in the same
runtime; native/shared handle metadata is an import edge, not a separate
authority regime.
shader lowering. Mimir-declared rendering buffers are Fensalir GPU resources in
the same runtime; native/shared handle metadata is an import edge, not a
separate authority regime. Rendering-relevant buffers move to GPU residency as
early as possible and stay there; CPU readback/tessellation is diagnostic only.
The current smokes prove planning, not visible packet rendering:
`--fensalir-field-evidence-smoke` now produces one planned resource-backed
`TubeField` packet from Mimir's spectrum intent, and
`--fensalir-field-dsl-resource-smoke` proves the Fensalir DSL can bind the same
kind of declared resource directly. Fensalir now has the first D3D12 resolver
cut for structured/curve buffers: it allocates, reuses, and retires
engine-owned GPU slots under the declared resource key. The next blocker is
shader-side packet binding for those resolved TubeField resources, plus later
texture/mesh/page/volume resolvers.
cut for structured/curve buffers: it imports shared GPU buffers by handle and
allocates engine-owned GPU slots only for Fensalir-produced resources. The DSL
can describe a 2D rolling float buffer as Catmull-Rom XY tubes with modulo
column addressing, amplitude power/normalization, radius, ramp texture path, and
emission scale. The next blocker is shader-side packet binding/expansion for
those GPU-resident TubeField resources, plus later texture/mesh/page/volume
resolvers.
The current teardown/migration map is
`docs/fensalir-rendering-rebuild-migration.md`, paired with Fensalir's

View file

@ -141,3 +141,4 @@
{"ts": "2026-05-26T16:21:31+01:00", "type": "implementation", "status": "ok", "note": "Added the typed Fensalir resource boundary for field evidence. AquariumFieldEvidenceFrame now carries AquariumFieldResourceDeclaration rows; claims/packets that use mimir:resource:* handles validate against declared resources, and the lowering planner defers missing, CPU-only, or backend-incompatible resource requests. MimirFensalirFieldLowering emits resource declarations from live MimirBridgePayloadView/native handles, and observation claims reference those resource keys instead of bare kind:handle strings. dotnet build Mimir.slnx passed with the pre-existing EveRelay CA2024 warning; BufferSmoke --fensalir-field-evidence-smoke passed with domains=4 resources=1 claims=3 candidates=3 packets=0 requests=3 errors=False."}
{"ts": "2026-05-26T16:42:17+01:00", "type": "implementation", "status": "blocked", "note": "Resource-backed Fensalir lowering now reaches planned packets but not visible rendering. Mimir audio spectrum/waveform surface intents use the source observation's mimir:resource:* key, so --fensalir-field-evidence-smoke produces one planned TubeField packet and two deferred non-backend claims. Fensalir's AquariumFieldScriptCompiler.CompileEvidence can bind declared resources in DSL; --fensalir-field-dsl-resource-smoke produces one planned TubeField packet with no deferred requests. The next blocker is engine-side D3D12 packet/resource resolution: Fensalir must import/alias GPU-resident structured buffers, textures, meshes, surface pages, and volumes and bind them to selected shader lowerings before planned packets can render visibly."}
{"ts": "2026-05-26T17:29:30+01:00", "type": "correction", "status": "ok", "note": "Corrected the resource-boundary model: Mimir is a client running inside the Fensalir runtime, so Mimir-declared buffers are Fensalir resource declarations, not cross-process payload truth. Fensalir now has the first D3D12 field resource registry cut for declared structured/curve buffers: valid declarations allocate/reuse/retire engine-owned GPU slots under the resource key, and duplicate resource keys are validation errors. Visible rendering is now blocked on TubeField shader binding for resolved slots, not on deciding who owns the buffers. Texture, mesh, surface-page, and volume resource kinds remain future Fensalir resolver cuts."}
{"ts": "2026-05-26T18:50:34+01:00", "type": "correction", "status": "ok", "note": "Tightened the resource invariant: rendering buffers should move to GPU residency ASAP and stay there, with Fensalir passing handles/SRVs/UAVs between compute and render lowerings instead of copying samples through CPU. Fensalir's TubeField DSL now describes 2D rolling Float32 buffers as Catmull-Rom XY tubes with modulo column addressing, amplitude power/normalization, radius scaling, ramp texture path, and emission scale. D3D12 shared structured/curve resources import by GPU handle or stay unsupported; Fensalir only allocates a GPU slot when it is the producer. Visible rendering still needs shader-side TubeField expansion/binding over the GPU slot."}

View file

@ -300,12 +300,16 @@ accepted_design:
`--fensalir-field-dsl-resource-smoke` proves Fensalir's field evidence DSL
can bind a declared resource directly and produce one planned `TubeField`
packet with no deferred requests. Fensalir now owns the first in-process
D3D12 field resource registry: declared structured/curve buffer resources
allocate/reuse/retire engine-owned GPU slots under the resource key.
Mimir-declared buffers are therefore Fensalir resources in the same runtime,
not cross-process payload truth. Visible packet rendering is blocked on
binding those resolved slots into a concrete TubeField shader lowering and
then adding honest texture/mesh/page/volume resolvers.
D3D12 field resource registry: declared shared structured/curve buffers
import/alias GPU-resident resources by handle, while Fensalir-owned
resources allocate GPU slots only when Fensalir is the producer.
Mimir-declared rendering buffers are therefore Fensalir GPU resources in
the same runtime, not cross-process payload truth and not CPU payloads to
copy back and forth. The TubeField DSL can now express a 2D rolling float
buffer as Catmull-Rom XY tubes with modulo column addressing, amplitude
power/normalization, radius, ramp texture path, and emission scale. Visible
packet rendering is blocked on shader-side expansion and binding of those
GPU-resident slots, then honest texture/mesh/page/volume resolvers.
- `config/perfect-machine.example.json` declares live owners, sensors,
reservoir views, and runtime policy.
- `src/Mimir.Runtime/Synchronization` now includes the Perfect Machine module