Repository navigation
fix(arm64): adm_dwt2_8_neon dropped the 4th filter tap at j=0 (ADR-1057 rediagnosed) - #1134
Merged
Merged
Conversation
The aarch64 Netflix golden failure (akiyo 88.030322 vs 88.030463, delta
1.41e-04, three failing assertions on Build - Ubuntu ARM clang (CPU)) is an
integer off-by-one, not the FMA-contraction problem ADR-1057 describes.
adm_dwt2_8_neon special-cases the j = 0 output column because its source indices
are mirrored ({1, 0, 1, 2} rather than the regular 2j-1..2j+2 stride). That
special case accumulated with
for (int idx = 0; idx < 3; idx++)
while the scalar reference adm_dwt2_8 in core/src/feature/integer_adm.c
multiplies all four taps (filter_lo[0..3] against s0..s3 from ind_x[0..3][j]).
The NEON path therefore dropped ind_x[3][0] and its coefficient -4240 from the
first output column of every DWT2 row, on every scale. Fix: idx < 4.
Why ADR-1057's diagnosis was wrong: integer ADM accumulates in int64, so FP
contraction cannot affect it. Building the entire tree with -ffp-contract=off on
aarch64 leaves the score at 88.030322, byte-for-byte unchanged. That is why
PR #1060's fp-contract approach could not have worked and #1063 reverted it.
Reproduced and fixed locally without a CI round-trip, using an
aarch64-linux-gnu-gcc cross-build under qemu-aarch64-static:
NEON integer_adm2=1.116698 adm3=1.052571 scale3=1.13728
-Denable_asm=false integer_adm2=1.116701 adm3=1.052573 scale3=1.13729
NEON + -ffp-contract=off 88.030322 (unchanged - rules out FP contraction)
after this fix 38 passed, 1 skipped, 0 failed on aarch64
(vmafexec_test.py + result_test.py, all akiyo
golden assertions included)
x86 is unaffected: the change is confined to core/src/feature/arm64/adm_neon.c.
No NEON-vs-scalar parity test covers the ADM DWT2 kernels on any architecture -
test_integer_adm_simd.c only exercises adm_cm_avx2 - which is how a three-vs-four
tap error shipped. Only the ARM golden leg caught it, and that leg is not a
required check, so it stayed red. Both gaps are worth closing separately.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
lusoris
enabled auto-merge (squash)
August 30, 2026 11:28
26 of 31 tasks
5 of 9 tasks
lusoris
added a commit
that referenced
this pull request
Sep 6, 2026
The ledger row for T-NEON-FMA-FLOAT-ADM-DWT2-2026-06-06 was self-contradictory: a 2026-06-27 note inside the T-MASTER-CI-TSAN-ARM-GOLDEN-2026-06-27 row said the bug "stays Open" for a correct re-attempt, while its Recently-closed row already recorded a 2026-08-30 closure — and that closure narrative described only the integer-path dropped-tap defect and cited a branch name (`fix/adr-1057-arm-fma-drift`) instead of a commit. Re-verified against origin/master, with no defective code left to point at: - The float-ADM follow-up the row asked for landed in `a6c4dfffb` (PR #853): the kernel lives in a dedicated non-contracting TU `core/src/feature/arm64/float_adm_dwt2_neon.c`, built with `-ffp-contract=off` (`core/src/meson.build`), and `adm_dwt2_dispatch()` in `core/src/feature/adm.c` calls `float_adm_dwt2_neon()` under `VMAF_ARM_CPU_FLAG_NEON`. The scalar `adm_dwt2_s` carries the matching function-scoped guard, so both sides of the comparison are non-contracting and the 1-ULP FMA gap that motivated the row cannot arise. - The integer `idx < 3` dropped filter tap in `adm_dwt2_8_neon` was fixed by `a013c1410` (PR #1134) and hardened to bit-exactness by `89a8e3258` (PR #1154); `6d61106ed` (PR #1156) added NEON parity tests for the remaining uncovered kernels. - `core/test/test_float_adm_dwt2_neon.c` gates NEON-vs-scalar bit-exactness by bit pattern and is registered in the default `fast` suite. The row stays in "Recently closed" (exactly one row for the id), rewritten in past tense with real commit shas, and the stale "stays Open" note is marked superseded so the next session does not re-investigate. Documentation only — no code or behaviour change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lusoris
added a commit
that referenced
this pull request
Sep 6, 2026
The ledger row for T-NEON-FMA-FLOAT-ADM-DWT2-2026-06-06 was self-contradictory: a 2026-06-27 note inside the T-MASTER-CI-TSAN-ARM-GOLDEN-2026-06-27 row said the bug "stays Open" for a correct re-attempt, while its Recently-closed row already recorded a 2026-08-30 closure — and that closure narrative described only the integer-path dropped-tap defect and cited a branch name (`fix/adr-1057-arm-fma-drift`) instead of a commit. Re-verified against origin/master, with no defective code left to point at: - The float-ADM follow-up the row asked for landed in `a6c4dfffb` (PR #853): the kernel lives in a dedicated non-contracting TU `core/src/feature/arm64/float_adm_dwt2_neon.c`, built with `-ffp-contract=off` (`core/src/meson.build`), and `adm_dwt2_dispatch()` in `core/src/feature/adm.c` calls `float_adm_dwt2_neon()` under `VMAF_ARM_CPU_FLAG_NEON`. The scalar `adm_dwt2_s` carries the matching function-scoped guard, so both sides of the comparison are non-contracting and the 1-ULP FMA gap that motivated the row cannot arise. - The integer `idx < 3` dropped filter tap in `adm_dwt2_8_neon` was fixed by `a013c1410` (PR #1134) and hardened to bit-exactness by `89a8e3258` (PR #1154); `6d61106ed` (PR #1156) added NEON parity tests for the remaining uncovered kernels. - `core/test/test_float_adm_dwt2_neon.c` gates NEON-vs-scalar bit-exactness by bit pattern and is registered in the default `fast` suite. The row stays in "Recently closed" (exactly one row for the id), rewritten in past tense with real commit shas, and the stale "stays Open" note is marked superseded so the next session does not re-investigate. Documentation only — no code or behaviour change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lusoris
added a commit
that referenced
this pull request
Sep 6, 2026
The ledger row for T-NEON-FMA-FLOAT-ADM-DWT2-2026-06-06 was self-contradictory: a 2026-06-27 note inside the T-MASTER-CI-TSAN-ARM-GOLDEN-2026-06-27 row said the bug "stays Open" for a correct re-attempt, while its Recently-closed row already recorded a 2026-08-30 closure — and that closure narrative described only the integer-path dropped-tap defect and cited a branch name (`fix/adr-1057-arm-fma-drift`) instead of a commit. Re-verified against origin/master, with no defective code left to point at: - The float-ADM follow-up the row asked for landed in `a6c4dfffb` (PR #853): the kernel lives in a dedicated non-contracting TU `core/src/feature/arm64/float_adm_dwt2_neon.c`, built with `-ffp-contract=off` (`core/src/meson.build`), and `adm_dwt2_dispatch()` in `core/src/feature/adm.c` calls `float_adm_dwt2_neon()` under `VMAF_ARM_CPU_FLAG_NEON`. The scalar `adm_dwt2_s` carries the matching function-scoped guard, so both sides of the comparison are non-contracting and the 1-ULP FMA gap that motivated the row cannot arise. - The integer `idx < 3` dropped filter tap in `adm_dwt2_8_neon` was fixed by `a013c1410` (PR #1134) and hardened to bit-exactness by `89a8e3258` (PR #1154); `6d61106ed` (PR #1156) added NEON parity tests for the remaining uncovered kernels. - `core/test/test_float_adm_dwt2_neon.c` gates NEON-vs-scalar bit-exactness by bit pattern and is registered in the default `fast` suite. The row stays in "Recently closed" (exactly one row for the id), rewritten in past tense with real commit shas, and the stale "stays Open" note is marked superseded so the next session does not re-investigate. Documentation only — no code or behaviour change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lusoris
added a commit
that referenced
this pull request
Sep 7, 2026
The ledger row for T-NEON-FMA-FLOAT-ADM-DWT2-2026-06-06 was self-contradictory: a 2026-06-27 note inside the T-MASTER-CI-TSAN-ARM-GOLDEN-2026-06-27 row said the bug "stays Open" for a correct re-attempt, while its Recently-closed row already recorded a 2026-08-30 closure — and that closure narrative described only the integer-path dropped-tap defect and cited a branch name (`fix/adr-1057-arm-fma-drift`) instead of a commit. Re-verified against origin/master, with no defective code left to point at: - The float-ADM follow-up the row asked for landed in `a6c4dfffb` (PR #853): the kernel lives in a dedicated non-contracting TU `core/src/feature/arm64/float_adm_dwt2_neon.c`, built with `-ffp-contract=off` (`core/src/meson.build`), and `adm_dwt2_dispatch()` in `core/src/feature/adm.c` calls `float_adm_dwt2_neon()` under `VMAF_ARM_CPU_FLAG_NEON`. The scalar `adm_dwt2_s` carries the matching function-scoped guard, so both sides of the comparison are non-contracting and the 1-ULP FMA gap that motivated the row cannot arise. - The integer `idx < 3` dropped filter tap in `adm_dwt2_8_neon` was fixed by `a013c1410` (PR #1134) and hardened to bit-exactness by `89a8e3258` (PR #1154); `6d61106ed` (PR #1156) added NEON parity tests for the remaining uncovered kernels. - `core/test/test_float_adm_dwt2_neon.c` gates NEON-vs-scalar bit-exactness by bit pattern and is registered in the default `fast` suite. The row stays in "Recently closed" (exactly one row for the id), rewritten in past tense with real commit shas, and the stale "stays Open" note is marked superseded so the next session does not re-investigate. Documentation only — no code or behaviour change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lusoris
added a commit
that referenced
this pull request
Sep 7, 2026
…#1331) The ledger row for T-NEON-FMA-FLOAT-ADM-DWT2-2026-06-06 was self-contradictory: a 2026-06-27 note inside the T-MASTER-CI-TSAN-ARM-GOLDEN-2026-06-27 row said the bug "stays Open" for a correct re-attempt, while its Recently-closed row already recorded a 2026-08-30 closure — and that closure narrative described only the integer-path dropped-tap defect and cited a branch name (`fix/adr-1057-arm-fma-drift`) instead of a commit. Re-verified against origin/master, with no defective code left to point at: - The float-ADM follow-up the row asked for landed in `a6c4dfffb` (PR #853): the kernel lives in a dedicated non-contracting TU `core/src/feature/arm64/float_adm_dwt2_neon.c`, built with `-ffp-contract=off` (`core/src/meson.build`), and `adm_dwt2_dispatch()` in `core/src/feature/adm.c` calls `float_adm_dwt2_neon()` under `VMAF_ARM_CPU_FLAG_NEON`. The scalar `adm_dwt2_s` carries the matching function-scoped guard, so both sides of the comparison are non-contracting and the 1-ULP FMA gap that motivated the row cannot arise. - The integer `idx < 3` dropped filter tap in `adm_dwt2_8_neon` was fixed by `a013c1410` (PR #1134) and hardened to bit-exactness by `89a8e3258` (PR #1154); `6d61106ed` (PR #1156) added NEON parity tests for the remaining uncovered kernels. - `core/test/test_float_adm_dwt2_neon.c` gates NEON-vs-scalar bit-exactness by bit pattern and is registered in the default `fast` suite. The row stays in "Recently closed" (exactly one row for the id), rewritten in past tense with real commit shas, and the stale "stays Open" note is marked superseded so the next session does not re-investigate. Documentation only — no code or behaviour change. Co-authored-by: Lusoris <lusoris@pm.me> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.
What
Fixes the aarch64 Netflix golden failure. One character:
idx < 3→idx < 4.The bug
adm_dwt2_8_neonspecial-cases thej = 0output column because its sourceindices are mirrored (
{1, 0, 1, 2}rather than the regular2j-1 .. 2j+2stride). That special case accumulated with:
The scalar reference
adm_dwt2_8(core/src/feature/integer_adm.c:2606)multiplies all four taps —
filter_lo[0..3]againsts0..s3fromind_x[0..3][j]. The NEON path therefore droppedind_x[3][0]and itscoefficient
-4240from the first output column of every DWT2 row, on everyscale.
ADR-1057's diagnosis was wrong
ADR-1057 attributes this to
float-ADM NEON FMA contraction. It is not an FP problem at all — integer ADM
accumulates in
int64. Proof: building the entire tree with-ffp-contract=offon aarch64 leaves the score at88.030322, byte-for-byteunchanged. That is why PR #1060's fp-contract approach could not have worked and
#1063 reverted it.
Reproduced locally — no CI round-trip needed
aarch64-linux-gnu-gcccross-build run underqemu-aarch64-static, driving thereal pytest harness via a shim at
core/build/tools/vmaf:integer_adm2adm3adm_scale3-Denable_asm=false-ffp-contract=offThe final row covers
vmafexec_test.py+result_test.pyon aarch64, includingevery akiyo golden assertion.
x86 is unaffected — the diff touches only
core/src/feature/arm64/adm_neon.c.Two gaps this exposes
architecture.
test_integer_adm_simd.conly exercisesadm_cm_avx2. Athree-vs-four tap error shipped because nothing compares the kernels directly.
rather than blocking a merge.
Both are worth closing separately; neither is in scope here.
Deep-dive deliverables
changelog.d/fixed/adr-1057-adm-neon-dwt2-tap.mdReproducer / smoke-test command
Bug status hygiene
docs/state.mdupdated —T-NEON-FMA-FLOAT-ADM-DWT2-2026-06-06moved to Recently closed with the corrected root cause.