refactor: split LeafExecutionPath into prefix/leaf types for type-level guarantees#168
Closed
branchseer wants to merge 1 commit intomainfrom
Closed
refactor: split LeafExecutionPath into prefix/leaf types for type-level guarantees#168branchseer wants to merge 1 commit intomainfrom
branchseer wants to merge 1 commit intomainfrom
Conversation
…el guarantees Introduce ExecutionPathPrefix for incremental path building during graph traversal and restructure LeafExecutionPath with separate ancestors/leaf fields, making empty paths unrepresentable. Key changes: - ExecutionPathPrefix: new type for building paths, tracks all_containing_graphs_single_node incrementally during construction - LeafExecutionPath: now struct with ancestors + leaf fields (always non-empty by construction), precomputed single-node-chain check - execute_expanded_graph: takes &ExecutionPathPrefix, uses type-appropriate to_leaf_path/extended methods instead of clone+push - Remove Index<&LeafExecutionPath> impl (unused in production) Reduces unreachable! assertions from 3 to 1 (the sole remaining one guards the ancestor-is-Expanded invariant in resolve_leaf_graph).
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.
Summary
ExecutionPathPrefixfor incremental path building during graph traversal, and restructureLeafExecutionPathwith separateancestors/leaffields — making empty paths unrepresentable at the type level.ExecutionPathPrefixprecomputesall_containing_graphs_single_nodeincrementally during construction, eliminating the need for a full graph re-traversal at query time.Index<&LeafExecutionPath> for ExecutionGraphimpl.Reduces
unreachable!assertions from 3 to 1 (the sole remaining one guards the ancestor-is-Expanded invariant inresolve_leaf_graph).Note
Stack: this PR is the base for #169.