Skip to content

Issue #1898: the photo on screen and the user's own work first, background scans on spare capacity - #1932

Merged
emmertex merged 1 commit into
emmertex:stagingfrom
RAD-Films:pr/sched-rank
Dec 5, 2026
Merged

emmertex merged 1 commit into
emmertex:stagingfrom
RAD-Films:pr/sched-rank

Conversation

@OneSlips

@OneSlips OneSlips commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1898

What changed

One ranked order for the machine (crate::sched):

  • The face scan, photo indexing and the focus-point reader pause while an export, an import or another batch the user started runs, while a requested preview build runs, and while the photo on screen is being made. They pick up again on spare capacity. The user's own pause switches for faces and indexing work as before.
  • Every batch of an import gets its previews. A batch that arrives while the previous batch's build runs now waits for it; before, it was dropped with "a preview build is already running" (16 of 261 photos built in one import). The build makes its jobs a frame at a time, starting from the photo the user is on.
  • Requested preview builds wait while an export runs, and give the photo on screen up to 0.6 s before each photo.
  • A file that moves (Rename Photos, a move, a relink, or their undo) remakes the running build's jobs with the new path. Before, a build queued before a rename failed 84 photos with "cannot find the file".
  • Manual: platforms/performance (Who goes first). docs/background-tasks.md gains a "Who goes first" section. What's new and changelog entries are in the commit.

How it was checked

60 Canon R5 C CR3s from a real wedding, imported and exported with a preset that has a Subject mask (JPEG q90 sRGB, long edge 6000), on a 32-thread Windows PC with an RTX 5070 and an RTX 4070 SUPER. Release builds of staging and of this branch, same data, one run each, with no other Chromaforge app running during the export.

staging this PR
Export time 1290 s 992 s (23 % less)
Photos a minute 2.8 3.6
Photos out after 300 s / 600 s 1 / 10 6 / 24
Subject model runs during export 99 79
Slow frames (500 ms or more) during export 0 0
UI samples over 50 ms during export 99 of 4646 70 of 3726
All previews built after import 164 s 144 s
Machine CPU while idle after import 53 % 31 %

New tests in crates/engine/src/sched.rs cover the pause rules (export, import, requested preview build, photo indexing), and crates/engine/src/tests_sched.rs covers the queued import batch and the job rebuild after a rename. cargo xtask ci --quick --base origin/staging: all 15 check steps pass (fmt, clippy, docs, parity, layers, assets, wasm and the rest). In the test step, the lcc-engine integration tests pass, and the engine library tests pass except tests_face_recognize::a_trained_person_and_an_untrained_one_are_scored_the_same_way, which fails the same way on staging (5df5a81).

Notes

  • Three staging-only background scans (source colour, ML orientation and quality) are not paced yet. They can move onto the same spare_pace in a follow-up.

🤖 Generated with Claude Code

…round scans on spare capacity

One ranked order for the machine (crate::sched):
- The face scan, photo indexing and the focus-point reader pause while an
  export, import or other batch of the user's runs, while a requested preview
  build runs, and while the photo on screen is being made (spare_pace on their
  per-frame pumps). The user's own pause switches for faces and indexing stay
  as they are.
- Every batch of an import gets its previews. A batch that arrives while the
  previous batch's build runs waits for it; before, it was dropped ("a preview
  build is already running": 16 of 261 photos built). The build's jobs are made
  a frame at a time, starting from the photo the user is on.
- Requested preview builds wait while an export runs, and give the photo on
  screen up to 0.6 s before each photo.
- A file that moves (Rename Photos, a move, a relink, their undo) remakes the
  running build's jobs for it with the new path. A build queued before a
  rename failed 84 photos with "cannot find the file".

Fixes emmertex#1898.

Manual: platforms/performance (Who goes first).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@emmertex
emmertex merged commit b86fd52 into emmertex:staging Dec 5, 2026
3 checks passed
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.

Background scans run at full speed during an export and while a photo is on screen

2 participants