longcat: tests that still described the old rules

Three left over from earlier fixes in this work:

- the frame tests asserted 93 was a valid TRAINING length. SimpleTuner's rule
  is 8n+1, not generation's 4n+1, and it rounds down silently — which is why
  frame_problems() rejects 93 and says a good clip can still be a bad sample.
  Reversed: the valid cases are 8n+1 now, and 93 has its own case asserting
  the message explains itself.
- the trainer stopped dumping "Last output" when it started picking the error
  lines out of a bounded tail; the test still looked for the old wording.
- the vendoring test counted the __pycache__ the container writes into the
  bind-mounted copy as "vendored non-source files". Generated, not vendored.
Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185zEBiy3KWB37xNGSrxL7w
parent 999efe6c
......@@ -126,27 +126,35 @@ def test_the_default_precision_is_quantised():
# ---------------------------------------------------------------- the constraints
@pytest.mark.parametrize("frames", [93, 89, 85, 5, 1])
@pytest.mark.parametrize("frames", [89, 97, 105, 9, 1])
def test_valid_frame_counts_pass(frames):
"""(num_frames - 1) must be divisible by 4 — the VAE's rule, the same 4n+1 coderai
already applies to Wan."""
"""(num_frames - 1) must be divisible by 8. SimpleTuner's rule is stricter than
generation's 4n+1 and it rounds down silently, so a clip length that is only
4n+1 has to be refused here with the reason."""
assert T.frame_problems(frames, "480x832") == []
@pytest.mark.parametrize("frames", [90, 92, 0, 2])
@pytest.mark.parametrize("frames", [93, 85, 90, 92, 0, 2])
def test_invalid_frame_counts_are_caught_before_the_run(frames):
probs = T.frame_problems(frames, "480x832")
assert probs and "4n+1" in probs[0]
assert probs and "8n+1" in probs[0]
def test_a_valid_clip_length_can_still_be_an_invalid_training_length():
"""93 frames is what the generator produces and what the datasets hold; saying
only "invalid" about it sends you looking in the wrong place."""
probs = T.frame_problems(93, "480x832")
assert probs and "4n+1" in probs[0], "say why a good clip is a bad sample"
def test_sides_must_clear_the_vae_stride():
assert T.frame_problems(93, "481x832")
assert T.frame_problems(93, "480x833")
assert T.frame_problems(93, "720x1280") == []
assert T.frame_problems(89, "481x832")
assert T.frame_problems(89, "480x833")
assert T.frame_problems(89, "720x1280") == []
def test_a_malformed_resolution_is_reported():
assert T.frame_problems(93, "big")
assert T.frame_problems(89, "big")
# ---------------------------------------------------------------- the venv
......@@ -219,7 +227,11 @@ def test_the_trainer_reports_the_adapter_it_wrote():
def test_a_nonzero_exit_is_a_failure_with_the_tail():
src = (ROOT / "tools/longcat_train.py").read_text()
assert "SimpleTuner exited" in src and "Last output" in src
assert "SimpleTuner exited" in src
# the tail is kept bounded, and the error lines are picked out of it so the
# message says what went wrong instead of ending on a progress bar
assert "del tail[:-25]" in src
assert "_signal" in src
def test_the_int8_loader_is_imported_from_the_right_module():
......
......@@ -44,7 +44,8 @@ def test_the_provenance_pins_a_commit():
def test_nothing_compiled_or_heavy_was_vendored():
"""Source only: no weights, no wheels, no .so — it must stay reviewable and
small enough to live in the repo."""
files = [p for p in (VENDOR / "longcat_video").rglob("*") if p.is_file()]
files = [p for p in (VENDOR / "longcat_video").rglob("*")
if p.is_file() and "__pycache__" not in p.parts]
assert files, "nothing vendored"
non_py = [p for p in files if p.suffix != ".py"]
assert not non_py, f"non-source files vendored: {non_py[:5]}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment