Repository navigation
Studio tests: pin the torch probe invalidation contract to both installers - #8795
Merged
Merged
Conversation
…llers #8779 made pip_install_try() drop the memoized torch classification, because it installs the Windows AMD ROCm trio and a memo it does not clear can answer for the build it just replaced. That fix shipped with no test: only pip_install() was covered, so reverting the pip_install_try() line kept the suite green. Three tests, each of which fails with that line removed: - pip_install_try() drops the memo, mirroring the pip_install() case - a real reinstall is really reclassified: two real torch packages on disk and a real probe subprocess either side of a real call into each installer, so the answer that replaces the memo is shown to come from the venv as it is now rather than from the mock that dropped it - every function that builds a pip or uv install command invalidates. Read out of the module with ast rather than listed here, so a third installer helper cannot be added without either invalidating or failing this test No production change.
Folds in the one test #8796 had that this branch did not. The other two there duplicate what is already here, so #8796 closes in favour of this. _select_torchao_spec reads _probe_installed_torch_version() between the two repair points, which makes it the consumer that would actually read a memo left over from before a reinstall, and pin torchao against the torch that was just replaced. The existing cases assert on _probe_torch_runtime directly; this one goes through the accessor that the torchao path really calls. Fails with the _invalidate_torch_runtime_probe() line removed from pip_install_try, along with the three siblings, and passes with it.
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This was referenced Aug 14, 2026
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
#8779 made
pip_install_try()drop the memoized torch classification alongsidepip_install(). It has to: it is what puts the Windows AMD ROCm trio on disk, so a memo it does not clear can answer for the build it just replaced.That fix shipped without a test. Deleting the
_invalidate_torch_runtime_probe()line frompip_install_try()leaves the whole suite green, which is the wrong state for a one-line invariant that nothing else enforces.What this adds
Three tests, each of which fails with that line removed and passes with it:
test_pip_install_try_invalidates_the_cache, the mirror of thepip_installcase that already existedtest_a_real_reinstall_is_really_reclassified, parametrised over both installers. Two realtorchpackages on disk, a real probe subprocess either side of a real call into the installer. The mocked version proves the memo was dropped; this proves the answer that replaces it comes from the venv as it is now. It also pins the half that must NOT change: while nothing has installed anything, swapping the package onPYTHONPATHdoes not move the answer.test_every_installer_entry_point_invalidates, which reads the installer entry points out of the module withast(the functions that call_build_pip_cmd/_build_uv_cmd) rather than listing them here. A third one cannot be added without either invalidating or failing this test, and the assertion says why.Why the ast one is worth having
The memoization rests on "
pip_installandpip_install_tryare the only things here that change what is installed". That is true today and is not self-enforcing. Enumerating the entry points from the module means the test notices a new one instead of quietly not covering it.Tests
tests/studio/install/andtests/python/test_install_python_stack.py: 2606 passed. The threetest_managed_node_runtime.pyfailures reproduce onmainin this environment (they assume a particularUNSLOTH_STUDIO_HOMElayout).No production change in this PR.