BUG: Video scorers block the event loop while decoding frames and audio
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- opencv, python
- Lĩnh vực
- backend, performance
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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)
- Ngôn ngữ chính
- Python
- Star
- 4.6k
- Fork
- 962
- Merge trung bình
- 2 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 398
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/PyRIT
-
BUG: MarkdownInjectionScorer misses shortcut-reference images with path-based exfiltration, and raw HTML <img>Có thể đã có người làm @aatif101 đã nhận 1 ngày trước. Đang mởBug: triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
microsoft/PyRIT#3343 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG: UrlConverter preserves forward slashes by default, preventing path payload evasionCó thể đã có người làm @Kaap10 đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG: XSSOutputScorer misses SVG and JavaScript data URIsCó thể đã có người làm @Kaap10 đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG: FuzzerGenerator accepts a jailbreak goal below 1 and a success threshold outside [0, 1]Có thể đã có người làm @ShivamSharma43 đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG: ManyShotJailbreakAttack accepts a negative example_count and drops examples from the endCó thể đã có người làm @ShivamSharma43 đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của microsoft/PyRIT
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
pgvector/pgvector-python#169 ·
-
ChaosEngine: backup-remote doctor row passes while consumer mode hides bot memory from gitCó thể đã có người làm @MohabMohie đã nhận hôm nay. Đang mởagentic
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ShaftHQ/SHAFT_ENGINE#7263 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
huggingface/smolagents#3045 ·
Maintainer thường phản hồi trong vòng 1 ngày