Skip to content

Studio tests: refresh the diffusion family freeze for FastWan and stop dunders spreading the decode-rewrap scan - #18815

Merged
danielhanchen merged 1 commit into
mainfrom
fix/diffusion-freeze-and-decode-rewrap
Nov 21, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/diffusion-freeze-and-decode-rewrap

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

(Python 3.13, diffusion) fails on main and on every PR based on it (for example #18806) with two failures:

test_diffusion_family_data_freeze.py::test_family_data_resolves_identically   AssertionError: tables
test_diffusion_vae_oom.py::test_every_decode_rewrap_site_restores_the_oom_scope  510 sites flagged, first ('diffusion.py', 'DiffusionBackend.__init__')

Both reproduce locally on main (d8ff4de6a1). Running both tests on each Studio inference commit since the last green main attributes them:

commit freeze decode rewrap
8d41610c50 (#18800) pass pass
d66aa77cee (#18779) fail pass
6f4c2a7bd9 (#18780) fail fail

Causes

Family data freeze (#18779). #18779 adds the dense FastWan students as trusted video repos. The frozen table was not regenerated, so the only difference is two new trusted_video_repos entries, fastvideo/fastwan2.1-t2v-1.3b-diffusers and fastvideo/fastwan2.2-ti2v-5b-fullattn-diffusers. The PR is right; the fixture is behind.

Decode-rewrap scan (#18780). The test seeds every function that assigns .decode, then marks any function that calls one of those by bare name as a rewrap helper too, to a fixpoint. #18780's opt-in draft decode is a context manager, TinyVaeDraftDecode, which swaps vae.decode in __enter__ and restores it in __exit__. That made __enter__ and __exit__ seeds, and a bare-name match on __exit__ / __enter__ reaches every function that drives any context manager by hand, so the fixpoint spread to 510 functions. The draft swap itself is scoped and restores the previous decode on exit, and its fallback calls the decode it replaced, so the OOM scope is intact. The PR is right; the scan's name matching is too loose for dunders.

Fix

Test-only:

  • tests/fixtures/diffusion_family_data_freeze.json: regenerated with UNSLOTH_FREEZE_UPDATE=1. The diff is exactly the two FastWan repos (2 lines added).
  • test_every_decode_rewrap_site_restores_the_oom_scope: dunder method names are not propagated by name. A dunder is reached through with or an object protocol, never by a call to that name, so matching it by name cannot identify a caller. Named helpers such as install_untiled_decode still propagate as before.

Verification

  • test_diffusion_family_data_freeze.py, test_diffusion_vae_oom.py, test_video_tiny_vae.py, test_video_tiny_vae_wiring.py: 134 passed, 5 skipped.
  • Sabotage: adding def _sabotage_leak(vae): install_untiled_decode(vae) to video.py fails the rewrap test with [('video.py', '_sabotage_leak')], so a real unguarded rewrap is still caught. Restored afterwards.
  • The freeze fails on main without the regenerated fixture, as on CI.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T23:07:31.124402Z fc95b2e Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: fc95b2e2a7

ℹ️ 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".

@danielhanchen
danielhanchen merged commit a61dcde into main Nov 21, 2026
@danielhanchen
danielhanchen deleted the fix/diffusion-freeze-and-decode-rewrap branch November 21, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant