test(dng): find the maximum black per plane across the repeat pattern - #497
Merged
Conversation
`levels.black()[(j * cols + k) * spp + plane]` walks the black-level repeat pattern to find each plane's largest black, which sets that plane's scale. Mutating `* spp` to `/ spp` collapses the pattern's cells onto one index, so a plane's scale is computed from the wrong black. It went unnoticed because the fixtures covered multiple planes and multiple cells but never both at once: with one sample per pixel the two operators agree, and with a 1x1 pattern the index is `plane` either way. The new fixture is two planes over a 1x2 pattern, where plane 0's blacks are 0 and 40 -- dividing finds a maximum of 0 and stretches the range from 100 to the full 140. This one was missed by the crate's own survey and only turned up on a re-run: its shard had been cut short when the filesystem hit 100%, having tested 25 of its 82 mutants. Worth recording that the truncation was visible -- the shard exited non-zero with an explicit ENOSPC -- rather than passing quietly as a clean result. Refs #110
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #110. Follow-up to #495.
One more
gamut-dngsurvivor, found by re-running four shards that had been cut short during theoriginal sweep.
The survivor
levels.black()[(j * cols + k) * spp + plane]walks the black-level repeat pattern to find eachplane's largest black, which sets that plane's scale. Mutating
* sppto/ sppcollapses thepattern's cells onto one index, so a plane's scale is computed from the wrong black.
Why it needed two things at once
The fixtures covered multiple planes, and they covered multi-cell repeat patterns — but never both
in the same image, and either alone hides it:
* sppand/ sppare the same operation;jandkare both 0, so the index isplaneeither way.The new fixture is two planes over a 1×2 pattern. Plane 0's blacks are 0 and 40, so its range is
140 - 40 = 100; dividing finds a maximum black of 0 and stretches the range to the full 140,changing every sample in that plane.
Provenance, and why #495 said its count was a floor
This was missed by the crate's original survey because the shard holding it exited on ENOSPC
after testing 25 of its 82 mutants — the filesystem hit 100% mid-run. Three further shards were
killed by a per-shard timeout that turned out to be too tight for this crate under load.
#495 recorded its 23 survivors as a floor for exactly this reason, and re-running those four shards
under a longer cap (on a machine with disk headroom) turned up this one. The other three re-runs
found only sites already closed there.
Worth recording that the truncation was visible rather than silent: the shard reported a
non-zero exit with an explicit
No space left on device. Had it been swallowed, dng would havebeen recorded as fully surveyed with a third of that shard untested.
Validation
cargo test -p gamut-dng --all-features,mise run fmt-check,mise run check-testsand clippyall clean. The mutant was applied by hand and confirmed caught.