Skip to content

Add failing tests for uncapped camera-motion frame buffers - #803

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/uncapped-frame-buffer-tests-3e90
Closed

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/uncapped-frame-buffer-tests-3e90

Conversation

@cursor

@cursor cursor Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Summary

Adds tests that require camera-motion streaming, camera-motion measurement, raw RGB sampling, and the opt-in camera_stability check to refuse a video whose probed frame is larger than VideoLimits.maximum_frame_pixels before reading a raw frame of that size.

These tests fail on purpose until that budget is enforced. No production code is changed here.

Why

probe_video and the video importer already reject width * height above that budget. The raw-frame reader used by camera motion multiplies the dimensions ffprobe reports into a byte count and reads that many bytes for every frame. A container header that names an oversized frame is enough; the payload does not have to contain those pixels. The same reader is what camera_stability reaches after it remuxes an episode's H.264.

Validation

The refusal tests fail on this branch. The two in-budget controls pass.

uv run pytest tests/test_uncapped_frame_buffers.py -q --tb=line

Result: 11 failed, 2 passed. The failures are RawFrameError not raised, or raised only as a truncated-frame / missing-timestamp error after the oversized read. test_raw_frame_stream_refuses_a_read_larger_than_the_pixel_budget reports a read of 33570816 bytes from a 160x120 file.

uv run ruff check tests/test_uncapped_frame_buffers.py
uv run ruff format --check tests/test_uncapped_frame_buffers.py
uv run ty check tests/test_uncapped_frame_buffers.py

Checklist

  • I added or updated outcome-focused tests for changed business logic.
  • I updated documentation for changed behavior, flags, formats, or requirements.
  • I ran uv run ruff check --fix, uv run ruff format, and uv run ty check.
  • I ran the relevant pytest suite.
  • I did not add recordings, generated media, credentials, private URLs, or runtime artifacts.
  • I preserved stored-data compatibility or documented an explicit version change.
Open in Web Open in Cursor 

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Camera-motion streaming, camera-motion measurement, RGB sampling, and the opt-in stability check trust ffprobe dimensions and read a raw frame of that size. These tests require the same pixel budget as video probe, and they fail until a frame over that budget is refused before the read.
@cursor cursor Bot mentioned this pull request Nov 20, 2026
6 tasks done
@kstonekuan

Copy link
Copy Markdown
Contributor

Tracking the fix and regression coverage in #807.

@kstonekuan kstonekuan closed this Nov 20, 2026
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.

2 participants