#2504: the dehaze regression test also fails when the whole dark field renders black

Review follow-up (CodeRabbit): an all-black field made every comparison pass, so the field's own level must stay visible first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AbegtYaPuwqZ81pGfELsFK
This commit is contained in:
Claude
2026-10-22 11:42:59 +00:00
parent 9122443f22
commit c21714a379
+2
View File
@@ -96,6 +96,8 @@ fn dehaze_does_not_crush_dark_regions_next_to_bright_ones() {
}
v.sort_unstable();
let mid = v[v.len() / 2] as i32;
// a field rendered all black would pass the comparison below vacuously
assert!(mid > 2, "the dark field itself is crushed in ch {ch}: level {mid}");
for y in 0..160 {
for x in 0..120 {
let p = r.get(x, y)[ch] as i32;