Skip to content

Concurrent pantsd: Wrap Entry state in an EntryStorage abstraction - #23589

Open
tobni wants to merge 1 commit into
pantsbuild:mainfrom
tobni:graph/entry-storage-indirection
Open

Concurrent pantsd: Wrap Entry state in an EntryStorage abstraction#23589
tobni wants to merge 1 commit into
pantsbuild:mainfrom
tobni:graph/entry-storage-indirection

Conversation

@tobni

@tobni tobni commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Wraps Entry state in an EntryStorage indirection and allocates RunTokens from a per-Entry counter.

#7654 stalled on differing options. Avoiding options in node identities was blocked on #11269, which closed unimplemented after the pivot to call-by-name.

The alternative I propose is to make the graph run-aware. This is already possible at runtime since uncacheable results carry their producing run. This approach needs an Entry to hold more than one state, keyed by RunId when needed.

The proposed change is to make access no longer assumed to reach the single state, and RunTokens stay unique across states rather than being derived from the one being replaced.

This change is currently a pure refactor.

@tobni
tobni requested review from benjyw and tdyas July 30, 2026 10:39
@tobni tobni added category:internal CI, fixes for not-yet-released features, etc. release-notes:not-required [CI] PR doesn't require mention in release notes labels Jul 30, 2026
@tobni
tobni force-pushed the graph/entry-storage-indirection branch from 95aa975 to 2244ccb Compare July 30, 2026 10:45

impl<N: Node> EntryMutable<N> {
/// Returns the state for the given Run, if it exists.
fn state_for_run(&self, _run_id: RunId) -> Option<&EntryState<N>> {

@tobni tobni Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is an Option in anticipation of an EntryStorage::PerRun arm, where a Run can have no state. Adding the arm now would be dead code.

@tobni

tobni commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:internal CI, fixes for not-yet-released features, etc. release-notes:not-required [CI] PR doesn't require mention in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants