Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
test(rife): every test that pins the binary's calls pins them by model through as_pinned, rife-v4.6's exactly and rife-v4.25's at most, the larger of an Apple GPU's and llvmpipe's count; the slow cut tests that still held rife-v4.6's counts hold both models', and the release notes and docs/release.md say so
Soohong Kima2ba515e36ec
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 11f64e3..871f6c5 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -14,7 +14,7 @@ All notable public changes to `sprite-gen` are recorded here. Versions track the- **Changed: the torch backend runs rife-v4.25 (`rife_torch.NETS`, `rife_torch.Net`, `rife_torch.Head`, `rife_torch.layers`, `IFNet(name)`, `state_from_ncnn(files, name)`).** Practical-RIFE 4.25's IFNet, an encoder on each image and five blocks at scales 16 to 1, written again, its weights read from the release's `rife-v4.25` files (the published `flownet.pkl`, SHA-256 `6615790efd627772917205db291f51cd392528a157ecbb2ecaeec3bff8eb6de2`, as converted to float16), the betas held apart and the encoder's two copies checked equal. On the CPU it makes Practical-RIFE's own frame from those weights, byte for byte. No pkl mirror: the weights come from the same GitHub zip as the binary.- **Changed: reports and identities name the model.** `interpolator.model` in reports; the torch runner's and executor's identity carry `model`, so a frame kept for one model is never taken for the other, and a host whose executor answers with another model is refused as the RIFE is made.- **Licences: `NOTICE` gains TNTwise's rife-ncnn-vulkan (MIT, © 2020 nihui) and Practical-RIFE's 4.25 model (MIT, © 2021 hzwer).**-- **Tests: `tests/video/test_rife_models.py`, `tests/video/test_rife_cuts.py`, `tests/video/test_rife_torch_v425.py`, `tests/fixtures/rife-cuts`.** The default and the named model, their refusals and pins; the 128 padding (frames a multiple of 128, zeros outside) for rife-v4.25 and rife-v4.6 handed as before; cache keys apart by model; three public cuts (a knight's walk, Pip's run and jump, lossless WebP, their RGBA pinned) filled 24 → 60 fps by the binary (`real_rife`) and by the torch backend (`torch_rife`): the knight's walk at least 40 poses, Pip's run and jump within one of 39 and 67, Pip's jump the very frames PyTorch took, and every frame rife-v4.6's feet windows caught dragged 2 px caught for rife-v4.25 too; the rife-v4.25 IFNet's layer order, betas and refusals. `tests/video/test_held_fill.py` adds the unheld-bytes test above; Tests that pin the binary's calls pin them by model, rife-v4.25 refusing a frame more and making it again at another time: `tests/video/test_play.py` (once-return, 44 against 36), `tests/video/test_ghost_given_way.py` (10 against 8), `tests/video/test_ghost_screen.py` (28 against 20). `tests/video/test_loop_overlap.py`: rife-v4.25 drags the third walker's hand apart at weight 0.5 (refused as torn), and at 0.7 keeps it whole and reads under the bar (`TORN_AT`). Tests calibrated on rife-v4.6's augmentation name it.+- **Tests: `tests/video/test_rife_models.py`, `tests/video/test_rife_cuts.py`, `tests/video/test_rife_torch_v425.py`, `tests/fixtures/rife-cuts`.** The default and the named model, their refusals and pins; the 128 padding (frames a multiple of 128, zeros outside) for rife-v4.25 and rife-v4.6 handed as before; cache keys apart by model; three public cuts (a knight's walk, Pip's run and jump, lossless WebP, their RGBA pinned) filled 24 → 60 fps by the binary (`real_rife`) and by the torch backend (`torch_rife`): the knight's walk at least 40 poses, Pip's run and jump within one of 39 and 67, Pip's jump the very frames PyTorch took, and every frame rife-v4.6's feet windows caught dragged 2 px caught for rife-v4.25 too; the rife-v4.25 IFNet's layer order, betas and refusals. `tests/video/test_held_fill.py` adds the unheld-bytes test above; Tests that pin the binary's calls pin them by model through `as_pinned` in `tests/conftest.py` (0 calls where the binary is not found, the same as `rife_located()` false before): rife-v4.6 the count exactly, as before; rife-v4.25 at most the pin, the larger of the counts measured on an Apple GPU and on llvmpipe (the CPU Vulkan driver of the Linux lane), because it runs with no augmentation, in float16, so its frames differ with the GPU's arithmetic, and with them the frames refused and made again at another time (35 pinned cases were run on both machines: on one synthetic walk the binary was called 8 times on the Apple GPU and 10 times on llvmpipe, and on the other 34 cases the counts were the same; rife-v4.6's counts were the same on every machine measured); the purpose of the pin is unchanged, each call seconds on a CPU's Vulkan driver, so a change that asks for more calls fails on the count, not on the test's time limit. rife-v4.25 asks for more calls on some synthetic cuts and fewer on others, refusing a frame between held cells that shows a neighbour's picture again and making it at another time, or keeping the cells as filmed: `tests/video/test_play.py` (once-return, 44 against 36), `tests/video/test_ghost_given_way.py` (10 against 8), `tests/video/test_ghost_screen.py` (28 against 20), `tests/video/test_wrap_blend.py` (24 against 16), `tests/video/test_gait_fallback.py` (16 against 22 and 16 against 14), `tests/video/test_explicit_window.py` (20 against 6 and 16 against 22), `tests/video/test_walk_steps.py` (nine cases, from 2 against 6 to 30 against 12). `tests/video/test_loop_overlap.py`: rife-v4.25 drags the third walker's hand apart at weight 0.5 (refused as torn), and at 0.7 keeps it whole and reads under the bar (`TORN_AT`). Tests calibrated on rife-v4.6's augmentation name it.## v3.14.0 - A walk whose arms swing past its sides is witnessed where its middle rows read a body rising whole, one on a picture swaying once a cycle or slower held named, the body's word one line in both placesdiff --git a/docs/release.md b/docs/release.mdindex 99c1be2..3627529 100644--- a/docs/release.md+++ b/docs/release.md@@ -32,7 +32,7 @@ RIFE 가 닿는 곳이 하나도 없는 상태로 스위트 전체를 돌려 그시험(`pytest --full -m "real_rife and not torch_rife"`, 아래 torch 단계가 나머지)을 돌린다 — 하나라도 건너뛰거나, 표시된 시험이 없으면 실패다. 그래서 새실제-RIFE 시험은 표시만 붙이면 `--rife-only` 가 저절로 걷는다.-컷의 기본 채움(`--fill-held auto`)으로 바이너리에 닿고 CPU 의 Vulkan 드라이버에서 기본 120 s 제한을 넘길 만큼 자주 실행하는 시험은 `real_rife` 표시 여부와 관계없이 긴 바이너리 시험처럼 `@pytest.mark.timeout(900)` 과 바이너리 호출 수 주석을 달고 `tests/conftest.py` 의 `rife_runs` 로 요청하는 RIFE 실행 수를 고정한다(`rife_located()` 가 바이너리를 못 찾으면 0). 바이너리를 몇 번만 실행하고 기본 제한 안에서 여유 있게 끝나는 시험은 둘 다 두지 않는다. CPU 의 Vulkan 드라이버에서는 실행 하나에 몇 초씩 걸리므로, 실행을 더 요구하는 변경이 시간 초과가 아니라 호출 수에서 걸린다.+컷의 기본 채움(`--fill-held auto`)으로 바이너리에 닿고 CPU 의 Vulkan 드라이버에서 기본 120 s 제한을 넘길 만큼 자주 실행하는 시험은 `real_rife` 표시 여부와 관계없이 긴 바이너리 시험처럼 `@pytest.mark.timeout(900)` 과 바이너리 호출 수 주석을 달고 `tests/conftest.py` 의 `as_pinned` 로 요청하는 RIFE 실행 수를 모델별로 고정한다(바이너리를 못 찾으면 호출 수를 0 으로, 즉 호출이 없는 것으로 고정하며, 이는 이전에 `rife_located()` 가 거짓일 때와 같다). rife-v4.6 은 전처럼 정확한 수로 고정하고, rife-v4.25 는 고정값 이하로 고정하며, 그 고정값은 Apple GPU 와 llvmpipe(Linux 레인의 CPU Vulkan 드라이버)에서 잰 수 가운데 큰 쪽이다. rife-v4.25 를 이하로 두는 까닭은 증강 없이 float16 으로 실행하여 프레임이 GPU 의 연산에 따라 달라지고, 그에 따라 거부되어 다른 때에 다시 만드는 프레임도 달라지기 때문이다. 고정된 35 건을 두 기계에서 실행하여, 합성 걷기 하나에서 바이너리가 Apple GPU 에서는 8 번, llvmpipe 에서는 10 번 호출되었고, 나머지 34 건은 수가 같았으며, rife-v4.6 은 잰 모든 기계에서 수가 같았다. 바이너리를 몇 번만 실행하고 기본 제한 안에서 여유 있게 끝나는 시험은 둘 다 두지 않는다. 고정의 목적은 그대로다. CPU 의 Vulkan 드라이버에서는 실행 하나에 몇 초씩 걸리므로, 실행을 더 요구하는 변경이 시간 초과가 아니라 호출 수에서 걸린다.RIFE 의 torch 백엔드(`SPRITE_GEN_RIFE_BACKEND=torch`, docs/loop-repair.md 1절)를 돌리는 시험은`torch_rife` 표시를 단다(`pyproject.toml` 이 등록한다). `tests/conftest.py` 는 PyTorch 가 import 되지diff --git a/tests/conftest.py b/tests/conftest.pyindex 171d25b..5df0e10 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -249,6 +249,32 @@ def rife_runs(monkeypatch: pytest.MonkeyPatch) -> Callable[[], int]:return lambda: sum(r.calls for r in located)+# The models whose count of the binary's calls a test holds as a most, not exactly: rife-v4.25 runs with no augmentation,+# in float16, so its frames differ with the GPU's arithmetic (an Apple GPU and llvmpipe made different ones), and with them+# the frames refused and made again at another time. rife-v4.6's counts were the same on every machine measured.+RUNS_AT_MOST = frozenset({"rife-v4.25"})+++def as_pinned(called: int, pin: int | dict[str, int]) -> bool:+ """Whether `called`, the binary's calls a test made (`rife_runs()`, `Rife.calls`), keeps the test's pin for the model+ it ran (`rife.model_name()`; an int pins every model alike): none where the binary is not found here; else the pin+ exactly, or at most the pin for a model in `RUNS_AT_MOST`, where it is the most measured on an Apple GPU and on+ llvmpipe."""+ from sprite_gen.video import rife++ if not rife_located():+ return called == 0+ model = rife.model_name()+ most = pin if isinstance(pin, int) else pin[model]+ return called <= most if model in RUNS_AT_MOST else called == most+++def pin_id(value: object) -> str | None:+ """A parametrized pin by model named by its rife-v4.6 count, the count it pinned before there were two models, so a+ case keeps its id; anything else named as pytest names it."""+ return str(value["rife-v4.6"]) if isinstance(value, dict) else None++@pytest.fixture(autouse=True)def own_settings(tmp_path_factory: pytest.TempPathFactory, monkeypatch: pytest.MonkeyPatch) -> None:"""No test reads the saved preferences or the provider choices of the machine it runs on: what a call thatdiff --git a/tests/video/test_explicit_window.py b/tests/video/test_explicit_window.pyindex 1a83f9d..49bcc60 100644--- a/tests/video/test_explicit_window.py+++ b/tests/video/test_explicit_window.py@@ -14,7 +14,7 @@ from pathlib import Pathimport pytest-from conftest import rife_located+from conftest import as_pinnedfrom sprite_gen.video import loopfrom tests.video import test_gait_fallback as fallback_clipsfrom tests.video import test_loop_prop_seam_held as held_clips@@ -64,10 +64,12 @@ ROWS = [and r["cycle"]["seam_pop"]["held_edge"]["two_step_capped"] == {"max_len": 47, "lengths_over": [48, 49]}, True, 0),("two-step", _held, ("--state", "walk", *MOTION, "--min-len", "20"), lambda r: r["cycle"]["seam_pop"]["applied"], True, 0),("counted", _short, ("--state", "walk", *MOTION, "--max-len", "42", "--steps", "1"),- lambda r: r["cycle"]["steps"]["window"] == [41, 42] and r["cycle"]["steps"]["counted_window"] == [41, 43], True, 6),+ lambda r: r["cycle"]["steps"]["window"] == [41, 42] and r["cycle"]["steps"]["counted_window"] == [41, 43], True,+ {"rife-v4.25": 20, "rife-v4.6": 6}),("counted", _slow, ("--state", "walk", *MOTION, "--min-len", "18", "--steps", "1"), lambda r: r["cycle"]["steps"]["by"] == "given", True, 6),("fallback", _slow_front, ("--state", "walk", *MOTION, "--max-len", "36"), lambda r: r["gait_fallback"]["window"] == [12, 36], False, 0),- ("fallback", _slow_front, ("--state", "walk", *MOTION, "--min-len", "30"), lambda r: r["gait_fallback"]["window"][0] == 30, True, 22),+ ("fallback", _slow_front, ("--state", "walk", *MOTION, "--min-len", "30"), lambda r: r["gait_fallback"]["window"][0] == 30, True,+ {"rife-v4.25": 16, "rife-v4.6": 22}),("one-shot", _hop, ("--state", "jump", "--max-len", "30"), lambda r: r["periodic_attempt"] is not None and r["cycle"]["kind"] == "one-shot", True, 0),("one-shot", _hop, ("--state", "jump", "--min-len", "30"), lambda r: r["periodic_attempt"] is not None and r["cycle"]["kind"] == "one-shot", True, 0),("fixed", _hop, ("--state", "jump", "--cycle", "fixed", "--start", "50", "--length", "40", "--max-len", "30"),@@ -91,7 +93,7 @@ def test_an_explicit_window_holds_on_every_path(tmp_path, path, clip, args, ran,code = exc.codereport = json.loads(report_path.read_text())assert ran(report), report.get("cycle")- assert rife_runs() == (runs if rife_located() else 0)+ assert as_pinned(rife_runs(), runs), rife_runs()lo, hi = _bound(args, "--min-len"), _bound(args, "--max-len")if not cut:assert code != 0 and report["status"] == "failed", report.get("cycle")diff --git a/tests/video/test_gait_fallback.py b/tests/video/test_gait_fallback.pyindex 8c2e4c9..ef9a33e 100644--- a/tests/video/test_gait_fallback.py+++ b/tests/video/test_gait_fallback.py@@ -6,7 +6,7 @@ import mathimport numpy as npimport pytestfrom PIL import Image, ImageDraw-from conftest import rife_located+from conftest import as_pinnedfrom sprite_gen.video import gait_fallback, loopfrom tests.video import test_ghost_given_way as ghost_clipsfrom tests.video import test_stop as stop_clips@@ -161,12 +161,12 @@ def test_a_clip_the_first_search_cuts_is_cut_without_the_fallback(tmp_path):@pytest.mark.slow[email protected](900) # 22 calls of the binary at 280 x 180 (the held fill's frames between): seconds on a GPU, minutes on a CPU's Vulkan driver[email protected](900) # 16 to 22 calls of the binary at 280 x 180 (the held fill's frames between): seconds on a GPU, minutes on a CPU's Vulkan driverdef test_a_cycle_longer_than_half_the_clip_is_found_by_the_fallback(tmp_path, rife_runs):frames = [walker(k, period=40) for k in range(73)]code, report, output = run(tmp_path, frames)assert code == 0- assert rife_runs() == (22 if rife_located() else 0)+ assert as_pinned(rife_runs(), {"rife-v4.25": 16, "rife-v4.6": 22}), rife_runs()assert abs(report['cycle']['length']-40) <= 1fallback = report['gait_fallback']assert 'no periodic cycle found' in fallback['reason']@@ -371,7 +371,7 @@ def wrap_and_inner(output):@pytest.mark.slow[email protected](900) # 14 calls of the binary at 280 x 180 for the 2 % walk (the held fill's frames between): seconds on a GPU, minutes on a CPU's Vulkan driver[email protected](900) # 14 to 16 calls of the binary at 280 x 180 for the 2 % walk (the held fill's frames between): seconds on a GPU, minutes on a CPU's Vulkan driver@pytest.mark.parametrize('clip', ['walking away', 'shrinking 2 %'])def test_a_walk_cut_again_by_hand_is_held_at_its_size_and_its_feet(tmp_path, clip, rife_runs):"""A cut the caller names (`--cycle fixed`, the recut path) of a walk that changes size: held over the whole clip@@ -381,7 +381,7 @@ def test_a_walk_cut_again_by_hand_is_held_at_its_size_and_its_feet(tmp_path, cli(1 inside) and was refused at 6.83, the 2 % walk 1 px (1) at 3.80."""frames = [walking_away(k) for k in range(73)] if clip == 'walking away' else [walker(k, grow=-0.02) for k in range(73)]code, report, output = run(tmp_path, frames, cut=FIXED)- assert rife_runs() == (14 if clip == 'shrinking 2 %' and rife_located() else 0)+ assert as_pinned(rife_runs(), {"rife-v4.25": 16, "rife-v4.6": 14} if clip == 'shrinking 2 %' else 0), rife_runs()edges = wrap_and_inner(output)# The feet first, whatever the gate said: held at its size alone, the walk away's last frame stands 6 px above its# first (1 px a frame inside) and the seam reads 10.03 — its size moved into its place.diff --git a/tests/video/test_ghost_given_way.py b/tests/video/test_ghost_given_way.pyindex 3b380f4..dc1b1c9 100644--- a/tests/video/test_ghost_given_way.py+++ b/tests/video/test_ghost_given_way.py@@ -30,6 +30,7 @@ from pathlib import Pathimport pytestfrom PIL import Image+from conftest import as_pinnedfrom sprite_gen.video import align, rife, restoration, sourcefrom sprite_gen.video import loop as loop_modfrom sprite_gen.video import repair@@ -403,7 +404,7 @@ def test_real_rife_the_applications_walk_gives_a_small_filmed_ghost_way(tmp_pathreport = _app_cut(tmp_path, None)assert report["jump_repair"]["interpolator"]["kind"] == "rife-ncnn-vulkan"_app_ghost_given_way(report, tmp_path / "E")- assert rife_runs() == APP_RUNS[rife.model_name()]+ assert as_pinned(rife_runs(), APP_RUNS), rife_runs()# --- the source projection and the restoration ------------------------------------------------------diff --git a/tests/video/test_ghost_screen.py b/tests/video/test_ghost_screen.pyindex c64a6ae..fa3f4c1 100644--- a/tests/video/test_ghost_screen.py+++ b/tests/video/test_ghost_screen.py@@ -18,6 +18,7 @@ import numpy as npimport pytestfrom PIL import Image, ImageFilter+from conftest import as_pinnedfrom sprite_gen.video import align, rifefrom sprite_gen.video import loop as loop_modfrom sprite_gen.video import repair@@ -200,4 +201,4 @@ def test_real_rife_delivers_no_cell_carrying_a_filmed_ghost():assert all(f is not frames[1] for f in out)assert max(rife.ghost(f) for f in out) <= GHOST_WARNassert [g["frame"] for g in facts["ghost_screen"]["ghosts"]] == [1]- assert interpolate.calls == SCREEN_CALLS[interpolate.model_name]+ assert interpolate.model_name == rife.model_name() and as_pinned(interpolate.calls, SCREEN_CALLS), interpolate.callsdiff --git a/tests/video/test_once.py b/tests/video/test_once.pyindex 381c5a5..8ed5a2f 100644--- a/tests/video/test_once.py+++ b/tests/video/test_once.py@@ -6,7 +6,7 @@ from pathlib import Pathimport pytestfrom PIL import Image, ImageDraw-from conftest import rife_located+from conftest import as_pinnedfrom sprite_gen.video import loop, batch, canvas, clip_prompt@@ -35,7 +35,7 @@ def cut(tmp_path, **kwargs):def test_cut_keeps_final_pose_in_strip_and_once_previews(tmp_path, rife_runs):keyed(tmp_path / "keyed")report = cut(tmp_path)- assert rife_runs() == (20 if rife_located() else 0)+ assert as_pinned(rife_runs(), 20), rife_runs()meta = report["strip"]assert report["cycle"]["kind"] == "once"assert meta["loop"] is False and meta["hold_last"] is Truediff --git a/tests/video/test_one_step_cut.py b/tests/video/test_one_step_cut.pyindex 2cd6f99..280bcea 100644--- a/tests/video/test_one_step_cut.py+++ b/tests/video/test_one_step_cut.py@@ -25,7 +25,7 @@ from pathlib import Pathimport pytestfrom PIL import Image, ImageDraw-from conftest import feet_unseen, rife_located+from conftest import as_pinned, feet_unseenfrom sprite_gen.video import align, batch, local_cycle, loop, periodfrom tests.video.test_video_pipeline import HAS_IMG2WEBP@@ -151,7 +151,7 @@ def test_the_step_screen_changes_nothing_but_its_own_record(tmp_path, monkeypatcmonkeypatch.setattr(period, "step_screen", lambda *a, **k: {"stubbed": True})_cut(tmp_path / "unscreened", keyed)_same_but_the_screen(tmp_path / "screened", tmp_path / "unscreened")- assert rife_runs() == (8 if rife_located() else 0)+ assert as_pinned(rife_runs(), 8), rife_runs()@pytest.mark.slow@@ -167,7 +167,7 @@ def test_the_step_screen_reads_a_cycle_on_a_frame_count_that_is_not_whole(tmp_padef test_steps_1_cuts_the_walk_again_two_steps_long_where_its_arms_close(slow, tmp_path, rife_runs):root, keyed, first = slowreport = _cut(tmp_path / "out", keyed, "--steps", "1")- assert rife_runs() == (6 if rife_located() else 0)+ assert as_pinned(rife_runs(), 6), rife_runs()cycle = report["cycle"]assert cycle["length"] in (CYCLE - 1, CYCLE, CYCLE + 1)L = first["cycle"]["length"]diff --git a/tests/video/test_play.py b/tests/video/test_play.pyindex 0c598d3..992906a 100644--- a/tests/video/test_play.py+++ b/tests/video/test_play.py@@ -14,8 +14,8 @@ from pathlib import Pathimport pytestfrom PIL import Image, ImageDraw-from conftest import rife_located-from sprite_gen.video import batch, clip_prompt, effect, loop, nonloop, play, rife+from conftest import as_pinned+from sprite_gen.video import batch, clip_prompt, effect, loop, nonloop, playfrom test_clip_prompt import PUNCH, punch_frames# state -> (preset, pinned seen from the side, cut): the engine as it was before play modes, by state name alone.@@ -266,7 +266,7 @@ ONCE_RETURN_RUNS = {"rife-v4.25": 44, "rife-v4.6": 36}@pytest.mark.timeout(900) # 36 to 44 calls of the binary at 96 x 96 (the held fill's frames between): seconds on a GPU, minutes on a CPU's Vulkan driverdef test_a_once_return_cut_keeps_both_ends_and_plays_once(tmp_path, rife_runs) -> None:report = cut(tmp_path, punch_frames(tmp_path / "frames", (96, 96), count=90))- assert rife_runs() == (ONCE_RETURN_RUNS[rife.model_name()] if rife_located() else 0)+ assert as_pinned(rife_runs(), ONCE_RETURN_RUNS), rife_runs()meta = report["strip"]assert report["cycle"]["kind"] == "once-return" and report["cycle"]["length"] == 90assert meta["loop"] is False and meta["hold_last"] is False and meta["returns"] is Truediff --git a/tests/video/test_walk_steps.py b/tests/video/test_walk_steps.pyindex 5aa2e06..3732092 100644--- a/tests/video/test_walk_steps.py+++ b/tests/video/test_walk_steps.py@@ -57,7 +57,7 @@ import numpy as npimport pytestfrom PIL import Image, ImageDraw-from conftest import feet_unseen, rife_located+from conftest import as_pinned, feet_unseen, pin_idfrom sprite_gen.video import crossings, legs, local_cycle, loopFRAMES = 73@@ -493,8 +493,9 @@ def _unwitnessed(report: dict, interval: float) -> dict:@pytest.mark.slow@pytest.mark.timeout(900) # up to 12 calls of the binary at 300 x 220 (the held fill's frames between): seconds on a GPU, minutes on a CPU's Vulkan driver[email protected]("walker, view, interval, runs", [("behind", None, 17.5, 12), ("behind", "back_diagonal", 17.5, 12),- ("outward", "front_diagonal", 16, 0)])[email protected]("walker, view, interval, runs", [("behind", None, 17.5, {"rife-v4.25": 10, "rife-v4.6": 12}),+ ("behind", "back_diagonal", 17.5, {"rife-v4.25": 10, "rife-v4.6": 12}),+ ("outward", "front_diagonal", 16, 0)], ids=pin_id)def test_a_walk_whose_feet_meet_once_a_cycle_but_whose_body_does_not_bob_is_cut_two_intervals_with_a_warning(tmp_path, walker, view,interval, runs, rife_runs):"""The two walkers whose feet meet once a cycle, their body held still: its top line does not rise and fall, and@@ -503,7 +504,7 @@ def test_a_walk_whose_feet_meet_once_a_cycle_but_whose_body_does_not_bob_is_cut_one cycle on the picture where a pass hid, and on the foot cue's turn half an interval on from the view)."""draw = (lambda k: _behind(k, cycle=interval, hold=1, bob=0)) if walker == "behind" else (lambda k: _outward(k, cycle=interval, bob=0))report = _cut(tmp_path / "out", _keyed(tmp_path, draw), *(("--view", view) if view else ()))- assert rife_runs() == (runs if rife_located() else 0)+ assert as_pinned(rife_runs(), runs), rife_runs()said = _unwitnessed(report, interval)assert said["bob"]["swing"] < local_cycle.BOB_FLOOR and "does not rise and fall" in said["bob"]["why"]@@ -554,12 +555,13 @@ def test_a_diagonal_walk_whose_near_foot_steps_out_is_cut_one_cycle_from_its_vieassert "cycles" not in plain["cycle"]["step_count"] and abs(plain["cycle"]["length"] - 2 * cycle) <= 1said = plain["cycle"]["cut_witness"]assert said["says"] == "four steps" and local_cycle.four_steps(plain["cycle"]) and plain["cycle"]["steps"]["count"] == 2- assert rife_runs() == (runs if rife_located() else 0)+ assert as_pinned(rife_runs(), runs), rife_runs()@pytest.mark.slow[email protected](900) # up to 12 calls of the binary at 300 x 220 (the held fill's frames between, both cuts): seconds on a GPU, minutes on a CPU's Vulkan driver[email protected]("cycle, runs", [(20, 10), (24, 12)])[email protected](900) # up to 30 calls of the binary at 300 x 220 (the held fill's frames between, both cuts): seconds on a GPU, minutes on a CPU's Vulkan driver[email protected]("cycle, runs", [(20, {"rife-v4.25": 22, "rife-v4.6": 10}), (24, {"rife-v4.25": 30, "rife-v4.6": 12})],+ ids=pin_id)def test_a_walk_whose_feet_stay_apart_and_meet_once_a_cycle_is_cut_one_cycle_on_the_order_its_feet_are_drawn_in(tmp_path, cycle, runs, rife_runs):"""Seen from the front, the feet apart, the foot stepping toward the camera drawn lower: the feet meet on the screenonce a cycle, and the body does not rise and fall. The clip shows its two sides of feet are its two legs — seen apart@@ -579,7 +581,7 @@ def test_a_walk_whose_feet_stay_apart_and_meet_once_a_cycle_is_cut_one_cycle_on_side = _cut(tmp_path / "side", keyed, "--view", "side")assert abs(side["cycle"]["length"] - 2 * cycle) <= 1.5 and local_cycle.unwitnessed(side["cycle"])assert "order" not in (side["cycle"]["step_count"].get("cycles") or {}) and "order" not in side["cycle"]["cut_witness"]- assert rife_runs() == (runs if rife_located() else 0)+ assert as_pinned(rife_runs(), runs), rife_runs()@pytest.mark.slow@@ -731,7 +733,9 @@ def test_a_wide_walk_whose_far_leg_is_drawn_a_few_tones_off_is_cut_two_steps(tmp@pytest.mark.slow@pytest.mark.timeout(900) # up to 22 calls of the binary at about 300 x 340 (the held fill's frames between): seconds on a GPU, minutes on a CPU's Vulkan driver[email protected]("motion, bob, room, runs", [("arc", 3, 0, 8), ("arc", 0, 60, 22), ("sway", 0, 60, 6), ("ramp", 0, 60, 16)])[email protected]("motion, bob, room, runs", [("arc", 3, 0, {"rife-v4.25": 10, "rife-v4.6": 8}), ("arc", 0, 60, 22),+ ("sway", 0, 60, {"rife-v4.25": 2, "rife-v4.6": 6}),+ ("ramp", 0, 60, {"rife-v4.25": 8, "rife-v4.6": 16})], ids=pin_id)def test_a_walk_whose_crossings_are_its_steps_carried_up_and_down_is_cut_two_steps(tmp_path, motion, bob, room, runs, rife_runs):"""The wide walker with its legs drawn alike, carried up and down the screen with the whole picture (`_carried`;its legs, their steps and their crossings every 23 frames as they were): bobbing, along a smooth arc 24 px deep;@@ -743,7 +747,7 @@ def test_a_walk_whose_crossings_are_its_steps_carried_up_and_down_is_cut_two_steand falling twice an interval and cut each one step, counted two, and no warning said so)."""walker = lambda k: _alike(k, cycle=46, phase=13, tone=4, lean=1, leg_tone=0, leg_half=10, bob=bob) # noqa: E731report = _cut(tmp_path / "out", _keyed(tmp_path, _carried(walker, motion, room)))- assert rife_runs() == (runs if rife_located() else 0)+ assert as_pinned(rife_runs(), runs), rife_runs()_two_steps(report, 46)said = _unwitnessed(report, 23)assert said["asked"].startswith("the feet together")@@ -782,7 +786,7 @@ def test_a_walk_carried_up_and_down_whole_feet_and_all_is_cut_two_intervals_with@pytest.mark.slow@pytest.mark.timeout(900) # up to 8 calls of the binary at 300 x 340 (the held fill's frames between): seconds on a GPU, minutes on a CPU's Vulkan driver[email protected]("bob, runs", [(0, 8), (3, 4)])[email protected]("bob, runs", [(0, {"rife-v4.25": 4, "rife-v4.6": 8}), (3, {"rife-v4.25": 6, "rife-v4.6": 4})], ids=pin_id)def test_a_walk_on_a_picture_shaken_twice_an_interval_is_cut_two_steps_with_a_warning(tmp_path, bob, runs, rife_runs):"""The wide walker with its legs drawn alike, its crossings its steps every 23 frames, held still (or rising andfalling on its legs once a step), on a picture shaken 3 px up and down twice an interval — dy = round(3 sin(4 pi k /@@ -792,7 +796,7 @@ def test_a_walk_on_a_picture_shaken_twice_an_interval_is_cut_two_steps_with_a_wawarning."""walker = lambda k: _alike(k, cycle=46, phase=13, tone=4, lean=1, leg_tone=0, leg_half=10, bob=bob) # noqa: E731report = _cut(tmp_path / "out", _keyed(tmp_path, _carried(walker, lambda k: round(3 * math.sin(4 * math.pi * k / 23)))))- assert rife_runs() == (runs if rife_located() else 0)+ assert as_pinned(rife_runs(), runs), rife_runs()said = _unwitnessed(report, 23)assert said["asked"].startswith("the feet together")if not bob:diff --git a/tests/video/test_wrap_blend.py b/tests/video/test_wrap_blend.pyindex eb6345e..29afcba 100644--- a/tests/video/test_wrap_blend.py+++ b/tests/video/test_wrap_blend.py@@ -19,7 +19,7 @@ import numpy as npimport pytestfrom PIL import Image-from conftest import rife_located+from conftest import as_pinnedfrom sprite_gen.video import loop as loop_modfrom sprite_gen.video import wrap_blendfrom tests.video.test_idle_still import _still_frames@@ -420,7 +420,7 @@ def test_a_part_moved_on_a_redrawn_character_is_held_while_the_rest_is_blended(d@pytest.mark.slow[email protected](900) # 16 calls of the binary at 160 x 224 (the held fill's frames between, both cuts): seconds on a GPU, minutes on a CPU's Vulkan driver[email protected](900) # 16 to 24 calls of the binary at 160 x 224 (the held fill's frames between, both cuts): seconds on a GPU, minutes on a CPU's Vulkan driverdef test_the_checkpoints_part_on_a_flat_figure_is_cut_as_filmed_with_a_warning(tmp_path: Path, capsys, rife_runs) -> None:frames = []for t in range(N):@@ -436,7 +436,7 @@ def test_the_checkpoints_part_on_a_flat_figure_is_cut_as_filmed_with_a_warning(tassert "the wrap blend was not used" in capsys.readouterr().errcut(tmp_path, keyed(tmp_path, frames, "keyed-off"), "off", wrap_blend="off", repair="off")assert outputs(tmp_path / "auto") == outputs(tmp_path / "off")- assert rife_runs() == (16 if rife_located() else 0)+ assert as_pinned(rife_runs(), {"rife-v4.25": 24, "rife-v4.6": 16}), rife_runs()# --- 4. a 1 px line on a flat figure ---------------------------------------------------------------------------------------