Skip to content

animation: inkstats undercounts the final hold of a rotoscope work dir #4594

Closed as not planned

Description

@kyle-sexton

For a rotoscope work directory, inkstats.drawings() ends the last drawing one nominal frame after its start instead of at d/index.json's duration, so the final hold is undercounted (regression clip: 0.042 s counted, 0.133 s actual). Found by Codex on #4534; deferred there because the fix changes the learned woodcut-ink pack.

Fix (tested, not applied)

diff --git a/plugins/animation/scripts/inkstats.py b/plugins/animation/scripts/inkstats.py
index 06465ed4b..c1d15a83d 100755
--- a/plugins/animation/scripts/inkstats.py
+++ b/plugins/animation/scripts/inkstats.py
@@ -120,8 +120,13 @@ def drawings(film, fps, region=None, window=None):
             continue
         prev = rgb.astype(np.int16)
         yield rgb, t
-    else:   # the film ended: a video where its stream ends, anything else one frame after the last
-        t = decode.end(film) if isinstance(film, (str, Path)) and Path(film).is_file() else t + dt
+    else:   # the film ended: a video where its stream ends, a work dir at its index's duration, else one frame on
+        if isinstance(film, (str, Path)) and Path(film).is_file():
+            t = decode.end(film)
+        elif isinstance(film, (str, Path)) and decode.workdir.src(Path(film)).is_dir():
+            t = json.load(open(decode.workdir.index(Path(film)), encoding='utf-8'))['duration']
+        else:
+            t += dt
     yield None, t
 
 

Result of relearning the pack with the fix

  • controls.py check: 36/36 as required against both the old and the relearned pack; no control flips to passing. Selftest unchanged.
  • Held-out: calibration 152/152, evaluation 147/150 (was 150/150). Splits 151 (76 calibration) instead of 150.
  • offstep: band 0.0308-0.1406 (source 0.0882) becomes 0.0393-0.1242 (source 0.084), widening 0.0096 to 0.0007; the 3 held-out misses are all on this row.
  • Also moved: per_second 7.784-8.04 to 7.777-7.968 (source 7.919 to 7.895); flat 0.1305-0.7958 to 0.1057-0.819; duration 30.182 to 30.273.

To decide

Accept 147/150, or change how bands and widening are learned so held-out coverage survives the corrected statistic, then re-baseline the pack and the refactor safety net.

Related

