perf: reuse Conda environment metadata across refreshes (Fixes #476) - #487
Merged
Conversation
Cache parsed Conda environment details by metadata fingerprints and share the cache with transient refresh locator graphs while rebuilding discovery outputs each refresh. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Karthik Nadig (karthiknadig)
marked this pull request as ready for review
July 24, 2026 21:15
Test Coverage Report (Linux)
Coverage unchanged. |
Performance Report (Linux) ➖
Legend
|
Performance Report (Windows) ➖
Legend
|
Performance Report (macOS)
Legend
|
Test Coverage Report (Windows)
Coverage increased! Great work! |
Copilot started reviewing on behalf of
Karthik Nadig (karthiknadig)
July 24, 2026 21:17
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements cross-refresh reuse of Conda environment metadata by introducing a shared, self-invalidating cache keyed on conda-meta fingerprints, and wires transient JSON-RPC refresh locator graphs to share that cache with the long-lived Conda locator (addressing #476).
Changes:
- Added an mtime/length-based fingerprint cache for parsed Conda environment details, shared across refreshes and pruned for removed prefixes.
- Updated refresh-locator construction to create refresh Conda locators from the shared cache owned by the long-lived server context locator.
- Documented the updated Conda locator refresh-state behavior and added a unit test covering cross-refresh reuse and history-based invalidation.
Show a summary per file
| File | Description |
|---|---|
| docs/LOCATOR_STATE.md | Updates the locator refresh-state contract notes for Conda to mention the shared environment-info cache. |
| crates/pet/src/jsonrpc.rs | Creates refresh locator graphs with a Conda locator that shares the long-lived locator’s environment-info cache. |
| crates/pet-conda/src/lib.rs | Implements the shared, fingerprint-invalidated Conda environment-info cache plus coverage validating reuse/invalidation. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Low
Comment on lines
+179
to
+183
| .read() | ||
| .expect("conda environment info cache lock poisoned") | ||
| .get(path) | ||
| .filter(|cached| &cached.fingerprint == fingerprint) | ||
| { |
Dmitriy Vasyura (dmitrivMS)
approved these changes
Jul 24, 2026
This was referenced Jul 25, 2026
This was referenced Aug 5, 2026
Karthik Nadig (karthiknadig)
added a commit
that referenced
this pull request
Aug 5, 2026
## Summary - add a PET-wide Rust coding skill alongside locator-specific guidance - capture path identity/cache, Unicode-safe parsing, hot-path I/O/allocation, and cross-platform rules - require tests to prove claimed read-count, cache-hit, and event-count invariants - wire the recurring checks into the Reviewer agent for every Rust change ## Review retrospective Recent feedback clustered around: - normalized cache keys and caller-facing path preservation (#487, #490) - Unicode-safe byte indexing and ASCII format handling (#493) - proving optimization scope and read counts (#493) - duplicate side effects and precise pattern semantics (#495) - workflow assignment/merge postconditions, already addressed in #486 Fixes #496 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
conda-metadirectory and history fingerprintsValidation
cargo test -p pet-condacargo test -p pet sync_refresh_locator_state.\scripts\rust-precommit.ps1Fixes #476