fix(cache): retry transient identity barrier churn#1778
Merged
mldangelo-oai merged 5 commits intoJul 22, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Improves the scan-results cache identity capture so transient “change-clock barrier” churn is retried via the existing bounded outer capture loop, avoiding premature failures while still failing closed for persistent churn.
Changes:
- Update
_capture_file_identityto retry (with a short backoff) when the identity barrier cannot be satisfied on a given capture attempt, instead of failing before outer retries run. - Add deterministic regressions for transient and persistent change-clock barrier behavior.
- Scope a cache-correctness test’s ancestor identity to the tmp tree to avoid unrelated ancestor churn, and add a changelog entry.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
modelaudit/cache/scan_results_cache.py |
Changes barrier-exhaustion behavior to continue outer capture retries (with backoff) and preserve fail-closed semantics after bounded attempts. |
tests/cache/test_cache_correctness.py |
Adds targeted tests for transient/persistent barrier churn and scopes ancestor identity in a parametrized cache-correctness test to reduce nondeterministic churn. |
CHANGELOG.md |
Notes the cache identity-barrier churn retry fix under Unreleased bug fixes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Performance BenchmarksCompared
|
…che-identity-barrier-20260722
Comment on lines
+370
to
+372
| barrier_attempts["count"] += 1 | ||
| newest_token = cache._newest_identity_change_token(file_change_token, ancestor_identity) | ||
| return newest_token + int(barrier_attempts["count"] > 3) |
| with pytest.raises(ValueError, match="File kept changing while capturing cache identity") as exc_info: | ||
| cache.capture_file_identity(str(file_path)) | ||
|
|
||
| assert barrier_attempts["count"] == 15 |
mldangelo-oai
deleted the
mdangelo/codex/fix-cache-identity-barrier-20260722
branch
July 22, 2026 16:39
Merged
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
Evidence
Nightly 29892590286 failed only
Correctness (ubuntu-latest, Python 3.13, Shard 1)attest_scan_cache_rejects_source_independent_marker_with_source_inputs[metadata_update5]with:The deterministic transient-barrier regression fails on the exact current main and passes with this change. Persistent churn still raises after the bounded 15 attempts.
Validation
PYTHONPATH=/private/tmp/modelaudit-cache-identity-barrier-20260722 PROMPTFOO_DISABLE_TELEMETRY=1 /Users/mdangelo/code/modelaudit/.venv/bin/python -m pytest -n 4 tests/cache/test_cache_correctness.py::test_capture_file_identity_retries_transient_change_clock_barrier tests/cache/test_cache_correctness.py::test_capture_file_identity_fails_closed_for_persistent_change_clock_barrier tests/cache/test_cache_correctness.py::test_capture_file_identity_retries_transient_monitor_start_change tests/cache/test_cache_correctness.py::test_capture_file_identity_advances_clock_before_hashing tests/cache/test_cache_correctness.py::test_scan_cache_rejects_source_independent_marker_with_source_inputs -q --tb=short --maxfail=1— 10 passedPYTHONPATH=/private/tmp/modelaudit-cache-identity-barrier-20260722 PROMPTFOO_DISABLE_TELEMETRY=1 /Users/mdangelo/code/modelaudit/.venv/bin/python -m pytest -n 4 tests/cache --ignore=tests/cache/test_cache_correctness.py -q --tb=short --maxfail=1— 22 passedgit diff --checkcleanThe full cache-correctness xdist run on this macOS environment still hits three pre-existing source-identity store assertions in unrelated tests; the exact Ubuntu CI lane is authoritative.