ADR-1052: Re-register CPU motion_v2 extractor and fix post-flush test ordering¶
- Status: Accepted
- Date: 2026-06-04
- Deciders: Lusoris
- Tags:
core,motion,test,build
Context¶
PR #532 (commit 6bb5464511) ported upstream Netflix/vmaf commit a4a1492d3, which restructured the motion extractor family. During the port, vmaf_fex_integer_motion_v2 (the CPU pipelined-SAD variant registered under the name "motion_v2") was removed from feature_extractor.c's extern declaration list and from feature_extractor_list[]. The source file integer_motion_v2.c still compiles on GPU-backend builds (it provides the CUDA/SYCL/HIP/Metal motion_v2 CPU fallback), but in a CPU-only build the symbol is unreachable via vmaf_get_feature_extractor_by_name("motion_v2"), causing:
test_motion_v2_missing— every test that callsvmaf_get_feature_extractor_by_name("motion_v2")receives NULL and fails themu_assert("motion_v2 extractor missing", fex != NULL)assertion.test_motion_three_frame—test_motion_three_frame_extract_emits_scorescalledvmaf_feature_collector_get_scoreforVMAF_integer_feature_motion2_scorebeforevmaf_feature_extractor_context_flush(). After the pipelined-rename port,motion2_scoreis deferred toflush(), so the pre-flushget_scorealways returns an error.
Both failures surface on ARM64 CI lanes (Build — Ubuntu ARM clang (CPU)) because those lanes use CPU-only builds where the missing registration is fatal.
Decision¶
Re-register the CPU motion_v2 extractor in three steps:
- Add
feature_src_dir + 'integer_motion_v2.c'to the CPU source list incore/src/meson.buildimmediately afterinteger_motion.c. - Restore
extern VmafFeatureExtractor vmaf_fex_integer_motion_v2;incore/src/feature/feature_extractor.cand add&vmaf_fex_integer_motion_v2tofeature_extractor_list[]alongside&vmaf_fex_integer_motion. - Fix
test_motion_three_frame_extract_emits_scoresto callvmaf_feature_collector_get_scoreformotion2_scoreaftervmaf_feature_extractor_context_flush(), matching the post-port contract.
Alternatives considered¶
| Option | Pros | Cons | Why not chosen |
|---|---|---|---|
| Delete the failing tests | No build change needed | Loses coverage of the pipelined motion path; violates the "re-register is preferable to deleting the test" direction | Not chosen per task constraint |
| Keep motion_v2 only in GPU builds | Reduces CPU binary size slightly | Breaks any caller that requests "motion_v2" on a CPU-only build; breaks the existing coverage tests | Not chosen |
Consequences¶
- Positive:
vmaf_get_feature_extractor_by_name("motion_v2")returns a valid extractor on all build configurations; allmotion_v2coverage tests pass on ARM64 CPU-only CI. - Negative:
integer_motion_v2.cis now compiled into the CPU library again (adds ~5 KB of object code). - Neutral: The
motion_v2_scoredeferred-to-flush contract is now documented in the test comment for future contributors.
References¶
- Introducing PR #532 / commit
6bb5464511(upstream port of Netflix/vmaf@a4a1492d3). - Bisect root-cause reports:
test_motion_v2_missingandtest_motion_three_frame. - Related: ADR-0337 (motion_five_frame_window -ENOTSUP), ADR-0994 (coverage-gate build break).