7247 Commits

Author SHA1 Message Date
skylar 93ea73cde7 Revert "Run the draft's Ubuntu gate once on the 16-core runner"
This reverts commit 894426b6c7.
2026-12-02 19:01:11 +01:00
skylar 894426b6c7 Run the draft's Ubuntu gate once on the 16-core runner
Temporary diagnostic for one run: does the gate complete on a 16-core/64 GB
runner? Revert before any further run or landing.
2026-12-02 16:47:18 +01:00
skylartaylor 614bc44735 Port the per-photo denoise method picker to the SDK 2026-12-02 15:54:52 +01:00
skylartaylor 4d37d23b3c Refresh LightCraft UI port on current main 2026-12-02 15:36:56 +01:00
skylar taylor-barrick e3e76fd0f0 Wait for the GPU warm-up before a test or headless process ends (#620) (#4697)
* LR-BEHAV-GPU: no GPU warm-up is still loading the driver when a test or headless process ends (issue #620)

The first frame starts the GPU device warm-up on a thread of its own. A process
that ended a few milliseconds later, as every test does under nextest, could
exit while that thread was inside the Vulkan loader's dlopen of the driver,
running libLLVM's initializers: a SIGSEGV after the test had passed, or a hang.
Only the window's exit (LightcraftApp::shutdown) waited for GPU work.

warm_up now counts as in flight from the moment it is called, before its thread
exists, and wait_warm_up waits for it. Dropping a LightcraftApp waits for it,
bounded, unless shutdown already ran.

* LR-BEHAV-GPU: warm_up counts as in flight before it marks itself started (issue #620)

A second warm_up call racing the first could find it marked started and return
before the first had entered the gate, so a host dropping its app right after
that second call saw no warm-up in flight. The gate is now entered first, a
call that starts nothing drops its entry, and a closed gate starts nothing.

* LR-BEHAV-GPU: the app waits for the GPU warm-up when dropped on native builds only (issue #620)

The web build has no warm-up thread (warm_up and wait_warm_up do nothing there),
and the web host replaces the app's UI state by moving it out of the app, which
a Drop impl forbids (E0509 in the wasm check).

* LR-BEHAV-GPU: a deterministic test for the app's warm-up wait on drop (issue #620)

Fred's review of #4697: the first regression test could pass without
exercising the wait — ready() || !enabled() also holds when the warm-up
finished or never started, and no pending warm-up was ever established.

The gpu crate exposes doc-hidden test support, hold_warm_up_for_test(),
entering the same gate the real warm_up enters: a substitute warm-up the
caller holds. The test proves it is in flight (wait_warm_up(ZERO) is
false), builds an app that never ran a frame on another thread (the app
is not Send — its host-service callbacks are not — so it is built there),
and verifies with channel synchronization that dropping the app does not
return while the hold is kept, and returns once it is released. Without
the wait in Drop for LightcraftApp it fails at that assertion; with it,
it passes. No GPU, no device, no timing beyond a one-second observation
window whose proof is the release.

---------

Co-authored-by: skylartaylor <skylartaylor@users.noreply.github.com>
2026-12-02 08:34:26 -06:00
skylar taylor-barrick e944599ef4 Share one GPU device in the thumbnail tests (#4992)
* Share one GPU device in the thumbnail tests

gpu_drawn_fixture created a new wgpu instance, adapter and device for every
test. Its vkEnumeratePhysicalDevices unloads drivers that expose no device,
while another test thread's render calls vkSetDebugUtilsObjectNameEXT on the
process-wide device; Vulkan loaders before 1.4.345 then walk freed loader
state and crash with SIGSEGV (KhronosGroup/Vulkan-Loader#1863). The fixture
now reuses the render device (gpu::shared_device), or one process-wide device
that is never dropped.

render::thumbnail_tests looped 200 times (2 test threads): 31/200 SIGSEGV
before, 0/200 after.

* Keep the thumbnail tests' fallback device from racing the render device

gpu::shared_device returned None while the render device could still be
created later (GPU rendering turned off by another test through app.gpu, the
window's device pending), and gpu_drawn_fixture then created a Vulkan instance
of its own while another thread's render could create and use the render
device: the Vulkan-Loader#1863 race again. shared_device now creates the render
device whatever the preference, and waits while the window's device is being
adopted, so None means no render device can exist in this process any more
(switched off by the environment, creation failed, or the process is ending).
The fixture creates its own device only when the environment switches the GPU
off or creating the device failed: once the process is ending it skips the
test rather than create a device during teardown. The wait for the window's
device has a 60 s deadline and then panics, since returning None would let the
fixture race the window's device.

shared_device overrides the switch that keeps the GPU off (also after a launch
that crashed creating the device, #136), so the app must not have it: it now
exists only in the gpu crate's tests and with a new test-support feature, off
by default, which only dev-dependencies turn on (ui-egui's, and the gpu crate's
own for tests/shared_device.rs). The app's and the workspace's normal builds
don't have it.

The fixture's texture work runs inside error scopes, so an error in it fails
the test instead of stopping GPU rendering for every test in the process.

tests/shared_device.rs: with GPU rendering off and the window's device pending,
shared_device waits for the adoption and settles the render device.
render::thumbnail_tests looped 100 times (2 test threads): 100/100 passed;
with LIGHTCRAFT_GPU=0 (the fixture's own device) 50/50 passed.
2026-12-02 08:34:06 -06:00
FredApps d5bfabdc5e Merge pull request #5003 from wanikhawar/claude/issue-4953-6608cd
perf(merge): grid ring search for ANMS point thinning (#4953)
2026-12-02 12:43:03 +01:00
FredApps 6999f218e8 Merge pull request #4967 from wanikhawar/perf/lens-blur-one-pass
perf(lens-blur): one pass for the four blur levels, and no full-image copy (#4949)
2026-12-02 12:41:00 +01:00
FredApps dfacce6ad3 Merge pull request #5007 from wanikhawar/perf/gpu-v14-heal-spot-boxes
GPU render: V14 heal spots read back only what each spot reads (#4960)
2026-12-02 12:40:29 +01:00
FredApps bc4c7e36d3 Merge pull request #4999 from wanikhawar/gpu/readback-staging-pool-4958
GPU: readbacks reuse staging buffers and wait only for their own submission (#4958)
2026-12-02 12:39:57 +01:00
FredApps c92eaaf842 Merge pull request #5004 from wanikhawar/perf/4951-bm3d-dct-cache
BM3D (CPU): transform each block once per plane, not once per group (#4951)
2026-12-02 11:40:14 +01:00
FredApps d78c33ea14 Merge pull request #5002 from wanikhawar/perf/4950-vignette-separable
Vignette: separate the CPU distance into column and row terms (#4950)
2026-12-02 11:39:52 +01:00
FredApps 5b931e1552 Merge pull request #4969 from wanikhawar/fix/4838-merge-dng-lj92
fix(merge): write 16-bit integer merge DNGs as lossless JPEG tiles (#4838)
2026-12-02 11:39:29 +01:00
FredApps 3f37eafe0d Merge pull request #4961 from wanikhawar/perf/hashset-stacks-cull
perf(catalog,cull): look photo ids up in hash sets instead of lists
2026-12-02 11:38:19 +01:00
FredApps a63653dc0b Merge pull request #4517 from john01px2022/brush-stroke-feather
LR-MASK-BRUSH: a brush stroke is feathered as one dab is (process V16)
2026-12-02 11:01:26 +01:00
FredApps 1662ce4a39 Merge pull request #3138 from r3d42-git/r3d/cr3-profile-alignment
LR-PROF-CAMERACOLOR: align CR3 calibration through resolved lens profiles
2026-12-02 10:59:59 +01:00
FredApps 832eb10500 Merge main into #4967 2026-12-02 10:13:07 +01:00
FredApps 7c133410f1 lens blur: sum each cell row from only the bands that reach it, and free each level's partials once summed (#4949) 2026-12-02 10:13:07 +01:00
FredApps 7e48211966 Merge main into #4999 2026-12-02 10:12:39 +01:00
FredApps 8bae0315c7 gpu: readback pool test counts only reusable staging buffers and holds the device test lock (#4958) 2026-12-02 10:12:39 +01:00
FredApps bf6a641905 Merge main into #5003 2026-12-02 10:11:58 +01:00
FredApps 29ab3f7916 merge: ANMS ring search skips ring edges outside the grid (#4953) 2026-12-02 10:11:58 +01:00
FredApps a746f7da2e Merge main into #4969 2026-12-02 10:10:59 +01:00
FredApps c807c28fc4 Merge main into #4961 2026-12-02 10:10:56 +01:00
FredApps 45344537c0 Merge pull request #4996 from Terra854/fix/curve-input-diagnostic-path-4988
Fix escaped-path assertions in native curve histogram tests
2026-12-02 09:44:39 +01:00
r3d42-git 95fa91445b Distinguish frame and calibration crop factors in CR3 lookup 2026-12-02 09:44:31 +01:00
r3d42-git a5c5311dd2 Verify fixed-mount CR3 correspondence through the shared lens lookup 2026-12-02 09:16:16 +01:00
r3d42-git 4a4391816d Synchronize denoiser model-change tests with worker completion 2026-12-02 09:16:16 +01:00
Khawar Zamman Wani 395402ead3 GPU render: V14 heal spots read back only what each spot reads (#4960)
Under process V14 the GPU renderer read the whole image back, ran the
spots on the CPU and uploaded the whole image again: about 120 ms of
transfer on a 24 MP export, even for one spot. Each spot now reads back
only the rectangle it reads (its box and its source patch,
`spots::spot_reads`), is healed on the CPU by the same code as the CPU
renderer (`spots::apply_spot`, split out of `spots::apply`), and only
its box is written back. The V13 path is unchanged.
2026-12-02 13:16:05 +05:30
r3d42-git 1e5d8294b8 Compare pooled CR3 warps with the unshaded fallback and isolate diagnostic runs 2026-12-02 07:29:56 +01:00
Khawar Zamman Wani 8e55f56f47 perf(merge): grid ring search for ANMS point thinning (#4953)
ANMS compared every keypoint with every stronger one (O(n^2), n up to
12,000). Bucket the points into a uniform grid and search rings of cells
outward until no unsearched cell can hold a closer stronger point. Points
with no stronger predecessor skip the search. The result is identical;
a test checks it against the old quadratic version.
2026-12-02 11:49:08 +05:30
FredApps ee824f37fd LR-MASK-BRUSH: the Lens Blur brush preview keeps an Auto Mask stroke's V15 accumulation (review) 2026-12-02 12:51:08 +07:00
Khawar Zamman Wani 312b2dc8bb BM3D (CPU): transform each block once per plane, not once per group (#4951)
The CPU collaborative filter ran the 2-D DCT on every member of every
group, so a block was transformed each time it joined a group, and the
Wiener step transformed the pilot's blocks again for every group. Each
block's coefficients are now worked out the first time a group asks for
them and reused. The output is bit-for-bit the same.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-12-02 11:08:57 +05:30
Khawar Zamman Wani 73781f93ff Vignette: separate the CPU distance into column and row terms (#4950)
Each pixel did three powf. The column term is now a table of image
width and the row term is computed once per row, which leaves one
powf per pixel only inside the transition band, and none for the
default power 2 (sqrt). Same output up to float rounding.
2026-12-02 10:22:21 +05:30
FredApps 41e6341101 Merge main and #4047 into brush-stroke-feather; the stroke feather becomes process V16
Main gave V10 to the checked Bradford white balance (#4599) and 13 and 14 to the
Shadows calibration and the pinned heal; #4047 (Flow per radius travelled) is V15.
So this PR's stroke feather moves from V10 to the next free number, V16 = V15 plus
feather, as asked in the review comment on #4517.

- includes #4047's head (898de527) so the stack lands in order: V15 Flow, then V16 feather
- Process::V16 is LATEST and appended to Process::ALL; masks::stroke_feather,
  the GPU brush_aux word and brush_live switch on V16, not V10
- V1 to V15 render as before (a_saved_process_keeps_its_brush_look)
- docs/process-versions.md, parity checklist and whats-new (Unreleased) updated

Co-authored-by: Dimitrij Denissenko <dimitrij.denissenko@blacksquaremedia.com>
2026-12-02 11:51:23 +07:00
FredApps 8443441961 Merge main into r3d/cr3-profile-alignment
# Conflicts:
#	crates/engine/src/camera_preview.rs
#	crates/engine/src/media/source.rs
2026-12-02 11:26:42 +07:00
Khawar Zamman Wani c5bd44a1f7 GPU readback: pool staging buffers and wait only for this render's submission (#4958)
finish_and_read took a fresh MAP_READ staging buffer for every readback
(~96 MB for a 24 MP export) and waited for everything on the queue.
Staging buffers now share the free pool with storage buffers, matched on
usage so neither is handed out as the other, and are returned after a
clean copy-out (dropped after any failure). Gpu::submit returns the
SubmissionIndex and the readback waits only on it; the 60 s timeout,
the 10 s callback grace period and the lost-device handling are kept.
2026-12-02 08:47:58 +05:30
Terra854 6efd21c440 #4988: assert escaped paths in curve histogram diagnostics 2026-12-02 09:53:57 +08:00
skylartaylor 75310cfa96 Revert "Log Ubuntu memory during the LightCraft draft gate"
This reverts commit c90026ff8e.
2026-12-02 00:59:33 +01:00
FredApps c1f2cf664a Merge pull request #4905 from r3d42-git/r3d/per-photo-denoiser
LR-EDIT-DETAIL-DENOISE: Choose and remember the denoiser per photo
2026-12-02 00:44:38 +01:00
FredApps 7dd7851df1 Merge pull request #2633 from Bruno-Alumn/fix/panic-log-settings-folder-2572
Desktop: the panic log is kept in the settings folder, never the shared temp folder (#2572)
2026-12-02 00:44:12 +01:00
FredApps 12bfc45506 Merge pull request #2492 from AlexChambers/codex/1765-panorama-verification
LR-MERGE-PANO: report omitted photos and pair verification outcomes
2026-12-02 00:43:46 +01:00
skylartaylor adb1d4c13f Match the quoted Curve render path in test diagnostics 2026-12-01 20:26:03 +01:00
skylartaylor c90026ff8e Log Ubuntu memory during the LightCraft draft gate 2026-12-01 20:03:19 +01:00
skylartaylor c9b9c53951 Expect rating chip removal to clear stars and operator 2026-12-01 18:25:04 +01:00
skylartaylor a6a0cfd1a8 Separate the Tone Curve histogram status from graph editing 2026-12-01 16:30:11 +01:00
skylartaylor 1ffdda8e67 Hold a valid test download open until activity cancellation 2026-12-01 16:00:26 +01:00
skylartaylor fa14e5b758 Integrate current LightCraft main into the UI port 2026-12-01 15:59:49 +01:00
Khawar Zamman Wani ea1ecaef3d fix(merge): write 16-bit integer merge DNGs as lossless JPEG tiles (#4838)
LibRaw, rawspeed and RawTherapee accept Deflate DNG tiles only for
floating-point data, so panorama and synth-merge DNGs (16-bit integer,
Deflate) did not open there. Integer merge output now uses lossless JPEG
tiles; HDR and float output keep Deflate.
2026-12-01 18:10:12 +05:30
P2H 84b296e0d6 Import: optional backup copy that mirrors the destination (#4840) (#4847)
* Import: optional backup copy that mirrors the destination (#4840)

Copy and Move imports can make a second, verified copy of each file in a
backup folder (dialog: Backup to; library.import: backup). The backup takes
the path the main copy ended up with, relative to the destination, so
folder and rename templates, sequence numbers, the -1 of a taken name and
Copy as DNG all carry over: the backup mirrors the destination.

Each backup gets the check Copy runs (copy_verified: a new file, synced,
checked against the probe hash or byte for byte); a bad one is removed and
reported in backupFailed. A Move keeps the original of a photo whose backup
failed. A different file already at the backup's place is left alone and
reported, never renamed. A backup with mode add, or a backup folder that is,
is inside or contains the destination, is refused up front.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Import backup: address review findings (#4840)

- A backup place that is the file being imported (a backup folder set to
  the card) is not a backup: it is reported, and a Move keeps the original
  instead of deleting the only copy.
- The backup folder check runs when library.import's params are checked,
  so the import dialog refuses it before creating a new album.
- The "outside the destination" check also compares the folders with
  links resolved through their nearest existing ancestor, so a backup
  folder that doesn't exist yet can't slip inside the destination.
- A photo browsed in Local that a Copy or Move adds in place is reported
  in backupFailed.
- docs/user describes the latest release only: the import guide's backup
  step is held back until a release ships the option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Import backup: resolve `..` and relative backup paths; refuse a backup on the main copy (#4840)

- import_move::resolved makes a path absolute and follows it part by part:
  links of the parts that exist are resolved, and a `..` after a part that
  doesn't exist yet steps back from it (it used to stop there and compare
  the path unresolved, so <base>/missing/../out/bk got past the "outside
  the destination" check).
- back_up also refuses a backup place that is the main copy or one of a
  Move's placed sidecars, not only the original.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Import backup: compare backup and destination in one path form (#4840)

On Windows, import_move::resolved gave a path whose first folder exists in
the \?\C:\ form canonicalizing returns, and one whose first folder doesn't
in the plain C:\ form; Path::starts_with told them apart, so a backup
inside a destination that doesn't exist yet could pass the overlap check.
resolved now always returns the plain form, and compare_key (used by the
overlap check and the backup-is-the-file check) also ignores letter case
on Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Import backup: check folder overlap on resolved paths only (#4840)

backup_folder_error also ran import_move::inside, which compares the raw
paths first, so a folder beside the destination named through it
(<dest>/../bk) was refused as inside it. The resolved comparison
(compare_key: absolute, links and `..` followed) already covers equal and
nested folders, so the raw checks are dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* add my real name in contributors

* Import backup: a Move checks its backup again before removing the original (#4840)

The backup path a transfer made was dropped from the Move's bookkeeping,
so finish_moves checked only the main copy: a backup removed (or a backup
drive unplugged) while the catalog was committed and saved still let the
original be deleted. The path is now carried to finish_moves, and
import_move::backup_intact checks the photo's backup and its sidecars'
against the placed copies before the source is removed; when it fails the
original stays, reported in kept like a backup that failed outright.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:40:11 +01:00