Skip to content

Move fastlanes kernel logic out of dispatch macros - #11532

Merged
joseph-isaacs merged 3 commits into
developfrom
ji/mutants-macros-fastlanes
Nov 17, 2026
Merged

joseph-isaacs merged 3 commits into
developfrom
ji/mutants-macros-fastlanes

Conversation

@joseph-isaacs

@joseph-isaacs joseph-isaacs commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

cargo-mutants can't mutate code inside macros, so logic in fastlanes' match_each_*! bodies was never mutation tested. This moves it into generic helpers across the bitpacking, delta, FoR and RLE kernels.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UeniBAvrcuvbZMgsM2XrTM

joseph-isaacs and others added 2 commits November 17, 2026 12:42
cargo-mutants does not mutate code inside macro invocations, so logic
written in a `match_each_*!` body is never mutation tested. Keep those
calls as thin dispatches and move the logic into generic functions,
which monomorphize to the same code:

- `block_offsets_typed`: the block offset accumulation loop of
  `block_offsets_from_widths`.
- `has_negative_min`: the negative-minimum check of
  `ensure_non_negative_integers`, whose `unused_comparisons` and
  `absurd_extreme_comparisons` expectation no longer applies.
- `block_boundaries`: reading a block's host offsets in
  `unpack_single_blocked`.
- `set_patch_values`: the patch loop of `apply_patches_to_uninit_range`.
- `set_patch_bits`: the identical patch loops of `constant_result` and
  `stream_compare_fused`, now shared.
- `stream_patched_predicate`: the patched chunk walk of
  `stream_predicate`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UeniBAvrcuvbZMgsM2XrTM
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
cargo-mutants does not mutate code inside macro invocations, so logic
written in a `match_each_*!` body is never mutation tested. Keep those
calls as thin dispatches and move the logic into generic functions,
which monomorphize to the same code:

- `patches_in_positions`: the patch position filter of Delta's
  `chunk_patches`.
- `all_equal` and `all_equal_to`: the value comparisons of Delta's
  `all_valid_is_constant`.
- `set_patch_values`: the patch loop of FoR's `apply_patches`.
- `widen_offsets`: the value-index offset widening of `rle_decompress`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UeniBAvrcuvbZMgsM2XrTM
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs
joseph-isaacs marked this pull request as ready for review November 17, 2026 12:56
@joseph-isaacs
joseph-isaacs enabled auto-merge (squash) November 17, 2026 13:27
@joseph-isaacs joseph-isaacs added the changelog/chore A trivial change label Nov 17, 2026 — with Claude

Copy link
Copy Markdown
Contributor Author

CI status: the failing "Integration smoke tests" job fails on develop too, so it doesn't come from this PR. wasm-test/ has no lockfile and picked up fastlanes 0.8.1, which now requires a 'static bound in rle_decompress.rs (E0310). Fixed in #11543. I'll merge develop into this branch once that lands. This PR edits a different part of the same file (widen_offsets), so the merge should apply cleanly.


Generated by Claude Code

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs
joseph-isaacs merged commit b9fac40 into develop Nov 17, 2026
80 checks passed
@joseph-isaacs
joseph-isaacs deleted the ji/mutants-macros-fastlanes branch November 17, 2026 14:15
connortsui20 added a commit that referenced this pull request Nov 18, 2026
`cargo-mutants` skips macro bodies, so it cannot mutate predicates and
loops inside type dispatch. Generic helpers make that logic available to
mutation testing and preserve static dispatch.

This follows the approach in #11528 and #11532.

This change was prepared with assistance from Codex.

---------

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/chore A trivial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants