Repository navigation
Conversation
The stable-shim linters resolved and fetched individual blob OIDs when a historical diff needed objects missing from a partial clone. GitHub rejects that fetch shape without the promisor negotiation path, and resolving main through adapter-level network operations also exposed concurrent linters to ref and network races. Resolve the merge base strictly from the checkout's existing origin/main ref. For historical object access, first prove the high-level Git command works locally, then retry that same command with native promisor hydration enabled. Read historical files with ls-tree and cat-file so a genuinely absent path remains distinct from a Git or network failure. This keeps object-class decisions inside Git instead of adding another blob/tree special case or increasing timeouts. Test Plan: ``` python tools/test/test_stable_shim_utils.py python tools/test/test_stable_shim_version_linter.py python tools/test/test_generated_shims_version_linter.py spin quicklint ``` The partial-clone integration methods were exercised for blob:none, tree:0, concurrent hydration, and a full clone with an unreachable remote. The standard common_utils entry point is blocked in this checkout before test collection by duplicate GradBucket registration. spin quicklint found no issues in the changed files and remained nonzero on unrelated pre-existing Pyrefly errors. AI assistance disclosure: This change was authored with an AI assistant and requires human review before submission. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/191364
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit a239d1f with merge base 04b311a ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
The stable-shim linters resolved and fetched individual blob OIDs when a historical diff needed objects missing from a partial clone. GitHub rejects that fetch shape without the promisor negotiation path, and resolving main through adapter-level network operations also exposed concurrent linters to ref and network races. Resolve the merge base strictly from the checkout's existing origin/main ref. For historical object access, first prove the high-level Git command works locally, then retry that same command with native promisor hydration enabled. Read historical files with ls-tree and cat-file so a genuinely absent path remains distinct from a Git or network failure. This keeps object-class decisions inside Git instead of adding another blob/tree special case or increasing timeouts. Test Plan: ``` python tools/test/test_stable_shim_utils.py python tools/test/test_stable_shim_version_linter.py python tools/test/test_generated_shims_version_linter.py spin quicklint ``` The partial-clone integration methods were exercised for blob:none, tree:0, concurrent hydration, and a full clone with an unreachable remote. The standard common_utils entry point is blocked in this checkout before test collection by duplicate GradBucket registration. spin quicklint found no issues in the changed files and remained nonzero on unrelated pre-existing Pyrefly errors. AI assistance disclosure: This change was authored with an AI assistant and requires human review before submission. [ghstack-poisoned]
janeyx99
marked this pull request as ready for review
July 28, 2026 21:18
albanD
approved these changes
Jul 28, 2026
| raise RuntimeError( | ||
| f"Git command failed first attempt with no lazy fetching: {local_error}. " | ||
| f"Second, slower, attempt while allowing fetching over the network also " | ||
| "failed, even with retries: {e}" |
We've tried a lot of partial fixes to this partial clone problem, which then caused more holes that required patching. The latest was: #191228 which attempted to enforce certain git commands be local only. This was too strict, where the historical versions of files would error (see https://github.com/pytorch/pytorch/actions/runs/30380274127/job/90346227990). Codex and I tried to solve this problem once and for all with a small redesign. We have separated out the git commands that should require network, and the ones that should not: Must remain offline: refs + commits, which we should trust our checkout. - merge_base_with_main() `GIT_NO_LAZY_FETCH=1 git merge-base HEAD refs/remotes/origin/main` - Working-tree diff: `GIT_NO_LAZY_FETCH=1 git diff HEAD -- <file>` - First attempt of every historical object command. May contact the network: actual file content. - Latter attempts of every historical object command, assuming the first local attempt failed: ``` git diff <merge-base>..HEAD -- <file> git ls-tree -z <revision> -- <path> git cat-file blob <oid> ``` Removed: - `git ls-remote`: trust the local main, do not refetch main. - Explicit `git fetch origin <object-oid>`: GitHub can reject this request if it's a blob vs a commit/branch. We replace this with cat-file. - Fetching or updating origin/main or any linter-managed ref updates: lint runs concurrently, don't step over each other's toes I'm relatively confident about the must remain offline, because our checkout for lint does the following: - setup-linux defaults to checkout-mode: treeless. - checkout-pytorch defaults to fetch-depth: 0, meaning full commit history. - origin/main is fetched by checkout. [ghstack-poisoned]
Collaborator
|
Starting merge as part of PR stack under #191266 |
pytorchmergebot
pushed a commit
that referenced
this pull request
Jul 29, 2026
Pull Request resolved: #191266 Approved by: https://github.com/zou3519, https://github.com/Skylion007 ghstack dependencies: #191364
MelindaTan
pushed a commit
to MelindaTan/pytorch
that referenced
this pull request
Jul 31, 2026
We've tried a lot of partial fixes to this partial clone problem, which then caused more holes that required patching. The latest was: pytorch#191228 which attempted to enforce certain git commands be local only. This was too strict, where the historical versions of files would error (see https://github.com/pytorch/pytorch/actions/runs/30380274127/job/90346227990). Codex and I tried to solve this problem once and for all with a small redesign. We have separated out the git commands that should require network, and the ones that should not: Must remain offline: refs + commits, which we should trust our checkout. - merge_base_with_main() `GIT_NO_LAZY_FETCH=1 git merge-base HEAD refs/remotes/origin/main` - Working-tree diff: `GIT_NO_LAZY_FETCH=1 git diff HEAD -- <file>` - First attempt of every historical object command. May contact the network: actual file content. - Latter attempts of every historical object command, assuming the first local attempt failed: ``` git diff <merge-base>..HEAD -- <file> git ls-tree -z <revision> -- <path> git cat-file blob <oid> ``` Removed: - `git ls-remote`: trust the local main, do not refetch main. - Explicit `git fetch origin <object-oid>`: GitHub can reject this request if it's a blob vs a commit/branch. We replace this with cat-file. - Fetching or updating origin/main or any linter-managed ref updates: lint runs concurrently, don't step over each other's toes I'm relatively confident about the must remain offline, because our checkout for lint does the following: - setup-linux defaults to checkout-mode: treeless. - checkout-pytorch defaults to fetch-depth: 0, meaning full commit history. - origin/main is fetched by checkout. Pull Request resolved: pytorch#191364 Approved by: https://github.com/albanD
MelindaTan
pushed a commit
to MelindaTan/pytorch
that referenced
this pull request
Jul 31, 2026
Pull Request resolved: pytorch#191266 Approved by: https://github.com/zou3519, https://github.com/Skylion007 ghstack dependencies: pytorch#191364
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.
Stack from ghstack (oldest at bottom):
We've tried a lot of partial fixes to this partial clone problem, which then caused more holes that required patching. The latest was: #191228 which attempted to enforce certain git commands be local only. This was too strict, where the historical versions of files would error (see https://github.com/pytorch/pytorch/actions/runs/30380274127/job/90346227990).
Codex and I tried to solve this problem once and for all with a small redesign. We have separated out the git commands that should require network, and the ones that should not:
Must remain offline: refs + commits, which we should trust our checkout.
GIT_NO_LAZY_FETCH=1 git merge-base HEAD refs/remotes/origin/mainGIT_NO_LAZY_FETCH=1 git diff HEAD -- <file>May contact the network: actual file content.
Removed:
git ls-remote: trust the local main, do not refetch main.git fetch origin <object-oid>: GitHub can reject this request if it's a blob vs a commit/branch. We replace this with cat-file.I'm relatively confident about the must remain offline, because our checkout for lint does the following: