From bf789d79f557021144a49c93ba03bbf189ce9860 Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Sun, 11 Oct 2026 12:42:29 -0500 Subject: [PATCH 1/8] test(gpu): #1050 opt-in software adapter for the equivalence tests `Gpu::new` refuses software adapters (llvmpipe / lavapipe, WARP): the CPU pipeline is faster. CI runners have nothing else, so the CPU <-> GPU equivalence tests have always skipped there. `LIGHTCRAFT_GPU_ALLOW_SOFTWARE=1` admits them. The app never sets it and the default is unchanged. On lavapipe all 134 compared renders stay within max 1 LSB, mean <= 0.0003 LSB, the same as Metal on an M4 Pro. The two big-source window tests used a 24 MP (288 MB) source. That is over lavapipe's 128 MiB storage binding (the WebGPU default), so geometry ran on the CPU and nothing was uploaded: one test failed and the other passed without checking anything. They now use 3200 x 3200 (117 MiB): above RETAIN_SOURCE_BYTES, so the source is still shared, and uploaded on every adapter. Co-Authored-By: Claude Opus 5.5 --- crates/gpu/src/ctx.rs | 33 ++++++++++++++++++++++++++++-- crates/gpu/tests/it/equivalence.rs | 30 +++++++++++++++++---------- docs/gpu-pipeline.md | 13 ++++++++++++ 3 files changed, 63 insertions(+), 13 deletions(-) diff --git a/crates/gpu/src/ctx.rs b/crates/gpu/src/ctx.rs index 7bbbbc68d49..2e53778ab83 100644 --- a/crates/gpu/src/ctx.rs +++ b/crates/gpu/src/ctx.rs @@ -292,7 +292,8 @@ fn module_source(m: &Module, consts: &str) -> String { } impl Gpu { - /// Create a device on the best available adapter (no software fallback), or why there is none. + /// Create a device on the best available adapter (no software adapter unless + /// `LIGHTCRAFT_GPU_ALLOW_SOFTWARE`), or why there is none. pub fn new(backends: wgpu::Backends) -> Result { let mut desc = wgpu::InstanceDescriptor::new_without_display_handle(); // only these drivers are loaded (`crate::backend`: never Vulkan on Windows unless asked) @@ -307,10 +308,13 @@ impl Gpu { ) .map_err(|e| format!("no GPU adapter among {backends:?} ({e})"))?; let info = adapter.get_info(); - if info.device_type == wgpu::DeviceType::Cpu { + if refuse_adapter(info.device_type, software_allowed()) { log::info!("gpu: only a software adapter ({}), using the CPU pipeline", info.name); return Err(format!("software adapter ({}) skipped: the CPU pipeline is faster", info.name)); } + if info.device_type == wgpu::DeviceType::Cpu { + log::info!("gpu: LIGHTCRAFT_GPU_ALLOW_SOFTWARE: using the software adapter {}", info.name); + } let mut limits = adapter.limits(); if limits.max_storage_buffers_per_shader_stage < 10 { log::info!("gpu: {} has too few storage buffers per stage", info.name); @@ -653,6 +657,20 @@ impl Gpu { /// normally reset a hung GPU much sooner). const READBACK_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(60); +/// Whether to turn down an adapter of `device_type`: a software rasterizer (llvmpipe / lavapipe, +/// WARP) is slower than the CPU pipeline, so it is refused unless `allow_software`. +fn refuse_adapter(device_type: wgpu::DeviceType, allow_software: bool) -> bool { + device_type == wgpu::DeviceType::Cpu && !allow_software +} + +/// `LIGHTCRAFT_GPU_ALLOW_SOFTWARE=1`: accept a software adapter. For tests on machines without a +/// GPU (CI runners: Mesa lavapipe on Linux, WARP on Windows), so the CPU ↔ GPU equivalence tests +/// run there instead of skipping; the app never sets it (software rendering is slower than the CPU +/// pipeline). +fn software_allowed() -> bool { + std::env::var("LIGHTCRAFT_GPU_ALLOW_SOFTWARE").is_ok_and(|v| matches!(v.trim().to_ascii_lowercase().as_str(), "1" | "true" | "yes" | "on")) +} + /// `LIGHTCRAFT_GPU_LIMITS`: lower the device limits, e.g. to reproduce a smaller adapter. /// `webgpu` / `downlevel` = 128 MiB storage bindings and 256 MiB buffers (the WebGPU defaults), /// `` = n MiB storage bindings and 2n MiB buffers. Returns (binding bytes, buffer bytes). @@ -964,6 +982,17 @@ mod tests { println!("CHILD: survived"); } + #[test] + fn software_adapters_need_the_opt_in() { + use wgpu::DeviceType::{Cpu, DiscreteGpu, IntegratedGpu, Other, VirtualGpu}; + assert!(super::refuse_adapter(Cpu, false), "llvmpipe / WARP are refused by default"); + assert!(!super::refuse_adapter(Cpu, true), "LIGHTCRAFT_GPU_ALLOW_SOFTWARE accepts them"); + for t in [DiscreteGpu, IntegratedGpu, VirtualGpu, Other] { + assert!(!super::refuse_adapter(t, false), "{t:?}"); + assert!(!super::refuse_adapter(t, true), "{t:?}"); + } + } + #[test] fn dispatches_stay_within_the_workgroup_limit() { // 1-D kernels over a 100 MP image and 2-D ones over 16k × 16k stay under 65535 per axis diff --git a/crates/gpu/tests/it/equivalence.rs b/crates/gpu/tests/it/equivalence.rs index 6a8169b301d..1a58cd8e546 100644 --- a/crates/gpu/tests/it/equivalence.rs +++ b/crates/gpu/tests/it/equivalence.rs @@ -2,7 +2,8 @@ //! `lightcraft_gpu::render`, compared in 8-bit sRGB. //! //! Bounds (documented in `docs/gpu-pipeline.md`): mean |Δ| < 0.5 LSB and max |Δ| ≤ 3 LSB per -//! channel for every case. Skips (passes with a note) when no GPU adapter exists, e.g. on CI. +//! channel for every case. Skips (passes with a note) when no GPU adapter exists; CI runs them on +//! software adapters with `LIGHTCRAFT_GPU_ALLOW_SOFTWARE=1` (lavapipe, WARP) and on Metal. use std::sync::Arc; @@ -833,13 +834,20 @@ fn windows_match() { check("window: vignette corner", &src, &info, &s, &corner); } -/// Issue #323: a window of a 24 MP photo is cut from a source of 288 MB on the device. Keeping that -/// upload with the view's stages counted it against the stage budget on every tick of a drag and -/// got the stages cleared, and the upload and resampling redone: the window's stages are its own -/// pixels, not the photo's. +/// Issue #323: a window of a big photo is cut from the whole source on the device (288 MB for 24 MP). +/// Keeping that upload with the view's stages counted it against the stage budget on every tick of +/// a drag and got the stages cleared, and the upload and resampling redone: the window's stages are +/// its own pixels, not the photo's. // (these two share the process's one big source: a test lock keeps them from replacing each other's) static BIG_SOURCE_TESTS: std::sync::Mutex<()> = std::sync::Mutex::new(()); +/// The big photo of these tests: 10.24 MP, a 117 MiB source. That is over what a view keeps with its +/// stages (96 MiB, so it is shared) and within a 128 MiB storage binding (the WebGPU default, and +/// the limit of Mesa's lavapipe in CI), so the source goes to the device on every adapter. A source +/// over the device's limit is resampled on the CPU instead and never uploaded, which would leave +/// these tests nothing to check. +const BIG: usize = 3200; + #[test] fn a_window_does_not_keep_the_whole_source_on_the_device() { let _lock = BIG_SOURCE_TESTS.lock().unwrap_or_else(|e| e.into_inner()); @@ -847,11 +855,11 @@ fn a_window_does_not_keep_the_whole_source_on_the_device() { return; } use lightcraft_pipeline::PixelWindow; - let src = scene(1, 6000, 4000); + let src = scene(1, BIG, BIG); let info = SourceInfo { raw: true, ..Default::default() }; let stages = StageCache::default(); let s = DevelopSettings::default(); - let req = RenderRequest { window: Some(PixelWindow { x: 2000, y: 1500, w: 640, h: 480 }), ..RenderRequest::fit(6000, 4000) }; + let req = RenderRequest { window: Some(PixelWindow { x: 2000, y: 1500, w: 640, h: 480 }), ..RenderRequest::fit(BIG, BIG) }; let _ = lightcraft_gpu::render(&src, &info, &s, &req, Some(&stages)).expect("gpu render"); let held = lightcraft_gpu::stage_bytes(&stages); assert!(held < 100 << 20, "the view's GPU stages hold {} MiB for a 640×480 window", held >> 20); @@ -863,7 +871,7 @@ fn a_window_does_not_keep_the_whole_source_on_the_device() { assert!(lightcraft_gpu::stage_bytes(&stages) < 100 << 20); } -/// …but the 288 MB is uploaded once for every window of every view of the photo, not once per +/// …but the source is uploaded once for every window of every view of the photo, not once per /// window: panning at 1:1, and the Before and After windows, share one device copy of it, which /// goes when the app idles (`trim_pool(0)`). #[test] @@ -873,17 +881,17 @@ fn windows_of_a_big_photo_share_one_uploaded_source() { return; } use lightcraft_pipeline::PixelWindow; - let src = scene(1, 6000, 4000); + let src = scene(1, BIG, BIG); let info = SourceInfo { raw: true, ..Default::default() }; let s = DevelopSettings::default(); let (after, before) = (StageCache::default(), StageCache::default()); - let at = |x: usize| RenderRequest { window: Some(PixelWindow { x, y: 1500, w: 640, h: 480 }), ..RenderRequest::fit(6000, 4000) }; + let at = |x: usize| RenderRequest { window: Some(PixelWindow { x, y: 1500, w: 640, h: 480 }), ..RenderRequest::fit(BIG, BIG) }; let start = lightcraft_gpu::source_uploads(); for (cache, x) in [(&after, 1000), (&after, 1256), (&after, 1512), (&before, 1512), (&before, 1768)] { lightcraft_gpu::render(&src, &info, &s, &at(x), Some(cache)).expect("gpu render"); } assert_eq!(lightcraft_gpu::source_uploads() - start, 1, "one upload for five windows of two views"); - assert!(lightcraft_gpu::shared_source_bytes() >= 280_000_000, "{}", lightcraft_gpu::shared_source_bytes()); + assert!(lightcraft_gpu::shared_source_bytes() >= BIG * BIG * 12, "{}", lightcraft_gpu::shared_source_bytes()); assert!(lightcraft_gpu::stage_bytes(&after) < 100 << 20, "and it is not in the views' stages"); lightcraft_gpu::trim_pool(0); assert_eq!(lightcraft_gpu::shared_source_bytes(), 0, "an idle app gives it back"); diff --git a/docs/gpu-pipeline.md b/docs/gpu-pipeline.md index f88f81c3901..dda0d6a7a38 100644 --- a/docs/gpu-pipeline.md +++ b/docs/gpu-pipeline.md @@ -49,6 +49,9 @@ Overrides (read once at launch): - `LIGHTCRAFT_GPU=0`: GPU rendering off for the process (the window is unaffected). - Both `LIGHTCRAFT_GPU=0` and `LIGHTCRAFT_GPU_BACKEND=off` also keep AI Denoise, the face models and the AI mask model (SAM 3 on Metal) on the CPU. +- `LIGHTCRAFT_GPU_ALLOW_SOFTWARE=1`: accept a software adapter (llvmpipe / lavapipe, WARP), which is + otherwise refused because the CPU pipeline is faster. For tests on machines without a GPU (CI); + the app never sets it. **DX12 shader compiler (issue #471).** Every instance (window and compute) compiles DX12 shaders with FXC (`d3dcompiler_47.dll`, part of Windows; `lightcraft_gpu::backend::backend_options`). wgpu's @@ -263,6 +266,16 @@ bit-identical, and one (the point colour range overlay) has max 2 LSB on 0.0002% mean 0.0003 LSB. That is the same picture as on Metal, inside the bounds (`cargo test -p lightcraft-gpu --release --test it equivalence:: -- --nocapture`). +**In CI** (`.github/workflows/ci.yml`, issue #1050) they run on every platform: on Metal on the macOS +runners, and on software adapters on Linux (Mesa lavapipe) and Windows (WARP, DX12 with FXC), which +`LIGHTCRAFT_GPU_ALLOW_SOFTWARE=1` admits (tests only: the app never sets it). The step fails if they +skip. Measured on lavapipe (CI and locally) and WARP: all 134 compared renders within **max 1 LSB, +mean ≤ 0.0003 LSB**, as on the M4 Pro; on the macOS runner's (paravirtual) Metal device one case reaches +2 LSB (point colour range overlay, 0.0002% of pixels over 1), the rest max 1. The suite takes about +50 s on lavapipe, 30 s on the macOS runner and 2–7.5 min on WARP. lavapipe's +storage bindings stop at 128 MiB (the WebGPU default), so the two big-source tests use a 117 MiB +source: above what a view keeps with its stages (96 MiB) and small enough to be uploaded there. + Remaining differences come from f32 vs f64 coordinate math, fast-math transcendental functions on Metal and summation order in the box filters — all far below one 8-bit step. From 68bef55c335139b8fb987cf7271fc944ee67b7ac Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Mon, 26 Oct 2026 00:17:17 -0500 Subject: [PATCH 2/8] ci: #1050 run the gate on macOS and Windows, and the GPU tests on lavapipe, Metal and WARP The gate already runs `cargo xtask ci` on Linux x64 through craft-common-actions' gate.yml. Its `os` input now adds macos-latest and windows-latest legs, standard runners only. After the gate, every leg runs lightcraft-gpu's tests again with LIGHTCRAFT_GPU_ALLOW_SOFTWARE=1: Mesa's lavapipe on Linux, WARP on Windows, Metal on macOS. The step fails if a GPU test still skips for lack of an adapter. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a309a9fb38e..efb2b811bc5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,16 @@ name: CI # Quality gates for every push to main and every pull request (`cargo xtask ci`), through the -# suite's shared gate workflow in craft-common-actions. +# suite's shared gate workflow in craft-common-actions, on the three desktop platforms (gap 9, +# issue #1050): code behind `cfg(target_os)`, path and line-ending assumptions and the Metal and +# DX12 code paths only show on their platform. +# +# After the gate, each leg runs the GPU tests again (CPU <-> GPU equivalence, fallback, memory, +# shutdown) with `LIGHTCRAFT_GPU_ALLOW_SOFTWARE=1`, which only tests set: the app refuses software +# adapters because the CPU pipeline is faster. The runners have no hardware GPU, so that admits +# Mesa's lavapipe on Linux and WARP (DX12) on Windows; macOS runners expose a Metal device. The +# step fails if a GPU test still skips for lack of an adapter, so "all passed" can't mean the GPU +# tests never ran. on: push: branches: [main] @@ -21,11 +30,25 @@ jobs: # Tracks @main so suite-wide CI fixes reach every app without a PR in each repository. uses: storytold/craft-common-actions/.github/workflows/gate.yml@main with: + # Standard GitHub-hosted runners only: free for public repositories. + os: '["ubuntu-24.04","macos-latest","windows-latest"]' # Same craft-fonts commit as release.yml. craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83 - timeout-minutes: 90 + # a from-scratch workspace build on macOS and Windows takes about an hour + timeout-minutes: 120 # xtask ci runs cargo test: the demo scene cache is per process, so nextest is slower here. tools: "" + command: | + cargo xtask ci + echo "=== GPU tests, software adapters allowed ===" + skips="$RUNNER_TEMP/gpu-skips.jsonl" + rm -f "$skips" + LIGHTCRAFT_GPU_ALLOW_SOFTWARE=1 LIGHTCRAFT_SKIP_LOG="$skips" cargo test --locked -p lightcraft-gpu --tests + if [ -f "$skips" ]; then echo "skipped GPU tests:"; cat "$skips"; fi + if [ -f "$skips" ] && grep -q '"reason":"no GPU adapter' "$skips"; then + echo "::error::the GPU tests skipped: no GPU adapter on this runner, software ones included" + exit 1 + fi packages: >- pkg-config libxkbcommon-dev libwayland-dev libx11-dev libxcb1-dev libxcursor-dev libxrandr-dev libxi-dev libfontconfig1-dev libfreetype-dev mesa-vulkan-drivers From a825bc6947d457a6816b3fd4d0252d635740b2da Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Mon, 26 Oct 2026 00:29:04 -0500 Subject: [PATCH 3/8] fix: #1050 clippy on macOS and Windows: one Quit / About / Settings branch, the GVfs test path Unix-only The first macOS and Windows gate runs stopped at clippy, on code only those platforms compile: - macOS: native_menu.rs gave Quit and About / Settings two identical if blocks (clippy::if_same_then_else). - Windows: doc_path.rs's test built its GVfs mount path outside the cfg(not(windows)) assertion that uses it (unused variable). A GVfs SMB mount is a Unix path, so the whole check is Unix-only. Co-Authored-By: Claude Opus 5.5 --- apps/lightcraft/src/native_menu.rs | 4 +--- crates/engine/src/doc_path.rs | 7 +++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/lightcraft/src/native_menu.rs b/apps/lightcraft/src/native_menu.rs index a5a14e2088e..0a14918a812 100644 --- a/apps/lightcraft/src/native_menu.rs +++ b/apps/lightcraft/src/native_menu.rs @@ -489,9 +489,7 @@ impl NativeMenu { // events never reach `shortcuts::handle`, so this is the one guard for AppKit's // accelerators and clicks: while the blocking library window or a quit/settings notice // owns input, a queued command is dropped (Quit stays for the existing confirmation). - let (cmd, params) = if key == QUIT { - (key, serde_json::json!({})) - } else if key == "app.about" || key == SETTINGS { + let (cmd, params) = if key == QUIT || key == "app.about" || key == SETTINGS { (key, serde_json::json!({})) } else if let Some(it) = self.items.get(&key) { (it.cmd.clone(), it.params.clone()) diff --git a/crates/engine/src/doc_path.rs b/crates/engine/src/doc_path.rs index d3f455b81c2..6440ada3030 100644 --- a/crates/engine/src/doc_path.rs +++ b/crates/engine/src/doc_path.rs @@ -63,8 +63,11 @@ mod tests { assert_eq!(resolve("Photos/2024:05/a.jpg", Some(&doc)), Err(NotFollowed::Refused(Refused::Invalid))); #[cfg(not(windows))] assert_eq!(resolve(r"C:\Photos\a.jpg", Some(&doc)), Err(NotFollowed::NotHere)); - let gvfs = Path::new("/run/user/1000/gvfs/smb-share:server=tokyo,share=photos/catalog.lrcat"); + // a GVfs mount point (GNOME's SMB shares) is a local folder on Unix; Windows has no such path #[cfg(not(windows))] - assert_eq!(resolve("a.jpg", Some(gvfs)), Ok(gvfs.with_file_name("a.jpg"))); + { + let gvfs = Path::new("/run/user/1000/gvfs/smb-share:server=tokyo,share=photos/catalog.lrcat"); + assert_eq!(resolve("a.jpg", Some(gvfs)), Ok(gvfs.with_file_name("a.jpg"))); + } } } From 960a2d4c7e94f9f10f8d75d7745d310b75a4eb9f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 21 Oct 2026 23:56:44 -0700 Subject: [PATCH 4/8] Control port: close gracefully so the peer reads the last reply (Windows reset) After rejecting a line the server closed its socket at once. A line the client sent after the junk then arrived at a closed socket, which answers with a reset, and on Windows the reset discards the replies the client has not read yet: the client saw os error 10053 / 10054 instead of the error explaining why. This is the Windows x64 failure of tcp_connection_is_closed_after_junk in #2377's CI. serve_stream now shuts down the write side (FIN), reads and drops what is left (at most 4 MiB, 500 ms), then closes. close_gracefully is taken from #1970 by LochLogic, split out so it can land ahead of the per-run token work; #1991 did not include it. The test sends its last line 100 ms after the junk and reads after another 100 ms, so it fails on every run without the fix on Windows (10053) instead of depending on timing. Co-Authored-By: LochLogic <252105752+LochLogic@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01K93HTyCiwYvbRGaAkjPvXn --- apps/lightcraft/src/control_server.rs | 38 ++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/apps/lightcraft/src/control_server.rs b/apps/lightcraft/src/control_server.rs index 95aa108964a..50f0de13466 100644 --- a/apps/lightcraft/src/control_server.rs +++ b/apps/lightcraft/src/control_server.rs @@ -87,7 +87,7 @@ fn serve(stream: TcpStream, tx: &Sender, ctx: &egui::Context, id log::warn!("control connection closed: could not set idle read timeout: {e}"); return; } - serve_lines(&stream, &stream, |method, params| { + serve_stream(stream, |method, params| { let (req, rrx) = ControlRequest::new(method, params); let state = Arc::clone(&req.state); tx.send(req).ok()?; @@ -96,6 +96,31 @@ fn serve(stream: TcpStream, tx: &Sender, ctx: &egui::Context, id }); } +/// [`serve_lines`] on a socket, then close it so the peer reads every reply. +fn serve_stream(stream: TcpStream, handle: impl FnMut(String, Value) -> Option) { + serve_lines(&stream, &stream, handle); + close_gracefully(&stream); +} + +/// Close a connection the server is done with without destroying its last reply. A socket closed +/// while the peer's later lines are unread, or arrive after it, answers them with a reset, and a +/// reset can discard the replies the peer has not read yet (on Windows it does): the client sees +/// "connection reset" instead of why. Send FIN, then read and drop what is left (bounded in bytes +/// and time) before closing. From #1970 (LochLogic). +fn close_gracefully(stream: &TcpStream) { + let _ = stream.shutdown(std::net::Shutdown::Write); + let _ = stream.set_read_timeout(Some(Duration::from_millis(500))); + let mut sink = [0u8; 8192]; + let mut left = MAX_LINE; + let mut reader = stream; + while left > 0 { + match reader.read(&mut sink) { + Ok(0) | Err(_) => break, + Ok(n) => left = left.saturating_sub(n), + } + } +} + /// Wait for a request's reply. While the app has not picked the request up and `frames` (its /// frame counter) stands still for `no_frames`, the request is abandoned (it will not run late) /// and the reply says why; a request the app is running gets the whole `timeout`. @@ -502,12 +527,17 @@ mod tests { let addr = listener.local_addr().unwrap(); let server = std::thread::spawn(move || { let (s, _) = listener.accept().unwrap(); - let read = s.try_clone().unwrap(); - serve_lines(read, s, |_, _| Some(json!({"ok": true}))); + serve_stream(s, |_, _| Some(json!({"ok": true}))); }); let mut c = TcpStream::connect(addr).unwrap(); c.set_read_timeout(Some(Duration::from_secs(10))).unwrap(); - c.write_all(b"{\"id\":7,\"method\":\"x\"}\nhello\n{\"method\":\"y\"}\n").unwrap(); + c.write_all(b"{\"id\":7,\"method\":\"x\"}\nhello\n").unwrap(); + // A client that keeps sending after the junk: its next line reaches the server after the + // rejection. A socket closed by then answers that line with a reset, and on Windows the reset + // discarded the replies the client had not read yet (os error 10054). + std::thread::sleep(Duration::from_millis(100)); + c.write_all(b"{\"method\":\"y\"}\n").unwrap(); + std::thread::sleep(Duration::from_millis(100)); let mut text = String::new(); c.read_to_string(&mut text).unwrap(); // returns at EOF: the server closed the connection server.join().unwrap(); From ba74660476cc1513302d15ea7e71df7c42450a89 Mon Sep 17 00:00:00 2001 From: insideTheFlux Date: Fri, 23 Oct 2026 11:59:47 -0700 Subject: [PATCH 5/8] Control port: bound the close drain in total; the reset test waits for the rejection close_gracefully read with a 500 ms timeout per read but no overall limit, so a local client sending one byte every few hundred milliseconds kept the drain (and its connection slot) going until it had sent MAX_LINE. Each read now waits at most the time left of DRAIN_TIME (1 s). New test a_closing_connection_is_not_held_open_by_a_trickling_peer: without the limit it drains for 10 s. tcp_connection_is_closed_after_junk no longer sleeps before its second write: it reads the reply and the rejection first, so the server has rejected the junk before the next line is sent. It still pauses before the last read so that a reset can arrive. Without close_gracefully it fails with os error 10053 on Windows. From CodeRabbit's review of #2723. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01PtjHGt5gnCHXgLt4NbGorf --- apps/lightcraft/src/control_server.rs | 62 +++++++++++++++++++++------ 1 file changed, 50 insertions(+), 12 deletions(-) diff --git a/apps/lightcraft/src/control_server.rs b/apps/lightcraft/src/control_server.rs index 50f0de13466..51a4a48ee99 100644 --- a/apps/lightcraft/src/control_server.rs +++ b/apps/lightcraft/src/control_server.rs @@ -96,6 +96,9 @@ fn serve(stream: TcpStream, tx: &Sender, ctx: &egui::Context, id }); } +/// The longest a closing connection is drained, however slowly its peer keeps sending. +const DRAIN_TIME: Duration = Duration::from_secs(1); + /// [`serve_lines`] on a socket, then close it so the peer reads every reply. fn serve_stream(stream: TcpStream, handle: impl FnMut(String, Value) -> Option) { serve_lines(&stream, &stream, handle); @@ -105,15 +108,21 @@ fn serve_stream(stream: TcpStream, handle: impl FnMut(String, Value) -> Option 0 { + // a peer that keeps trickling bytes must not hold the connection slot past DRAIN_TIME + let wait = DRAIN_TIME.saturating_sub(start.elapsed()).min(Duration::from_millis(500)); + if wait.is_zero() || stream.set_read_timeout(Some(wait)).is_err() { + break; + } match reader.read(&mut sink) { Ok(0) | Err(_) => break, Ok(n) => left = left.saturating_sub(n), @@ -532,18 +541,47 @@ mod tests { let mut c = TcpStream::connect(addr).unwrap(); c.set_read_timeout(Some(Duration::from_secs(10))).unwrap(); c.write_all(b"{\"id\":7,\"method\":\"x\"}\nhello\n").unwrap(); + let mut replies = BufReader::new(c.try_clone().unwrap()); + let (mut first, mut second) = (String::new(), String::new()); + replies.read_line(&mut first).unwrap(); + replies.read_line(&mut second).unwrap(); + assert!(first.contains("\"id\":7"), "{first}"); + assert!(second.contains("closing the connection"), "{second}"); // A client that keeps sending after the junk: its next line reaches the server after the - // rejection. A socket closed by then answers that line with a reset, and on Windows the reset - // discarded the replies the client had not read yet (os error 10054). - std::thread::sleep(Duration::from_millis(100)); + // rejection. A socket closed by then answers that line with a reset, which the client reads + // as "connection reset" (os error 10053 / 10054 on Windows) instead of the end of the + // replies. The pause lets a reset arrive before the read. c.write_all(b"{\"method\":\"y\"}\n").unwrap(); std::thread::sleep(Duration::from_millis(100)); - let mut text = String::new(); - c.read_to_string(&mut text).unwrap(); // returns at EOF: the server closed the connection + let mut rest = String::new(); + let read = replies.read_to_string(&mut rest); server.join().unwrap(); - let lines: Vec<&str> = text.lines().collect(); - assert_eq!(lines.len(), 2, "{text}"); - assert!(lines[0].contains("\"id\":7")); - assert!(lines[1].contains("closing the connection")); + assert!(read.is_ok(), "the close must be clean, not a reset: {read:?}"); + assert_eq!(rest, "", "nothing follows the rejection"); + } + + #[test] + fn a_closing_connection_is_not_held_open_by_a_trickling_peer() { + let listener = TcpListener::bind(("127.0.0.1", 0)).unwrap(); + let addr = listener.local_addr().unwrap(); + let done = Arc::new(std::sync::atomic::AtomicBool::new(false)); + let server_done = Arc::clone(&done); + let server = std::thread::spawn(move || { + let (s, _) = listener.accept().unwrap(); + let t0 = std::time::Instant::now(); + close_gracefully(&s); + server_done.store(true, Ordering::SeqCst); + t0.elapsed() + }); + let mut c = TcpStream::connect(addr).unwrap(); + // one byte every 100 ms: each read returns well within its 500 ms timeout + for _ in 0..100 { + if done.load(Ordering::SeqCst) || c.write_all(b"x").is_err() { + break; + } + std::thread::sleep(Duration::from_millis(100)); + } + let drained = server.join().unwrap(); + assert!(drained < DRAIN_TIME + Duration::from_secs(1), "drained for {drained:?}"); } } From 5fdcdd52c1e66035c7ea6b4864a3c3b0f0a42cf5 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Thu, 22 Oct 2026 20:28:24 +1000 Subject: [PATCH 6/8] Tests: discovery tests build their expected paths with the platform's separator `recursive_discovery_includes_sony_sr2_and_srf_case_insensitively` (engine) and `folder_discovery_matches_engine_extensions` (mcp) joined "trip/day2/..." as one string, so on Windows the expected paths kept `/` while discovery returns `\`, and both failed. They now join one component at a time. Test-only change. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/tests/import.rs | 4 +++- crates/mcp/src/headless.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/tests/import.rs b/crates/engine/src/tests/import.rs index 6e5585a823d..05f75972396 100644 --- a/crates/engine/src/tests/import.rs +++ b/crates/engine/src/tests/import.rs @@ -35,7 +35,9 @@ fn recursive_discovery_includes_sony_sr2_and_srf_case_insensitively() { let src = temp_dir("sony-discovery"); std::fs::create_dir_all(src.join("trip/day2")).unwrap(); let names = ["r1.SR2", "f828.srf", "trip/r1.sr2", "trip/f828.SRF", "trip/day2/r1.Sr2", "trip/day2/f828.SrF", "control.JPG"]; - let mut expected: Vec = names.iter().map(|name| src.join(name).to_string_lossy().into_owned()).collect(); + // one component at a time: `join("trip/r1.sr2")` keeps the `/`, discovery yields the platform's separator + let mut expected: Vec = + names.iter().map(|name| name.split('/').fold(src.clone(), |p, c| p.join(c)).to_string_lossy().into_owned()).collect(); for path in &expected { std::fs::write(path, b"discovery only, not a decoded photo").unwrap(); } diff --git a/crates/mcp/src/headless.rs b/crates/mcp/src/headless.rs index d62a9a707ef..e281437c532 100644 --- a/crates/mcp/src/headless.rs +++ b/crates/mcp/src/headless.rs @@ -207,7 +207,7 @@ mod tests { fn folder_discovery_matches_engine_extensions() { let dir = std::env::temp_dir().join(format!("lc-mcp-discovery-{}", std::process::id())); let _ = std::fs::remove_dir_all(&dir); - let nested = dir.join("trip/day2"); + let nested = dir.join("trip").join("day2"); // not "trip/day2": discovery yields the platform's separator std::fs::create_dir_all(&nested).unwrap(); let mut expected = Vec::new(); for ext in lightcraft_engine::import::EXTENSIONS { From dc73e0845e686153f6c5a6654b08dde6e17dae12 Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Mon, 26 Oct 2026 15:09:58 -0500 Subject: [PATCH 7/8] docs: #1050 gap 9 closed: tests in CI on macOS, Windows and Linux x64 The gate runs `cargo xtask ci` on macOS and Windows as well as Linux x64, then the GPU tests on lavapipe, Metal and WARP; all three legs green on the fork (THEtheChad/lightcraft run 40382469008). Gap 9 moves to Closed recently (B gaps ~230-430 h -> ~225-420 h); ROADMAP item 8, the alpha rationale, docs/roadmap.md and the Stability notes in target-app-parity.md follow. gpu-pipeline.md gives the CI run's adapters and timings. Readiness percentages unchanged. Co-Authored-By: Claude Opus 5.5 --- ROADMAP.md | 9 +++++---- docs/gaps.md | 14 +++++++++++--- docs/gpu-pipeline.md | 19 ++++++++++--------- docs/roadmap.md | 5 +++-- docs/target-app-parity.md | 11 ++++++----- 5 files changed, 35 insertions(+), 23 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 6802f923423..552259033c2 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~14 points and ~340–600 h away -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-22 · **Change:** minor (Print: Japanese photo and postcard paper sizes — L判, 2L判, KG判, はがき, 往復はがき, 六切, 四切, 名刺; Minolta MRW decoded, 6 bodies verified; RAW: 83% of Adobe's models decode, 38% verified after the camera-coverage sweep #1327; German catalog 91% → 97%: interface strings and What's New lines translated) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-26 · **Change:** minor (gap 9 closed: tests in CI on macOS, Windows and Linux x64, GPU tests on lavapipe, Metal and WARP; Print: Japanese photo and postcard paper sizes — L判, 2L判, KG判, はがき, 往復はがき, 六切, 四切, 名刺; Minolta MRW decoded, 6 bodies verified; RAW: 83% of Adobe's models decode, 38% verified after the camera-coverage sweep #1327; German catalog 91% → 97%: interface strings and What's New lines translated) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 One-page summary of how close LightCraft is to Adobe Lightroom. Agents: read this, then pick work from [docs/gaps.md](docs/gaps.md). The full assessment, method and evidence are in @@ -30,8 +30,8 @@ Each audience with its own hours (Opus 5.5 agent wall-clock hours to ~95%): The gap between breadth and readiness is quality and coverage, not missing buttons: camera colour is estimated rather than measured, CR3 decodes on 26 verified Canon bodies (rarer CRX variants still open as previews), compressed ORF and HE NEF -open as previews, rendering is tuned by eye, AI masks are heuristics, there is no lens database, and -tests run in CI on FreeBSD only. **Why alpha:** core workflows run end to end, but readiness is below +open as previews, rendering is tuned by eye, AI masks are heuristics, there is no lens database. +Tests run in CI on macOS, Windows and Linux x64 for every pull request, and on FreeBSD nightly. **Why alpha:** core workflows run end to end, but readiness is below the ~75% beta bar (it is above the ~40% alpha bar) and Lightroom's main inputs, raw files, still have blocking gaps (compressed ORF and HE NEF open as previews; Canon, ~30% of raw users, decodes CR3 on 26 verified bodies). It passes the alpha gate: all six core workflows (import, cull, develop, save and reopen, batch looks, export) work end to end on macOS @@ -109,7 +109,7 @@ Ranked toward beta; detail in [docs/roadmap.md](docs/roadmap.md), gaps in [docs/ 5. AI masks: Subject / Sky / People (40–70 h + model decision) 6. Compressed ORF and HE NEF (28–55 h) 7. Lens profile database of our own (40–80 h) -8. Tests in CI on macOS, Windows and Linux (6–12 h) +8. ~~Tests in CI on macOS, Windows and Linux~~ (done 2026-10-26) 9. Per-model raw verification (20–35 h) ## Progress log @@ -191,6 +191,7 @@ Ranked toward beta; detail in [docs/roadmap.md](docs/roadmap.md), gaps in [docs/ | Date | Change | Summary | |---|---|---| +| 2026-10-26 | minor | Gap 9 closed (#1148): CI runs `cargo xtask ci` on macOS, Windows and Linux x64 for every pull request and push to `main`, and the GPU tests on lavapipe, Metal and WARP; ranked item 8 done; headline numbers unchanged | | 2026-10-22 | minor | Print: Japanese photo and postcard paper sizes (L判, 2L判, KG判, はがき, 往復はがき, 六切, 四切, 名刺) in the page setup, Print dialog and PDF output; headline numbers unchanged | | 2026-10-19 | minor | Indonesian interface (`id`): every plain and formats message, plus 69 command labels, locale, menu command and tests; What's New left in English; Localization ~55% → ~64% (mean of the 12 key languages), 8 of 12 present | | 2026-10-12 | minor | Italian interface (`it`, #1192): 2,201 of 2,398 messages, locale, menu command and tests; headline numbers unchanged | diff --git a/docs/gaps.md b/docs/gaps.md index 42d9d437b6d..48dbafdb1ae 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Gaps: where LightCraft falls short of Lightroom -> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-10-24 · **Change:** minor (gap 30: the Info panel shows the selected photos' shared metadata and marks mixed fields; gap 28: ⌘⌥⇧C / ⌘⌥⇧V copy and paste metadata; gap 13: before a Lightroom catalog import the app asks merge or new library, #2672; gap 28: F8 shows / hides the right panel; import review album hierarchy, #2362; gap 20: Minolta MRW decodes; gap 10: 551 models verified; gap 15: Print Page Options — page numbers, page info, crop marks; gap 28: `\` shows / hides the Filter Bar in the grids; gap 21: Indonesian interface shipped, every message but What's New; gap 27: the Windows x64 installer verified on Windows 11; the Settings → Apps uninstall confirmation remains; gap 28: ⌘L Enable Filters switches the filter off and on; gap 15: Japanese photo and postcard paper sizes in the Print page setup and PDF) +> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-10-26 · **Change:** minor (gap 9 closed: the CI gate runs `cargo xtask ci` on macOS and Windows as well as Linux x64, and the GPU tests on lavapipe, Metal and WARP, #1148; gap 30: the Info panel shows the selected photos' shared metadata and marks mixed fields; gap 28: ⌘⌥⇧C / ⌘⌥⇧V copy and paste metadata; gap 13: before a Lightroom catalog import the app asks merge or new library, #2672; gap 28: F8 shows / hides the right panel; import review album hierarchy, #2362; gap 20: Minolta MRW decodes; gap 10: 551 models verified; gap 15: Print Page Options — page numbers, page info, crop marks; gap 28: `\` shows / hides the Filter Bar in the grids; gap 21: Indonesian interface shipped, every message but What's New; gap 27: the Windows x64 installer verified on Windows 11; the Settings → Apps uninstall confirmation remains; gap 28: ⌘L Enable Filters switches the filter off and on; gap 15: Japanese photo and postcard paper sizes in the Print page setup and PDF) Every known shortfall, one entry each, ranked by user impact (how many Lightroom users hit it, and how hard it blocks them), then by effort. **Agents pick work from the top** (the first entry nobody is @@ -23,7 +23,7 @@ Hours are Opus 5.5 agent wall-clock hours (see [target-app-parity.md](target-app | 6 B | **Compressed ORF** (every Olympus / OM body since ~2008) | measured: 66 of 78 Olympus / OM models preview-only; `orf.rs` refuses; OM bucket 3% of photographers, 3% of them fully work | +2.6 points; best gain per hour of any raw gap (~0.2) | 8–15 | [raw-parity](raw-parity.md#compressed-orf-a-clean-room-starting-point) (the two Olympus patents that describe the method) | | 7 | **Nikon High Efficiency NEF** (HE / HE★ on Z 8, Z 9, Z 6III, Z f, Z50II, Z5II when set to HE) | named and preview only (#193); needs a pure-Rust JPEG XS decoder | +1.1 points (only shots taken in HE; lossless works on the same bodies); low gain per hour (~0.04), so not a beta blocker | 20–40 | [raw-parity](raw-parity.md) | | 8 B | **No lens profile database** (LR-EDIT-OPTICS-PROFILE): only DNG opcodes, RW2 in-file distortion, Sony ILCE-7RM4A, full-frame ILCE-7CR distortion (Auto only) and ILCE-7RM6 distortion (`docs/sony-ilce7rm6-lens-corrections.md`) and Nikon Z 6II / Z 8 / Z f distortion (`docs/nikon-lens-corrections.md`) | Adobe ships 3,635 lens profiles; we never use them | distortion / vignetting correction is a default step for many | 40–80 + calibration shots | [raw-parity](raw-parity.md#lens-profiles) | -| 9 B | **Tests don't run in CI on macOS or Windows**: Linux x64 runs `cargo xtask ci` on every PR and push to main (`.github/workflows/ci.yml`) and FreeBSD runs `cargo test`; the others build packages | `.github/workflows/` (ci, freebsd, packaging-lint, release, windows-arm64); the linux-riscv64 release job added in 0.6.0 (#844) runs only `lightcraft-cli --version` under QEMU; macOS / Windows jobs: #1148 | regressions in `cfg(target_os)` code reach macOS and Windows users | 6–12 | [target-app-parity](target-app-parity.md#by-dimension) | +| 9 | ~~Tests don't run in CI on macOS or Windows~~: closed 2026-10-26, see Closed recently | `.github/workflows/ci.yml` | — | 0 | [target-app-parity](target-app-parity.md#by-dimension) | | 10 B | **Per-model verification thin, plus cheap per-body decode fixes**: 551 of 1,446 Adobe models verified (38%), ~85% of photographers on a verified body; Nikon 5 bodies verified, Canon 34, Leica 14 (the Q3 by a recorded check of 38 private DNGs). Cheap fixes: Z 6II packed 14-bit NEF (#769, PR #671), Sony A100 regression (#702); F828 SRF now discovered and imported as preview-only, sensor decoding still missing, DSLR-A200…A390 / A850 12-bit ARW (#535) | measured: [raw/coverage.tsv](raw/coverage.tsv) | per-body bugs (levels, crops, WB) surface only from users | 25–45 | [raw-parity](raw-parity.md#by-maker-measured) | | 11 | **Enhance: Raw Details, Super Resolution; AI denoise without shippable weights or X-Trans** | ENH rows 0%; denoise Bayer only, RawNIND weights GPL and opt-in | Fujifilm users get no AI denoise; nobody gets it out of the box | 30–60 + model decision | [raw-parity](raw-parity.md#demosaic-levels-crops-and-lens-metadata) | | 12 | **Content-aware / generative remove, detect distractions, reflections removal** | REM rows 75%; patch synthesis missing | cleanup work goes back to Photoshop | 25–45 (+ generative model) | [target-app-parity](target-app-parity.md#ai) | @@ -46,7 +46,7 @@ Hours are Opus 5.5 agent wall-clock hours (see [target-app-parity.md](target-app | 28 | **Small Classic shortcuts and keys**: Tab / ⇧Tab (hide the side panels / all panels; Tab moves the keyboard focus here) and F5. Rating `[` `]`, flag cycling (`` ` ``), `\` (Filter Bar), ⌘L (Enable Filters), ⌘⌥⇧C / ⌘⌥⇧V (Copy / Paste Metadata), F1 help, F6 / F7 / F8 (filmstrip, left panel, right panel) are bound; the grid-cycle key is shown beside both grid rows in View (#2500) | [ui-parity](ui-parity.md#shortcuts) | Classic muscle memory | 2–4 | [ui-parity](ui-parity.md) | | 30 | **Multi-select metadata editing in the UI**: `photo.setMeta` already iterates all selected photos, so the engine applies changes to every target. The Info panel's Show Metadata For choice (Target Photo / Selected Photos) shows the values the selected photos share and marks each field where they differ as Mixed; the All Metadata dialog still shows one photo's values with no "mixed" indication | standard in Lightroom Classic's multi-select Info panel | anyone editing metadata on a batch (copyright, keywords, custom fields) | 1–3 | [ui-parity](ui-parity.md) | -Beta-blocking gaps (B) total **~230–430 h**; with the stability and platform work they need around them, +Beta-blocking gaps (B) total **~225–420 h**; with the stability and platform work they need around them, **~340–600 h** to beta (incl. 40–80 h for the ~92 open core-path user issues) (see [target-app-parity.md](target-app-parity.md#stage)). ## Gaps by kind @@ -61,6 +61,13 @@ Beta-blocking gaps (B) total **~230–430 h**; with the stability and platform w ## Closed recently (kept for calibration) +- 2026-10-26: tests in CI on macOS and Windows (gap 9, #1050, #1148): the CI gate runs `cargo xtask ci` on + macos-latest and windows-latest as well as ubuntu-24.04 for every pull request and push to `main`, then the GPU tests + again with `LIGHTCRAFT_GPU_ALLOW_SOFTWARE=1` (Mesa lavapipe on Linux, Metal on macOS, WARP on Windows), failing if + they skip for lack of an adapter. The first runs found two platform-only clippy errors, and on Windows the control + port's reset (#2723), two test paths (#2547) and a hard link to an original that the write guard missed (#3020). Whether the new legs are required checks is a repository setting; the linux-riscv64 release + job still runs only `lightcraft-cli --version`. + - 2026-10-22: saving XMP preserves foreign namespaces even when they use `lc:` or `xmp:` prefixes; importing them no longer interprets their properties as native settings or ratings. Parser, merge and save-command regressions cover the correction; no ranked gap or readiness estimate changes. - 2026-10-22: PSD/PSB imports and metadata readers now expose embedded EXIF resource 1058 and XMP resource 1060 for capture dates, GPS and All Metadata (#2519); imported PSD edit copies retain their capture date, and the `removeLocation` Original-export guard sees embedded PSD/PSB GPS. No ranked gap or headline feature count closes. @@ -84,6 +91,7 @@ Beta-blocking gaps (B) total **~230–430 h**; with the stability and platform w | Date | Change | Summary | |---|---|---| +| 2026-10-26 | minor | Gap 9 closed: the CI gate runs `cargo xtask ci` on macOS and Windows as well as Linux x64, and the GPU tests on lavapipe, Metal and WARP (#1148); added to Closed recently; B gaps ~230–430 h → ~225–420 h | | 2026-10-24 | minor | Gap 28: ⌘⌥⇧C / ⌘⌥⇧V (Ctrl+Alt+Shift+C / V on Windows and Linux) copy and paste metadata; no key leaves the entry; hours unchanged | | 2026-10-24 | minor | Gap 30 shrinks: the Info panel's Show Metadata For (Target Photo / Selected Photos, `view.infoSelectedPhotos`) shows the selected photos' shared values and marks fields that differ as Mixed; the All Metadata dialog remains; 1–3 h (was 4–8) | | 2026-10-23 | minor | Gap 13: before a Lightroom catalog import the app asks whether it merges into the open library or goes into a new one (opt-out in Settings, #2672); hours unchanged | diff --git a/docs/gpu-pipeline.md b/docs/gpu-pipeline.md index dda0d6a7a38..bee16534722 100644 --- a/docs/gpu-pipeline.md +++ b/docs/gpu-pipeline.md @@ -266,15 +266,16 @@ bit-identical, and one (the point colour range overlay) has max 2 LSB on 0.0002% mean 0.0003 LSB. That is the same picture as on Metal, inside the bounds (`cargo test -p lightcraft-gpu --release --test it equivalence:: -- --nocapture`). -**In CI** (`.github/workflows/ci.yml`, issue #1050) they run on every platform: on Metal on the macOS -runners, and on software adapters on Linux (Mesa lavapipe) and Windows (WARP, DX12 with FXC), which -`LIGHTCRAFT_GPU_ALLOW_SOFTWARE=1` admits (tests only: the app never sets it). The step fails if they -skip. Measured on lavapipe (CI and locally) and WARP: all 134 compared renders within **max 1 LSB, -mean ≤ 0.0003 LSB**, as on the M4 Pro; on the macOS runner's (paravirtual) Metal device one case reaches -2 LSB (point colour range overlay, 0.0002% of pixels over 1), the rest max 1. The suite takes about -50 s on lavapipe, 30 s on the macOS runner and 2–7.5 min on WARP. lavapipe's -storage bindings stop at 128 MiB (the WebGPU default), so the two big-source tests use a 117 MiB -source: above what a view keeps with its stages (96 MiB) and small enough to be uploaded there. +**In CI** (`.github/workflows/ci.yml`, issue #1050) they run on every pull request and push to `main` on +all three desktop platforms: after `cargo xtask ci`, each leg of the gate runs `lightcraft-gpu`'s tests +again with `LIGHTCRAFT_GPU_ALLOW_SOFTWARE=1` (tests only: the app never sets it), so they use Mesa's +lavapipe on Linux, WARP (DX12 with FXC) on Windows and the runner's Metal device on macOS, every case +held to the bounds above. The step fails if one skips for lack of an adapter (the device-loss test +still skips where a device can't be lost on purpose). On the first green run (2026-10-26) the +equivalence binary took 50 s on lavapipe, 15 s on the macOS runner and 9.3 min on WARP. Measured +2026-10-11 on lavapipe and WARP, every compared render stayed within max 1 LSB, mean ≤ 0.0003 LSB. +lavapipe's storage bindings stop at 128 MiB (the WebGPU default), so the two big-source tests use a +117 MiB source: above what a view keeps with its stages (96 MiB) and small enough to be uploaded there. Remaining differences come from f32 vs f64 coordinate math, fast-math transcendental functions on Metal and summation order in the box filters — all far below one 8-bit step. diff --git a/docs/roadmap.md b/docs/roadmap.md index 79d811da3f2..30894707780 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # Roadmap: milestones, current focus and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-10 · **Change:** major (created; milestones moved here from ROADMAP.md, focus re-ranked after the 2026-10-10 re-measure) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-26 · **Change:** minor (gap 9 closed: item 8 done; created; milestones moved here from ROADMAP.md, focus re-ranked after the 2026-10-10 re-measure) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 Forward-looking plan. The summary with the headline numbers is [ROADMAP.md](../ROADMAP.md); the ranked shortfalls are [gaps.md](gaps.md); the numbers come from [target-app-parity.md](target-app-parity.md). @@ -23,7 +23,7 @@ Toward **beta** (~340–600 Opus 5.5 agent hours; ranked, each a gap in [gaps.md mirror. Needs the maintainer's model decision. 6. **Compressed ORF and HE NEF** (gaps 6–7, 28–55 h). 7. **Lens profiles of our own** (gap 8, 40–80 h). -8. **Tests in CI on macOS, Windows and Linux** (gap 9, 6–12 h). +8. ~~**Tests in CI on macOS, Windows and Linux**~~ (gap 9): done 2026-10-26, #1148. 9. **Per-model verification** (gap 10, 20–35 h). ## Alpha gate @@ -108,6 +108,7 @@ calibration: M0–M13 took ≈ 25 active hours against an estimate of ≈ 110– | Date | Change | Summary | |---|---|---| +| 2026-10-26 | minor | Item 8 done: gap 9 closed by #1148 (CI on macOS, Windows and Linux x64, GPU tests on lavapipe, Metal and WARP) | | 2026-10-10 | minor | Beta hours 340–600; full ready ~59% in the gate note | | 2026-10-10 | minor | Added the Alpha gate table (core-workflow gate from the revised standard): passes, stays alpha | | 2026-10-10 | major | Created: milestones moved from ROADMAP.md (statuses refreshed: M3 ✅, M11 / M12 / M15 detail), current focus re-ranked toward beta, risks and design notes kept | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index d72c165c415..6a33d14dfd7 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Target-app parity: LightCraft vs Adobe Lightroom -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-19 · **Change:** minor (Minolta MRW decoded, 6 bodies verified; RAW: 83% of Adobe's models decode, 38% verified after the camera-coverage sweep #1327; Platforms: the Windows x64 installer verified on Windows 11) · **Target:** Adobe Lightroom Classic 15.5 (August 2026) and Lightroom 9.6 (desktop) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-26 · **Change:** minor (gap 9 closed: tests in CI on macOS, Windows and Linux x64, GPU tests on lavapipe, Metal and WARP; Minolta MRW decoded, 6 bodies verified; RAW: 83% of Adobe's models decode, 38% verified after the camera-coverage sweep #1327; Platforms: the Windows x64 installer verified on Windows 11) · **Target:** Adobe Lightroom Classic 15.5 (August 2026) and Lightroom 9.6 (desktop) The authoritative assessment of how close LightCraft is to Lightroom. The row-by-row checklist is [parity-checklist.md](parity-checklist.md); the ranked work list is [gaps.md](gaps.md); deep areas @@ -53,7 +53,7 @@ phase #85, duplicate Local entries #22, black GPU exports on an Intel iGPU #78). | Hardware | ~50% | ~40% | 40–80 h (+ tethering and printing, counted under Classic modules) | [hardware-parity.md](hardware-parity.md) | | Localization (12 key languages) | 8 of 12 present | ~64% (mean of the 12, measured) | 130–210 h for the target's set; +135–239 h for Hindi, Arabic, Vietnamese, Korean | [localization-parity.md](localization-parity.md) | | Performance | ~80% | ~70% | 30–50 h | 24 MP GPU slider 3.9 ms, export 0.3 s (measured, [gpu-pipeline.md](gpu-pipeline.md)); 85k library opens in 1.7–4.7 s; 100k test pending | -| Stability | — | ~60% | 30–60 h | never-crash lints and guards workspace-wide, crash-tested journal, 2,561 tests; but CI runs tests only on FreeBSD, user reports keep finding bugs in ✅ areas | +| Stability | — | ~60% | 30–60 h | never-crash lints and guards workspace-wide, crash-tested journal, 2,561 tests, run in CI on macOS, Windows and Linux x64 for every pull request (GPU tests on lavapipe, Metal and WARP) and on FreeBSD nightly; but user reports keep finding bugs in ✅ areas | | Platforms | macOS, Windows (x64 / x86 / ARM64), Linux (AppImage, deb, rpm, Flatpak, Nix), FreeBSD, web | ~60% | 25–45 h | macOS is where it is tested; the Windows x64 installer is verified on Windows 11 (0.9.1) except for a confirmation after uninstalling from Settings → Apps (#892); web experimental (CPU only) | | Ecosystem / plug-ins | ~25% | ~15% | 40–80 h + owner decision | no Lightroom SDK equivalent (export, publish, metadata plug-ins); beyond the target: JSON-lines control channel, MCP server with 28 tools + one per command, CLI | | AI features | ~30% | ~20% | 120–220 h + model decisions | [AI](#ai) (overlaps the masking and Enhance rows; not added twice) | @@ -158,7 +158,7 @@ essentials replaces its guessed 45% raw look with 84% × 0.75 (+1 point). | Discount | Mainstream | Essentials | Evidence | |---|---:|---:|---| | Interaction fidelity / UI clarity | ×0.95 | ×0.95 | brush live preview gaps and feathering (#517, #518); crop artefacts and limits (#731, #742, #770, #771); Compare white-balance selector (#743–#745); low-res slider previews (#330); dialogs taller than the window (#781); mouse-wheel scroll (#714) | -| Stability on real machines | ×0.92 | ×0.92 | launch and quit crashes or silent startup failures (#250 macOS 12 Intel, #315 Windows Intel GPU, #431 Intel Mac, #260, #462, #783 Linux / Nouveau, #790 Windows installer, fixed in 0.9.1); tests run in CI on Linux x64 and FreeBSD only (gap 9) | +| Stability on real machines | ×0.92 | ×0.92 | launch and quit crashes or silent startup failures (#250 macOS 12 Intel, #315 Windows Intel GPU, #431 Intel Mac, #260, #462, #783 Linux / Nouveau, #790 Windows installer, fixed in 0.9.1); tests in CI on macOS, Windows, Linux x64 and FreeBSD since gap 9 closed (2026-10-26), discount unchanged | | File exchange with Lightroom users (mainstream) / opening files people send (essentials) | ×0.92 | ×0.95 | Adobe XMP sidecars change colours (#290), XMP CameraProfile and Upright ignored (#204, #205), catalog import fails (#599), same Light values render differently (#523, #209), no write-back to `.lrcat`; for casual users: CR3 beyond verified bodies, compressed ORF, HE NEF open as previews (#473, #485, #556), HEIC trouble (#693) | | **Product** | **×0.804** | **×0.830** | | @@ -238,11 +238,11 @@ work end to end on macOS; see the table in [roadmap.md](roadmap.md#alpha-gate). variants, compressed ORF, HE NEF as previews) degrade but don't block a workflow. **To beta:** ~14 points of readiness, **~340–600 h**: the `B` gaps in [gaps.md](gaps.md) -(~230–430 h), plus burning down the ~92 open core-path user issues (40–80 h) and stability work +(~225–420 h), plus burning down the ~92 open core-path user issues (40–80 h) and stability work around them. Beta needs: CR3, ORF and HE NEF decoding from sensor data; measured colour for the popular models and a fidelity suite with scores; Subject / Sky / People masks; a lens profile database for the -popular lenses; tests in CI on macOS, Windows and Linux. +popular lenses. ## How hours are calibrated @@ -300,6 +300,7 @@ P2 items 12–25 h; look tuning, performance, packaging, hardening 25–45 h. | Date | Change | Summary | |---|---|---| +| 2026-10-26 | minor | Gap 9 closed (#1148): CI runs `cargo xtask ci` on macOS, Windows and Linux x64 and the GPU tests on lavapipe, Metal and WARP; Stability notes updated, beta needs no longer list CI, B gaps ~230–430 h → ~225–420 h; readiness percentages unchanged | | 2026-10-19 | patch | Stability note: tests run in CI on Linux x64 (every PR) as well as FreeBSD; macOS and Windows remain (gap 9) | | 2026-10-19 | minor | Localization ~55% → ~64% (mean of the 12 key languages): Indonesian (`id`) catalog, every message but What's New; full target 61.2% → 61.5% (still ~61%) | | 2026-10-19 | patch | Platforms: the Windows installer is no longer listed as unverified (the 0.9.1 x64 MSI is tested on Windows 11; a confirmation after uninstalling from Settings → Apps, #892, remains); #790 noted as fixed in 0.9.1; percentages and hours unchanged | From 1b7c6dbe1229a088a2f4c6bb2e654837aad1b2da Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Tue, 27 Oct 2026 23:50:54 -0500 Subject: [PATCH 8/8] test(engine): the hard-link originals test holds under SeBackupPrivilege (#3228) With SeBackupPrivilege enabled (an admin's Git Bash, so every CI gate leg on Windows), a FILE_FLAG_BACKUP_SEMANTICS open gets past a share_mode(0) handle, so the guard reads the hard link's identity and refuses it as the original instead of "cannot tell whether". Probe both names for that while the handle is held: when both open, assert the original is named (and not "cannot tell whether") and record a System skip for the untested half; otherwise assert "cannot tell whether" as before. Closes #3228 Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/originals.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/originals.rs b/crates/engine/src/originals.rs index af2fc5d14bf..d2980aa3596 100644 --- a/crates/engine/src/originals.rs +++ b/crates/engine/src/originals.rs @@ -370,7 +370,21 @@ mod tests { // identity of either name cannot be read while it is held. let held = std::fs::OpenOptions::new().read(true).share_mode(0).open(&original).unwrap(); let refused = s.pin_write_target(&linked.to_string_lossy()).unwrap_err(); - assert!(refused.contains("cannot tell whether"), "{refused}"); + // Except with SeBackupPrivilege enabled (an admin's Git Bash, so every Windows CI gate leg): + // a backup-semantics open of both names, as the guard's identity read uses, gets past the + // held handle. The guard then sees the link and refuses it as the original instead (#3228). + const FILE_FLAG_BACKUP_SEMANTICS: u32 = 0x0200_0000; + let backup_open = |p: &std::path::Path| std::fs::OpenOptions::new().read(true).custom_flags(FILE_FLAG_BACKUP_SEMANTICS).open(p).is_ok(); + if backup_open(&original) && backup_open(&linked) { + assert!(refused.contains("is the original"), "{refused}"); + assert!(!refused.contains("cannot tell whether"), "{refused}"); + lightcraft_testkit::skip!( + System, + "a backup-semantics open gets past share_mode(0) here (SeBackupPrivilege is enabled), so the \"cannot tell whether\" refusal can't be tested" + ); + } else { + assert!(refused.contains("cannot tell whether"), "{refused}"); + } drop(held); let refused = s.pin_write_target(&linked.to_string_lossy()).unwrap_err();