feat: jobs run one at a time, parallelism per photo and a priority queue
Owner review 1, phase 2 (docs/requests/2026-10-15-owner-review-1.md, R2). Jobs now run one at a time on the desktop and on the server. Parallelism (Settings > Rendering, TITANO_PARALLELISM) is how many photos the running job processes at once: thumbnail and proxy passes draw that many photos together and still write the pack and checkpoints in frame order, decode tiers are probed that many at a time, the deep analysis measures that many frames and a render decodes that many ahead. Wherever originals are developed whole (TIFF, PNG, RAW without a usable preview), fewer run at once within the memory budget, which the running job now has whole; the server's frame window is sized to the host instead of 1 GiB. A new job waits its turn and pausing the running job starts the next one. An optional priority queue gives each job kind a level (renders, imports and downloads high, verifies and proxies low by default): a queued job of a higher level pauses the running one without asking, and that job goes back to the queue with its checkpoint and resumes by itself afterwards. Jobs of the same level, and a job's own follow-ups, never interrupt it. The Jobs screen and the admin panel show the parallelism and the queue; Settings > Rendering and the admin panel's Settings set them, at once. TITANO_WORKERS and the Workers key of server.json still set the parallelism (1 to 64, with a warning at start for the variable). Titano.Tools gains i18n prune, which removed the renamed keys from the 36 machine-translated languages; the new strings are translated in all 38. Found while testing: uploads and imports failed when a pass read the sidecar while they wrote it (atomic writes now retry the rename while a reader holds the file, and never for a read-only one), and taking a lease just released while another process read it failed on Windows (the create now waits for the reader). Five adversarial review rounds checked the phase before this commit. Also updates BRIEF (12.8, 14.6, 14.8, 14.9, 24), DECISIONS, CHANGELOG, ARCHITECTURE, STATUS, the request file and the compose/Unraid templates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
34d03051f5
commit
43b6871cdc
228 files changed
+3535
-793
No files matched your search
@@ -402,3 +402,12 @@ One line per decision: date · decision · alternative · reason.
|
||||
| 2026-10-16 | WIC decodes a camera RAW only when the decoder it chose is the Raw Image Extension (CLSID read per file), never a DNG, and never for a request that prefers the embedded preview. Refines 2026-10-02 'Camera RAW is "native" via WIC only when the Raw Image Extension package is installed.' (Owner review 1, R4.) | Trust `CodecInventory` per format; force the Raw Image Extension by CLSID for DNG | With the extension installed, WIC still picks Windows' in-box "DNG Decoder" for every DNG with a JPEG preview; it reads only that 8-bit preview, which the provider labelled native (a smaller preview was a silent downscale). The Raw Image Extension develops DNG to 8 bits and fails on Lightroom's lossy LinearRaw DNGs; the managed decoder develops all of the owner's files at 16 bits. |
|
||||
| 2026-10-16 | A DNG is GPR only when its raw image is VC-5 (Compression 9) or its extension is .gpr; Make=GoPro alone no longer counts. Frames stored as GPR whose file is not a .gpr are probed again by the next light analysis, which the scan follow-up queues for their sequences, and the format the probe finds replaces the stored one in the sidecar and in `frames.format`. (Owner review 1, R4.) | A migration that rewrites every sidecar; leave existing frames as indexed | The owner's 84,400 GoPro DNGs were converted by Lightroom or DNG Converter (lossy LinearRaw, lossless CFA), which the managed DNG decoder develops, but every one was indexed GPR and preview-only. A light analysis reads only metadata and already probes tiers under the sequence lease. |
|
||||
| 2026-10-16 | Decode policy, the owner's choice: analyses, thumbnails, proxies and the editor's preview set `DecodeRequest.PreferPreview`, so a RAW gives an embedded preview whose long edge reaches the requested size when it has one and is developed otherwise; renders never set it and develop natively at 16 bits. Such a result is `DecodedImage.ByChoice` and is never recorded as the frame's tier. (Owner review 1, R4.) | Native development everywhere; the preview everywhere | Developing one of the owner's 12 MP DNGs takes 0.8–2.6 s against about 0.1 s for its preview: an analysis of the 84,400 frames would take about 18 hours instead of about 2. Exposure measured on a preview is tone-mapped by the converter, so deflicker corrections computed on it only approximate those of the native pixels the render corrects; the owner chose speed for analysis and quality for videos. |
|
||||
| 2026-10-16 | Jobs run one at a time (owner review 1, R2): the engine has one worker by default (`JobEngineOptions.Workers` stays for tests of concurrent claims) and `SetWorkers` is gone. The parallelism reaches the work through the hosts' options, asked at the start of each sequence or job: `ArchiveServiceOptions.Parallelism` (thumbnail and proxy passes, tier probes) and `ProcessingOptions.WithParallelism` (deep analysis threads, render read-ahead and decodes). The running job has the whole memory budget. Refines 2026-10-12 'Settings › Rendering › Parallelism Auto is the job engine's default'. | Keep N workers with per-job caps; a `JobContext.Parallelism` passed through every handler and service | The owner's answer. The hosts already tune both option sets per job, render nodes reuse the desktop tuning, and no handler signature changes. |
|
||||
| 2026-10-16 | The priority queue gives each job kind a level (high, normal, low), off by default: claim order level → priority → age; a queued job of a higher level that the engine would claim makes the running job of the lowest level yield without asking (cancelled, its checkpoint and a log line saved, then `JobRepository.RequeueAsync` back to Queued unless the user paused or cancelled it meanwhile); it resumes by itself when nothing above it waits. Reviewed at every `Wake` (enqueue, resume, settings saved) and every poll (3 s). Jobs of the same level never interrupt each other, a job's own follow-ups never interrupt it, and only a full engine interrupts. Defaults: render, import and download high; verify and proxies low. | An ordered list of all kinds; asking before pausing | The owner: set priorities so that a render started during a scan pauses the scan without confirmation and the scan resumes afterwards. A total order would make every pair of kinds interrupt each other (each periodic scan would pause hours of deep analysis); follow-ups work on what their parent produces. |
|
||||
| 2026-10-16 | Thumbnail and proxy passes work on several photos at once through `OrderedWork`: up to the parallelism run on the thread pool (twice as many results wait) and their results come back in frame order on the pass's flow, so the pack writer, the counters and the checkpoints stay sequential and a checkpoint still means every frame before it is done; a parallelism of one runs inline. Decodes that develop originals whole run fewer at once for large originals (`DecodeBudget.PhotosAtOnce`): memory budget ÷ (largest frame × 32 bytes per pixel), 24 MP when no size is known, a size a damaged file claims saturating instead of overflowing. Proxy passes always count; thumbnail passes, deep analyses and every window of a render or its preparation count only the frames a decode at their size develops whole (`DecodeBudget.Developed`, `SequenceFrames.DevelopedPixels`): not a JPEG at least twice the size asked for (it decodes scaled down), not a frame read through its proxy or from a JPEG file, not a RAW's embedded preview of that size when previews are preferred (never in a render; another format's stored preview, such as a JPEG-compressed TIFF strip, may need the file's own tables and fall back to a full decode); a TIFF, a PNG or a developed RAW counts whole, so a render node's originals and a preparation over TIFFs are held back too. A frame window that develops originals gates every decode with that limit, read-ahead and demand loads alike (the window itself caps only its read-ahead). The server's frame window gets the host's memory budget (a quarter of the memory available, as the desktop's Auto) instead of the window's 1 GiB default. Tier probes run that many at a time (`Parallel.ForEachAsync`). | `Parallel.ForEach` with a lock around the pack; a byte semaphore per frame | Output identical to a pass of one photo at a time (tested byte for byte). The frames of a sequence share one size, so a limit per sequence is as good as a gate per frame. |
|
||||
| 2026-10-16 | Verify, import and scan stay sequential inside their job. | Hash, copy or read metadata in parallel | They are bound by one disk or one card reader, where parallel reads are slower; the verify log keeps its order. |
|
||||
| 2026-10-16 | Server: `TITANO_PARALLELISM` replaces `TITANO_WORKERS`, which still sets it (TITANO_PARALLELISM wins when both are set) and logs a warning at start; the `Workers` key of `server.json` still sets the parallelism and saving the setting removes it. `TITANO_PRIORITY_QUEUE` sets the queue on or off. The parallelism is 1 to 64 (the admin panel's range); a larger value from the environment or `server.json`, or the default on a machine with more than 128 threads, is brought down to 64, so a value the panel cannot change never blocks saving the others. Both apply at once (no restart), `server.json` keeps only the levels that differ from the defaults, and the admin panel lists the 14 kinds a server runs. `ServerSettingsDto` and `DashboardDto` replace `Workers` with `Parallelism` and add the priority queue. | Keep the name Workers; require a restart | The meaning changed (jobs at once → photos at once) and an older value keeps working. The admin panel ships with the server, so the DTO rename breaks no client. |
|
||||
| 2026-10-16 | `Titano.Tools i18n prune` removes orphan keys (not in English and not a plural form of an English plural key) from every translation, rewriting only the files that had some, as `import` writes them. | Hand edits; regex | A renamed or removed key otherwise stays an orphan in 36 languages, and resx files are never mass-edited with regular expressions. |
|
||||
| 2026-10-16 | Desktop: the Jobs toolbar shows "8 photos at once" (Settings › Rendering › Parallelism) and a Priority queue chip while the queue is on, instead of "Workers n / m"; Settings › Rendering lists the 16 job kinds with a level dropdown only while the queue is on; the Jobs list orders the queue with the engine's `JobPriorityQueue.ClaimsBefore`. The Jobs, Settings and Admin mockups follow in phase 6 with the rest of the review. | Keep the workers readout | One job runs at a time, so a count of busy workers says nothing. |
|
||||
| 2026-10-16 | `AtomicFile` tries the rename over the target again for some 1 s (15 attempts, 10 ms × n) while another handle holds it: a sharing or lock violation, or Windows' "access denied" for an open file that is neither read-only nor a folder (those, like a missing file, fail at once). Sidecars, ingest journals, index snapshots and `project.json` are read whole and at once with `AtomicFile.ReadAllBytes`/`ReadAllText` (sharing read and delete, never a writer in place; above 2 GB an `IOException`, as `File.ReadAllBytes`). Windows refuses `MoveFileEx` over an open file even when the reader shares deletion. | Rename with POSIX semantics (`SetFileInformationByHandle`, Windows interop in Core); take the sequence lease for every sidecar read | Readers hold these files for milliseconds; a lease per read would queue thumbnail passes behind uploads, and Core stays free of Windows interop. Found when the faster passes of phase 2 made an upload's commit fail in the server tests. |
|
||||
| 2026-10-16 | `LeaseFile.TryCreate` treats "access denied" on creating a lease as the name of a lease just released while a reader still holds it (pending deletion on Windows, since readers share deletion) and tries again for some 130 ms (8 attempts, 1 ms doubling), as it already did for the create-or-check race. | Return "held" at once; stop sharing deletion in readers | Returning "held" makes the caller wait its whole poll back-off for a name free milliseconds later, and readers must never block a release or a takeover. A real permission problem still fails after the short retry. Found when the phase 2 test runs hit it in `MassRenameTests` under load. |
|
||||
Reference in new issue
Block a user