-
Notifications
You must be signed in to change notification settings - Fork 1
Add StreamProcessor.visualize() method #300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SimonHeybrock
wants to merge
5
commits into
main
Choose a base branch
from
add-stream-processor-visualize
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+974
−6
Conversation
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
Add visualization support that displays the workflow graph with node classification styling to help understand the streaming data flow: - Static nodes (gray): Pre-computed once, cached - Context keys/nodes (blue): Input entry points and cached dependents - Dynamic keys/nodes (green): Chunk inputs and per-chunk computations - Accumulator keys (orange cylinder): Aggregation points - Finalize nodes (lavender): Computed from accumulators - Target keys (double border): Final outputs The method stores the base workflow during __init__ to show the full graph including pre-computed static subgraphs. Dynamic and context keys are styled with black borders to override sciline's red "unsatisfied" styling since these are intentional stream inputs. --- Prompt: develop an understanding of StreamProcessor, then think about how we can make an equivalent to sciline.Pipeline.visualize, highlight specifics of the wrapping StreamProcessor - where are accumulators, which are dynamic inputs, which nodes are cached and which are downstream of dynamic and thus recomputed?
- Unify _find_descendants and _find_graph_descendants into a single function that accepts either Pipeline or DiGraph - Convert _classify_nodes_for_visualization to a method _classify_nodes on StreamProcessor for cleaner access to instance attributes - Add comprehensive tests for visualization in streaming_visualize_test.py Prompt: Please carefully think through and review the implementation of StreamProcessor.visualize. Could it be written in a better way, e.g., by relying more on what StreamProcessor already does in __init__ (node classification, ...)? Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
23a5dc1 to
5ea0769
Compare
- Exclude nodes unreachable from target_keys (unrelated branches) - Show full static subgraph including nodes upstream of input keys - Build visualization workflow once in constructor for consistency - Classify nodes based on actual visualized graph to ensure all visible nodes are properly styled Prompt: StreamProcessor.visualize currently seems to show the full graph, even parts/nodes unreachable/unused by computing the given targets. Also fixes: visualization shows nodes upstream of input keys (dynamic_keys, context_keys). Also fixes: some root nodes appearing unstyled/white. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…alize color - Distinguish between static nodes (dependencies) and actually cached nodes by adding thick border to cached nodes in visualization - Change finalize nodes color from lavender (#E6E6FA) to plum (#DDA0DD) for better distinction from Sciline's cluster grouping color - Add cached_keys classification to track nodes at the dynamic boundary - Update legend to show both "Static" and "Static (cached)" entries - Add tests for cached_keys classification and styling Prompt: Consider changes w.r.t. `main`. There are two small things to fix/improve in `visualize`: 1. Currently all precomputed nodes are labelled as "Static (cached)", even those that are just dependencies of cached nodes. We do want to show these nodes but the label is misleading. I am not sure if we should color them differently, or add a frame for the actual cached nodes? 2. The color for the part of the graph running after "finalize" is not clear/obvious enough. It is also too similar to the color Sciline uses for grouping generic nodes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add parameter to hide ancestors of cached nodes for a simplified graph view. When show_static_dependencies=False, the visualization prunes the static dependency chain and only shows cached nodes at the boundary. The legend is also updated to conditionally show the "Static" entry only when static dependencies are displayed. Prompt: Can you add an option to not display the static (not cached) parts of the graph? Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Summary
StreamProcessor.visualize()method that post-processes sciline's visualization to highlight streaming-specific node classificationsExamples
Default (fall graph):
With

show_static_dependencies=False: