Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

BUG: Video scorers block the event loop while decoding frames and audio

Đang mở
#3,358 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@Shizoqua đang làm issue này rồi.

Từ ngày 20/10/2026.

  • #3359 của @Shizoqua — đang mở

Đá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

Mở trong Codespaces

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/PyRIT

Tất cả issue của microsoft/PyRIT

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.