port(libvmaf/feature/x86): AVX2/AVX-512 portability fixes (Netflix PR #1475)#48
Closed
port(libvmaf/feature/x86): AVX2/AVX-512 portability fixes (Netflix PR #1475)#48
Conversation
Adds the deep-dive deliverables for the Netflix PR Netflix#1475 port (cherry-picks c51a73d and 456eaf1 on this branch): - docs/rebase-notes.md entry 0016 documents the invariant (don't revert _mm_extract_epi64 to vector subscripting; don't revert _mm256_castps_si256 to a C-style cast on __m256), notes the collision-free coexistence with entries 0001 (ADM double-precision reduction) and 0013 (motion files mirror upstream), and provides a reproducer. - CHANGELOG.md "Upstream port -- AVX2/AVX-512 portability" entry under the Unreleased section. - Re-runs clang-format on adm_avx2.c after the upstream cast-fix commit landed (the upstream patch added a single-long-line that the fork's clang-format-22 wraps). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Owner
Author
|
Closing as fully superseded by the MSVC Windows portability sweep already on master (rebase-notes 0022, commits Verified by
Merging this PR would revert those refinements. Closing in favour of the master state. No code intent from upstream Netflix PR Netflix#1475 is lost. |
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.
Summary
Cherry-picks Netflix PR #1475
("AVX2: replace non-portable vector indexing & SIMD casts with intrinsic
extraction/reinterpretation") onto fork master.
Two upstream commits land:
c437f43d— replaces GCC vector subscripting (rN[0] + rN[1]) with_mm_extract_epi64/_mm256_extract_epi64acrossadm_avx2.c,adm_avx512.c,motion_avx2.c,motion_avx512.c. The vector-subscriptsyntax is a GCC extension; MSVC and stricter compilers reject it.
b4fcd21b— replaces a stray C-style(__m256i)cast on a__m256operand in
adm_avx2.cwith_mm256_castps_si256.The third upstream commit (
50e772a1, cosmetic indentation fix)collapsed to a no-op against our existing clang-format-22 wrapped
formatting and was skipped.
10 conflicts arose from the fork's own modifications on these same files
(rebase-notes entries 0001 and 0013); all resolved by keeping our
wrapped formatting and adopting upstream's portable intrinsic
substitutions.
Type
port— cherry-pick from upstream Netflix/vmafChecklist
port(...)subject; the two cherry-picks preserve upstream attributionto David C. Manuelda).
meson test -C libvmaf/build→ 27/27 OK.Netflix golden-data gate
assertAlmostEqual(...)score in theNetflix golden Python tests.
(
76.66783).Deep-dive deliverables
substitution; intrinsics-equivalence is documented by Intel.
(substitute the documented portable intrinsic for the GCC extension).
AGENTS.mdinvariant note — covered by the existinglibvmaf/src/feature/x86/AGENTS.mddirection "match upstream byte-for-bytemodulo our wrapped formatting"; the new invariant is captured in
rebase-note 0016.
CHANGELOG.md"lusoris fork" entry — added under### Changed("Upstream port -- AVX2/AVX-512 portability").docs/rebase-notes.mdentry 0016 (numbering mayshift to 0014/0015/0017 depending on PR-fix(ci): coverage gate lcov→gcovr + ORT + lint upstream tests in-tree #46 / PR-fix(libvmaf/feature): free VIF init base pointer on fail path (Netflix PR #1476, leak half) #47 merge order; will
rebase if needed).
Reproducer
```bash
ninja -C libvmaf/build && meson test -C libvmaf/build
libvmaf/build/tools/vmaf -r python/test/resource/yuv/src01_hrc00_576x324.yuv \
-d python/test/resource/yuv/src01_hrc01_576x324.yuv \
-w 576 -h 324 -p 420 -b 8 \
--model version=vmaf_v0.6.1 -o /tmp/vmaf-1475-port.json
grep -E '<metric name="vmaf"' /tmp/vmaf-1475-port.json
Expected: vmaf mean unchanged from entry 0013 (~ 76.66783).
```
Known follow-ups
50e772a1was skipped as a no-op againstour clang-format-22 pass; re-running upstream sync should not surface
it again.
🤖 Generated with Claude Code