Finish reconciling the whole-chain tests the three kernels each rewrote

Sharpening, noise reduction and clarity were written in parallel and each
rewrote the same two tests, which had counted one fused block per operation —
true only while every operation was a point function.

Kept the exclusive-or formulation: each operation must reach exactly one of
the two stages. A count cannot tell "moved to the detail stage" from
"vanished from both", and that ambiguity is what broke these tests three
times over.

The merge left two fragments of the versions it replaced — a loop over a set
that no longer exists, and the tail of an assertion whose head was gone.
The loop is not restored: `point ^ neighbourhood` already asserts per
operation what it checked over the set. The assertion is, because it catches
a different fault from the exclusive-or — a block in the shader that nothing
in the chain asked for, rather than an operation in the wrong stage.
This commit is contained in:
2026-08-22 19:34:24 +02:00
parent 35b126449b
commit ec4283e37f
2 changed files with 11 additions and 10 deletions
+11
View File
@@ -1501,6 +1501,17 @@ mod tests {
);
fused_blocks += usize::from(point);
}
// The count the loop above accumulated, plus framing — which emits a
// stage of its own rather than an operation block and is not in
// `descriptors`. Asserted as well as the per-operation exclusive-or
// because the two catch different faults: the XOR catches an operation
// in the wrong stage, this catches a block in the shader that nothing
// in the chain asked for.
assert_eq!(
shader.source.matches("---- ").count(),
fused_blocks + 1,
"the fused shader carries a block nothing in the chain asked for"
);
assert!(
shader.source.contains("---- framing ----"),
-10
View File
@@ -148,16 +148,6 @@ mod tests {
fused_blocks,
"the fused shader carries a block nothing in the chain asked for"
);
// And each neighbourhood operation is genuinely absent from the fused
// shader rather than merely uncounted — the arithmetic above would be
// satisfied just as well by two errors that cancelled.
for id in &neighbourhood {
assert!(
!shader.source.contains(&format!("---- {id} ----")),
"{id} reads its neighbours and cannot be a fused fragment"
);
}
}
#[test]