From 554558d7d95c0e96bc742bff79ce59b4704b5a8f Mon Sep 17 00:00:00 2001 From: David Mann Date: Mon, 30 Nov 2026 11:04:12 +0100 Subject: [PATCH 1/2] WIP: split the psd-tools mutation sweep into four parts (#18259) Co-Authored-By: Claude Opus 5.5 From c92a017a23916774423728a94f3bb1556bde3ea6 Mon Sep 17 00:00:00 2001 From: David Mann Date: Mon, 30 Nov 2026 11:15:38 +0100 Subject: [PATCH 2/2] Split the psd-tools mutation sweep into four parts (#18259) The full sweep ran as one test and took 573-600 s on the nightly CI runner, past nextest's 600 s limit on four of the last five nights, which kept the nightly from being signed and published. Each part now takes every fourth file with the same cuts and seeds, so every file still gets the same variants, and fails if it got no file. Co-Authored-By: Claude Opus 5.5 --- crates/io/tests/it/corpus.rs | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/crates/io/tests/it/corpus.rs b/crates/io/tests/it/corpus.rs index 7005e2a71eb..08303881fdd 100644 --- a/crates/io/tests/it/corpus.rs +++ b/crates/io/tests/it/corpus.rs @@ -459,11 +459,14 @@ fn next(state: &mut u64) -> u64 { /// header, resources and layer records live. A full sweep cuts each file at every eighth and /// corrupts it 24 times; other runs cut at every other eighth and keep the first 8 corruptions /// (the same seeds). -fn run_mutations(src: &Source) { +/// +/// The sweep runs in four parts, each taking every fourth file: the psd-tools full sweep in one +/// test ran past nextest's 600 s limit (#18259). Every file still gets the same variants. +fn run_mutations(src: &Source, part: usize) { let (root, files) = files_of(src); let (cut_step, corruptions) = if photocraft_testkit::full_sweep() { (1, 24) } else { (2, 8) }; let (mut runs, mut panics, mut slow) = (0usize, Vec::new(), Vec::new()); - for p in &files { + for p in files.iter().skip(part).step_by(MUTATION_PARTS) { let name = p.strip_prefix(&root).unwrap_or(p).display().to_string(); let Ok(bytes) = std::fs::read(p) else { continue }; let mut seed = 0x9E37_79B9_7F4A_7C15u64 ^ bytes.len() as u64; @@ -510,8 +513,10 @@ fn run_mutations(src: &Source) { } } } - eprintln!("{}: {runs} mutated imports, {} panics, {} slow (> 20 s): {slow:?}", src.label, panics.len(), slow.len()); - assert!(panics.is_empty(), "{}: mutated files panicked (Rule 9): {panics:?}", src.label); + let label = src.label; + eprintln!("{label} part {part}: {runs} mutated imports, {} panics, {} slow (> 20 s): {slow:?}", panics.len(), slow.len()); + assert!(runs > 0, "{label} part {part}: no file was mutated"); + assert!(panics.is_empty(), "{label} part {part}: mutated files panicked (Rule 9): {panics:?}"); } #[test] @@ -529,7 +534,24 @@ fn photoshop_oracle_corpus() { run_oracle(&PHOTOSHOP); } +const MUTATION_PARTS: usize = 4; + #[test] -fn psd_tools_mutations_never_panic() { - run_mutations(&PSD_TOOLS); +fn psd_tools_mutations_never_panic_part_0() { + run_mutations(&PSD_TOOLS, 0); +} + +#[test] +fn psd_tools_mutations_never_panic_part_1() { + run_mutations(&PSD_TOOLS, 1); +} + +#[test] +fn psd_tools_mutations_never_panic_part_2() { + run_mutations(&PSD_TOOLS, 2); +} + +#[test] +fn psd_tools_mutations_never_panic_part_3() { + run_mutations(&PSD_TOOLS, 3); }