Sink nodes: a real multi-sink recording surface (replace the single observe index) #2

Closed
opened 2026-06-03 16:21:46 +02:00 by Brummel · 0 comments
Owner

Problem

The only observation mechanism the engine has today is the single observe: usize
index on Harness (crates/aura-engine/src/harness.rs:91). Harness::run returns
Vec<Option<Vec<Scalar>>> (harness.rs:213) — exactly one node's per-cycle row.
There is no sink concept at all, even though C8/C18 and the glossary define a sink as
"a pure consumer node with no output that persists a stream into the run registry —
the sole recording and observability mechanism."

This blocks multi-sink: a single run can record exactly one stream, so the milestone's
goal (multi-producer / multi-consumer / multi-sink in all combinations) is
structurally unreachable.

Scope

Replace the single-observe affordance with real sink nodes:

  • A sink is a pure-consumer node (empty output record, output: vec![]) bound to one
    or more producer fields via the existing Edge / Target wiring.
  • Each cycle it fires, it records its bound input value(s).
  • After the run the harness yields every sink's recorded stream, not one node's row.

Pure infrastructure — no trading domain (no position table, no broker, no equity).

Design questions (needs a spec — this is a cycle, not a mechanical edit)

  • How the engine reads a sink's accumulated stream back: engine-owned per-sink
    recording buffers vs. a trait method on the node vs. downcast.
  • The run return shape: per-sink streams keyed by node index (or sink name).
  • What a sink may bind: N inputs of mixed scalar kinds, recording a K-field row per cycle.
  • Whether observe: usize is removed outright or kept as the degenerate single-sink case.

Invariants (must hold)

C1 (deterministic, no per-cycle heap alloc on the hot path beyond the recording
buffers), C7 (four scalar kinds, SoA), C8 (sink = node with no output), C18 (the sink
is the recording mechanism).

## Problem The only observation mechanism the engine has today is the single `observe: usize` index on `Harness` (`crates/aura-engine/src/harness.rs:91`). `Harness::run` returns `Vec<Option<Vec<Scalar>>>` (`harness.rs:213`) — exactly one node's per-cycle row. There is no sink concept at all, even though C8/C18 and the glossary define a sink as "a pure consumer node with no output that persists a stream into the run registry — the sole recording and observability mechanism." This blocks multi-sink: a single run can record exactly one stream, so the milestone's goal (multi-producer / multi-consumer / multi-sink in all combinations) is structurally unreachable. ## Scope Replace the single-`observe` affordance with real sink nodes: - A sink is a pure-consumer node (empty output record, `output: vec![]`) bound to one or more producer fields via the existing `Edge` / `Target` wiring. - Each cycle it fires, it records its bound input value(s). - After the run the harness yields *every* sink's recorded stream, not one node's row. Pure infrastructure — no trading domain (no position table, no broker, no equity). ## Design questions (needs a spec — this is a cycle, not a mechanical edit) - How the engine reads a sink's accumulated stream back: engine-owned per-sink recording buffers vs. a trait method on the node vs. downcast. - The `run` return shape: per-sink streams keyed by node index (or sink name). - What a sink may bind: N inputs of mixed scalar kinds, recording a K-field row per cycle. - Whether `observe: usize` is removed outright or kept as the degenerate single-sink case. ## Invariants (must hold) C1 (deterministic, no per-cycle heap alloc on the hot path beyond the recording buffers), C7 (four scalar kinds, SoA), C8 (sink = node with no output), C18 (the sink is the recording mechanism).
Brummel added this to the Producer/consumer/sink substrate milestone 2026-06-03 16:21:46 +02:00
Brummel added the BLOCKER label 2026-06-03 16:21:46 +02:00
Brummel referenced this issue from a commit 2026-06-04 14:45:25 +02:00
Brummel referenced this issue from a commit 2026-06-04 14:45:25 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Brummel/Aura#2