fix(test): gate test_speed on enable_float to match speed.c compile guard#263
Merged
fix(test): gate test_speed on enable_float to match speed.c compile guard#263
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR fixes a default-build failure by gating the test_speed Meson executable and test registration behind the same enable_float build option that controls compilation of the underlying speed.c float-only extractors.
Changes:
- Wrap
test_speedexecutable definition inif get_option('enable_float'). - Wrap
test('test_speed', ...)registration inif get_option('enable_float'). - Add a rebase note documenting the rationale and local/CI test commands.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| libvmaf/test/meson.build | Gates test_speed build + registration on enable_float to avoid running it when float-only extractors aren’t compiled. |
| docs/rebase-notes.md | Documents the gating change and provides re-test commands for rebase workflows. |
Comments suppressed due to low confidence (1)
libvmaf/test/meson.build:1
- The same condition is duplicated in two separate places, which increases the chance of drift (e.g., one guard gets updated but the other doesn’t). Consider defining a single
enable_float = get_option('enable_float')variable once and reusing it (or using a single consistent predicate likeenable_float.enabled()), so the gating logic remains synchronized.
if not get_option('enable_tests')
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # wrapped in `#if VMAF_FLOAT_FEATURES`. Gate the test on the same option | ||
| # so a default `meson setup` (enable_float=false) doesn't fail on a | ||
| # config that legitimately omits these extractors. | ||
| if get_option('enable_float') |
| libsvm_static_lib.extract_all_objects(recursive: true), | ||
| ] | ||
| ) | ||
| endif |
| test('test_mobilesal', test_mobilesal) | ||
| test('test_transnet_v2', test_transnet_v2) | ||
| test('test_cambi', test_cambi) | ||
| if get_option('enable_float') |
| test('test_mobilesal', test_mobilesal) | ||
| test('test_transnet_v2', test_transnet_v2) | ||
| test('test_cambi', test_cambi) | ||
| if get_option('enable_float') |
…uard speed_chroma + speed_temporal live in libvmaf/src/feature/speed.c, which the build only compiles when -Denable_float=true. Their entries in the feature_extractor.c registration list are wrapped in `#if VMAF_FLOAT_FEATURES`, so vmaf_get_feature_extractor_by_name returns NULL on a default build (enable_float=false) — the test then fails its first assertion. CI passes -Denable_float=true everywhere, so this never tripped on the hosted runners; a default `meson setup build libvmaf` locally has been returning 49/50 since the SpEED port (Netflix d3647c7 / PR #197) and landing each PR documented the failure as "pre-existing on master". Wrap both the executable() and test() registrations in `if get_option('enable_float')`, matching the pattern test_vulkan_* already uses for its feature gate. The test still runs on every CI build; local default builds now report 47/47 instead of 47/50. Six-deliverable checklist (ADR-0108): - Research digest: no digest needed: trivial — single-config gate - Decision matrix: no alternatives: only-one-way fix (mirror existing enable_vulkan gating pattern) - AGENTS.md invariant note: no rebase-sensitive invariants — meson gate - Reproducer / smoke-test command: see PR body Test plan - CHANGELOG fragment: no changelog needed — test-only change, no user-visible delta - Rebase note: docs/rebase-notes.md entry 0097 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
f466a74 to
5cd2e99
Compare
13 tasks
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
speed_chroma+speed_temporallive inlibvmaf/src/feature/speed.c,which the build only compiles when
-Denable_float=true. Theirregistration entries in
feature_extractor.care guarded by#if VMAF_FLOAT_FEATURES. Thetest_speedtest, however, wasunconditionally registered with meson — so a default
meson setup build libvmaf(which hasenable_float=falsebydefault) returned NULL from
vmaf_get_feature_extractor_by_name("speed_chroma")and failed its first assertion.
CI sets
-Denable_float=trueeverywhere, so this never tripped onhosted runners; locally each PR landed with the failure documented as
"pre-existing on master" (e.g. PR #241, #260).
Fix
Wrap both the
executable()andtest()registrations inif get_option('enable_float'), matching the patterntest_vulkan_*uses for its feature gate.
enable_float=false)test_speedruns and fails (NULL extractor lookup)test_speedis not in the test listenable_float=true)test_speedruns and passes (5/5)Six-deliverable checklist (ADR-0108)
enable_vulkangating).docs/rebase-notes.mdentry 0097.Test plan
test_speed5/5 pass.make pr-check BODY=…clean (deliverables gate self-test).State.md update (CLAUDE.md §12 r13)
default-build failure, not a Netflix upstream report.
🤖 Generated with Claude Code