Repository navigation
Close fastlanes test gaps found by mutation testing - #11475
Merged
Merged
Conversation
Mutation testing showed that no test reached this kernel's patch handling: the only test called `is_constant`, which answered from min/max stats before dispatching, so deleting `apply_patches` or changing any of its bounds went unnoticed (22 of 26 viable mutants in the file survived). Call the kernel directly, as the delta kernel's tests do, with patches in a sliced header, full chunks, a trailer, a one-row trailer and outside a slice, and check each answer against `is_constant` on the source. All 26 viable mutants in the file are now caught. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UeniBCBxF4oRz7efstrfC9 Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Merging this PR will not alter performance2 warnings
Comparing Footnotes
|
Mutation testing showed that no delta take selected more positions from one chunk than the chunk holds, which repeated indices allow. `take_grouped` groups positions by chunk without capping a group, and only its whole-chunk decode handles such a group: forcing the selective decode overruns its 1024-value buffer, yet those mutants (`>` to `<` and `==`) survived. Take 1100 repeated positions from one chunk of a 9000-row array, few enough to stay on the grouped path, and compare with the decoded take. Mutation result for take_chunks.rs and delta/compute/take.rs: the 2 take_grouped survivors are caught. Of the other 5, the `AllTrue` arm is a fast path with an equal result, and the 4 in the full-decode heuristic differ only in whether an out-of-bounds index errors at take or when the lazy take executes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UeniBCBxF4oRz7efstrfC9 Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UeniBCBxF4oRz7efstrfC9 Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
A kill matrix from cargo-mutants' per-mutant logs showed that 3 of the 12 cases catch all 26 viable mutants of the kernel: an all-patched array (the only case that catches the cross-chunk comparison), a slice whose header, chunks and trailer hold patches, and a one-row trailer (the only case that catches the trailer range). Drop the other 9. Mutation result with the full crate suite: 26 caught, 0 missed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UeniBCBxF4oRz7efstrfC9 Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
robert3005
approved these changes
Nov 15, 2026
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.
Summary
Mutation testing with cargo-mutants (see #11471) found code in
vortex-fastlanesthat the tests run but never check. This PR adds tests for two such gaps, keeping only the cases that catch distinct mutants. It changes tests only.Changes
Bit-packed
is_constantpatch pathNo test reached the kernel's patch handling. The only test,
is_constant_with_patches, called the publicis_constant, which answered from min/max statistics before dispatching to the kernel. Deletingapply_patches, or changing any of its bounds, went unnoticed: 22 of the 26 viable mutants in the file survived. A temporarypanic!on the patch line confirmed that no test executed it.The test is replaced by
kernel_applies_patches, which callsBitPackedIsConstantKerneldirectly, following the delta kernel's tests. It has threerstestcases at bit width 2:all_patched: 3000 patched values, filling two full chunks and a trailer. Only this case catches the comparison of later chunks against the first chunk's value.patched_inside_sliced: the slice100..2900, whose partial first chunk, full chunk and trailer all hold patches, with packed values outside the slice.patch_in_one_row_trailer: 1025 rows, with the only patch in a one-row trailer. Only this case catches a mutated trailer range (current_idx * chunk_len).I chose these three from 12 candidates using a kill matrix built from cargo-mutants' per-mutant logs: they are a minimum set that catches every viable mutant. Each case states its expected answer and also checks
is_constanton the array againstis_constanton the source data. The cases slice through<BitPacked as SliceKernel>::slice, becauseArrayRef::slicestays a lazySliceArrayover patched arrays.Result for
bitpacking/compute/is_constant.rs: 22 missed and 4 caught before; 0 missed and 26 caught after.Delta take of more than a chunk from one chunk
Repeated indices can select more positions from one chunk than the chunk holds.
take_groupedgroups positions by chunk without capping a group, and only its whole-chunk decode can handle such a group: forcing the selective decode overruns its 1024-value buffer. No delta take test selected that many positions from one chunk, so the mutants that force selective decoding (>to<and to==) survived.take_more_positions_than_a_chunk_from_one_chunktakes 1100 repeated positions from one chunk of a 9000-row array, which is few enough to stay on the grouped path, and compares the result with the decoded take.Result for
take_chunks.rsanddelta/compute/take.rs: 7 survivors before.take_groupedsurvivors are now caught.Mask::AllTruearm is a fast path with an equal result. Add cargo-mutants mutation testing: CI workflow and agent skill #11471 records it as an exclusion.Delta::takefull-decode heuristic. Both paths give equal results, but they handle an out-of-bounds index differently: the grouped path errors at take, while the full-decode path returns a lazy take that errors only when executed. A test that kills these mutants would pin that timing rather than a result.Checks run:
cargo clippy -p vortex-fastlanes --all-targets --all-features -- -D warningscargo +nightly-2026-11-13 fmt -p vortex-fastlanes --checkdevelop, cargo-mutants needs a temporary parse workaround forunpack_iter.rs, which Add cargo-mutants mutation testing: CI workflow and agent skill #11471 makes permanent.🤖 Generated with Claude Code
https://claude.ai/code/session_01UeniBCBxF4oRz7efstrfC9