Repository navigation
Clear the four main CI reds blocking every open PR - #8506
Conversation
Backend CI has been red on main since the pre-quant allowlist landed. 19 tests in studio/backend/tests/test_diffusion_prequant.py fail with assert None is not None and one with "this torch cannot register the pre-quant constructor allowlist". The cause is not the allowlist. _register_prequant_safe_globals refuses unless _prequant_safe_globals resolves torch.torch_version.TorchVersion plus at least one real torchao class, by actual import. The Backend tests job installs torch 2.10.0+cpu and transformers and no torchao at all, so nothing resolves, every load refuses, and every assertion about the loader lands on the refusal instead. The tests also swap sys.modules["torch"] for a bare module while a load runs, so even torch.torch_version is unimportable at that moment, torchao or no torchao. The file's own header says these tests run "without CUDA, torchao, or a real diffusers model", so this restores what was intended rather than changing it. An autouse fixture stands in for the entries the host could NOT import and leaves the rest alone, so a host that has torchao still tests the real classes. Standing in everywhere would have hidden the thing the stand-in is standing in for, so two tests keep the real gate under test: test_the_registration_floor_needs_a_real_torchao asks the unpatched resolver and skips where there is no torchao to ask. AffineQuantizedTensor is already deprecated upstream (pytorch/ao#2752), so a release that retires it should fail here rather than pass on a fabricated class. test_the_registration_refuses_when_nothing_resolves pins the CI image's own situation: an install that cannot express the allowlist gets a raise and a dense fallback, never a torch.load with the restriction dropped. Verified both ways. With torchao installed: 83 passed. With torchao made unimportable by a ModuleNotFoundError-raising meta_path finder, which reproduces the CI failure exactly on this branch's parent (19 failed): 82 passed, 1 skipped.
…d away test_an_expired_positive_hit_refreshes_before_switching has failed on main since the mistyped-GGUF-id fix landed. It passes at that commit's parent and fails at the commit, in isolation as well as in a full run, so it is not a flake or an ordering effect. That fix made unsloth/ and -GGUF ids concrete references, which is the point of it: a wrong model name is refused instead of being answered by whatever happens to be loaded. This test's scenario is exactly that shape. The index holds a stale positive for unsloth/B-GGUF, the refresh proves it is gone, and the request names it anyway, so a 404 is now the correct outcome and the test's "the hook returns" expectation is the stale part. What the test is actually about is unchanged and still asserted: one rescan, then a re-resolve that does not rescan, no load attempted, and the resident model left alone. The refusal is asserted alongside those rather than the test being loosened to swallow it. The third resolve call now expected is the refusal wording asking what the resident model is; it passes allow_scan = False, which is why the rescan count is still one. Verified: tests/test_openai_auto_switch.py, tests/test_stt_sidecar.py and tests/test_diffusion_prequant.py together, 630 passed.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3eb2dbda93
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| pytest.importorskip("torchao") | ||
| resolved = {name for _obj, name in real_prequant_safe_globals()} | ||
| assert "torch.torch_version.TorchVersion" in resolved | ||
| assert [name for name in resolved if name.startswith("torchao.")], ( |
There was a problem hiding this comment.
Check required constructors for each supported scheme
When a torchao release removes one required constructor but retains another—for example, dropping AffineQuantizedTensor while keeping Float8Tensor—this assertion still passes because it only requires any torchao.* name. In that situation restricted_prequant_load_supported("int8") returns false and hosted int8 pre-quantization becomes unusable, although this test was added specifically to detect constructor retirement; compare the real resolved names against the required set for each scheme expected to work.
Useful? React with 👍 / 👎.
The sentence-transformers pinned-symbol matrix is red on main: FAILED test_st_models_re_exports[master] master: ST 5.4+ layout: class Normalize not found in any of ['sentence_transformers/sentence_transformer/modules/normalize.py', 'sentence_transformers/sentence_transformer/Normalize.py'] Upstream moved it to sentence_transformers/base/modules/normalize.py, which is where the reorg has been heading: Transformer in the same table already lists its base/modules path first. Checked per ref rather than assumed. On master, base/modules/normalize.py has the class and sentence_transformer/modules/normalize.py is gone; on v5.6.0 and v5.4.1 it is the other way round. Both spellings therefore stay listed, and every tag in ST_TAGS resolves. Pooling is left alone. It has not moved, and listing a path that does not exist anywhere would weaken the check rather than future-proof it. Verified: 40 passed.
|
Third red added: the sentence-transformers pinned-symbol matrix. Upstream moved it to One more repo-wide red is NOT in this PR because it lives in the other repository: Still unexamined, and also failing on other open PRs rather than being caused by them: |
|
Full
Tests failing only on this branch: none. Failing only on the merge base: 18, and they are exactly the ones this PR is about -- 17 in The remaining 72 are identical on both sides and are this host missing dependencies the CI image has (24 in One thing the diff surfaced that the isolated runs did not. This host HAS torchao, so
|
Repo tests (CPU) is red on main and on every open PR: 4 failed, 6084 passed. Reproduced locally on the merge base, same four. All four are source-string contracts that a refactor moved out from under, and in each case the behaviour they exist to protect is intact -- checked by reading the new code, not assumed. settleLostGeneration: the proof that a lost POST reached the backend was an inline knownIds set with !knownIds.has(image.id). It is now a baseline handed to hasUnknownRecord in lib/gallery-flags.ts. Same proof through a named helper, so the assertion follows it and also pins that the helper exists. The GGUF footprint dedupe: effectiveRecommended went from a single quant to a SET of them, so "is this the recommended one" is membership rather than equality. The contract is unchanged -- the recommended quant represents its own group when it has one -- and both halves are asserted in the new spelling. The stale negated half is dropped rather than reworded, because !effectiveRecommended.has(current.quant) already says it. The provider backfill: a literal Promise.allSettled(backfillTasks) became settleTasksIfCurrent(backfillTasks, isCurrent) in features/credentials/reconciliation.ts, which allSettles them AND drops the result when the auth session has moved on. The assertion follows the call and then checks the helper still allSettles, so "one failing task must not sink the rest" is still under test rather than taken on the function's name. test_chat_page_hydrates_connections_on_startup is renamed to test_connections_are_hydrated_on_startup. The sync moved out of chat-page.tsx into features/credentials/bootstrap.ts, which the ROOT route calls -- a wider guarantee, not a narrower one, since connections now hydrate on any entry into the app rather than only on the chat page. Asserting the old location would fail on a change that improved the thing being asserted. Both halves are pinned: the bootstrap wires the sync, and something actually runs the bootstrap. 189 passed.
|
Fourth red added: All four are source-string contracts that a refactor moved out from under, and in each case the behaviour they protect is intact -- checked by reading the new code rather than assumed.
The last one is renamed rather than repointed. The backfill one keeps its teeth the same way: the assertion follows the call, then checks 189 passed. Two of the reds I listed earlier are still unexamined: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5dc526c3b0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| assert "settleTasksIfCurrent(backfillTasks" in source | ||
| helper = (FRONTEND / "features/credentials/reconciliation.ts").read_text(encoding = "utf-8") | ||
| assert "export async function settleTasksIfCurrent" in helper | ||
| assert "allSettled" in helper, "the batch must still settle rather than reject on the first failure" |
There was a problem hiding this comment.
Scope the allSettled check to the backfill helper
This assertion searches all of reconciliation.ts, which also contains an unrelated Promise.allSettled inside runCredentialBootstrap. If settleTasksIfCurrent regresses to Promise.all and starts abandoning later provider backfills after one rejection, this contract still passes because of that second occurrence. Extract the settleTasksIfCurrent body before checking for allSettled so the stated per-backfill failure isolation remains covered.
Useful? React with 👍 / 👎.
| # to hasUnknownRecord in lib/gallery-flags.ts. Same proof, named helper, so | ||
| # the assertion follows it rather than pinning the old spelling. | ||
| assert "hasUnknownRecord(" in fn | ||
| assert "baseline" in fn |
There was a problem hiding this comment.
Keep checking that the gallery baseline precedes the POST
The replacement assertions only verify that settleLostGeneration receives something named baseline; they no longer inspect the caller that creates it. If a later refactor builds newRecordProbeBaseline after generateImage rejects, this test stays green even though records observed during the request can enter the baseline and a completed generation may be reported as never reaching the server. Preserve an ordering assertion that the baseline snapshot is created before the POST.
Useful? React with 👍 / 👎.
| assert "effectiveRecommended.has(variant.quant)" in group | ||
| assert "!effectiveRecommended.has(current.quant)" in group |
There was a problem hiding this comment.
Index footprint recommendations by dependency group
These replacement assertions bless membership in the flattened effectiveRecommended set, but that set loses the dependency-group association this contract is meant to protect. When group A recommends Q4 and group B recommends Q8, a Q4 current row in group B is treated as already recommended because Q4 appears in group A, so group B never replaces it with its own Q8 representative and its footprint request is made for the wrong variant. The condition and contract should consult effectiveRecommendedByGroup.get(key) rather than global quant membership.
Useful? React with 👍 / 👎.
| # lists its base/modules path first. Released 5.4 through 5.6 still keep | ||
| # it under sentence_transformer/modules, so both spellings stay listed | ||
| # and every tag in ST_TAGS resolves. | ||
| "sentence_transformers/base/modules/normalize.py", |
There was a problem hiding this comment.
Verify Normalize remains exported from the models namespace
Adding the new internal file path only proves that a Normalize class exists somewhere on sentence-transformers master, while Unsloth actually executes from sentence_transformers.models import ... Normalize in unsloth/models/sentence_transformer.py. The separate check merely finds any setup_deprecated_module_imports call, which may configure unrelated compatibility aliases and does not prove that the moved class is exposed through sentence_transformers.models; if upstream moves the class without updating that alias, this test now passes while Unsloth raises ImportError. Inspect the shim's mapping for Normalize or otherwise verify the public re-export rather than accepting the internal definition alone.
Useful? React with 👍 / 👎.
…ai#8554) * Studio: finish the backend CI cleanup unslothai#8506 started unslothai#8506 fixed the pre-quant allowlist tests but left test_diffusion_convrot.py on the same footing, and set the STT cancel timeout aside as a flake. Both are addressed here. The allowlist stand-in moves to conftest so the two files that load through the same registration share it instead of one carrying a private copy. The STT cancel path collected twice in a row while holding the model lock that wait_for_load_to_settle waits on. A long-lived backend reaches millions of tracked objects, where one pass costs about a second, so the join(timeout = 2) sat on a cliff. The release already collects and nothing becomes garbage after it, so the second call keeps its cache sweep and skips the collection. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Three conflicts, all of them main and this branch repairing the same contract drift independently. tests/studio/test_remote_connection_models_contract.py, both hunks: main (#8506) already followed the sync backfill to settleTasksIfCurrent and renamed the hydration test, so the branch's version of that work is redundant. Kept main's naming, docstring and the robust "allSettled" in helper check, and folded in the one thing the branch had that main did not: the assertions match CALL sites rather than bare names. "bootstrapPersistedCredentials" alone is satisfied by the import on line 23 of __root.tsx, so main's assertion passes on a root that imports the bootstrap and never runs it; "bootstrapPersistedCredentials()" pins the call on line 108, and "<CredentialBootstrapGate>" pins that the gate wrapping it is actually rendered. Same for the bootstrap's own call, "syncExternalProvidersFromBackend(providers". tests/studio/test_model_picker_contracts.py, the lost-generate-POST test: main followed the proof into hasUnknownRecord loosely ("baseline" in fn, the export exists); this branch pinned the data flow instead -- the baseline is built BEFORE the POST and the probe refuses to judge an inconclusive listing. Those are different guarantees, so both are kept; the branch's local name for the helper file was dropped in favour of main's. tests/studio/test_model_picker_contracts.py, the footprint-group test: main tracked the source through effectiveRecommended becoming a Set and asserted membership in it. That set is flattened across dependency groups, which is the bug this branch fixes in pickers.tsx, so main's assertions describe the behaviour being removed. Took the branch's keyed-lookup assertions. One resolution beyond the marked conflicts: main moved the row badge off the flattened effectiveRecommended set (effectiveRecommendedByGroup.get (group.key) === v.quant) and this branch moves the footprint representative off it, so after the merge the memo has no readers left. Deleted it, along with the comment that named the footprint representative as its reason for existing. biome runs correctness rules with "all": true, so leaving it would fail lint.
Backend CI has been red on
mainall day. Every completed run since 16:04 UTC has failed, so every open PR is blocked on reds it did not cause. Two independent causes, one commit each.The pre-quant allowlist tests need a torchao the CI image does not have
19 tests in
studio/backend/tests/test_diffusion_prequant.pyfail onassert None is not None, and one onthis torch cannot register the pre-quant constructor allowlist.The allowlist itself is fine.
_register_prequant_safe_globalsrefuses unless_prequant_safe_globalscan actually importtorch.torch_version.TorchVersionplus at least one realtorchaoclass. The Backend tests job installs torch 2.10.0+cpu and transformers and no torchao at all, so nothing resolves, every load refuses, and every assertion about the loader lands on the refusal instead. The tests also swapsys.modules["torch"]for a bare module while a load runs, so eventorch.torch_versionis unimportable at that moment, torchao or no torchao.The file's own header already says these tests run "without CUDA, torchao, or a real diffusers model", so this restores what was intended. An autouse fixture stands in for the entries the host could not import and leaves the rest alone, so a host that does have torchao still tests the real classes.
Standing in everywhere would hide the thing being stood in for, so two tests keep the real gate under test:
test_the_registration_floor_needs_a_real_torchaoasks the unpatched resolver and skips where there is no torchao to ask.AffineQuantizedTensoris already deprecated upstream (Migrating from AffineQuantizedTensor + Layouts to new structure of tensor subclasses pytorch/ao#2752), so a release that retires it should fail here rather than pass against a fabricated class.test_the_registration_refuses_when_nothing_resolvespins the CI image's own situation: an install that cannot express the allowlist gets a raise and a dense fallback, never atorch.loadwith the restriction dropped.One auto-switch test still expects the behaviour #8389 deliberately changed
test_an_expired_positive_hit_refreshes_before_switchingpasses at 77e29f4~1 and fails at 77e29f4, in isolation as well as in a full run.#8389 made
unsloth/and-GGUFids concrete references, which is the point of it: a wrong model name is refused rather than answered by whatever happens to be loaded. This test's scenario is exactly that shape. The index holds a stale positive forunsloth/B-GGUF, the refresh proves it is gone, the request names it anyway. A 404 is now correct and the test's "the hook returns" expectation is the stale part.What the test is about is unchanged and still asserted: one rescan, then a re-resolve that does not rescan, no load attempted, resident model left alone. The refusal is asserted alongside those rather than the test being loosened to swallow it. The third resolve call now expected is the refusal wording asking what the resident model is, and it passes
allow_scan = False, which is why the rescan count is still one.Verification
tests/test_diffusion_prequant.pywith torchao installed: 83 passed.ModuleNotFoundError-raisingmeta_pathfinder, which reproduces the CI failure exactly on the merge base (19 failed): 82 passed, 1 skipped.test_openai_auto_switch.py+test_stt_sidecar.py+test_diffusion_prequant.pytogether: 630 passed.studio/backend/testsrun in progress.test_stt_sidecar.py::test_pending_load_can_be_cancelled_without_waiting_for_model_lockalso failed in that CI run. It passes here both alone and in a full run, so I am treating it as a timing flake rather than touching it.