Skip to content

Add memory-safe selectable proxy resolution - #30

Merged
D-Mad merged 2 commits into
mainfrom
agent/pr24-review
Jul 15, 2026
Merged

Add memory-safe selectable proxy resolution#30
D-Mad merged 2 commits into
mainfrom
agent/pr24-review

Conversation

@D-Mad

@D-Mad D-Mad commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • rebase Eric Levy's selectable Full/2K/1080p/720p proxy feature from Add user-selectable proxy resolution #24 onto current main with playback-speed support
  • keep movie, EXR decode, memory cache and disk-preview cache on the same proxy level
  • reload the current source at the same review frame when the level changes
  • bypass lossy JPEG preview caches in Full Resolution inspection mode
  • size sequence cache depth from a 512 MiB decoded-frame budget so Full 4K/8K cannot retain dozens of huge frames

Review fixes

The original Full mode still read/wrote persistent JPEG previews, which could hide grain/detail, and it allowed Full 8K to retain the same 48-frame cache depth as 2K, potentially consuming several GiB. This replacement keeps Full lossless and memory-bounded.

Original feature authored by @emlcpfx in #24.

Validation

  • proxy module passed (16 tests)
  • full pytest -q passed
  • git diff --check

Replaces #24.

emlcpfx and others added 2 commits July 15, 2026 11:11
Playback > Proxy Resolution picks Full / 2K / 1080p / 720p. The proxy level
was fixed at 2K; the right answer depends on the machine and the job. A
supervisor on a laptop wants 720p to hold real time on an 8K plate, while
someone checking grain or edge detail needs the full frame and will accept
slower playback.

playback/proxy.py owns the level and the resolution maths. The level is
process-wide rather than a constructor argument because the readers, the frame
cache and the on-disk preview cache all have to agree on it, and they are built
in different places.

- The preview-cache key already carried the proxy dimensions, so it now carries
  the level token instead. Every level has a distinct token, which is what stops
  a frame cached at 720p being served back to a viewer asking for 2K. There is a
  test that fails if two levels ever collide.
- The movie path still rounds to even dimensions: yuv420 subsamples chroma by
  two, so an odd proxy size is not representable. The sequence path does not
  need that constraint.
- Sequence cache depth follows the proxy size, since bigger review frames mean
  fewer of them fit in the same memory budget.
- Changing level reloads the current source at the frame the reviewer is sitting
  on. The open reader and both caches hold frames at the old size, so the level
  cannot be swapped under a running player.

Full resolution disables the proxy entirely rather than scaling by 1.0, so the
EXR mip-level shortcut is skipped too.

14 tests. Verified against a real decoded 3840x2160 clip: it lands at 2048x1152
at 2K, 1280x720 at 720p, and 3840x2160 at Full.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TexnzYbmCjjTDB8zzZuUPb
@D-Mad
D-Mad marked this pull request as ready for review July 15, 2026 04:14
@D-Mad
D-Mad merged commit 23946dc into main Jul 15, 2026
3 checks passed
@D-Mad
D-Mad deleted the agent/pr24-review branch July 15, 2026 04:14
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