diff --git a/crates/trace/src/layers.rs b/crates/trace/src/layers.rs index dba52ee3cd..1a592cd292 100644 --- a/crates/trace/src/layers.rs +++ b/crates/trace/src/layers.rs @@ -722,7 +722,8 @@ impl Layers<'_> { /// /// The marks take two bytes a pixel of the image. In an image with a transparent pixel or a color left out, the /// runs of such pixels take up to four bytes a pixel more during the first round (eight bytes a run). Both count - /// against the half gigabyte that sets how many levels are traced at a time. + /// against the half gigabyte that sets how many levels are traced at a time. The components kept for the second pass + /// take up to [`KEPT_BYTES`] more, outside that half gigabyte. pub(crate) fn stacked( &self, layers: &[(usize, usize)], diff --git a/crates/trace/src/tests.rs b/crates/trace/src/tests.rs index 934ed55880..46d3c7604b 100644 --- a/crates/trace/src/tests.rs +++ b/crates/trace/src/tests.rs @@ -557,7 +557,8 @@ fn overlapping_lines_and_outlines_leave_out_areas_without_their_color() { /// Overlapping: a level's components found with the areas that higher levels fill left out give the same trace as /// those found whole, and as those found again in the second pass (as past the memory kept for them), on a framed -/// image of rings and scattered blobs of eight colors, whatever the Noise. +/// image of rings and scattered blobs of eight colors, whatever the Noise. Traced with several levels at a time, in +/// whatever order the threads take them, it gives the same trace each time. #[test] fn overlapping_gives_the_same_trace_with_covered_areas_left_out() { let colors: [[u8; 4]; 8] = [ @@ -588,6 +589,9 @@ fn overlapping_gives_the_same_trace_with_covered_areas_left_out() { assert!(left_out.palette.len() >= 6 && left_out.paths.len() > 20, "{} colors, {} paths", left_out.palette.len(), left_out.paths.len()); assert_eq!(left_out, whole, "noise {noise}"); assert_eq!(left_out, again, "noise {noise}: found again"); + for run in 0..8 { + assert_eq!(left_out, trace(&img, &p), "noise {noise}: run {run} with several levels at a time"); + } assert_draws(&img, &left_out, &[]); } }