Skip to content

Convert Tracker structs to columnar#762

Merged
frankmcsherry merged 2 commits intoTimelyDataflow:masterfrom
frankmcsherry:columar_reachability
Mar 13, 2026
Merged

Convert Tracker structs to columnar#762
frankmcsherry merged 2 commits intoTimelyDataflow:masterfrom
frankmcsherry:columar_reachability

Conversation

@frankmcsherry
Copy link
Member

This PR is largely authored by Claude, as a way to convert the types in the reachability tracker to have columnar layouts, rather than deeply nested short vectors and allocations. The types are all dense integer indexed (nodes, ports), and standard columnar vector layouts work great here.

The win is that at runtime there is less memory to hop through to reach path summaries, among other things. There is a bonus benefit that large graphs will not take as long terminating; the deallocation has taken seconds on large benchmarks.

Copy link
Member

@antiguru antiguru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems alright, but I wonder if we could push it further to flatten even more. We already have to pay for an increase in complexity, so why stop here?

Comment on lines +374 to +379
/// Internal operator connectivity, columnar form of `Vec<Vec<PortConnectivity<T::Summary>>>`.
/// Indexed by `(node, input_port)` to yield `(output_port, summary)` pairs.
nodes: Vecs<Vecs<Vec<(usize, T::Summary)>>>,
/// Edge connectivity, columnar form of `Vec<Vec<Vec<Target>>>`.
/// Indexed by `(node, output_port)` to yield target slices.
edges: Vecs<Vecs<Vec<Target>>>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're flattening this .. what about flattening it further? Instead of nested vecs, have the usual index vec + flat vector, one for each level. I can imagine it'll get unwieldy for no benefit, but maybe worth exploring.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vecs is what you are thinking of! :D

Copy link
Member Author

@frankmcsherry frankmcsherry Mar 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could maybe be clearer as <Vec<Vec<PortConnectivity<T::Summary>>> as Columnar>::Container, but you can't quite get there yet (w/o T::Summary: Columnar>).

@frankmcsherry frankmcsherry merged commit 7350dac into TimelyDataflow:master Mar 13, 2026
8 checks passed
@frankmcsherry frankmcsherry deleted the columar_reachability branch March 13, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants