![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Corrected against fa8e8b86fa on 2026-09-29. The audit before that found 2 claim(s) in this file wrong of the tree and 9 stale. One was load-bearing and wrong: iop/lens.c DID read pixel state off the virtual pipe, which is why lens jumped the tranche queue. Re-measure before acting on a claim older than the code you are changing, and re-date this line when you do.
Written while fixing #1157, whose root cause is entangled with the virtual pipe's cost.
Status: superseded by what was actually built. The maintainer picked option C, and doc/geometry-service.md is the canonical record of it: the virtual pipe no longer exists, and the GUI composes sizes and coordinates from published per-module records. This file is kept for the measurements and the consumer audit that produced that decision — everything below describes the tree as it was, in the present tense it was written in.
dev->virtual_pipe was a full clone of the module stack — every one of the ~95 IOPs gets a node, params committed from history — that never processes a pixel. It exists so the GUI thread can answer two questions synchronously, without waiting for a worker pipe:
Measured on a darkroom open of a 6016×4016 NEF (-d perf, isolated configdir):
Nobody reads pixel state from the virtual pipe. One module did, and it is the reason that audit needed re-running. At 31db6ca28a, iop/lens.cc:2547-2549 fetched its own piece off self->dev->virtual_pipe and read the committed dt_iop_lensfun_data_t blob out of it — not dimensions, not a transform, the module's own commit-time data. The premise was right for every other module and wrong for that one, which is what made lens the tranche that jumped the queue (doc/geometry-service.md, G4). It no longer does: _lens_corrections_available() (iop/lens.c:3612-3640) builds its own blob and asks only for dimensions.
iop/colorout.c encoded the intended shape as a per-module early-out: on the virtual pipe it committed d->type = DT_COLORSPACE_LAB and returned before building any LCMS transform. That early-out went with the virtual pipe itself at G16.
The throttled history drain runs, on the GUI thread: shutdown → history write → pipe flags → virtual resync (0.1–0.3 s) → publish of the matching ROI request. Everything between the history write and the publish is a window in which the worker can sync the new history while still holding a latch on the old geometry. The fix for #1157 (publish re-arms the pipes; the worker re-checks its latch) makes a mixed frame transient instead of terminal — but the window itself IS the virtual resync's duration. Shrink or remove it and the residual one-frame flash goes with it.
Apply the colorout pattern to the measured offenders: commit_params early-outs on pipe == dev->virtual_pipe for colorequal, colorprimaries, lut3d (and any module a -d perf pass shows building derived pixel state). Each early-out must still commit the fields its own output_format()/contract logic reads — that is why this is per-module and audited, not a blanket skip: a blanket "skip commit_params for non-geometry modules" leaves piece->data zeroed, and dt_dev_pixelpipe_propagate_formats() then reads garbage contracts and can disable different modules on the virtual pipe than on the real ones — silent geometry divergence.
Expected: steady-state virtual resync 0.10–0.20 s → **~0.03–0.05 s**. The #1157 residual window shrinks proportionally. No consumer can notice: none reads what is skipped.
The worker already computes the processed size at the end of every resync (dt_dev_pixelpipe_get_roi_out at the tail of dt_dev_pixelpipe_change()); the virtual pipe recomputes the same number on the GUI thread so it is available immediately. Invert the authority:
Cost: the fit scale for a geometry commit is derived one worker-resync later (~0.15 s). With the #1157 flags this is invisible — the worker re-plans as soon as the publish lands, which is exactly what happens today anyway for the pixels; only the number arrives with them instead of before them. Risk: every consumer of "processed size" must tolerate reading a value one commit older than dev->history for that window — the audit of those consumers is the real work of this tranche.
Transforms as data: each of the 15 geometry modules publishes, at commit time, a serialized transform (crop rect, homography, lens polynomial, …) into a per-image list; the GUI composes transforms and sizes from the list with no pipe, no pieces, no nodes. Kills the virtual pipe entirely and makes overlay math backend-independent — the shape a Qt frontend wants. This is a refactor of all 15 modules plus the mask/overlay call sites; not a bug-fix-adjacent change.
A now (three audited early-outs, verifiable from one -d perf run), B as its own tranche with the consumer audit, C when the frontend split gets there. A and B compose: A makes the remaining GUI-thread resync cheap for the transforms that stay, B removes it from the sizing path where it does the #1157-class damage.