Agent: bound video GPU work (early-exit frame loop at max_regions) #172

Merged
bvandeusen merged 1 commits from dev into main 2026-06-30 22:57:33 -04:00
Owner

Follow-up to #171. Image 81602 turned out to be a 156 MB mp4, not a huge still (confirmed via /api/gallery/image/81602). The agent samples up to 64 frames × ~32 regions/frame → ~2000 regions (the 413) and 64 frames of detect+CCIP+embed (the 38s). The MAX_REGIONS backstop only truncated the submit — the GPU work was already spent.

Now the frame loop breaks once accumulated regions reach max_regions, so a long video costs ~a few frames of GPU (~2–3s) instead of all 64 (~38s). The whole-image embed task is unaffected (it mean-pools all frames and returns before this loop).

Agent-only; full CI green on dev.

🤖 Generated with Claude Code

Follow-up to #171. Image 81602 turned out to be a **156 MB mp4**, not a huge still (confirmed via `/api/gallery/image/81602`). The agent samples up to 64 frames × ~32 regions/frame → ~2000 regions (the 413) and 64 frames of detect+CCIP+embed (the 38s). The `MAX_REGIONS` backstop only truncated the *submit* — the GPU work was already spent. Now the frame loop **breaks once accumulated regions reach `max_regions`**, so a long video costs ~a few frames of GPU (~2–3s) instead of all 64 (~38s). The whole-image `embed` task is unaffected (it mean-pools all frames and returns before this loop). Agent-only; full CI green on dev. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bvandeusen added 1 commit 2026-06-30 22:57:27 -04:00
fix(agent): bound video GPU work — early-exit the frame loop at max_regions
CI / lint (push) Successful in 3s
CI / frontend-build (push) Successful in 19s
CI / backend-lint-and-test (push) Successful in 26s
CI / integration (push) Successful in 3m23s
83f1070a11
Image 81602 turned out to be a 156 MB mp4, not a huge still: the agent samples
up to 64 frames × ~32 regions/frame → ~2000 regions (the 413) and 64 frames of
detect+CCIP+embed (the 38s). The MAX_REGIONS backstop (#171) only truncated the
SUBMIT — the GPU work was already spent. Break out of the frame loop once
accumulated regions reach max_regions, so a long video costs ~a few frames of
GPU (~2-3s), not all 64 (~38s). The whole-image 'embed' task is unaffected (it
mean-pools all frames and returns before this loop).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ttrj5P7upUTueSfoJcxEqa
bvandeusen merged commit 216b7fc743 into main 2026-06-30 22:57:33 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledCurator#172