Add native render point ABI

This commit is contained in:
Meta Vens 2026-05-19 12:26:16 +01:00
commit cc468c0270
8 changed files with 82 additions and 5 deletions

View file

@ -38,6 +38,9 @@ shape removes independent per-kind storage from the live foundation.
descriptor boundary: caller-owned point buffer, point count/stride, target
size, source window, present time, audio-alignment time, and optional
metadata handle.
- `LocalcastRenderPoint` is the first fixed point-buffer element ABI for
Aquarium decoding: stable-key hash, source timestamp, position, radius,
color/alpha, and confidence.
- Repo-local persistence machinery.
- First architecture map.
- Example config for one video source plus two audio sources.

View file

@ -83,6 +83,9 @@ address as the payload handle and does not own the bytes.
`LocalcastRenderPacketDescriptor` does the same for visual render packets:
caller-owned point buffers and timing metadata are explicit, while Aquarium owns
decode/upload/rendering.
The first point-buffer element is `LocalcastRenderPoint`; it is deliberately
small so a native producer can kill file-backed render-frame transport before
the richer material/brush payloads arrive.
## Authoritative Boundaries

View file

@ -70,6 +70,12 @@ runtime path:
- Aquarium owns decoding and GPU upload. The reservoir only indexes when this
render packet exists in the shared rolling window.
`LocalcastRenderPoint` is the fixed point-buffer element shape for the initial
native/Aquarium render path. It carries a stable-key hash, source timestamp,
position, radius, color/alpha, and confidence. Richer material/brush payloads
can get their own descriptors later; this point shape exists to kill the old
JSON/CultCache render-frame dependency first.
Payload handles are owned by the caller. Aquarium should treat them as handles
to GPU/native visual memory; Faust/native DSP should treat them as handles to
audio buffers. This crate does not interpret those bytes. It is the clocked

View file

