Add native runtime producer spine
This commit is contained in:
parent
2bf5abbd57
commit
be6e68af9d
8 changed files with 357 additions and 19 deletions
|
|
@ -7,6 +7,7 @@
|
|||
- `config/perfect-machine.example.json` declares the contract shape for six cameras, six microphones, reservoir rings, native authorities, outputs, and the demotion of bridge scripts to tooling.
|
||||
- `native/reservoir` is the first native Rust crate. It implements shared-edge five-second reservoir rings and proves that all rings expire against the newest sample, not private per-source clocks.
|
||||
- `native/reservoir/include/localcast_reservoir.h` exposes the Aquarium/Faust C ABI: opaque reservoir create/destroy, sample-handle push, edge/window queries, ring counts, and latest sample lookup by sensor hash. Payload memory remains owned by Aquarium/GPU/Faust; the reservoir owns timing and retention.
|
||||
- `LocalcastRuntime` now wraps the reservoir with typed native producer calls for camera frames/features, scene rays, surface/material claims, audio blocks, phase claims, events, and render packets. It also exposes native status with shared edge/window and ring counts, replacing the Python file-cache path as the intended live spine.
|
||||
- Repo-local persistence machinery.
|
||||
- First architecture map.
|
||||
- Example config for one video source plus two audio sources.
|
||||
|
|
@ -73,15 +74,17 @@
|
|||
- Audio defaults to AAC inside MPEG-TS for compatibility; test Opus later only if there is a concrete reason.
|
||||
- Desktop capture uses `gdigrab` first because it is broadly available. `ddagrab` is a candidate once the installed FFmpeg build is confirmed.
|
||||
- The scripts assume Windows sender and OBS receiver on the same LAN.
|
||||
- The Python live producers/renderers are compatibility diagnostics. They are no longer the intended runtime API.
|
||||
|
||||
## Next
|
||||
|
||||
1. Add the Aquarium-side binding that loads `localcast_reservoir` and maps GPU/audio buffer handles to `LocalcastSampleHandle`.
|
||||
2. Move camera ingest into native capture workers that append `camera_frame` samples to the reservoir.
|
||||
3. Move feature extraction, flow, cross-view matching, LOD reconciliation, and material fitting into Aquarium GPU compute.
|
||||
4. Move mic alignment, voice separation, room suppression, Ambisonic/HOA spatialization, and stem generation into Faust/native DSP.
|
||||
5. Replace the deadline Spout sink with Aquarium-owned Spout publication from the native render target.
|
||||
6. Feed the neighbor Focusrite shotgun and neighbor loopback into the reservoir as live synchronized audio inputs.
|
||||
7. Replace placeholder mic/speaker/camera geometry with measured `config/audio-field.json` and `config/sensor-fusion.json` coordinates.
|
||||
8. Calibrate Leap as a geometric camera so Leap contributes direct 3D rays, not only timing evidence.
|
||||
9. Keep the Python bridge only for calibration, contract tests, device discovery, status, and offline analysis.
|
||||
1. Add the Aquarium-side binding that loads `localcast_reservoir`, creates `LocalcastRuntime`, and maps GPU/audio buffer handles to `LocalcastSampleHandle`.
|
||||
2. Move camera ingest into native capture workers that call `localcast_runtime_push_camera_frame`.
|
||||
3. Move mic/loopback ingest into native capture workers that call `localcast_runtime_push_audio_block`.
|
||||
4. Move feature extraction, flow, cross-view matching, LOD reconciliation, and material fitting into Aquarium GPU compute.
|
||||
5. Move mic alignment, voice separation, room suppression, Ambisonic/HOA spatialization, and stem generation into Faust/native DSP.
|
||||
6. Replace the deadline Spout sink with Aquarium-owned Spout publication from the native render target.
|
||||
7. Feed the neighbor Focusrite shotgun and neighbor loopback into the reservoir as live synchronized audio inputs.
|
||||
8. Replace placeholder mic/speaker/camera geometry with measured `config/audio-field.json` and `config/sensor-fusion.json` coordinates.
|
||||
9. Calibrate Leap as a geometric camera so Leap contributes direct 3D rays, not only timing evidence.
|
||||
10. Keep the Python bridge only for calibration, contract tests, device discovery, status, and offline analysis.
|
||||
|
|
|
|||
|
|
@ -15,13 +15,15 @@ The repo currently proves the contracts:
|
|||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A["sensor samples"] --> B["typed CultCache docs"]
|
||||
B --> C["Python deadline producers"]
|
||||
C --> D["deadline Spout texture"]
|
||||
D --> E["OBS"]
|
||||
A["camera/audio/phase/render producers"] --> B["LocalcastRuntime C ABI"]
|
||||
B --> C["5s native reservoir"]
|
||||
C --> D["Aquarium GPU + Faust DSP"]
|
||||
D --> E["Spout/audio stems"]
|
||||
E --> F["OBS"]
|
||||
```
|
||||
|
||||
That was useful. It is not the final machine.
|
||||
The old CultCache/Python/Spout path remains a compatibility diagnostic. It is
|
||||
not the runtime API.
|
||||
|
||||
## Invariants
|
||||
|
||||
|
|
@ -83,6 +85,11 @@ Required rings:
|
|||
The reservoir owns retention. Producers append. Optimizers refine. Renderers
|
||||
sample. No stage owns a private history that can outlive the reservoir.
|
||||
|
||||
`LocalcastRuntime` is the first native owner above the raw reservoir. It exposes
|
||||
typed producer calls for each ring so camera capture, audio capture, phase
|
||||
estimation, material fitting, event detection, and render planning all append
|
||||
into one shared five-second window without crossing a Python file cache.
|
||||
|
||||
## Visual Fusion
|
||||
|
||||
Camera fusion is feature matching across the reservoir, not a latest-frame
|
||||
|
|
@ -165,6 +172,10 @@ in `native/reservoir/include/localcast_reservoir.h`:
|
|||
- advance/query the shared edge and window start;
|
||||
- query ring length;
|
||||
- query the latest sample for a sensor hash.
|
||||
- create/destroy an opaque `LocalcastRuntime`;
|
||||
- append typed camera/audio/phase/event/render handles through producer calls;
|
||||
- query a native runtime status struct with shared edge, window start, and ring
|
||||
counts.
|
||||
|
||||
The ABI carries `payload_handle`, not payload bytes. Aquarium owns image,
|
||||
feature, surface, material, and GPU memory interpretation. Faust/native DSP owns
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ tests, and offline analysis. It does not own dense live fusion or DSP.
|
|||
|
||||
## Reservoir ABI
|
||||
|
||||
The ABI is intentionally small:
|
||||
The reservoir ABI is intentionally small:
|
||||
|
||||
- `LocalcastReservoir` is opaque.
|
||||
- `LocalcastSampleHandle` is sample metadata plus a `payload_handle`.
|
||||
|
|
@ -25,6 +25,19 @@ The ABI is intentionally small:
|
|||
- The reservoir can create/destroy, push, set/query edge, query window start,
|
||||
count a ring, and fetch the latest sample for a sensor hash.
|
||||
|
||||
## Runtime ABI
|
||||
|
||||
`LocalcastRuntime` is the live spine that should replace the Python file-cache
|
||||
runtime path:
|
||||
|
||||
- it owns one native reservoir;
|
||||
- it exposes typed producer functions for camera frames, camera features, scene
|
||||
rays, surface claims, material claims, audio blocks, phase claims, event
|
||||
claims, and render packets;
|
||||
- it exposes `LocalcastRuntimeStatus` so Aquarium/Faust can inspect the shared
|
||||
edge, window start, and per-ring sample counts without polling JSON or
|
||||
MessagePack files.
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ enum LocalcastRingKind {
|
|||
};
|
||||
|
||||
typedef struct LocalcastReservoir LocalcastReservoir;
|
||||
typedef struct LocalcastRuntime LocalcastRuntime;
|
||||
|
||||
typedef struct LocalcastSampleHandle {
|
||||
uint64_t sensor_id_hash;
|
||||
|
|
@ -30,6 +31,20 @@ typedef struct LocalcastSampleHandle {
|
|||
uint64_t payload_handle;
|
||||
} LocalcastSampleHandle;
|
||||
|
||||
typedef struct LocalcastRuntimeStatus {
|
||||
uint64_t edge_ns;
|
||||
uint64_t window_start_ns;
|
||||
size_t camera_frame_count;
|
||||
size_t camera_feature_count;
|
||||
size_t scene_ray_count;
|
||||
size_t surface_claim_count;
|
||||
size_t material_claim_count;
|
||||
size_t audio_block_count;
|
||||
size_t phase_claim_count;
|
||||
size_t event_claim_count;
|
||||
size_t render_packet_count;
|
||||
} LocalcastRuntimeStatus;
|
||||
|
||||
LocalcastReservoir *localcast_reservoir_create(uint64_t duration_ns);
|
||||
void localcast_reservoir_destroy(LocalcastReservoir *reservoir);
|
||||
|
||||
|
|
@ -51,6 +66,20 @@ bool localcast_reservoir_latest_for_sensor(
|
|||
LocalcastSampleHandle *out_sample
|
||||
);
|
||||
|
||||
LocalcastRuntime *localcast_runtime_create(uint64_t duration_ns);
|
||||
void localcast_runtime_destroy(LocalcastRuntime *runtime);
|
||||
|
||||
bool localcast_runtime_push_camera_frame(LocalcastRuntime *runtime, LocalcastSampleHandle sample);
|
||||
bool localcast_runtime_push_camera_feature(LocalcastRuntime *runtime, LocalcastSampleHandle sample);
|
||||
bool localcast_runtime_push_scene_ray(LocalcastRuntime *runtime, LocalcastSampleHandle sample);
|
||||
bool localcast_runtime_push_surface_claim(LocalcastRuntime *runtime, LocalcastSampleHandle sample);
|
||||
bool localcast_runtime_push_material_claim(LocalcastRuntime *runtime, LocalcastSampleHandle sample);
|
||||
bool localcast_runtime_push_audio_block(LocalcastRuntime *runtime, LocalcastSampleHandle sample);
|
||||
bool localcast_runtime_push_phase_claim(LocalcastRuntime *runtime, LocalcastSampleHandle sample);
|
||||
bool localcast_runtime_push_event_claim(LocalcastRuntime *runtime, LocalcastSampleHandle sample);
|
||||
bool localcast_runtime_push_render_packet(LocalcastRuntime *runtime, LocalcastSampleHandle sample);
|
||||
bool localcast_runtime_status(const LocalcastRuntime *runtime, LocalcastRuntimeStatus *out_status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -190,6 +190,90 @@ pub struct LocalcastReservoir {
|
|||
inner: Reservoir<LocalcastSampleHandle>,
|
||||
}
|
||||
|
||||
pub struct LocalcastRuntime {
|
||||
reservoir: Reservoir<LocalcastSampleHandle>,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct LocalcastRuntimeStatus {
|
||||
pub edge_ns: u64,
|
||||
pub window_start_ns: u64,
|
||||
pub camera_frame_count: usize,
|
||||
pub camera_feature_count: usize,
|
||||
pub scene_ray_count: usize,
|
||||
pub surface_claim_count: usize,
|
||||
pub material_claim_count: usize,
|
||||
pub audio_block_count: usize,
|
||||
pub phase_claim_count: usize,
|
||||
pub event_claim_count: usize,
|
||||
pub render_packet_count: usize,
|
||||
}
|
||||
|
||||
impl Default for LocalcastRuntimeStatus {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
edge_ns: 0,
|
||||
window_start_ns: 0,
|
||||
camera_frame_count: 0,
|
||||
camera_feature_count: 0,
|
||||
scene_ray_count: 0,
|
||||
surface_claim_count: 0,
|
||||
material_claim_count: 0,
|
||||
audio_block_count: 0,
|
||||
phase_claim_count: 0,
|
||||
event_claim_count: 0,
|
||||
render_packet_count: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl LocalcastRuntime {
|
||||
fn new(duration_ns: u64) -> Self {
|
||||
let duration = if duration_ns == 0 {
|
||||
DEFAULT_RESERVOIR_NS
|
||||
} else {
|
||||
duration_ns
|
||||
};
|
||||
Self {
|
||||
reservoir: Reservoir::new(duration),
|
||||
}
|
||||
}
|
||||
|
||||
fn push(&mut self, kind: RingKind, sample: LocalcastSampleHandle) {
|
||||
self.reservoir.push(
|
||||
kind,
|
||||
Sample::new(
|
||||
sample.sensor_id_hash.to_string(),
|
||||
sample.timestamp_ns,
|
||||
sample.arrival_ns,
|
||||
sample.sequence,
|
||||
sample,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
fn ring_len(&self, kind: RingKind) -> usize {
|
||||
self.reservoir.ring(kind).map_or(0, ReservoirRing::len)
|
||||
}
|
||||
|
||||
fn status(&self) -> LocalcastRuntimeStatus {
|
||||
LocalcastRuntimeStatus {
|
||||
edge_ns: self.reservoir.edge_ns(),
|
||||
window_start_ns: self.reservoir.window_start_ns(),
|
||||
camera_frame_count: self.ring_len(RingKind::CameraFrame),
|
||||
camera_feature_count: self.ring_len(RingKind::CameraFeature),
|
||||
scene_ray_count: self.ring_len(RingKind::SceneRay),
|
||||
surface_claim_count: self.ring_len(RingKind::SurfaceClaim),
|
||||
material_claim_count: self.ring_len(RingKind::MaterialClaim),
|
||||
audio_block_count: self.ring_len(RingKind::AudioBlock),
|
||||
phase_claim_count: self.ring_len(RingKind::PhaseClaim),
|
||||
event_claim_count: self.ring_len(RingKind::EventClaim),
|
||||
render_packet_count: self.ring_len(RingKind::RenderPacket),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn localcast_reservoir_create(duration_ns: u64) -> *mut LocalcastReservoir {
|
||||
let duration = if duration_ns == 0 {
|
||||
|
|
@ -303,6 +387,120 @@ pub extern "C" fn localcast_reservoir_latest_for_sensor(
|
|||
true
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn localcast_runtime_create(duration_ns: u64) -> *mut LocalcastRuntime {
|
||||
Box::into_raw(Box::new(LocalcastRuntime::new(duration_ns)))
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn localcast_runtime_destroy(ptr: *mut LocalcastRuntime) {
|
||||
if ptr.is_null() {
|
||||
return;
|
||||
}
|
||||
unsafe {
|
||||
drop(Box::from_raw(ptr));
|
||||
}
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn localcast_runtime_push_camera_frame(
|
||||
ptr: *mut LocalcastRuntime,
|
||||
sample: LocalcastSampleHandle,
|
||||
) -> bool {
|
||||
localcast_runtime_push_typed(ptr, RingKind::CameraFrame, sample)
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn localcast_runtime_push_camera_feature(
|
||||
ptr: *mut LocalcastRuntime,
|
||||
sample: LocalcastSampleHandle,
|
||||
) -> bool {
|
||||
localcast_runtime_push_typed(ptr, RingKind::CameraFeature, sample)
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn localcast_runtime_push_scene_ray(
|
||||
ptr: *mut LocalcastRuntime,
|
||||
sample: LocalcastSampleHandle,
|
||||
) -> bool {
|
||||
localcast_runtime_push_typed(ptr, RingKind::SceneRay, sample)
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn localcast_runtime_push_surface_claim(
|
||||
ptr: *mut LocalcastRuntime,
|
||||
sample: LocalcastSampleHandle,
|
||||
) -> bool {
|
||||
localcast_runtime_push_typed(ptr, RingKind::SurfaceClaim, sample)
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn localcast_runtime_push_material_claim(
|
||||
ptr: *mut LocalcastRuntime,
|
||||
sample: LocalcastSampleHandle,
|
||||
) -> bool {
|
||||
localcast_runtime_push_typed(ptr, RingKind::MaterialClaim, sample)
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn localcast_runtime_push_audio_block(
|
||||
ptr: *mut LocalcastRuntime,
|
||||
sample: LocalcastSampleHandle,
|
||||
) -> bool {
|
||||
localcast_runtime_push_typed(ptr, RingKind::AudioBlock, sample)
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn localcast_runtime_push_phase_claim(
|
||||
ptr: *mut LocalcastRuntime,
|
||||
sample: LocalcastSampleHandle,
|
||||
) -> bool {
|
||||
localcast_runtime_push_typed(ptr, RingKind::PhaseClaim, sample)
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn localcast_runtime_push_event_claim(
|
||||
ptr: *mut LocalcastRuntime,
|
||||
sample: LocalcastSampleHandle,
|
||||
) -> bool {
|
||||
localcast_runtime_push_typed(ptr, RingKind::EventClaim, sample)
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn localcast_runtime_push_render_packet(
|
||||
ptr: *mut LocalcastRuntime,
|
||||
sample: LocalcastSampleHandle,
|
||||
) -> bool {
|
||||
localcast_runtime_push_typed(ptr, RingKind::RenderPacket, sample)
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn localcast_runtime_status(
|
||||
ptr: *const LocalcastRuntime,
|
||||
out_status: *mut LocalcastRuntimeStatus,
|
||||
) -> bool {
|
||||
let Some(runtime) = (unsafe { ptr.as_ref() }) else {
|
||||
return false;
|
||||
};
|
||||
let Some(out) = (unsafe { out_status.as_mut() }) else {
|
||||
return false;
|
||||
};
|
||||
*out = runtime.status();
|
||||
true
|
||||
}
|
||||
|
||||
fn localcast_runtime_push_typed(
|
||||
ptr: *mut LocalcastRuntime,
|
||||
kind: RingKind,
|
||||
sample: LocalcastSampleHandle,
|
||||
) -> bool {
|
||||
let Some(runtime) = (unsafe { ptr.as_mut() }) else {
|
||||
return false;
|
||||
};
|
||||
runtime.push(kind, sample);
|
||||
true
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
|
@ -418,4 +616,65 @@ mod tests {
|
|||
));
|
||||
localcast_reservoir_destroy(reservoir);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn runtime_spine_routes_typed_producers_into_one_reservoir() {
|
||||
let runtime = localcast_runtime_create(DEFAULT_RESERVOIR_NS);
|
||||
let camera = LocalcastSampleHandle {
|
||||
sensor_id_hash: 10,
|
||||
timestamp_ns: 1_000_000_000,
|
||||
arrival_ns: 1_000_000_001,
|
||||
sequence: 1,
|
||||
payload_handle: 100,
|
||||
};
|
||||
let audio = LocalcastSampleHandle {
|
||||
sensor_id_hash: 20,
|
||||
timestamp_ns: 7_000_000_001,
|
||||
arrival_ns: 7_000_000_010,
|
||||
sequence: 2,
|
||||
payload_handle: 200,
|
||||
};
|
||||
let phase = LocalcastSampleHandle {
|
||||
sensor_id_hash: 30,
|
||||
timestamp_ns: 7_000_000_010,
|
||||
arrival_ns: 7_000_000_020,
|
||||
sequence: 3,
|
||||
payload_handle: 300,
|
||||
};
|
||||
|
||||
assert!(localcast_runtime_push_camera_frame(runtime, camera));
|
||||
assert!(localcast_runtime_push_audio_block(runtime, audio));
|
||||
assert!(localcast_runtime_push_phase_claim(runtime, phase));
|
||||
|
||||
let mut status = LocalcastRuntimeStatus::default();
|
||||
assert!(localcast_runtime_status(runtime, &mut status));
|
||||
assert_eq!(7_000_000_010, status.edge_ns);
|
||||
assert_eq!(2_000_000_010, status.window_start_ns);
|
||||
assert_eq!(0, status.camera_frame_count);
|
||||
assert_eq!(1, status.audio_block_count);
|
||||
assert_eq!(1, status.phase_claim_count);
|
||||
|
||||
localcast_runtime_destroy(runtime);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn runtime_spine_rejects_nulls() {
|
||||
let sample = LocalcastSampleHandle {
|
||||
sensor_id_hash: 1,
|
||||
timestamp_ns: 2,
|
||||
arrival_ns: 3,
|
||||
sequence: 4,
|
||||
payload_handle: 5,
|
||||
};
|
||||
let mut status = LocalcastRuntimeStatus::default();
|
||||
|
||||
assert!(!localcast_runtime_push_camera_frame(
|
||||
std::ptr::null_mut(),
|
||||
sample,
|
||||
));
|
||||
assert!(!localcast_runtime_status(std::ptr::null(), &mut status));
|
||||
let runtime = localcast_runtime_create(0);
|
||||
assert!(!localcast_runtime_status(runtime, std::ptr::null_mut()));
|
||||
localcast_runtime_destroy(runtime);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ Ownership:
|
|||
- Faust owns hot audio DSP and program stem generation.
|
||||
- OBS owns broadcast controls.
|
||||
- Python remains tooling, not the stream hot path.
|
||||
- `native/reservoir` is the first native crate. It owns shared-edge five-second sample retention for typed rings and exposes the small C ABI in `native/reservoir/include/localcast_reservoir.h`: opaque reservoir lifetime, sample-handle push, edge/window queries, ring counts, and latest-by-sensor lookup.
|
||||
- `native/reservoir` is the first native crate. It owns shared-edge five-second sample retention for typed rings and exposes the C ABI in `native/reservoir/include/localcast_reservoir.h`: opaque reservoir lifetime, sample-handle push, edge/window queries, ring counts, latest-by-sensor lookup, and the `LocalcastRuntime` spine for typed producer appends plus native status.
|
||||
|
||||
Invariant: the five-second spatiotemporal reservoir is the live authority. Producers append sample handles, optimizers refine, Aquarium/Faust sample and interpret the pointed-to payloads. No private history outlives the reservoir, and the reservoir does not pretend to own GPU image memory or Faust audio buffers.
|
||||
Invariant: the five-second spatiotemporal reservoir is the live authority. Producers append sample handles through typed native calls, optimizers refine, Aquarium/Faust sample and interpret the pointed-to payloads. No private history outlives the reservoir, and the reservoir does not pretend to own GPU image memory or Faust audio buffers. Python scripts are compatibility diagnostics and calibration tools, not the live API.
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ invariants:
|
|||
|
||||
accepted_design:
|
||||
- `docs/perfect-machine.md` and `config/perfect-machine.example.json` define the native target: one five-second spatiotemporal reservoir, Aquarium GPU fusion/rendering, Faust DSP, OBS output controls, and LocalCastBridge tooling.
|
||||
- `native/reservoir` is the first native Rust crate. It implements shared-edge reservoir rings so all sample types expire from the newest live sample rather than private source histories, and exposes a small C ABI for Aquarium/Faust handle-based integration.
|
||||
- `native/reservoir` is the first native Rust crate. It implements shared-edge reservoir rings so all sample types expire from the newest live sample rather than private source histories, and exposes a C ABI for Aquarium/Faust handle-based integration plus `LocalcastRuntime` typed producer calls.
|
||||
- `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.
|
||||
|
|
@ -42,7 +42,7 @@ accepted_design:
|
|||
- Persistence follows the active repo pattern: map, scratch, evidence, branches, handoff, system map, implementation plan, state helpers.
|
||||
|
||||
active_subgoals:
|
||||
- Bind Aquarium/Faust to the native reservoir C ABI described by `native/reservoir/include/localcast_reservoir.h`.
|
||||
- Bind Aquarium/Faust to `LocalcastRuntime` in the native reservoir C ABI described by `native/reservoir/include/localcast_reservoir.h`.
|
||||
- Move dense visual fusion/material fitting/brush generation into Aquarium GPU compute.
|
||||
- Move hot audio DSP/voice separation/room suppression/spatialization into Faust/native runtime.
|
||||
- Validate the actual sender FFmpeg build and capture device names.
|
||||
|
|
|
|||
|
|
@ -44,6 +44,29 @@ class PerfectMachineContractTests(unittest.TestCase):
|
|||
self.assertIn("size_t localcast_reservoir_ring_len", header)
|
||||
self.assertIn("bool localcast_reservoir_latest_for_sensor", header)
|
||||
|
||||
def test_native_runtime_header_exposes_typed_producer_spine(self):
|
||||
header = (ROOT / "native" / "reservoir" / "include" / "localcast_reservoir.h").read_text(encoding="utf-8")
|
||||
|
||||
self.assertIn("typedef struct LocalcastRuntime LocalcastRuntime;", header)
|
||||
self.assertIn("typedef struct LocalcastRuntimeStatus", header)
|
||||
self.assertIn("uint64_t edge_ns;", header)
|
||||
self.assertIn("size_t camera_frame_count;", header)
|
||||
self.assertIn("LocalcastRuntime *localcast_runtime_create", header)
|
||||
self.assertIn("void localcast_runtime_destroy", header)
|
||||
for function in [
|
||||
"localcast_runtime_push_camera_frame",
|
||||
"localcast_runtime_push_camera_feature",
|
||||
"localcast_runtime_push_scene_ray",
|
||||
"localcast_runtime_push_surface_claim",
|
||||
"localcast_runtime_push_material_claim",
|
||||
"localcast_runtime_push_audio_block",
|
||||
"localcast_runtime_push_phase_claim",
|
||||
"localcast_runtime_push_event_claim",
|
||||
"localcast_runtime_push_render_packet",
|
||||
"localcast_runtime_status",
|
||||
]:
|
||||
self.assertIn(function, header)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Reference in a new issue