You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Read cached thumbnails independently of generation - #120
A ready disk-cache PNG currently waits behind running video/PDF/image generation in the provider's one pool. Probe cache entries in a separate two-worker pool; send misses to the existing generation pool, where freshness/cache is checked again. Text pages go straight to their existing generation route.
No disk access moves to the UI thread, no RAM cache or dependency is added, and generation concurrency remains unchanged. A missing PNG is detected before querying source metadata, avoiding an extra network-source lookup on ordinary cold misses. Cache freshness uses the existing policy.
A response is separate from runnable tasks. Cancellation is checked around the cache stage and before queued generation; destruction drains cache work before generation because cache misses may still enqueue jobs. Every response finishes once. This does not import #117's running-helper cancellation.
Evidence
Before: with real generators held in every slot, an existing disk PNG cannot make a QML Image ready before the gate opens. After: it becomes Ready while generators are still held. The test observes persistent QML state, not a racy finished-signal subscription.
Eight alternating pairs per direct-provider scenario after warm-up: busy-cache response median 507.9 → 0.57 ms, p95 508.5 → 0.59 ms. This deliberately holds generators for 500 ms; these are response completion times, not displayed-frame latency.
Eight 12 MP synthetic JPEGs (baseline/progressive mix), cold thumbnail cache: all responses 210.7 → 209.8 ms median. Idle warm-cache batch: 1.33 → 2.33 ms, reflecting the two-reader bound; first response stays about 0.7 ms. Warm OS page cache throughout.
Real Backend/FolderGrid, three pairs each: all eight pictures 227.0 → 227.6 ms, jump to the last of 512 entries 353.3 → 350.2 ms, navigation during generation 43.20 → 43.26 ms. All 18 measured runs complete and drain without failure markers. Offscreen Qt Quick software rendering; physical frame latency was not measured.
Release build, diff check and complete local tests: 198 passed, 0 failed, using Qt image plugins matching CI dependencies. Tests cover stale/corrupt/missing cache, removed source, cache recursion and 64 cancelled queued misses.
ASan/UBSan with rapid real QML creation/cancellation: candidate 2378 and base 2377 requests all finished and were destroyed while the reader remained alive; no sanitizer errors (leak detection disabled). Immediate engine destruction instead leaves a few responses undestroyed on both versions; that boundary remains recorded and is not fixed here.
Merge Danger
Door: two-way.
Blast Radius: thumbnail admission. Two additional bounded workers can themselves wait on slow cache/source I/O; the existing generation limit is preserved. Pending #67/#117 changes will need the usual rebase and validation before integrating on their final base. This PR targets main independently; #67/#117 are not base dependencies.
[Medium impact] The PR appears safe to merge; no blocking issues were found.
Summary
Cached thumbnails can now finish while thumbnail generation is busy, without changing the generation limit.
Cached thumbnails can finish while generation workers are busy.
No actionable issues found. git diff --check passed; tests were not run during this review.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Thumbnail request] --> B{Text page or sharp image?}
B -->|Yes| G[Existing generation pool]
B -->|No| C[Two-worker cache pool]
C --> D{Cancelled or fresh cache hit?}
D -->|Yes| F[Finish response]
D -->|No| G
G --> E[Check cancellation and cache before generation]
E --> F
Thanks, Kirill. I've rebased this onto main and pushed it to your branch. Two things on main needed fitting in. First, the response's run() is now wrapped in a try/catch so a throwing decoder can't take Folio down (#173). That stays as it was: work() ends in your complete(), and it's marked as told first. Second, the details' new sharp/ requests (#155) have their own cache and id layout, so they now go straight to the generation pool, the same as page/, rather than through cached(), which would misread their ids. thumbnailsCachedImagesDoNotWaitForGenerators still fails when everything goes through one pool and passes with the cache lane. The whole suite passes locally (234 tests).
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
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.
Summary
A ready disk-cache PNG currently waits behind running video/PDF/image generation in the provider's one pool. Probe cache entries in a separate two-worker pool; send misses to the existing generation pool, where freshness/cache is checked again. Text pages go straight to their existing generation route.
No disk access moves to the UI thread, no RAM cache or dependency is added, and generation concurrency remains unchanged. A missing PNG is detected before querying source metadata, avoiding an extra network-source lookup on ordinary cold misses. Cache freshness uses the existing policy.
A response is separate from runnable tasks. Cancellation is checked around the cache stage and before queued generation; destruction drains cache work before generation because cache misses may still enqueue jobs. Every response finishes once. This does not import #117's running-helper cancellation.
Evidence
Merge Danger
Door: two-way.
Blast Radius: thumbnail admission. Two additional bounded workers can themselves wait on slow cache/source I/O; the existing generation limit is preserved. Pending #67/#117 changes will need the usual rebase and validation before integrating on their final base. This PR targets
mainindependently; #67/#117 are not base dependencies.