Repository navigation
Fix the four test failures currently red on main - #8254
danielhanchen wants to merge 2 commits into
Conversation
Vendoring truststore 0.10.4 (#8108) turned both floor guards red: its two typing.TypeAlias values are PEP 604 unions, which the future import does not defer, and its three platform modules pushed the studio union-debt ratchet from 35 to 38. Neither is fixable where it was flagged. The tree is checked in byte-identical to the wheel and hash-pinned by vendor/truststore_manifest.json, with ruff and the kwargs formatter configured to skip it so it keeps matching upstream, so converting those aliases breaks the invariant the vendor README defends. truststore is requires-python >=3.10 upstream, so it cannot run on our floor either way, and prebuilt_core.py already imports it inside try/except. Scope the scan to our own sources instead, alongside the existing __pycache__ and node_modules exclusions, and pin the reasoning with a test.
#8162 pinned the saved-recipe contracts against a tree where a declined explicit precision fell back silently, and #8165 landed the fail-closed refusal alongside it. Each was green on its own base, so main got a combination neither PR ran. Three fixes, all on the test side, since #8165 is the newer intent: - opt into UNSLOTH_DIFFUSION_ALLOW_PRECISION_FALLBACK where the contract is about what the recipe records after a fallback, matching how test_diffusion_routes.py and test_diffusion_backend.py were already adapted - assert the decline reason #8165 records rather than the old "GGUF transformer loaded" wording - give the _EngagedBackend stub the assert_precision_available gate the route now calls, and return a TEQuantOutcome rather than a bare None from the stubbed text-encoder pass, which the loader now reads .mode off
|
Closing as superseded. Both halves of this PR are now redundant against main, and the remaining delta is comment text only. The four Studio precision testsFixed by #8257, which took the same test-side approach this PR proposed and credited it. On current main ( Two notes from re-deriving the cause while working on #8257, in case it is useful later:
A test-side fix is the right call, and #8257 settled that explicitly rather than by default: The 3.9 floor guardFixed by #8252, which is merged; That fix keys the exemption on the guard rather than the path: it skips files under a package whose This PR's hunks for that file therefore conflict with main and would relax a rule that is deliberately stricter. What is leftDiffing every line this PR adds against main, the only content main does not already have is comment wording, for example |
Four tests fail on a clean checkout of main, independent of any PR, so every branch
cut from it inherits them. Two separate causes, both semantic merge conflicts where
each PR was green on its own base.
1. The 3.9 floor guards vs vendored truststore (#8108)
test_no_pep604_unions_are_evaluated_on_the_declared_floorandtest_studio_evaluated_unions_do_not_grow. Vendoring truststore 0.10.4 added twotyping.TypeAliasvalues that are PEP 604 unions, whichfrom __future__ import annotationsdoes not defer, and three platform modules that pushed the studiounion-debt ratchet from 35 to 38.
Neither is fixable where it is flagged. The tree is checked in byte-identical to the
wheel and hash-pinned by
vendor/truststore_manifest.json, with ruff and the kwargsformatter configured to skip it so it keeps matching upstream, so converting those
aliases breaks the invariant the vendor README exists to defend. truststore is
requires-python >=3.10upstream, so it cannot run on our floor either way, andprebuilt_core.pyalready imports it insidetry/except.So the scan is scoped to our own sources, next to the existing
__pycache__andnode_modulesexclusions, with a test pinning the reasoning.2. The image precision contracts vs the refusal behaviour (#8162 vs #8165)
test_saved_image_metadata_precision_contract.pyx3 andtest_diffusion_backend.py::test_load_refines_component_placement_after_text_encoder_quantization.#8162 pinned the saved-recipe contracts against a tree where a declined explicit
precision fell back silently; #8165 landed the fail-closed refusal beside it. Both were
green on their own base and main got a combination neither ran.
Fixed on the test side, since #8165 is the newer intent:
UNSLOTH_DIFFUSION_ALLOW_PRECISION_FALLBACKwhere the contract is about whatthe recipe records once a fallback is allowed, matching how
test_diffusion_routes.pyand
test_diffusion_backend.pywere already adapted for Report the precision actually in use, and refuse an explicit one we cannot honor #8165wording. The substantive assertions are untouched: the resolved value is still
offfrom an
explicitsource, and generate() still must not echo the declined request_EngagedBackendstub theassert_precision_availablegate the route nowcalls, and return a
TEQuantOutcomerather than a bareNonefrom the stubbedtext-encoder pass, which the loader now reads
.modeoffVerification
Before: 4 tests red on a clean detached checkout of main. After:
tests/test_python39_compatibility.py5 passed,
tests/test_saved_image_metadata_precision_contract.py10 passed,tests/test_diffusion_backend.py226 passed. Ruff clean. No production code changed.