buffer-prop: cross-graph shared buffer communication#9
Draft
treere wants to merge 3 commits into
Draft
Conversation
treere
commented
May 30, 2026
| @@ -63,6 +63,7 @@ fn create_graph(nodes_count: u64) -> Graph { | |||
| node: NodeRepr { | |||
| typ: "add".to_string(), | |||
| props: HashMap::default(), | |||
Owner
Author
There was a problem hiding this comment.
Suggested change
| props: HashMap::default(), |
The Default::default) should already include this.
This is true for many places where we add Default::default()
91aa073 to
6f353d9
Compare
- BoundedQueue: VecDeque<GenericOwnedProp> with bounded capacity - BufferHandle: Arc<Mutex<BoundedQueue>> for thread-safe sharing - BufferProp<T>: push/pop interface wrapping Prop<T> + BufferHandle - GenericPropInterface::link_buffer(): wiring method for system init - BufferRepr + SystemRepr.buffers: buffer config serialization - NodeRepr.buffer_links: maps param IDs to named buffer references - System buffer registry: creates handles from config, wires to nodes - System::buffer_stats(): query buffer (len, capacity) by name - 10 unit tests + 1 integration test (producer/consumer, two graphs)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Some graphs generate bursts of data faster than downstream graphs can consume. The existing link protocol only reads the last value of a property — values produced between consumption cycles are lost. Consumer graphs that need to accumulate or batch-process every value have no way to do so without missing intermediate data.
Solution
This PR introduces a shared buffer mechanism. A producer graph writes values into a named buffer; a consumer graph reads from the same buffer. Each value is delivered exactly once — the buffer acts as a decoupling queue between producers and consumers.
Configuration is declarative: define buffers and their capacities in the system config, then declare which node properties are linked to which buffer. Wiring happens automatically when the system starts.
The design is non-invasive — no changes to the existing graph pipeline, worker loop, or cross-graph link protocol. Buffers coexist with the existing pull-based links, letting each graph use the right communication pattern for each connection.