Skip to content

Move tensor L2 normalize kernel out of its dispatch macro - #11526

Merged
joseph-isaacs merged 2 commits into
developfrom
ji/mutants-macros-tensor
Nov 18, 2026
Merged

joseph-isaacs merged 2 commits into
developfrom
ji/mutants-macros-tensor

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 the L2-normalize row loop was never mutation tested. This moves it out of match_each_float_ptype! into a generic normalize_rows<T>.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UeniBAvrcuvbZMgsM2XrTM

cargo-mutants does not mutate code inside macro invocations, so the
per-row L2 normalization loop written inside the
match_each_float_ptype! body in L2Normalize::execute was never
mutation tested.

Move the loop into a private generic `normalize_rows<T>` that builds
the normalized values and per-row norms, and leave the macro as a thin
dispatch that resolves `T` and calls it. The non-generic array
construction (FixedSizeList, Extension and Struct arrays) now runs
after the dispatch. Floating-point operation order is unchanged.

vortex-mask moves from dev-dependencies to dependencies so the helper
can take the validity `Mask` by reference.

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>
@codspeed

codspeed Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

✅ 1962 untouched benchmarks
⏩ 53 skipped benchmarks1


Comparing ji/mutants-macros-tensor (c518ee3) with develop (7737dbb)

Open in CodSpeed

Footnotes

  1. 53 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@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
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs
joseph-isaacs merged commit a0cb3c6 into develop Nov 18, 2026
80 checks passed
@joseph-isaacs
joseph-isaacs deleted the ji/mutants-macros-tensor branch November 18, 2026 09:59
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