Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
Merge plan/test-diet-1022 (tests: a plain pytest is the fast bundle, the tests marked slow deselected; pytest --full and the release lane run every test) into main, validated in sprite-gen/test-diet-1022 — CHANGELOG: the branch's Tests entry follows the breathe-large-illust block in the one ## Unreleased section
Soohong Kimc23f56ad400d
diff --cc CHANGELOG.mdindex b8e295b,5a6c464..6557d65--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -4,37 -4,8 +4,39 @@@ All notable public changes to `sprite-g## Unreleased+**Upgrading from 3.0.0: Bakes retain the same bytes for figures whose anatomy is unchanged. The `pixel` refusal message now names the sides and pixel counts. A figure that had `face-absent` may now have a face, with a lower rigid boundary only when that face ends below the neck.**++The Breathe layer still supports `pixel` and `smooth`.++- **Changed: Pixel refusal.** `pixel` still refuses stretched content past the top, left, or right of a cell instead of cropping it.+ The message names each side and its opaque pixel count. A pixel past a corner counts on both sides.+ When an overflowing side is the drawing's own border, the message also gives the number of pixels covering that edge.+ It advises `--mode smooth` or sidecar `mode: "smooth"` for an illustration cut by its frame.+ It advises a wider cell margin or lower `depth` for a pixel sprite.+ It warns that padding, baking, and cropping back silently loses pushed off content.+ The curator preview uses the same refusal wording.+ The border reading follows the 2% rule in [video pipeline](docs/video-pipeline.md) section 3.+ See [breathing](docs/breathing.md) for behavior at frame edges.+- **New: Second eye pair search.** It runs only when the existing search finds no pair.+ Its minimum eye area is 0.2% of opaque pixels above the neck.+ Its eye width to height limit is 3.0, and its minimum eye center distance from the body axis is 0.02 of content width.+ Pair placement, separation, size similarity, and row overlap conditions remain the same.+ A face found by this search clears `face-absent`. It lowers the boundary only if the face ends below the neck.+- **Faster: Breathe bakes.** Array operations speed up pixel outline thinning, appendage weights, and row mapping.+ `smooth` solves displacement only for pixels that move.+ Anatomy and settings checks run once per row, and `sprite-gen breathe` shares one anatomy measurement between its report and bake.+ On synthetic 960 x 960 cells with Apple M1, bake time fell from 0.20 s to 0.10 s for `smooth`.+ For an outlined figure with arms in `pixel`, it fell from 0.98 s to 0.05 s.+ These measurements exclude PNG reading and writing.+ `bake_breathe_sequence(images, cfg, anat=None)` and `anatomy_report(images, cfg, anat=None)` accept measured anatomy.+ `protect(anat)` accepts one column or an array of columns.+- **Tests:** `tests/effects/test_breathe.py` checks border counts, advice, smooth edge preservation, and the second face search.+ `tests/effects/test_breathe_js_mirror.py` checks curator refusal wording and byte identity with the pixel bake.+ `tests/effects/test_breathe_smooth.py` checks pixel and smooth byte goldens and shared anatomy and strain measurements.+ `tests/effects/test_breathe_publish.py` checks that the stand-in bake accepts the new argument.++ - **Tests**: A plain `pytest` runs a fast bundle: tests marked `slow` are deselected, the header points to `pytest --full`, and the summary counts deselections. `pytest --full` runs every test. The release lane, `scripts/linux_lane.sh`, passes `--full` to both `pytest` calls, including `-m real_rife`, so its gate still runs every test. `tests/release/test_fast_bundle.py` checks both calls and probes selection with and without `--full`. The `slow` rule in `pyproject.toml` is 1 s per case or 5 s across a function's cases on an 8-core M1 running the whole suite; marking a function marks every case. Five tests remain unmarked as the only fast callers of `video-stop`, `workflow`, `defaults`, `video-sway`, and `export-aseprite`. Three fixture-first tests remain unmarked because other fast tests build their fixtures. In `tests/frames/test_ui_kit.py`, the fast bundle keeps 16 of 512 scattered-drawing grid seeds, 8 of 256 full-size-frame band grid seeds, 9 of 256 missing-element sets, 2 of 17 counterexample sheets, and one placement and start in each publish sweep. `tests/curate/test_anchor_selection.py` extracts each run once per module instead of repeating 1.5 to 2.6 s of setup per test; 25 of 27 affected tests are now fast. Removed `tests/video/test_loop_overlap.py::test_a_tail_on_its_own_beat_is_closed_at_the_wrap_with_the_clips_frames_a_cycle_apart[on]`; its wordless case makes the same call with the default "on". Removed `tests/video/test_walk_steps.py::test_cycle_align_takes_a_loop_cut_two_steps_as_one_cycle` and `tests/video/test_one_step_cut.py::test_cycle_align_takes_the_loop_cut_again_on_its_count`; `tests/video/test_loop_prop_seam_held.py::test_cycle_align_aligns_a_two_step_loop_as_the_one_cycle_it_is` covers alignment from recorded `steps: 2`. Merged `tests/video/test_loop_overlap.py::test_the_cli_passes_overlap_wrap_off_and_on_is_its_default` into `tests/video/test_loop_overlap.py::test_with_the_overlapped_wrap_off_nothing_is_read_for_the_wrap_and_the_gate_refuses_the_cut_as_filmed`, retaining both sets of assertions on one CLI cut with `--overlap-wrap off`. In a new virtual environment, the former suite ran 7,881 tests (7,880 passed, 1 skipped) in 21 minutes 54 seconds; `pytest --full` now runs 7,879, including two new release tests, and the fast bundle runs 6,553 in about 6 minutes. Package code, commands, and outputs are unchanged.+## v3.0.0 - Remove rig layer composition**Upgrading from 2.46.0: `sprite-gen compose-layers` and its other launch forms are removed, and rig layer declarations are no longer read.** `compose-atlas` no longer writes a manifest `rig` block or `animation.rows.<state>.track` for a run that declared a rig. Runs that never declared `rig`, `layers` or a state `track` get the same manifest as before. Existing run files and `layers/` folders stay on disk.diff --cc tests/video/test_wrap_blend.pyindex 4fd8a56,44e2ad8..eb485a2--- a/tests/video/test_wrap_blend.py+++ b/tests/video/test_wrap_blend.py@@@ -519,12 -523,12 +525,13 @@@ def test_a_cut_that_is_not_pinned_is_noassert outputs(tmp_path / "auto") == outputs(tmp_path / "off")+ @pytest.mark.slowdef test_a_pinned_cut_the_body_anchor_moves_is_not_touched(tmp_path: Path) -> None:frames = character(**REDRAW)- report = cut(tmp_path, keyed(tmp_path, frames), "auto", anchor="body")+ # The blend alone, as in section 1: `--repair off` keeps the seam bridge from making frames round the redraw's wrap.+ report = cut(tmp_path, keyed(tmp_path, frames), "auto", anchor="body", repair="off")assert report["wrap_blend"]["applied"] is False and "--anchor body" in report["wrap_blend"]["why"]- cut(tmp_path, keyed(tmp_path, frames, "keyed-off"), "off", anchor="body", wrap_blend="off")+ cut(tmp_path, keyed(tmp_path, frames, "keyed-off"), "off", anchor="body", wrap_blend="off", repair="off")assert outputs(tmp_path / "auto") == outputs(tmp_path / "off")