Skip to content

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

fix(video-loop): a walk's every step is gated between its drawings, a frame left off the flow is named, a fixed cut is counted, and the seam's refusal says why where its warnings know

Soohong Kime147fa0406f6
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e6346c5..b836f16 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,16 @@
All notable public changes to `sprite-gen` are recorded here. Versions track the `version:` field in `SKILL.md` and `pyproject.toml`.
+## Unreleased - The loop check inspects steps between drawings, checks fixed cut step counts, warns on unfixed repair frames, and explains seam failures
+
+**Upgrading from 2.45.3: Every cut 2.45.3 passed that neither new reading refuses gives the same loop files byte for byte.** Strip, sidecar, frames, GIF and WebP bytes match with the same stderr save new warning lines, measured on a batch of walk clips cut with caller arguments (the automatic walk cut, cuts by hand, forced cuts). The report gains `step_gate` on walk or run loops and `cycle.step_count` on fixed walk or run cuts, `producer` names the new version, and the CLI summary gains `step_gate` and `jump_repair.unfixed`. Refusals outside the new readings keep their lines word for word, except the seam line's end where warning lines name a part on a beat of its own. Callers matching failure lines by first words need rules for `video-loop: loop step ratio` (the clip jumps inside: film again), `video-loop: loop step count refutes the fixed cut` (cutting again by hand failed), and `video-loop: loop frames left off the flow` only if passing `--unfixed refuse`; failure reasons can also be read from `seam_refusal`. Any `--seam-max` past 2.5 lifts the step gate and count refusal, so forced delivery keeps passing `--seam-max 1000`. Reading feet on a fixed walk or run cut costs less than the distance matrix read by every cut. As a known limit, the seam gate and the body anchor's rule from 2.45.3 still read frames, not drawings, so a walk held on twos or threes whose cut wraps between two drawings is still refused where it closes between its drawings.
+
+- **Behavior change: Walk and run loops that play round now pass a step gate that inspects spacing between drawings.** After the seam gate, cells are read between drawings rather than frame by frame, so held animation on twos or threes does not appear uneven when drawings span multiple frames. The largest step from one drawing to the next, the wrap included, over the mean of the others, must be at most `STEP_RATIO_MAX` (2.5), else the loop fails with `video-loop: loop step ratio <ratio> exceeds 2.5 (<kind> length <L> frames from <start>, into frame <frame>, read between its <n> drawings); the loop jumps inside — regenerate the clip`, with jump repair reason `: frame <frame> lies off the walk's flow, and the jump repair's frame there was refused (<faults>), so it plays as filmed` before ` — regenerate the clip` where present. The report records `step_gate` on every walk or run loop (`drawings`, `hold`, `mean_step`, `largest_ratio`, `largest_from`, `largest_into`, `wrap_ratio`, `max`, `lifted`, `kept`; `skipped` under three drawings). The bound is the larger of 2.5 and `--seam-max`, so any `--seam-max` past 2.5 lifts it; a scan or forced delivery with `--seam-max 1000` keeps a loop whose largest step is over 2.5 with warning `video-loop: warning: the loop's largest step between drawings is <ratio>x their mean (into frame <frame>), over 2.5: it jumps inside — kept, as --seam-max <seam-max> lifts the step gate` and `step_gate.kept`.
+- **Behavior change: Fixed cuts fail when foot crossings count an odd number of steps.** Manual walk or run cuts using `--cycle fixed` now read the clip's foot crossings and evaluate the cut, matching `--anchor motion-auto`. The report records `cycle.step_count` with `chosen_by: caller`. A cut counted an odd number of steps fails with `video-loop: loop step count refutes the fixed cut <start>/<L> — the clip's crossings count one step, each seen where a walk loops on two, and an odd count swaps the legs at the wrap; cut it again two steps long (about <2 steps> frames)`. An even count is not refused by the count check, and the exemption `--anchor motion-auto` makes for a pass hidden among feet held together (the clip a cut on the same picture) applies identically through shared `local_cycle.same_picture_count`. The strip is unchanged, and there is no `steps` field. Any `--seam-max` past 2.5 lifts this refusal; a scan or forced delivery with `--seam-max 1000` keeps an odd step cut with warning `video-loop: warning: the clip's crossings count the fixed cut <start>/<L> one step, each seen: a walk loops on two steps, and an odd count swaps the legs at the wrap — kept, as --seam-max <seam-max> lifts the step gate` and records `cycle.step_count.lifted`.
+- **New: Refused jump repair drawings are listed in `jump_repair.unfixed` and can fail the command.** When jump repair refuses a frame group, its frames remain as filmed; where the playing loop still reads a drawing of it 3.0 or more of its window's usual steps off the flow, that drawing is recorded in `jump_repair.unfixed` alongside `refused` (the faults). Every `unfixed` drawing prints warning line `video-loop: warning: frame <frame> of the loop lies <off>x its window's usual step off the walk's flow after the jump repair: the group that would bring it back was refused (<faults>), so it plays as filmed — a jump played as filmed; --unfixed refuse refuses such a loop (docs/loop-repair.md section 2)`. A new flag `--unfixed warn|refuse` (default `warn`) controls handling: `refuse` fails such a loop with an error line starting `video-loop: loop frames left off the flow — `. This failure is not lifted by `--seam-max`.
+- **Fix: The seam gate failure line explains the cause where warning lines know it.** The first words of the failure line stay the same up to `the cycle does not close — `; where warning lines name a part on a beat of its own (an `--anchor motion-auto` cut two steps long by the clip's crossings whose wrap the gate refuses), the rest says so and names what became of the overlapped wrap, for example `video-loop: loop seam ratio <ratio> exceeds 2.0 (periodic length <L> frames from <start>); the cycle does not close — the cut covers two steps by the clip's crossings, and a part on a beat of its own (a tail, a held prop) closes on no cut of two steps: the overlapped wrap was not made (turned off (--overlap-wrap off)) — regenerate with that part moving on the walk's beat`. Elsewhere the line is word for word as before. Every refusal by the wrap, steps, or count records `seam_refusal` in the report (`reading`: `wrap`, `steps` or `count`). For `wrap`, it records `ratio`, `max`, `reason` (`own-beat` or null), and `overlap_wrap`. For `steps`, it records `ratio`, `max`, `into`, `reason` (`repair-refused`, `unfixed` or null), plus `frames` and `refused` where a reason was found. For `count`, it records `cut`, `verdict`, `k`, `why`, and `two_steps`.
+- **Tests** — `tests/video/test_loop_silent_pass.py`: a side walk in place with a middle frame moved 10 px fails the step gate while its wrap passes, recording `step_gate` and `seam_refusal`, kept by `--seam-max 1000` with a warning line; an eight drawing walk on threes passes when frame by frame steps exceed 2.5; melted ponytail outlines and smeared stand in RIFE frames stay `unfixed` with faults, cite the refused frame in step gate lines, and fail under `--unfixed refuse`; CLI tests confirm `--unfixed` defaults to `warn` and rejects other words; hand cuts fail on one step, pass at two, keep one step cuts under `--seam-max 1000`, and exempt hidden far feet on twos; a walker whose tail swings on its own beat fails seam checks with the reason in its line and `seam_refusal`; and a sideways wrap shift keeps its line word for word with `seam_refusal.reason` null.
+
## v2.45.3 - The seam check reads the frames that play when the body anchor spreads a sideways slide; such a cut passes again, as it did in 2.44.0
**Upgrading from 2.45.2: Every cut 2.45.2 passed, and every `--anchor motion-auto` run, gives the same bytes as 2.45.2.** Only `--anchor body` cuts that 2.45.2 refused because of the walk sliding sideways before the anchor can now pass, read on the frames that play. Refused cuts print the same error line as before, the report's `producer` field names the new version, and there are no restoration schema changes.
diff --git a/docs/loop-repair.md b/docs/loop-repair.md
index 5b903d2..740c0fc 100644
--- a/docs/loop-repair.md
+++ b/docs/loop-repair.md
@@ -287,6 +287,8 @@ made for the source projection and for restoration, which never restores it ([th
guard](loop-comparison.md#the-ghost-guard)). `--repair off` gives nothing way: the cut's ghosts are
delivered as filmed, named (section 4).
+Under `--repair auto` (the default) or `on`, jump repair takes out a group of one or two drawings that lie 3.0 or more usual steps off the line between neighbours (`repair.FLOW_LIMIT`) and has RIFE make them again. A group whose made frames have a fault is refused and keeps its frames as filmed in `refused`. When the loop as it plays still reads a drawing of a refused group at or over the limit, that drawing is in `jump_repair.unfixed` too: `frames`, `off`, `turn`, `into`, `out`, `window` (read on the playing loop) and `refused`. Every drawing in `unfixed` prints the warning line `video-loop: warning: frame <frame> of the loop lies <off>x its window's usual step off the walk's flow after the jump repair: the group that would bring it back was refused (<faults>), so it plays as filmed — a jump played as filmed; --unfixed refuse refuses such a loop (docs/loop-repair.md section 2)`. Flag `--unfixed warn|refuse` (default `warn`) can refuse such a loop with `video-loop: loop frames left off the flow — ` followed by those words, the cut, and `; the motion does not play smoothly — regenerate the clip`. The `--unfixed` flag is caller choice and is not lifted by `--seam-max`.
+
The flow is read again after each group, on the union box of the loop as filmed; a refused group is
never tried again in that run, and nothing is made from or beside it. The circular last/first
adjacency rule and the call budget hold across the wrap. The shared `interpolation_quality` policy
@@ -1031,6 +1033,16 @@ nearer than a frame apart, is cut as the search cuts it — one step long, as be
pixels nor the crossings tell its step from its cycle there, and only someone who counts the steps (`--steps`)
settles it. Four-legged gaits are read as one foot band (`legs.strike_signals`), as before.
+### The step gate: every step between drawings, and a fixed cut's count
+
+On every walk or run loop that plays round (not a single play cut), after the seam gate passes, the strip cells are read between their drawings: a loop drawn on twos or threes shows each drawing for two or three frames (`repair.flow_drawings` finds them), so read frame by frame it steps nothing and then two or three steps at each drawing, making its largest step two or three times its mean even when playing evenly. Each drawing first cell is read on analysis features the seam gate reads (`loop._small_features`), taking the step from each drawing to the next and from the last drawing into the first across the wrap. The largest of these steps, wrap included, over the mean of the others must be at most `STEP_RATIO_MAX` (2.5) (`loop.drawing_steps`). Otherwise the loop fails with `video-loop: loop step ratio <ratio> exceeds 2.5 (<kind> length <L> frames from <start>, into frame <frame>, read between its <n> drawings); the loop jumps inside — regenerate the clip`. Where jump repair says why the step jumps, the line says it before ` — regenerate the clip`: `: frame <frame> lies off the walk's flow, and the jump repair's frame there was refused (<faults>), so it plays as filmed`, or `: frame <frame> lies off the walk's flow, and no group of up to 2 drawings brings it back`. The report records `step_gate` on every walk or run loop, passed or failed: `read` (`drawings`), `drawings`, `hold`, `mean_step`, `largest_ratio`, `largest_from` and `largest_into` (the cut frames the largest step goes from and into, each the first frame of its drawing), `wrap_ratio`, `max` (the bound used), `lifted`, and `kept` where a lifted gate kept a loop over 2.5; a loop of fewer than three drawings records `skipped` instead.
+
+`--cycle fixed --start S --length L` of a walk or run now reads clip foot crossings (`crossings.read`) and judges the cut (`Reading.judge`), as `--anchor motion-auto` already does for the cut it takes. The report records this as `cycle.step_count` (the reading record, `chosen_by: caller`, and `cut` with `verdict`, `code`, `k`, `phase`, `ring`). A walk loops on two steps; a cut whose crossings count an odd number of steps (one, three) swaps legs at the wrap however close frames look, failing with `video-loop: loop step count refutes the fixed cut <start>/<L> — the clip's crossings count one step, each seen where a walk loops on two, and an odd count swaps the legs at the wrap; cut it again two steps long (about <2 steps> frames)`. An even count of four steps is not refused. The exemption from `--anchor motion-auto` applies (`local_cycle.same_picture_count`, shared by both now): where feet are seen together over half a step at a pass (`crossings.HIDE_SHARE`) and the clip one cut on is the same picture (at most `local_cycle.SAME_PICTURE_MAX`, 1.0 playback steps along the cut), the count missed a crossing; verdict reads `uncertain`, code `same-picture`, recorded with `same_picture`, and the cut is not refused. A fixed cut gets no `steps` field and leaves its strip unchanged.
+
+The step gate stands where the seam gate does. Its bound is the larger of 2.5 and `--seam-max`. Setting `--seam-max` past 2.5 lifts it with the seam: every step bound is then `--seam-max`, a loop whose largest step is over 2.5 is kept with the warning line `video-loop: warning: the loop's largest step between drawings is <ratio>x their mean (into frame <frame>), over 2.5: it jumps inside — kept, as --seam-max <seam-max> lifts the step gate` (and `step_gate.kept`, `step_gate.lifted: true`), and a fixed cut counted an odd number of steps is kept with `video-loop: warning: the clip's crossings count the fixed cut <start>/<L> one step, each seen: a walk loops on two steps, and an odd count swaps the legs at the wrap — kept, as --seam-max <seam-max> lifts the step gate` (and `cycle.step_count.lifted`, which records `seam_max`). A forced delivery with `--seam-max 1000` therefore passes as before, with these lines.
+
+The seam gate failure line keeps its first words up to `the cycle does not close — `. Where warning lines name a part on a beat of its own (an `--anchor motion-auto` cut two steps long by clip crossings whose wrap the gate refuses while asking for an overlapped wrap, or a step count warning that no two step cut joins the walk within its phase), the rest of the line says so instead of `regenerate with a complete return to the starting pose`, for example: `video-loop: loop seam ratio <ratio> exceeds 2.0 (periodic length <L> frames from <start>); the cycle does not close — the cut covers two steps by the clip's crossings, and a part on a beat of its own (a tail, a held prop) closes on no cut of two steps: the overlapped wrap was not made (turned off (--overlap-wrap off)) — regenerate with that part moving on the walk's beat`. The middle part names what became of the overlapped wrap: not made (and why, as `wrap_overlap.skipped` says), RIFE not installed, refused (each run reasons, as warning lines give them), or made and still not closing. Elsewhere the line is as before. Every refusal by one of these three readings records `seam_refusal` in the report: `{"reading": "wrap", "ratio", "max", "reason": "own-beat" or null, "overlap_wrap": "made" | "skipped" | "rife not installed" | "refused" | null}`, `{"reading": "steps", "ratio", "max", "into", "reason": "repair-refused" | "unfixed" | null, "frames", "refused"}` (the last two where a reason was found), and `{"reading": "count", "cut", "verdict", "k", "why", "two_steps"}`.
+
### The step screen — a slow walk cut one step long
The walk window is 0.5 to 1.6 s, and at most half the clip: a cycle has to be seen repeating. A
diff --git a/docs/loop-review.md b/docs/loop-review.md
index bb4d72d..6c3f18d 100644
--- a/docs/loop-review.md
+++ b/docs/loop-review.md
@@ -66,6 +66,8 @@ does not close. Repaired frames check the wrap alone, a walk whose ordinary step
uneven can read a step over the limit on the cells that play and is refused as before,
and `--anchor feet` reads source frames.
+After this rule, the step gate reads cells between drawings for every walk or run loop that plays round. A known limit on walks held on twos or threes was measured on synthetic side walks sliding 0.1 px a frame, cut one stride by hand with `--anchor body` without repair from six starts each. The seam gate reads frames, not drawings: a cut whose wrap falls between drawings reads wrap two or three times the mean step on filmed frames and fails, though between drawings it closes. The body anchor rule also reads frame by frame, refusing all cuts on those held walks even where the ramp closed the wrap (cell wrap 0.0 to 1.21), because largest frame steps are 2.48 to 4.17 while cells between drawings step at most 1.39 to 1.70. Those cuts stay refused; reading seam gate and anchor rules between drawings is left to later work. Unheld walks of the same probe were unaffected.
+
## Material for a vision-capable reviewer
Provide the original clip, the generated loop played at source speed for at least three
diff --git a/docs/video-pipeline.md b/docs/video-pipeline.md
index 5fede81..d70b948 100644
--- a/docs/video-pipeline.md
+++ b/docs/video-pipeline.md
@@ -924,9 +924,7 @@ the last bit on every machine. With np.polyfit, whose last bit differs between L
that stand on the frame's bottom edge read a hair past it or short of it, and whether the frames
got 2 px of room below — and so the frames the cut is searched on — turned on that bit.
-Gates, all fail-loud: no period (profile flat, below the recorded `periodicity_min`), loop seam ratio
-above `--seam-max` (2.0), GIF/WebP re-opened and checked (frame count, `loop=0`,
-transparent corners, no RGB under alpha 0 in the WebP).
+Gates, all fail loud: no period (profile flat, below the recorded `periodicity_min`), loop seam ratio above `--seam-max` (2.0), GIF/WebP reopened and checked (frame count, `loop=0`, transparent corners, no RGB under alpha 0 in the WebP). On every walk or run loop that plays round, the step gate reads cells between drawings and requires the largest step over the mean of the others to be at most `STEP_RATIO_MAX` (2.5). A fixed cut of a walk or run reads clip foot crossings to judge the cut, refusing an odd step count that would swap legs at the wrap. Both checks are lifted by `--seam-max` past 2.5; see `docs/loop-repair.md` section 3, "The step gate".
A walk or run loop then has its jump frames repaired before the strip is built: one or two
drawings in a row that leave the loop's flow — 3× their region's usual step off the line between
diff --git a/sprite_gen/video/local_cycle.py b/sprite_gen/video/local_cycle.py
index c2cdb16..aa46070 100644
--- a/sprite_gen/video/local_cycle.py
+++ b/sprite_gen/video/local_cycle.py
@@ -444,6 +444,26 @@ def same_picture(distances, start, length):
return float(distances[js, js+length].mean())/step
+def same_picture_count(reading, distances, judged):
+ """A cut the crossings count an odd number of steps (`judged`, `reading.judge`), asked whether the count missed a
+ crossing: where the feet are seen together over more than HIDE_SHARE of a step at a pass (`reading.overlap`) and the
+ clip a cut on is the same picture (`same_picture`, at most SAME_PICTURE_MAX playback steps along the cut), no legs
+ swapped. Returns (what was read, None where it is not asked; the cut's count, `uncertain` (`same-picture`) where the
+ count missed a crossing, else `judged` itself)."""
+ overlap = reading.overlap
+ if not (judged['verdict'] == 'refuted' and judged['k'][0] % 2 and overlap is not None and overlap > HIDE_SHARE):
+ return None, judged
+ near = same_picture(distances, *judged['cut'])
+ said = {'over_step': None if near is None else round(near, 3), 'max': SAME_PICTURE_MAX, 'overlap': round(overlap, 3),
+ 'hides': HIDE_SHARE}
+ if near is None or near > SAME_PICTURE_MAX:
+ return said, judged
+ return said, {**judged, 'verdict': 'uncertain', 'code': 'same-picture',
+ 'why': f"the crossings count {judged['why']}, but the feet are seen together {overlap:.2f} of a step at a "
+ f"pass (over {HIDE_SHARE:g}: a pass can hide there) and the clip a cut on is the same picture ({near:.2f} "
+ f"playback steps along the cut, at most {SAME_PICTURE_MAX:g}): no legs swapped, a crossing unseen"}
+
+
def _rank(rows, *, flow_limit, seam_max, in_phase):
"""Two-step cuts, best first, and how many of the first passed the gates: in phase (`in_phase`), its top band calm
at the wrap (`_calm`: a thin part the flow hardly sees, a staff, does not jump), its wrap over its step (`ratio`) at
@@ -507,17 +527,11 @@ def by_steps(distances, trajectory, reading, *, found, refused, min_len, max_len
if reading.in_phase(searched):
record.update(chosen_by='search', cut=searched)
return _two_steps(found, record), record
- overlap = reading.overlap
- if searched['verdict'] == 'refuted' and searched['k'][0] % 2 and overlap is not None and overlap > HIDE_SHARE:
- near = same_picture(distances, found['start'], found['length'])
- record['search']['same_picture'] = {'over_step': None if near is None else round(near, 3), 'max': SAME_PICTURE_MAX,
- 'overlap': round(overlap, 3), 'hides': HIDE_SHARE}
- if near is not None and near <= SAME_PICTURE_MAX:
- record.update(chosen_by='search', cut={
- **searched, 'verdict': 'uncertain', 'code': 'same-picture',
- 'why': f"the crossings count {searched['why']}, but the feet are seen together {overlap:.2f} of a step at a "
- f"pass (over {HIDE_SHARE:g}: a pass can hide there) and the clip a cut on is the same picture ({near:.2f} "
- f"playback steps along the cut, at most {SAME_PICTURE_MAX:g}): no legs swapped, a crossing unseen"})
+ 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, record
twos = reading.twos(min_len, max_len)
record['two_cuts'] = len(twos)
diff --git a/sprite_gen/video/loop.py b/sprite_gen/video/loop.py
index 93df3cc..da2ab24 100644
--- a/sprite_gen/video/loop.py
+++ b/sprite_gen/video/loop.py
@@ -64,6 +64,12 @@ STRIP_MAX_CELLS = 64 # upper bound on cells even when they are narrow
STRIP_MAX_WIDTH = 32000 # Chrome refuses images wider than ~32767 px; the cap is on PIXELS — a 650 px cell allows only 49 cells (2026-09-09 wolf idle: 64 cells = 41,664 px, unrenderable)
STRIP_MAX_HEIGHT = 520
SEAM_RATIO_MAX = 2.0 # loop seam / mean adjacent distance inside the cycle
+# A walk's or run's largest step between drawings as it plays, the wrap one of them, over their mean step
+# (`drawing_steps`): past it the loop jumps inside, where the seam ratio, read at the wrap alone, does not look. Read
+# between drawings, not frames: a loop held on twos or threes steps nothing and then two or three steps at every drawing.
+# The step gate stands where the seam gate does: a --seam-max past it lifts it, every step's bound is then --seam-max,
+# and a fixed cut the clip's crossings count an odd number of steps is kept with a warning line (`fixed_count`).
+STEP_RATIO_MAX = 2.5
PERIODICITY_MIN = 0.15 # the period must dip at least 15% below the profile mean (flat profile = no repeat)
# Where the gait fallback writes the frames it scaled back (removed once the strip is built).
FALLBACK_FRAMES_DIR = ".gait-fallback-frames"
@@ -118,6 +124,9 @@ REPAIR_MODES = ("auto", "on", "off")
# 960 px clip takes minutes and the loop's caller would stop it before it fails on its own.
OVERLAP_WRAP_MODES = ("on", "off")
OVERLAP_WRAP_OFF = "turned off (--overlap-wrap off)"
+# A frame the jump repair leaves off the walk's flow (`jump_repair.unfixed`: no group brings it back, or the group that
+# would was refused). warn: a warning line, the loop kept; refuse: the loop fails.
+UNFIXED_MODES = ("warn", "refuse")
SIZE_HOLD_MODES = ("auto", "off")
FACINGS = ("right", "left")
# Where `video-cycle-align` keeps the cut as filmed (sprite_gen/video/align.py). A new cut makes
@@ -1059,7 +1068,11 @@ def _overlap_lines(overlap: dict[str, Any]) -> list[str]:
"and cut it again (docs/loop-repair.md section 2)"]
if "skipped" in overlap:
return [f"{said}; the overlapped wrap was not made: {overlap['skipped']} (docs/loop-repair.md section 2)"]
+ return [f"{said}, and the overlapped wrap was refused ({_overlap_refused(overlap)}): cut as filmed (docs/loop-repair.md section 2)"]
+
+def _overlap_refused(overlap: dict[str, Any]) -> str:
+ """Why each run of the overlapped wrap was refused, in words."""
def why(t: dict[str, Any]) -> str:
if "unmade" not in t:
return ", ".join(t["rejected_for"])
@@ -1067,8 +1080,64 @@ def _overlap_lines(overlap: dict[str, Any]) -> list[str]:
rest = ", the rest not made" if t["unmade"] else ""
return f"{', '.join(t['rejected_for'])} ({', '.join(stopped['faults'])} at frame {stopped['frame']}{rest})"
- refused = "; ".join(f"{t['width']} frames {t['side']} the wrap: {why(t)}" for t in overlap["tries"])
- return [f"{said}, and the overlapped wrap was refused ({refused}): cut as filmed (docs/loop-repair.md section 2)"]
+ return "; ".join(f"{t['width']} frames {t['side']} the wrap: {why(t)}" for t in overlap["tries"])
+
+
+def _unfixed_lines(jump_repair: dict[str, Any]) -> list[str]:
+ """Each drawing the jump repair left off the walk's flow (`jump_repair.unfixed`), in words."""
+ lines = []
+ for u in jump_repair.get("unfixed") or []:
+ frames = u["frames"]
+ why = (f"the group that would bring it back was refused ({', '.join(u['refused'])}), so it plays as filmed"
+ if "refused" in u else f"no group of up to {jump_repair['span']} drawings brings it under {jump_repair['limit']:g}")
+ lines.append(f"frame{'s' if len(frames) > 1 else ''} {', '.join(map(str, frames))} of the loop lie{'' if len(frames) > 1 else 's'} "
+ f"{u['off']:.2f}x its window's usual step off the walk's flow after the jump repair: {why}")
+ return lines
+
+
+def _step_reason(jump_repair: dict[str, Any], frames: set[int]) -> dict[str, Any]:
+ """Why a step between drawings jumps, where the jump repair says it: a drawing of it (`frames`) left off the walk's
+ flow (`jump_repair.unfixed`) — the group that would bring it back refused (`repair-refused`, its faults), or none
+ found (`unfixed`) — a refused group's drawing first: the drawings beside it read off the flow because it is; with the
+ failure line's `words`. Elsewhere the reason is not known (`reason` None)."""
+ for u in sorted(jump_repair.get("unfixed") or [], key=lambda u: "refused" not in u):
+ if not frames & set(u["frames"]):
+ continue
+ at = f"frame{'s' if len(u['frames']) > 1 else ''} {', '.join(map(str, u['frames']))} lie{'' if len(u['frames']) > 1 else 's'} off the walk's flow"
+ if "refused" in u:
+ return {"reason": "repair-refused", "frames": u["frames"], "refused": u["refused"],
+ "words": f": {at}, and the jump repair's frame there was refused ({', '.join(u['refused'])}), so it plays as filmed"}
+ return {"reason": "unfixed", "frames": u["frames"],
+ "words": f": {at}, and no group of up to {jump_repair['span']} drawings brings it back"}
+ return {"reason": None}
+
+
+def seam_reason(report: dict[str, Any], cycle: dict[str, Any]) -> dict[str, Any]:
+ """Why the seam gate refuses a cut, where the warning lines say it: a cut of two steps by the clip's crossings whose
+ wrap a part on a beat of its own leaves open (`own-beat`) — the overlapped wrap was asked (`wrap_overlap`,
+ `_overlap_lines`), or no two-step cut closes (`local_cycle.step_verdict`). `overlap_wrap` says what became of the
+ overlapped wrap (made, skipped, rife not installed, refused; None where it was not asked) and `words` the failure
+ line's. Elsewhere the reason is not known (`reason` None)."""
+ overlap = report.get("wrap_overlap")
+ counted = cycle.get("step_count") or {}
+ if overlap is None and not (counted.get("chosen_by") == "two steps" and not counted.get("gated")):
+ return {"reason": None}
+ words = "the cut covers two steps by the clip's crossings, and a part on a beat of its own (a tail, a held prop) closes on no cut of two steps"
+ if overlap is None:
+ outcome = None
+ elif overlap["frames"]:
+ outcome = "made"
+ words += f": the overlapped wrap was made (frames {', '.join(map(str, overlap['frames']))}) and the wrap still does not close"
+ elif "rife" in overlap:
+ outcome = "rife not installed"
+ words += ": RIFE is not installed, so the overlapped wrap was not made"
+ elif "skipped" in overlap:
+ outcome = "skipped"
+ words += f": the overlapped wrap was not made ({overlap['skipped']})"
+ else:
+ outcome = "refused"
+ words += f": the overlapped wrap was refused ({_overlap_refused(overlap)})"
+ return {"reason": "own-beat", "overlap_wrap": outcome, "words": words}
def _shifts(analysis: dict[str, Any]) -> tuple[np.ndarray, int]:
@@ -1210,6 +1279,49 @@ def ring_steps(frames: list[Image.Image]) -> dict[str, Any]:
return reading.judge(len(frames), len(frames))
+def drawing_steps(cells: list[Image.Image]) -> dict[str, Any] | None:
+ """A loop's cells as they play, read between their drawings (`repair.flow_drawings`: a cell held on twos or threes
+ shows its drawing again): each drawing's first cell on the analysis features (`_small_features`) and the step into the
+ next drawing's, the last drawing's into the first's across the wrap. The largest of them, the wrap's included, over
+ the mean of the others (`largest_ratio`, from the cell `largest_from` into the cell `largest_into`, each a drawing's
+ first), and the wrap's (`wrap_ratio`). None for a loop of fewer than three drawings."""
+ runs, hold = repair_mod.flow_drawings(repair_mod.flow_states(cells))
+ if len(runs) < 3:
+ return None
+ firsts = [run[0] for run in runs]
+ flat = np.stack([_small_features(cells[k]) for k in firsts])
+ steps = np.abs(np.roll(flat, -1, axis=0) - flat).mean(axis=1)
+ mean = float(steps[:-1].mean())
+ largest = int(np.argmax(steps))
+ return {"read": "drawings", "drawings": len(runs), "hold": hold, "mean_step": round(mean, 6),
+ "largest_ratio": round(float(steps[largest]) / mean, 4) if mean > 0 else None,
+ "largest_from": firsts[largest], "largest_into": firsts[(largest + 1) % len(firsts)],
+ "wrap_ratio": round(float(steps[-1]) / mean, 4) if mean > 0 else None}
+
+
+def fixed_count(frames: list[Image.Image], D: np.ndarray, start: int, length: int) -> dict[str, Any]:
+ """The clip's own count of the steps a fixed cut covers: the crossings of its frames (`crossings.read`), the cut
+ judged (`Reading.judge`), and an odd count the clip may have missed a crossing in asked whether the clip a cut on is
+ the same picture (`local_cycle.same_picture_count`, as `--anchor motion-auto` asks it, on `D`, the clip's distances).
+ Recorded `chosen_by: caller`: the caller named the cut."""
+ 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")
+ record = {**reading.record(), "chosen_by": "caller"}
+ said, record["cut"] = local_cycle.same_picture_count(reading, D, reading.judge(start, length))
+ if said is not None:
+ record["same_picture"] = said
+ return record
+
+
+def odd_count(cycle: dict[str, Any]) -> bool:
+ """A fixed cut the clip's crossings count an odd number of steps (`fixed_count`): its legs swap at the wrap."""
+ counted = (cycle.get("step_count") or {}).get("cut") or {}
+ return cycle.get("kind") == "fixed" and counted.get("verdict") == "refuted" and bool(counted["k"][0] % 2)
+
+
def cycle_apart(files: list[Path], *, start: int, length: int, skip: int, analysis: dict[str, Any],
motion: dict[str, Any], size: tuple[int, int]) -> dict[str, dict[int, Image.Image]]:
"""The clip's frames a cycle from a motion-auto cut's frames beside its wrap, for `repair.overlap_wrap`: a cycle after
@@ -1392,6 +1504,7 @@ def run_loop(
size_hold: str = "auto",
steps: int | None = None,
overlap_wrap: str = "on",
+ unfixed: str = "warn",
) -> dict[str, Any]:
state = state.strip().lower() if state else state
if state == effect.STATE:
@@ -1421,6 +1534,8 @@ def run_loop(
raise SystemExit(f"video-loop: unknown --repair {repair!r}; expected one of {', '.join(REPAIR_MODES)}")
if overlap_wrap not in OVERLAP_WRAP_MODES:
raise SystemExit(f"video-loop: unknown --overlap-wrap {overlap_wrap!r}; expected one of {', '.join(OVERLAP_WRAP_MODES)}")
+ if unfixed not in UNFIXED_MODES:
+ 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 anchor is None:
@@ -1570,6 +1685,24 @@ def run_loop(
if start is None or length is None:
raise SystemExit("video-loop: --cycle fixed needs --start and --length")
cycle = fixed_cycle(D, start=start, length=length)
+ if gait_frames is not None:
+ # A walk or run loops on two steps: the clip's own count of the cut the caller named, as a search's cut is
+ # counted. An odd count swaps the legs at the wrap, however close the frames there look.
+ cycle["step_count"] = fixed_count(gait_frames, D, start, length)
+ if odd_count(cycle):
+ counted = cycle["step_count"]
+ if seam_max <= STEP_RATIO_MAX:
+ two = round(2 * counted["step_range"][1])
+ report_base["seam_refusal"] = {"reading": "count", "cut": [start, length], "verdict": "refuted",
+ "k": counted["cut"]["k"], "why": counted["cut"]["why"], "two_steps": two}
+ raise SystemExit(
+ f"video-loop: loop step count refutes the fixed cut {start}/{length} — the clip's crossings count "
+ f"{counted['cut']['why']} where a walk loops on two, and an odd count swaps the legs at the wrap; "
+ f"cut it again two steps long (about {two} frames)")
+ counted["lifted"] = {"seam_max": seam_max}
+ print(f"video-loop: warning: the clip's crossings count the fixed cut {start}/{length} "
+ f"{counted['cut']['why']}: a walk loops on two steps, and an odd count swaps the legs at the wrap — "
+ f"kept, as --seam-max {seam_max:g} lifts the step gate", file=sys.stderr)
elif cycle_mode == "one-shot":
cycle = _one_shot(D, window, hi, masses)
elif cycle_mode == "pinned":
@@ -1777,6 +1910,16 @@ def run_loop(
shutil.rmtree(out_dir / FALLBACK_FRAMES_DIR, ignore_errors=True)
write_loop_report(target, {**report_base, "status": "failed", "error": error, "cycle": cycle})
raise SystemExit(error)
+ left = _unfixed_lines(report_base["jump_repair"])
+ if left and unfixed == "refuse":
+ error = (f"video-loop: loop frames left off the flow — {'; '.join(left)} ({cycle.get('kind', 'periodic')} length {L} "
+ f"frames from {i}); the motion does not play smoothly — regenerate the clip")
+ shutil.rmtree(out_dir / FALLBACK_FRAMES_DIR, ignore_errors=True)
+ write_loop_report(target, {**report_base, "status": "failed", "error": error, "cycle": cycle})
+ raise SystemExit(error)
+ for line in left:
+ print(f"video-loop: warning: {line} — a jump played as filmed; --unfixed refuse refuses such a loop "
+ "(docs/loop-repair.md section 2)", file=sys.stderr)
for line in warnings:
print(f"video-loop: warning: {line} (reference bound; the loop is kept — docs/loop-repair.md)", file=sys.stderr)
if "ghost_given_way" not in report_base:
@@ -1914,17 +2057,53 @@ def run_loop(
"resampled_seam_ratio": seam_ratio})
raise SystemExit(error)
elif not single_play and seam_ratio > seam_max:
+ known = seam_reason(report_base, cycle)
error = (
f"video-loop: loop seam ratio {seam_ratio:.2f} exceeds {seam_max} "
f"({cycle['kind']} length {L} frames from {i}); the cycle does not close — "
- "regenerate with a complete return to the starting pose"
+ + (f"{known['words']} — regenerate with that part moving on the walk's beat" if known["reason"] else
+ "regenerate with a complete return to the starting pose")
)
write_loop_report(target, {**report_base, "status": "failed", "error": error,
"cycle": cycle, "periodic_attempt": periodic_attempt,
"resampled_seam": resampled_seam,
"resampled_inner_mean_adjacent": resampled_adjacent,
- "resampled_seam_ratio": seam_ratio})
+ "resampled_seam_ratio": seam_ratio,
+ "seam_refusal": {"reading": "wrap", "ratio": seam_ratio, "max": seam_max,
+ **{k: v for k, v in known.items() if k != "words"}}})
raise SystemExit(error)
+ if prof.gait and not single_play:
+ # Every step of the loop as it plays, read between its drawings: a frame that jumps inside the loop, which the
+ # seam ratio at the wrap does not see. The bound is the step gate's, or the seam gate's where --seam-max lifts it.
+ step_max = max(STEP_RATIO_MAX, seam_max)
+ read = drawing_steps([strip.crop((k * strip_meta["w"], 0, (k + 1) * strip_meta["w"], strip_meta["h"]))
+ for k in range(strip_meta["frames"])])
+ if read is None:
+ report_base["step_gate"] = {"read": "drawings", "skipped": "fewer than three drawings", "max": step_max}
+ else:
+ of = strip_meta["sample_indices"]
+ read.update(largest_into=of[read["largest_into"]], largest_from=of[read["largest_from"]], max=step_max,
+ lifted=seam_max > STEP_RATIO_MAX)
+ report_base["step_gate"] = read
+ ratio = read["largest_ratio"]
+ if ratio is not None and ratio > step_max:
+ known = _step_reason(report_base["jump_repair"], {read["largest_from"], read["largest_into"]})
+ error = (f"video-loop: loop step ratio {ratio:.2f} exceeds {step_max:g} ({cycle['kind']} length {L} frames "
+ f"from {i}, into frame {read['largest_into']}, read between its {read['drawings']} drawings); the loop "
+ f"jumps inside{known.pop('words', '')} — regenerate the clip")
+ write_loop_report(target, {**report_base, "status": "failed", "error": error,
+ "cycle": cycle, "periodic_attempt": periodic_attempt,
+ "resampled_seam": resampled_seam,
+ "resampled_inner_mean_adjacent": resampled_adjacent,
+ "resampled_seam_ratio": seam_ratio,
+ "seam_refusal": {"reading": "steps", "ratio": ratio, "max": step_max,
+ "into": read["largest_into"], **known}})
+ raise SystemExit(error)
+ if ratio is not None and ratio > STEP_RATIO_MAX:
+ read["kept"] = f"--seam-max {seam_max:g} lifts the step gate"
+ print(f"video-loop: warning: the loop's largest step between drawings is {ratio:.2f}x their mean (into frame "
+ f"{read['largest_into']}), over {STEP_RATIO_MAX:g}: it jumps inside — kept, as --seam-max {seam_max:g} "
+ "lifts the step gate", file=sys.stderr)
# GIF has binary transparency. Bake the effect onto its declared black preview
# background instead of turning its faint partial-alpha glow into opaque dark pixels.
gif_background = "#000000" if cycle["kind"] == "lifetime" else None
@@ -1983,7 +2162,7 @@ def add_arguments(parser: argparse.ArgumentParser) -> None:
parser.add_argument("--max-len", type=int, help="override: maximum cycle length in frames, on every path that sets one (a cut longer fails)")
parser.add_argument("--n-out", type=int, help="frames in the GIF/WebP (default: cycle seconds x --gif-fps)")
parser.add_argument("--gif-fps", type=float, default=GIF_FPS_DEFAULT, help=f"GIF/WebP playback density (default {GIF_FPS_DEFAULT:g}); every state plays at this rate regardless of cycle length")
- parser.add_argument("--seam-max", type=float, default=SEAM_RATIO_MAX, help=f"loop seam gate (default {SEAM_RATIO_MAX})")
+ parser.add_argument("--seam-max", type=float, default=SEAM_RATIO_MAX, help=f"loop seam gate (default {SEAM_RATIO_MAX}): the wrap over the mean step. A walk or run is also held to the step gate — its largest step between drawings over their mean step at most {STEP_RATIO_MAX:g}, and a fixed cut not one the clip's crossings count an odd number of steps; a --seam-max past {STEP_RATIO_MAX:g} lifts the step gate with it (every step's bound is then --seam-max, and an odd count a warning line)")
parser.add_argument("--cycle", choices=CYCLE_MODES, default="auto", help="once: a performed action ending in a stable held pose, with no return or seam gate; auto: non-loop states use once, otherwise periodic first, one-shot failover for action states (recorded in the report); periodic / one-shot force one detector; fixed cuts exactly --start/--length (no detection, reported as kind=fixed); pinned: the whole clip but its last frame, for a clip pinned to end on its first frame (the gate is that pin); once-return: the whole clip with its last frame, played once from its first pose back to it (loop false, returns true), for a clip pinned to end on its first frame (the gate is that pin)")
parser.add_argument("--start", type=int, help="fixed cut: first keyed frame of the cycle (with --cycle fixed)")
parser.add_argument("--length", type=int, help="fixed cut: cycle length in frames (with --cycle fixed)")
@@ -1993,6 +2172,7 @@ def add_arguments(parser: argparse.ArgumentParser) -> None:
parser.add_argument("--anchor-region", type=motion_anchor.parse_region, action="append", help="motion anchor only: repeat twice with head then torso x0,y0,x1,y1 in the first selected frame; requires --cycle fixed and at least 6 frames")
parser.add_argument("--repair", choices=REPAIR_MODES, default="auto", help="auto (default): take out the frames off the walk's flow (one or two drawings that lie 3x their region's usual step off the line between the frames either side) and make them again with RIFE between those frames, each at its own time, so the loop keeps its length; adopt only without smear/outline faults, at most 3 calls and never made from or beside a frame made (docs/loop-repair.md section 2). A rejected group keeps its frames. Missing RIFE keeps the filmed loop with a warning (`sprite-gen rife install`); on: the same repair, but no RIFE fails the loop; off: cut as filmed")
parser.add_argument("--overlap-wrap", choices=OVERLAP_WRAP_MODES, default="on", help="--anchor motion-auto, under --repair auto or on: on (default): a cut two steps long whose wrap a part on its own beat leaves open (the seam gate refuses it) has four to twelve frames beside its wrap made again between the clip's frames a cycle apart and its own, each read with RIFE's single passes for a part torn — 34 calls of the binary a frame, up to forty frames (docs/loop-repair.md section 2, \"The overlapped wrap\"); off: not tried, recorded `wrap_overlap.skipped` with a warning line, and the gate refuses the cut as filmed — for a host whose RIFE runs on a CPU, where one frame of a 960 px clip takes minutes")
+ parser.add_argument("--unfixed", choices=UNFIXED_MODES, default="warn", help="walk/run, under --repair auto or on: a frame the jump repair leaves off the walk's flow — no group of up to two drawings brings it back, or the group that would was refused (its RIFE frame had a fault) — is recorded in jump_repair.unfixed; warn (default): a warning line, the loop kept; refuse: the loop fails")
parser.add_argument("--jolt-max", type=float, default=None, help=f"walk/run: fail the repaired loop when its jolt index (how far each step strays from its neighbours' mean, over the median step) exceeds this. Default: no gate — the index is reported and a value over {repair_mod.JOLT_REFERENCE} is a warning line")
parser.add_argument("--head-step-max", type=float, default=None, help=f"walk/run: fail the repaired loop when the head's largest sideways move in one frame exceeds this %% of the body height. Default: no gate — reported, and over {repair_mod.HEAD_STEP_REFERENCE} is a warning line")
parser.add_argument("--facing", choices=FACINGS, default="right", help="which way the body faces in the frames (default right): the jolt index's hair, and the size reading video-loop-compare's jump guard reads, are behind it; the jump repair reads the flow either way")
@@ -2022,7 +2202,7 @@ def run(**kwargs: object) -> int:
repair=str(kwargs.get("repair") or "auto"), facing=str(kwargs.get("facing") or "right"),
jolt_max=kwargs.get("jolt_max"), head_step_max=kwargs.get("head_step_max"), # type: ignore[arg-type]
size_hold=str(kwargs.get("size_hold") or "auto"), steps=kwargs.get("steps"), # type: ignore[arg-type]
- overlap_wrap=str(kwargs.get("overlap_wrap") or "on"),
+ overlap_wrap=str(kwargs.get("overlap_wrap") or "on"), unfixed=str(kwargs.get("unfixed") or "warn"),
)
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")}
@@ -2053,11 +2233,16 @@ def run(**kwargs: object) -> int:
if payload.get("wrap_overlap"):
overlap = payload["wrap_overlap"]
summary["wrap_overlap"] = {k: overlap[k] for k in ("seam", "frames", "side", "width", "seam_after", "skipped") if k in overlap}
+ if payload.get("step_gate"):
+ summary["step_gate"] = {k: payload["step_gate"][k] for k in ("drawings", "hold", "largest_ratio", "largest_into", "max", "skipped")
+ if k in payload["step_gate"]}
if payload.get("jump_repair", {}).get("replaced"):
summary["jump_repair"] = {k: payload["jump_repair"][k] for k in ("replaced", "off_max_before", "off_max_after")}
eased = [r for r in payload["jump_repair"]["rounds"] if r.get("why") == "ease" and r["outcome"] == "accepted"]
if eased:
summary["jump_repair"]["eased"] = eased[0]["replaced"]
+ if payload.get("jump_repair", {}).get("unfixed"):
+ summary.setdefault("jump_repair", {})["unfixed"] = [u["frames"] for u in payload["jump_repair"]["unfixed"]]
summary["strip"] = {k: payload["strip"][k] for k in ("path", "frames", "w", "h", "body_h", "delay_ms")}
print(json.dumps(summary, ensure_ascii=False, indent=2))
return 0
diff --git a/sprite_gen/video/repair.py b/sprite_gen/video/repair.py
index 84cb8d9..e54dd35 100644
--- a/sprite_gen/video/repair.py
+++ b/sprite_gen/video/repair.py
@@ -1169,8 +1169,9 @@ def repair_jumps(frames: list[Image.Image], interpolate: Interpolate | None, *,
frames side by side are made from each other and melt the legs. A group whose made drawings carry
a shared interpolation-quality fault — a ghost too, on its own coverage, where the screen reads
the loop — keeps every frame it would take, as filmed, and nothing is made from or beside them
- (`refused`); a made drawing that cross-fades two drawings inside its silhouette is still taken,
- its round naming it (`look`). `interpolate` may be None: a ghost then gives way to the clean frame
+ (`refused`), and a drawing of it the loop as it plays still reads at or over `limit` off the flow is
+ `unfixed`, with the faults that refused it (`_refused_left`); a made drawing that cross-fades two drawings inside its
+ silhouette is still taken, its round naming it (`look`). `interpolate` may be None: a ghost then gives way to the clean frame
beside it, and the flow search stops at the first group it would make, naming it (`unmade`). The
flow is read again after each group, on the union box of the original loop. Then, on the loop as the rounds left
it, the eased retime (`why` ease, `_ease`; `ease` false reads the rush and makes nothing): the worst rush
@@ -1269,9 +1270,30 @@ def repair_jumps(frames: list[Image.Image], interpolate: Interpolate | None, *,
if record["surge"] is not None:
later = _flow(out, box)
record["surge_after"] = next((_said_surge(s, later) for s in _surges(later)), None)
+ if refused:
+ record["unfixed"] = [*record["unfixed"], *_refused_left(out, box, record["rounds"], limit)]
return out, record
+def _refused_left(frames: list[Image.Image], box: tuple[int, int, int, int], rounds: list[dict[str, Any]],
+ limit: float) -> list[dict[str, Any]]:
+ """The drawings of the flow groups the rounds refused that the loop as it now plays still reads at or over `limit` off
+ its flow: a group refused keeps its frames as filmed, so a jump is left there. Each as `flow_targets` names a drawing
+ `unfixed` — its frames and its reading (`off`, `turn`, `into`, `out`, `window`), here on the loop as it plays — and
+ the faults that refused its group (`refused`)."""
+ flow = _flow(frames, box)
+ scores = _drawing_scores(flow)
+ faults_of = {t: r["faults"] for r in rounds if r["why"] == "flow" and r["outcome"] == "rejected" for t in r["frames"]}
+ left = []
+ for d, run in enumerate(flow["runs"]):
+ hit = [t for t in run if t in faults_of]
+ if not hit or scores["off"][d] < limit:
+ continue
+ left.append({"frames": run, **{k: round(float(scores[k][d]), 4) for k in ("off", "turn", "into", "out")},
+ "window": [round(v, 4) for v in flow["fractions"][int(scores["window"][d])]], "refused": faults_of[hit[0]]})
+ return left
+
+
# --- the jolt index (docs/loop-repair.md section 3) ------------------------------------------
# Reference bounds, at the edge of what was kept on the 2026-10-03 takes (section 3): nothing kept