Repository navigation
simd(avx2): fix F64x8::reduce_min/max regression from #435 + before/after disassembly and Mandelbrot results - #436
Merged
Conversation
Adds section 6 to the wide/pulp comparison: measured medians on x86-64-v4 and x86-64-v3 (1 and 4 threads), the pre-PR ndarray reference on v3, the grading of P1-P4 (P3 failed: LLVM had already vectorized most of the old scalar compare loop) and what the hot-loop disassembly shows about the remaining gaps. Blackboard entry added. Docs only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMQaYXab73XQdjqZfAW
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
AdaWorldAPI
marked this pull request as ready for review
November 17, 2026 18:17
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
One code fix, plus the measurements that found it.
Code (
src/simd_avx2.rs, one method pair)The AVX2
F64x8::reduce_min/reduce_maxare back to master's body: an iterator fold over the fixed-size lane array, which is the shapesimd_opsis built on.PR #435 had replaced that body with a hand-written
vminpd/vblendvpdtree. The before/after probe showed the tree was 1.9× slower: 2.15 → 4.03 ns per call, and 21 → 27 instructions. With this fix the method is back to about 2.0 ns and 21 instructions.Results are bit-identical before the PR, after it, and after this fix. No AVX-512 code is touched.
Docs (
.claude/knowledge/simd-crate-comparison-wide-pulp-2026-11-17.md§§ 6–8, blackboard)§ 7: PR #435 before and after, per method (
llvm-objdumpplus timing)U8x64::mask_blendis 10× faster,F32x16compare + select 2.4×, andF32x16reductions 1.6×.§ 6 and § 8: Mandelbrot, wide vs pulp vs ndarray
2^52add andto_bits(), both existing facade methods, ndarray takes 149–154 ms against 152–157 ms for wide8 and 155–156 ms for pulp.select.Working rule recorded: write an operation as a fixed-size-array expression (
as_chunks, thesimd_opshelpers, the typed vectors' own methods) and read the disassembly first. Use intrinsics only where the compiler demonstrably did not vectorize.Verification
tests/simd_lane_masks(including the NaN compatibility tests) andsimd_float_classifypass on v3 and avx.-D warnings, fmt, the facet-stride guard and the ternlog generator check are all clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01XAqKMQaYXab73XQdjqZfAW