fix(cache): resolve SEED_CACHE path relative to repo root in experime… - #13
Open
Adityakk9031 wants to merge 1 commit into
Open
fix(cache): resolve SEED_CACHE path relative to repo root in experime…#13Adityakk9031 wants to merge 1 commit into
Adityakk9031 wants to merge 1 commit into
Conversation
Author
|
@SilenNaihin have a look |
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.
Fixes #12
Summary
This PR fixes an incorrect path resolution bug in
lib/experiment_cache.pywhereSEED_CACHEattempted to load pre-computed seed results fromlib/cache/all.jsonrather than the repository root (cache/all.json).Issue Fixed
_REPO_DIR = Path(__file__).resolve().parentresolved tolib/.SEED_CACHE = _REPO_DIR / "cache" / "all.json"looked forlib/cache/all.json, which does not exist.SEED_CACHE.exists()evaluated toFalseon startup, causingExperimentCacheto ignore repo-committed baseline results and re-evaluate duplicate experiment diffs from scratch.Changes Made
Fixed Repo Root Path Resolution:
_REPO_DIRinlib/experiment_cache.pytoPath(__file__).resolve().parent.parent.SEED_CACHEnow correctly points to<repo_root>/cache/all.json.Cross-Platform
fcntlGuard:import fcntlso_flock_with_timeoutdegrades gracefully on non-Unix environments (e.g., Windows).File Changes
lib/experiment_cache.py: Updated_REPO_DIRto resolve to the parent repository root directory.How Was This Tested?
SEED_CACHEpath in Python interactive shell: