2.2 KiB
2.2 KiB
title, created, updated, type, tags, sources
| title | created | updated | type | tags | sources | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Look-Ahead Buffer Controller | 2026-06-20 | 2026-06-20 | concept |
|
|
Look-Ahead Buffer Controller (先行缓冲控制)
Look-Ahead Buffer Controller 是 maineCoon agentic-streaming-inference 的第三个控制器:管理生成速度与播放速度之间的时间差。
问题:生成≠播放同步
MaineCoon 在单 H100 上以 ~32 FPS 生成,但视频以 25 FPS 播放。两者不同步导致先行缓冲 (look-ahead buffer) 的积累:
← Past | Future →
Generation: [已生成.........正在生成..........未生成]
↑ generation head
Playback: [已播放.....正在播放.....缓冲中........]
↑ playback head
← lead →
Pace Gate(节奏门)
Buffer Controller 通过 pace gate 将 lead 保持在一个有界窗口内:
- 上限:lead 过大时减速生成,防止过度承诺未来内容
- 下限:lead 过小时加速生成(sprint),避免播放卡顿
- 暂停处理:观众暂停时 hold 生成
为什么 Lead 是设计空间
先行缓冲不仅是技术副作用,更是交互式流生成的设计资源:
| Lead 大小 | 优势 | 风险 |
|---|---|---|
| 大 lead | 容错空间大,可吸收计算抖动 | 观众输入滞后,已生成内容无法修改 |
| 小 lead | 即时响应观众交互 | 一次性能抖动就可能导致播放卡顿 |
理想的 lead 大小是刚好够缓冲计算抖动,又不至于让观众互动延迟过高。
与分离架构的配合
因为 agentic-streaming-inference 的分离设计:
- Planner/Observer 在 generation head 运行(有 lead 保护)
- Viewer interaction 通过 fast lane 注入未来 beat,不中断当前 chunk
- 计算抖动和 agentic 成本由 lead 吸收,播放端零延迟
参考
- maineCoon Section 4.3
- agentic-streaming-inference
- streaming-generation