fix(mirror-scan): don't cache zero when scoring data unavailable#837
Open
YB0y wants to merge 1 commit intoentrius:testfrom
Open
fix(mirror-scan): don't cache zero when scoring data unavailable#837YB0y wants to merge 1 commit intoentrius:testfrom
YB0y wants to merge 1 commit intoentrius:testfrom
Conversation
…lable When the mirror returns MirrorPullRequestFilesResponse with scoring_data_stored=False, _resolve_solving_pr_score previously tokenized the (typically empty) file list and wrote a CachedSolvingPR(0, 0) into the per-cycle cross-miner cache. That poisons every later issue in the same round that references the same solving PR — they hit the cached zero, fail the MIN_TOKEN_SCORE_FOR_BASE_SCORE gate, and earn no discovery score even after mirror backfill completes. Treat scoring_data_stored=False as an availability signal (matching the existing MirrorRequestError branch and the sibling OSS scoring path): return None, increment cache_stats.fetch_failures, log enough context to identify repo/PR/issue, and leave the cache untouched so a later miner in the same cycle can retry. Closes entrius#836
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
Closes #836.
_resolve_solving_pr_scoreingittensor/validator/issue_discovery/mirror_scan.pypreviously treated a mirror file response withscoring_data_stored=Falsethe same as a real scored response: it tokenized the (typically empty) file list, computed(base_score=0, token_score=0), and wrote that result into the per-cycle cross-miner solving-PR cache.That cached zero is not a legitimate score —
scoring_data_stored=Falseis the mirror's explicit signal that file scoring data is unavailable (file ingestion / backfill pending). Caching it poisons every later issue in the same validator round that references the same solving PR: each one hits the cache, fails theMIN_TOKEN_SCORE_FOR_BASE_SCOREgate, and earns no discovery score even after mirror backfill completes.This also contradicted the cache contract documented at
mirror_scan.py:73-76, which says failed file lookups are not cached so later lookups can retry.Fix
After
client.get_pr_files(...)returns, check the response'sscoring_data_storedflag. When it'sFalse, treat the result the same way as the existingMirrorRequestErrorbranch: returnNone, incrementcache_stats.fetch_failures, log enough context to identify the repo / solving PR / issue, and leave the cache untouched.This is a narrow cache-correctness fix:
gittensor/validator/oss_contributions/mirror/scoring.py:128-131, which already skips PRs whose scoring data is not stored.Test plan
Two regression tests added to
TestCacheStatsintests/validator/issue_discovery/test_mirror_scan.py: