Skip to content

Test fixtures

Run scripts/test/fetch-test-yuvs.sh once per checkout to provision the YUV clips that the Python tests (python/test/quality_runner_test.py, python/test/feature_extractor_test.py) and the Netflix golden gate read.

The clips live outside the repository. Netflix removed them upstream in 2020 (commit bac8b6073) and moved them to the sibling repository https://github.com/Netflix/vmaf_resource. The local target directory python/test/resource/yuv/ is gitignored, so it is absent in a fresh tree.

Provisioning fixtures locally

scripts/test/fetch-test-yuvs.sh

The script:

  • Downloads seven files into python/test/resource/yuv/ when they are not already present: src01_hrc00_576x324.yuv and src01_hrc01_576x324.yuv (576x324), checkerboard_1920_1080_10_3_0_0.yuv, checkerboard_1920_1080_10_3_1_0.yuv and checkerboard_1920_1080_10_3_10_0.yuv (1920x1080), and the two single-frame HDR clips ref_dock-na-HDR_res2160_..._576x324_1frame.yuv / dis_dock-na-HDR_res1440_..._576x324_1frame.yuv (576x324, yuv420p10le, PQ / BT.2020nc / limited range; the files carry no colorimetry). The HDR pair is read by python/test/vmafexec_color_args_test.py and is not part of the golden gate.
  • Verifies the md5 sum of every file against hardcoded expected values. A local file with the right name but the wrong content is detected, deleted and downloaded again.
  • Is idempotent. Re-running on a fully provisioned tree prints ok <name> (md5 verified) for each fixture and exits 0.

The first five files are the three Netflix test pairs of the CPU golden gate (normal, checkerboard 1-px, checkerboard 10-px; see section 8 of AGENTS.md and ADR-0024). The cross-backend VIF and motion diff jobs that CI runs use them too.

Why md5 verification matters

The script refuses a file whose md5 differs from the expected value and fetches it again. A mismatch is reported at provision time:

stale   src01_hrc00_576x324.yuv (md5 4226fb7e…, want b16f67d3…) — refetching

Note

A stale local copy with the canonical name and size but different content once produced 84 test failures in the feature_extractor_test.py and quality_runner_test.py suites (2026-05-17). The assertion errors looked like extractor bugs (VIF score about twice the expected value), but the cause was a fixture content mismatch. See ADR-0493.

To provision some of the files only, name them:

scripts/test/fetch-test-yuvs.sh src01_hrc00_576x324.yuv src01_hrc01_576x324.yuv

A name that is not in the script's FIXTURES list is refused (exit 2).

Provisioning fixture bundles

The script can also provision multi-file test bundles packaged as compressed archives:

scripts/test/fetch-test-yuvs.sh --bundle pq-sollevante-v1

The pq-sollevante-v1 bundle packages an 8-frame 1080p real-motion PQ fixture derived from the open-content Sol Levante material, along with licensing and credit notices:

  • Destination: python/test/resource/yuv/pq-sollevante-v1/
  • Contents: sollevante_ref_1920x1080_8f.yuv, sollevante_dis_1920x1080_8f.yuv, CREDIT.txt, and LICENCE-CC-BY-4.0.txt
  • Validation: downloads pq-sollevante-v1.tar.zst through the retrying download policy, checks archive sha256 before extraction, inspects the table of contents to reject any path traversal or absolute paths, and checks member sha256 sums after extraction. Any mismatch or failed download exits non-zero and leaves nothing in the target directory.
  • Caching: re-running against an already-extracted bundle verifies member hashes and skips re-downloading.

