Repository navigation
Issue #1377: automatic export lanes follow the GPU's measured share - #1579
Merged
Merged
Conversation
Step 4 of the export plan. The CPU already decodes and encodes a photo outside its GPU turn, so photos overlap; what was fixed was how many: half the cores, up to 12. Now a batch with automatic lanes meters the GPU's busy time (lcc_gpu::hold_busy_meter, no reset of the bench's meter) over each stretch of twice the photos running, and runs one photo fewer while the GPU was busy 90 % of it or more (the extra photos only wait for it, each holding a decoded original) and one more while it was under 70 %, between 2 and the automatic count. Lanes set by hand (Test my machine, <PREFIX>_EXPORT_LANES) are unchanged; without a GPU every lane runs as before. Manual: platforms/performance.mdx, manual/agents-and-status.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011VFDrfcYF2xSBoosZAu8dw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Andrew · project thread
Part of #1377 (step 4). It's independent of #1561 and #1575.
Problem
The plan called for overlapping "CPU decode of photo N+1 with GPU render of photo N, with lane counts sized from the measured split instead of a fixed 8". The overlap is already there: a photo decodes before its GPU turn and encodes after it (
render_pair), so lanes side by side keep both busy. The lane count, though, is fixed at half the cores (up to 12) whatever the work. When the GPU is the bottleneck, the extra lanes just wait for their turn, each holding a decoded original: 45 MP of float RGB is 540 MB. blwfish measured 4 lanes against 8 on his M4 Max at 2048 px: 5 % slower, but 40 % less peak memory.Change
lcc_gpu::busy::hold(exposed aslcc_gpu::hold_busy_meter/busy_time, which do nothing in the browser) meters the GPU's busy time without resetting the total, so a batch can read the differences while the bench's own meter keeps working.export::Queuegains aSplit. With automatic lanes it meters the GPU over each stretch of twice the running photos, then sizes the lanes from the result (next_lane_limit):<PREFIX>_EXPORT_LANES) are used as given;<PREFIX>_PROFILE=1, each change is logged.Not in this PR: raising lanes above the automatic count. The memory gate still caps them, and CPU-bound batches gain nothing from more (blwfish's 4-against-8 run).
How it was checked
cargo xtask ci --quick: all 16 steps pass.lanes_follow_the_gpus_share_of_the_workchecks the rule: down to 2 while saturated, back up to the automatic count while starved, unchanged in between, all lanes without a GPU, a NaN reading changes nothing, and 1 lane stays 1.export::tests pass (128).<PREFIX>_EXPORT_LANES=8.Merging
unsafe, build scripts, network access, spawned processes, deleted files, CI orxtaskgate changes: none.Manual: platforms/performance.mdx, manual/agents-and-status.md. Release notes:
docs/whats-new/anddocs/changelog/unreleased/entries.Generated by Claude Code