@ -65,6 +65,20 @@ typedef struct LocalcastRenderPacketDescriptor {
uint64_t metadata_handle;
} LocalcastRenderPacketDescriptor;
typedef struct LocalcastRenderPoint {
uint64_t stable_key_hash;
uint64_t source_timestamp_ns;
float x;
float y;
float z;
float radius_m;
float red;
float green;
float blue;
float alpha;
float confidence;
} LocalcastRenderPoint;
typedef struct LocalcastRuntimeStatus {
uint64_t edge_ns;
uint64_t window_start_ns;

View file

@ -211,6 +211,22 @@ pub struct LocalcastRenderPacketDescriptor {
pub metadata_handle: u64,
}
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct LocalcastRenderPoint {
pub stable_key_hash: u64,
pub source_timestamp_ns: u64,
pub x: f32,
pub y: f32,
pub z: f32,
pub radius_m: f32,
pub red: f32,
pub green: f32,
pub blue: f32,
pub alpha: f32,
pub confidence: f32,
}
pub struct LocalcastReservoir {
inner: RollingReservoir<LocalcastSampleHandle>,
}
@ -891,6 +907,22 @@ mod tests {
}
}
fn render_point(stable_key_hash: u64) -> LocalcastRenderPoint {
LocalcastRenderPoint {
stable_key_hash,
source_timestamp_ns: 1_900,
x: 0.1,
y: 0.2,
z: 1.2,
radius_m: 0.03,
red: 0.7,
green: 0.6,
blue: 0.5,
alpha: 0.9,
confidence: 0.8,
}
}
#[test]
fn rolling_reservoir_expires_every_kind_from_one_edge() {
let mut reservoir = RollingReservoir::new(DEFAULT_RESERVOIR_NS);
@ -1431,6 +1463,16 @@ mod tests {
localcast_runtime_destroy(runtime);
}
#[test]
fn render_point_layout_is_fixed_for_aquarium_decoding() {
let point = render_point(0xCAFE);
assert_eq!(std::mem::size_of::<LocalcastRenderPoint>(), 56);
assert_eq!(0xCAFE, point.stable_key_hash);
assert_eq!(1_900, point.source_timestamp_ns);
assert_eq!(0.03, point.radius_m);
}
#[test]
fn render_packet_descriptor_push_rejects_wrong_kind_and_null_descriptor() {
let runtime = localcast_runtime_create(DEFAULT_RESERVOIR_NS);

View file

@ -38,6 +38,8 @@ Get-Content .\state\evidence.jsonl -Tail 8
pointer, while the reservoir still owns only timing/retention metadata.
- `LocalcastRenderPacketDescriptor` now gives render packets the same typed
descriptor boundary for caller-owned point buffers and presentation timing.
- `LocalcastRenderPoint` is the fixed first point-buffer ABI for Aquarium
decoding.
- Aquarium-Engine commit `4d5aec7` adds the first safe-code C# binding layer for
this native ABI. It is not yet wired into `LocalCastRuntime` as the live
source.

View file

@ -81,3 +81,5 @@
{"ts": "2026-05-19T11:10:31+00:00", "type": "implementation", "status": "ok", "note": "Native reservoir ABI now includes LocalcastRenderPacketDescriptor and localcast_producer_push_render_packet so render packets carry caller-owned point-buffer and timing descriptors instead of untyped payload integers."}
{"ts": "2026-05-19T11:13:54+00:00", "type": "implementation", "status": "ok", "note": "Aquarium-Engine commit 9eb40cf adds the C# LocalCast render packet descriptor binding and layout tests for LocalcastRenderPacketDescriptor/localcast_producer_push_render_packet."}
{"ts": "2026-05-19T11:21:55+00:00", "type": "implementation", "status": "ok", "note": "Aquarium-Engine commit cfb48d7 adds LocalCastNativeRenderDescriptorDecoder: Aquarium now reads LocalcastRenderPacketDescriptor timing/target metadata from native payload handles while keeping point-buffer decoding as an injected boundary."}
{"ts": "2026-05-19T11:25:11+00:00", "type": "decision", "status": "ok", "note": "Mimir is now the public brand for the LocalCastBridge/localcast implementation surfaces: local sensors become one coherent realtime volumetric field, while OBS, Aquarium, Faust, and FFmpeg retain their existing ownership boundaries."}
{"ts": "2026-05-19T11:25:59+00:00", "type": "implementation", "status": "ok", "note": "Native reservoir ABI now includes LocalcastRenderPoint, the fixed first point-buffer element for Aquarium render decoding: stable-key hash, source timestamp, position, radius, color/alpha, and confidence."}

View file

@ -1,12 +1,14 @@
workspace:
name: LocalCastBridge
name: Mimir
status: active
focus: perfect-machine-native-reservoir
implementation_name: LocalCastBridge / localcast
premise: >
A second Windows PC should appear inside OBS as video plus separately
mixable audio sources. The synchronized program path now cuts away the
Python/OpenGL deadline bridge and rebuilds around one native rolling
reservoir feeding Aquarium, Faust, CultNet, and OBS.
Mimir is the public name for the local realtime field machine: a roomful of
cameras, microphones, speakers, and timing signals becomes one coherent
OBS-facing volumetric program surface. The synchronized program path now
cuts away the Python/OpenGL deadline bridge and rebuilds around one native
rolling reservoir feeding Aquarium, Faust, CultNet, and OBS.
objective:
primary: >
@ -60,6 +62,9 @@ accepted_design:
- `LocalcastRenderPacketDescriptor` gives render packets the same typed
payload boundary for caller-owned point buffers and presentation timing;
Aquarium still owns decoding, upload, and rendering.
- `LocalcastRenderPoint` is the first native point-buffer element ABI, kept
small to replace file-backed render-frame transport before richer material
and brush descriptors exist.
- `config/localcast.example.json` defines receiver address, base port, video encode settings, and audio sources.
- `scripts/sender-discover.ps1` lists FFmpeg devices, protocols, and encoders.
- `scripts/sender-start.ps1` launches one FFmpeg process per enabled source.