Skip to content

fix(sycl): clip integer_motion2 score to motion_max_val (1080p checkerboard drift) - #1315

Merged
lusoris merged 1 commit into
masterfrom
fix/sycl-motion2-checkerboard-drift
Sep 6, 2026
Merged

lusoris merged 1 commit into
masterfrom
fix/sycl-motion2-checkerboard-drift

Conversation

@lusoris

@lusoris lusoris commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a numerical parity bug where the SYCL integer motion feature extractor emitted unclipped motion2 and score values when motion_max_val was configured.
In core/src/feature/sycl/integer_motion_sycl.cpp, motion2_clipped = MIN(motion2 * s->motion_fps_weight, s->motion_max_val) was computed, but the feature collector previously appended raw unclipped motion2 (line 841), raw motion_score in debug mode (line 848), and unclipped prev_motion_score in flush_fex_sycl (line 896).
On 1080p checkerboard reference pairs (checkerboard_1920_1080_10_3_0_0.yuv vs ..._1_0.yuv and ..._10_0.yuv), raw motion scores reach ~18.805 (frame 1) and ~18.858 (frame 2), so with motion_max_val=18.0 CPU clamped to 18.0 yielding pooled mean 12.000000, whereas SYCL yielded 12.554712.
Appending motion2_clipped and last_motion2 achieves exact 0 ULP diff on both 1080p checkerboard pairs (12.000000 on both CPU and SYCL) and maintains src01 parity within 1e-5.
The duplicate _x86_simd_strict_fp_extra hunk in core/src/meson.build carried by draft PR #1307 was dropped from this branch.
Parity verified via core/build/test/test_sycl_motion3_parity, python/test/sycl_motion_parity_test.py, and the CLI reproducer on Intel Arc A380.

Type

  • fix — Fix integer_motion2 score clipping to motion_max_val under SYCL backend

Checklist

  • Commits follow Conventional Commits.
  • make format && make lint is green locally (pre-commit on every touched file).
  • Unit tests: test_sycl_motion3_parity extended with 1080p checkerboard test, python/test/sycl_motion_parity_test.py added.
  • Docs in the same PR: docs/backends/sycl/overview.md, docs/rebase-notes.md, docs/state.md.
  • SIMD/GPU, twins, new C sources, breaking change, ADR — SYCL GPU twin fix in core/src/feature/sycl/integer_motion_sycl.cpp; no breaking change; no ADR (parity bug fix).

Bug-status hygiene (ADR-0165)

  • docs/state.md — added T-SYCL-MOTION2-CHECKERBOARD-DRIFT-2026-09-05 to Recently closed.

Netflix golden-data gate (ADR-0024)

  • I did not modify any assertAlmostEqual(...) score in the Netflix golden Python tests.

Deep-dive deliverables (ADR-0108)

  • Research digest — no digest needed: bug fix for integer motion2 clipping on SYCL
  • Decision matrix — no alternatives: only-one-way fix. SYCL twin must match CPU reference clipping semantics
  • AGENTS.md invariant note — no rebase-sensitive invariants: fork-local SYCL feature extractor
  • Reproducer / smoke-test command — below.
  • CHANGELOG fragment — changelog.d/fixed/sycl-motion2-checkerboard-drift.md
  • Rebase note — docs/rebase-notes.md entry

Reproducer

Y=/home/kilian/dev/vmaf/python/test/resource/yuv
core/build/tools/vmaf -r $Y/checkerboard_1920_1080_10_3_0_0.yuv -d $Y/checkerboard_1920_1080_10_3_1_0.yuv -w 1920 -h 1080 -p 420 -b 8 --backend sycl --no_prediction --feature motion_sycl=motion_max_val=18.0 --json -o out_sycl.json
core/build/tools/vmaf -r $Y/checkerboard_1920_1080_10_3_0_0.yuv -d $Y/checkerboard_1920_1080_10_3_1_0.yuv -w 1920 -h 1080 -p 420 -b 8 --no_sycl --no_cuda --no_prediction --feature motion=motion_max_val=18.0 --json -o out_cpu.json
# Both emit pooled integer_motion2_mmxv_18: 12.000000 (was 12.554712 on SYCL)

🤖 Generated with Claude Code

@lusoris lusoris added this to the 1.0.0 — First release milestone Sep 5, 2026
@lusoris
lusoris force-pushed the fix/sycl-motion2-checkerboard-drift branch 3 times, most recently from 7294850 to f4c8102 Compare September 5, 2026 23:11
@lusoris
lusoris force-pushed the fix/sycl-motion2-checkerboard-drift branch from f4c8102 to d090d46 Compare September 6, 2026 02:00
@lusoris
lusoris marked this pull request as ready for review September 6, 2026 02:00
@lusoris
lusoris merged commit 20195f6 into master Sep 6, 2026
118 of 119 checks passed
@lusoris
lusoris deleted the fix/sycl-motion2-checkerboard-drift branch September 6, 2026 02:25
@lusoris lusoris added the type:bug Something isn't working label Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant