From 3575564abf8d31f37a5137ef8008ae6294d01660 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 22 Nov 2026 22:50:05 -0500 Subject: [PATCH 1/7] raw, engine: bump craft-libs to b2d2a1e94 and use WB-before-demosaic + clip mask (#3042) --- Cargo.lock | 70 ++++++++++++++++----------------- Cargo.toml | 62 ++++++++++++++--------------- crates/engine/src/files/load.rs | 2 +- crates/fetch/Cargo.toml | 2 +- crates/raw/src/lib.rs | 26 ++++++++++++ 5 files changed, 94 insertions(+), 68 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 41e9714eb2..d6ddaca554 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1190,7 +1190,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "md-5", "rayon", @@ -1199,12 +1199,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "serde", ] @@ -1212,7 +1212,7 @@ dependencies = [ [[package]] name = "craft-color-transform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "craft-cms", "craft-color", @@ -1222,7 +1222,7 @@ dependencies = [ [[package]] name = "craft-crw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "thiserror 2.0.21", ] @@ -1230,7 +1230,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "rayon", ] @@ -1238,7 +1238,7 @@ dependencies = [ [[package]] name = "craft-develop" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "craft-color", "craft-color-transform", @@ -1253,7 +1253,7 @@ dependencies = [ [[package]] name = "craft-develop-model" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "craft-geom", "craft-metadata", @@ -1265,17 +1265,17 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" [[package]] name = "craft-gainmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "thiserror 2.0.21", ] @@ -1283,7 +1283,7 @@ dependencies = [ [[package]] name = "craft-geom" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "serde", ] @@ -1291,7 +1291,7 @@ dependencies = [ [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "gif", "image", @@ -1300,7 +1300,7 @@ dependencies = [ [[package]] name = "craft-heif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "heic-rs", "rayon", @@ -1309,12 +1309,12 @@ dependencies = [ [[package]] name = "craft-http-url" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "fixed_decimal", "icu_decimal", @@ -1337,7 +1337,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "avif-serialize", "craft-dds", @@ -1368,7 +1368,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "rayon", "thiserror 2.0.21", @@ -1377,7 +1377,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1388,7 +1388,7 @@ dependencies = [ [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "thiserror 2.0.21", ] @@ -1396,7 +1396,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "brotli-decompressor 6.0.1", "chrono", @@ -1408,7 +1408,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "chrono", "craft-codepage", @@ -1418,7 +1418,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "flate2", "roxmltree", @@ -1427,7 +1427,7 @@ dependencies = [ [[package]] name = "craft-plist" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "thiserror 2.0.21", ] @@ -1435,7 +1435,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "encoding_rs", "flate2", @@ -1446,7 +1446,7 @@ dependencies = [ [[package]] name = "craft-raw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "chrono", "craft-crw", @@ -1464,17 +1464,17 @@ dependencies = [ [[package]] name = "craft-sniff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" [[package]] name = "craft-sqlite" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "serde", "thiserror 2.0.21", @@ -1484,7 +1484,7 @@ dependencies = [ [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "craft-fonts-build", "craft-i18n", @@ -1505,7 +1505,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "chrono", "dunce", @@ -1532,7 +1532,7 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "craft-media", "rav1e", @@ -1543,7 +1543,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "egui", "objc2 0.6.5", @@ -1554,7 +1554,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "quick-xml 0.41.0", "serde", @@ -1564,7 +1564,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2be967ec515a687db6b0abe372d54243ccf124bd#2be967ec515a687db6b0abe372d54243ccf124bd" +source = "git+https://github.com/storytold/craft-libs?rev=b2d2a1e948c43d95aa769d4f0a06fe6b869edc39#b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" dependencies = [ "flate2", "thiserror 2.0.21", diff --git a/Cargo.toml b/Cargo.toml index bb14ea3247..66b5407c3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,40 +10,40 @@ rust-version = "1.95" repository = "https://github.com/storytold/lightcraft" [workspace.dependencies] -craft-cms-profile = { package = "craft-cms", git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-plist = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-pdf-print = { package = "craft-pdf", git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd", default-features = false, features = ["write-raster"] } -craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd", features = ["serde"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } +craft-cms-profile = { package = "craft-cms", git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-plist = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-pdf-print = { package = "craft-pdf", git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39", default-features = false, features = ["write-raster"] } +craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39", features = ["serde"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } # Canon CRW decoder shared with the other Craft apps -craft-crw = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-color-transform = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-color = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-develop = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-develop-model = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-geom = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd", version = "0.1.0" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd", features = ["frames"] } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd", default-features = false, features = ["decode", "encode"] } +craft-crw = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-color-transform = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-color = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-develop = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-develop-model = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-geom = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39", version = "0.1.0" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39", features = ["frames"] } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39", default-features = false, features = ["decode", "encode"] } jixel = "=0.3.4" # Photo metadata: EXIF, IPTC-IIM, XMP packets and GPX track logs (craft-libs#949) -craft-metadata = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-jpeg = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-sniff = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-media = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd", default-features = false, features = ["isobmff", "matroska"] } -craft-video = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd", features = ["av1", "av1-large-encode", "threads"] } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } +craft-metadata = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-jpeg = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-sniff = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-media = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39", default-features = false, features = ["isobmff", "matroska"] } +craft-video = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39", features = ["av1", "av1-large-encode", "threads"] } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "2be967ec515a687db6b0abe372d54243ccf124bd", features = ["egui"] } -craft-window = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd", features = ["egui"] } +craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39", features = ["egui"] } +craft-window = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39", features = ["egui"] } # HDR gain maps: ISO 21496-1 and hdrgm metadata, compute and apply (moved from crates/codecs; craft-libs#904). -craft-gainmap = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } +craft-gainmap = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } # PSD/PSB: the header, colour mode data and image resources (craft-libs#885). -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-sqlite = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-zip = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-sqlite = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-zip = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } jpeg-encoder = { version = "0.7", default-features = false, features = ["std"] } # internal lightcraft-denoise-core = { path = "crates/denoise-core" } @@ -55,8 +55,8 @@ lightcraft-wincolor = { path = "crates/wincolor" } lightcraft-color = { path = "crates/color" } lightcraft-raster = { path = "crates/raster" } # TIFF/IFD: the shared reader and writer (moved from crates/tiff; craft-libs#783). -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } -craft-raw = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } +craft-raw = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } lightcraft-raw = { path = "crates/raw" } lightcraft-codecs = { path = "crates/codecs" } lightcraft-meta = { path = "crates/meta" } @@ -75,7 +75,7 @@ lightcraft-ui-egui = { path = "crates/ui-egui" } lightcraft-mcp = { path = "crates/mcp" } lightcraft-fetch = { path = "crates/fetch" } # HEIC/HEIF: the shared decoder (moved from crates/heif; craft-libs#784). -craft-heif = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd", default-features = false } +craft-heif = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39", default-features = false } lightcraft-segment = { path = "crates/segment" } lightcraft-geocode = { path = "crates/geocode" } lightcraft-slideshow = { path = "crates/slideshow" } diff --git a/crates/engine/src/files/load.rs b/crates/engine/src/files/load.rs index 9b3afb7929..a5a7e79b61 100644 --- a/crates/engine/src/files/load.rs +++ b/crates/engine/src/files/load.rs @@ -180,7 +180,7 @@ fn load_bytes_now( Some((img, mask)) => (img, Some(mask)), None => { let method = if max_edge <= 600 { lightcraft_raw::Method::Bilinear } else { lightcraft_raw::Method::Ahd }; - (raw.develop(method).map_err(|e| e.to_string())?, None) + raw.take_develop_balanced_masked(method, t.wb, HIGHLIGHT_CLIP).map_err(|e| e.to_string())? } }; // the same development from the denoised mosaic, when the photo has been denoised diff --git a/crates/fetch/Cargo.toml b/crates/fetch/Cargo.toml index 4bfe505122..1719590990 100644 --- a/crates/fetch/Cargo.toml +++ b/crates/fetch/Cargo.toml @@ -10,7 +10,7 @@ workspace = true # downloads run natively only (the web build fetches no models) [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -craft-http-url = { git = "https://github.com/storytold/craft-libs", rev = "2be967ec515a687db6b0abe372d54243ccf124bd" } +craft-http-url = { git = "https://github.com/storytold/craft-libs", rev = "b2d2a1e948c43d95aa769d4f0a06fe6b869edc39" } log = { workspace = true } rustls = { version = "0.23", default-features = false, features = ["std", "tls12"] } rustls-rustcrypto = "0.0.2-alpha" diff --git a/crates/raw/src/lib.rs b/crates/raw/src/lib.rs index 211933b2d4..217a30a7a8 100644 --- a/crates/raw/src/lib.rs +++ b/crates/raw/src/lib.rs @@ -390,6 +390,32 @@ impl RawImage { Ok(self.finish_demosaiced(rgb)) } + /// [`Self::develop`] with white balance `wb` applied to the mosaic before directional demosaicing, + /// then divided back to camera RGB. + pub fn develop_balanced(&self, method: Method, wb: [f32; 3]) -> Result { + let mut craft = bridge::to_craft_raw_header(self); + craft.data = self.data.clone(); + craft_develop::sensor::RawDevelopExt::develop_balanced(&craft, method, wb).map(bridge::from_craft_rgb32f) + } + + /// [`Self::develop_balanced`] with a per-pixel sensor clip mask for [`highlight::reconstruct_masked`]. + pub fn develop_balanced_masked(&self, method: Method, wb: [f32; 3], clip: f32) -> Result<(Rgb32f, Option>)> { + let mut craft = bridge::to_craft_raw_header(self); + craft.data = self.data.clone(); + let (rgb, mask) = craft_develop::sensor::RawDevelopExt::develop_balanced_masked(&craft, method, wb, clip)?; + Ok((bridge::from_craft_rgb32f(rgb), mask)) + } + + /// Like [`Self::develop_balanced_masked`], moving `self.data` temporarily to avoid cloning raw samples. + pub fn take_develop_balanced_masked(&mut self, method: Method, wb: [f32; 3], clip: f32) -> Result<(Rgb32f, Option>)> { + let mut craft = bridge::to_craft_raw_header(self); + craft.data = std::mem::replace(&mut self.data, RawData::U16(Vec::new())); + let res = craft_develop::sensor::RawDevelopExt::develop_balanced_masked(&craft, method, wb, clip); + self.data = craft.data; + let (rgb, mask) = res?; + Ok((bridge::from_craft_rgb32f(rgb), mask)) + } + /// The last steps of [`Self::develop`] for camera RGB made some other way (a denoiser that demosaics too) from /// [`Self::normalized`]'s mosaic: apply `OpcodeList3`, then the default crop. pub fn finish_demosaiced(&self, mut rgb: Rgb32f) -> Rgb32f { From 3251a1d4b03d71ab285d7500d6737b110c6c9bf8 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 22 Nov 2026 23:31:21 -0500 Subject: [PATCH 2/7] fix(engine): use balanced masked demosaic in cached denoise finish test --- crates/engine/src/files/tests.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/files/tests.rs b/crates/engine/src/files/tests.rs index d2a5bb36ea..08c46356ac 100644 --- a/crates/engine/src/files/tests.rs +++ b/crates/engine/src/files/tests.rs @@ -588,10 +588,11 @@ fn cached_denoise_uses_the_same_white_balance_profile_and_orientation_as_plain_r raw.color.profile.look_table = Some(HsvTable { hue_divisions: 1, sat_divisions: 2, val_divisions: 1, data: vec![[23.0, 0.65, 0.8]; 2], srgb_value: false }); let bytes = write_dng(&raw, &DngWriteOptions::default()).unwrap(); - let decoded = lightcraft_raw::decode(&bytes).unwrap(); + let mut decoded = lightcraft_raw::decode(&bytes).unwrap(); assert!(decoded.color.profile.look_table.is_some()); // A cache containing the ordinary demosaic must undergo the identical downstream finish. - let camera_rgb = decoded.develop(Method::Ahd).unwrap(); + let (_, t, _) = crate::camera_preview::starting_colour(&mut decoded, &bytes, None, None); + let (camera_rgb, _) = decoded.take_develop_balanced_masked(Method::Ahd, t.wb, super::HIGHLIGHT_CLIP).unwrap(); let key = "synthetic-color-finish"; let path = dir.join("same.lcdn"); product::write(&path, &camera_rgb, key).unwrap(); From 98b3cf82bf6f485e3ba1da33c0ddd0ff29cae8ed Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 23 Nov 2026 09:03:28 -0500 Subject: [PATCH 3/7] raw: cover develop_balanced and develop_balanced_masked variants in unit tests --- crates/raw/src/tests.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/raw/src/tests.rs b/crates/raw/src/tests.rs index c10158e7d7..8bbd69a972 100644 --- a/crates/raw/src/tests.rs +++ b/crates/raw/src/tests.rs @@ -600,3 +600,16 @@ fn probe_rejects_junk() { assert!(decode(b"FUJIFILMCCD-RAW 0201").is_err()); assert_eq!(decode(b"junk"), Err(RawError::NotRaw)); } + +#[test] +fn develop_balanced_and_masked_match_take_variant() { + let bytes = plain_cfa_tiff(1, le_words(&cfa_samples()), None); + let mut raw = decode(&bytes).expect("decode"); + let wb = [2.5, 1.0, 1.6]; + let balanced = raw.develop_balanced(Method::Ahd, wb).expect("develop_balanced"); + let (masked, mask_a) = raw.develop_balanced_masked(Method::Ahd, wb, 0.99).expect("develop_balanced_masked"); + let (taken, mask_b) = raw.take_develop_balanced_masked(Method::Ahd, wb, 0.99).expect("take_develop_balanced_masked"); + assert_eq!(balanced.data, masked.data); + assert_eq!(masked.data, taken.data); + assert_eq!(mask_a, mask_b); +} From 3cb0924aff4156f51498bc5530a4a6701990be1f Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 23 Nov 2026 10:30:47 -0500 Subject: [PATCH 4/7] fix(gpu,ui-egui): await render workers and GPU warm-up on app drop --- crates/gpu/src/lib.rs | 7 ++++++- crates/ui-egui/src/app.rs | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/crates/gpu/src/lib.rs b/crates/gpu/src/lib.rs index 1e06e9f1ad..ec0647c0c5 100644 --- a/crates/gpu/src/lib.rs +++ b/crates/gpu/src/lib.rs @@ -349,7 +349,12 @@ pub fn warm_up() { if STARTED.swap(true, Ordering::SeqCst) { return; } - let spawned = std::thread::Builder::new().name("lc-gpu-init".into()).spawn(|| { + let Some(work) = exit::enter() else { + STARTED.store(false, Ordering::SeqCst); + return; + }; + let spawned = std::thread::Builder::new().name("lc-gpu-init".into()).spawn(move || { + let _work = work; loop { let _ = device(); if GPU.get().is_some() || shutting_down() || env_disabled() { diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 29ba1334dc..322270a90e 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -641,7 +641,23 @@ impl LightcraftApp { let idle = lightcraft_engine::gpu::wait_idle(timeout); stopped && idle } +} +/// Dropping the app (including in one-test `nextest` processes that never call [`Self::shutdown`]) +/// must not leave render workers or the GPU warm-up thread inside the driver when the process exits +/// (issue #620). Does not call [`lightcraft_engine::gpu::begin_shutdown`] so multiple tests in one +/// `cargo test` process can still use the GPU afterwards. +impl Drop for LightcraftApp { + fn drop(&mut self) { + #[cfg(not(target_arch = "wasm32"))] + { + self.renderer.shutdown(std::time::Duration::from_secs(30)); + let _ = lightcraft_engine::gpu::wait_idle(std::time::Duration::from_secs(30)); + } + } +} + +impl LightcraftApp { /// Background and queue work. Called before layout on every host pass and, while the window is /// hidden, from `Context::run_logic`. It may read the refreshed viewport fields only: never /// `i.time`, events, keys or dropped files. From e21ed3fd868dfbbda1b4a7b0bc745758879930d1 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 23 Nov 2026 14:10:55 -0500 Subject: [PATCH 5/7] fix(ui-egui): gate LightcraftApp Drop off wasm32 and drain export on drop --- crates/ui-egui/src/app.rs | 15 ++++++++------- crates/ui-egui/src/export_task.rs | 8 ++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 322270a90e..dc10ee9c9b 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -644,16 +644,17 @@ impl LightcraftApp { } /// Dropping the app (including in one-test `nextest` processes that never call [`Self::shutdown`]) -/// must not leave render workers or the GPU warm-up thread inside the driver when the process exits -/// (issue #620). Does not call [`lightcraft_engine::gpu::begin_shutdown`] so multiple tests in one -/// `cargo test` process can still use the GPU afterwards. +/// must not leave export workers, render workers, or the GPU warm-up thread inside the driver when +/// the process exits (issue #620). Does not call [`lightcraft_engine::gpu::begin_shutdown`] so +/// multiple tests in one `cargo test` process can still use the GPU afterwards. +#[cfg(not(target_arch = "wasm32"))] impl Drop for LightcraftApp { fn drop(&mut self) { - #[cfg(not(target_arch = "wasm32"))] - { - self.renderer.shutdown(std::time::Duration::from_secs(30)); - let _ = lightcraft_engine::gpu::wait_idle(std::time::Duration::from_secs(30)); + if let Some(export) = self.export.as_ref() { + export.cancel_and_wait(std::time::Duration::from_secs(30)); } + self.renderer.shutdown(std::time::Duration::from_secs(30)); + let _ = lightcraft_engine::gpu::wait_idle(std::time::Duration::from_secs(30)); } } diff --git a/crates/ui-egui/src/export_task.rs b/crates/ui-egui/src/export_task.rs index 2061611028..d30758b751 100644 --- a/crates/ui-egui/src/export_task.rs +++ b/crates/ui-egui/src/export_task.rs @@ -35,6 +35,14 @@ impl ExportTask { let (done, current) = self.progress.lock().map(|g| g.clone()).unwrap_or_default(); json!({"total": self.total, "done": done, "current": current}) } + + /// Signal cancellation and wait up to `timeout` for the background worker to finish so it + /// cannot enter the GPU driver after [`LightcraftApp`] is dropped. + #[cfg(not(target_arch = "wasm32"))] + pub(crate) fn cancel_and_wait(&self, timeout: std::time::Duration) { + self.cancel.store(true, Ordering::Relaxed); + let _ = self.rx.recv_timeout(timeout); + } } /// Start exporting `items` in the background, then do `after` with the files written (Add to Apple From 0fee87f77c6c73ab56076b795922640d85e24151 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 23 Nov 2026 14:36:42 -0500 Subject: [PATCH 6/7] build: keep only craft-libs b2d2a1e94 pin bump in PR #4674 --- crates/engine/src/files/load.rs | 2 +- crates/engine/src/files/tests.rs | 5 ++--- crates/raw/src/lib.rs | 26 -------------------------- crates/raw/src/tests.rs | 13 ------------- 4 files changed, 3 insertions(+), 43 deletions(-) diff --git a/crates/engine/src/files/load.rs b/crates/engine/src/files/load.rs index a5a7e79b61..9b3afb7929 100644 --- a/crates/engine/src/files/load.rs +++ b/crates/engine/src/files/load.rs @@ -180,7 +180,7 @@ fn load_bytes_now( Some((img, mask)) => (img, Some(mask)), None => { let method = if max_edge <= 600 { lightcraft_raw::Method::Bilinear } else { lightcraft_raw::Method::Ahd }; - raw.take_develop_balanced_masked(method, t.wb, HIGHLIGHT_CLIP).map_err(|e| e.to_string())? + (raw.develop(method).map_err(|e| e.to_string())?, None) } }; // the same development from the denoised mosaic, when the photo has been denoised diff --git a/crates/engine/src/files/tests.rs b/crates/engine/src/files/tests.rs index 08c46356ac..d2a5bb36ea 100644 --- a/crates/engine/src/files/tests.rs +++ b/crates/engine/src/files/tests.rs @@ -588,11 +588,10 @@ fn cached_denoise_uses_the_same_white_balance_profile_and_orientation_as_plain_r raw.color.profile.look_table = Some(HsvTable { hue_divisions: 1, sat_divisions: 2, val_divisions: 1, data: vec![[23.0, 0.65, 0.8]; 2], srgb_value: false }); let bytes = write_dng(&raw, &DngWriteOptions::default()).unwrap(); - let mut decoded = lightcraft_raw::decode(&bytes).unwrap(); + let decoded = lightcraft_raw::decode(&bytes).unwrap(); assert!(decoded.color.profile.look_table.is_some()); // A cache containing the ordinary demosaic must undergo the identical downstream finish. - let (_, t, _) = crate::camera_preview::starting_colour(&mut decoded, &bytes, None, None); - let (camera_rgb, _) = decoded.take_develop_balanced_masked(Method::Ahd, t.wb, super::HIGHLIGHT_CLIP).unwrap(); + let camera_rgb = decoded.develop(Method::Ahd).unwrap(); let key = "synthetic-color-finish"; let path = dir.join("same.lcdn"); product::write(&path, &camera_rgb, key).unwrap(); diff --git a/crates/raw/src/lib.rs b/crates/raw/src/lib.rs index 217a30a7a8..211933b2d4 100644 --- a/crates/raw/src/lib.rs +++ b/crates/raw/src/lib.rs @@ -390,32 +390,6 @@ impl RawImage { Ok(self.finish_demosaiced(rgb)) } - /// [`Self::develop`] with white balance `wb` applied to the mosaic before directional demosaicing, - /// then divided back to camera RGB. - pub fn develop_balanced(&self, method: Method, wb: [f32; 3]) -> Result { - let mut craft = bridge::to_craft_raw_header(self); - craft.data = self.data.clone(); - craft_develop::sensor::RawDevelopExt::develop_balanced(&craft, method, wb).map(bridge::from_craft_rgb32f) - } - - /// [`Self::develop_balanced`] with a per-pixel sensor clip mask for [`highlight::reconstruct_masked`]. - pub fn develop_balanced_masked(&self, method: Method, wb: [f32; 3], clip: f32) -> Result<(Rgb32f, Option>)> { - let mut craft = bridge::to_craft_raw_header(self); - craft.data = self.data.clone(); - let (rgb, mask) = craft_develop::sensor::RawDevelopExt::develop_balanced_masked(&craft, method, wb, clip)?; - Ok((bridge::from_craft_rgb32f(rgb), mask)) - } - - /// Like [`Self::develop_balanced_masked`], moving `self.data` temporarily to avoid cloning raw samples. - pub fn take_develop_balanced_masked(&mut self, method: Method, wb: [f32; 3], clip: f32) -> Result<(Rgb32f, Option>)> { - let mut craft = bridge::to_craft_raw_header(self); - craft.data = std::mem::replace(&mut self.data, RawData::U16(Vec::new())); - let res = craft_develop::sensor::RawDevelopExt::develop_balanced_masked(&craft, method, wb, clip); - self.data = craft.data; - let (rgb, mask) = res?; - Ok((bridge::from_craft_rgb32f(rgb), mask)) - } - /// The last steps of [`Self::develop`] for camera RGB made some other way (a denoiser that demosaics too) from /// [`Self::normalized`]'s mosaic: apply `OpcodeList3`, then the default crop. pub fn finish_demosaiced(&self, mut rgb: Rgb32f) -> Rgb32f { diff --git a/crates/raw/src/tests.rs b/crates/raw/src/tests.rs index 8bbd69a972..c10158e7d7 100644 --- a/crates/raw/src/tests.rs +++ b/crates/raw/src/tests.rs @@ -600,16 +600,3 @@ fn probe_rejects_junk() { assert!(decode(b"FUJIFILMCCD-RAW 0201").is_err()); assert_eq!(decode(b"junk"), Err(RawError::NotRaw)); } - -#[test] -fn develop_balanced_and_masked_match_take_variant() { - let bytes = plain_cfa_tiff(1, le_words(&cfa_samples()), None); - let mut raw = decode(&bytes).expect("decode"); - let wb = [2.5, 1.0, 1.6]; - let balanced = raw.develop_balanced(Method::Ahd, wb).expect("develop_balanced"); - let (masked, mask_a) = raw.develop_balanced_masked(Method::Ahd, wb, 0.99).expect("develop_balanced_masked"); - let (taken, mask_b) = raw.take_develop_balanced_masked(Method::Ahd, wb, 0.99).expect("take_develop_balanced_masked"); - assert_eq!(balanced.data, masked.data); - assert_eq!(masked.data, taken.data); - assert_eq!(mask_a, mask_b); -} From 106d7248b0b970b1c7177c7a16d511d3d5a41a13 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Tue, 24 Nov 2026 14:26:10 +0100 Subject: [PATCH 7/7] build: drop the GPU/export teardown changes from the craft-libs pin PR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keep #4674 as a Rule 10 rev move only (craft-libs b2d2a1e94). The warm_up/Drop/cancel_and_wait changes belong with #4697 (#620), which already covers the same shutdown path and has a regression test. The untested teardown was the new code behind the 68.8% Sonar coverage gate (needs ≥ 80%). --- crates/gpu/src/lib.rs | 7 +------ crates/ui-egui/src/app.rs | 17 ----------------- crates/ui-egui/src/export_task.rs | 8 -------- 3 files changed, 1 insertion(+), 31 deletions(-) diff --git a/crates/gpu/src/lib.rs b/crates/gpu/src/lib.rs index ec0647c0c5..1e06e9f1ad 100644 --- a/crates/gpu/src/lib.rs +++ b/crates/gpu/src/lib.rs @@ -349,12 +349,7 @@ pub fn warm_up() { if STARTED.swap(true, Ordering::SeqCst) { return; } - let Some(work) = exit::enter() else { - STARTED.store(false, Ordering::SeqCst); - return; - }; - let spawned = std::thread::Builder::new().name("lc-gpu-init".into()).spawn(move || { - let _work = work; + let spawned = std::thread::Builder::new().name("lc-gpu-init".into()).spawn(|| { loop { let _ = device(); if GPU.get().is_some() || shutting_down() || env_disabled() { diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index dc10ee9c9b..29ba1334dc 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -641,24 +641,7 @@ impl LightcraftApp { let idle = lightcraft_engine::gpu::wait_idle(timeout); stopped && idle } -} -/// Dropping the app (including in one-test `nextest` processes that never call [`Self::shutdown`]) -/// must not leave export workers, render workers, or the GPU warm-up thread inside the driver when -/// the process exits (issue #620). Does not call [`lightcraft_engine::gpu::begin_shutdown`] so -/// multiple tests in one `cargo test` process can still use the GPU afterwards. -#[cfg(not(target_arch = "wasm32"))] -impl Drop for LightcraftApp { - fn drop(&mut self) { - if let Some(export) = self.export.as_ref() { - export.cancel_and_wait(std::time::Duration::from_secs(30)); - } - self.renderer.shutdown(std::time::Duration::from_secs(30)); - let _ = lightcraft_engine::gpu::wait_idle(std::time::Duration::from_secs(30)); - } -} - -impl LightcraftApp { /// Background and queue work. Called before layout on every host pass and, while the window is /// hidden, from `Context::run_logic`. It may read the refreshed viewport fields only: never /// `i.time`, events, keys or dropped files. diff --git a/crates/ui-egui/src/export_task.rs b/crates/ui-egui/src/export_task.rs index d30758b751..2061611028 100644 --- a/crates/ui-egui/src/export_task.rs +++ b/crates/ui-egui/src/export_task.rs @@ -35,14 +35,6 @@ impl ExportTask { let (done, current) = self.progress.lock().map(|g| g.clone()).unwrap_or_default(); json!({"total": self.total, "done": done, "current": current}) } - - /// Signal cancellation and wait up to `timeout` for the background worker to finish so it - /// cannot enter the GPU driver after [`LightcraftApp`] is dropped. - #[cfg(not(target_arch = "wasm32"))] - pub(crate) fn cancel_and_wait(&self, timeout: std::time::Duration) { - self.cancel.store(true, Ordering::Relaxed); - let _ = self.rx.recv_timeout(timeout); - } } /// Start exporting `items` in the background, then do `after` with the files written (Add to Apple