BUG: Video scorers block the event loop while decoding frames and audio
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- opencv, python
- 领域
- backend, performance
调研方向
Read pyrit/score/video_scorer.py and inspect _score_frames_async and _score_video_audio_async; compare with AudioTranscriptHelper._transcribe_audio_async, which already uses asyncio.to_thread. Check the scorer tests for coverage of frame and audio decoding. Done means OpenCV and PyAV decoding no longer block the event loop; linked pull request #3359 is already open.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
VideoTrueFalseScorer and VideoFloatScaleScorer decode video directly on the event loop. In pyrit/score/video_scorer.py, _score_frames_async calls _extract_frames (OpenCV) and _score_video_audio_async calls AudioTranscriptHelper.extract_audio_from_video (PyAV) without asyncio.to_thread. While a video is decoded, every other attack, scorer and target request on the loop is frozen.
The style guide says cv2 and av calls must go through asyncio.to_thread, and AudioTranscriptHelper._transcribe_audio_async already does this.
Steps to Reproduce
Score a 1080p, 300-frame video with VideoTrueFalseScorer(num_sampled_frames=10) while a coroutine ticks every 10 ms with asyncio.sleep(0.01), and record the longest gap between ticks.
Expected Results
Ticks keep arriving about every 10 ms.
Actual Results
The longest gap is about 2.4 s. With the decodes moved to asyncio.to_thread, it drops to about 150 ms.
Versions
Linux, Python 3.13.16, PyRIT 1.2.0.dev0 from main (a799842b)
- 主要语言
- Python
- 星标
- 4.6k
- 派生
- 962
- 平均合并
- 2 天 15 小时
- 30 天内合并 PR
- 398
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/PyRIT 的其他 Issue
-
BUG: Overlapping scorer-evaluation globs duplicate CSVs and change accuracy可能已有人在做 @its-amann 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/PyRIT#3430 · 1 条评论 ·
维护者通常 2 天内回复
-
BUG: MarkdownInjectionScorer misses shortcut-reference images with path-based exfiltration, and raw HTML <img>可能已有人在做 @aatif101 于 2 天前认领。 未关闭Bug: triage
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/PyRIT#3343 · 2 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
BUG: OpenAITTSTarget accepts any speed, so an out-of-range value is only sent to the API on every request可能已有人在做 @ShivamSharma43 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 25/100
维护者通常 2 天内回复
-
BUG: KeywordSelectionStrategy accepts a negative context, so SelectiveTextConverter duplicates or truncates the prompt可能已有人在做 @ShivamSharma43 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
维护者通常 2 天内回复
-
BUG: PackageHallucinationScorer flags Rust std paths, type names and hyphenated crates as hallucinated可能已有人在做 @nniiovoo 今天认领。 未关闭
难度 3/5 1-2 天 新手友好度 35/100
维护者通常 2 天内回复
相似的 Issue
-
comp/tools P2 type/bug
难度 2/5 1-3 小时 新手友好度 78/100
NousResearch/hermes-agent#142908 · 1 条评论 ·
-
[oblt-aw][autodoc] Fix malformed headings in new Buildkite docs pages可能已有人在做 @github-actions 今天认领。 未关闭documentation
难度 1/5 1 小时以内 新手友好度 83/100
维护者通常 1 天内回复
-
[Bug]: fileUploadMatrix.test.ts URL case does a real DNS lookup and fails offline可能已有人在做 @r2jaff 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
ComposioHQ/composio#5054 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
pytorch/tensordict#3286 ·
维护者通常 1 天内回复