Activity

  1. added
    needs-triage
    on Sep 27, 2026
  2. added theissue type on Sep 27, 2026
  3. added
    needs-human
    and removed
    needs-triage
    on Sep 27, 2026
  4. kyle-sexton commented on Sep 27, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Triage: verified bug, human-gated on the pack decision

    Verified (code read on main). The drawing iterator's end-of-film branch only special-cases a video file. A rotoscope work dir is a directory, so it falls to "one nominal frame after the last drawing's time" and ignores the duration recorded in the work dir's drawing index. That explains the reported shortfall: the final hold is counted as 1/fps, not as the time left until the clip ends. The frame decoder already reads that same index for a work dir, so the fix in the body uses a value that is already there.

    Brief

    • Behavior: for a work-dir input, the last drawing's hold ends at the index's duration. Video-file inputs, frame folders, and synthetic iterables keep their current end rules.
    • Acceptance: the regression clip counts 0.133 s for its final hold, not 0.042 s. controls.py check stays 36/36 and the selftest is unchanged. The woodcut-ink pack is relearned and committed together with the fix, and held-out coverage meets whatever bar is decided below.
    • Why a human decides: the fix is small and already tested. The open question is the pack. With the corrected statistic, held-out evaluation drops from 150/150 to 147/150, and all three misses are on offstep. There are two choices: (a) accept 147/150 and re-baseline, or (b) change how bands and widening are learned so held-out coverage survives, then re-baseline the pack and the refactor safety net. That is a calibration-method choice with no single right answer, so it is not defaulted.
    • Once decided: (a) is scoped work: apply the diff, relearn, commit the pack. (b) first needs a design for the band-learning change.

    Type: Bug. Priority: medium (nothing is blocked, and the error is a bounded undercount on one statistic).

  5. added
    agent-ready
    and removed
    needs-human
    on Sep 27, 2026
  6. kyle-sexton commented on Sep 27, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during work-loop.

    Ratify C3 dispatch? This item now carries work-class: scoped and agent-ready (applied 2026-09-27 18:52Z), and the work-loop admission gate (instance melo-lap-001-wsl-2) reads it as C3, bug-fix-shaped. It has no recorded ratification, and labels alone are not ratification evidence, so it is queued here instead of dispatched.

    Also needed: the triage brief left the woodcut-ink pack decision open. Option (a) is the one-function fix. Option (b) redesigns how bands are learned, which triage said would raise the item to C4. Please say which option the worker should implement when you ratify.

    Intended dispatch: one /work-items:work worker implements the ratified option and opens a draft PR.

  7. added
    needs-human
    and removed
    agent-ready
    on Sep 27, 2026
  8. 9 remaining items

  9. kyle-sexton commented on Oct 1, 2026

    @kyle-sexton
    MemberAuthor

    Owner decision (2026-10-01): approved the recommendation ("go with recommended", the owner's reply to the batch decision page that listed this question and its recommendation).

    Question: the woodcut-ink relearn needs the shfred0 clip, which the repo does not ship. Who runs it?

    Chosen option A: the owner names the host and path of shfred0.mp4 (or its rotoscope work dir), or puts it somewhere a lane can reach. An agent then runs regress.py, controls.py measure, learn.py, controls.py check (expect 36/36), selftest and the safety-net re-baseline in a worktree, and opens a draft PR with "Closes #4594" that also removes the STYLE.md caveat. This replaces the owner-runs-the-steps plan in the 2026-09-29 comment.

    Next: waiting on the owner to give the clip location. Until then the issue stays open with needs-human.

  10. self-assigned this
    on Oct 4, 2026
  11. kyle-sexton commented on Oct 4, 2026

    @kyle-sexton
    MemberAuthor
    No description provided.
  12. kyle-sexton commented on Oct 4, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during attend-queue.

    Escalation answered (2026-10-04): the owner does not know where the shfred0 clip or its rotoscope work dir is. The relearn cannot run without it, so the item stays needs-human. It can move again in either of two ways:

    • the clip turns up, or
    • the owner decides to accept the shipped final-hold fix and drop the relearn and re-baseline from scope.
  13. removed their assignment
    on Oct 4, 2026
  14. kyle-sexton commented on Oct 13, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded. The owner approved applying independently verified recommendations on 2026-10-12.

    inkstats undercounted a rotoscope work dir's final hold; the code fix shipped in #4965, but the woodcut-ink pack was never relearned with the corrected statistic and STYLE.md carries a caveat. The relearn needs the shfred0 clip, which the repo does not ship and the owner could not locate on 2026-10-04.

    Verification notes:

    Verified by an independent fresh-context check (confirmed, risk low): gh issue view 4594 (OPEN; owner decisions 2026-09-29 (a), 2026-10-01 A; 2026-10-04 clip location unknown); gh pr view 4965 MERGED; origin/main plugins/animation/README.md:24, CHANGELOG.md:254, styles/woodcut-ink/STYLE.md:7-8,60-64, style.json:3, scripts/decode.py:29; curl publish.twitter.com oembed (200) and cdn.syndication.twimg.com tweet-result for 2102495989194236158

    Admission to an agent lane stays with the work-class rules and owner ratification.

  15. kyle-sexton commented on Oct 13, 2026

    @kyle-sexton
    MemberAuthor

    Owner batch-ratified this admission in an attended session on 2026-10-12: work-class: scoped. Rule: class C1-C3, no trust surface, the independent check confirmed the recorded decision, and no owner step remains.

  16. added
    agent-ready
    and removed
    needs-human
    on Oct 13, 2026
  17. kyle-sexton commented on Oct 14, 2026

    @kyle-sexton
    MemberAuthor

    The code bug is fixed: #4965 merged on 2026-09-28, and test_inkstats.py passes on main (5/5). What remains is the woodcut-ink relearn. controls.py measure needs the round 3 near-miss film and three other-style clips (statistics.md:7-8), and none of them are in the repo or on this machine. Question for the owner: where are those clips? Or should this ship without the relearn and the 36/36 control check?


    This comment was posted by an AI agent (Claude Code), the work-loop lane.

  18. added
    needs-human
    and removed
    agent-ready
    on Oct 14, 2026
  19. kyle-sexton commented on Oct 18, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded.

    Question: The inkstats bug is fixed (#4965). The woodcut-ink style was never relearned with the corrected statistic, and STYLE.md says so. A relearn needs four source clips that are not on this machine. Options: (a) the owner finds all four clips, then an agent relearns; (b) accept the fix, keep the caveat and close; (c) relearn from the shfred0 clip only, with no control check.

    Owner's answer: (b) Two of the four clips cannot be found: the round-3 film was a replica the user rejected, and the control clips have no recorded location. (c) is cheaper than it looks, because the shfred0 post was still public on 2026-10-12. Basis: styles/woodcut-ink/STYLE.md:7-8, :60-64; learn-style/reference/statistics.md:5-9.

    The owner accepted this recommendation as item D2 of a 32-decision batch in an attended backlog-shaping session on 2026-10-18. The batch question: "Accept all 32 recommendations, including the four flagged above (D2 close the relearn, D26 cross-repo sync without per-repo confirm, D10 narrow hook, D23 delete guard only)?" The owner answered: "Accept all 32 (Recommended)".

    Posted by AI from the owner's answer in that session.

  20. kyle-sexton commented on Oct 18, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during backlog shaping.

    Closing as not planned. Owner decision D2 (2026-10-18): option (b), accept the fix and keep the caveat. This reverses the earlier relearn rulings of 2026-09-29 and 2026-10-01. The final-hold fix shipped in #4965. Two of the four relearn clips cannot be found (learn-style reference/statistics.md:5-9), and STYLE.md:60-64 on origin/main documents that the pack predates the corrected statistic.

    The owner approved this close in an attended backlog-shaping session on 2026-10-18 (question: "Close the 9 issues ...?"; answer: "Close all 9 (Recommended)").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-human

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions