Skip to content

Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.

test(no-repeat): RIFE calls pinned again where the default fill now makes real repeats; three tests read the fill

Soohong Kim1532deba57f6
diff --git a/tests/video/test_auto_motion.py b/tests/video/test_auto_motion.py
index 43531fa..39852de 100644
--- a/tests/video/test_auto_motion.py
+++ b/tests/video/test_auto_motion.py
@@ -176,7 +176,14 @@ def test_actual_cli_auto_selects_corrects_and_verifies_animation(tmp_path):
assert abs(motion['endpoint_xy'][0]+23) <= 1
assert abs(motion['endpoint_xy'][1]+5) <= 1
left, top, _, _ = motion['padding_ltrb']
+ # Anchored, the walker's legs hold their rounded swing for two or three cells: the fill read after the anchor makes
+ # those cells again between the poses beside them (RIFE's frames, where it is installed). Every other cell is its
+ # source frame moved back.
+ held = report['held_fill']
+ made = set(held['made']) | set((held.get('again') or {}).get('made', []))
for k, path in enumerate(sorted((output/'cycle').glob('*.png'))):
+ if k in made:
+ continue
image = Image.open(path)
dx, dy = motion['shifts_xy'][k]
restored = image.crop((left+dx, top+dy, left+dx+280, top+dy+180))
diff --git a/tests/video/test_explicit_window.py b/tests/video/test_explicit_window.py
index 42c2b03..a97ad19 100644
--- a/tests/video/test_explicit_window.py
+++ b/tests/video/test_explicit_window.py
@@ -56,7 +56,7 @@ ROWS = [
# A window that holds one step of a walk whose steps are seen: no cut of two steps there, and none of one.
("first", _slow, ("--state", "walk", *MOTION, "--max-len", "25"),
lambda r: "gait_fallback" not in r and r["error"].startswith("no cut of two steps in --max-len 25"), False, 0),
- ("first", _slow, ("--state", "walk", *MOTION, "--min-len", "18"), lambda r: "gait_fallback" not in r, True, 6),
+ ("first", _slow, ("--state", "walk", *MOTION, "--min-len", "18"), lambda r: "gait_fallback" not in r, True, 8),
("two-step", _held, ("--state", "walk", *MOTION, "--max-len", "25"),
lambda r: r["cycle"]["seam_pop"]["held_edge"]["two_step_capped"]["max_len"] == 25, True, 0),
("two-step", _held, ("--state", "walk", *MOTION, "--max-len", "47"), # 47 of 47-49 read
@@ -65,8 +65,8 @@ ROWS = [
("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,
- {"rife-v4.25": (6, 20), "rife-v4.6": 6}),
- ("counted", _slow, ("--state", "walk", *MOTION, "--min-len", "18", "--steps", "1"), lambda r: r["cycle"]["steps"]["by"] == "given", True, 6),
+ {"rife-v4.25": (8, 22), "rife-v4.6": 8}),
+ ("counted", _slow, ("--state", "walk", *MOTION, "--min-len", "18", "--steps", "1"), lambda r: r["cycle"]["steps"]["by"] == "given", True, 8),
("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,
{"rife-v4.25": (4, 16), "rife-v4.6": 22}),
diff --git a/tests/video/test_follow_read_on.py b/tests/video/test_follow_read_on.py
index 7b8aa56..8d70740 100644
--- a/tests/video/test_follow_read_on.py
+++ b/tests/video/test_follow_read_on.py
@@ -216,7 +216,7 @@ def test_t1_the_same_turned_loop_followed_as_read_today_moves_another_place(orig
def test_t2_a_loop_stretched_by_the_nearer_cell_is_carried_cell_for_cell_duplicates_and_all(origin, tmp_path):
o, read_on, _ = origin
- loop_dir = aligned(o, tmp_path/'stretched', length=17)
+ loop_dir = aligned(o, tmp_path/'stretched', length=17, fill_held='off') # the nearer cells shown again, as resampled
record = meta_of(loop_dir)['cycle_align']
sources = [entry['source'] for entry in record['cells_from']]
assert len(sources) == 17 and len(set(sources)) < len(sources)
diff --git a/tests/video/test_ghost_given_way.py b/tests/video/test_ghost_given_way.py
index f9f59ec..2c9d59e 100644
--- a/tests/video/test_ghost_given_way.py
+++ b/tests/video/test_ghost_given_way.py
@@ -393,7 +393,7 @@ def test_the_applications_walk_gives_a_small_filmed_ghost_way(tmp_path):
# The binary's calls on the application's walk, by model (`rife.model_name()`): rife-v4.25's frame between held cells 32
# to 34 shows a neighbour's picture again, so it is refused (`held`), tried at another time and kept as filmed.
-APP_RUNS = {"rife-v4.25": (8, 10), "rife-v4.6": 8}
+APP_RUNS = {"rife-v4.25": (10, 12), "rife-v4.6": 12}
@pytest.mark.slow
diff --git a/tests/video/test_one_step_cut.py b/tests/video/test_one_step_cut.py
index 280bcea..371fefb 100644
--- a/tests/video/test_one_step_cut.py
+++ b/tests/video/test_one_step_cut.py
@@ -163,11 +163,11 @@ def test_the_step_screen_reads_a_cycle_on_a_frame_count_that_is_not_whole(tmp_pa
@pytest.mark.slow
[email protected](900) # 6 calls of the binary at 280 x 220 (the held fill's frames between): seconds on a GPU, minutes on a CPU's Vulkan driver
[email protected](900) # 8 calls of the binary at 280 x 220 (the held fill's frames between): seconds on a GPU, minutes on a CPU's Vulkan driver
def test_steps_1_cuts_the_walk_again_two_steps_long_where_its_arms_close(slow, tmp_path, rife_runs):
root, keyed, first = slow
report = _cut(tmp_path / "out", keyed, "--steps", "1")
- assert as_pinned(rife_runs(), 6), rife_runs()
+ assert as_pinned(rife_runs(), 8), rife_runs()
cycle = report["cycle"]
assert cycle["length"] in (CYCLE - 1, CYCLE, CYCLE + 1)
L = first["cycle"]["length"]
diff --git a/tests/video/test_sway_read_on_recut.py b/tests/video/test_sway_read_on_recut.py
index 29cfb29..1219adc 100644
--- a/tests/video/test_sway_read_on_recut.py
+++ b/tests/video/test_sway_read_on_recut.py
@@ -370,7 +370,7 @@ def test_a_loop_aligned_to_more_cells_says_where_each_is_from_and_read_on_cut_re
sway.sway_loop(made, [region], **kw)
assert files(made) == before
# Stretched by the cut's own cells, shown again, every cell is one of the cut's, and the pair is carried through.
- shown = aligned(b, tmp_path/'shown', length=17)
+ shown = aligned(b, tmp_path/'shown', length=17, fill_held='off') # the cells shown again stay so (--fill-held off)
entries = meta_of(shown)['cycle_align']['cells_from']
assert len(entries) == 17 and all('source' in entry for entry in entries) and CR not in meta_of(shown)
read_on = sway.sway_loop(shown, [region], **kw)['read_on']
diff --git a/tests/video/test_walk_steps.py b/tests/video/test_walk_steps.py
index 5924b7b..d694d1a 100644
--- a/tests/video/test_walk_steps.py
+++ b/tests/video/test_walk_steps.py
@@ -530,8 +530,8 @@ def test_a_walk_whose_feet_meet_once_a_cycle_its_arms_swinging_past_its_sides_is
@pytest.mark.slow
[email protected](900) # up to 10 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", [(16, 0), (18, 10)])
[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", [(16, 0), (18, 12)])
def test_a_diagonal_walk_whose_near_foot_steps_out_is_cut_one_cycle_from_its_view(tmp_path, cycle, runs, rife_runs):
"""On a front diagonal the near foot steps out toward the camera and passes the far one apart: the feet meet on the
screen once a cycle, and briefly — no pass hides. Given the view, the count asks the picture: the clip one interval
@@ -560,7 +560,7 @@ def test_a_diagonal_walk_whose_near_foot_steps_out_is_cut_one_cycle_from_its_vie
@pytest.mark.slow
@pytest.mark.timeout(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": (10, 22), "rife-v4.6": 10}), (24, {"rife-v4.25": (12, 30), "rife-v4.6": 12})],
[email protected]("cycle, runs", [(20, {"rife-v4.25": (12, 24), "rife-v4.6": 12}), (24, {"rife-v4.25": (12, 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 screen
@@ -735,7 +735,7 @@ def test_a_wide_walk_whose_far_leg_is_drawn_a_few_tones_off_is_cut_two_steps(tmp
@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
@pytest.mark.parametrize("motion, bob, room, runs", [("arc", 3, 0, {"rife-v4.25": (6, 10), "rife-v4.6": 8}),
("arc", 0, 60, {"rife-v4.25": (14, 22), "rife-v4.6": 22}),
- ("sway", 0, 60, {"rife-v4.25": 2, "rife-v4.6": 6}),
+ ("sway", 0, 60, {"rife-v4.25": 6, "rife-v4.6": 12}),
("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`;