Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
Merge origin/main (v3.11.0, 62e4b69) into plan/walk-cycle-witness-1028: a walk's cut chosen by its step count and the clip two lengths on is held to one word, in main's _motion_auto
Soohong Kimc1b065c79f53
diff --cc CHANGELOG.mdindex 41df4a8,d7cb922..755f698--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -2,83 -2,193 +2,270 @@@All notable public changes to `sprite-gen` are recorded here. Versions track the `version:` field in `SKILL.md` and `pyproject.toml`.+## Unreleased - A walk whose feet meet once a cycle is cut one cycle long only where its body or the order the feet are drawn in witnesses it, a walk that starts or stops in its take is named to film again, and video-set cuts a searched walk or run with motion-auto by default++**Upgrading from 3.5.0: `video-set` now cuts searched walk and run loops with `--anchor motion-auto` and their view by default, and `video-loop --anchor motion-auto` recognises crossings that mark cycles where feet hide or step apart instead of cutting two cycles.** Every walk or run item whose loop is searched is now cut with `motion-auto` and its view, producing a different cut and different bytes; `--anchor none` gives the old cut, its pictures and reports byte for byte apart from the engine hash (`producer.implementation_sha256`). Idle, attack, once-hold, lifetime, and once-return items are cut as before. In `video-loop --anchor motion-auto` without `--view`, a walk whose feet are seen together over half the interval at a pass (`crossings.HIDE_SHARE`, 0.5) and whose picture repeats each interval is now counted on cycles only where the body's top line, read less the picture's own flow, rises and falls twice an interval, and that rise and fall must be the body's own, read against its lowest row and its upper body, so the picture moved or zoomed with it witnesses nothing: where the parent engine cut two cycles, the loop is now one cycle with new bytes; where the parent engine kept the search's cut with no `steps`, the cut is the same and the strip and report now record `steps: 2`; where nothing witnesses, its crossings stay on steps with a warning (`cycle-unwitnessed`). A walk whose crossings mark steps (brief passes, or from the side) is cut to the same bytes. With `--view` (or through `video-set`), a front, back, or diagonal walk is evaluated even with brief passes: such a walk is counted on cycles with the same witness, the view's foot cue only refusing where it turns over one interval on; where nothing witnesses, its crossings stay on steps with a warning, and `video-set` leaves a `cycle-unwitnessed` loop out of the cycle alignment. Every report whose clip stands still gains `stands` and `run_limit`, and reports where cycle reading is asked gain `cycles`, with `bob` where the picture passes and `cue` only where a view is given.++- **New: crossing cycle detection (`local_cycle.read_cycles`, `local_cycle.bob_word`, `local_cycle.off_flow`, `local_cycle.twice_an_interval`, `local_cycle.own_beat`, `local_cycle.cue_word`, `crossings.HIDE_SHARE`, `crossings.Reading.hides`, `legs.body_signals`, `CYCLE_SLACK`, `CUE_FLOOR`, `CUE_SWAPPED`, `BOB_TWICE`, `BOB_FLOOR`, `BOB_ROWS`, `BOB_OWN`, `BOB_SCALE`, `BEAT_FRAMES`, `UNWITNESSED`).** In gap mode on a readable reading, when feet can hide behind one another (`reading.overlap` over `crossings.HIDE_SHARE`, 0.5) or when the view is given and is not `side`, crossing intervals are checked to see if they mark full cycles rather than single steps. `repeat_at(distances, span)` reads the mean distance of frames to those lagged by `span` over the clip's mean step from frame to frame. Comparing distances at half, one, and two intervals, crossings mark cycles when `one < half` and `one <= two + CYCLE_SLACK` (0.5), only where a witness that reads no leg says the interval holds two steps, the body's own rise and fall twice an interval: its top line (`legs.strike_signals` `top`) less its flow, read against its lowest row and upper body. New function `local_cycle.off_flow(values, interval)` returns `values` (per frame) less their flow: each frame minus the mean of the interval about it (a moving average one interval long, its two end frames weighted by the part of a frame the interval covers), kept only over the frames the interval fits about (the first and last `ceil(interval/2 - 0.5)` frames drop out), and what is left minus its least-squares straight line; a rise and fall once or twice an interval averages to nothing over one interval and is left whole, while a flow slower than the interval is taken out wholly where it bends no more than a cubic (a constant, a straight drift, an arc, a cubic) and in part where it is a slow sway a few intervals long. `local_cycle.bob_word(signals, interval)` reads the body's top line less its flow (`off_flow(top, interval)`), not the raw line; `swing` is the range of the line left over the body's median height, and `rows` is that range in pixel rows. Where the clip is under an interval long so nothing is left, `says` is null and `why` says its top line less its flow is not read; where `swing` is under `BOB_FLOOR` (0.005) or `rows` is under `BOB_ROWS` (2), `says` is null, `why` says the line's range less its flow is under 0.5 % of the body's height or 2 rows, so it does not rise and fall (the top line is read in whole pixel rows, so a picture drifting up or down makes the line step a row up and down as it rounds, and that rounding, less its own mean over an interval, stays under 2 rows), and `half` and `quarter` are not read. Otherwise it reads the line left's correlation half an interval on (`half`) and a quarter of an interval on (`quarter`), both with `crossings.correlation_on` (each the larger of the two whole lags about the span), saying `"cycles"` only where `half` is `BOB_TWICE` (0.28) or more and `quarter` is `-BOB_TWICE` (-0.28) or less (the line is as it was half an interval on and turned over a quarter on, which is a rise and fall twice an interval; a step's bob is turned over half an interval on, and any flow left over is as it was at both half and a quarter of an interval on so it cannot pass the quarter test), null otherwise with `why` giving both values. Where any frame's lowest solid row is the frame's last row (`legs.body_signals` `edge`), `says` is null, `why`: "its lowest row is the frame's last row in {n} of {N} frames: the feet may run off the frame, and the picture moving is not read off them" (there the lowest row is the frame's, not the feet's). `local_cycle.twice_an_interval(values, interval)` reads `values` (per frame) less their flow (`off_flow`), then a least-squares fit of a mean, the harmonic twice an interval (cos and sin of 4 pi k / `interval`) and the harmonic once an interval (cos and sin of 2 pi k / `interval`), k the frames left counted from the first; it returns the twice-an-interval harmonic as a complex amplitude (its cos coefficient less i times its sin coefficient), in the values' units (a line rising and falling a rows either way twice an interval reads a in magnitude; lines read so over the same frames and interval subtract as they move), or None where fewer than `BEAT_FRAMES` (8) frames are left; where none, `says` is null, `why`: "its top line's rise and fall twice an interval is not read against its lowest row and upper body: under 8 frames are left less the flow". `local_cycle.own_beat(signals, interval)` reads three lines with `twice_an_interval`: the top line (`top`), the lowest solid row (`reach`) and the lowest opaque row (`sole`); it returns, in rows up and down (twice the magnitude): `beat` (the top line's), `lowest` (the lowest row's), `sole`, `less_lowest` (the top line's less the lowest row's: the picture moving taken out), `bands` (`{rows, width, zoom, beat, reads, less}`, per band: its rows below the first solid row, its width in the median frame and `zoom`, in pixels, `beat` in pixels, `reads` is the band's `beat` over its `zoom` (the share of the zoom making the line's rise and fall that the band reads), read whatever its turn: a zoom moves a band's width in step with the line it lifts, but the band's own parts swinging across it (arms, a cape) move it too, in step with the line, against it, or a quarter of the beat off, and the zoom's part is not told from theirs. `less` is what is left of the top line's rise and fall twice an interval less as much of the zoom as the band reads: `less_lowest` times (1 - `reads`), and nothing where `reads` is 1 or more, so a band whose width moves against the line adds nothing to what is left, `reads` and `less` null where the band is not seen), `less_bands` (the least `less`, null where no band is seen), `still_bands` (the number of bands seen whose `reads` is at most 1 - `BOB_SCALE`, 0.4: they hold still on the beat), and `own`, the smaller of `less_lowest` and `less_bands` (None where a line is not read). The floor is the larger of `BOB_ROWS` and `BOB_FLOOR` of the body's median height; where `less_lowest` is under the larger of `BOB_OWN` (0.3) times `beat` and the floor, `says` is null, `why`: "its lowest row rises and falls with it: less the lowest row's, its top line's rise and fall twice an interval is {x} rows of {beat} ({percent}; at least 30% and {floor} rows): the picture moves with the body, and the body's own is not told from it"; where no band is seen (`less_bands` null), `says` is null, `why`: "no band of its upper body would show the picture zooming: zoomed in as far as its top line rises and falls twice an interval against its lowest row ({less_lowest} rows of {height}), no band's width moves 1 px (at most {largest zoom}): the picture zooming with the body is not told from the body's own"; where `less_bands` is under the largest of `BOB_OWN` times `beat`, the floor, and `BOB_SCALE` (0.6) times `less_lowest`, `says` is null, `why`: "its upper body's width changes with it: less as much of the zoom as its band {a}% to {b}% of its height below its top reads, its top line's rise and fall twice an interval is {x} rows of {beat} ({percent}), {ratio} of the {less_lowest} left against the lowest row (at least 30%, {floor} rows and 0.6): the picture may zoom with the body, and the body's own is not told from it"; otherwise `says` `"cycles"`. This tells them apart because a body rising and falling on its legs leaves its planted foot, the lowest solid row, on the ground, and carries its upper body's bands whole and leaves their widths: the picture moved up and down carries the lowest row with the top line by the same rows, so nothing is left of the line's rise against it, while the picture zoomed in and out widens each band as it lifts the line, as far as the band's outline lets it, so nothing is left once the zoom is taken out too. Where no band would show the zoom, or any band that would moves on the beat (arms swinging past the body's sides, a cape, or the picture zooming), nothing tells the picture zooming from the body's own, and nothing is witnessed; one band holding still says only that no zoom shows in that band (a head drawn narrower as the picture zooms in holds still so). Two limits the code does not catch: (a) a picture zoomed on the beat with every band seen drawn against the zoom, so that each band holds still, is read as the body's own (its band widths are those of an upper body rising whole on its legs; measured on one such drawing, every band within 0.78 px of such a body); (b) a body that rises and falls twice a step on its own legs reads as two steps an interval of one. A walk whose arms swing past its sides on the beat is not witnessed where a band seen moves on the beat (its `reads` over 0.4). Where a walk is not witnessed, its crossings stay on steps, or its cut is held, and either way it is named, never handed out as a cycle unnamed. New `legs.body_signals(frames)` reads per frame `bands`, each band's mean width in alpha, in pixels, read on the same rows in every frame, those of the clip's median body height (`legs.BANDS` = `((0.02, 0.10), (0.10, 0.18), (0.18, 0.26), (0.26, 0.34), (0.34, 0.42), (0.42, 0.50))`), and `edge`, 1 where the lowest solid row is the frame's last row, else 0; only the step count's witness reads them, merged by `loop.read_steps` into the signals it passes to `local_cycle.read_cycles`; `legs.strike_signals` is unchanged, so the loop report's `gait.silhouette.signals` is unchanged, and `--anchor none` still gives the old cut, its pictures and reports byte for byte apart from the engine hash. The directional foot cue (`legs.shade_cue` from the side or diagonal, `legs.depth_cue` from the front or back) is read with a view given by `local_cycle.cue_word(cue, interval, step=None)` and can only refuse cycles: under `CUE_FLOOR` (0.5) of the step it is drawn in (`legs.TONE`, 1/255, or a pixel row of median body height) it says `"alike"`; where it turns over one interval on (`crossings.correlation_on` at or below `CUE_SWAPPED`, `-0.2`) it says `"steps"`, refusing cycles because the other leg leads there; otherwise null. With no view no cue is read at all. Where the view's cue says `"steps"`, the count stands (two steps); else where the bob says `"cycles"`, cycles are marked; otherwise crossings stay on steps with `unwitnessed` true (`local_cycle.UNWITNESSED`) and a warning (`cycle-unwitnessed`). When cycles are marked, `Reading.mark_cycles` sets `per` to 2 and halves `step` and `step_range`: a cut one interval long is two steps, and the search's cut (`--anchor motion-auto`) taken on it writes `steps: {count: 2, by: crossings}`. A fixed cut (`--cycle fixed`, `fixed_count`) and the loop as it plays round (`ring_steps`) read the same; a fixed cut one interval long is counted two steps and not refused, and still writes no `steps`.+- **Removed: the same-picture rule (`local_cycle.same_picture`, `local_cycle.same_picture_count`, `local_cycle.SAME_PICTURE_MAX`, count code `same-picture`, report fields `step_count.search.same_picture` and `step_count.same_picture`).** It kept the search's cut, with no `steps`, where the count said one step; it never cut one cycle where the search had found two. `local_cycle.read_cycles` takes its place.+- **New: walk start-stop retake reporting (`loop.stand_retake`, `crossings.Reading.stands`).** In gap mode, runs where the feet stay together longer than `run_limit` (√2 times the median whole pass run) are recorded in `Reading.stands`. Where a clip shows its steps, contains `stands`, and the cut kept does not count two steps (`verdict` is not `two`) with no two-step cut closing between the standing frames, `loop.stand_retake` emits a `retake` report (`reason: "start-stop"`, `remedy: "retake"`), keeping the cut as cut without refusal under `--unfixed refuse`. Where a part also pops, one `retake` names both (`loop.retakes`): the first reason's record, `reasons: ["part-pop", "start-stop"]`, and each reason's numbers under its own key (`part_pop`, `start_stop`).+- **Changed: `video-set` defaults gait anchoring to `motion-auto` (`batch.anchor_for`).** Without an explicit `--anchor`, `video-set` cuts each walk and run item whose loop is searched (`cycle_for` returns `auto` or `periodic`) with `motion-auto`, and assigns `none` to idle, attack, once-hold, lifetime, and once-return items; explicit `--anchor` options are applied to every item as before. `video-set` passes each item's view to `video-loop`. Any item whose loop names a retake carries `loop.retake`, appears in the set's `warnings`, and appends ` (film again: <reasons>)` to `table.md`.+- **Changed: cycle alignment leaves out start-stop retake, cycle-unwitnessed and cycle-four-steps loops (`batch.align_gaits`, `video-set --align-cycles auto`, `local_cycle.four_steps`).** Takes flagged with `start-stop` retakes loop no two steps, loops whose cut nothing witnesses whole cycles (`cycle-unwitnessed`: crossings left on steps unwitnessed, or a cut the cut witness held) may hold half a cycle or two, and the warning says so, and loops whose cut witness says four steps (`cycle-four-steps`) hold two cycles where their strip counts two steps (`steps: 2`, which `video-cycle-align` reads as one cycle) and would play twice as fast if aligned as one cycle; all are excluded from gait cycle alignment, keeping their loops as cut while aligning the remaining directions. Excluded items are recorded under `left_out` (`{item: reasons}`, listing `["start-stop"]`, `["cycle-unwitnessed"]`, `["cycle-four-steps"]`, or `["start-stop", "cycle-unwitnessed"]`) with a stderr warning and a set warning; if fewer than two directions remain, alignment is skipped (`applied: false`, `why: "fewer than two directions left to align"`). A left-out loop whose step screen suspects one step is told in its warning what settles it (`video-loop --steps 1`), as `video-cycle-align` says when it stops on such a loop, and `batch.left_out_why` takes `one_step`.+- **New: a walk's cut is held to its body's word before it is cut (`loop._witnessed`, `local_cycle.cut_word`, `local_cycle.unwitnessed`, `local_cycle.held_verdict`).** In `video-loop --anchor motion-auto` (`--cycle auto` or `periodic`), after `loop._by_steps` chooses the cut and before frames are cut, `loop._witnessed(cycle, frames=...)` holds the cut s/L to `local_cycle.cut_word(signals, length)`, which reads `local_cycle.bob_word` on two lines, `local_cycle.CUT_LINES` (`'screen'` on the screen, less its flow, and `'feet'` over its feet with `local_cycle.over_feet`, `feet=True`), at length L, L/2 and 2L (a picture swaying up and down once a cut or slower hides the body's rise and fall twice the cut on the screen, where the line over the feet reads it; a walk whose lean changes slowly on its feet tilts the ground under them, so the line over the feet takes in the two feet's heights by turns and reads no rise and fall, where the line on the screen reads it) and says the first either line says in `local_cycle.CUT_WORDS`: `"two steps"` (a cycle), `"four steps"` (two cycles), `"one step"` (once in the cut), or null. On two steps or four steps the cut stands (`{cut: [s, L], ...cut_word's record}`; where the cut stands and its lowest row rises and falls twice the cut more than its top line on the screen, the record carries `mark`; it holds nothing), and a cut of four steps (two cycles), its strip still counting two steps, makes `local_cycle.four_steps(cycle)` true, and `video-set` leaves the item out of cycle alignment (`left_out` `["cycle-four-steps"]`); anything else is held exactly as chosen (two clip crossing intervals where counted, else the search's cut), setting `cut_witness.held` to `"unwitnessed"`, warning `cycle-unwitnessed` (`local_cycle.held_verdict(cycle)` via `local_cycle.step_verdict`), and marking `local_cycle.unwitnessed(cycle)` true so `video-set` leaves the item out of cycle alignment (`left_out` `["cycle-unwitnessed"]`), while cuts the step count already held record `held: "step count"`. A reading of `"one step"` is held and never cut again two long because a body rising and falling once in the cut cannot be distinguished between half a cycle of legs drawn alike and a full cycle of a limp or bouncing legless body without reading legs, and the witness never lengthens or shortens a cut; walks whose body rises once a cycle, legless bodies bouncing once in the cut, and walks carried whole with no rise of their own are held and named even where a cut is a whole cycle.+- **Changed: the body's own rise and fall is read against the lowest opaque row as well (`legs.body_signals` `sole`, `legs.OPAQUE`, `local_cycle.own_beat`).** `legs.body_signals(frames)` now returns `sole` per frame, taking the lowest row with an alpha of `legs.OPAQUE` (255) or the lowest solid row where none is opaque. `local_cycle.own_beat(signals, interval)` reads `sole` with `twice_an_interval` and takes `less_lowest` as the top line's rise and fall less the lowest solid row's or less the lowest opaque row's, whichever leaves less, returning `sole` as rows up and down. This prevents a translucent shadow drawn fixed on the screen under the feet from acting as the lowest solid row and registering picture shake twice an interval as the body's own rise against it, since opaque feet move with the picture.+- **New: the order the feet are drawn in witnesses a walk's steps (`legs.feet_order`, `legs.CONTACT`, `local_cycle.order_word`, `ORDER_ROWS`, `ORDER_TRAVEL`, `ORDER_SWAY`, `ORDER_REACH`, `ORDER_SLACK`, `ORDER_WORDS`).** `legs.feet_order` tracks which foot is drawn lower in each frame, and `local_cycle.order_word` gates side changes to witness one, two, or four steps across a span from non-side views. From the front, the back, or a diagonal, the foot nearer the viewer is drawn lower, and the nearer foot changes sides once a step, twice a cycle. The view's label is not taken for it, because a generated walk's label may be wrong: the clip must show that its two sides of feet are its two legs, or nothing is witnessed. `read_cycles` and `cut_word` read the foot drawing order when body cues do not witness crossings or cuts, and search cuts that failed to close are held unwitnessed rather than stood by foot order. A diagonal walk whose feet pass each other on the screen, one foot always drawn lower and the other passing it on either side, shows the same changes a side walk does, and the order does not witness it; a side walk is never read on the order. Before its gates, `local_cycle.order_word` leaves out frames whose contacts touch no column of anything standing on the lowest row in any frame, recorded in `off_ground`, so a dipping tail is not read as a foot and changing sides to count half a cycle as a whole, at the cost of leaving out feet lifted over columns where nothing ever stands. As a named limit, a tail hanging over the columns the feet stand on is still read as a foot, held only by the gates after the reading (the sliding check, the ground travelled, and the upper body's sway).+- **Changed: standalone `video-cycle-align` stops on held or four-step cuts (`align.held_cut`).** `video-cycle-align` run on its own reads the cut report beside each loop through `align.held_cut(loop_dir, meta_path, meta)`. Where nothing witnessed the cut whole cycles (`cycle-unwitnessed`) or the cut spans four steps (`cycle-four-steps`), the loop is named under `held` and the aligner stops under `--multi-cycle fail` before rewriting any files, adding "and nothing witnessed some of the cuts whole cycles". Under `--multi-cycle warn` it aligns the loop with a warning, matching `video-set` instead of aligning held loops as one cycle without a word.+- CLI: `video-loop --view front|back|side|front_diagonal|back_diagonal` (default none) sets the clip view for cycle detection and foot cue selection.+- Report fields: `cycle.step_count.cycles` (`{asked, interval, overlap, half, one, two, slack, cue, bob, cycles, unwitnessed, why}`, where `cue` and `bob` are recorded only where the picture passes, `cue: {range, floor, swapped, one, says, why}` only with a view, `one` absent where `says` is `"alike"`, `bob: {swing, rows, floor, twice, half, quarter, edge, body: {beat, lowest, sole, less_lowest, less_bands, still_bands, own, bands: {rows, width, zoom, beat, reads, less}, share, scale, least, scale_least, band_floor}, says, why}`, `half`, `quarter`, `edge` and `body` absent under the floors, `body` absent where under 8 frames are left, and `why` absent where it says `"cycles"`, and `unwitnessed` true only where nothing witnessed); the loop's warnings (`jolt.warnings`); `step_count.stands` and `step_count.run_limit`; `loop.retake` (`{reason: "start-stop", reasons, start_stop: {stands, run_limit, crossings, cut, verdict, code, why}, remedy: "retake"}`); the set report's item `loop.retake` (`{reason, reasons, remedy}`) and item `loop["cycle-unwitnessed"]` (`true`), and its state's `cycle_align.<state>.left_out` (`{item: reasons}`); the loop report's `cycle.cut_witness` (`{cut, says, by, lines, on, why, held, mark}`, `lines` (`{screen, feet}`, each `{says, bob, on, why}`), the feet line's `bob` and `on` with `over`, `by` only where it says a word, `on` with its `line` and `interval` only for four steps or one step, `why` only where `says` is null, `held` only where held, and `mark` only where marked); the printed summary's `cycle.cut_witness` (`{cut, says, by, held, mark}`, each where present). `cycle.step_count.cycles.order` and `cut_witness.order` record foot-order metrics (`apart`, `swing`, `floor`, `changes`, `slides`, `spacing`, `travel`, `sway`, `tilt`, `per`, `says`, `why`, `off_ground`), and `video-cycle-align` reports held suspect loops under `held` with `{reason, report}`.+- Python callers: new `local_cycle.read_cycles(reading, distances, view=None, cue=None, cue_step=None, signals=None)`, `local_cycle.bob_word(signals, interval, feet=False)`, `local_cycle.twice_an_interval(values, interval)`, `local_cycle.own_beat(signals, interval)`, `local_cycle.cut_word(signals, length)`, `local_cycle.over_feet(signals, interval)`, `local_cycle.unwitnessed(cycle)`, `local_cycle.four_steps(cycle)`, `local_cycle.held_verdict(cycle)` (refuses with a `ValueError` a cut held on one step whose record names no line it was read on (no `by` or `lines`)), `legs.OPAQUE`, `local_cycle.BOB_OWN`, `local_cycle.BOB_SCALE`, `local_cycle.BEAT_FRAMES`, `legs.body_signals(frames)`, `legs.BANDS`, `legs.band_rows(median)`, `legs.band_widths(alpha, rows)`, `legs.zoomed(alpha, scale)`, `local_cycle.BAND_FLOOR`, `local_cycle.off_flow(values, interval)`, `local_cycle.cue_word(cue, interval, step=None)`, `local_cycle.BOB_TWICE`, `local_cycle.BOB_FLOOR`, `local_cycle.BOB_ROWS`, `local_cycle.CUT_LINES`, `local_cycle.CUT_WORDS`, `local_cycle.UNWITNESSED`, `local_cycle.FOUR_STEPS`, `local_cycle.CUE_FLOOR`, `legs.TONE`, `local_cycle.repeat_at(distances, span)`, `batch.anchor_for(state, cut, anchor)`, `batch.left_out_why(reasons, stands=False, one_step=False)`, `loop.stand_retake(cycle)`, `loop.retakes(*records)`, `loop.STAND_REASON`; `crossings._alternation` is now public `crossings.correlation_on(values, span)`; `align._feet`, `align._depth_cue`, `align._shade_cue`, and `align.SHADE_BAND` are moved to `legs.feet_halves`, `legs.depth_cue`, `legs.shade_cue`, and `legs.SHADE_BAND` (`align` keeps `_depth_cue` and `_shade_cue` aliases); `crossings.Reading` gains `interval`, `per`, `cycles`, `hides`, and `mark_cycles(said)`. `local_cycle.read_cycles` and `local_cycle.cut_word` take `order`, `cut_word` takes `declined`, and `align.held_cut` checks loop cut reports.+- **Tests**: `tests/video/test_walk_steps.py` covers these synthetic walker cases (the walkers' bodies rise and fall on legs whose soles stay on the ground unless held still or drawn carried whole; the walkers whose body is witnessed (and those the cut's witness reads one step of) swing their arms within the body's sides, 8 px either way of its middle (`ARMS_IN`), the body's sides 28 px apart; the other walkers seen from the side, from behind or on a front diagonal swing them 16 px either way of the body's middle, past its sides; the walker seen from the front swings its arms up and down beside its body, and some walkers have no arms):+ - a walker seen from behind whose far foot hides behind the near one (feet together over half the interval) across cycles of 20 frames on twos, 24 on threes, and 17.5 and 18.5 on ones: its top line rises and falls twice an interval, cutting one cycle within a frame with `cycles` true, `steps: 2`, and no cue read with no view, its bob's `body.share` at least `0.3`, `body.scale` at least `0.6`, `edge` 0, every band seen holds still on the beat (`still_bands` equals the bands seen), and its `why` naming the body's own; the same walker with its far leg drawn as the near one (legs alike), with no view and with `--view back_diagonal`, is still cut to one cycle because the view's cue says `"alike"` (which no longer refuses) and the bob witnesses;+ - a front-diagonal walker whose near foot steps out toward the camera and passes the far one apart (feet together under half the interval, cycle 16 and 18): with `--view front_diagonal` cut to one cycle because its foot cue moves over the floor and does not turn over one interval on (`says` null) and its top line rises and falls twice an interval; without a view it is not asked and is cut to two cycles (32, 36 frames); its cut witness says `"four steps"`, its strip says `steps: 2`, and `local_cycle.four_steps` is true;+ - the walker seen from behind (17.5 on ones; no view and `--view back_diagonal`) and the front-diagonal walker (16, `--view front_diagonal`) with their bodies held still: the top line does not rise and fall (the line left under `BOB_FLOOR` of the body's height and under `BOB_ROWS` rows), keeping two intervals (two cycles) with `cycles` false, `unwitnessed` true, and the warning naming the cut;+ - a side walker whose two steps are one silhouette (46-frame cycle, near and far a tone or four apart), passes brief: not asked with no view or `--view side`, keeping two steps at 46 frames; the cut's witness then reads the cut: the arms move the bands they swing over on the beat, so nothing that reads no leg witnesses the cut whole cycles, and the cut is held as cut and named (`cycle-unwitnessed`, the warning), its why naming the upper body's width;+ - the same 46-frame walker filmed as a front diagonal, its far leg four tones off the near one, `--view front_diagonal`: the picture passes, but the foot cue turns over one interval on (`says: "steps"`), keeping two steps at 46 frames; its cut is held as cut and named by the cut's witness (the warning), for the same reason;+ - the same 46-frame walker with its legs drawn alike (arms still four tones apart) asked with `--view` set to `front`, `front_diagonal`, `back`, and `back_diagonal`: the picture passes, the cue says `"alike"`, and its top line rises and falls once an interval (a step), so its `half` correlation is negative, leaving nothing to witness and keeping two steps at 46 frames with `unwitnessed` true and the warning;+ - the same 46-frame walker with its legs drawn alike and twice as wide (10 px either side of its line instead of 5), so the feet are seen together over half the interval and a pass could hide: asked with no view and with `--view` set to `side`, `front_diagonal`, and `back`, keeping two steps at 46 frames with `unwitnessed` true and the warning (with a view the cue says `"alike"`, and with no view no cue is read);+ - the wide alike walker lit by a light fixed on the screen, lighter to the right (up to 12 tones across the feet), with no view and with `--view` set to `side`, `front_diagonal`, and `back_diagonal`: the shade of the feet moves with how far apart they are drawn and turns over half an interval on, but nothing witnesses, keeping two steps at 46 frames with the warning;+ - the alike walker (legs 5 px) with the leg swinging forward lifted 6 px at its pass and a light fixed on the screen varying top to bottom (12 tones), asked with `--view` set to `front`, `front_diagonal`, `back`, and `back_diagonal`: the cue moves with the swing whichever leg swings and turns over half an interval on, but nothing witnesses, keeping two steps at 46 frames with the warning;+ - the wide walker with its far leg four tones off the near one (where a pass can hide): with `--view side` or `front_diagonal` the cue turns over one interval on (`"steps"`), keeping two steps at 46 frames with no warning, while with no view no cue is read and nothing witnesses, keeping 46 frames with `unwitnessed` true and the warning;+ - the wide legs-alike side walker (46-frame cycle, crossings every 23 frames, a pass can hide), carried up and down with the whole picture: along a smooth arc 24 px deep, and, with its body held still, along the same arc, along a sway 12 px either way, four intervals long (92 frames), and down a ramp 24 px over the clip, a row every three frames; each is cut two steps, 46 frames, with `unwitnessed` and the warning; for the bobbing walker its `half` is `-0.28` or less (less its flow its line rises and falls once an interval); for the still one its `rows` is under `BOB_ROWS`; before this change every one of the four was cut one step, counted two, and no warning said so;+ - the walker seen from behind whose far foot hides behind the near one (cycle 17.5 frames on ones, legs drawn alike), carried along the arc and the cubic: cut one cycle; the bob says `"cycles"` with its `quarter` at `-0.28` or less;+ - synthetic units meeting every 15 frames verify that where a pass can hide (feet together 9 frames at each meeting), a top line rising and falling every 7.5 frames (twice an interval) marks cycles (15 frames kept as one cycle, `steps: 2`), while rising and falling every 15 frames (once an interval) or held still keeps two steps of 15 (30 frames) with `unwitnessed` true and the warning; brief meetings with no view or `side` are not asked; on front diagonals with brief meetings, a cue turning over every 15 frames (one interval on) keeps two steps of 15 (30 frames) whatever the body does, and a cue turning over half an interval on and holding one interval on is no witness (30 frames with the warning when the top line is once an interval, 15 frames and one cycle when twice an interval); a still cue (range far under half a tone) or one flickering every 4 frames refuses nothing, letting the body decide (twice an interval: one cycle of 15; held still: 30 with the warning) on front diagonals with brief meetings, back diagonals where a pass can hide, and with no view where a pass can hide; and `bob_word` on an interval of 15 frames for a body 100 rows tall says `"cycles"` with 3 rows either way every 7.5 frames, says null every 15 or 30 frames, and says null under the floors at 0.2 rows either way without reading `half` or `quarter` (`swing` and `rows` are the range of `off_flow`'s line), while for a top line in whole rows on a picture held still or carried along an arc 24 rows deep, a cubic 48 rows either way, a sway 12 rows either way four intervals long, or a ramp of 6 rows over the clip, rising and falling twice an interval says `"cycles"` under every one, once an interval, or not at all, says null under every one, and not rising at all, on the still picture, the arc, the cubic or the ramp, the line left is under `BOB_ROWS`, and `off_flow` over intervals of 15 and 17.5 frames takes a cubic flow out wholly and leaves a rise and fall once or twice an interval as it was (less its straight line) over the frames the interval fits about;+ - the walker seen from behind whose far foot hides (cycle 17.5 frames on ones, no view) and the front-diagonal walker whose near foot steps out (cycle 16, `--view front_diagonal`), their bodies rising and falling twice an interval carried whole, feet and all: cut two intervals, `unwitnessed`, the warning; the bob's `half` is `0.28` or more and its `quarter` `-0.28` or less (the top line alone rises and falls twice an interval), its `body.share` is under `0.3`, and its `why` says its lowest row rises and falls with it;+ - the wide legs-alike side walker (46-frame cycle, its crossings its steps every 23 frames, a pass can hide), held still or rising and falling on its legs once a step, on a picture shaken up and down 3 px twice an interval (dy = round(3 sin(4 pi k / 23))): two steps, 46 frames, `unwitnessed`, the warning; held still, its bob's `half` is `0.28` or more and `quarter` `-0.28` or less, and its `why` says its lowest row rises and falls with it;+ - the walker seen from behind (17.5, rising and falling twice an interval on its legs), its frames cut at the soles' row so the lowest row is each frame's last: two intervals, `unwitnessed`, the warning, `edge` over 0 and a `why` naming the frame's last row;+ - `twice_an_interval` over intervals of 15 and 17.5 frames: a line rising and falling 3 rows either way twice an interval, with a rise and fall of 2 rows once an interval and a cubic flow 48 rows either way laid on it, reads 3 rows (within 0.15); the same rise and fall on a constant reads within 0.15 of it; 14 frames over an interval of 15 read None;+ - `bob_word` over an interval of 15 frames, the body 100 rows tall, its lines in whole rows: a top line rising and falling 3 rows either way twice an interval with the lowest row still says `"cycles"` (`share` over 0.9, `scale` 1); the same rise and fall with the lowest row rising and falling with it (the body carried up and down whole, or held still on a picture shaken twice an interval: the same lines) says null, its `why` naming the lowest row; a rise and fall of 3 rows of its own on a picture shaken 12 rows with it (its own a fifth of the line's, under `BOB_OWN`) says null;+ - `bob_word`: the body zoomed in and out twice an interval with the picture about its feet (3 % either way: the top line 3 rows, the lowest row still) or about its middle (6 %: the top line and the lowest row 3 rows either way, turned over from each other), its upper body's width and height scaled with it: null, `scale` under `0.6`, its `why` naming the upper body's width;+ - `bob_word`: the planted rise and fall says `"cycles"`; the same with the lowest row on the frame's last row in one frame of 73 says null, `edge` 1, `why` "in 1 of 73 frames";+ - read off drawn frames with `legs.strike_signals` and `legs.body_signals`: five walkers that do not rise and fall twice an interval on their legs (the wide legs-alike side walker, interval 23, held still, carried whole bobbing once a step, or rising and falling on its legs once a step; the walker seen from behind, legs alike, interval 17.5, held still or carried whole rising and falling twice an interval), each moved up and down with the whole picture 3, 6 or 12 px either way every d/4, d/2, d or 2d frames (d its interval) at four phases: none is witnessed. Three of them (the side walker held still and on its legs, the walker from behind held still) zoomed in and out 0.5, 1, 2 or 4 % either way every d/4, d/2 or d frames about the feet, the middle or the head, at two phases: none is witnessed;+ - the wide walker, its head's top flat, round, pointed or two ears' tips, held still or rising and falling on its legs once a step, zoomed in and out 4 % either way with the picture about its feet, middle or head every quarter, half or whole cycle (11.5, 23 or 46 frames): never two steps an interval of a step (23 frames), nor a cut of a step said to be a cycle or two, nor a cut of two cycles (92) said to be one; cut through the loop, the walker with a pointed head or ears zoomed every quarter cycle (11.5 frames), and the walker with a pointed head held still zoomed about its feet twice a step, are never cut half a cycle unnamed;+ - a top line rising and falling twice an interval on legs whose feet stay on the ground witnesses two steps an interval on a body whose sides run straight down; on a cone from a point at its top (where a zoom would move no band a pixel) or where any band of its upper body moves on the beat: every band widening and narrowing 2 px either way twice an interval a quarter of the beat on, with or without the band across its head's top holding still, is held by default, the word saying why ("its upper body's width changes with it"); with every band holding still the word says "cycles";+ - the walker seen from behind whose far foot hides (17.5 on ones, no view) and the front-diagonal walker whose near foot steps out (16, `--view front_diagonal`), rising and falling 3 px on their legs once a step as the walkers cut one cycle do, their arms swinging 16 px either way of the body's middle, past its sides: cut two intervals, `unwitnessed`, the warning; `body.less_lowest` at least `BOB_OWN` of `body.beat`, `body.scale` under `0.6`, the largest band `reads` over `0.4`, `still_bands` fewer than the bands seen, and the why naming the upper body's width and that the picture may zoom with the body.+ - the walkers the tests witness, or whose cut the cut's witness reads one step, drawn instead with their arms swinging 16 px either way of the body's middle, past its sides (nineteen forms, `PAST_ITS_SIDES`): none is a silent half cycle. A walk whose feet meet once a cycle (the walker whose far foot hides, 18.5 frames on ones, 20 on twos and 24 on threes; the same with its legs drawn alike, 17.5 and 20, with no view and with `--view back_diagonal`; the front-diagonal walker whose near foot steps out, 18, `--view front_diagonal`; the walker whose far foot hides, legs alike, carried along the arc and the cubic; the same walker turned 15 degrees about its feet over the clip) is cut two intervals, `unwitnessed`, the warning, its bob's `why` naming the upper body's width. Any other cut is held as chosen (`cut_witness.held` `"unwitnessed"`, its word null, the warning): 46 frames for the wide walker with its far leg four tones off (`--view side` and `--view front_diagonal`), 23 for the sliding foot and for the walker held still over a shadow on a picture shaken twice a step, 30 for the limp, and a cycle for the walks on a picture swaying once a cycle or slower.+ - the wide walker held still on its legs, zoomed in and out 4 % either way with the picture about its feet twice a step (every 11.5 frames), its head drawn narrower as the picture zooms in, and the body under it swinging on the beat: its torso's half width 4 px either way a quarter of the beat off the zoom, in step with it, or against it; or a crown 13 rows deep drawn narrower as the picture zooms in over a cape widening and narrowing 4 px either way a quarter of the beat before the zoom: cut through the loop it is held (`unwitnessed`), never cut 23 frames (half a cycle) as two steps unnamed; read off its frames at an interval of 23, its top line rises and falls twice an interval (`half` at least `BOB_TWICE`, `quarter` at most `-BOB_TWICE`), at least one band holds still on the beat, and the word says null, its why naming the upper body's width.+ - read off 128 drawn frames at an interval of 16, a column 20 px wide on feet planted at row 140, its top rising and falling 3 rows either way twice an interval, its crown (11 rows) and the column under its shoulders holding still, and its shoulders (the 41 rows under the crown) widening and narrowing 2 px either way a quarter of the beat on: five bands are seen, one holds still and four move on the beat, and the word says null, its why naming the upper body's width.+ - the side walker rising and falling on its legs once a step (its crossings its steps), running: both soles lifted up to 1, 2, 3 or 6 px off the ground while the body is high; still or on a picture moved 6 px either way every d/2 (two phases) or every d frames: never witnessed;+ - the side walker drawn as a view from behind or a diagonal draws feet, each sole up to 6, 12 or 24 px lower the further back its foot is, the foot moving forward lifted 8 px (the lowest row is the planted foot, sliding down the screen through its step); still, or on a picture moved 3, 6 (four phases) or 12 px either way every d/2 frames, or 6 px every d: never witnessed;+ - synthetic start-stop clips with feet together for 15 frames at the head and 14 at the tail alongside passes of 8 and 3 frames flag retakes when the cut is uncertain, omit retakes when counted as two steps, and report no `stands` when feet only pass.+ - `cut_word` units on a cut 16 frames long with a body 100 rows tall on feet that stay on the ground report "two steps", "four steps" (`on.interval` 8), "one step" (`on.interval` 32), and null as its top line rises and falls 3 rows either way every 8, 4, or 16 frames or is held still: both lines say the word, `by` is both lines; where null, each line's why is in `why`.+ - a record held on one step with no `by` or `lines` (built from `cut_word`'s record of a top line rising and falling once in a cut 16 frames long, its reading over the feet kept at its top) is refused by name, a `ValueError`, through `held_verdict` and through `step_verdict`; the same with nothing read (`says` null, its why kept) gives one warning naming its why and `cycle-unwitnessed`.+ - a unit with the body on a picture moved 3 rows up and down twice an interval of 15 frames and a translucent shadow fixed on the screen as its lowest solid row yields `says` null with "its lowest row rises and falls with it" when read against the lowest opaque row, and reports "cycles" with the lowest opaque row where the lowest solid row is.+ - the shadow walker: through the loop it is drawn with its arms swinging past its sides, leaving the step count no feet to read so the search cuts 23 frames, held at 23 and named with null whether it rises and falls on its legs or is carried whole; drawn with its arms within its sides and read off its frames (`cut_word` on the cut's length), the word says "one step" when it rises and falls on its legs and null when carried whole; so drawn, the loop refuses it: its wrap jumps (the seam ratio over 2.0), as it does where the walker is held still on its legs.+ - the same walker swinging its arms within its sides with each sole drawn up to 12 px lower the further back its foot is and the foot moving forward lifted 8 px has the step count count the search's 23 frames as two steps, returning "one step", held and named.+ - the same walker over a shadow fixed on the screen apart under its feet on a picture shaken 12 px up and down every half step counts two steps by the crossings with a cut of 14 frames or under, held and named.+ - the same walker on a picture moved 12 px up and down every two thirds of a step has the search cut 16 frames or under, held and named.+ - the same walker swinging its arms within its sides held still on its legs over a shadow fixed on the screen touching its soles on a picture shaken 6 px twice a step reads no feet, cuts 23 frames; on the screen its top line rises and falls twice the cut with the picture (`half` at least `BOB_TWICE`, `quarter` at most `-BOB_TWICE`), and its lowest opaque row (the feet's) with it, more than the lowest solid row (the shadow), its why saying its lowest row rises and falls with it; over the lowest opaque row (`over` `sole`) its top line holds still (under `BOB_ROWS` rows: "does not rise and fall"); neither line witnesses the cut, and it is held and named (read over the lowest solid row alone, the shadow holding still, the picture's shaking witnesses "two steps" with every band of its upper body holding still on the beat).+ - a walk rising and falling on its legs once a step, swinging its arms within its sides, its feet on the ground, on a picture swaying up and down once a cycle or slower (the wide walker with its legs drawn alike, crossings every 23 frames, a cycle of 46 frames, the picture swaying 12 px either way every 46 frames or 24 px every 69 frames; and the walker whose far foot passes hidden, 20 frames a cycle on twos, the picture swaying 24 px every 40 frames, up first) is cut one cycle, its cut witnessed `"two steps"` by the line over its feet (`by` includes `feet`), read over `reach` or `sole`, not held, no warning (read on the screen alone, the sway hides the body's rise and fall twice the cut, and the cycle would be held).+ - the walker whose far foot passes hidden behind the near one, its legs drawn alike, its feet meeting once a cycle (17.5 frames), rising and falling on its legs once a step, turned 15 degrees about its feet over the clip (k/72 of it in frame k, on a canvas 60 px taller above and below: a lean changing slowly on its feet), swinging its arms within its sides: it cuts one cycle (within 1 frame of 17.5), the count reading its crossings as cycles (`cycles` true, `steps: 2`); on the screen the top line, less its flow, rises and falls of its own twice the cut, every band of its upper body seen holding still on the beat: the cut's witness says "two steps", the screen among the lines that say it (`by`), not held, no warning; read off its frames on a cut of 18, the line over its feet says null: it does not rise and fall twice an interval (the lean tilts the ground under the feet, and the line over them takes in the two feet's heights by turns), where the line on the screen says "two steps" (`by` the screen alone).+ - a side walker whose legs four tones apart tell its steps apart on a 30-frame cycle, swinging its arms within its sides, filmed 100 frames, with its body sinking 3 px once a cycle and not at each step (a limp) is cut 30 frames by the search, two steps by the crossings, returning "one step", held and named, and is never cut 60 frames long.+ - the legless body bouncing every 16 frames: the search cuts one bounce (16 frames, within 1) and the cut stands as cut, never cut again two long; it squashes as it bounces, so its upper body's widths, read on rows below its top, change with it on that beat: nothing witnesses the cut (`says` null), and it is held and named; read on twice its cut, its top line rises and falls twice that interval and the word says null, its why naming the upper body's width.+ - the walker seen from the front whose feet stay apart (stepping foot drawn up to 3 px under the ground, the other as far over it; right foot swinging in to meet the left only while it is drawn higher, the other foot drawn lower and nearer the viewer, and back out before it is drawn lower; no foot standing on the ground sliding along it; arms swinging within the body's sides; body not rising and falling), 20-frame and 24-frame cycles, `--view front`: cut one cycle, `steps` 2, `cycles.order.says` "two steps", zero slides, travel under `ORDER_TRAVEL` of spacing, body word null, `cut_witness` "two steps" by `["order"]`; with `--view side`: cut two intervals, `cut_witness.held` "unwitnessed", no order read (previously cut two intervals with a warning).+ - the walker from the side with legs drawn alike (46 frames, swinging leg lifted 6 px at pass) with no view and with `--view` front, front_diagonal, back, and back_diagonal: cut 46 frames, `steps` 2; crossing check has `cycles` false, `order.why` value stating a foot passes under the body; cut never stands on order.+ - the walker whose feet stay apart (cycle 30) tested across spans in `local_cycle.order_word`: spans of 30, 60, and 15 frames, `says` value "two steps", "four steps", and "one step", span 22 none, also checking that no foot slides and that the upper body's sway stays under `ORDER_SWAY` of the tilt; picture rocked 10 degrees either way about feet once a cycle, feet drawn level and still, `says` null, `why` value stating it may rock on its feet; the same walker drawn with its right foot sliding along the ground, planted, to meet the left as both stand level and back out, `says` null, `why` value stating a foot slides (the order is not read where a foot on the ground passes under the body toward the other side); lifted-foot side walker with legs 5 and 10 px either side of line, `says` null, `why` value stating a foot passes under the body; rear walker with soles on one row, `says` null, `why` value stating feet are drawn level.+ - the walker whose feet stay apart cut 20 frames, `--view front`, under `loop._witnessed`: cut stands on order, `by` `["order"]`; with step count `declined` record set: cut held, `cut_witness.held` "unwitnessed", `order.read` "two steps", `order.why` value stating order does not stand a length the closing refused.+ - the walker seen from the front whose feet stay apart (cycle 30 frames, body still), its feet meeting on the screen once a cycle, or once a step where `each_step` is set (the left foot swinging in to meet the right while drawn higher), drawn with a tail (`_dipping_tail`: from the hip to a tip 28 px to its left, rising and falling 8 px either way on a 17-frame beat of its own, dipping into the foot band about a third of the time, never as low as the feet nor over a column they stand on): `order_word` over 30 frames (meeting once a cycle) says "two steps", over 15 frames (once a cycle) and over 15 frames (once a step) "one step", what the same walker drawn without the tail says, never "two steps" where the walker holds one, with `off_ground` exactly the frames whose left side is the tail and no counted change falling on them (before: the tail's frames were read as feet, and over 30 frames the walker meeting once a cycle said nothing).+ - the 46-frame side walker lifting its swing foot 6 px, drawn with the tail 40 px behind: `off_ground` is the tail's frames, `says` is null and its why says a foot passes under the body (before: null as well, the tail's frames read as feet).+ - slow test of the walker meeting once a step with the tail, `--view front`: its crossings are never read as cycles, the cut witness stands a cut on the order (`by` `["order"]`) only where the cut is within 1.5 frames of the 30-frame cycle, and no cut under three quarters of the cycle is handed out without a warning naming it (before: `video-loop` stopped on the division by zero).+ - the walker meeting once a cycle (cycle 30, body still, no tail): `cut_word` returns on every cut length from 10 to 46 frames; on cuts of 25, 26, 34 and 35 frames it says null with a why containing "its top line holding still" (before: it stopped on cuts of 13, 17, 25, 26, 34 and 35 frames).+- **Tests**: `tests/video/test_gait_guard_anchor_wide.py` and `tests/video/test_cycle_align.py` cover batch anchoring and cycle alignment:+ - `batch.anchor_for` assigns `motion-auto` to walk and run loops while assigning `none` to cheer, walk with `--anchor none`, and pinned idle items, propagating loop retakes to item records, warnings, and markdown tables;+ - `batch.align_gaits` excludes loops with a `start-stop` retake, a loop with `cycle-unwitnessed`, or a loop with both, names its reasons under `left_out` (`["start-stop"]`, `["cycle-unwitnessed"]`, `["start-stop", "cycle-unwitnessed"]`) and in the stderr warning, aligns remaining directions, and leaves the state unaligned when fewer than two directions remain.+ - `batch.align_gaits` with three directions, two loops of one cycle (20 and 24 frames) and one loop of two cycles (40 frames) whose strip says `steps: 2` and whose cut witness says four steps: the two-cycle loop is left out under `left_out` (`["cycle-four-steps"]`) and named in the warning, its loop and strip kept as cut (40 frames, `steps: 2`), and the other two are aligned to their median length.+ - three walker loops with reports beside them, the third loop marked held (`cut_witness.held` "unwitnessed") or four steps (`cut_witness.says` "four steps", strip `steps: 2`, walker two cycles long): standalone `video-cycle-align` stops with one suspect, `held` value `{reason, report}`, `settle` value `=1` and `=2`, nothing rewritten; `--multi-cycle warn` aligns and names reason; `--cycles` 1 or 2 aligns it, suspect `status` "counted" (previously aligned as one cycle without a word).+- **Tests**: `tests/video/test_one_step_cut.py`: a side walker whose cycle (42 frames) the walk window cannot hold is cut one step long (21 frames) by the pixel search, its feet read as unseen, and the step screen names it; before, the test said nothing else speaks (no `steps` and no warning about steps), whereas now there are still no `steps`, the walker is carried whole on its legs, so its cut witness holds the cut (`cut_witness.held` is `"unwitnessed"`, `local_cycle.unwitnessed` is true), and the one warning that speaks of steps is the witness's (`local_cycle.held_verdict`), naming `cycle-unwitnessed`. In a set of two items, the same walker on a 25-frame cycle (front, cut a whole cycle) and the one-step side walk, their rows now carry the marks `run_set` records (`cycle-unwitnessed` from `local_cycle.unwitnessed`, and `step_screen`) instead of rows built without them; both are left out of the alignment (`left_out` `["cycle-unwitnessed"]` each, `why: "fewer than two directions left to align"`), each warning says nothing witnesses its cut whole cycles and it may hold half a cycle or two, only the side walk's warning adds that it may be one step (cut it again with `video-loop --steps 1` if it is), `video-cycle-align` run on the items' loops reads the step screen in the report beside the side walk's loop and stops on it (`one_step`), naming `--steps 1`, and the set table still marks the side walk's cycle `(one step?)`. The walker carried whole on its legs across the two set tests: `video-cycle-align` now stops on both loops, each named `held`, `reason` "cycle-unwitnessed", the side loop also suspected one step; a count of one cycle for each settles it.+- **Tests**: `tests/video/test_cycle_suspects.py` and `tests/video/test_loop_prop_seam_held.py` cover standalone `video-cycle-align` on loops whose cut reports hold their cuts:+ - three synthetic loops in `tests/video/test_cycle_suspects.py` (S and E one stride of 24 frames each, NE two strides of 15 frames, 30 frames held on twos, as a two-cycle cut leaves it, with NE's cut report beside it as `video-loop` writes it holding its cut because nothing witnesses it whole cycles): stopping the set, run twice, names NE with its report beside it both for what the report holds (`held`, reason `cycle-unwitnessed`, with the report's path: it may hold half a cycle, one or two, and the message names `video-loop` to cut it again if it is one step) and for its return at 15 frames (it may also hold 2 cycles of 15 frames), while with the report removed (a loop cut by other means) it is named only for its return with no `held` and no mention of `video-loop`, both offering settle `=1` and `=2` with nothing rewritten (previously one run, NE named only for its return, and the message never named `video-loop`); `--multi-cycle warn` aligns the set as it is, NE's warning starting with nothing having witnessed its cut whole cycles and adding that it may also hold 2 cycles (previously the warning started with it may hold 2 cycles); the command line (`align.main`) without a count exits naming the held cut and the return at 15 frames, and with `--cycles NE=2` aligns as before (previously the exit named only the return).+ - two synthetic loops in `tests/video/test_loop_prop_seam_held.py` (one cut two steps long, one cycle, strip `steps: 2`, and one cut one cycle with no `steps`, neither walker's body rising and falling and its feet never passing, so both reports hold their cuts, nothing witnessing either whole cycles): on copies whose reports the test rewrites to witness their cuts (`cut_witness` saying "two steps" by the screen, nothing held), the aligner works as before: the two-step loop returns half way at its second step, which is no suspect (`status` "steps", `steps` 2, candidates `[2]`), and both loops are resampled to the median of their lengths as cut, nothing kept twice as long, the strip of the two-step copy still saying `steps: 2`, the other none; on the loops as cut, `video-cycle-align` stops on both, each named `held` with reason `cycle-unwitnessed`; a count of one cycle for each (`cycles`, the caller's word) aligns them as they are, to the same median length, each suspect `status` "counted"; a count of 2 for the two-step loop (and 1 for the other) still takes one half out of it, and its strip no longer says `steps`; two copies of the loop with no held part, aligned with a count of one cycle each, are written as before: no `cycles_kept` and no `steps` in their rows, their strip metadata with the same keys, and the cut's source (`source_cut`) as the cut wrote it (previously both aligned with no count, the two-step loop's return read as its steps).++ ## v3.11.0 - Sway regions laid over the figure (--region-over), rims widened for shear (--region-shear), figure membranes (--region-membrane), and recut strip pairing by cell records (--read-on-cut)++ **Upgrading from 3.10.1: `video-loop` writes `cell_record` into every strip record `<name>.strip.json`, and `video-sway` gains options that shape a `--region-mask` region alongside `--read-on-cut`. Strips, frames and records keep their bytes by default, but `video-sway --read-on-cut` reads cuts by that record alone and refuses cuts made without it.** New options `--region-over` and `--region-shear` shape the region mask and its rim; both are off by default, and when not given, strips, frames, and records remain byte for byte what they were. With `--region-crease` the wear wears the crease in as before; laid over the figure the region reaches down to the crease again in every cell, changing those runs' output. Runs with `--region-over` and runs with `--region-membrane` draw differently than in 3.10.1; the four new membrane options are off by default and byte for byte as before when not given. New options `--region-over-solid`, `--region-rim-round`, `--region-membrane` and `--read-on-cut` are off by default; when not given, strips, frames, and records remain byte for byte what they were. Runs with `--read-on` alone behave as before, except that its no-match message now names `--read-on-cut`. The refusal for `--region-over` or `--region-shear` given without `--region-mask` keeps refusing the same runs, and its message now names the new options too: "--region-over, --region-over-solid, --region-rim-round, --region-shear and --region-membrane shape a region mask; they need --region-mask" (it was "--region-over and --region-shear shape a region mask; they need --region-mask").++ - **New: laying a region over the figure and widening the rim for shear (`--region-over`, `--region-shear`).** `--region-over` lays the region over the figure under it instead of pinning its lower edge, freeing held pixels under the edge (solid or not), moving the band within reach, drawing the layer over the band by alpha, drawing the air by the move, and showing the figure under its lower edge at the move where it lifts. Its soft edge moves with the region (except under the lower edge where touching a solid pixel outside keeps it in the band), its solid outline against air goes with the layer, and `--hold-mask` leaves pixels the region mask does not cover out of the layer and band while pixels it covers move with the region. `--region-shear S` widens the rim across and down so a move one way rises across the rim the other way by at most S px per px (`shear_floor`), preventing tears along the sides. With either option, the ledger records move steps between neighbouring pixels, still strips left standing, and tip outline shapes, and `--region-over` records `lifted_px`. Both require `--region-mask`, are off by default, and leave strips, frames, and records byte for byte what they were when not given. See [video-pipeline](docs/video-pipeline.md) section 6.+ - **Changed: wearing the crease row in like every other edge of the mask and reaching down to the crease only when laying a region over the figure (`--region-crease`, `--region-over`).** Removed: the step that filled each crease column back down to the crease row after the mask was worn in (`crease_kept` is gone). Now `--region-crease` ends the mask on the crease before the wear and the wear (`--region-shrink`) wears the whole mask in, the crease row too, like every other edge. So the record's `mask.box` ends `--region-shrink` rows above the crease row (2 rows at the default), as it did before `crease_kept`. New, under `--region-over` only: in every cell the region reaches down to the crease again (`crease_reach`): the crease's rows (its columns and rows on the cell the mask was drawn on; a column between two crease columns takes the nearer one's row, the left one's on a tie) are carried into the cell by the mask's carry there (the column rounded to the nearest, half to even; the row rounded down), and in each crease column where the region holds a pixel, the cell's solid pixels from the region's lowest pixel down to the crease's row join the region. The crease is the picture's own edge, so the layer reaches it in every cell while the wear still wears the mask in everywhere else. Without `--region-over` nothing reaches back down: the worn mask is the region.+ - **New: solid under-edges, round rims, figure membranes, and recut strip pairing (`--region-over-solid`, `--region-rim-round`, `--region-membrane`, `--read-on-cut`).** `--region-over-solid` frees only solid pixels (alpha 128 or more) under the lower edge into the band while keeping softer pixels as anchors, and carries the region's soft edge with it under the lower edge. `--region-rim-round` holds the rim round beside the region across the wider of its two widths (`max(Lx, Ly)`), preventing steep downward steps below corners where the lower edge runs lower. `--region-membrane N` moves the figure under the lower edge within N + 1 px as a membrane by solving 4-neighbour figure means in passes instead of conjugate gradients (from a cos² start, at most 1200 passes, leaving no piece out) so the figure stretches rather than slides, drawing membrane pixels by their move and reporting membrane-specific fold refusals. `--read-on-cut STRIP` pairs regions read on another cut of the same clip by matching source frame numbers and applying a whole-pixel shift across crops on unaligned and aligned loops alike. The shift is taken on the frame as filmed, less where each cut's body or motion anchor moved that frame. Each cut is now read by its record of its cells alone: `cell_record` in the strip's record (`<name>.strip.json`), which `video-loop` now writes, bound to the strip by `cell_record.strip_sha256` (the sha256 of the strip PNG), with one entry per cell: `source_frame`, `anchor_move_px` (where the anchor moved that frame before the crop, whole px across and down), `scale` (`size_hold` and `gait_fallback`: the factor each step that holds a clip's frames to one size scaled that frame by, 1 where it did not hold them) and `as_filmed` (true where the cell's pixels at the end of the cut are its pixels anchored before any repair, the receipt `source_projection.before_repair_pixels_sha256` in the cut's report, and no step held the clip's frames to one size). On a loop aligned from its cut it reads the cut's own record, which `video-cycle-align` now keeps beside the cut's frames as filmed (`cycle.source/<name>.strip.json`) and which must be bound to the strip the alignment's origin names (`cycle_align.origin.strip_sha256`). It refuses, no-match, saying which and naming the field: a cut with no `cell_record` (any cut made before this release), a record bound to another strip, a record that does not give its cells as `video-loop` writes them (a field missing or not of its kind, in any cell), a loop aligned from its cut with no kept record, a paired cell a hold scaled or not cut as filmed, and two paired cells that are not the same pixels where they overlap at the shift (a record changed to call a cell as filmed is held to the cell's pixels). The report beside a cut is no longer looked for or read. All four options are off by default and leave strips, frames, and records byte for byte what they were when not given. See [video-pipeline](docs/video-pipeline.md) section 6.+ - **New: the membrane's own keys (`--region-membrane-unpin`, `--region-clear-alpha`, `--region-floor-beside`, `--region-own-outline`).** `--region-membrane-unpin` makes what the membrane moves no anchor of the rim either, so the region's move does not fall to none at its first rows under its lower edge. `--region-clear-alpha A` (a whole number from 1 to 127) reads a pixel under alpha A as clear by the sets the region moves and holds and by the membrane's figure while the cell's bytes stay its own, so a speck of dust beside the figure holds nothing. `--region-floor-beside N` sets the lower edge beside the region's columns to the lowest pixel of its columns within N px of that side, not that of its nearest column alone. `--region-own-outline G` grows the region G 4-neighbour steps over the cell's solid pixels within G 4-neighbour steps of a clear pixel before the sets (never under its lower edge's line and never over pixels `--hold-mask` leaves out), moving the outline its carried mask leaves out with the region. All four require `--region-mask`, shape nothing without `--region-membrane` (leaving the same bytes and record, naming none of them), are off by default, and leave strips, frames, and records byte for byte what they were when not given. See [video-pipeline](docs/video-pipeline.md) section 6.+ - **Output change: `cell_record` in strip records, `source_projection` for motion anchors, and kept cut strip records.** `video-loop` now writes `cell_record` into every strip record it writes (the fields above). The strip PNG, the GIF, the WebP and the frames of `cycle/` keep their bytes; the strip record gains this one key. A cut's report gains `source_projection` (`recipe`, `wrap_dx_px`, `before_repair_pixels_sha256`) at `--anchor motion` and `--anchor motion-auto` too, with `recipe` `motion-anchor-correction-v1` there; it was written only at `--anchor none` and `body` before (unchanged there). `cell_record` is written in the strip record only, not in the report's copy of it. `video-cycle-align`'s first alignment of a loop now also writes `cycle.source/<name>.strip.json`, the loop's strip record as cut, byte for byte, before it rewrites `<name>.strip.json`; later alignments leave it as it is, and a new cut with `video-loop` removes it with `cycle.source/`. The aligned strip's record does not carry `cell_record` (it is the record of another strip). The pair policy `RECUT_POLICY` is now `same-clip/source-frame/whole-px-shift/2`. At `--out-fps` (3.8.0: cells each made at a time of their own, more cells than the cut has frames), and at `--out-fps` with the air retimed, the report's `held_fill.out_fps` gains `source_frames` (per cell, the frame of the cut it is, or null where it was made), and `cell_record` now reads a retimed cut the same way as a cut at `--out-fps`: `source_frame` is the frame the cell is, and for a cell made between two frames the cut's frame at or before its time (the frame the seam reads it as), with that frame's `anchor_move_px` and `scale`. `as_filmed` is true only where the cell's pixels are that frame's pixels anchored before any repair, so a cell that repeats a frame unchanged is as filmed, and a cell made between two frames, a cell moved onto the parabola or along, and every cell of a cut the retime laid on a larger canvas are not as filmed, and `video-sway --read-on-cut` does not pair them. The cells before the take-off that the retime neither moved nor laid on a larger canvas stay as filmed.+ - Python callers: `sway_loop`, `sway_frames`, `read_request` and `read_ask` accept `region_over` (bool; default False) and `region_shear` (float; None: off). New in `sprite_gen.video.sway`: `shear_floor`, `layer_sets`, `lay_over`, `cover_depth`, `still_strip`, `tip_shape` and `move_steps`; constants `OVER_POLICY`, `TIP_COLS`, `TIP_AIR`, `TIP_RING`, `TIP_OFF` and `TIP_SEARCH`; `RegionMask` gains `over`, `shear`, `hold` and `edges()`; `Masked` gains `sheared`, `left_out` and `left_out_in(k)`; `rim_bands` gains `floor` (None: as before).+ - Python callers: `sway_loop`, `sway_frames`, `read_request` and `read_ask` accept `region_over_solid` (bool; default False), `region_rim_round` (bool; default False) and `region_membrane` (int; None: off); `sway_loop` and `read_request` accept `read_on_cut` (Path; None: off, refused by `sway_frames`). New in `sprite_gen.video.sway`: `membrane_sets`, `membrane_move(free, figure, own, outline, move, reach)`, `recut_pair`, `recut_ask` and `read_cut`; new in `sprite_gen.video.loop`: `ramp_offset`; new in `sprite_gen.video.motion_anchor`: `laid_at`; constants `OVER_SOLID_POLICY`, `MEMBRANE_POLICY`, `RECUT_POLICY`, `RECUT_DRIFT` and `RIM_ROUND_POLICY`; `RegionMask` gains `over_solid`, `membrane` and `rim_round`; `Request` gains `read_on_cut`; `layer_sets(..., solid_only=False)` gains `solid_only` and returns the new set `below`; `read_on_relation(..., cut=False)` gains `cut`; and `transported_motion(..., paired=None)` gains `paired`. New in `sprite_gen.video.sway`: `cell_record(record, strip_sha256)` (the record of a strip's cells, a ValueError naming what it does not give), `recut_same(pair, cut_cell, cell, read_on)` (refuses two paired cells that are not the same pixels at the shift) and `aligned_from(loop_dir, meta_path, meta)` (the cut's record an alignment kept, or None); `recut_pair(meta, cut, read_on, *, strip_sha256, kept=None)` takes this loop's strip sha256 and the kept record; `read_cut` returns the strip picture under `strip`; `Request` gains `aligned_from`; new in `sprite_gen.video.loop`: constants `CELL_RECORD`, `CELL_SCALE_STEPS` and `MOTION_RECIPE`.+ - **Tests**: new file `tests/video/test_sway_region_over.py` covers these cases on synthetic figures (the region test's body and its striped part over the torso's right side and past it over the air, with a dark crease under it on the torso; an arm block beside the part's lower left; a dark outline row under the part where it hangs over the air). Each case first reads what a sway writes with the new options (its cells, its record), so on a release without them the same input fails on what comes out:+ - without the new options nothing of them is read or written (cells and record as before, from Python with them passed off);+ - with `--region-crease` the wear wears the crease in with the rest (the worn mask's lowest row on the torso 2 rows over the crease, its box ending there), nothing under the crease moves, and laid over the figure the region reaches down to the crease again in every cell (its lowest pixel on the crease's row in each crease column);+ - laid over the figure under it, the lower edge moves as much as the part above it does (at gain 2.5 and 1.25), while without `--region-over` the crease pins it;+ - the layer draws the band where it lands, no read of the move taken there, and keeps its bytes elsewhere; the move draws the air (reads are taken there); a read in the air that takes the held figure beside it (the torso's soft side past the band) is walked back, in the air alone and never on the band (4, 9 and 6 reads in three cells, none in the others); nothing outside the region, its soft edge, the air and the band changes; the layer covers no deeper than the band; nothing folds;+ - where the part lifts it shows the figure under it: each pixel there is read at its whole move, none read short, its alpha the source's read there; read wholly on opaque pixels it stays opaque and shows the torso and the crease, not the stripes; beside the torso's soft side one column of the part's, within 2 px of that side, is as soft as its read of that side and the air past it (in 7 of the 12 lifting cells); in the rows the part leaves, its column over the torso's soft side shows thinner than that side in exactly the cells where the part moves toward the torso;+ - its outline against the air goes with it and leaves the air behind, and its outline against the figure (the crease) keeps its bytes;+ - two new cases for `--hold-mask` with `--region-over`: the pixels it names that the region mask covers (a piece in the arm's colour inside the part) are the region's, no anchors, and move with the part (one PNG carried and a folder per cell); the pixels it names that the region mask does not cover keep their bytes in every cell, and on a band (`--band auto` with the same `--hold-mask`) every pixel it names keeps its bytes while the part moves round them;+ - where the part lifts off a piece in the arm's colour right under its lower edge, left out with `--hold-mask`, the part's reads that would take the piece are read from their other pixels (10 in every lifting cell), none of them lifted and all opaque: no hole opens and the piece keeps its bytes;+ - `--region-shear` 0.5 and 0.25 widen the rim to the least it asks, so the drawn move's step across the rim stays within the bound, and less than without it;+ - the still strip is read from the region to its side (beside the arm, the px the mask left short; over the air, 0);+ - the tip is read on the side over the air; a tip moved whole is 0 px off its own shape, its shift found;+ - `move_steps` reads the most step both ways where both pixels are shown;+ - `--frames` gives the strip's cells and the same record;+ - each refusal leaves the loop as it was.+ `tests/video/test_sway_region.py`'s crease case now reads the worn mask's box ending 2 rows over the crease row. `tests/video/test_follow_inspect.py` now names `--region-over` and `--region-shear` among the arguments `video-sway` takes and `video-sway-inspect` does not.+ - **Tests**: updates to `tests/video/test_sway_region_over.py` and new file `tests/video/test_sway_read_on_recut.py` cover these cases on synthetic figures (the region tests' body with a striped part over the torso's right side and past it over the air; the read-on runner):+ - over-solid: only solid pixels under the lower edge are free and drawn over; the not-opaque rest stays, an anchor, with bytes kept; the soft edge under the lower edge beside the torso goes with the part, while sliding over without the flag it belongs to the figure;+ - the membrane at reach 3 and 6: under the lower edge within reach + 1 px, never the outline over the band; each pixel's move is the mean of its figure 4-neighbours' to within less than `MEMBRANE_STEP` (what one more pass would move it), and the record names `step_px` and `passes_most`; the seam step down from the part's last row is at most half of the one sliding over; drawn by the move, never laid over;+ - the membrane never moves a piece left out (stops at its sides); without the membrane the layer is as it was;+ - a membrane too short for the move is refused by its name, writing nothing;+ - below the corner of a part whose lower edge falls from its left side, with `--region-rim-round` the move rises down by at most pi/2 of its size over the rim's wider width, and more than that without the flag;+ - the refusals list gains each new option's refusal;+ - without the membrane the four new options shape nothing (the same bytes and record);+ - the four new options' refusals (each without `--region-mask`, and the values `--region-clear-alpha` 0 and 128, `--region-floor-beside` -1, `--region-own-outline` -2) leave the loop as it was;+ - two defect shapes, each red on the engine before this change: a part laid over the figure with a few pixels not opaque (alpha 60 and 30) a few rows under its lower edge over the air and a near-clear speck (alpha 3), with `--region-over-solid`, `--region-membrane 6` and `--region-shear 0.35`: with `--region-membrane-unpin` and `--region-clear-alpha 8` the lower edge over the air moves with the part (lag 0.25 px or under), without them it stays short of the move (0.5 px or more), and under the clear alpha the speck is neither held nor the membrane's; and a part whose outline over the air takes one or two pixels past its mask in a row that changes from cell to cell, with `--band-up 0.4` and `--region-membrane 6`: with `--region-own-outline 2` those pixels are the region's and the side moves by each row's share of the move (lag 0.25 px or under), without it they are anchors and the side bends at a row that changes from cell to cell (0.5 px or more);+ - `--region-floor-beside`: beside a region whose lower edge falls 1 px a column, the lower edge past each side is that of its lowest column within N of that side (directly on `layer_sets`);+ - the frames path gives the strip's cells with `--region-membrane 6`;+ - in new file `tests/video/test_sway_read_on_recut.py`, a cut again at the same frame with a wider crop moves the regions and the mask by the crop's shift and gives the sway on the regions drawn there by hand;+ - a cut again at another start moves the mask onto the cell that is that frame, pixel for pixel, with every pixel outside it kept;+ - a cell elsewhere in either cut that its record calls scaled or not as filmed leaves the pair as it is;+ - a loop aligned from the cut again carries the pair through the alignment; the alignment keeps the cut's strip record byte for byte beside its frames (`cycle.source/<name>.strip.json`), bound to the strip its origin names, and a second alignment keeps it as it was; the aligned strip's record holds no `cell_record`;+ - on a loop aligned from its cut, these are refused, each saying which: a kept record that is gone, a kept record that holds no `cell_record`, a kept record bound to another strip, a paired cell its kept record calls not as filmed, and the read cut's cell drawn between the frames either side with its record changed to call it as filmed;+ - two cuts at `--anchor body` whose ramps move frame 4 by nothing in the first and by -6 px in the second pair that frame where each ramp moved it: shift (0, 0), no drift, the moved mask is the patch where the second cut drew that frame, pixel for pixel; the crops alone set it 6 px apart;+ - two cuts at `--anchor body` whose ramps move no frame (both `wrap_dx_px` 0) pair by their crops alone, as before, the mask landing on the patch there;+ - two cuts at `--anchor motion` (head and torso regions on each cut's first frame) pair the frame where each correction laid it: the shift is the crops' less where the first correction laid that frame plus where the second laid it, not the crops' alone, and the mask lands on the patch there; each cell's `anchor_move_px` is the correction's place and every cell is as filmed; the report's `source_projection` names the motion recipe;+ - `video-loop` records each cell of its strip in the strip's record bound to its PNG: the source frame, the body ramp's move, no hold's scale, as filmed; the record is written beside the strip and not into the report, whose receipt holds one digest per frame;+ - a cell the jump repair gave way (a filmed ghost, no RIFE) is recorded not as filmed, every other cell as filmed;+ - refusals: a frame this loop does not hold, a record with no clip it is cut from, and without `--read-on-cut` the relation's refusal as ever, each leaving the loop as it was;+ - a record of its cells not there or not as `video-loop` writes it is refused naming the field, on either cut: none, not an object, bound to another strip or none, no cells or one too few, a cell's entry, its `source_frame`, `anchor_move_px`, `scale`, and `as_filmed` missing or not of its kind (float, text, boolean, zero, NaN);+ - a paired cell its record calls scaled by the size hold or the gait fallback, or not as filmed, is refused saying which, on either cut;+ - a cell an interpolator made, on either cut, is refused whatever its record says: as `video-loop` records it (not as filmed), and with its record changed to call it as filmed (its pixels are not the other cut's at the shift);+ - a loop aligned from its cut (`video-cycle-align`) named by `--read-on-cut`, and a cut of another clip, are refused, and what the key is refused for leaves the loop as it was;+ - the walk away from the camera of the gait fallback tests, cut by `video-loop` with and without the size hold: the record gives the factor the size hold scaled each cell by, equal to the report's `size_hold.cut_frames`, and calls none of the held cells as filmed;+ - the same walk cut twice by `video-loop` as a walk with the size hold on for one cut, for the other, and for both is refused, leaving the loop as it was, the record of the held cell naming its factor;+ - the same walk held in one cut with every trace of the hold and walk taken out of the report and strip record (the report's `size_hold`, the report's `state`, the report's strip's `state`, the strip record's `state`) is refused by the record of its cells; with the record's factors and `as_filmed` taken out too, refused naming the field; with the strip record's `cell_record` taken out, refused as a record with none; with the record changed to call every cell as filmed, refused by its pixels on either cut;+ - the command line reads the relation `recut`.+ `tests/video/test_follow_inspect.py` now names `--region-over-solid`, `--region-membrane`, `--read-on-cut`, `--region-rim-round`, `--region-membrane-unpin`, `--region-clear-alpha`, `--region-floor-beside` and `--region-own-outline` among the arguments `video-sway` takes and `video-sway-inspect` does not.++ ## v3.10.1 - A frame made that shows the same picture as a frame beside it is refused; it is made again only on the side away from the picture it showed, or its run kept as filmed++ **Upgrading from 3.10.0: Every cut with no held cell, every cut whose frames between are real new pictures, and every `--fill-held off` run give the same cells as 3.10.0.** A run that 3.8.0 to 3.10.0 reported as filled although its frame between repeated a picture beside it is now made at another fraction where one passes, or kept as filmed with a warning. Its `faults` in `held_fill.before.held_runs` list `held`. At `--out-fps` and in an air retimed with `--air-retime`, such cells are now listed in `out_fps.shown_again` or `air_retime.shown_again` with a warning instead of being counted as made. On twelve tests of the suite that run the binary, 3.10.0 runs the binary 146 times and 3.10.1 runs it 188 times because 3.10.0 took frames between that showed a picture beside them again, while 3.10.1 refuses them and makes them again at other fractions. So a cut whose frames between show a picture beside them again asks the binary for more runs, and takes longer, than in 3.10.0.++ - **Fix: A frame made that shows the same picture as a frame beside it is refused as `held`, made again only on the side away from that picture, or its run kept as filmed.** In 3.8.0 to 3.10.0, an interpolator that gave back one of the two frames it was handed, or the same picture for two different times, made no frame between at all. The run was recorded `filled: true`, its cells listed in `made`, with no retry and no warning, while poses over cells remained unchanged. A frame made must not read as the same picture as either frame it is made between, nor as the cell delivered just before it; otherwise it receives the fault `held` and is refused. A refused frame is made again at the nearest other fractions of `RETIME_T` within half a cell, but only on the side away from the picture it showed: later where it showed the frame before or the cell before it, earlier where it showed the frame after, and not again where it showed both. Because frames between run from one pose to the next, a fraction nearer a picture it showed shows that picture too. If none passes, the run is kept as filmed with a `warning:` line naming its cells. At `--out-fps` and in an air retimed with `--air-retime`, a cell refused this way is the nearer frame, listed in `shown_again` and named in a `warning:` line. On the synthetic cuts of eight tests that reach the binary through the default fill, 3.10.0 took all 44 frames between it asked for, and 19 showed a picture beside them again. Version 3.10.1 makes 26 cells. Poses over cells are 324/383 as filmed, 341/383 in 3.10.0, and 348/383 in 3.10.1. Runs of the binary on them are 90 in 3.10.0, 124 in 3.10.1, and 214 in a first version that retried a refused frame at every fraction within half a cell on both sides. On a Linux runner with a CPU Vulkan driver, that first version made each of those eight tests run longer than its 120 s limit, so each of them timed out and failed.+ - Python callers: New function `held_fill.same_picture(frame, others)`. `held_fill.judge(..., before=)` takes the cell delivered before the frame, and its reading names `shows` (which of `a`, `b` and `before` the frame shows again). Each try the loop report records (`tries`) names `shows` where it showed one.+ - **Docs**: [loop-repair.md](docs/loop-repair.md) section 7 documents the rule, the side a refused frame is made again on, their measurements, and the `--out-fps` cells. [video-pipeline.md](docs/video-pipeline.md) and `SKILL.md` are updated. [release.md](docs/release.md) notes that a test that reaches the binary through a cut's default fill and runs it often enough to pass the default 120 s limit on a CPU's Vulkan driver carries the 900 s limit and pins its runs of RIFE with `rife_runs`.+ - **Tests**: `tests/video/test_held_fill.py` (stalled walk with runs of two and three held cells kept as filmed when returning the frame before or after, 24/27 poses/cells, nine frames asked for, pictures matching `--fill-held off`, warnings naming cells 5-6 and 14-16; frame showing both poses refused with no retry; interpolator drawing the half way time making the run of two and trying the second cell of the run of three only later at 0.6667 to 0.8; `--out-fps` 60 from 24 with eight cells listed in `out_fps.shown_again`; synthetic fall refused as `held` at 0.5 and 0.55 and made at 0.6 in changed test `test_a_once_cut_and_a_one_shot_have_their_held_cells_made_too`); `tests/video/test_root_motion.py` (synthetic jump air retimed twice as long with ten cells listed in `air_retime.shown_again` and named in a warning, each tried at 0.5 and then only later). Twelve tests that run the RIFE binary on a synthetic cut (the eight that timed out in the first version: three rows of `tests/video/test_explicit_window.py`, two tests of `tests/video/test_gait_fallback.py`, `tests/video/test_ghost_given_way.py`, one test of `tests/video/test_one_step_cut.py`, `tests/video/test_play.py`; and four more: the step screen test of `tests/video/test_one_step_cut.py`, the checkpoints test of `tests/video/test_wrap_blend.py`, a test of `tests/video/test_once.py`, and a test of `tests/video/test_ghost_screen.py` marked `real_rife` that hands frames to `rife.Rife` itself; the other eleven reach the binary through a cut's default fill) carry `@pytest.mark.timeout(900)` with a comment naming their calls of the binary, and each pins its runs of RIFE (between 6 and 36): eleven through `rife_runs` in `tests/conftest.py` (0 where `rife_located()` finds no binary), the `tests/video/test_ghost_screen.py` test through `Rife.calls`. With no binary found, every count is 0 and the two tests marked `real_rife` skip. On the first version, nine of the twelve fail on the count, with run counts of 18 to 38: the eight, and the checkpoints test of `tests/video/test_wrap_blend.py` (20 against 16). The other three ask for the same runs in both versions. Red first for two test files, `tests/video/test_held_fill.py` and `tests/video/test_root_motion.py`: 10 failed and 46 passed on 3.10.0; 56 passed on 3.10.1. Mutation check over those two files: with the new reading switched off, ten tests fail; without comparison to the cell before, two; without comparison to the frame after, three; without "only later" after the frame before or cell before, eight; without "only earlier" after the frame after, three; with the cell before not counted for the side, two.++ ## v3.10.0 - Root motion on single-play cuts, their air retimed on a given gravity, length and speed (--air-retime), and a caller-named single play (--cycle once --start --length)++ **Upgrading from 3.9.0: a cut played once with a body (`video-loop --cycle once`, `once-return`, `one-shot`, and so `video-set`'s single-play states) gains `root_motion` in its report and strip metadata: each cell's root, what it stands on, and its airs. Its cells and every other key keep their bytes and values. The air is drawn again only when asked (`--air-retime`).**++ - **New: root motion on every cut played once.** `root_motion` gives each cell's root (the subject's mass centre, as `inspect-motion`'s `centroid_px`, in cell px), the floor's row (`ground_y`), the runs of cells on the ground or in a contact the caller names (`--contact hand=12:20`, frames of the clip), and each air: its take-off and landing cells, the seconds between them, its apex and the cell it peaks in. With `--meters-per-px M` it adds each root in metres from the first cell's (`root_m`) and each apex in metres. A game reads `root` to place each cell and moves the body on its own physics. `video-loop` prints each air in one line (`air 0.42 s, apex 0.21 m`) and `video-set` puts `loop.air` on each item.+ - **New: `video-loop --air-retime gravity=G,air=T,speed=V`** (and `video-set --air-retime`). Each air with its take-off and landing in the cut is given `T` seconds, `G` m/s² and `V` m/s along, any of them, each the clip's own where not given; `G` and `V` need `--meters-per-px`. The air's cells are spread evenly over its new seconds, each the clip's pose at the same share of its air, made with RIFE between two frames where it falls between them (the held-cell fill's frames, judged the same way), and moved whole onto the parabola from the take-off's root to the landing's; the landing and the cells after it move along with it, so a planted foot stays planted. The take-off, the landing and the cells on the ground before it are the frames as filmed. The strip metadata's `air_retime` records each air's seconds and apex before and after, the gravity and speed used, how far along it moved, the cells made and the poses over cells. With no RIFE and a frame to make, the air is cut as filmed and a warning names the motion and the install line. A loop, or a cut with no such air, is cut as filmed and says why. A retimed cut is not restored from its source frames (`video-loop-repair`).+ - **New: `video-loop --cycle once --start S --length L`** plays exactly those frames once (`terminal.kind: given`): a move cut out of a longer motion that settles on no pose, such as a vault in a run. Before, a single-play cut refused `--start` and `--length`.+ - Python callers: `sprite_gen.video.root_motion` (`parse_retime`, `parse_contacts`, `clip_floor`, `root`, `touching`, `reading`, `read`, `sidecar`, `said`, `apex`, `retime`, `public`); `held_fill.at_times` (a cell at each given time, taken out of `upsample`); `qa.motion.centroid` and `qa.motion.contact_spans` (were `_contact_spans`); `nonloop.on_floor`, `nonloop.GROUND_PX`, `nonloop.given_ending`; `loop.run_loop(..., air_retime=, meters_per_px=, contacts=)`; `batch.run_set(..., air_retime=, meters_per_px=)`.+ - **Docs**: [video-pipeline.md](docs/video-pipeline.md) section 4, "Root motion" (the keys, how a game reads `root`, the mass centre and not a body part, `--cycle once --start --length`, the air retimed, what it takes from sprite-gen); `SKILL.md` (tell the user each air's seconds and apex).+ - **Tests**: `tests/video/test_root_motion.py` with `tests/video/jump_inputs.py` (a synthetic jump whose mass centre flies a parabola under a known gravity: the root read within half a pixel, the air's cells, seconds and apex, the ground and a named hand contact; the air doubled peaks at g T²/8 with twice its cells, every cell on the parabola, none shown again, the take-off and the ground before it byte for byte, the landing moved along whole, and through real RIFE (`real_rife`) every between made and judged; the air alone keeps the clip's gravity; no RIFE cut as filmed with the motion named; the six cuts `tests/video/test_held_fill.py` pins keep their pictures as decoded (`tests/picture_digest.py`) and every metadata value but the new key, the keyed clip's file sha read against the run's own files; the refusals; `video-set` hands the handle on).++ ## v3.9.0 - Provider address environment variables, subscription logins off, and the capabilities verb++ **Upgrading from 3.8.0: nothing changes unless you set one of the new variables. Each provider's calls can go to another address (`SPRITE_GEN_OPENAI_BASE_URL`, `SPRITE_GEN_XAI_BASE_URL`, `SPRITE_GEN_ANTHROPIC_BASE_URL`, `SPRITE_GEN_ELEVENLABS_BASE_URL`), `SPRITE_GEN_LOGINS=off` runs every call on its API key, and the new verb `sprite-gen capabilities` prints every verb and argument as one JSON line. Unset, every request goes where it went with the same bytes, and every output keeps its bytes except `sprite-gen --help`, which lists the new verb.**++ - **New: provider addresses.** Each of the four providers sprite-gen calls over HTTP has a variable that replaces its documented address (the API root with its version path, `https://api.openai.com/v1`, `https://api.x.ai/v1`, `https://api.anthropic.com/v1`, `https://api.elevenlabs.io/v1`). It is read when each request is made, not at import, so a value set or changed after the engine is imported is followed. Unset, empty or blank is the documented address. It moves every direct call: OpenAI images, edits and vision checks; Grok images, edits and vision checks, the video facing check, the video requests, polls and `video-resume`; Anthropic messages and Message Batches; ElevenLabs sound. A value that is not an `http://` or `https://` address with no query or fragment stops the call naming the variable.+ - **New: a URL a provider hands back is fetched through the same address.** With `SPRITE_GEN_XAI_BASE_URL` set, the finished clip is downloaded as `GET <value>/sprite-gen/fetch?url=<the clip's URL, percent-encoded>`, first without a token and once more with the bearer token after a 401 or 403, as before. With `SPRITE_GEN_ANTHROPIC_BASE_URL` set, a batch's results file comes the same way with the API key. A relay that forwards the provider's API forwards these too. Unset, the URL is fetched where it points.+ - **New: `SPRITE_GEN_LOGINS=off`.** No subscription login is read: the grok login file (and `GROK_HOME`) is not looked at and `XAI_API_KEY` is used, `claude auth status` is not run and `ANTHROPIC_API_KEY` is used, and codex is not usable (`codex login status` is not run; a default codex asks or runs what you chose for a codex that cannot run, naming the variable, and `--provider codex` stops). Each key keeps its rule: set but empty is refused, and a missing key stops the call naming the key and the variable. Unset or empty is `on`, the order as before; any other value is refused.+ - **New: `sprite-gen capabilities`.** One JSON line: every verb (domain, description, old names, sub-verbs) and every argument as the CLI's parser holds it (spellings, type, how many values, default, required, choices, groups of which one is given), the providers each verb may call and whether it may be billed (`video-resume` calls xAI and buys nothing), and the provider and login variables. It is read off the parser, so a verb or flag added to the CLI is listed with nothing else written. At this release it is 42,227 bytes, where every `--help` together is 158,857.+ - Python callers: new module `sprite_gen.gen.address` (`PROVIDERS`, `base`, `url`, `fetched`, `FETCH_PATH`), `sprite_gen.gen.base.LOGINS_ENV`, `LOGINS_OFF` and `logins_on`, new module `sprite_gen.workflow.capabilities` (`document`, `PROVIDER_CALLS`, `NO_PURCHASE`). Removed: the module constants `xai.API_BASE`, `openai_provider.API_BASE`, `anthropic_api.API_BASE` and `sprite_gen.audio.provider.BASE`, which kept a provider's address where a variable could not move it; `video` no longer copies the xAI address at import.+ - **Tests**: `tests/gen/test_provider_address.py` (every call site against a local relay, the address unset, empty and blank, a value changed after import, the relay given the request's bytes, the clip and results file fetched through it, refused values, no module but the registry naming an address and none reading it at import), `tests/gen/test_logins_off.py` (each route on and off, the empty key refusal kept, codex's question and refusals, the access check), `tests/workflow/test_capabilities.py` (the document against the parser and every verb's printed options, a verb or flag added is listed, the providers, the size against every `--help`).++ ## v3.8.0 - Held cells found and filled with in-betweens by default, and a cut given above its clip's frame rate (--out-fps)++ **Upgrading from 3.7.0: `video-loop` (and so `video-set`) now finds neighbour cells of a cut that show the same picture and, by default, makes them again with RIFE's frames between. A cut with no such cell comes out byte for byte as before. A cut with them comes out with its held cells made, its length, beat, first and last cells and wrap unchanged. `--fill-held off` cuts as before. Every cut's report and strip metadata gain `held_fill`.**++ - **New: held cells found on every cut.** A frame shown twice or three times in a row (a model that stalls, a rate carried to another by repeating frames, a cut mapped to a higher rate by taking the nearer frame) is read on the analysis thumbnail used to choose the cut and on the frames as cut. A step where at most 0.5 % of the subject's pixels change by more than 0.1 in both readings is the same picture. The report and the strip metadata record `held_fill`: the cells, the poses (the cells less those showing the picture before them again), and the held runs (first cell, how many), before and after. `video-loop` prints `poses/cells` in its summary and `video-set` puts `loop.poses` on each item.+ - **New: held cells filled by default (`--fill-held auto`).** Each run's cells are made between the run's first cell and the next pose at their own times (a run of three a third and two thirds of the way), judged as `video-cycle-align`'s frames are (smear, outline, ghost, hole, doubled) and for a part standing still on both sides (a foot planted, a hand on a ledge: its outline must stand where it stood, the fault `contact`). A frame refused is made again at a nearby fraction, else the run stays as filmed with a warning. Kept as filmed: a run longer than three cells (a hold the motion means), the opening and closing pose of a cut played once, a loop's last cells (their next pose is across the wrap), and every run of a cut drawn on twos or threes. In that case, its held-drawings reading (`cycle_drawings`, as `video-cycle-align` reads it) holds 2 or 3 and every run is that long (`held_fill.drawn`): limited animation, as filmed. A clip carried to a higher rate by repeating frames reads a hold too, but its runs are two and three cells by turns, and it is filled. With no RIFE the cells are delivered as filmed, never a failure, and a warning names the motion and `sprite-gen rife install`.+ - **New: `video-loop --out-fps F` and `video-set --out-fps F`.** A cut given above its clip's rate is made of frames between at each cell's own time, never frames shown again: a loop keeps its cycle's seconds, a cut played once runs from its first frame to its last. The strip metadata says `out_fps` and `source_fps`, and `source_cut.times` in place of `samples`. With no RIFE the cut is delivered at its own rate with a warning. `video-cycle-align` and `video-stop` refuse such a loop; `video-set` refuses it with the cycle alignment on (pass `--align-cycles off`).+ - A cut whose cells were made is read by the seam gate on its rendered cells, is not restored from its source frames (`video-loop-repair`: `source-processing-unsupported`), and `video-cycle-align` reads its drawings on its own cells.+ - Python callers: `sprite_gen.video.held_fill` (`same_steps`, `runs`, `reading`, `fill`, `upsample`, `times`, `still_kept`, `judge`, `public`, `said`); `loop.run_loop(..., fill_held=, out_fps=)`; `batch.run_set(..., fill_held=, out_fps=)`.+ - **Docs**: [loop-repair.md](docs/loop-repair.md) section 7 (the reading, the fill, the higher rate, the paths that give frames at a higher rate, what it takes from sprite-gen); [video-pipeline.md](docs/video-pipeline.md) section 4 (the default step: find, fill, read again; poses over cells in one line); `SKILL.md`.+ - **Tests**: `tests/video/test_held_fill.py` (synthetic clips and a stand-in interpolator that draws the clip again at the time asked: six cuts with no held cell pinned to their decoded pictures on the engine before the change (commit 886936e); a stalled walk filled at a half, a third and two thirds, every other cell as filmed; `--fill-held off` byte for byte as before; no RIFE delivered as filmed with the motion named; a hold of five kept; a walk drawn on twos kept as filmed, byte for byte as `--fill-held off`; a walk carried from 24 to 60 fps by repeating frames filled to 60 poses in 60 cells; a once and a one-shot cut filled; a planted foot kept still, and a frame between that drags it or cross-fades two poses refused; the ends of a cut played once and a loop's last cells kept; codec-like copies are the same picture and a pixel's move is not; a whole figure moving under a thumbnail pixel is not the same picture; a walk at 60 fps made of 60 poses in 60 cells; a one-shot at 60 fps keeping its first and last frames; no RIFE at its own rate; a rate under the clip's refused; the switches through `video-loop` and `video-set`; restoration, the alignment and a stop refusing what they cannot read).++ ## v3.7.0 - Breathe row width and height minimum and maximum sizing, and curator breathe editor range inputs++ **Upgrading from 3.6.0: a Breathe row's breath can now be sized by the two ends it travels between, across and up, instead of a strength (`width_min`, `width_max`, `height_min`, `height_max`; flags `--width-min`, `--width-max`, `--height-min`, `--height-max`). Every existing sidecar, flag and output keeps its bytes, and so does every normalized sidecar; the curator's breathe editor shows four range inputs in place of the two depth selects.**++ - **New: a breath's width and height as minimum and maximum (pixel and smooth).** Each is a share of the original. Width is how much the torso widens at the row where the breath is fullest (pixel: the row where the envelope peaks; smooth: the chest's peak P), negative narrower. Height is how far the head top (pixel) or the chest (smooth) rises, as a share of the body below the neck, negative down. Each lies in -0.20 to 0.20 with minimum at most maximum; a bound left out is 0, and null is left out. A minimum of 0 keeps the breath from going under the original size. The curve's shape and beat (`breaths`, `breath_peaks`, `lag`, `inhale`) are unchanged. In pixel, one gain widens a row by 1 + g and shortens it by 1 / (1 + g), so the top of the curve is (`width_max`, `height_min`) and its bottom is (`width_min`, `height_max`). In smooth, rest is at both minimums and the top of the in-breath is at both maximums, so a minimum other than 0 moves the rest cell off the source.+ - A strength converts exactly. A pixel row of `depth` d has height [-0.9009 d, 0.9009 d] (0.9009 is the breath curve's peak, `breathe.WAVE_PEAK`) and width [-a, a], with a = 0.9009 × `depth_x` (or `depth`) × the amplitude norm × the envelope's peak; a smooth row has height [0, `depth`] and width [0, `depth_x`]. Written as minimum and maximum, these bake the same bytes. `sprite-gen breathe` records the row's `range` (`{"width": [min, max], "height": [min, max]}`) in `breathe.json` for that conversion. Pixel rows move whole rows and columns, so the extremes measured on a plate are within one cell of the values written.+ - Refused, not silently resolved: a row with both a strength (`depth`, `depth_x`) and minimum or maximum keys, a value out of range or not a number (booleans included), a minimum above its maximum, and minimum or maximum keys on a round chest row. The row strain limit (0.25) is checked at the largest gain the curve reaches, and its refusal names the keys to reduce. The pixel clip refusal now says to reduce the breath's size (depth, or minimum and maximum) where it said depth.+ - Python callers: `breathe.WAVE_PEAK`, `breathe.envelope_peak`, `breathe.pixel_gains`, `breathe.breathe_range`, `curation.BREATHE_RANGE_KEYS`, `curation.BREATHE_RANGE_MAX`. `breathe.smooth_lift` is the chest's rise from rest to the top, which `video-sway --breathe` and `--avoid-region` read: (`height_max` - `height_min`) × the basis height for a minimum and maximum row.+ - **Curator**: the breathe editor's two depth selects are four inputs (width minimum to maximum, height minimum to maximum, in %, 0.1 % steps, -20 to 20). A strength row shows the range its strength travels; editing one input moves the row to the four keys, the untouched ones carried at their exact values so that axis bakes the same bytes. The inputs are off for a round chest row and, on a pixel strength row, until the anatomy arrives. Loading a sidecar now keeps a strength row's `depth_x`, `axis_x` and `torso_half`, which the first autosave dropped before. A new row inherits a sibling row's minimum and maximum keys as it inherited a depth. The preview mirror bakes minimum and maximum rows byte for byte as the bake does.+ - **Tests**: `tests/effects/test_breathe_min_max.py` (synthetic figures: strength rows keep their bytes and normalized sidecar; minimum 0 is never narrower nor taller on any row or phase; the written extremes are what the plate measures, within one cell; a strength's range written as minimum and maximum bakes its bytes; smooth from 0 is the old smooth; refusals and the strain limit), new cases in `tests/effects/test_breathe_js_mirror.py` (minimum and maximum parity, `breatheRange`), the value-shape matrix over the four keys and the kept `depth_x` and band in `tests/effects/test_breathe_sidecar_roundtrip.py`, and the mirrored constants in `tests/effects/test_breathe_reference_key.py`.++ ## v3.6.0 - Two step walk and run loop cuts with half step warnings, loop search past untracked anchor frames, body turn loop exclusion, round chest breathing with sideways arms, and sway region mass movement++ **Upgrading from 3.5.0: `video-loop` walk and run cuts change for two-step cuts and half steps under `--anchor motion-auto`, opening frames the motion anchor cannot track, and body turns, while new `sprite-gen breathe` and `video-sway` options are off by default.** In `video-loop`, a walk or run cut shorter than its state's gait floor, its steps not counted, is now cut two steps long under `--anchor motion-auto` where the clip as filmed comes back nearer two lengths on than one, and says so where it does not (`cycle.half_step` and a warning line); every other cut keeps every byte. A walk or run whose first frames the automatic motion anchor cannot track is now searched after them, as after a lead-in, where it was refused; every clip the anchor tracks from its first frame keeps every cut and byte. A clip whose cut held a turn is now cut where a window without the turn holds a cycle, while clips with no turn, clips that are not read, and clips with a turn and no turn-free cycle under `warn` keep every cut and byte. A pixel Breathe row can now breathe round from the chest, with the arms moving sideways (`chest_round`, `arms_x`), and `sprite-gen breathe` takes cells held still (`--hold-mask`), what the arms hold (`--props-mask`), pieces held behind the body (`--props-behind-mask`), and props grouping (`--props-groups`). All are off by default: every existing sidecar, flag and output keeps its bytes, and so does every normalized sidecar. `video-sway` can move each region as one mass with `--band`. When `--band` is left out, strips, frames, and records remain byte for byte what they were. Passing `--band PX|auto` moves each region's ellipse and an outer margin at full weight, with the weight falling to 0 by cos² over a band of pixels around it, while carrying the region by its own pixels rather than the body's outline lay. The fifth region number `flat` and `--stretch-floor` are refused when `--band` is specified. In the strip's metadata, `follow` gains `band` (and `sway.json` gains `band` for `--frames`), while stdout JSON gains `band` with `band_px`, `margin_px`, and `lay_cells`. The legacy command name `video-follow` accepts the same flags. `video-sway --band` can now hold pixels with `--hold-mask`, leaving them as they are while regions move round them. It is off by default, and when not given, strips, frames, and records remain byte for byte as before. `video-sway` can now move a region's own pixels with `--region-mask`, holding every visible pixel outside it and its soft edge while the weight falls over an inner rim read off the move. It is off by default, and when not given, strips, frames, and records remain byte for byte what they were (with `--band`, with `--band` and `--hold-mask`, and with neither).++ - **New: `video-loop` names a half-step cut.** A walk or run loops on an even number of steps (two, one cycle). The half-period guard reads the gait floor (`LoopProfile.min_seconds`) in whole frames, rounded, so a run cut 8 frames long at 24 fps (0.33 s, under the run's 0.35 s) is taken as two steps. Such a periodic cut whose steps nothing counted (no `cycle.steps`) is kept, recorded in `cycle.half_step` (`rule`, `state`, `seconds`, `gait_floor`, `why`, `two_steps`; in the stdout summary too) and named in a warning line that suggests `--steps 1`; the line repeats no refusal's words. Python callers: `loop.half_step`, `loop.half_step_verdict`, `loop.HALF_STEP_RULE`. Docs: [video-pipeline.md](docs/video-pipeline.md) section 4. **Tests**: `tests/video/test_loop_half_step.py`.+ - **Changed: `video-loop --anchor motion-auto` cuts such a cut two lengths long where the clip says it holds two steps.** One step on, the legs are back in place with near and far swapped, and where they are drawn alike the silhouette repeats; the body's turn, the shading across the torso and the folds of the clothes come back only two steps on. Each length of [2L − 1, 2L + 1] is cut as `--steps 1` cuts it, and about each cut's wrap (two frames either side of its first) the frames as filmed are read two lengths on over one length on; the nearest at most 0.85 (`period.STEP_RATIO_MAX`, the step screen's bound) whose seam and seam pop gates pass is taken, recorded `cycle.steps` `{"count": 2, "by": "two-lengths", ...}` and `cycle.two_lengths` (`first_cut`, `tried`, `cut`, `taken`; in the stdout summary too). It is read on the frames as filmed, not on the search's distances, which move every frame by one vertical slope fitted over the clip: a slope tilted by frames that open higher moves frames two steps apart further than one step apart where the body runs in place, so two lengths on read no nearer there. A cut the clip gives no two is kept and named as above, the warning line saying why (`cycle.half_step.two_lengths`). Python callers: `loop.two_lengths_on`, `loop.TWO_LENGTHS_AROUND`. **Tests**: `tests/video/test_loop_two_lengths.py`.+ - **Fixed: `video-loop --anchor motion-auto` no longer refuses a walk or run for its opening frames alone.** Where `auto_motion.discover` finds no two regions through the whole clip (`automatic motion anchor needs two separated regions trackable throughout the clip`, or `found no stable textured region`), the analysis is read again on the clip after the fewest frames it opens on, fewer than the window's shortest cut, with which the anchor finds its two regions through the rest (`auto_motion.analyse_after_opening`, new exception `auto_motion.RegionsUnfound`). A clip filmed from a still opens on that still and on the standing pose the body sets off from, and the regions the middle of the clip shows may be out of the anchor's reach there; the refusal came before the search, so the gait fallback never ran. Those frames are left out of the search as a lead-in is (`lead_in.search_from`, every frame number the clip's own), recorded in the report's new `untracked_opening` (`frames`, `first`, `shorter_than`, `refused`) and, once a cut is found, a warning line `video-loop: warning: the automatic motion anchor found its two regions from frame <k> on, not from the clip's first frames: ...` that does not repeat the refusal's words. Where no such opening leaves the clip tracked, it is refused in the same words as before, followed by ` — nor through the clip after any of its first 1 to <n> frames left out (an opening shorter than the shortest cut, <n + 1> frames)`; where the cut the search took holds no two regions when its frames are read again for the correction, the refusal now ends ` — on the cut the search took (frames <a>-<b>)`. Tests: `tests/video/test_auto_motion_opening.py` (a synthetic walker whose first three frames carry its head and torso 90 px forward: refused as filmed before, now cut after them with every frame number the clip's own; the same walker without them unchanged; the lean again mid-clip refused with the new words).+ - **New: `video-loop` detects torso turns in walk and run clips and avoids them during the cut search.** A video model asked to walk at the still's angle sometimes turns the body inside the clip: a back-diagonal walk turns to a full back view half way and back. A loop cut across the turn plays the body swinging round. Until now the engine had no reading of this: the cut search could not avoid it, and a clip that held no cycle for it was refused only as `video-loop: no periodic cycle found`, so an app could not name that the body turned as the reason to film it again. The new module `sprite_gen/video/body_turn.py` introduces reading `torso-side-v2` on every walk or run under `--anchor motion-auto`, reading each frame's torso crop against the clip's first frame, the still the clip was filmed from, a standing pose. It does so whether or not the clip opens on a lead-in (the video model reframing the still to the walk's size over the first frames, which the cut search leaves out). It does not read against the first frame after the lead-in: that frame is a stride's pose, and a walk draws the mirror of a stride's pose half a cycle later, so a synthetic walk that does not turn, read against it, read a turn every stride (least -0.34). Read against the still filmed small, the same synthetic walk (its first 8 frames filmed from 0.6 of its size) reads +0.87 at least where it does not turn (+0.92 without the lead-in); turning over frames 30 to 40, its turn over frames 32 to 38, the same frames as without the lead-in, least -0.71 (-0.63 without the lead-in). The torso crop runs from the neck down half the body below it, centred on the head's centre, as wide as the first frame's torso. Each crop is cut about the head's axis between pixels, and the still and every frame are read at their nearest about the axes within `GUARD` (2.5 px) and `TOL` (2 px), `STEP` (0.25 px) apart, so a piece beside the head that moves its centre 1.4 px moves no turn. Under the module constant `MASS_SHARE` = 0.01, the box's top is read as the row with more than a hundredth of the frame's solid pixels above it, and the still's torso width is read about the head's centre from the columns of the still's torso rows with more than a hundredth of those rows' solid pixels beside them. Reading them by mass prevents a piece apart from the body from moving the box or the torso width. The box's bottom is the frame's last solid row, the one end of the box not read by mass: where the legs cross each stride they lay their pixels over each other, and a bottom read by mass (the row with a hundredth of the frame's solid pixels under it, as the top is read) rises with them (on the lead-in walker, a row over its last solid row in most frames and 3 rows over where the legs cross, moving the crop's rows with it), though read either way, the walkers turning over frames 30 to 40 and the 4-frame turns drawn from 8 places, with the lead-in and without it, read their turns over the same frames. Under `HEAD_CORE` = 0.5, the head's centre is read as the middle of the head band's columns that hold at least half the solid pixels of the band's fullest column, before being read again within `HEAD_REACH` as before. This stops a fleck or a cut-loose ornament beside the head from shifting the head's centre and falsely reading a turn across the clip or hiding the walk's turn. The neck is the narrowest row of the first frame between 10 % and 55 % of its height (the topmost on a tie, or row 0.11 on a hooded walker). Each frame's `side` correlation is `(v.s - v.m) / (1 - s.m)`, where each correlation is taken at its nearest about the axes within `TOL`. Under module constants `SIDE_SHOWN_MIN` = 0.08, `TURN_SIDE_MAX` = 0, and `TURN_RUN_MIN` = 4 consecutive frames, candidate windows whose cut holds a frame of a turn are refused with `the body turns (clip frames a-b)`, two-step cuts holding one are left out (`step_count.turned_out`), and held-side windows two lengths long are excluded. A new bound, `HEAD_REACH` = 0.3, re-reads the head's centre (the middle of the solid pixels of the top 15 % of the body) on the pixels within `HEAD_REACH` of the body's height of it until it settles, leaving the plain mass centre as before where no pixel of those rows lies further out. Clips without turns (or unread) are searched once as before with the same cut and bytes. A walk that reads square against a still that shows a side is not read either and is cut the same way, with a warning line (`WALK_SIDE_MIN`). Where no window without the turn holds a cycle, `--body-turn warn` (the default) reruns the cut search as before and keeps the cut with a warning line naming the turn, or refuses as before (`video-loop: no periodic cycle found`) after a warning line if no cut holds a cycle; while `--body-turn refuse` (requiring `--anchor motion-auto`) prints `video-loop: the body turns in the walk` as its first line, prescribes filming it again with the torso and hips kept at the still's angle, hands over nothing, and sets `status: failed`, supporting app retake rules such as `loop-body-turned`.+ - Report fields (`<name>.loop.report.json`): every walk or run report under `--anchor motion-auto` adds the `body_turn` object containing `reading` (`torso-side-v2`), `bounds` (`SIDE_SHOWN_MIN`, `WALK_SIDE_MIN`, `TURN_SIDE_MAX`, `TURN_RUN_MIN`), `reference` (0: the frame read against, the clip's first, lead-in or not), `still_side`, `walk_side`, `read` (true or false), `why` (where not read), `neck`, `torso_still_side`, `side` (each frame's reading), `turns` (each `{from, to, least, at}`), `mode` (`warn` or `refuse`), `verdict`, `refused` (how many windows were refused for it), `cut` (`frames`, the cut's first and last clip frame, and `holds`, the turned frames it holds), `avoiding` (the search's refusal where the search that avoided the turn found nothing), and `unread` (a list of `{frames, why}`, each reason with the frames it applies to, appearing only where at least one frame was not read). The `verdict` field records one of `none` (read, no turn), `not-read` (a square still, a walk seen square, a first frame with no body, or a first frame the reading cannot read (no head to centre on, no solid pixel across its torso rows, or a crop of no width or with nothing in it)), `clear` (a turn, and the cut holds none of it without refusing anything), `avoided` (windows were refused for the turn and the cut leaves it out), `kept` (no cut without the turn holds a cycle; the cut taken before is kept, warned), `unfound` (no cycle with the turn or without it; refused as before, warned), or `refused` (`--body-turn refuse`). Where the still passes `SIDE_SHOWN_MIN` and the walk is seen square, `video-loop` prints one warning line under `--body-turn warn` and `refuse` alike, beginning `video-loop: warning: the walk reads square against a still that shows a side (still_side` and ending `check the loop's facing`. The command's JSON summary also gains `body_turn` (`verdict`, `turns`, `cut`) where a turn was read.+ - Python callers: new module `sprite_gen.video.body_turn` provides `read(frames)`, `square(reading)`, `turns(side)`, `turned(reading)`, `neck(body)`, `torso_rows(at)`, class `Turn(reading, skip=0)` (callable as `(start, length)`, returning the refusal reason or None, `held(start, length)`, counter `refused`), `refusal(...)`, `kept(...)`, `unfound(...)`, constants `READING`, `SIDE_SHOWN_MIN`, `WALK_SIDE_MIN`, `TURN_SIDE_MAX`, `TURN_RUN_MIN`, `MODES` (`warn`, `refuse`), `NECK_RANGE` (0.10, 0.55), `HEAD_REACH` (0.3), `MASS_SHARE` (0.01, the same value as `frames.SPECK_MIN_FRACTION`), `HEAD_CORE` (0.5), `GUARD` (2.5), `TOL` (2.0) and `STEP` (0.25). Functions `local_cycle.detect`, `local_cycle.by_steps` and `local_cycle.counted` take a new keyword argument `turn` (a `Turn`, default None: as before). Function `loop.run_loop` takes `body_turn` (default `"warn"`).+ - Output changes: a new named bound of the reading, `HEAD_REACH` = 0.3, re-reads the head's centre on the pixels within 0.3 of the body's height of it. The full test suite caught why it is needed: its side walker with a 60 px tail on a 45-frame beat (`tests/video/test_walk_steps.py`, the half-step case) read a turn on every swing (frames 8 to 15 and 53 to 60, least -0.19), because the tail swung up into the head's rows and pulled the head's centre aside. With `HEAD_REACH` it reads no turn (least +0.11) and is cut as before. Where no solid pixel of those rows lies within `HEAD_REACH` of their middle, the top's parts lie apart on either side of the middle (a prop held as high as the head and apart from it, or a body too small for any pixel to lie that near), and the top does not tell which part is the head, so the frame is not read instead of taking the largest part and centring on a prop that can weigh what the head does (on the test suite's 132 px synthetic staff walker, the ornament and the head hold the same number of solid pixels in those rows, 513 each, with no pixel within 39.6 px of the middle) and reading turns the body does not make. Where that frame is the first frame, the clip is not read and the cut search runs once as on any unread clip; cut by `video-loop` under default `--body-turn warn`, that synthetic staff walker is not read and is cut 11/24 (start 11, 24 frames), every byte as 3.3.0 cuts it.+ - Output changes: a new named bound of the reading, `WALK_SIDE_MIN` = 0.045, and report field `walk_side` in `body_turn` keep front and back walks whose still shows a side (from arm swings or pieces beside the head) from reading turns every stride. For each frame after the still, its head and shoulders (top 45 % of body) cropped about its head are compared with the still's head and shoulders and their mirror within `GUARD` (2.5 px); `walk_side` is the median of frame nearness to the still minus nearness to the mirror (v.s - v.m), where a frame that flips under `HELD_MAX` (0.5 %) of the drawing last counted's solid pixels (alpha 128 or more) is not counted, so each drawing counts once and `walk_side` is the median of the walk's drawings, not of the time the clip gives each drawing; a clip in which every frame flips 0.5 % or more of the frame before's solid pixels reads exactly as before. The synthetic walker seen square from behind (the walker's still was taken 6 frames into its stride and the clip is 147 frames), each drawing of the first half of each stride held 3 frames and the second half 1 frame, previously lay 0.075 and read turns over frames 19 to 29, 67 to 77 and 115 to 125 that it does not make, but counting each drawing once it now lies 0.000 and is not read, with the warning line. Through the codec and keying (libx264 and `video-frames`), at most 2 of its 74 held frames came back the same pixels as the frame before, so it previously lay 0.076 to 0.083 and read turns that it does not make, but counted once under `HELD_MAX` it lies at most 0.013 and is not read. Held against the drawing last counted, a large or slow body is counted each time it has moved `HELD_MAX` from the drawing last counted; the synthetic walker over one stride, each drawing reached from the one before over frames that each flip under 0.4 % of the frame before's solid pixels: seen square from behind (its still taken 6 frames into its stride) its `walk_side` lies under `WALK_SIDE_MIN` and it is not read; seen at an angle its `walk_side` lies over `WALK_SIDE_MIN` and it is read. Where the still passes `SIDE_SHOWN_MIN` and `walk_side` lies between -0.045 and +0.045, the walk is seen square: `read` is false, `verdict` is `not-read`, `why` starts "the walk is seen square", and cuts match search alone. Angled walks lie 0.061 or more (the 447 synthetic turn windows 0.090 or more), whereas square walks now all lie at 0.000 (the front walker with a 70 px tail moved from 0.013 to 0.000). When square, `video-loop` prints one warning line under `--body-turn warn` and `refuse` alike, beginning `video-loop: warning: the walk reads square against a still that shows a side (still_side`, giving the still's side and `walk_side` in that parenthesis, naming a front or back walk or a body that turned for much of the walk to face the camera or to its mirror, saying its facing is not read, and ending `check the loop's facing`. Reading `walk_side` costs one more crop per frame.+ - Named limits: a piece apart from the body over a hundredth of body pixels is read as body: on synthetic walkers (3849 solid pixels), a 7 px fleck over frames 30 to 39 (49 px) tops the box, reading a turn. The box bottom is the last solid row: pieces under the feet (3 to 10 px square, 1 to 45 px under, across frames 30 to 39) stop turn reads, or return a verdict of `not-read` from about 25 px under in the still. Neck rows spaced 2 % of height apart shift grid steps on 1 px box changes. A piece beside the still's head and shoulders (its head or an arm) can leave the clip unread: of 863, 372, 808 and 148 placements of a piece under a hundredth of the body about the heads and torsos of four walkers that do not turn (in the still alone, in every frame but the still, or over frames 30 to 39), 11, 1, 22 and 0 leave the clip unread, each a piece in the still alone (21 of 34 right or left of the head at 6 or 20 px, 13 beside an arm) laying the still's head and shoulders under 0.08 off their nearest mirror. The piece-in-the-still case is now closed by `WALK_SIDE_MIN`: that square walker's still is read when `SIDE_SHOWN_MIN` is lowered to 0.06 (or `GUARD` set to 2, or `STEP` to 1), but its walk is not (`walk_side` 0.000); only with `WALK_SIDE_MIN` also at 0 does it read turns (frames 15 to 21 and 39 to 43). `GUARD` and `TOL` are pixels of the frame, so a larger body's margin narrows: the plain walker drawn 1.5, 2 and 3 times as large, with the 3 by 12 px column drawn as many times as large beside its head in the still moving the centre 1.8, 2.7 and 4.0 px, the walk reads least +0.78, +0.44 and +0.31 without turning. (a) A walk turned to the still's mirror over about half its frames lies as near the mirror as the still at the median and is not read, with the warning line: the synthetic walker turned to its mirror over 39 to 41 of its 73 frames about their middle (38 to 41 hooded), that is 52 to 56 % of the clip; over 38 or fewer (37 hooded), or 42 or more, it is read with its turn. (b) A walk that turns in every cycle over 14 to 16 frames of each 24-frame cycle (58 to 67 %) is not read, with the warning line; over 13 or fewer it is read. (c) A walk turned to square and held there (a side walk that turns to face the camera and walks on toward it, or turns its back and stays) over 41 or more of its 73 frames (56 % and more; 40 or more hooded) is a square walk by its frames and is not read, with the warning line; for example the walker turned square at frame 24 and held to the end (49 frames) lies 0.006. (d) A frame is counted once only where under `HELD_MAX` of the drawing last counted's solid pixels flip: a part of the stride that a clip plays slower in drawings of its own (not held), or a held frame under noise over `HELD_MAX` (at crf 28, some of the synthetic walker's held frames), counts frame by frame, so a square walk played that way lies off the still's mirror at the median toward that part; over `WALK_SIDE_MIN` it is read and reads turns it does not make. And a drawing that flips under `HELD_MAX` of the drawing last counted (a large or slow walker where its stride turns) is taken for that drawing held and is not counted.+ - **New: the round chest (pixel; `chest_round`, `arms_x`, flags `--chest-round`, `--arms-x`).** When either is above 0, a pixel row bakes the round chest instead of the envelope squash. Both are shares of the body below the neck (0 to 0.20). The rim of the chest ellipse (smooth's `chest_*` keys) moves out from its peak by `chest_round`. Inside the ellipse the body stretches evenly from the peak; outside it the body is pushed whole, so a 1 px outline stays 1 px. Above the peak the chest goes up and out; below the peak it goes sideways only, fading to nothing at the feet. The head above the rigid boundary keeps its place and bytes, as in smooth. Below the rigid boundary, the sideways share (the chest's sideways push and the arms) turns on over the longer of 0.15 of the neck band and 1.5 times the sideways px (`chest_round` plus `arms_x` in px), and the body's following of a held piece turns on over the longer of 0.15 of the neck band and 1.5 times the largest piece move in px (if it turns on over less, rows just below the head line slide more than one cell per row against each other and an outline crossing the head line breaks; with 1.5 times, no row slides more than about one cell against the next because the steepest slope of the smooth turn on is 1.5 over its length). The arms (the columns outside where appendage protection starts) are pushed whole by the chest and then sideways by `arms_x` on top, never stretched; the torso's sides take the stretch over 12 times that push. The breath is smooth's one-sided curve (`inhale`, `breaths`, `breath_peaks`, `loop_cells`, `start_cell`), so a cell at phase 0 is the source byte for byte. Every output cell is a cell of the source: no new colour, and no row or column is folded. A round row refuses `depth`, `depth_x`, `lag` and smooth-only shape keys; smooth refuses `chest_round` and `arms_x`. See [breathing](docs/breathing.md), "둥근 가슴".+ - **New: held cells (`--hold-mask`), held props (`--props-mask`), props behind the body (`--props-behind-mask`), and props grouping (`--props-groups`).** All are PNGs the size of the frames; their light opaque pixels (lightness 128 or more, alpha 128 or more) are the cells. A cell may be in only one of the three masks; a cell in two is refused. Empty cells inside a props mask are not drawn; only the drawing's opaque cells of a piece move. A held cell keeps its bytes in every frame, because the field is 0 there (smooth and round rows; an envelope row refuses). Each piece of the props mask (8-connected, cells within 2 px of each other joined, as a hilt and blade parted by the hand) moves whole and sideways, as far as the hand holding it: the chest's sideways push where the piece touches the body, plus the full `arms_x` of the arm on its side. The body within 2 px of it moves the same whole cells, so no gap opens between hand and grip. A whole arm can move as one rigid block by masking it from the sleeve below the shoulder down to the hand together with what it holds as one `--props-mask` piece (one colour), starting below the sideways turn on rows. Where a piece moves onto held cells, held cells stay on top and those cells are not drawn; the engine counts them per piece and per frame in `props.pieces[i].hidden` and `hidden_max` of `breathe.json`, printing one warning line on stderr of the form `breathe: warning: --props-mask piece K of N (C cells) goes under held cells in F of T frames, up to M cells (frame X); those cells are not drawn` followed by `breathe.json props.pieces[K-1].hidden`. In each row, the engine looks at the first cell right behind the moved piece: when that cell is a held cell, it repeats over the cells the piece left (water fills where a blade left the water band; a held back fills where a sleeve moved away), and otherwise the body fills it; no empty cell is made up. The engine counts cells a piece fills by repeating a cell or left by the field where the body does not follow fully rather than moving them in `props.pieces[i].filled` and `filled_max` of `breathe.json` (held cells themselves are never counted), printing one warning line on stderr of the form `breathe: warning: --props-mask piece K of N (C cells) leaves cells it fills by repeating a cell in F of T frames, up to M cells (frame X); those cells are made up, not moved` followed by a space and `breathe.json props.pieces[K-1].filled`. Pieces held behind the body (`--props-behind-mask`, off by default) take the same sideways move, but the body stays in front, does not follow, and the piece is drawn under held cells, under the body, and under pieces held in front; all pieces behind the body are drawn first, then all pieces in front, including pieces that do not move in that frame (so a resting front piece is not covered by a behind piece), and held cells are always on top; where it pulls out from behind the body, the piece's cell touching the body in that row repeats over the cells it left (making the piece look wider by that many cells, as the shield's edge column repeats), while cells left where nothing was in front become empty; the cells it fills by repeating a cell are counted in `props_behind.pieces[i].filled` and `filled_max` with a warning line on stderr of the form `breathe: warning: --props-behind-mask piece K of N (C cells) leaves cells it fills by repeating a cell in F of T frames, up to M cells (frame X); those cells are made up, not moved` followed by a space and `breathe.json props_behind.pieces[K-1].filled`; its hidden cells (under held cells, the body, or a front piece) are counted in `props_behind.pieces[i].hidden` and `hidden_max` with a warning line reading `goes under held cells, the body or a piece held in front of it` and naming `--props-behind-mask`. A piece ledger maintains a source map of which source cell each output cell shows, reading all counts off this map in every frame. Before drawing, each piece is checked at its whole-cell destination and refused if pushed off the cell (naming the mask flag, piece as i/n with its cell count, opaque cells leaving, side crossed with its count like `왼쪽 변 밖 3`, cell size, and move, advising to widen the cell margin or lower `chest_round` or `arms_x`; covering behind pieces, rows above the head line, and rounding edges); the body's own off-cell refusal now counts body cells only and names the side crossed with its count. Two pieces of one layer landing on one cell are refused (advising `--props-groups colour` or moving one to the other mask); a behind piece and the body in front moving apart to leave empty cells is refused (advising to mask only the part showing outside the body as `--props-behind-mask` or give it as `--props-mask`); and in every frame the cells shown at destination plus hidden cells must equal the piece's opaque cells in the still, refusing as an engine defect if not. With `--props-groups colour` (default `piece`; refused without a props mask), both props masks are read by colour: light opaque cells of one colour form one group moving by the whole cells read where the group touches the body, allowing unheld elements like reflections to follow a prop. `breathe.json` records `hold`, `props`, and `props_behind` (path, sha256, cells, each piece's `shift_px`, `hidden`, `hidden_max`, `filled`, `filled_max`), with each piece carrying `colour` and the mask carrying `groups: "colour"` and `colours` when grouped by colour. `sprite-gen breathe` also takes `--axis-x` and `--torso-half`, the sidecar's existing overrides, so a figure whose arms lie inside the measured torso can name them.+ - **Curator**: a round row is kept as written and its preview and video export are refused, as for smooth rows; the mirrored key lists are checked against the bake's.+ - **New: banded sway moving regions as one mass (`--band`, `--band-margin`, `--band-up`).** `--band PX|auto` keeps the weight at 1 over each region's ellipse expanded by the margin in every direction (the flat part), falling from 1 to 0 by cos² over a band of `PX` px past it, leaving pixels outside the band unchanged byte for byte. `--band-margin PX|auto` (default `auto`, `ceil(reach) + 1`) sets how far past the ellipse the weight stays 1. `--band auto` sets the band to `ceil(reach x pi / 2) + 1`, the narrowest band that does not fold. Reach is evaluated first at the requested `--gain`, after which band and margin are determined in two stages. The fold rule reads the narrowest band instead of radius, refusing moves where `reach x pi / (2 x band) >= 1` or lowering gain under `--on-fold lower`. `--band-up FLAT[,PX|auto]` shapes the area above the centre separately, stopping the flat part `FLAT` of the vertical radius above the centre and falling over `PX` px (defaulting to the band or `HANG_PAST` of 3 px above the top, whichever is further) so upper regions yield while the rest moves whole. Where the flat ellipse and the outer one differ in shape (above the centre under `--band-up`, where the flat part is short and the band long), the band measured across its ring is narrower than its px, so the weight falls steeper than the fold rule reads. After the fold rule, each region's steepest slope along the move is read over every pixel of every cell (`band_steepest`: per unit of gain, the most of the move at gain 1 dotted with the weight's gradient, the gradient read between each pixel's neighbours, and the cell where it is). A pixel moved by gain `g` keeps `1 - g x steepest` of its area, so a region folds where `g x steepest >= 1`. Then `--on-fold refuse` refuses, saying that `--band`'s weight falls steeper than its px where the band is narrower across its ring, in which cell and what area a pixel keeps at the gain asked, and to lower `--gain` or give a wider `--band` (or `--band-up`, when it was given); `--on-fold lower` lowers that region's gain to the largest whole number of `0.01` steps, no more than the gain it had, whose steepest slope stays under 1 (`steepest_gain`); a region that would have to go under gain 1 is held, and the run is refused only when every region is held, as the fold rule does. Each region is carried across cells in the loop's order from the cell the region was read on by its own solid pixels under the ellipse within `CARRY_SEARCH` (9) px of where the cell before had the region's pixels (around the cell's own body lay only where the cell before was carried by the lay, or is the cell the region was read on; or, with `--reference`, for the first cell) using least squared difference of premultiplied colour and subpixel parabolic fitting; uncertain matches revert to the outline lay and warn on stderr. See [video-pipeline](docs/video-pipeline.md) section 6.+ - **New: holding pixels through banded sway (`--hold-mask`).** `--hold-mask MASK.png|DIR` leaves pixels as they are while a band moves its regions round them, requiring `--band` and off by default, byte for byte as before when not given. The mask is a PNG drawn on the cell the regions were read on (holding pixels where alpha is 128 or more; where the PNG has no alpha, grey 128 or more) or a folder of PNGs giving one mask per cell in file-name order. One mask is split into 8-connected pieces, each carried into every cell by its own solid pixels within `CARRY_SEARCH` (9) px by least squared difference of premultiplied colour and parabolic fitting (reverting to body lay with a warning on stderr when uncertain or covering no solid pixel), then grown by `HOLD_GROW` (3) px. Each cell keeps byte for byte the mask pixels, soft edges, and air within `ceil(reach) + HOLD_EDGE` (2) px. Other pixels are read short of kept pixels along the move direction by `f = min(s, h)` px, where `h` is `HOLD_SLOPE` (0.5) times free distance to kept or margin pixels (`HOLD_MARGIN` of 1 px), bounded to rise by at most `HOLD_SLOPE` per pixel (`read_share`). Reads touching forbidden pixels are renormalised or walked back by 1/`HOLD_STEPS` (1/16) of their move. Metadata gains `follow.hold` (and `sway.json` gains `hold` for `--frames`), while stdout JSON gains `hold` with `pieces`, `lay_cells`, and `read_folded_px_max`.+ - **New: a region given as a mask (`--region-mask`, `--region-rim`, `--region-shrink`, `--region-crease`).** `--region-mask MASK.png|DIR` gives the region as a mask of the part's own pixels instead of the ellipse's weight, moving the part while holding every visible pixel outside it and its soft edge in every cell, off by default and byte for byte as before when not given. The mask is a PNG drawn on the cell the regions were read on (alpha 128 or more, or grey 128 or more where it has no alpha) or a folder of PNGs giving one mask per cell in file-name order. When requested, `--region-crease` aligns the mask's lower edge to the median darkest row from `CREASE_UP` (5) rows above to `CREASE_DOWN` (3) rows below over `CREASE_SPAN` (2) columns either way, and `--region-shrink PX` (default `SHRINK_DEFAULT`, 2) wears the mask in by 4-neighbour steps. One mask is carried into each cell by its own solid pixels within `CARRY_SEARCH` (9) px by least squared difference of premultiplied colour, searching round the cell before and the body's lay, keeping the carry of the cell before when neither settles. The region and its soft edge (pixels not opaque within `REGION_SOFT`, 2, px of the region, not beside another solid pixel) move, and the air (clear pixels within `ceil(reach) + REGION_AIR`, 2, px of the region) is where they may move into; every other visible pixel is held. Inside the region, its soft edge and the air, weight rises by `sin²(pi/2 x d)` from 0 at held pixels to 1 across a rim scaled by `--region-rim SCALE` (default `RIM_DEFAULT`, 1.0) and widened until slope is at most `RIM_SLOPE` (0.9), preventing folding. With `--band-up`, weight is the lesser of the rim and the upper yield. Strip metadata gains `follow.region_mask` (and `sway.json` gains `region_mask` for `--frames`), while stdout JSON gains `region_mask` with `kept_cells`, `rim_px`, `move_most_px`, and `walked_px_max`. See [video-pipeline](docs/video-pipeline.md) section 6.+ - Python callers: `sway_loop`, `sway_frames`, `read_request`, and `read_ask` accept `band`, `band_margin`, and `band_up` (`band_up` as `(flat, px_or_"auto")` or command-line string). New in `sprite_gen.video.sway`: `band_weight`, `band_shapes`, `carry_match`, `carry_own`, `band_steepest`, `steepest_gain`, `band_ledger`, `band_notes`, and `jacobian` (moved from `sway_inspect`, which retains it under the same name); constants `BAND_POLICY`, `CARRY_BASIS_BAND`, `CARRY_SEARCH`, `HANG_PAST`, `PRESSED`, `STRETCHED`, `MOVED_PX`, and `AUTO`; and methods `Answer.band_field(k, xx, yy)` and `Answer.band_record()`. `sway_loop`, `sway_frames`, `read_request`, and `read_ask` accept `hold_mask` (a Path to a PNG or folder; None: off); new in `sprite_gen.video.sway`: `Hold`, `read_hold`, `Held`, `hold_sets`, `free_back`, `read_share`, `draw_held`, `hold_ledger`, `hold_notes`, and `carry_mask`; constants `HOLD_POLICY`, `HOLD_GROW`, `HOLD_EDGE`, `HOLD_MARGIN`, `HOLD_SLOPE`, `HOLD_ROUND`, and `HOLD_STEPS`; `Ask.hold`, `Answer.hold`, `Answer.held_cell(k)`, and `Answer.hold_record()`; and `carry_own` now calls `carry_mask` (same behaviour).+ - Python callers: `sway_loop`, `sway_frames`, `read_request`, and `read_ask` accept `region_mask` (a Path to a PNG or a folder; None: off), `region_rim` (float; None: 1.0), `region_shrink` (int; None: 2), and `region_crease` (bool); new in `sprite_gen.video.sway`: `RegionMask`, `Masked`, `crease_of`, `carry_region`, `rim_bands`, `rim_distance`, `region_sets`, `region_ledger`, and `region_notes`; constants `REGION_POLICY`, `RIM_SLOPE`, `RIM_DEFAULT`, `SHRINK_DEFAULT`, `REGION_SOFT`, `REGION_AIR`, `CREASE_UP`, `CREASE_DOWN`, and `CREASE_SPAN`; `Ask.mask`, `Answer.mask`, `Answer.mask_field(k, xx, yy)`, `Answer.masked_cell(k)`, and `Answer.mask_record()`; and `draw_held` gains `short` (default true; false reads every pixel at its whole move).+ - Record fields: `follow.band` in strip metadata and `band` in `sway.json` record `policy` (`own-pixels/margin-band-cos2/1`), `asked` (`{band, margin, up}`), `reach_px`, `band_px`, and `margin_px`. They record per-region `flat_px` and `band_px` (across, above, below); per region in `follow.band.regions[i]`, `steepest`: `per_gain` (the slope per unit of gain), `cell`, and `ratio` (the region's gain times `per_gain`, under 1 on any written strip); `carry` with `search_px` (9) and per-cell, per-region `px`, `from` (`base`, `pixels`, or `lay`), `why` for lay, `least`, and `curvature`; `lay` entries for cells carried by lay; and `ledger` lists per cell (with `<key>_max` values) for `band_on_regions_px`, `pressed_px`, `stretched_px`, `pressed_box`, `stretched_box`, `area_least`, `area_most`, `outside_moved_px`, and `jacobian_min`. Only the four counts warn: `band_on_regions_px`, `pressed_px`, `stretched_px`, and `outside_moved_px`. For each that is not 0 in some cell, one warning line on stderr says in how many cells, up to how many px and in which cell (for `pressed_px` and `stretched_px` also the least or the most area and where), and ends with the record key: `follow.band.ledger.<key>` on `--loop-dir`, `sway.json band.ledger.<key>` on `--frames`. The lay warning names its record key the same way: `follow.band.lay` on `--loop-dir`, `sway.json band.lay` on `--frames`. `jacobian_min` (the least area of the source any pixel of a moved cell takes, per cell) gives no warning: it is recorded, and 0 or under in any cell refuses the run as the last check, named the engine's fault, nothing written. Command stdout JSON gains `band` containing `band_px`, `margin_px`, and `lay_cells`.+ - Record fields: `follow.hold` in strip metadata and `hold` in `sway.json` record `policy` (`own-pixels-grown/kept-edge-air/read-short-sloped/1`), `asked` (`per_cell`, and `sha256`: the file's, or a list per file for a folder), `grow_px` (3; null for a folder), `edge_px`, `margin_px` (1), `slope` (0.5), `round_px` (1), and `steps` (16). They record `pieces` with each piece's `px` and `box` (`x0`, `y0`, `x1`, `y1`) on the cell it was drawn on (empty for a folder); `carry` with `search_px` (9) and per-cell, per-piece `px`, `from` (`base`, `pixels`, or `lay`), `why` for lay, `least`, and `curvature` (null for a folder); `lay` entries (`{cell, piece, why}`) for pieces carried by lay; and `ledger` lists per cell (with `<key>_max` values) for `held_px`, `soft_px`, `air_px`, `short_px`, `renormalised_px`, `walked_px`, `read_folded_px`, `read_folded_edge_px`, `read_least`, `read_turn_folded_px`, and `read_turn_least`. Warning lines on stderr report a piece carried by the lay (in how many cells and why), ending with the record key: `follow.hold.lay` on `--loop-dir`, `sway.json hold.lay` on `--frames`. For `renormalised_px`, `walked_px`, and `read_folded_px`, when not 0 in some cell, one warning line on stderr says in how many cells, up to how many px and in which cell, ending with the record key: `follow.hold.ledger.<key>` on `--loop-dir`, `sway.json hold.ledger.<key>` on `--frames`. Command stdout JSON gains `hold` containing `pieces`, `lay_cells`, and `read_folded_px_max`.+ - Record fields: `follow.region_mask` in strip metadata and `region_mask` in `sway.json` record `policy` (`own-pixels-mask/held-outside/rim-sin2/1`), `asked` (`per_cell`, `sha256`: the file's, or a list per file for a folder, `rim`: the scale, `shrink_px`, `crease`: true/false, and `up`: `{flat, band}` or null), `soft_px` (2), and `air_px` (`ceil(reach) + 2`). They record `rim` (`across_px` for Lx, `down_px` for Ly, `least_px`: the two bands it started at, `slope`: the steepest `(pi/2) x sqrt(...)` over the cells, and `slope_bound`: 0.9); `mask` (`px`: its pixel count as worn in, `box`, and `carried_by_px`: the solid pixels it was carried by; null for a folder); `crease` (per mask, `rows`: each column's row, keyed by column, and `free_columns`; null when not asked); `carry` (`search_px` of 9 and `cells`: per cell `px`, `from`: `base`, `pixels` or `before`, `guess`: `before` or `lay` where carried by its pixels, `why` where it kept the cell before's carry, `least`, and `curvature`; null for a folder); `kept` entries (`{cell, why}`) for cells keeping the carry of the cell before; `up` containing the upper yield's shape as a band's record (`reach_px`, `band_px`, `margin_px`, per region `flat_px`, `band_px` and `steepest`, its `carry` and `lay`; null without `--band-up`); and `ledger` lists per cell (with `<key>_max` values) for `region_px`, `soft_px`, `air_px`, `held_px`, `held_changed_px` (0), `move_most` ([px, x, y] of the region pixel that moves most; null where none moves) with `move_most_max`, `pressed_px`, `pressed_box`, `area_least`, `stretched_px`, `stretched_box`, `area_most`, `folded_px`, `jacobian_min`, `read_held_weight` ([weight, x, y]; null where none), `read_held_half_px`, `renormalised_px`, and `walked_px`. Warning lines on stderr report cells that kept the carry of the cell before (ending `follow.region_mask.kept`), a region whose `--band-up` yield was carried by the lay (ending `follow.region_mask.up.lay`), and for `held_changed_px`, `pressed_px`, `stretched_px`, `read_held_half_px`, `renormalised_px` and `walked_px` when not 0 in some cell, one line reports in how many cells and up to how many px (with area and location for pressed and stretched), ending with `follow.region_mask.ledger.<key>` on `--loop-dir` or `sway.json region_mask.ledger.<key>` on `--frames`. Command stdout JSON gains `region_mask` containing `kept_cells`, `rim_px` ([Lx, Ly]), `move_most_px`, and `walked_px_max`.+ - **Tests**: synthetic tests in new test file `tests/video/test_loop_body_turn.py` verify a 73-frame, 24-frame cycle back-diagonal walker seen from behind (legs side by side swinging half a cycle apart, arms either side swinging opposite, the arm on the facing side bright and the other dim, a light panel on the torso and the cheek toward the facing) whose turn moves its facing over to the still's mirror and back. Tests verify boundary turnovers: a torso reading of exactly 0 is not turned and one just under it is; three turned frames in a row are not a turn and four are; a frame not read ends a run; and `SIDE_SHOWN_MIN` set to the walker's own still side reads the clip and set just above it does not. The walker that turns reads one turn inside the frames it turns over and none elsewhere; the same walker not turning reads none; drawn square from behind it is not read. The same turn drawn on twos reads the same frames as on ones (within a frame), in fewer drawings. On a lead-in where the first 8 frames are filmed from 0.6 of the size (which the search leaves out), the report's `body_turn.reference` is 0, the turn reads over the frames it reads over without the lead-in (under -0.1), and the walk where it does not turn stays over +0.1; read from the first frame after the lead-in, the walk that does not turn is not read, and with `WALK_SIDE_MIN` at 0 it reads a turn every stride. A hooded walker with no neck reads its neck at the top row of the range (0.11) and finds the turn too, and finds none where it does not turn. The walker facing past its mirror 3 frames in a row reads no turn (however deep); 4 frames in a row read one turn of 4 frames. The suite's half-step side walker with a 60 px tail reads no turn at `HEAD_REACH` 0.3 and a turn every swing at 0.35. Red to green tests verify that for a walker turning over frames 30 to 40 (read as 32 to 38, least -0.63), 3.3.0 cuts 22/24 (frames 22 to 45) across the turn, while this version refuses the windows that hold it and cuts 41/24 (frames 41 to 64); and turning over frames 14 to 24 and 24 to 34 where 3.3.0 cut 11/24 and 17/24 across the turn, this version cuts 35/24 and 41/24. When a walker turns in every cycle, `warn` keeps the cut the search took before, byte for byte, with the warning line, while `refuse` refuses it with `video-loop: the body turns in the walk` as the first line and hands nothing over. Walkers that do not turn and walkers drawn square are cut byte for byte as the search alone cuts them. The walker that turns (over frames 30 to 40) is cut with the cycle search replaced by one that finds no cycle in any window (as on a clip that holds no repeat), and its feet are not read; `warn` refuses it in the words it was refused in before (`video-loop: no periodic cycle found`), after the warning line naming the turn; `refuse` refuses it with `video-loop: the body turns in the walk`. Passing `--body-turn refuse` without `--anchor motion-auto` is refused. New synthetic tests in `tests/video/test_loop_body_turn.py` verify that the staff walker's still is not read; the staff over frames 20 to 29 and a 2 pixel sliver at frame 40 leave those frames null with their reason, every other frame reading as it reads without them; a pennant apart above the walker leaves the still's torso rows empty and the still unread; the pennant over frames 20 to 29 only leaves those frames' torso crops empty, so they are null, not 0; a head on a pole (one column under the head's centre) gives a crop of no width and the still is not read, and a frame of one solid pixel is null; a clip with no frames is not read; and under the default `warn`, the staff walker and the walker with the pennant in its first frame alone are cut byte for byte as the search alone cuts them, and the report says why they were not read. For `torso-side-v2`, new synthetic tests in `tests/video/test_loop_body_turn.py` verify that the 42 named walkers each read as drawn (a turn inside the frames it turns over, none where it does not, unread where the still cannot be read), the 7 px fleck reading its frames turned as the named limit; the antenna or whisker cut loose with a 3 px fleck at 186 placements reading no turn (marked slow); a piece apart under the feet over frames 30 to 39 (3, 6, 7 and 10 px; 1 to 45 px under) reading no turn; `MASS_SHARE` on both sides (the 6 px fleck and the antenna cut loose read no turn at 0.01, the 7 px fleck reads its frames turned at 0.01, the antenna tops the box and the walk reads three turns at 0.005, the 7 px fleck reads no turn at 0.0125, and the walker's 3849 px put a hundredth between 36 and 49); `HEAD_CORE` on both sides (at 0.5 neither the fleck beside the head in the still nor the ornament moves the still's centre, the fleck's walk reads no turn and the ornament walker reads its turn; at 0.3 the fleck moves the still's centre more than 1 px and less than `TOL` and the walk still reads no turn; at 0.35 the ornament moves it less than `TOL` and the turn still reads). The walker drawn in one grey crops as its own mirror about its head's axis (head and shoulders and torso under 1e-6 off it), and in its own tones its still lies 0.10 to 0.11 off its mirror; with the still's centre read 0.25 to 1 px off either way the walk reads no turn and no frame's side moves 0.07; a 6 by 6 px square or a 3 by 12 px column 6 px right of the head in the still, or the column over frames 30 to 39 of the lead-in walker, reads no turn, and the same walkers turning read their turn inside frames 30 to 40; the hooded, lead-in and plain stills lie between 0.08 and 0.11 off their nearest mirror, and the walker seen square with a 3 by 12 or 2 by 18 px column or a 6 by 6 px square against its head or 6 px from it in the still is not read (its side between 0.05 and 0.07); with `GUARD` 2, `STEP` 1 or `SIDE_SHOWN_MIN` 0.06 the square walker with the 3 by 12 px column has its still read but its walk not ("the walk is seen square"), and with `WALK_SIDE_MIN` at 0 as well it reads turns; `TOL` 0 reads the lead-in walker with the column over frames 30 to 39 turned there; and the side walker with a 60 px tail and its arms reads no turn with every frame's centre read 3 px left, where at `TOL` 1 it reads a turn with them 2.25 px left. The square walker taken 6, 3 or 9 frames into its stride, or 1, 2 or 11 frames with a 6 by 6, 3 by 12 or 2 by 18 px piece beside its head in the still, has its still over `SIDE_SHOWN_MIN`, `walk_side` under 0.005, and is not read, while with `WALK_SIDE_MIN` at 0 it reads three turns. The walker seen square from behind whose still shows a side, each drawing of one half of its stride held 2, 3 or 4 frames and each of the other half 1 frame (taken 2, 3, 6, 9 or 11 frames into its stride; alone, or with a 6 by 6, 3 by 12 or 2 by 18 px piece beside its head in the still), is not read, with the warning line, and its `walk_side` is the same as drawn on ones (within 0.002 with a piece); with `WALK_SIDE_MIN` at 0 it reads turns. The plain, hooded, turning and hooded turning walkers held the same way have the same `walk_side` as on ones, read their turn over the frames that hold the drawings they turn over (drawings 30 to 40), and read none where they do not turn. The square walker held 3 and 1 frames over the two halves of its stride (taken 6 frames into its stride, alone or with a 6 by 6 px piece beside its head in the still), each held frame with 6 of its edge pixels cleared (under 0.2 % of its solid pixels), has the same `walk_side` as without the noise and is not read (with `HELD_MAX` at 0 it is read, with turns), while the turning walker held the same way with the same noise has the same `walk_side` as without it and reads its turn over the frames that hold drawings 30 to 40. Through libx264 (its default crf 23) and `video-frames`' keying (a slow test, skipped without ffmpeg), the square walker held 3 and 1 lies under 0.02 and is not read, and the turning walker held the same way reads its turn over the frames that hold drawings 30 to 40. The walker over one stride, each drawing reached from the one before over frames that each flip under 0.4 % of the frame before's solid pixels, seen square from behind (taken 6 frames into its stride) is not read (`walk_side` under `WALK_SIDE_MIN`), and seen at an angle is read (`walk_side` over `WALK_SIDE_MIN`). `walk_side` lies between 0.08 and 0.11 for the plain, hooded, lead-in, turning, hooded turning, turning-every-cycle and on-twos walkers, between 0.07 and 0.075 for the side walker with a 60 px tail on a 45-frame beat, and under 0.005 for the square walker taken 3, 6 or 9 frames on, and `WALK_SIDE_MIN` is 0.045. The walker turned to its mirror over frames 18 to 53 (36 of 73) is read with its turn over frames 20 to 51 and no warning, over 16 to 55 (40) is not read (`walk_side` under 0.005) and gets the warning (naming the turn to its mirror), as does the walker turned over 15 frames of each 24-frame cycle, and over 14 to 57 (44) is read with its turn over frames 16 to 55, `walk_side` under 0 and no warning. Cut by `video-loop`, the walker turned square at frame 24 and held to the end is not read (`verdict` `not-read`, `walk_side` under 0.01), prints exactly one warning line beginning `video-loop: warning: the walk reads square against a still that shows a side (still_side` and ending `check the loop's facing` that gives the still's side and `walk_side` and names the turn to face the camera or to its mirror, and is cut every byte as the search alone cuts it, while the diagonal walker that does not turn and the walker drawn square print no such line.+ - **Tests**: `tests/effects/test_breathe_round.py` (on a synthetic figure: the rest is the source and the head never moves; the chest swells round from one point, the line above the peak rises and the line below it does not; no new colour, no fold, a 1 px outline; the arms move sideways whole; a bar held in the hand moves with it and no gap opens; held cells keep their bytes under the round chest and under smooth; a bar going under a held water band is counted per frame in `breathe.json` and warned on stderr, held cells keep their bytes and the cells it left in the water rows are water (no gap); a reflection painted the bar's colour with `--props-groups colour` follows the bar by the same cells in every frame, the cells it left show the still's water, and no new colour appears; a shield given as `--props-behind-mask` slides out from behind a held arm with its rim cell filling the space and no gap, while given as `--props-mask` the held arm's outline fills that space instead; `--props-groups` without a props mask is refused; the new keys off keep every byte; wrong keys are refused; the CLI bakes what the library bakes and records both masks; a piece pushed off the canvas, behind the body or in front, is refused with its name and the side, and no folder is left; a piece above the head line pushed off the canvas is refused; the body pushed off the canvas names the side; the cells a piece fills (a shield sliding out from behind an arm, a bar leaving a held water band) are recorded per frame in `breathe.json` and warned, and match a count made independently from a tag picture (every cell carries its own index); in eight scenes every cell of every piece is drawn at its destination or counted as hidden in every frame, and the filled count matches the independent count; two pieces of one layer landing on one cell are refused; a piece in front stays over a piece behind, whether it moves over it or the behind piece moves under it; a piece behind the body moving apart from it is refused; the ledger changes no byte of seven scenes baked before it (no masks, held legs only, the held bar, the bar in the water, the colour group reflection, the shield behind and in front); a row with only held cells records no piece ledger) and `tests/effects/test_breathe_round_curator.py` (the mirror refuses a round row; the round trip keeps a round sidecar as written and keeps a refused one with a notice; the mirrored key lists).+ - **Tests**: new file `tests/video/test_sway_band.py` covers these cases on synthetic figures. Each case first reads what a sway writes with or without the band (its cells, its fold, whether it refuses, what it says on stderr) and the band's own record after, so a release without the band fails on what comes out:+ - without `--band`, the strip and the record are as before (no `band`, no `carry_basis`);+ - `auto` reads the margin and the band off the move's reach at the gain asked, and the fold rule reads the band;+ - a band narrower than the move needs is refused, or the gain lowered under `--on-fold lower`;+ - a band narrower across its ring than its px (flat to a tenth of the radius above the centre) is refused by its steepest slope, or lowered to the largest gain whose slope stays under 1, every cell's least area over 0, while the same band without `--band-up` keeps the gain asked;+ - `--band-up` stops the flat part over the centre and runs its band past the region's top: below the centre the cells are those of the band without it, above it the upper part gives;+ - what cannot go with `--band` is refused with its reason (a flat share, `--stretch-floor`, `--band-margin` or `--band-up` alone) and leaves the loop as it was; a flat share of 0 is four numbers and takes a band;+ - out-of-range values are refused by the command line with exit 2 and the flag's message;+ - the flat part moves by the cell's offset itself, and past the band no byte changes, also just past its rim;+ - a part that slides on the body is carried by its own pixels, not the lay;+ - a part that slides 3 px a cell to 12 px from the lay, held there and back, is found around where the cell before had it and moved whole in every cell;+ - cloth with no pattern, and a part that jumps further than the search from where the cell before had it, are carried by the lay and named in a warning;+ - cloth dotted every 4 px is a tie and carried by the lay;+ - the ledger's counts, boxes and warning lines;+ - `--frames` gives the strip's cells, and a turned loop under `--read-on` is the cut's banded sway cell for cell.+ `tests/video/test_follow_inspect.py` now names `--band`, `--band-margin` and `--band-up` among the arguments `video-sway` takes and `video-sway-inspect` does not.+ - **Tests**: new file `tests/video/test_sway_hold.py` covers these cases on synthetic figures. Each case first reads what a sway writes with and without the mask (its cells, whether it refuses, what it says), so a release without the mask fails on what comes out; the hold's record and ledger are read after:+ - without `--hold-mask` the band is as before (no `hold` in the record);+ - an arm over the chest, a belt below it, a half-clear edge beside the arm and a clear notch at the waist keep their bytes in every cell; no arm-coloured pixel is drawn off the arm, and no pixel solid within 2 px of the arm is left clear; without the mask the band moves the arm and draws its colour on the chest; record: pieces, carry by own pixels where the body carries them, no lay, some reads short;+ - pixels no read round the mask comes near are the band's byte for byte;+ - a steep band beside the mask (the band's own least area under 0.2, the gain lowered by the fold rule): the arm keeps its bytes and no read takes the source backwards, checked by a direct computation and by the ledger (`read_folded_px` 0 in every cell, and where the read turns from the whole move to its share, `read_turn_folded_px` 0 and the least area over 0);+ - a folder of the carried masks gives the same strip and ledger as the one mask;+ - `--frames` gives the strip's cells and the same hold record;+ - under `--read-on`: a mask drawn on a cut's first cell (on its chest's rim); the held sway differs from the band alone in more than half of the cells, and a loop turned from that cut and swayed with `--read-on` on the cut's reading and the same mask gives the cut's held cells, cell for cell in the turned order, with the read-on relation `transported` and the same carried pixel count per piece in each cell, in the turned order (this case uses the read-on tests' runner figure);+ - each refusal leaves the loop as it was;+ - a piece on cloth with no pattern is carried by the lay, held all the same, and the record, the warning line, the stdout JSON and the ledger keys say so.+ `tests/video/test_follow_inspect.py` now names `--hold-mask` among the arguments `video-sway` takes and `video-sway-inspect` does not.+ - **Tests**: new file `tests/video/test_sway_region.py` covers these cases on synthetic figures (a body whose striped part, round above and cut straight below, lies over its torso's right side and past it over the air, soft against the air, with a dark crease under it on the torso; the band tests' part on cloth with no pattern; the read-on tests' runner, cut and turned). Each case first reads what a sway writes with the mask (its cells, whether it refuses, what it says), so on a release without the mask the same input fails on what comes out; the record and the ledger are read after:+ - without `--region-mask` the sway is as before, plain and with `--band` (no `region_mask` in the record), from the command line and from Python;+ - every visible pixel outside the part keeps its bytes at gain 2.5, at 1.25 and at 6.0, while without the mask the outside changes;+ - inside its rim the part moves whole, and it moves into the air beside it and no further;+ - the part's soft edge moves with it, and a soft pixel beside the torso is held;+ - the mask is carried round where the cell before had it first (a part sliding on the body, and one ramping away from the lay), and the record says so;+ - a part whose body jumps further than the search is found round the lay;+ - where neither guess settles (cloth with no pattern), the carry of the cell before is kept, never the lay, and the record, the warning line and the stdout JSON say which cells and why;+ - the rim is read off the move and the weight is sin² of the distance to the held pixels, at gain 2.5 and 6.0: the fold rule reads no radius, nothing folds, no read is walked back and no read puts half its weight on a held pixel;+ - a wider rim (`--region-rim 1.5`) moves less of the part whole;+ - `--band-up` yields above the centre: the weight is the lesser of the rim's and the yield's, and below the centre it is the rim's;+ - a mask drawn 2 px large holds the belly once it is worn in by the default 2 px;+ - `--region-crease` ends the mask on the darkest row under it before it is worn in;+ - a folder of the carried masks moves the part as the one mask does;+ - `--frames` gives the strip's cells and the same record;+ - a loop turned from a cut and moved under `--read-on` on the cut's reading is the cut's, cell for cell;+ - each refusal leaves the loop as it was;+ - the ledger counts each cell, and the warning lines and the stdout JSON say what is in it.+ `tests/video/test_follow_inspect.py` now names `--region-mask`, `--region-rim`, `--region-shrink` and `--region-crease` among the arguments `video-sway` takes and `video-sway-inspect` does not.+## v3.5.0 - Widened square canvas framing for side walk and run stride and trailing parts, measured background matte cutout for flat backgrounds of any colour, and failure when a cutout removes nothing**Upgrading from 3.4.0: `video-set` now frames a walk or run filmed from the side on a square widened by the room its still lacks, and a background the chroma engine did not recognise, which used to come out with nothing removed, is now cut out.** A still that leaves less than `GAIT_ROOM` clear in front of its silhouette (0.15 of the silhouette's height) or behind it (0.25) gains the columns it lacks on that side; the square gains the same number of rows above the still. A still that leaves the room keeps its canvas to the byte. Every other state, a front, back or diagonal view, `--shape` and `--fit tight` are framed as before. Each side walk or run's `canvas.report.json`, and its item in `set.report.json`, gains `room`. `video-canvas` gains `--view` and reads the room only with `--view side`. Backgrounds the chroma engine already recognised key byte for byte as before. A pure or recognised magenta/green background still goes to the chroma engine and a bright achromatic one to the white matte, with the same bytes.diff --cc sprite_gen/video/batch.pyindex 677fb30,815aa5d..71a7a58--- a/sprite_gen/video/batch.py+++ b/sprite_gen/video/batch.py@@@ -37,7 -37,8 +37,9 @@@ from sprite_gen.video import facing asfrom sprite_gen.video import canvas as canvas_modfrom sprite_gen.video import frames as frames_modfrom sprite_gen.video import loop as loop_mod+ from sprite_gen.video import held_fill as held_fill_mod+from sprite_gen.video import local_cycle+ from sprite_gen.video import root_motion as root_motion_modfrom sprite_gen.video import align as align_modfrom sprite_gen.video import body_plan as body_modfrom sprite_gen.video.body_plan import Body@@@ -730,10 -722,13 +732,14 @@@ def run_itemend_frame: Path | None = None,play: str | None = None,motion: str | None = None,+ fill_held: str = "auto",+ out_fps: float | None = None,+ air_retime: str | None = None,+ meters_per_px: float | None = None,) -> dict[str, Any]:"""One (direction, state) item, canvas to loop. `play` is the request's play mode for it (`play.MODES`; None, the- state's preset) and `motion` the caller's own motion text in place of the state's sentence."""+ state's preset) and `motion` the caller's own motion text in place of the state's sentence. `anchor` is the+ request's `--anchor`; None cuts the loop with the item's own (`anchor_for`)."""mode = play_mod.resolve(state, play, prog="video-set")if end_frame is not None and mode != play_mod.ONCE_HOLD:raise SystemExit("video-set: --end-frame requires a once-hold item (a non-loop state, or --play once-hold)")@@@ -868,10 -863,10 +874,11 @@@if decontam_note:# the set report lists it under `warnings`result["frames"]["decontam_warning"] = decontam_note- lp = loop_mod.run_loop(Path(fr["keyed_dir"]), item_dir / "loop", fps=float(fr["fps"]), state=state, min_len=None, max_len=None, n_out=None, seam_max=loop_mod.SEAM_RATIO_MAX, name=item, report_path=item_dir / "loop.report.json", anchor=anchor, body_height=body_height,- cycle_mode=cycle_for(state, direction, play, pinned=pins),- facing=facing if direction in handed_mod.LATERAL_VIEWS else "right",+ cut = cycle_for(state, direction, play, pinned=pins)+ lp = loop_mod.run_loop(Path(fr["keyed_dir"]), item_dir / "loop", fps=float(fr["fps"]), state=state, min_len=None, max_len=None, n_out=None, seam_max=loop_mod.SEAM_RATIO_MAX, name=item, report_path=item_dir / "loop.report.json", anchor=anchor_for(state, cut, anchor), body_height=body_height,+ cycle_mode=cut,- facing=facing if direction in handed_mod.LATERAL_VIEWS else "right", view=direction)++ facing=facing if direction in handed_mod.LATERAL_VIEWS else "right", view=direction,+ fill_held=fill_held, out_fps=out_fps, air_retime=air_retime, meters_per_px=meters_per_px)result["loop"] = {"kind": lp["cycle"].get("kind", "periodic"), "cycle": lp["cycle"]["length"], "period": lp["cycle"]["period_global"], "cycle_ratio": round(lp["cycle"]["ratio"], 3), "seam_ratio": lp["resampled_seam_ratio"], "n_out": lp["n_out"], "drift_px": lp["strip"].get("drift_px", 0), "gif": lp["gif"]["file"], "webp": lp["webp"]["file"], "strip": lp["strip"]["path"]}result["loop"]["review_recommended"] = lp["cycle"].get("review_recommended", False)result["loop"]["half_period_guard"] = lp["cycle"].get("half_period_guard")@@@ -896,9 -883,18 +903,21 @@@result["loop"]["step_screen"] = {k: lp["cycle"]["step_screen"][k] for k in ("lag", "ratio", "depth", "coverage")}if lp.get("motion_anchor", {}).get("applied") is False:result["loop"]["motion_anchor"] = lp["motion_anchor"]+ if lp.get("retake"):+ # a take to film again (a part that pops at the wrap, a walk that starts or stops in the take), named+ result["loop"]["retake"] = {k: lp["retake"][k] for k in ("reason", "reasons", "remedy")}+ # The cut's poses over its cells, its held runs as delivered, and what became of them (docs/loop-repair.md section 7).+ held = lp["held_fill"]+ result["loop"]["poses"] = held_fill_mod.said(held)+ result["loop"]["held_fill"] = {"before": held_fill_mod.said(held["before"]), "held_runs": held["held_runs"],+ "made": held["made"], **({"unmade": held["unmade"]} if "unmade" in held else {}),+ **({"out_fps": held["out_fps"]} if "out_fps" in held else {})}+ if "root_motion" in lp:+ # A cut played once: each air's seconds and apex (docs/video-pipeline.md, "Root motion").+ result["loop"]["air"] = root_motion_mod.said(lp["root_motion"])+ if "air_retime" in lp:+ result["loop"]["air_retime"] = {k: lp["air_retime"][k] for k in ("applied", "why", "made", "shown_again", "poses", "cells")+ if k in lp["air_retime"]}if "rife" in (lp.get("jump_repair") or {}):# cut as filmed for want of RIFE: the set report lists it under `warnings` (a wrap the seam bridge read carries# its `seam`, not the flow's `off_max_before`)diff --cc sprite_gen/video/local_cycle.pyindex 2cdd281,ccde979..4d362fa--- a/sprite_gen/video/local_cycle.py+++ b/sprite_gen/video/local_cycle.py@@@ -1095,10 -552,10 +1111,10 @@@ def _gates(tried, seam_max)def by_steps(distances, trajectory, reading, *, found, refused, min_len, max_len, seam_flow, wrap_pop, seam_gate, flow_limit,- seam_max, gait_floor, periodicity_min, signals, pop_gate=None):+ seam_max, gait_floor, periodicity_min, signals, pop_gate=None, turn=None):- """The cut the clip's own steps choose (`reading`, crossings.Reading), after the pixel search: `found`, its cut,- or `refused`, why it found none. Returns (the cut, or None where the search's word stands and it found none;- `step_count`, the record).+ """The cut the clip's own steps choose (`reading`, crossings.Reading, whose crossings mark steps or cycles as+ `read_cycles` read them), after the pixel search: `found`, its cut, or `refused`, why it found none. Returns (the+ cut, or None where the search's word stands and it found none; `step_count`, the record).- The clip does not show its steps (`reading.readable` false: no feet seen, a lean that is not feet stepping,under two steps): the search's cut, as it chose it.@@@ -1139,7 -605,17 +1158,11 @@@if reading.in_phase(searched):record.update(chosen_by='search', cut=searched)return _two_steps(found, record), record- said, counted = same_picture_count(reading, distances, searched)- if said is not None:- record['search']['same_picture'] = said- if counted is not searched:- record.update(chosen_by='search', cut=counted)- return found, recordtwos = reading.twos(min_len, max_len)+ if turn is not None:+ kept = [counted for counted in twos if turn(*counted['cut']) is None]+ record['turned_out'] = len(twos)-len(kept)+ twos = keptrecord['two_cuts'] = len(twos)if not twos:record['chosen_by'] = 'search'@@@ -1251,39 -718,7 +1274,40 @@@ def step_verdict(cycle)f"seam {declined['seam']:g}): the search's cut {s}/{L} stands, {counted['cut']['verdict']} by the count "f"({counted['cut']['why']})")elif 'two_cuts' in counted and counted['two_cuts'] == 0:- out.append(f"the clip shows its steps (crossings {counted['crossings']}) but no cut of two: the cut {s}/{L} is "+ turned = f" that leaves the body's turn out ({counted['turned_out']} hold it)" if counted.get('turned_out') else ''+ out.append(f"the clip shows its steps (crossings {counted['crossings']}) but no cut of two{turned}: the cut {s}/{L} is "f"{counted['cut']['verdict']} ({counted['cut']['why']}) — count its steps")- return out+ return out + held_verdict(cycle)+++def held_verdict(cycle):+ """The body's word on the cut, where it holds it (`cut_witness`, loop `_witnessed`), in words: a cut nothing+ witnesses whole cycles, or one the body rises and falls once in — one step of a walk, or a whole cycle of a body+ that does so once a cycle — kept as it was chosen, each line's reading named (CUT_LINES). Each names UNWITNESSED.+ A cut held on one step whose record names no line it was read on (no `by` or `lines`) is refused by name+ (ValueError): the line it rose and fell once on cannot be named."""+ said = cycle.get('cut_witness') or {}+ if said.get('held') != 'unwitnessed':+ return []+ s, L = said['cut']+ counted = cycle.get('step_count') or {}+ basis = (f"the step count reads no feet ({counted.get('why', 'no reading')})" if not counted.get('readable')+ else "the clip's crossings cannot say it either: read off feet that slide, or off a shadow under them on a "+ "picture that moves, they count half steps")+ if said['says'] is None:+ return [f"nothing that reads no leg witnesses the cut {s}/{L} whole cycles ({said['why']}): {basis} — where the "+ f"walk's legs are drawn alike, a step loops as a cycle does, and the loop may be half its cycle "+ f"({UNWITNESSED})"]+ if 'by' not in said or 'lines' not in said:+ raise ValueError(f"the cut witness of {s}/{L} says one step and names no line it was read on (no `by` or "+ "`lines`): held_verdict names the line a cut held on one step rose and fell once on, as "+ "cut_word records it (CUT_LINES); cut the loop again to have its witness so recorded")+ on = said['on']+ where = ' and '.join(CUT_LINES[line] for line in said['by'])+ rest = ''.join(f", and {CUT_LINES[line]} it says nothing ({word['why']})" for line, word in said['lines'].items()+ if line not in said['by'])+ return [f"nothing that reads no leg witnesses the cut {s}/{L} whole cycles: the body's top line {where} rises and falls "+ f"of its own once in it ({on['half']:+.2f} a cut on, {on['quarter']:+.2f} half a cut on){rest} — one step of a "+ f"walk whose legs are drawn alike, half its cycle, or a whole cycle of a body that rises and falls once a cycle "+ f"(a limp, a body with no legs that bounces as it goes) — and {basis}. The cut is kept as chosen: cut again two "+ f"long, it would loop two of such a body's cycles ({UNWITNESSED})"]diff --cc sprite_gen/video/loop.pyindex 61bbae3,1b0f01a..4718ffd--- a/sprite_gen/video/loop.py+++ b/sprite_gen/video/loop.py@@@ -1691,17 -1764,20 +1830,19 @@@ def cycle_apart(files: list[Path], *, sdef _by_steps(cycle: dict[str, Any] | None, refused: ValueError | None, *, frames: list[Image.Image], analysis: dict[str, Any],D: np.ndarray, trajectory: np.ndarray, window: CutWindow, searched: dict[str, Any], detect: dict[str, Any],- seam_max: float, cells: CutOnCells, view: str | None = None, facing: str = "right") -> dict[str, Any]:- seam_max: float, cells: CutOnCells, turn: body_turn_mod.Turn | None = None) -> dict[str, Any]:++ seam_max: float, cells: CutOnCells, view: str | None = None, facing: str = "right",++ turn: body_turn_mod.Turn | None = None) -> dict[str, Any]:"""The cut the clip's own steps choose (`local_cycle.by_steps`, the crossings of the frames the search read,- sprite_gen/video/crossings.py), recorded `step_count`, from the search's cut or its refusal (`refused`).+ sprite_gen/video/crossings.py, steps or cycles as the clip and its `view` say: `read_steps`), recorded+ `step_count`, from the search's cut or its refusal (`refused`).`cells` reads a cut of `frames` before it is cut as the seam gate and the seam pop gate read the loop.Where the clip shows its steps but no cut of two, and the search's cut is one they refute (one step, three), thesearch runs again on the window it searched (`searched`) refusing such cuts (`detect`'s `judge`). A search that- finds nothing names each refused window's count, those the crossings refute last, and raises."""+ finds nothing names each refused window's count, those the crossings refute last, and raises. With `turn`, no cut+ that holds a frame of a body turn is taken, a two-step cut or the search's again."""signals = leg_signals(frames)- try:- reading = crossings_mod.read(crossings_mod.foot_signals(frames, gap=signals["gap"] if signals else None))- except ValueError:- reading = crossings_mod.Reading(len(frames), "gap", [], why="a frame has no solid body to read the feet from")+ reading = read_steps(frames, D, view=view, facing=facing, signals=signals)moved = moved_alpha(frames, analysis)picked, record = local_cycle.by_steps(D, trajectory, reading, found=cycle, refused=refused, min_len=window.lo, max_len=window.max_len or len(frames),@@@ -1787,43 -1868,83 +1933,125 @@@ def _counted(cycle: dict[str, Any], stereturn found+def _witnessed(cycle: dict[str, Any], *, frames: list[Image.Image], view: str | None = None) -> dict[str, Any]:+ """The cut a walk's search and step count chose (`_by_steps`), held to one word before it is cut whichever way it+ was chosen — the search's, two steps by the clip's crossings, crossings read or not: the body's+ (`local_cycle.cut_word`: its top line on the screen and over its feet, the first word either says), or where it says+ no cycle the order the feet are drawn in (`legs.feet_order`, as the step count reads it; not from the side `view`),+ recorded `cut_witness` — not the order where the cut is the search's, kept because none of the clip's two-step cuts+ closes (`declined`). Legs drawn alike loop as well on one step as on two, and crossings read off feet that slide,+ or off a shadow under them on a picture that moves, count half steps.++ - Its own rise and fall twice the cut, or four times: the cut is a cycle, or two, and stands. Cut two cycles, its+ strip still counts two steps where the crossings counted them, and `video-set` leaves it out of its state's cycle+ alignment (local_cycle.FOUR_STEPS, `local_cycle.four_steps`). Where its lowest row rises and falls twice the cut+ more than its top line on the screen, the record carries a mark (`mark`), and nothing is held on it.+ - Else nothing witnesses the cut handed out whole cycles, and it is held (`held: unwitnessed`): kept — two of the+ clip's crossing intervals where it counted them, else as the search chose it — and named+ (local_cycle.UNWITNESSED, `held_verdict`); `video-set` leaves it out of its state's cycle alignment+ (`local_cycle.unwitnessed`). So is a cut the body rises and falls once in (`says` one step): one step of a walk,+ or a whole cycle of a body that rises and falls once a cycle — a limp, a body with no legs that bounces as it- goes — which nothing that reads no leg tells apart. It is never cut again two long: that would loop two of such- a body's cycles.++ goes — which nothing that reads no leg tells apart. It is not cut again two long on its word: that would loop++ two of such a body's cycles. A cut two lengths long comes only from the clip's own picture, read before this++ (`_two_lengths`), and its cut is the cut read here.++ A cut whose crossings the step count left on steps, nothing witnessing two steps an interval (`cycles.unwitnessed`),+ is held so already, and named on its step count (`held: step count`). Only a walk or a run comes here+ (motion-auto, its cycle searched, no count given)."""+ first = [cycle["start"], cycle["length"]]+ if ((cycle.get("step_count") or {}).get("cycles") or {}).get("unwitnessed"):+ cycle["cut_witness"] = {"cut": first, "held": "step count"}+ return cycle+ strike = leg_signals(frames)+ order = None if view == local_cycle.SIDE_VIEW or not strike else [legs_mod.feet_order(f) for f in frames]+ said = {"cut": first, **local_cycle.cut_word({**strike, **legs_mod.body_signals(frames)} if strike else None,+ cycle["length"], order=order,+ declined=(cycle.get("step_count") or {}).get("declined"))}+ cycle["cut_witness"] = said if said["says"] in ("two steps", "four steps") else {**said, "held": "unwitnessed"}+ return cycle+++ def _motion_auto(frames: list[Image.Image], files: list[Path], D: np.ndarray, trajectory: np.ndarray, analysis: dict[str, Any],+ *, fps: float, window: CutWindow, prof: LoopProfile, state: str, steps: int | None, seam_max: float,+ seam_pop_max: float | None, scratch: _Scratch, said: dict[str, Any],- turn: body_turn_mod.Turn | None = None++ turn: body_turn_mod.Turn | None = None, view: str | None = None, facing: str = "right"+ ) -> tuple[dict[str, Any], list[Path], dict[str, Any], list[float] | None]:+ """`--anchor motion-auto`'s cut of `frames` — the clip after its lead-in, held, `files` written of them and `D`,+ `trajectory` and `analysis` read on them (auto_motion.analyse): the search, the gait fallback after a first search+ that finds nothing, then the count, given (`steps`, `_counted`) or the clip's crossings (`_by_steps`) and, for a cut- one step long that neither counted, the clip two lengths on (`_two_lengths`). Returns the++ one step long that neither counted, the clip two lengths on (`_two_lengths`), and the cut so chosen held to one++ word (`_witnessed`; `view`, the view the clip is filmed from, as the step count reads it). Returns the+ cut, the files and the analysis it was read on (the gait fallback's, where it scaled the frames back), and the factor+ the gait fallback scaled each frame by (None where it did not); `said`+ takes what the report adds (`automatic_motion_analysis` read again, `gait_fallback`), whether a cut is found or the+ search raises. With `turn` (body_turn.Turn), no cut that holds a frame of a body turn is taken."""+ lo, hi = window.lo, window.hi+ detect = dict(gait_floor=round(prof.min_seconds*fps), periodicity_min=PERIODICITY_MIN,+ double_tolerance=GAIT_DOUBLE_TOL, double_search=GAIT_DOUBLE_SEARCH)+ searched: dict[str, Any] = {"min_len": lo, "max_len": hi}+ refused: ValueError | None = None+ cycle = None+ undone: list[float] | None = None+ # The cuts the search chooses among, read before one is cut as the seam gate and the seam pop gate read the loop.+ cells = CutOnCells(frames, pop_max=seam_pop_max)+ try:+ moved = moved_alpha(frames, analysis)+ cycle = local_cycle.detect(D, trajectory, min_len=lo, max_len=hi, signals=leg_signals(frames),+ wrap_pop=wrap_pop_on(moved), held_edge=HeldEdge(moved), length_cap=window.max_len,+ pop_gate=cells.gate, turn=turn, **detect)+ except ValueError as first:+ # A front or back gait that walked toward the camera, or a slow one: one more+ # search, recorded (`gait_fallback`), and only after the first found nothing.+ drift = gait_fallback.cycle_drift(frames, min_lag=lo, max_lag=hi)+ fallback = {"reason": str(first), "scale_drift": {k: drift[k] for k in ("height_first_px", "height_last_px", "drift", "method")},+ "scale_drift_min": gait_fallback.SCALE_DRIFT_MIN, "scale_undone": False}+ if abs(drift["drift"]) >= gait_fallback.SCALE_DRIFT_MIN:+ fallback["padding_ltrb"] = list(gait_fallback.undo_padding(frames, drift))+ frames = gait_fallback.undo_scale(frames, drift, pad=tuple(fallback["padding_ltrb"]))+ undone = [gait_fallback.frame_hold(k, drift)["scale"] for k in range(len(frames))]+ files = gait_fallback.write_frames(frames, [f.name for f in files], scratch.new())+ D, trajectory, analysis = auto_motion.analyse(frames, fps=fps)+ said["automatic_motion_analysis"] = analysis+ fallback["scale_undone"] = True+ cells = CutOnCells(frames, pop_max=seam_pop_max)+ # An explicit --max-len is the caller's ceiling and stays one.+ hi_long = window.past(gait_fallback.long_window(lo, len(files), fps))+ fallback["window"] = [lo, hi_long]+ said["gait_fallback"] = fallback+ searched = {"min_len": lo, "max_len": hi_long, "max_fraction": gait_fallback.LONG_CYCLE_FRACTION}+ try:+ moved = moved_alpha(frames, analysis)+ cycle = local_cycle.detect(D, trajectory, min_len=lo, max_len=hi_long,+ max_fraction=gait_fallback.LONG_CYCLE_FRACTION,+ signals=leg_signals(frames), wrap_pop=wrap_pop_on(moved),+ held_edge=HeldEdge(moved), length_cap=window.max_len, pop_gate=cells.gate, turn=turn,+ **detect)+ except ValueError as second:+ failed = ValueError(f"{second} (also with the gait fallback: window [{lo}, {hi_long}], "+ f"scale drift {drift['drift']:+.1%}{', undone' if fallback['scale_undone'] else ''})")+ # The windows the wider search measured and refused go into the report's `cycle`.+ if hasattr(second, "diagnostics"):+ failed.diagnostics = second.diagnostics # type: ignore[attr-defined]+ failed.__cause__ = first+ refused, cycle = failed, None+ if steps is not None:+ # A count given is the word on the search's cut; the crossings are not asked.+ if refused is not None:+ raise refused+ cycle = _counted(cycle, steps, window=window, D=D, trajectory=trajectory, frames=frames, moved=moved,+ detect=detect, cells=cells, turn=turn)+ else:+ cycle = _by_steps(cycle, refused, frames=frames, analysis=analysis, D=D, trajectory=trajectory,- window=window, searched=searched, detect=detect, seam_max=seam_max, cells=cells, turn=turn)++ window=window, searched=searched, detect=detect, seam_max=seam_max, cells=cells, view=view,++ facing=facing, turn=turn)+ # A cut one step long that nothing counted: the clip itself is asked for two (`_two_lengths`).+ cycle = _two_lengths(cycle, prof=prof, fps=fps, state=state, window=window, D=D, trajectory=trajectory, frames=frames,+ files=files, moved=moved, detect=detect, cells=cells, seam_max=seam_max, turn=turn)++ # Whichever way it was chosen, the cut that will play is held to one word.++ cycle = _witnessed(cycle, frames=frames, view=view)+ return cycle, files, analysis, undone++def _from_lead_in(record: Any, lead: int) -> Any:"""A search's record (a cut, or the windows a refusal measured) in the clip's own frame numbers: thesearch read the clip after its first `lead` frames, so every `start` and `context_pair_range` it wrote@@@ -1990,7 -2290,12 +2397,13 @@@ def _cut_loopwrap_blend: str = "auto",unfixed: str = "warn",seam_pop_max: float | None = repair_mod.SEAM_POP_REFERENCE,+ view: str | None = None,+ body_turn: str = "warn",+ fill_held: str = "auto",+ out_fps: float | None = None,+ air_retime: str | None = None,+ meters_per_px: float | None = None,+ contacts: list[str] | None = None,) -> dict[str, Any]:state = state.strip().lower() if state else stateif state == effect.STATE:@@@ -2026,10 -2332,29 +2440,31 @@@raise SystemExit(f"video-loop: unknown --unfixed {unfixed!r}; expected one of {', '.join(UNFIXED_MODES)}")if facing not in FACINGS:raise SystemExit(f"video-loop: unknown --facing {facing!r}; expected one of {', '.join(FACINGS)}")+ if view is not None and view not in handed_mod.VIEWS:+ raise SystemExit(f"video-loop: unknown --view {view!r}; expected one of {', '.join(handed_mod.VIEWS)}")if seam_pop_max is not None and not (math.isfinite(seam_pop_max) and seam_pop_max > 0):raise SystemExit(f"video-loop: --seam-pop-max {seam_pop_max}: a bound over 0, or off")+ if body_turn not in body_turn_mod.MODES:+ raise SystemExit(f"video-loop: unknown --body-turn {body_turn!r}; expected one of {', '.join(body_turn_mod.MODES)}")+ if fill_held not in held_fill_mod.MODES:+ raise SystemExit(f"video-loop: unknown --fill-held {fill_held!r}; expected one of {', '.join(held_fill_mod.MODES)}")+ if out_fps is not None:+ if not (math.isfinite(out_fps) and out_fps > fps):+ raise SystemExit(f"video-loop: --out-fps {out_fps:g} is not above the clip's {fps:g} fps: a cut is given at a higher "+ "rate than it was filmed (its frames between made), a lower one is its preview's (--gif-fps)")+ if cycle_mode == "lifetime":+ raise SystemExit("video-loop: --out-fps: an effect's lifetime plays as filmed")+ asked_air = None+ if air_retime is not None:+ try:+ asked_air = root_motion_mod.parse_retime(air_retime)+ except ValueError as exc:+ raise SystemExit(f"video-loop: {exc}") from None+ if meters_per_px is None and {"gravity", "speed"} & set(asked_air):+ raise SystemExit("video-loop: --air-retime gravity= and speed= are metres: give --meters-per-px, the metres a "+ "pixel of the clip as filmed holds (the standing height in metres over the strip's body_src_h)")+ if meters_per_px is not None and not (math.isfinite(meters_per_px) and meters_per_px > 0):+ raise SystemExit(f"video-loop: --meters-per-px {meters_per_px:g}: a number over 0")if anchor is None:# gaits drift a few pixels over a cycle and the wrap shows it; in-place states do notanchor = "body" if profile_for(state).gait else "none"@@@ -2107,63 -2443,92 +2553,93 @@@files = gait_fallback.write_frames(held, [f.name for f in files], scratch.new())else:report_base["size_hold"] = {"applied": False, "why": "--size-hold off"}- D, trajectory, analysis = auto_motion.analyse(source_frames, fps=fps)- report_base["automatic_motion_analysis"] = analysis- detect = dict(gait_floor=round(prof.min_seconds*fps), periodicity_min=PERIODICITY_MIN,- double_tolerance=GAIT_DOUBLE_TOL, double_search=GAIT_DOUBLE_SEARCH)- searched: dict[str, Any] = {"min_len": lo, "max_len": hi}- refused: ValueError | None = None- # The cuts the search chooses among, read before one is cut as the seam gate and the seam pop gate read the loop.- cells = CutOnCells(source_frames, pop_max=seam_pop_max)try:- moved = moved_alpha(source_frames, analysis)- cycle = local_cycle.detect(D, trajectory, min_len=lo, max_len=hi, signals=leg_signals(source_frames),- wrap_pop=wrap_pop_on(moved), held_edge=HeldEdge(moved), length_cap=window.max_len,- pop_gate=cells.gate, **detect)- except ValueError as first:- # A front or back gait that walked toward the camera, or a slow one: one more- # search, recorded (`gait_fallback`), and only after the first found nothing.- drift = gait_fallback.cycle_drift(source_frames, min_lag=lo, max_lag=hi)- fallback = {"reason": str(first), "scale_drift": {k: drift[k] for k in ("height_first_px", "height_last_px", "drift", "method")},- "scale_drift_min": gait_fallback.SCALE_DRIFT_MIN, "scale_undone": False}- if abs(drift["drift"]) >= gait_fallback.SCALE_DRIFT_MIN:- fallback["padding_ltrb"] = list(gait_fallback.undo_padding(source_frames, drift))- source_frames = gait_fallback.undo_scale(source_frames, drift, pad=tuple(fallback["padding_ltrb"]))- files = gait_fallback.write_frames(source_frames, [f.name for f in files], scratch.new())- D, trajectory, analysis = auto_motion.analyse(source_frames, fps=fps)- report_base["automatic_motion_analysis"] = analysis- fallback["scale_undone"] = True- cells = CutOnCells(source_frames, pop_max=seam_pop_max)- # An explicit --max-len is the caller's ceiling and stays one.- hi_long = window.past(gait_fallback.long_window(lo, len(files), fps))- fallback["window"] = [lo, hi_long]- report_base["gait_fallback"] = fallback- searched = {"min_len": lo, "max_len": hi_long, "max_fraction": gait_fallback.LONG_CYCLE_FRACTION}+ D, trajectory, analysis = auto_motion.analyse(source_frames, fps=fps)+ except auto_motion.RegionsUnfound as unfound:+ # No two regions track through the clip: the frames it opens on, fewer than the shortest cut, are left+ # out as a lead-in is and the clip after them is searched (`auto_motion.analyse_after_opening`), said+ # in the report's `untracked_opening` and, once a cut is found, a warning line; where no such opening+ # leaves it tracked, the clip is refused as before, in the same words and what was tried.+ opening, (D, trajectory, analysis) = auto_motion.analyse_after_opening(+ source_frames, fps=fps, shorter_than=lo, unfound=unfound)+ report_base["untracked_opening"] = {"frames": opening, "first": skip, "shorter_than": lo,+ "refused": str(unfound)}+ skip += opening+ source_frames, files = source_frames[opening:], files[opening:]+ window = CutWindow.of(prof, n - skip, fps, min_len, max_len)+ lo, hi = window.lo, window.hi+ report_base["window"] = [lo, hi]+ report_base["lead_in"]["search_from"] = skip+ report_base["automatic_motion_analysis"] = analysis+ search = partial(_motion_auto, source_frames, files, D, trajectory, analysis, fps=fps, window=window, prof=prof,- state=state, steps=steps, seam_max=seam_max, seam_pop_max=seam_pop_max, scratch=scratch)++ state=state, steps=steps, seam_max=seam_max, seam_pop_max=seam_pop_max, scratch=scratch, view=view,++ facing=facing)+ # The body's turn (sprite_gen/video/body_turn.py), read on the clip as keyed against its first frame, the still,+ # lead-in or not: a cut that holds a frame of one is not taken while another holds a cycle. Where none does,+ # --body-turn warn takes the cut the search takes with the turn in, and says so; refuse refuses the clip in a line+ # of its own. A clip that turns nowhere is searched once, as before; one whose walk reads square against a+ # still that shows a side is not read either, and a warning line says so.+ turning = {**body_turn_mod.read(gait_frames), "mode": body_turn}+ report_base["body_turn"] = turning+ turn = body_turn_mod.Turn(turning, skip) if turning["turns"] else None+ if turn is None:+ turning["verdict"] = "none" if turning["read"] else "not-read"+ if seen := body_turn_mod.square(turning):+ print(f"video-loop: warning: {seen}", file=sys.stderr)+ said: dict[str, Any] = {}+ found = avoided = None+ if turn is not None:try:- moved = moved_alpha(source_frames, analysis)- cycle = local_cycle.detect(D, trajectory, min_len=lo, max_len=hi_long,- max_fraction=gait_fallback.LONG_CYCLE_FRACTION,- signals=leg_signals(source_frames), wrap_pop=wrap_pop_on(moved),- held_edge=HeldEdge(moved), length_cap=window.max_len, pop_gate=cells.gate, **detect)- except ValueError as second:- failed = ValueError(f"{second} (also with the gait fallback: window [{lo}, {hi_long}], "- f"scale drift {drift['drift']:+.1%}{', undone' if fallback['scale_undone'] else ''})")- # The windows the wider search measured and refused go into the report's `cycle`.- if hasattr(second, "diagnostics"):- failed.diagnostics = second.diagnostics # type: ignore[attr-defined]- failed.__cause__ = first- refused, cycle = failed, None- if steps is not None:- # A count given is the word on the search's cut; the crossings are not asked.- if refused is not None:- raise refused- cycle = _counted(cycle, steps, window=window, D=D, trajectory=trajectory, frames=source_frames, moved=moved,- detect=detect, cells=cells)- else:- cycle = _by_steps(cycle, refused, frames=source_frames, analysis=analysis, D=D, trajectory=trajectory,- window=window, searched=searched, detect=detect, seam_max=seam_max, cells=cells,- view=view, facing=facing)- cycle = _witnessed(cycle, frames=source_frames, view=view)+ found = search(said=said, turn=turn)+ except ValueError as exc:+ avoided = exc+ turning["refused"] = turn.refused+ if found is None and body_turn == "refuse":+ report_base.update(said)+ turning["verdict"] = "refused"+ failed = ValueError(body_turn_mod.refusal(turning))+ if hasattr(avoided, "diagnostics"):+ failed.diagnostics = avoided.diagnostics # type: ignore[attr-defined]+ raise failed from avoided+ if found is None:+ said = {}+ try:+ found = search(said=said)+ except ValueError:+ report_base.update(said)+ if turn is not None:+ turning.update(verdict="unfound", avoiding=str(avoided))+ print(f"video-loop: warning: {body_turn_mod.unfound(turning)}", file=sys.stderr)+ raise+ report_base.update(said)+ cycle, files, analysis, undone = found+ if undone is not None:+ clip_scales["gait_fallback"] = [1.0] * skip + undone+ if turn is not None:+ cut = (cycle["start"] + skip, cycle["length"])+ holds = turn.held(cycle["start"], cycle["length"])+ turning["cut"] = {"frames": [cut[0], cut[0] + cut[1] - 1], "holds": holds}+ if avoided is not None:+ turning["avoiding"] = str(avoided)+ if not holds:+ turning["verdict"] = "avoided" if avoided is None and turn.refused else "clear"+ elif body_turn == "refuse":+ turning["verdict"] = "refused"+ raise ValueError(body_turn_mod.refusal(turning, cut=cut, held=holds))+ else:+ turning["verdict"] = "kept"+ print(f"video-loop: warning: {body_turn_mod.kept(turning, cut=cut, held=holds)}", file=sys.stderr)+ if opened := report_base.get("untracked_opening"):+ # Not the refusal's words: a caller that reads the stderr for them reads a refusal, and this cut is found.+ left = (f"frame {opened['first']}" if opened["frames"] == 1+ else f"frames {opened['first']}-{opened['first'] + opened['frames'] - 1}")+ print(f"video-loop: warning: the automatic motion anchor found its two regions from frame {skip} on, not from "+ f"the clip's first frames: {left} left out of the search as a lead-in is (untracked_opening)",+ file=sys.stderr)+ elif cycle_mode == "once" and start is not None:+ # The frames the caller plays once (a move cut out of a run, which settles on no pose): no terminal pose read.+ cycle = nonloop.select_cut(D, masses, fps=fps, ending=partial(nonloop.given_ending, start=start, length=length))+ nonloop.validate_body([Image.open(f).convert("RGBA") for f in files[start:start + length]])elif cycle_mode == "once":source_frames = [Image.open(f).convert("RGBA") for f in files]cycle = nonloop.select_cut(D, masses, fps=fps, ending=partial(@@@ -2820,15 -3300,44 +3415,53 @@@ def add_arguments(parser: argparse.Argu"not bounded by half the clip but held inside --min-len/--max-len: a window that leaves none of it ""fails), recorded `cycle.steps`; 2: the cut is kept, recorded. Either way the strip ""metadata says `steps: 2`, which `video-cycle-align` reads")+ parser.add_argument("--view", choices=handed_mod.VIEWS, default=None,+ help="walk/run: the view the clip is filmed from. The step count asks whether the feet, which need not "+ "meet on the screen at every pass, meet once a cycle (`cycle.step_count.cycles`): where a pass "+ "can hide, as without it, and from the front, the back or a diagonal also where passes are brief. "+ "Wherever it is asked, the crossings mark cycles only where the body's top line rises and falls "+ "twice an interval; the view's foot cue only refuses, where it says the other leg leads one "+ "interval on. With no witness they stay on steps, as from the side, with a warning "+ "(docs/loop-repair.md section 3, \"The step count\"). Default: not given, asked only where a pass "+ "can hide")+ parser.add_argument("--body-turn", choices=body_turn_mod.MODES, default="warn",+ help="--anchor motion-auto: the body's turn in the walk — each frame's torso read between the clip's first "+ "frame and that frame mirrored (`body_turn`, docs/video-pipeline.md section 4, \"The body turn\"; a "+ f"square still, a front or back view, is not read): a turn is the torso under {body_turn_mod.TURN_SIDE_MAX:g} "+ f"for {body_turn_mod.TURN_RUN_MIN} frames or more, and no cut that holds a frame of one is taken while "+ "another holds a cycle. Where none does: warn (default), the cut the search takes with the turn in, "+ "and a warning line; refuse, the clip is refused in a line of its own (`video-loop: the body turns "+ "in the walk`), to be filmed again at the still's angle")+ parser.add_argument("--fill-held", choices=held_fill_mod.MODES, default="auto",+ help="neighbour cells of the cut that show the same picture (a frame shown twice or three times): auto "+ "(default) makes each run of them again with RIFE's frames between the pose before and the pose "+ f"after, the cut's length, beat, first and last cells and wrap kept, and a run longer than "+ f"{held_fill_mod.HOLD_MAX} cells, the opening or closing pose of a cut played once, a loop's last "+ "cells and a cut drawn on twos or threes kept as filmed; off cuts them as filmed. Either way the report and the strip metadata record "+ "the held runs and the poses over the cells (`held_fill`, docs/loop-repair.md section 7); with no "+ "RIFE installed the cells are shown as filmed, with a warning")+ parser.add_argument("--out-fps", type=float, default=None,+ help="give the cut at this rate, above the clip's (--fps): every cell at its own time, made by RIFE "+ "between the frames beside it — never a frame shown again. A loop keeps its cycle's seconds, a "+ "cut played once runs from its first frame to its last; the strip metadata says `out_fps`. With no "+ "RIFE installed the cut is delivered at its own rate, with a warning (docs/loop-repair.md section 7)")+ parser.add_argument("--air-retime", default=None, metavar="gravity=G,air=T,speed=V",+ help="a cut played once: give each air with its take-off and landing in the cut (the frames between the "+ "last contact and the next) a length of T seconds, a gravity of G m/s² and a speed along of V m/s, "+ "any of them, each the clip's own where not given: its cells made again at the cut's rate, each "+ "showing the clip's pose at the same share of its air, made by RIFE between the frames where it "+ "falls between them, and moved onto the parabola; the take-off, the landing and the contacts as "+ "filmed, the landing moved along. G and V need --meters-per-px. The strip metadata says "+ "`air_retime`; with no RIFE installed the air is cut as filmed, with a warning "+ "(docs/video-pipeline.md, \"Root motion\")")+ parser.add_argument("--meters-per-px", type=float, default=None,+ help="the metres a pixel of the clip as filmed holds (the standing height in metres over the strip's "+ "`body_src_h`): the root motion in metres too (`root_m`, each apex's `apex_m`), and --air-retime's "+ "gravity and speed")+ parser.add_argument("--contact", action="append", default=None, metavar="NAME=SPANS",+ help="a contact the floor does not show (a hand on a wall the clip does not draw), over zero-based frames "+ "of the clip, as inspect-motion's spans: hand=12:20 (repeatable). The ground is read off the floor; "+ "the air is the frames that touch neither")parser.add_argument("--name", default="loop", help="basename for strip/gif/webp outputs")parser.add_argument("--report", type=Path)@@@ -2850,7 -3359,10 +3483,11 @@@ def run(**kwargs: object) -> intoverlap_wrap=str(kwargs.get("overlap_wrap") or "on"), wrap_blend=str(kwargs.get("wrap_blend") or "auto"),unfixed=str(kwargs.get("unfixed") or "warn"),seam_pop_max=kwargs.get("seam_pop_max", repair_mod.SEAM_POP_REFERENCE), # type: ignore[arg-type]+ view=kwargs.get("view"), # type: ignore[arg-type]+ body_turn=str(kwargs.get("body_turn") or "warn"),+ fill_held=str(kwargs.get("fill_held") or "auto"), out_fps=kwargs.get("out_fps"), # type: ignore[arg-type]+ air_retime=kwargs.get("air_retime"), meters_per_px=kwargs.get("meters_per_px"), # type: ignore[arg-type]+ contacts=kwargs.get("contact"), # type: ignore[arg-type])summary = {k: payload[k] for k in ("state", "frames_total", "window", "cycle_seconds", "n_out", "delay_ms", "resampled_seam_ratio", "specks_dropped", "report")}summary["cycle"] = {k: payload["cycle"].get(k) for k in ("kind", "start", "length", "period_global", "ratio", "review_recommended", "half_period_guard", "fundamental")}@@@ -2880,9 -3396,8 +3521,11 @@@if "step_count" in payload["cycle"]:counted = payload["cycle"]["step_count"]summary["cycle"]["step_count"] = {k: counted[k] for k in ("mode", "readable", "chosen_by", "cut", "why") if k in counted}+ if "cut_witness" in payload["cycle"]:+ summary["cycle"]["cut_witness"] = {k: payload["cycle"]["cut_witness"][k] for k in ("cut", "says", "by", "held", "mark")+ if k in payload["cycle"]["cut_witness"]}+ if payload.get("body_turn", {}).get("turns"):+ summary["body_turn"] = {k: payload["body_turn"][k] for k in ("verdict", "turns", "cut") if k in payload["body_turn"]}if payload.get("ghost_screen", {}).get("ghosts") or payload.get("ghost_screen", {}).get("reads") is False:summary["ghost_screen"] = payload["ghost_screen"]for key in ("ghost_given_way", "ghost_kept"):diff --cc tests/video/test_one_step_cut.pyindex 954af67,45e4d31..2cd6f99--- a/tests/video/test_one_step_cut.py+++ b/tests/video/test_one_step_cut.py@@@ -25,8 -25,8 +25,8 @@@ from pathlib import Patimport pytestfrom PIL import Image, ImageDraw- from conftest import feet_unseen+ from conftest import feet_unseen, rife_located-from sprite_gen.video import align, batch, loop, period+from sprite_gen.video import align, batch, local_cycle, loop, periodfrom tests.video.test_video_pipeline import HAS_IMG2WEBP# Every test here cuts a loop, and a loop is written with img2webp: without it they skip, as the