The asset is the prerelease fixtures-pq-sollevante-v1, which holds test data only. make test-netflix-golden and every CI job that runs a test reading the bundle (the golden job, the tox legs and both Coverage jobs) fetch it with the ./.github/actions/pq-fixture action, and a failed download fails them. scripts/ci/check_fixture_bundle_jobs.py fails a workflow job that runs such a test (the whole suite, or the test file by name, also through a scripts/ci/*.sh script it calls) without fetching each bundle the test names as "yuv", "<bundle>"; it runs as a pre-commit and pre-push hook. A plain scripts/test/fetch-test-yuvs.sh does not fetch bundles. CI keeps the bundle in its own cache entry, keyed on the sha that scripts/test/fetch-test-yuvs.sh --print-bundle-sha prints.

Credit: Sol Levante (2020), Netflix Open Content, under Creative Commons Attribution 4.0 International. The VMAFx project cut 8 frames from 00:00:10, scaled them to 1920x1080 and encoded the distorted file with libx265 at CRF 28. CREDIT.txt in the bundle has the details. No endorsement by the licensor is implied.

scripts/test/fetch-test-yuvs.sh --bundle hdr-ictcp-pixels-v1

The hdr-ictcp-pixels-v1 bundle packages pre-converted 1080p and 2160p 16-bit 4:2:0 ICtCp pictures, allowing all legs to score HDR models with the zimg conversion bypassed and assert bit-exact score equality against x86-64:

  • Destination: python/test/resource/yuv/hdr-ictcp-pixels-v1/
  • Contents: CREDIT.txt, LICENCE-BSD-2-Clause-Patent.txt, dis_1920x1080.yuv, dis_3840x2160.yuv, ref_1920x1080.yuv, and ref_3840x2160.yuv
  • Validation: downloads hdr-ictcp-pixels-v1.tar.zst (archive sha256 b5cc0aff25a507fccd4808c8c7c4692db3bdf1a68bd3e77c6f081c5398d4ab1a) through the shared retrying download policy, validates archive sha256 before extraction, rejects path traversal, and verifies member sha256 sums after extraction. Any mismatch or failed download exits non-zero, leaves nothing in the target directory, and fails the job.
  • Caching: re-running against an already-extracted bundle verifies member hashes and skips re-downloading.

The asset is the prerelease fixtures-hdr-ictcp-pixels-v1, which holds test data only. Every leg running HDR pin tests fetches it, and a failed download fails the job. CI keeps the bundle in its own cache entry, keyed on the sha that scripts/test/fetch-test-yuvs.sh --print-bundle-sha hdr-ictcp-pixels-v1 prints.

Credit: source material from Netflix/vmaf_resource under the BSD-2-Clause-Patent licence. CREDIT.txt and LICENCE-BSD-2-Clause-Patent.txt in the bundle have the details.

Download retries

The fixture host sometimes fails for minutes: on 2026-10-10 it answered HTTP 504 from 14:15 to at least 14:18 UTC and two required CI jobs failed on it. Both ways a fixture is downloaded now share one retry policy, compat/python-vmaf/tools/retrying_download.py:

  • scripts/test/fetch-test-yuvs.sh runs that file for every download;
  • download_reactively() in compat/python-vmaf/config.py, which fetches a fixture the first time a Python test asks for it, calls its retrieve().

A download gets seven attempts, with waits of 5, 10, 20, 40, 80 and 120 seconds between them (275 seconds in all). The waits stay below the 600 second per-test timeout of the Coverage Gate's pytest run.

Failure What happens
HTTP 408, 425, 429, 500, 502, 503, 504, 522 or 524 Retried
Refused, reset or timed-out connection, failed name lookup, short body Retried
HTTP 404 and every other status Fails at once
A certificate that does not verify, a full disk Fails at once

When the script cannot download a file after the last attempt it stops and does not try the files after it, which come from the same host. Each retry prints one line on standard error:

download of https://…/src01_hrc00_576x324.yuv: attempt 1 of 7 failed (HTTP Error 504: Gateway Timeout), next in 5 s

CI parity

CI jobs that need the clips run the same script, and the Python tests of the Coverage Gate download further fixtures through download_reactively(). A workflow does not download from Netflix/vmaf_resource on its own (scripts/ci/tests/test_fetch_test_yuvs.py refuses that). If the canonical content in Netflix/vmaf_resource changes, update the script's expected-md5 list.

Fixtures not covered by the script

Some tests reference fixtures that CI does not run on every PR and that the script does not provision:

  • KristenAndSara_1280x720_8bit_processed.yuv
  • the multi-frame and bit-depth src01_* variants

When a CI job activates one of those tests, add the file with its md5 to the FIXTURES array in scripts/test/fetch-test-yuvs.sh.

Other fixture roots

  • testdata/ holds the tracked 48-frame pairs (ref_576x324_48f.yuv / dis_576x324_48f.yuv and the 640x480 pair) and the snapshot JSONs.
  • testdata/bbb is a gitignored 4K clip used by the performance baselines; see backend performance baselines.
  • python/test/resource/yuv/ is the directory this script fills.

Windows volumes or filesystem filter drivers that reject symbolic links (WinError 87) and Windows hosts without the symbolic-link privilege (WinError 1314) fail link creation with OSError. Under HISS-21, test fixtures in scripts/ci/tests probe the target directory before creating a link and skip with a reason naming the probe error when the directory rejects links:

  • Python (scripts/ci/tests/test_*.py): import from scripts.ci.tests import symlink_test_support as links and call links.skip_without_symlinks(<dir>) inside the function that creates the link, before its first Path.symlink_to or os.symlink call, passing the directory that receives the link.
  • Shell (scripts/ci/tests/test-*.sh): source scripts/lib/symlink-probe.sh and guard each link case above ln -s with if reason=$(symlink_probe "<dir>"); then ... else echo "SKIP: <case name>: cannot create a symbolic link in <dir>: $reason"; fi.

The contract test scripts/ci/tests/test_symlink_test_support.py scans every scripts/ci/tests/test_*.py and scripts/ci/tests/test-*.sh file and fails on any unguarded symbolic-link fixture. An ln -s counts as guarded only inside the then branch of an if whose condition calls symlink_probe. No Windows CI leg runs scripts/ci/tests today.