Repository navigation
Move kernel logic out of dispatch macros in small crates - #11525
Conversation
cargo-mutants does not mutate code inside macro invocations, so the unary encode loop written inside the `match_each_unsigned_integer_ptype!` body in `unary_encode` was invisible to mutation testing. Move the loop that writes each value in unary into a private generic `unary_bits<T>` function, leaving the macro as a thin dispatch that resolves `T` and calls it. `Unary::try_new` now runs after the dispatch, since it does not depend on `T`. Behavior and monomorphization are unchanged. 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 the take gather written inside the `match_each_integer_ptype!` body in `<ByteBool as TakeExecute>::take` was invisible to mutation testing. Move the masked/unmasked gather and the out-of-bounds panic into a private generic `take_bytes_into<I>` function, leaving the macro as a thin dispatch that resolves `I` and calls it. Behavior and monomorphization are unchanged. 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 cannot mutate code inside macro invocations, so logic in a `match_each_*!` body is never mutation tested. Add the rule to the top-level AGENTS.md and the details, with an example, to a new vortex-array/AGENTS.md next to where the dispatch macros are defined. 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 the offset and size conversion loops written inside the `match_each_integer_ptype!` bodies in `list_ranges` were never mutation tested. Move that loop into a private generic `values_to_usize` helper and leave the macro calls as thin dispatch. The helper monomorphizes to the same code and performs the same single collect as before. 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_rules! bodies, so the sign-bit flip and the descending byte inversion written inside `impl_row_encode_unsigned!` and `impl_row_encode_signed!` were never mutation tested. Move that logic into the private `#[inline]` const generic helpers `write_row_bytes` and `write_signed_row_bytes`, leaving the macros to generate only the `impl RowEncode` boilerplate. The bytes written, and the panics on a short `out`, are unchanged. 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_pvalue!` arm is never mutation tested. Keep those arms as thin dispatch and move the logic into private functions: - `Sequence::is_sorted`: the step sign comparisons move into `step_is_sorted`, shared by the unsigned and signed arms (for an unsigned step, `step >= 0` is always true, matching the old `!strict || v > 0`). - `SequenceData::normalize`: the unsigned-step canonicalization (`i64` when it fits, else `u64`) moves into `canonical_unsigned_step`. - `eval::step_parts`: the signed direction and magnitude move into `signed_step_parts`. Behavior is unchanged. 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 the run-end slicing logic written inside the match_each_unsigned_integer_ptype! body in run_end_to_arrow was never mutation tested. Move it into the generic relative_run_ends<E> helper, which picks the runs covering the slice and rebases their ends onto the slice offset. The macro now only resolves E and calls the helper; the code monomorphizes as before. 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 the bloom filter's float accumulation loop, written inline in a match_each_float_ptype! body, was never mutation tested. The loop was identical to the existing generic insert_integer_slice helper used by the integer path. Rename that helper to insert_primitive_slice and dispatch both the float and integer paths to it, so the macro bodies only resolve the type and call the helper. 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>
Put the AGENTS.md beside `ptype.rs`, which declares the `match_each_*_ptype!` macros, instead of at the vortex-array root, so it is the nearest guidance for that code and moves with it when vortex-array is split. Point the top-level rule at the new path. 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>
Merging this PR will improve performance by 10.52%2 warnings
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
cargo-mutants does not mutate code inside macro invocations, so logic written in a `match_each_integer_ptype!` body is never mutation tested. `OnPairDecodePlan::new` summed the uncompressed lengths with a checked fold inside the macro body. Move that fold into a generic `sum_lengths` function and keep the macro call as a thin dispatch. The function is monomorphized per length type exactly as the inline body was. 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>
|
CI status: these failures don't come from this PR.
Generated by Claude Code |
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
cargo-mutants can't mutate code inside macros, so logic in
match_each_*!bodies is never mutation tested. This moves that logic into small generic helpers in elias-fano, bytebool, row, sequence, arrow, layout and onpair, and documents the rule invortex-array/src/dtype/AGENTS.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01UeniBAvrcuvbZMgsM2XrTM