Clear the clippy warnings that were failing CI before this branch
Build and test / Desktop (Linux) (push) Failing after 9m10s
Build and test / Layer separation (push) Successful in 27s
Traceability / Requirement traces (push) Failing after 24s
🐳 Android image / Build and push (push) Successful in 1s
Build and test / android-image (push) Successful in 1s
Build and test / Android (aarch64) (push) Failing after 22m15s

Nothing here is film simulation. These are lints that fail master today,
under the -D warnings CI runs with, mostly from a toolchain that learned
new ones rather than from anybody's code -- is_multiple_of and the
derivable Default did not exist as lints when this was written.

They are fixed rather than allowed, and by hand rather than by trusting
cargo clippy --fix wholesale: its automatic pass split a derive in two and
left a stray blank line, which is the sort of thing that is correct and
still wrong to commit.

The four that needed a decision rather than a rewrite:

  - the distance transform's inner loop writes through its iterator now.
     stays, because it is the position the parabola is evaluated at as
    well as the index it is written to -- the lint is about the write.
  -  and  take  by value. Their receiver is
    Copy, so this is the same machine code and the honest signature.
  - the export path's return type is five levels deep and now has a name,
    plus a line saying why the Option wraps the Result: None is
    cancellation, which is not a failure and has no error to report.
  - a test fills a range instead of looping over one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-25 22:34:38 +02:00
co-authored by Claude Opus 5
parent 3b5952769b
commit e929e9917e
11 changed files with 145 additions and 124 deletions
+24 -5
View File
@@ -165,7 +165,12 @@ fn film_key(t: &dr_pipeline::ops::FilmTables) -> u64 {
mix(v.to_bits());
}
}
for v in [t.curve_log_min, t.curve_log_max, t.density_max, t.lut_size as f32] {
for v in [
t.curve_log_min,
t.curve_log_max,
t.density_max,
t.lut_size as f32,
] {
mix(v.to_bits());
}
for e in t.lut.iter().step_by(8).chain(t.curves.iter().step_by(8)) {
@@ -228,7 +233,11 @@ impl AdjustPass {
let lut = self.upload_film(
"adjust-film-lut",
wgpu::TextureDimension::D3,
wgpu::Extent3d { width: n, height: n, depth_or_array_layers: n },
wgpu::Extent3d {
width: n,
height: n,
depth_or_array_layers: n,
},
&to_rgba(&t.lut),
);
self.film = Some(FilmTextures { curves, lut, key });
@@ -282,7 +291,9 @@ impl AdjustPass {
/// The curve texture to bind: the loaded stock's, or the placeholder.
fn film_curves_view(&self) -> &wgpu::TextureView {
self.film.as_ref().map_or(&self.empty_film_curves, |f| &f.curves)
self.film
.as_ref()
.map_or(&self.empty_film_curves, |f| &f.curves)
}
/// The density lookup to bind: the loaded stock's, or the placeholder.
@@ -352,7 +363,11 @@ impl AdjustPass {
.device
.create_texture(&wgpu::TextureDescriptor {
label: Some("adjust-empty-film-curves"),
size: wgpu::Extent3d { width: 1, height: 1, depth_or_array_layers: 1 },
size: wgpu::Extent3d {
width: 1,
height: 1,
depth_or_array_layers: 1,
},
mip_level_count: 1,
sample_count: 1,
dimension: wgpu::TextureDimension::D2,
@@ -365,7 +380,11 @@ impl AdjustPass {
.device
.create_texture(&wgpu::TextureDescriptor {
label: Some("adjust-empty-film-lut"),
size: wgpu::Extent3d { width: 1, height: 1, depth_or_array_layers: 1 },
size: wgpu::Extent3d {
width: 1,
height: 1,
depth_or_array_layers: 1,
},
mip_level_count: 1,
sample_count: 1,
dimension: wgpu::TextureDimension::D3,
+5 -1
View File
@@ -296,7 +296,11 @@ fn the_threshold_leaves_shallow_modulation_where_it_found_it() {
// under the 12.5% at which the gate below starts letting detail through.
let ripple: Vec<u8> = (0..SIZE * SIZE)
.flat_map(|i| {
let v = if (i % SIZE) % 2 == 0 { 128u8 } else { 132 };
let v = if (i % SIZE).is_multiple_of(2) {
128u8
} else {
132
};
[v, v, v, 255]
})
.collect();
+2 -2
View File
@@ -204,7 +204,7 @@ fn a_difference_below_the_threshold_is_averaged_and_one_above_it_is_not() {
/// [`chroma_r`] is what keeps it out of the measurements.
fn chroma_pattern(ctx: &GpuContext, size: u32, half_period: u32, swing: i32) -> DemosaicedImage {
upload(ctx, size, move |x, _| {
let on = (x / half_period) % 2 == 0;
let on = (x / half_period).is_multiple_of(2);
let d = if on { swing } else { -swing };
[(128 + d) as u8, 128, (128 - d) as u8]
})
@@ -244,7 +244,7 @@ fn modulation(
let mut count = 0.0;
for x in margin..(width - margin) {
let value = sample(linear(pixels, width, x, row));
let sign = if (x / half_period) % 2 == 0 {
let sign = if (x / half_period).is_multiple_of(2) {
1.0
} else {
-1.0