Skip to content

feat(upstream): port c70debb1 — adm+vif test deltas#211

Merged
lusoris merged 2 commits intomasterfrom
upstream/port-c70debb1-adm-vif-tests
Apr 30, 2026
Merged

feat(upstream): port c70debb1 — adm+vif test deltas#211
lusoris merged 2 commits intomasterfrom
upstream/port-c70debb1-adm-vif-tests

Conversation

@lusoris
Copy link
Copy Markdown
Owner

@lusoris lusoris commented Apr 29, 2026

Summary

  • Cherry-picks the additive halves of Netflix upstream commit
    c70debb1
    ("libvmaf/test: port new adm/vif/speed tests", Kyle Swanson,
    2026-04-28): the new adm_csf_tools.h header (declaring the
    inline adm_native_csf DLM-CSF helper) and two new unit-test
    files: test_adm_csf.c (2 cases) + test_barten_csf.c (23
    cases).
  • Resolves audit row T-NEW-2 from the
    2026-04-29 quarterly upstream-backlog re-audit (PR #205).
  • The other two halves of c70debb1 are deliberately deferred:
    • test_vif_tools.c depends on the upstream vif runtime-helper
      chain (NUM_KERNELSCALES, vif_validate_kernelscale,
      vif_get_filter, speed_get_antialias_filter, a
      [NUM_KERNELSCALES][5][65] filter table) that the fork skips
      per Research-0024
      Strategy E to protect the ADR-0138 / 0139 / 0142 / 0143 SIMD
      bit-exactness contract.
    • test_speed_chroma.c #includes feature/speed.c, which the
      fork does not yet ship (audit row T-NEW-1).

Test plan

  • Buildmeson setup build-cpu libvmaf -Denable_cuda=false -Denable_sycl=false && ninja -C build-cpu. Clean.
  • New tests passmeson test -C build-cpu test_adm_csf test_barten_csf → 2 / 2 OK.
  • Full CPU unit-test suitemeson test -C build-cpu → 39 / 39 OK.
  • Lint-clean on touched filesclang-tidy -p build-cpu libvmaf/test/test_adm_csf.c libvmaf/test/test_barten_csf.c → 0 surfacing warnings (one // NOLINTNEXTLINE(readability-function-size) on test_barten_csf with inline justification per CLAUDE.md §12 r12 + ADR-0141: the long verbatim mu_assert list is held against upstream so future syncs stay trivial).
  • pre-commitpre-commit run --files <touched> → all hooks pass.
  • Netflix golden gatemake test-netflix-golden → the 3 canonical golden VMAF assertions remain green; the 9 unrelated failures (NIQE pickle / PyPSNR / FileSystemResultStore) are pre-existing on master and untouched by this PR.

Reproducer:

meson setup build-cpu libvmaf -Denable_cuda=false -Denable_sycl=false
ninja -C build-cpu test_adm_csf test_barten_csf
meson test -C build-cpu test_adm_csf test_barten_csf

Deep-dive deliverables (ADR-0108)

  • no research digest needed: pure upstream cherry-pick.
  • no alternatives: only-one-way upstream port.
  • no rebase-sensitive AGENTS invariants in this PR.
  • Reproducer / smoke-test command — see Test plan.
  • CHANGELOG.md entry — Unreleased § Changed.
  • Rebase notedocs/rebase-notes.md upstream-merge marker.

🤖 Generated with Claude Code

Cherry-pick the additive halves of Netflix upstream commit c70debb
("libvmaf/test: port new adm/vif/speed tests", Kyle Swanson,
2026-04-28). Adds:

- libvmaf/src/feature/adm_csf_tools.h (verbatim, declares the inline
  adm_native_csf DLM-CSF helper).
- libvmaf/test/test_adm_csf.c (verbatim modulo `static` on
  almost_equal + clang-format reflow; 2 mu_assert cases).
- libvmaf/test/test_barten_csf.c (verbatim modulo `static` on
  almost_equal + clang-format reflow; 23 mu_assert cases over
  barten_rod_cone_sens / barten_mtf / barten_csf /
  linear_interpolate / barten_watson_blend_csf).
- libvmaf/test/meson.build registers the two executables and
  test() entries.

The other two halves of c70debb are deliberately deferred:

- test_vif_tools.c depends on the upstream `vif` runtime-helper
  chain (NUM_KERNELSCALES, vif_validate_kernelscale,
  vif_get_filter, speed_get_antialias_filter, a [_][5][65] filter
  table) that the fork skips per Research-0024 Strategy E to
  protect the ADR-0138 / 0139 / 0142 / 0143 SIMD bit-exactness
  contract.
- test_speed_chroma.c #includes feature/speed.c, which the fork
  does not yet ship (audit row T-NEW-1).

Tracked alongside the 2026-04-29 quarterly upstream-backlog
re-audit (PR #205); resolves audit row T-NEW-2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lusoris lusoris force-pushed the upstream/port-c70debb1-adm-vif-tests branch from c1c4ee3 to 29a3b12 Compare April 30, 2026 07:21
…ow-up)

MinGW64's <math.h> does not expose M_PI by default, causing
adm_csf_tools.h:36 to fail with "'M_PI' undeclared" on the Windows CI
job. Define _USE_MATH_DEFINES before <math.h> (so MSVC and conforming
MinGW configurations expose the constant) and add a literal fallback
after the include so any non-conforming libm still compiles.

Linux/glibc was already fine; verified test_adm_csf still passes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lusoris lusoris merged commit e66b510 into master Apr 30, 2026
53 checks passed
@lusoris lusoris deleted the upstream/port-c70debb1-adm-vif-tests branch April 30, 2026 07:49
@github-actions github-actions Bot mentioned this pull request Apr 30, 2026
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.

1 participant