Skip to content

fix: deduplicate Windows Conda casing aliases - #519

Merged
Karthik Nadig (karthiknadig) merged 3 commits into
mainfrom
bug/issue-518
Aug 14, 2026
Merged

fix: deduplicate Windows Conda casing aliases#519
Karthik Nadig (karthiknadig) merged 3 commits into
mainfrom
bug/issue-518

Conversation

@karthiknadig

@karthiknadig Karthik Nadig (karthiknadig) commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary

  • preserve the canonical executable path on cache hits
  • keep caller-facing aliases valid in the current working context
  • invalidate stale in-memory entries when tracked executables disappear
  • deduplicate Windows Conda casing aliases while preserving on-disk spelling
  • version performance inventory semantics so the intentional v1-to-v2 deduplication transition is explicit and same-schema count mismatches remain blocking

Fixes #518
Related: microsoft/vscode-python-environments#1703

Validation

  • cargo test -p pet-conda --test environment_locations_test
  • cargo test --features ci-perf --test e2e_performance test_performance_summary --no-run
  • python -B -m unittest discover -s scripts/tests -p 'test_*.py' -v (47 passed)
  • ./scripts/rust-precommit.ps1
  • replayed the failed Windows snapshot against its exact base: legacy comparison fails at 8/1 vs 10/2; inventory schema v2 passes with all latency metrics within budget

Preserve authoritative Windows path casing when well-known and configured Conda aliases refer to the same installation. Add a regression covering lowercase environment aliases.\n\nFixes #518\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

Performance Report (Linux)

Result: ✅ Within regression budgets

Metric PR Baseline Delta Change Blocking budget Status
Server startup P50 1ms 1ms +0ms +0.0% >5ms and >100%
Server startup P95 1ms 1ms +0ms +0.0% >50ms and >200%
Full refresh P50 55ms 56ms -1ms -1.8% >25ms and >30%
Full refresh P95 58ms 60ms -2ms -3.3% >50ms and >50%
Time to first environment P50 12ms 14ms -2ms -14.3% >20ms and >100%
Time to first environment P95 17ms 21ms -4ms -19.0% >25ms and >100%
Cold refresh P50 140ms 150ms -10ms -6.7% >100ms and >50%
Workload PR Baseline
Environments 5 5
Managers 1 1

Inventory schema transition

  • Inventory schema transitioned from v1 to v2; exact count matching is skipped for this comparison.

A regression must exceed both the documented absolute and relative budget. Environment and manager inventories must match exactly within the same inventory schema.

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

Test Coverage Report (Linux)

Result: ✅ Within regression budget

Metric PR Baseline Delta
Lines 80.815% 80.809% +0.005pp
Functions 84.806% 84.806% +0.000pp

Allowed numerical tolerance: 0.01 percentage points.

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

Performance Report (macOS)

Result: ✅ Within regression budgets

Metric PR Baseline Delta Change Blocking budget Status
Server startup P50 100ms 105ms -5ms -4.8% >100ms and >50%
Server startup P95 681ms 746ms -65ms -8.7% >750ms and >100%
Full refresh P50 180ms 194ms -14ms -7.2% >100ms and >50%
Full refresh P95 217ms 211ms +6ms +2.8% >300ms and >100% 🔺
Time to first environment P50 122ms 126ms -4ms -3.2% >150ms and >50%
Time to first environment P95 142ms 171ms -29ms -17.0% >250ms and >100%
Cold refresh P50 397ms 383ms +14ms +3.7% >250ms and >50% 🔺
Workload PR Baseline
Environments 10 10
Managers 1 1

Inventory schema transition

  • Inventory schema transitioned from v1 to v2; exact count matching is skipped for this comparison.

A regression must exceed both the documented absolute and relative budget. Environment and manager inventories must match exactly within the same inventory schema.

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

Performance Report (Windows)

Result: ✅ Within regression budgets

Metric PR Baseline Delta Change Blocking budget Status
Server startup P50 9ms 8ms +1ms +12.5% >10ms and >50% 🔺
Server startup P95 12ms 12ms +0ms +0.0% >50ms and >100%
Full refresh P50 149ms 151ms -2ms -1.3% >150ms and >50%
Full refresh P95 160ms 159ms +1ms +0.6% >250ms and >100% 🔺
Time to first environment P50 23ms 20ms +3ms +15.0% >25ms and >50% 🔺
Time to first environment P95 40ms 29ms +11ms +37.9% >100ms and >100% 🔺
Cold refresh P50 149ms 153ms -4ms -2.6% >150ms and >50%
Workload PR Baseline
Environments 8 10
Managers 1 2

Inventory schema transition

  • Inventory schema transitioned from v1 to v2; exact count matching is skipped for this comparison.

A regression must exceed both the documented absolute and relative budget. Environment and manager inventories must match exactly within the same inventory schema.

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

Test Coverage Report (Windows)

Result: ✅ Within regression budget

Metric PR Baseline Delta
Lines 78.229% 78.207% +0.022pp
Functions 81.573% 81.533% +0.041pp

Allowed numerical tolerance: 0.01 percentage points.

Keep the casing assertion independent of CI temp-path short-name behavior.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@karthiknadig Karthik Nadig (karthiknadig) changed the title fix: deduplicate Windows Conda paths by disk casing fix: preserve canonical executable on cache hits Aug 13, 2026
Allow the one-time Windows Conda deduplication transition while keeping exact inventory matching for snapshots that share a schema.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@karthiknadig Karthik Nadig (karthiknadig) changed the title fix: preserve canonical executable on cache hits fix: deduplicate Windows Conda casing aliases Aug 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates PET’s snapshot/performance gating and Windows Conda discovery to support a deliberate “inventory schema” transition (v1 → v2) while eliminating duplicate Conda installs discovered under casing aliases on Windows.

Changes:

  • Add an inventory_schema_version field to performance snapshots and gate inventory count comparisons on matching schema versions (with explicit v1→v2 transition reporting).
  • Normalize and deduplicate Windows known Conda install locations after case normalization, preserving on-disk leaf casing.
  • Add regression tests for the inventory-schema transition logic and Windows Conda casing-alias deduplication; update docs accordingly.
Show a summary per file
File Description
scripts/tests/test_quality_snapshot.py Adds snapshot helper support + unit tests covering inventory schema transition behavior.
scripts/quality_snapshot.py Introduces inventory schema versioning, transition reporting, and conditional inventory count matching.
docs/QUALITY_SNAPSHOTS.md Documents the new inventory schema semantics and the one-time v1→v2 transition behavior.
crates/pet/tests/e2e_performance.rs Emits inventory_schema_version in the performance JSON output.
crates/pet-conda/tests/environment_locations_test.rs Adds a Windows-only regression test for casing-alias deduplication/preserved casing.
crates/pet-conda/src/environment_locations.rs Implements Windows leaf-casing restoration + post-normalization deduplication for known Conda install paths.
crates/pet-conda/Cargo.toml Adds tempfile for the new Windows-only test.
Cargo.lock Records the new tempfile dependency in the lockfile.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 7/8 changed files
  • Comments generated: 0
  • Review effort level: Lite

@karthiknadig
Karthik Nadig (karthiknadig) marked this pull request as ready for review August 14, 2026 22:25
@karthiknadig
Karthik Nadig (karthiknadig) merged commit 4b7a780 into main Aug 14, 2026
39 of 40 checks passed
@karthiknadig
Karthik Nadig (karthiknadig) deleted the bug/issue-518 branch August 14, 2026 22:49
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.

Deduplicate Windows Conda environments discovered with casing aliases

3 participants