Skip to content

A time-map solver to copy, a skeleton for data along a time axis; Ctrl-C under every uv run; two plainer messages - #117

Merged
ZLHad merged 3 commits into
mainfrom
claude/leftovers
Oct 19, 2026
Merged

ZLHad merged 3 commits into
mainfrom
claude/leftovers

Conversation

@ZLHad

@ZLHad ZLHad commented Oct 19, 2026

Copy link
Copy Markdown
Owner

What and why · 改了什么、为什么

上一轮剩下的五件事,一个 PR。原则照旧:harness 给底线、准确的接口、做机械活的工具和带理由的参考;一支片子自己的解法留在项目里或者变成例子,不变成内置的规则或命令。例子一律是合成数据。

  1. 时间映射求解的例子 engines/canvas-film/examples/time-map-solve.py(只用标准库)和旁边一份合成的规格 time-map-spec.json。不是 bin/vh 的命令,是项目复制过去照着改的参考:
    • 段界的片子时间是定点;事件可以 "pin" 住(已定的落点,从映射里抄来的 t),定点把轴切成一个个跨度,每个跨度单独解;
    • 跨度里每单位轴的片子时间 = r·w(u)(w 是慢窗,边缘柔和)+ 放慢事件的高斯块(在跨度边上截断,不向邻居借时间)+ 停留;r 取剩下的;
    • 字卡读时按车道查:一张卡在同车道下一张卡来之前读不完(need = readcheck 的底线或事件自己的 need,加车道间隔),就给这一对里没钉住的事件加减速,重解这个跨度,最多 60 轮;跨定点的只报不改;
    • 所以改两个定点之间的一张卡,只有那个跨度的折点变,其余逐个相同;
    • 输出 src/06-time-map.js 和 tools/audio/time_map.py 读的格式(带 spec 的 sha256 和 rebuild),报告每个定点前后的速度、为读时加了多少减速、还差多少。
    • canvas-film README 的时间映射一节加一行指向它。
  2. 全片骨架 recipes/sequences/data-along-time.md:沿数据自己的时间轴讲的数据片。一份时间映射同时管画面各层和声音;定位环和从字卡到数据点的引线;换视图时把线带进下一个视图;字卡栈让每张卡都有读时;什么时候在事件附近放慢。每一处写了为什么,另有一节"什么会变,什么不变",免得变成一种固定长相。照 05 和 styles/editorial-data 写,bin/vh recipes check 通过;两个配方索引和 video-types/05 各加一行链接。
  3. uv run 的 Ctrl-C 竞态:Ctrl-C 正好落在 Python 退出时,uv 自己以 2 退出("Failed to get PID of child process"),bash 看见子进程是正常退出,就接着往下走。Small fixes: Ctrl-C ends readcheck, storyboard and rhythm quietly; X's weighted length; doctor <project> #114 只给 storyboard 和 rhythm 加了 on_ctrl_c。现在 bin/vh 里每一处 uv run 都经过它:music、sfx、beats、qa、带 profile 的 mix、tts、pace、captions(含两次 jieba 探测)、cover-preview、style compare 和 gallery、sheet、fonts list/subset、check 的逐帧和缩放扫描(在 $( ) 里,调用处见 130 就退出)、doctor 的两处缓存探测。还是一个 helper。
  4. sfx place … <duration> 时长不是大于 0 的秒数(2s、nan、-1、0、inf):说清楚,退出 2,不再是 float() 的 traceback。
  5. canvas-film 的 loadFonts:同一个 family 和 weight 有两个 face(主 face 和只管几个字的 unicode-range face)时,缺字体会把 "Film Serif 900" 报两次。现在每个缺的 face 报一次,unicode-range 的 face 带上它管的范围;列表用 · 隔开(范围里自己有逗号)。

English summary. An example time-map solver (stdlib only, synthetic spec) for projects to copy: fixed segment ends and pinned events cut the axis into spans solved one by one (Gaussian slow-downs cut at span edges, slow windows, holds, a per-lane reading-time check), so an edit between two pins re-solves that span alone. A whole-film skeleton for data told along a time axis, with reasons and what varies. on_ctrl_c now wraps every uv run in bin/vh. sfx place with a non-numeric duration exits 2 with a message. canvas-film names each missing font face once.

How it was verified · 怎么验证的

  • tools/ci.sh --committed(VH_BASH=/bin/bash,shellcheck、pyflakes 真的跑了)通过。新的 CI 用例:
    • 求解例子:规格解出的映射 bin/vh timemap check 通过;把 15 s 定点和 32 s 段界之间一张卡的字加长再解,这个跨度外的折点逐个相同、跨度内变了、两个钉住的事件仍在 15 s 和 48 s;
    • Ctrl-C:一个假的 uv,收到 SIGINT 就像竞态那样以 2 退出,在 12 个命令下各发一次 Ctrl-C(发给进程组,和终端一样),都以 130 结束。同一个用例跑 main 的 bin/vh:10 个是 2,sheet 是 1(接着跑了 ffmpeg 的后备),captions 卡住(第一次探测"失败"后开始第二次 uv);
    • sfx place 时长写 2s:退出 2,有那句说明,没有 traceback;
    • 缺字体:把模板 film.html 的 local() 全换成不存在的名字,报出 8 个 face,没有重复,Film Serif 900 和 Film Serif 900 for U+2013, U+2212 分开。main 上同一页报 Film Serif 900 和 Film Mono 400 各两次。
  • 手动:time-map-solve.py -h、无参数(退出 2)、在 spec 的定点上加一个停留(钉住的事件仍在定点到达,停留在它之后);sfx place 时长 abc、nan、-1、0、inf 都退出 2,2 照常写出 2.00 s 的静音轨。

Checklist · 自查

  • tools/ci.sh --committed passes · 通过
  • User-visible change noted in CHANGELOG.md → Unreleased · 已记进 CHANGELOG
  • Changed CLAUDE.md → ran bin/vh sync-agents · 没改 CLAUDE.md

ZLHad added 3 commits October 19, 2026 11:37
…l-C under every uv run; two plainer messages

- engines/canvas-film/examples/time-map-solve.py (stdlib only) and a synthetic
  time-map-spec.json: an example of solving a time map for a project to copy and
  change (segments, Gaussian slow-downs cut at span edges, slow windows, holds, a
  reading-time check per lane, pins so an edit re-solves only the span between two
  pins). Not a bin/vh command. The canvas-film README's time-map section points to it.
  CI: the spec solves to a map timemap check takes; a card made longer between two
  pins moves knots in that span alone.
- recipes/sequences/data-along-time.md: a whole-film skeleton for data told along
  its own time axis (one time map for picture and sound, locator ring and leader
  line, a change of view that carries the line, a card stack with reading time,
  when to slow), each with why and what varies. Linked from the recipe indexes and
  video-types/05.
- on_ctrl_c now wraps every uv run in bin/vh (music, sfx, beats, qa, mix profiles,
  tts, pace, captions, cover-preview, style compare/gallery, sheet, fonts, check's
  scans, doctor's probes): uv exits 2 when Ctrl-C lands as its Python exits, and
  bash went on. CI: a fake uv that does that, under twelve commands, each 130.
- sfx place with a duration that is not a number above 0: a plain message, exit 2.
- canvas-film loadFonts names each missing face once; a unicode-range face says
  its range.
@ZLHad
ZLHad marked this pull request as ready for review October 19, 2026 03:53
@ZLHad
ZLHad enabled auto-merge (squash) October 19, 2026 03:53
@ZLHad
ZLHad merged commit 1029d55 into main Oct 19, 2026
2 checks passed
@ZLHad
ZLHad deleted the claude/leftovers branch October 19, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant