Skip to content

pm_stats: S/A over the existing masked SAD word; correct #440's "no such word" - #441

Merged
AdaWorldAPI merged 2 commits into
masterfrom
ccr-85acaff0-oszq40-sad-partials
Nov 25, 2026
Merged

AdaWorldAPI merged 2 commits into
masterfrom
ccr-85acaff0-oszq40-sad-partials

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

EXO-399. The findings note from #440 said that a vpsadbw returning its U64x8 partials did not exist. That was wrong. U64x8::sum8_u8_add_masked(a, keep) (#407) is exactly that word: it is implemented on every backend and takes the selection mask directly. No new primitive is needed.

This PR:

  • adds an arm, sum_abs_sad, built on that word;
  • tests it against the same oracle as the vertical arm, covering tile boundaries and the magnitude bound (12/12 green);
  • records the result and corrects the note in place.

Disable run: masking negatives with P instead of !P makes the test fail.

Measured for S and A, 50% selection, in ns per 64 lanes, two runs per tier:

horizontal vertical (U16x32, #440) sum8_u8_add_masked
AVX-512, L2-resident 2.94–2.97 2.15 1.25–1.33
AVX-512, 16M lanes 3.8–5.9 2.8–5.0 2.7–4.4
AVX2, L2-resident 6.28–6.31 7.8–7.9 4.16–4.17
AVX2, 16M lanes 11.3–12.0 16.3–17.9 6.0–7.5

This word is the fastest on both tiers: 2.3× the horizontal form on AVX-512 and 1.5× on AVX2, the tier where the widening accumulator lost. So the portable rule is to accumulate with sum8_u8_add_masked, and the #440 arm is superseded.


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review November 25, 2026 19:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T19:55:08.127682Z 27ccfea Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AdaWorldAPI
AdaWorldAPI merged commit f9c1375 into master Nov 25, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants