Skip to content

Add regression tests for LoRA utils, remote VAE, schedulers, and FirstBlockCache#18

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/regression-test-coverage-5e26
Draft

Add regression tests for LoRA utils, remote VAE, schedulers, and FirstBlockCache#18
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/regression-test-coverage-5e26

Conversation

@cursor

@cursor cursor Bot commented Jun 27, 2026

Copy link
Copy Markdown

What does this PR do?

Adds targeted regression tests for high-blast-radius code paths that lacked dedicated unit coverage.

Risky behavior now covered

  • LoRA state dict conversion (state_dict_utils) — key remapping for PEFT/Diffusers/legacy formats on every adapter load
  • Remote VAE helpers (remote_utils) — input validation, encode/decode payload shaping, and response postprocessing
  • FlowMatchEulerDiscreteScheduler — shared by SD3, Flux, Wan; timesteps, dynamic shifting guards, step API
  • HeliosScheduler — multi-stage sigma ranges and flow-prediction conversion
  • LTXEulerAncestralRFScheduler — LTX-Video RF ancestral step contract and duplicate-timestep handling
  • FirstBlockCache — threshold-based skip vs. full recompute logic (including tuple outputs)

Test files added/updated

  • tests/others/test_state_dict_utils.py
  • tests/others/test_remote_utils.py
  • tests/schedulers/test_scheduler_flow_match_euler_discrete.py
  • tests/schedulers/test_scheduler_helios.py
  • tests/schedulers/test_scheduler_ltx_euler_ancestral_rf.py
  • tests/hooks/test_first_block_cache.py

Why these tests materially reduce regression risk

Recent merges were mostly documentation, but the library still ships critical shared utilities and schedulers without direct unit tests. LoRA key conversion and remote VAE validation are on every load/encode path; scheduler math bugs silently corrupt generation; FirstBlockCache skip logic had mixin-level integration tests but no focused unit tests proving threshold behavior (unlike MagCache). These tests are deterministic, fast, and assert concrete numeric contracts.

Before submitting

  • Did you write any new necessary tests?

Validation

All 47 new tests pass locally:

python3 -m pytest tests/others/test_state_dict_utils.py tests/others/test_remote_utils.py \
  tests/hooks/test_first_block_cache.py tests/schedulers/test_scheduler_flow_match_euler_discrete.py \
  tests/schedulers/test_scheduler_helios.py tests/schedulers/test_scheduler_ltx_euler_ancestral_rf.py
Open in Web View Automation 

cursoragent and others added 2 commits June 27, 2026 02:02
…tBlockCache

Cover high-blast-radius paths that lacked dedicated unit tests:
- LoRA state dict key conversion (every adapter load)
- Remote VAE encode/decode validation and postprocessing
- FlowMatch, Helios, and LTX scheduler contracts
- FirstBlockCache skip/compute threshold logic

Co-authored-by: Simon Lynch <srlynch1@users.noreply.github.com>
Co-authored-by: Simon Lynch <srlynch1@users.noreply.github.com>
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