Merge PR #1884: AI denoise: support 102 MP Bayer raws (#1880)

This commit is contained in:
Brandon Thomas committed 2026-10-18 09:20:16 -04:00
commit 80e2d0e64a
2 files changed
+17 -2

No files matched your search

+16 -1
View File
@@ -14,7 +14,7 @@ use crate::manifest::Gain;
use crate::tiles::{starts, weight};
/// Most pixels one picture may have (guards the allocations that follow from its size).
pub const MAX_PIXELS: usize = 100_000_000;
pub const MAX_PIXELS: usize = 110_000_000;
/// A tile whose mean signal is below this (white = 1) is too dark to measure its scale from.
const MIN_SIGNAL: f32 = 0.003;
@@ -642,4 +642,19 @@ mod tests {
assert!(matches!(denoise_bayer(&[0.5; 16], 4, 4, layout, &Bad(vec![0.0; 5]), &p, &Control::default()), Err(Error::Model(_))));
assert!(matches!(denoise_bayer(&[0.5; 16], 4, 4, layout, &Bad(vec![f32::NAN; 3 * 64 * 64]), &p, &Control::default()), Err(Error::Model(_))));
}
#[test]
fn accepts_102_mp_inputs_and_rejects_inputs_above_the_limit() {
let layout = Layout { dx: 0, dy: 0 };
let model = Mock { tile: 32, scale: 1.0 };
let p = params(32, 8, Gain::None);
assert!(matches!(
denoise_bayer(&[], 11_648, 8_736, layout, &model, &p, &Control::default()),
Err(Error::Input(message)) if message == "the mosaic does not have width × height samples"
));
assert!(matches!(
denoise_bayer(&[], MAX_PIXELS + 1, 1, layout, &model, &p, &Control::default()),
Err(Error::Input(message)) if message == "the picture has no size, or is too large"
));
}
}
+1 -1
View File
@@ -77,7 +77,7 @@ pool. A scalar implementation checks the optimized operators on synthetic networ
Tract is not a workspace dependency or a product feature.
CPU inference and the GPU model module are feature-gated; ordinary engine/web builds
do not compile the faer/GEMM backend. The engine depends on the inference crate only through `denoise = ["dep:lightcraft-denoise", …]`;
lightweight `lightcraft-denoise-core` metadata and cache formats remain available without inference. Pictures are capped at 100 megapixels; at most
lightweight `lightcraft-denoise-core` metadata and cache formats remain available without inference. Pictures are capped at 110 megapixels; at most
four tile calls run together, chosen within the process-wide working-memory budget.
One idle CPU workspace is retained, and cache costs reserve room for the blended picture.