Repository navigation
Count a RECORD path claim before the row is filtered out - #8181
danielhanchen merged 2 commits into
Conversation
d09cfb1 to
3021266
Compare
|
Narrowed this onto current main and force-pushed to the branch (previous head was d09cfb1, still reachable from the PR's commit history if you want it back). #8179 landed the overlapping half about five minutes after you opened this, which is what put the branch in conflict. What is left here is the part that was only in your version: counting the ownership claim before the row is filtered, plus the two-owner regression test, which is a better shape than the single-distribution one I wrote. Two things I dropped. Keeping The Worth being explicit that this is now behavior-neutral on main: the added test passes with and without the reordering. It is an invariant rather than a fix. Good catch on the ordering either way, it was the real reason the check misfired. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! 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". |
Summary
Count a RECORD path claim before the row is filtered out of the scan, in both the CLI verifier and the sidecar scanner, and add a two-owner regression test.
Why
The
unsloth_zoo: tests/conftest.py is 8107 bytes, expected 11429failure had two halves. This PR carries the second one._shared_non_runtimedropped a row withcontinue, and thatcontinuesat aboveowners[key] += 1. So a filtered row never registered its claim on the path. When two distributions shipped the same top-leveltests/conftest.pyand only one of the rows was filtered, the survivor looked singly owned, andowners[key] == 1let its recorded size be compared against a file the other distribution had written. The size on disk was never a statement about the retained RECORD in the first place.#8179 fixed the reachable half by exempting the shared roots for every distribution rather than third parties only, which is what unblocks the reported installs. Filtering is now root-based and identical for every claimant, so two distributions claiming one path are always both filtered or both retained, and the tally can no longer go stale.
Scope
This changes no behavior on current main. Verified: the added test passes with and without the reordering. It is an invariant, not a fix. The ordering was load-bearing once and would be again the moment the exemption is narrowed by distribution, by path, or by anything else, so it is worth stating in code rather than leaving as a property that happens to hold.
Also corrects the
_shared_non_runtimedocstring, which claimed the row "stays out of the ownership tally" as though that were intended.Changes
unsloth_cli/_studio_deps.py: resolve the target and count the claim before the_shared_non_runtimefilter.studio/backend/utils/transformers_version.py: the same reordering in_sidecar_scan_impl.test_two_distributions_claiming_one_shared_path: two distributions claimtests/conftest.py, the second lands last and shorter, and neither the size drift nor the deletion is damage.Dropped from the original version of this PR
Keeping
scripts/checked for Unsloth-owned distributions, since unsloth_zoo 2026.5.2 through 2026.8.5 shipped four files under a top-levelscripts/:Retaining those rows leaves the einx failure shape live for our own wheel: the ownership tally only gates the size comparison, while the missing-file branch reports regardless of how many distributions claim the path. Nothing under
unsloth/,unsloth_cli/orstudio/imports a top-levelscriptsat runtime, and unsloth's own wheel never shipped one, so there is nothing there to guarantee.The rest of the original diff is in #8179.
How to test
330 passed. Full
unsloth_cli/tests: 943 passed, 4 skipped.