Skip to content

test(video): prove the VA-API decode, scale and encode path stays on GPU - #7618

Merged
kixelated merged 5 commits into
mainfrom
test/vaapi-intel-ladder
Nov 2, 2026
Merged

kixelated merged 5 commits into
mainfrom
test/vaapi-intel-ladder

Conversation

@kixelated

@kixelated kixelated commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Existing VA-API pixel tests enable OpenH264. They do not establish that a build with no software codec can decode a 1080p source, scale a ladder, and encode every frame without CPU transfers.

Approach

  • Add an ignored hardware-only proof: one 1080p decode feeds 1280×720, 852×480, and 640×360 VPP/encode paths. Assert DMA-BUF decode and resize surfaces, all twelve GPU encodes per rung, and decoded output dimensions/frame counts.
  • Run it in the Intel branch of just rs gpu with Nix libva and iHD paths. Missing hardware fails. Preserve the AMD coverage notice and register the hardware-CI gap against the existing VA-API quest.
  • Keep the existing independent-decoder pixel tests. This additional test establishes residency and the hardware-only build boundary, not color fidelity or independent-decoder conformance.

Impact

  • Public API, wire, and production codec behavior: unchanged.
  • Consumer: the existing just rs gpu Intel hardware runner.

Validation

Head a8695e9fa62a846fe8cadb2e694372bec5ee1e56 (d189454 plus a conflict-free merge of origin/main at 5553907, after moq-dev/moq#7091 landed), run on desktop through quest gate:

  • just ci (base origin/main): passed in 80 s wall time. Every selected module passed: check rs, test rs, markdown, gh (check and test), drill, quest, shell, large_files, toml, nix, justfile. Rust tests: 1454 run, 1454 passed, 58 skipped (ignored or filtered out by the ci profile), this ignored proof among them. The moq-relay Io warning that failed the earlier run is gone.
  • just rs gpu: passed. This host has an Intel Arrow Lake iGPU (8086:7d67, i915, renderD128) and an AMD dGPU (1002:7550, amdgpu, renderD129); no NVIDIA module is loaded, so the NVIDIA branch did not run.
    • AMD: vulkan_gpu_device and the three render-export tests passed. The script prints that AMD VA-API encode and VPP are not covered.
    • Intel: vulkan_gpu_device and the three render-export tests passed, and so did vaapi_1080p_ladder_stays_on_the_gpu (0.397 s, with Nix libva and iHD). MOQ_VAAPI_DEVICE was unset. Auto-selection chose the Intel node, because with LIBVA_DRIVER_NAME=iHD forced the AMD node fails the encode/decode/VPP probe (rs/moq-video/src/frame/vaapi.rs).
  • quest check --base origin/main: 551 documents ok.

Earlier validation on d189454: just fix, just rs check-test -p moq-video --no-default-features --features vaapi (133 passed, the proof ignored), and the explicit proof against both the Nix iHD 26.3.5 and the host's iHD 26.1.2.

Reproduce the proof alone inside nix develop:

va=$(nix build --inputs-from . --no-link --print-out-paths nixpkgs#libva.out)
media=$(nix build --inputs-from . --no-link --print-out-paths nixpkgs#intel-media-driver)
MOQ_VAAPI_DEVICE=/dev/dri/renderD128 LD_LIBRARY_PATH="$va/lib" \
  LIBVA_DRIVERS_PATH="$media/lib/dri" LIBVA_DRIVER_NAME=iHD \
  quest gate just rs test -p moq-video --no-default-features --features vaapi \
  --lib --run-ignored only -E 'test(vaapi_1080p_ladder_stays_on_the_gpu)' --no-capture

Alternatives

Enabling OpenH264 to reuse the pixel-test module would remove the build boundary this proof tests. Wiring every older optional hardware test into CI belongs to the existing GPU CI work.

Review

quest review --base origin/main --harness claude, Claude Code, claude-opus-5-5, medium effort, round 2, head d18945462bbd9dc5d7a7535288b4c8a7fa3366f6: no findings.

Round 1: fixed the AMD coverage notice and both decoder-name assertions. Refuted broadening this hardware-only residency proof into independent pixel/conformance coverage. That coverage stays in the existing OpenH264-backed tests, and the new test now states its narrower contract.

That record covers head a8695e9fa62a846fe8cadb2e694372bec5ee1e56: the only change since is a conflict-free merge of origin/main. git diff origin/main...a8695e9 matches git diff origin/main...d189454 byte for byte except one blob index line, in sh/gh/test-inventory.allow, where nearby context moved on main.

Follow-ups

The existing VA-API quest retains the remaining codec/bindings work and hardware CI ownership. No new quest is created.

(Written by GPT-6.1 Sol; merge, validation, and review record updated by Claude Opus 5.5)

kixelated and others added 4 commits November 1, 2026 22:32
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
@kixelated
kixelated marked this pull request as ready for review November 2, 2026 23:45
@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 630647fb-8abe-478e-8b02-610e6db6c061
Commits

Reviewing files that changed from the base of the PR and between 5553907 and a8695e9.

Files selected for processing: 4
  • quest/m2/video-vaapi.md
  • rs/moq-video/src/encode/backend/vaapi.rs
  • sh/gh/test-inventory.allow
  • sh/rs/gpu.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed commit: a8695e9

No actionable bugs found. The hardware-only ladder test complements the existing independent-decoder pixel tests: it checks decode/resize residency, every rung’s GPU encode count, and decoded dimensions/frame counts without changing production APIs or wire behavior. Keeping these distinct tests is simpler than coupling residency coverage to a software codec.

Verification: static review of the test, Intel runner wiring, and relevant VAAPI selection, resize, encode and decoder-flush paths. No builds, tests or GPU checks run; the reported hardware results were not independently reproduced.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • VA-API hardware ladder proof (rs/moq-video/src/encode/backend/vaapi.rs): new #[ignore] test vaapi_1080p_ladder_stays_on_the_gpu compiles without any software codec, encodes a 12-frame 1080p source on hardware, decodes it to DMA-BUFs, then VPP-scales and re-encodes each rung (720p/480p/360p), asserting DMA-BUF residency, gpu_frames == 12, refused.is_empty(), and decoded sizes/counts.
  • Intel hardware runner (sh/rs/gpu.sh): the Intel branch now builds Nix libva + intel-media-driver and runs the proof under LIBVA_DRIVER_NAME=iHD; the AMD branch prints its coverage notice and both share the final "Vulkan driver verified" echo.
  • Test inventory (sh/gh/test-inventory.allow): registers the ignored test as an orphan owned by /quest/m2/video-vaapi.md, matching its module path.
  • Quest doc (quest/m2/video-vaapi.md): records that just rs gpu runs the proof on Intel.

Traced the test against the backend and front end: a fresh VA-API encoder's first picture is an IDR, so the decoder's keyframe gate opens; VA-API encode/decode are synchronous one-in one-out, so the frame-count assertions hold; Surface::resize preserves the decoded BT.709 label and Vaapi::new accepts it at every rung; and gpu_frames/refused catch a CPU fallback. recipe rs::gpu is already a manual-runner orphan, so the new ignore entry is correctly required and the path matches encode::backend::vaapi::hardware_tests::.... No behavioral surface beyond the hardware runner.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit b7187a4 Nov 2, 2026
10 checks passed
@kixelated
kixelated deleted the test/vaapi-intel-ladder branch November 2, 2026 23:58
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