Add regression tests for high-blast-radius schedulers and utilities#20
Draft
cursor[bot] wants to merge 1 commit into
Draft
Add regression tests for high-blast-radius schedulers and utilities#20cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Cover FlowMatchEulerDiscreteScheduler, HeliosScheduler, and LTXEulerAncestralRFScheduler contract behavior, DDIM/DDPM set_timesteps validation guards, state_dict LoRA conversion paths, and remote_utils encode/decode helpers. Co-authored-by: Simon Lynch <srlynch1@users.noreply.github.com>
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.
What does this PR do?
Adds targeted regression tests for production code paths that previously had weak or no direct unit test coverage. No production behavior changes.
Risky behavior now covered
set_timestepsguards (dynamic shifting, custom sigma/timestep mismatch), step contract,scale_noise, duplicate timestep indexing, and full denoising loop.set_timesteps(stage_index=...), UniPC corrector invocation on step 2, flow_prediction conversion, and dynamic shifting.num_inference_steps > num_train_timestepsvalidation (regression-prone comparison bug).Test files added/updated
tests/schedulers/test_scheduler_flow_match_euler_discrete.py(new)tests/schedulers/test_scheduler_helios.py(new)tests/schedulers/test_scheduler_ltx_euler_ancestral_rf.py(new)tests/schedulers/test_scheduler_ddim.py(2 tests added)tests/schedulers/test_scheduler_ddpm.py(2 tests added)tests/others/test_state_dict_utils.py(new)tests/others/test_remote_utils.py(new)Why these tests materially reduce regression risk
These components sit on critical inference paths with large blast radius but were only exercised indirectly through heavy pipeline tests. Direct scheduler contract tests catch step/sigma/timestep API regressions before they propagate across dozens of pipelines. Utility tests lock in LoRA key remapping and remote encode/decode wire format — both are easy to break silently and expensive to debug in integration.
Validation
All 49 targeted tests pass locally:
Before submitting
.ai/review-rules.md?