Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
video: 3 s default clips, gait windows in seconds, one-shot sidecar, GIF frames follow strip cells
Soohong Kim0c634a2e49d5
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex eaa819e..364c24e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,6 +2,13 @@All notable public changes to `sprite-gen` are recorded here. Versions track the `version:` field in `SKILL.md` and `pyproject.toml`.+## Unreleased (v2.4.0)++- `video-set --duration` defaults to 3 seconds (was 6). A repeating motion holds two or more cycles at 3 s (walk strides measured at 0.6–1.3 s across seven bodies), a single action is one hop or swing that the one-shot cut already handles, and 6 s bought only a longer wait — and, for jump, more idle standing between hops. `--duration 6` still asks for a longer clip.+- `video-loop` walk and run take their period window in seconds (walk 0.5–1.6 s, run 0.3–1.2 s, capped at half the clip) instead of a fraction of the clip length. At 3 s the old 6–31 % window topped out at 0.96 s and put a 1.0–1.3 s stride out of reach: on four walks generated at 3 s it refused one outright and cut another at a half step; with the bounds in seconds all four pass with equal or better seams, and the 6 s results are unchanged. Idle, jump and attack keep their windows.+- The strip sidecar (`<name>.strip.json`) records `kind` (`periodic` / `one-shot` / `fixed`) and `loop` (`false` for a one-shot), and the spec asset loader reads `loop` from it, so a jump or attack cut as a single action plays once on a trigger instead of repeating. A sidecar without the key is a loop, as before.+- The GIF/WebP never ask for more frames than the strip has cells. A cycle longer than the 64-cell cap is subsampled into the strip; the GIF/WebP are cut from those cells, so requesting the cycle length repeated cells back to back, the writer merged the identical neighbours, and verification refused its own output ("64 frames, expected 68" on a 2.8 s jump cycle).+## v2.3.1 - Key reflections removed from video sprites- `video-frames --spill small|full|auto` and `video-set --spill` (default `auto`): remove the key colour a video model paints into the subject — a reflection across metal, a tint on a pale surface — which the chroma engine's trapped-spill pass leaves alone once the patch is larger than its small-cluster cap. `auto` keys the still the clip was made from and measures its own key-coloured material; none worth the name means every key tint in the clip is spill (`full`), otherwise the still-pipeline rule stays (`small`). Colour only — alpha is unchanged — and colours without key tint are untouched. `video-frames` defaults to `small`, byte-identical to before; the frames report records the decision under `spill`.diff --git a/docs/video-pipeline.md b/docs/video-pipeline.mdindex 7b4ad47..a6fb3ed 100644--- a/docs/video-pipeline.md+++ b/docs/video-pipeline.md@@ -175,13 +175,22 @@ was 17). `video-loop` therefore:3. only then picks the **start** with the best seam for that period (± 1 frame):`seam = D[i][i+L]` over the mean adjacent distance inside the cycle.-Windows come from the state profile (`STATE_PROFILES`, fractions of the clip length):-idle 60–95 % (breathing is slow and not periodic — the lowest seam is a long window,-and idle is exempt from the periodicity gate), walk 6–31 %, run 7–23 %, jump/attack-11–45 %. `--min-len/--max-len` override. The walk floor is low on purpose: a legless-body "walks" as a fast bounce (about 13 frames at 24 fps) while a gait is 24–28, and it-is the 15 % depth rule — not the window — that rejects the one-step half period (on a-biped and a quadruped the half period dipped only 55–70 % as deep as the full one).+Windows come from the state profile (`STATE_PROFILES`). **Gait states take theirs in+seconds**, because a stride is a fact about the body, not about the clip length: walk+0.5–1.6 s, run 0.3–1.2 s, the ceiling capped at half the clip (a cycle must be seen twice+to be confirmed). The other states are fractions of the clip length: idle 60–95 %+(breathing is slow and not periodic — the lowest seam is a long window, and idle is+exempt from the periodicity gate), jump/attack 11–45 %. `--min-len/--max-len` override.+The walk floor is low on purpose: a legless body "walks" as a fast bounce (about 13+frames at 24 fps) while a gait is 24–28, and it is the 15 % depth rule and the gait+floor — not the window — that reject the one-step half period (on a biped and a+quadruped the half period dipped only 55–70 % as deep as the full one). Walk used to be+6–31 % of the clip; at the 3 s default that ceiling was 0.96 s and put a 1.0–1.3 s+stride out of reach (2026-09-18: one of four walks refused, another cut at a half step).+The ceiling is a bound in seconds rather than simply "half the clip" because the+periodicity gate measures the period's dip against the profile mean over the whole+window, and a ceiling that grows with the clip inflates that mean until a single hop+in a jittering stand passes as a walk.Gates, all fail-loud: no period (profile flat, `periodicity < 0.15`), loop seam ratioabove `--seam-max` (2.0), GIF/WebP re-opened and checked (frame count, `loop=0`,@@ -198,8 +207,10 @@ distance to it rises more than 3 MADs above the rest noise are the excursion, anlongest such run padded by 2 rest frames on each side is the cycle — so the seam isrest → rest by construction. The failover is explicit and recorded, not silent: thereport carries `cycle.kind = "one-shot"` plus `periodic_attempt` (the periodicity that-failed and the window), `table.md` has a `kind` column, and the same seam and-animation gates still apply. `--cycle periodic` keeps the old hard failure; `--cycle+failed and the window), `table.md` has a `kind` column, the strip sidecar carries+`kind` and `loop: false` (so `sprite-gen scene` and any loader of `<name>.strip.json`+play it once on a trigger rather than repeating it), and the same seam and animation+gates still apply. `--cycle periodic` keeps the old hard failure; `--cycleone-shot` forces the excursion cut. A clip that never leaves its rest pose fails loudin both detectors. `--cycle fixed --start N --length L` skips detection and cuts exactlythose frames — for a clip that holds too few repeats for the periodicity gate but whosediff --git a/sprite_gen/spec/assets.py b/sprite_gen/spec/assets.pyindex 4386976..cc3c116 100644--- a/sprite_gen/spec/assets.py+++ b/sprite_gen/spec/assets.py@@ -264,7 +264,9 @@ def load_asset(source: Path, *, state=None, fps=None, anchor=None) -> FrameSequeraise ValueError("loop strip size disagrees with its sidecar")frames = [sheet.crop((i*w, 0, (i+1)*w, h)) for i in range(n)]durations = [finite(data["delay_ms"], "delay_ms", positive=True)/1000] * n- meta["loop"] = True+ # `video-loop` writes `loop: false` for a one-shot cut (rest -> action -> rest);+ # an older sidecar without the key is a loop, as every strip was before.+ meta["loop"] = bool(data.get("loop", True))else:raise ValueError("unsupported asset descriptor; use sprite-gen-asset, loop strip sidecar or atlas manifest")if not frames:diff --git a/sprite_gen/video/batch.py b/sprite_gen/video/batch.pyindex c0f1808..711bb8e 100644--- a/sprite_gen/video/batch.py+++ b/sprite_gen/video/batch.py@@ -28,6 +28,11 @@ from sprite_gen.video import frames as frames_modfrom sprite_gen.video import loop as loop_modSTART_GAP_SECONDS = 2.0+# Clip length the batch asks the video model for. 3 s holds two or more cycles of every+# repeating state (walk periods measured at 0.6-1.3 s, 2026-09-18) and a single action+# for jump/attack, which the one-shot cut handles; 6 s bought nothing but a longer wait+# and, for jump, more idle standing between hops.+DEFAULT_DURATION_SECONDS = 3RETRY_BACKOFF_SECONDS = (15, 30)VIEW_TEXT = {"side": "seen from the exact side, facing right",@@ -204,7 +209,7 @@ def add_arguments(parser: argparse.ArgumentParser) -> None:parser.add_argument("--states", default="idle,walk,run,jump,attack", help="comma list of motion states")parser.add_argument("--out-dir", required=True, type=Path, help="batch root; one folder per direction-state")parser.add_argument("--character", help="short subject phrase used in the prompts (e.g. 'The armored knight')")- parser.add_argument("--duration", type=int, default=6)+ parser.add_argument("--duration", type=int, default=DEFAULT_DURATION_SECONDS, help=f"seconds per clip (default {DEFAULT_DURATION_SECONDS}); a repeating motion holds enough cycles at 3 s and a longer clip only costs more (2026-09-18)")parser.add_argument("--resolution", default="720p")parser.add_argument("--key", choices=("auto", "green", "magenta", "white"), default="auto")parser.add_argument("--concurrency", type=int, default=3, help="parallel clip generations (starts are staggered regardless)")@@ -220,7 +225,7 @@ def run(**kwargs: object) -> int:bases=_parse_bases(list(kwargs.get("base") or [])), # type: ignore[arg-type]states=[s.strip() for s in str(kwargs.get("states") or "").split(",") if s.strip()],root=Path(str(kwargs["out_dir"])), character=kwargs.get("character"), # type: ignore[arg-type]- duration=int(kwargs.get("duration") or 6), resolution=str(kwargs.get("resolution") or "720p"), key=str(kwargs.get("key") or "auto"),+ duration=int(kwargs.get("duration") or DEFAULT_DURATION_SECONDS), resolution=str(kwargs.get("resolution") or "720p"), key=str(kwargs.get("key") or "auto"),concurrency=int(kwargs.get("concurrency") or 3), force=bool(kwargs.get("force")), gap=float(kwargs.get("start_gap") or START_GAP_SECONDS),shape=(str(kwargs["shape"]) if kwargs.get("shape") else None), anchor=str(kwargs.get("anchor") or "none"), spill=str(kwargs.get("spill") or "auto"),)diff --git a/sprite_gen/video/loop.py b/sprite_gen/video/loop.pyindex 1da3c93..68fc7e5 100644--- a/sprite_gen/video/loop.py+++ b/sprite_gen/video/loop.py@@ -63,22 +63,52 @@ ANCHOR_MODES = ("none", "feet")FOOT_BAND = 0.08 # fraction of the frame's own height, measured up from its lowest opaque row+# A gait's period is a fact about the body, not about how long the clip runs: the+# same walker takes the same ~1 s stride in a 3 s clip and a 6 s clip. A window cut+# from the clip length (the fractions below) shrank with the clip and, at 3 s, put a+# 1.0-1.3 s stride above the walk ceiling (measured 2026-09-18: one of four walks refused+# outright, another cut at a half step). Gait states therefore take their window in+# seconds — physical bounds on how fast and how slow a locomotion cycle can be — capped+# above by half the clip, the most a detector can *confirm* repeats (a cycle must be seen+# twice to be a cycle at all). The ceiling is a bound in seconds and not simply "half+# the clip" because the periodicity gate compares the period's dip with the profile's+# mean over the whole window: a ceiling that grows with the clip drags in long, sparsely+# sampled lags, inflates that mean, and let a clip with ONE hop and a jittering stand+# pass as a walk (measured 2026-09-20 on the one-shot fixture: 0.23 with a half-clip+# ceiling, 0.03 with 1.6 s). The half-period guard (`min_seconds`) is unchanged.++@dataclass(frozen=True)class LoopProfile:- min_frac: float # window as a fraction of the clip's frame count+ min_frac: float # window as a fraction of the clip's frame count (non-gait states)max_frac: floatwhy: strperiodic: bool = True # gate: the profile must show a real period (idle is exempt)one_shot_ok: bool = False # the state is an action that may legitimately happen once (jump, attack) -> one-shot detector may take overgait: bool = False # locomotion: a period must hold two steps, so the half-period guard appliesmin_seconds: float = 0.0 # gait floor: a detected period shorter than this is treated as one step+ window_seconds: tuple[float, float] | None = None # gait states: period bounds in seconds (see above)++ def window(self, n: int, fps: float) -> tuple[int, int]:+ """Period-length window [lo, hi] in frames for a clip of `n` keyed frames.++ Gait states: `window_seconds`, the ceiling capped at half the clip. Everything+ else keeps the clip-length fractions (idle wants nearly the whole clip; jump and+ attack bound repeats only until the one-shot detector takes over)."""+ if self.window_seconds is not None:+ lo = max(4, round(self.window_seconds[0] * fps))+ return lo, max(lo + 2, min(n // 2, round(self.window_seconds[1] * fps)))+ lo = max(4, round(n * self.min_frac))+ return lo, max(lo + 2, round(n * self.max_frac))-# State -> detection window. Fractions of the clip length so 6 s and 10 s clips both work.+# State -> detection window. Non-gait profiles are fractions of the clip length so 6 s and+# 10 s clips both work; gait profiles use `window_seconds` (see above). Walk: measured+# strides 0.58-1.5 s (2026-09-09..20, seven bodies); run: 0.67-0.8 s.STATE_PROFILES: dict[str, LoopProfile] = {"idle": LoopProfile(0.60, 0.95, "breathing is slow and not strictly periodic; the lowest seam is a long window", periodic=False),- "walk": LoopProfile(0.06, 0.31, "full gait = two steps; the floor admits a legless body's fast bounce (~13 frames at 24 fps) — the 15% depth rule rejects the one-step half period when the near/far leg shows, and the gait floor (min_seconds) catches it when it does not", gait=True, min_seconds=0.6),- "run": LoopProfile(0.07, 0.23, "faster gait", gait=True, min_seconds=0.35),+ "walk": LoopProfile(0.06, 0.31, "full gait = two steps; the floor admits a legless body's fast bounce (~13 frames at 24 fps) — the 15% depth rule rejects the one-step half period when the near/far leg shows, and the gait floor (min_seconds) catches it when it does not", gait=True, min_seconds=0.6, window_seconds=(0.5, 1.6)),+ "run": LoopProfile(0.07, 0.23, "faster gait", gait=True, min_seconds=0.35, window_seconds=(0.3, 1.2)),"jump": LoopProfile(0.11, 0.45, "crouch-spring-land-return", one_shot_ok=True),"attack": LoopProfile(0.11, 0.45, "swing and return to ready", one_shot_ok=True),"default": LoopProfile(0.10, 0.45, "generic in-place action", one_shot_ok=True),@@ -321,7 +351,7 @@ def drift_reference(frames: list[Image.Image], boxes: list[tuple[int, int, int,return [float(r) for r in ref], abs(slope * (len(frames) - 1)), float(np.ptp(feet - trend))-def build_strip(frames: list[Image.Image], *, max_cells: int = STRIP_MAX_CELLS, max_height: int = STRIP_MAX_HEIGHT, max_width: int = STRIP_MAX_WIDTH, cycle_seconds: float, body_height: int | None = None, anchor: str = "none") -> tuple[Image.Image, dict[str, Any]]:+def build_strip(frames: list[Image.Image], *, max_cells: int = STRIP_MAX_CELLS, max_height: int = STRIP_MAX_HEIGHT, max_width: int = STRIP_MAX_WIDTH, cycle_seconds: float, body_height: int | None = None, anchor: str = "none", kind: str = "periodic") -> tuple[Image.Image, dict[str, Any]]:"""Union-crop (no bottom pad so feet meet the floor), scale, bottom-align, tile horizontally.The cell count is capped by the strip's PIXEL width (`max_width`) as well as by@@ -384,6 +414,11 @@ def build_strip(frames: list[Image.Image], *, max_cells: int = STRIP_MAX_CELLS,"frames": len(cells),"w": w,"h": h,+ # how the cycle was cut, and whether a runtime should repeat it: a one-shot+ # (rest -> action -> rest) plays once on a trigger; every other cut is a loop.+ # The spec asset loader reads `loop` from this sidecar.+ "kind": kind,+ "loop": kind != "one-shot","body_h": round(body_src * scale),"delay_ms": round(1000 * cycle_seconds / len(cells), 2),"cycle_frames": L,@@ -499,8 +534,9 @@ def run_loop(raise SystemExit(f"video-loop: need at least 6 keyed frames in {frames_dir}, found {len(files)}")prof = profile_for(state)n = len(files)- lo = min_len if min_len is not None else max(4, round(n * prof.min_frac))- hi = max_len if max_len is not None else max(lo + 2, round(n * prof.max_frac))+ lo_default, hi_default = prof.window(n, fps)+ lo = min_len if min_len is not None else lo_default+ hi = max_len if max_len is not None else max(lo + 2, hi_default)D = distance_matrix(files)periodic_attempt: dict[str, Any] | None = Noneif cycle_mode == "fixed":@@ -550,7 +586,13 @@ def run_loop(frames.append(im)cycle_seconds = L / fps- strip, strip_meta = build_strip(frames, max_height=strip_height, cycle_seconds=cycle_seconds, body_height=body_height, anchor=anchor)+ strip, strip_meta = build_strip(frames, max_height=strip_height, cycle_seconds=cycle_seconds, body_height=body_height, anchor=anchor, kind=str(cycle.get("kind") or "periodic"))+ # The GIF/WebP are cut from the strip's cells. A cycle longer than the cell cap was+ # subsampled there, so asking for more frames than cells repeats cells back to back+ # and the GIF writer merges the identical neighbours — the file then holds fewer+ # frames than requested and verification refused it (2026-09-20: a 68-frame jump cycle+ # capped at 64 cells came back as a 64-frame GIF "expected 68").+ n_out = min(n_out, int(strip_meta["frames"]))strip_path = out_dir / f"{name}.strip.png"strip.save(strip_path)atomic_write_text(out_dir / f"{name}.strip.json", json.dumps(strip_meta, indent=2) + "\n")diff --git a/tests/video/test_duration_window_oneshot.py b/tests/video/test_duration_window_oneshot.pynew file mode 100644index 0000000..bf2f95d--- /dev/null+++ b/tests/video/test_duration_window_oneshot.py@@ -0,0 +1,129 @@+"""Synthetic regressions for the 3 s default and its consequences (2026-09-18/20 field tests):++* `video-set` asks for 3 s clips by default;+* a gait's period window is taken in seconds (floor) and half the clip (ceiling), so a+ 1.0-1.3 s stride is still inside the window of a 3 s clip; idle and the action+ states keep their clip-length fractions;+* the strip sidecar says how the cycle was cut and whether to loop it, and the spec+ loader reads that back;+* the GIF/WebP never ask for more frames than the strip has cells.+"""+from __future__ import annotations++import argparse+import json+import math+from pathlib import Path++import pytest+from PIL import Image++from sprite_gen.spec.assets import load_asset+from sprite_gen.video import batch as batch_mod+from sprite_gen.video import loop as loop_mod+from tests.video.test_video_pipeline import HAS_IMG2WEBP, _gait_frames, _one_shot_frames+++def test_video_set_defaults_to_three_seconds(monkeypatch) -> None:+ parser = argparse.ArgumentParser()+ batch_mod.add_arguments(parser)+ assert parser.parse_args(["--out-dir", "x"]).duration == batch_mod.DEFAULT_DURATION_SECONDS == 3+ seen: dict = {}++ def fake_run_set(**kw):+ seen.update(kw)+ return {"ok": 0, "failed": [], "items": []}++ monkeypatch.setattr(batch_mod, "run_set", fake_run_set)+ monkeypatch.setattr(batch_mod, "_parse_bases", lambda items: {})+ batch_mod.run(out_dir="x", duration=None) # a caller that leaves it unset gets the default, not 6+ assert seen["duration"] == 3+++def test_gait_windows_are_in_seconds_capped_at_half_the_clip() -> None:+ walk, run, idle, jump = (loop_mod.profile_for(s) for s in ("walk", "run", "idle", "jump"))+ # a 3 s clip at 24 fps: a 1.0-1.3 s stride (24-32 frames) must fit; the old 6-31 %+ # window topped out at 23 frames (measured 2026-09-18: sookuma refused, xazinga half-stepped).+ # The ceiling is 1.6 s (38 frames) but a 73-frame clip can only confirm 36.+ assert walk.window(73, 24.0) == (12, 36)+ assert run.window(73, 24.0) == (7, 29)+ # a 6 s clip: the legless 13-frame bounce stays reachable, the ceiling is the 1.6 s bound+ assert walk.window(145, 24.0) == (12, 38)+ # the bounds are physical, so a different frame rate moves them+ assert walk.window(90, 30.0) == (15, 45)+ # non-gait states are untouched: idle wants nearly the whole clip, jump keeps its fractions+ assert idle.window(73, 24.0) == (round(73 * 0.60), round(73 * 0.95))+ assert jump.window(145, 24.0) == (round(145 * 0.11), round(145 * 0.45))+++def test_gait_window_does_not_let_a_single_hop_pass_as_a_walk(tmp_path: Path) -> None:+ """A wider ceiling inflates the periodicity gate's profile mean: with 'half the clip'+ the one-hop stand scored 0.23 (a walk!); with the 1.6 s bound it scores ~0.03."""+ files = _one_shot_frames(tmp_path)+ D = loop_mod.distance_matrix(files)+ lo, hi = loop_mod.profile_for("walk").window(len(files), 24.0)+ assert loop_mod.detect_cycle(D, min_len=lo, max_len=hi, gait_floor=round(0.6 * 24))["periodicity"] < loop_mod.PERIODICITY_MIN+++def test_run_loop_reports_the_gait_window_from_the_profile(tmp_path: Path, monkeypatch) -> None:+ _gait_frames(tmp_path, period=12, n=72)+ seen: dict = {}++ def fake_detect(D, *, min_len, max_len, gait_floor=None):+ seen.update(lo=min_len, hi=max_len)+ raise SystemExit("stop here")++ monkeypatch.setattr(loop_mod, "detect_cycle", fake_detect)+ with pytest.raises(SystemExit, match="stop here"):+ loop_mod.run_loop(tmp_path / "keyed", tmp_path / "out", fps=24.0, state="walk", min_len=None, max_len=None, n_out=None, seam_max=2.0, name="w", report_path=None)+ assert (seen["lo"], seen["hi"]) == (12, 36)+++def test_strip_sidecar_says_how_the_cycle_was_cut_and_whether_to_loop() -> None:+ frames = [Image.new("RGBA", (40, 40), (0, 0, 0, 0)) for _ in range(6)]+ for im in frames:+ for y in range(10, 38):+ for x in range(14, 26):+ im.putpixel((x, y), (200, 60, 60, 255))+ _, periodic = loop_mod.build_strip(frames, cycle_seconds=0.25)+ _, once = loop_mod.build_strip(frames, cycle_seconds=0.25, kind="one-shot")+ assert (periodic["kind"], periodic["loop"]) == ("periodic", True)+ assert (once["kind"], once["loop"]) == ("one-shot", False)+++def test_spec_loader_reads_loop_from_the_strip_sidecar(tmp_path: Path) -> None:+ frames = [Image.new("RGBA", (40, 40), (0, 0, 0, 0)) for _ in range(4)]+ for im in frames:+ for y in range(10, 38):+ for x in range(14, 26):+ im.putpixel((x, y), (200, 60, 60, 255))+ strip, meta = loop_mod.build_strip(frames, cycle_seconds=0.2, kind="one-shot")+ strip.save(tmp_path / "jump.strip.png")+ (tmp_path / "jump.strip.json").write_text(json.dumps(meta))+ assert load_asset(tmp_path / "jump.strip.json").metadata["loop"] is False+ # a sidecar from before the key existed is a loop, as it always was+ meta.pop("loop"); meta.pop("kind")+ (tmp_path / "jump.strip.json").write_text(json.dumps(meta))+ assert load_asset(tmp_path / "jump.strip.json").metadata["loop"] is True++[email protected](not HAS_IMG2WEBP, reason="img2webp not installed")+def test_one_shot_run_writes_a_non_looping_sidecar(tmp_path: Path) -> None:+ _one_shot_frames(tmp_path)+ rep = loop_mod.run_loop(tmp_path / "keyed", tmp_path / "jump", fps=24.0, state="jump", min_len=None, max_len=None, n_out=8, seam_max=2.0, name="j", report_path=None)+ assert rep["cycle"]["kind"] == "one-shot"+ side = json.loads((tmp_path / "jump" / "j.strip.json").read_text())+ assert side["kind"] == "one-shot" and side["loop"] is False+ assert load_asset(tmp_path / "jump" / "j.strip.json").metadata["loop"] is False++[email protected](not HAS_IMG2WEBP, reason="img2webp not installed")+def test_gif_frame_count_never_exceeds_the_strip_cells(tmp_path: Path) -> None:+ """A cycle longer than the cell cap is subsampled into the strip; the GIF/WebP are cut+ from those cells, so they hold that many frames — and verification expects that, not+ the cycle length (2026-09-20: a 68-frame jump cycle came back "64 frames, expected 68")."""+ _gait_frames(tmp_path, period=34, n=80, stamp=True)+ rep = loop_mod.run_loop(tmp_path / "keyed", tmp_path / "out", fps=24.0, state="jump", min_len=None, max_len=None, n_out=None, seam_max=99.0, name="long", report_path=None, cycle_mode="fixed", start=0, length=68)+ assert rep["cycle"]["length"] == 68+ assert rep["strip"]["frames"] == loop_mod.STRIP_MAX_CELLS == 64 and rep["strip"]["subsampled"] is True+ assert rep["n_out"] == 64 and rep["gif"]["n_frames"] == 64 and rep["webp"]["n_frames"] == 64diff --git a/tests/video/test_video_pipeline.py b/tests/video/test_video_pipeline.pyindex ddf6eca..4eacc3b 100644--- a/tests/video/test_video_pipeline.py+++ b/tests/video/test_video_pipeline.py@@ -183,8 +183,9 @@ def test_profiles_scale_windows_with_clip_length() -> None:p = loop_mod.profile_for("idle")assert p.min_frac > loop_mod.profile_for("walk").min_frac# a 6 s / 24 fps clip: the walk floor must admit a 13-frame bounce (legless body) and the- # ceiling a 28-frame gait (2026-09-09: slime 13, wolf 24, biped 25 all resolved by the depth rule)- lo, hi = round(144 * loop_mod.profile_for("walk").min_frac), round(144 * loop_mod.profile_for("walk").max_frac)+ # ceiling a 28-frame gait (2026-09-09: slime 13, wolf 24, biped 25 all resolved by the depth rule).+ # Gait windows are in seconds now (floor 0.25 s, ceiling half the clip) — the same two bounds hold.+ lo, hi = loop_mod.profile_for("walk").window(144, 24.0)assert lo <= 13 and hi >= 28assert loop_mod.profile_for("unknown-state") is loop_mod.STATE_PROFILES["default"]