Repository navigation
feat(video)!: moq-video configs pick a device and a cursor mode with one typed field each - #8940
Conversation
Quest-Claim: 419329c9e63906ab
encode::Config, decode::Config, resize::Config, encode::Capture, and moq_transcode::Config pick hardware with a moq_video::Device present on every platform and feature set, in place of cfg-gated VA-API and V4L2 paths. A render node also places NVENC and NVDEC on the NVIDIA GPU behind it, matched by PCI address. capture::Config::cursor is a non-exhaustive Cursor enum, and capture::Mode is non-exhaustive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou'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 20 minutes. View limit details
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. |
There was a problem hiding this comment.
ℹ️ No blocking issues. One point on how selection fails, plus two stale doc references.
Reviewed changes
I reviewed the whole diff: the new moq_video::Device selector, how it steers encode and decode backend selection, the NVIDIA render node → CUDA ordinal mapping, the matching moq-transcode and moq-cli changes, and the new capture::Cursor enum.
Devicereplaces gated paths:encode::Config,decode::Config,resize::Config, andencode::Captureeach take onedevice: Devicefield, on every platform and feature set.- Selection steering: each
Candidatedeclaresdrives: Drives.selectpasses over a backend that drives another kind of device without opening it. On the decode side, passed-over backends stay out of the refusal-or-fault verdict. - NVIDIA placement: a render node counts as NVIDIA when its sysfs
ueventsaysDRIVER=nvidia. It maps to a CUDA ordinal by PCI domain, bus and device. NVDEC and NVENC open that ordinal, and NVENC refuses a node that is not the external Vulkaninputdevice. - moq-transcode / moq-cli:
decoder_deviceandencoder_devicereplace the three backend-named paths. The CLI flags lose theircfggates and now conflict with each other. usage-rs counts a value from an environment variable as given, so having bothMOQ_VAAPI_DEVICEandMOQ_V4L2_*set now also fails startup. - Cursor:
capture::Config::cursorisCursor { Drawn, Hidden }, and each backend reads it through an exhaustiveCursor::drawn().capture::Modeis now#[non_exhaustive].
ℹ️ Two module docs still point at the removed Config::vaapi
The VA-API backend module docs still say "Config::vaapi can name it". That field no longer exists, so they should point at Config::device (Device::Render). Both lines are outside the diff hunks:
rs/moq-video/src/encode/backend/vaapi.rs:14rs/moq-video/src/decode/backend/vaapi.rs:19
claude-opus-5-5 | 𝕏
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed 4a1edaaaef6ac67a5e0445bfef8ba1a364694c37. No blocker in the library change. The typed selector keeps backend features out of callers, and the NVENC check avoids silently taking an explicit node that disagrees with the Vulkan input.
Two rollout checks: update downstream consumers of the removed moq_transcode::Config::vaapi field at the dependency bump, and exercise a nonzero NVIDIA GPU with reordered CUDA_VISIBLE_DEVICES to confirm both NVDEC and NVENC open the selected device. The fake PCI tests check the matching logic, not the driver’s reported addresses. Static review only; I did not build or run hardware tests.
An unreadable or missing render node counted against every backend: the driver check's error left select through `?` before VA-API or software was tried. It now counts against the NVIDIA candidate alone, as a failed open would, and its reason still reaches NoEncoder/NoDecoder. Also points the VA-API module docs at Config::device. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found. The prior feedback is addressed cleanly.
Reviewed changes
I reviewed the one commit since the last Pullfrog review, which fixes how backend selection handles a failed NVIDIA driver check.
- Driver check failure no longer aborts selection: in both
selectloops, anErrfromDevice::takesnow counts against that candidate the same way a failed open does. On decode it goes intotriedandskipped, andfaultedis set; on encode it goes intotriedandrefused. Selection then moves on, so VA-API and, underKind::Auto, software are still tried. Becausefaultedis set, a decode with no candidates left ends asNoDecoderrather thanUnsupportedCodec, and the error still names the path. - Tests: added
a_failed_driver_check_moves_onon both sides, covering fallthrough to a render-node candidate and the final error naming the absent node. - Docs: pointed the encode and decode VA-API module docs at
Config::deviceinstead of the removedConfig::vaapi.
claude-opus-5-5 | 𝕏
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Head: 217aa5774e3aaae356fd608c87b38abb83fbc587
No new blocker. An NVIDIA driver lookup failure is now scoped to that candidate, so a usable next decoder or encoder can still open; when none does, the failing node remains in the diagnostic. The new tests cover both outcomes without depending on a CUDA installation. The real nonzero-device check from the previous review still matters for rollout. Static review; I did not rerun the tests.
|
quest land watch: the merge queue removed this pull request at 217aa57 because its The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs.
…178 check js
15 16 test js
21 10 check markdown (cancelled)
48 22 check carla_bridge
0 0 check drill
3 3 check quest
20 19 check shell
0 0 check large_files
0 0 check text
2 1 check coverage_tables
0 0 check toml
3 3 check nix
0 0 check justfile
148 733 whole run
error: recipe `ci` failed on line 120 with exit code 100
moq-doc test: (pass) audio jitter corpus > idle > reports every target as a change [0.01ms]
moq-doc test: (pass) audio jitter corpus > silence > matches the checked-in file [0.10ms]
moq-doc test: (pass) audio jitter corpus > silence > is a trace of equal-length clocks
moq-doc test: (pass) audio jitter corpus > silence > arrives in a monotonic order [0.47ms]
moq-doc test: (pass) audio jitter corpus > silence > names a target for the first frame
moq-doc test: (pass) audio jitter corpus > silence > reports every target as a change
moq-doc test: (pass) audio jitter corpus > tunein > matches the checked-in file [0.10ms]
moq-doc test: (pass) audio jitter corpus > tunein > is a trace of equal-length clocks
moq-doc test: (pass) audio jitter corpus > tunein > arrives in a monotonic order [0.68ms]
moq-doc test: (pass) audio jitter corpus > tunein > names a target for the first frame
moq-doc test: (pass) audio jitter corpus > tunein > reports every target as a change
moq-doc test: (pass) audio jitter corpus > spike > matches the checked-in file [0.17ms]
moq-doc test: (pass) audio jitter corpus > spike > is a trace of equal-length clocks
moq-doc test: (pass) audio jitter corpus > spike > arrives in a monotonic order [0.85ms]
moq-doc test: (pass) audio jitter corpus > spike > names a target for the first frame
moq-doc test: (pass) audio jitter corpus > spike > reports every target as a change [0.02ms]
moq-doc test: (pass) audio jitter corpus > outage > matches the checked-in file [0.32ms]
moq-doc test: (pass) audio jitter corpus > outage > is a trace of equal-length clocks [0.01ms]
moq-doc test: (pass) audio jitter corpus > outage > arrives in a monotonic order [1.50ms]
moq-doc test: (pass) audio jitter corpus > outage > names a target for the first frame
moq-doc test: (pass) audio jitter corpus > outage > reports every target as a change [0.05ms]
moq-doc test: (pass) audio jitter corpus > batches > matches the checked-in file [0.28ms]
moq-doc test: (pass) audio jitter corpus > batches > is a trace of equal-length clocks
moq-doc test: (pass) audio jitter corpus > batches > arrives in a monotonic order [0.84ms]
moq-doc test: (pass) audio jitter corpus > batches > names a target for the first frame
moq-doc test: (pass) audio jitter corpus > batches > reports every target as a change [0.02ms]
moq-doc test: (pass) audio jitter corpus > straggler > matches the checked-in file [0.09ms]
moq-doc test: (pass) audio jitter corpus > straggler > is a trace of equal-length clocks [0.01ms]
moq-doc test: (pass) audio jitter corpus > straggler > arrives in a monotonic order [0.89ms]
moq-doc test: (pass) audio jitter corpus > straggler > names a target for the first frame
moq-doc test: (pass) audio jitter corpus > straggler > reports every target as a change [0.01ms]
moq-doc test: (pass) audio jitter corpus > fixed > matches the checked-in file [0.05ms]
moq-doc test: (pass) audio jitter corpus > fixed > is a trace of equal-length clocks
moq-doc test: (pass) audio jitter corpus > fixed > arrives in a monotonic order [0.18ms]
moq-doc test: (pass) audio jitter corpus > fixed > names a target for the first frame
moq-doc test: (pass) audio jitter corpus > fixed > reports every target as a change
moq-doc test:
moq-doc test: ::endgroup::
moq-doc test:
moq-doc test: ::group::concept/audio-jitter/stretch/corpus.test.ts:
moq-doc test: (pass) audio stretch corpus > the decisions match the checked-in file [0.13ms]
moq-doc test: (pass) audio stretch corpus > the cases match the checked-in file [0.05ms]
moq-doc test: (pass) audio stretch corpus > hold > matches the checked-in case [0.03ms]
moq-doc test: (pass) audio stretch corpus > hold > decides every hop it plays [0.02ms]
moq-doc test: (pass) audio stretch corpus > hold > moves the output by exactly the shifts it took [0.05ms]
moq-doc test: (pass) audio stretch corpus > speed-up-voiced > matches the checked-in case [0.08ms]
moq-doc test: (pass) audio stretch corpus > speed-up-voiced > decides every hop it plays
moq-doc test: (pass) audio stretch corpus > speed-up-voiced > moves the output by exactly the shifts it took
moq-doc test: (pass) audio stretch corpus > slow-down-voiced > matches the checked-in case [0.09ms]
moq-doc test: (pass) audio stretch corpus > slow-down-voiced > decides every hop it plays
moq-doc test: (pass) audio stretch corpus > slow-down-voiced > moves the output by exactly the shifts it took [0.01ms]
moq-doc test: (pass) audio stretch corpus > bridge > matches the checked-in case [0.06ms]
moq-doc test: (pass) audio stretch corpus > bridge > decides every hop it plays
moq-doc test: (pass) audio stretch corpus > bridge > moves the output by exactly the shifts it took
moq-doc test: (pass) audio stretch corpus > turns-around > matches the checked-in case [0.11ms]
moq-doc test: (pass) audio stretch corpus > turns-around > decides every hop it plays
moq-doc test: (pass) audio stretch corpus > turns-around > moves the output by exactly the shifts it took
moq-doc test: (pass) audio stretch corpus > narrow-range > matches the checked-in case [0.07ms]
moq-doc test: (pass) audio stretch corpus > narrow-range > decides every hop it plays
moq-doc test: (pass) audio stretch corpus > narrow-range > moves the output by exactly the shifts it took [0.01ms]
moq-doc test: (pass) audio stretch corpus > music > matches the checked-in case [0.08ms]
moq-doc test: (pass) audio stretch corpus > music > decides every hop it plays
moq-doc test: (pass) audio stretch corpus > music > moves the output by exactly the shifts it took
moq-doc test: (pass) audio stretch corpus > noise > matches the checked-in case [0.09ms]
moq-doc test: (pass) audio stretch corpus > noise > decides every hop it plays
moq-doc test: (pass) audio stretch corpus > noise > moves the output by exactly the shifts it took
moq-doc test: (pass) audio stretch corpus > silence > matches the checked-in case [0.08ms]
moq-doc test: (pass) audio stretch corpus > silence > decides every hop it plays
moq-doc test: (pass) audio stretch corpus > silence > moves the output by exactly the shifts it took
moq-doc test: (pass) audio stretch corpus > stereo-linked > matches the checked-in case [0.12ms]
moq-doc test: (pass) audio stretch corpus > stereo-linked > decides every hop it plays
moq-doc test: (pass) audio stretch corpus > stereo-linked > moves the output by exactly the shifts it took
moq-doc test: (pass) audio stretch corpus > stereo-opposite > matches the checked-in case [0.12ms]
moq-doc test: (pass) audio stretch corpus > stereo-opposite > decides every hop it plays
moq-doc test: (pass) audio stretch corpus > stereo-opposite > moves the output by exactly the shifts it took
moq-doc test: (pass) audio stretch corpus > bridge-44100 > matches the checked-in case [0.09ms]
moq-doc test: (pass) audio stretch corpus > bridge-44100 > decides every hop it plays
moq-doc test: (pass) audio stretch corpus > bridge-44100 > moves the output by exactly the shifts it took
moq-doc test: (pass) audio stretch corpus > bridge-48000 > matches the checked-in case [0.10ms]
moq-doc test: (pass) audio stretch corpus > bridge-48000 > decides every hop it plays
moq-doc test: (pass) audio stretch corpus > bridge-48000 > moves the output by exactly the shifts it took
moq-doc test: (pass) audio stretch corpus > speed-up-16000 > matches the checked-in case [0.13ms]
moq-doc test: (pass) audio stretch corpus > speed-up-16000 > decides every hop it plays
moq-doc test: (pass) audio stretch corpus > speed-up-16000 > moves the output by exactly the shifts it took
moq-doc test:
moq-doc test: ::endgroup::
moq-doc test:
moq-doc test: 187 pass
moq-doc test: 0 fail
moq-doc test: 26684 expect() calls
moq-doc test: Ran 187 tests across 5 files. [3.31s]
moq-doc test: Exited with code 0
js: test finished in 15.15s
##[endgroup]
##[group]check markdown
##[endgroup]
##[error]ci: test rs failed
##[error]Process completed with exit code 100.
##[group]Run actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: cargo-timings
path: target/cargo-timings/cargo-timing-*.html
if-no-files-found: ignore
retention-days: 14
compression-level: 6
overwrite: false
include-hidden-files: false
archive: true
env:
BASE: b063faa45bbbf683402d56e0e9da56d999eff42d
CHECK_FAIL_FAST: 1
NEXTEST_TEST_THREADS: 24
MBX_CACHE_LINKS: 1
MBX_REMOTE_URL:
##[endgroup]
With the provided path, there will be 7 files uploaded
Artifact name is valid!
Root directory input is valid!
Uploading artifact: cargo-timings.zip
Beginning upload of artifact content to blob storage
Uploaded bytes 381548
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is 3247b45b5a204d9a67479b01e880c68c525911ed5ed407e79315b1eb4dbb4001
Finalizing artifact upload
Artifact cargo-timings successfully finalized. Artifact ID 14311102680
Artifact cargo-timings has been successfully uploaded! Final size is 381548 bytes. Artifact ID is 14311102680
Artifact download URL: https://github.com/moq-dev/moq/actions/runs/44045332909/artifacts/14311102680
Post job cleanup.
##[start-action display=Run jdx/mr-boxington-action@88acf2bb50552c7c508cbac13e5f8c576b95b1de;id=__0154b877-cd9d-4f34-9174-302d31757f91.mbx]
##[end-action id=__0154b877-cd9d-4f34-9174-302d31757f91.mbx;outcome=skipped;conclusion=skipped;duration_ms=0]
Post job cleanup.
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git version
git version 2.56.0
Temporarily overriding HOME='/var/cache/github-runner-work/_temp/335ea511-a05e-4780-97d2-b8539c48d7f3' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --global --add safe.directory /var/cache/github-runner-work/moq/moq
Removing SSH command configuration
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp core\.sshCommand
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp ^includeIf\.gitdir:
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
A job completed hook has been configured by the self-hosted runner administrator
##[group]Run '/nix/store/qrn6ds64bzvwbm5nwf245ifz2c6jb9xw-ci-cache-gc.sh/bin/ci-cache-gc.sh'
shell: /nix/store/lfm00fnq66xfgbn099vqckabyl5jllz6-bash-interactive-5.3p20/bin/bash --noprofile --norc -e -o pipefail {0}
##[endgroup]
evicted 50 objects and 0 action results (601.8 MiB logical); 50.0 GiB logical remain
evicted 0 objects and 0 action results (0 B logical); 50.0 GiB logical remain
Cleaning up orphan processes
(written by quest land watch) |
|
codex, gpt-6.1-sol, medium effort land fixer note:
(written by codex, gpt-6.1-sol, medium effort) |
|
quest land watch: re-enqueued this pull request at 217aa57, at the back of the merge queue, unchanged, since the land fixer judged the failure flaky: (written by quest land watch) |

Finishes quest/m2/native-media-config.md, deleting it.
Problem
moq-video's configs named hardware through backend-named paths (
vaapi,v4l2) that existed only undercfg(all(target_os = "linux", feature = ...)), so every caller repeated moq-video's feature gates, and NVIDIA had no selector at all: NVDEC opened CUDA device 0, and NVENC device 0 unless an external Vulkan input picked one. A transcode host with more than one GPU could not place NVIDIA work.capture::Config::cursorwas a bool, which cannot grow the planned third mode (the cursor apart from the frame).Approach
moq_video::Device, a#[non_exhaustive]enum present on every platform and feature set:Auto(default),Render(PathBuf)(a DRM render node),Video(PathBuf)(a V4L2 codec node). It replaces the gated paths onencode::Config,decode::Config,resize::Config, andencode::Captureas onedevicefield.Drives::Own,Render,Nvidia,Video). Selection passes over a Linux hardware backend that drives another kind of device without opening it, so a named node also steersKind::Autoto its backend. Software and platform APIs that pick their own device (VideoToolbox, Media Foundation, MediaCodec) ignore it. On decode, a backend passed over is neither a refusal nor a fault, soUnsupportedCodecstill means the named device refused the stream.nvidiadriver runs it. NVENC and NVDEC map it to its CUDA ordinal by PCI address (sysfsPCI_SLOT_NAMEagainst each CUDA device's PCI domain, bus, and device). NVENC refuses a render node that is not the device behindConfig::input.moq_transcode::Configtakesdecoder_deviceandencoder_device(one per direction, since moq-transcode named a V4L2 decoder and encoder node separately).capture::Config::cursoriscapture::Cursor { Drawn, Hidden }(#[non_exhaustive]). Each backend reads it through one exhaustiveCursor::drawnmatch, so a third variant has to be decided per backend.capture::Modeis#[non_exhaustive]too.--vaapi-device,--v4l2-encoder,--v4l2-decoder, and--no-cursorkeep their names and lose theircfggates;--vaapi-devicenow also picks the NVIDIA GPU.Impact
encode::Config::{vaapi, v4l2},decode::Config::{vaapi, v4l2},resize::Config::vaapi, andencode::Capture::{vaapi, v4l2}are onedevice: moq_video::Device. Migrateconfig.vaapi = Some(path)toconfig.device = Device::Render(path),config.v4l2 = Some(path)toconfig.device = Device::Video(path), and drop the#[cfg(..., feature = "vaapi" | "v4l2")]around them. A render node an NVIDIA driver runs now also places NVENC and NVDEC on that GPU instead of device 0.capture::Config::cursor: booliscapture::Cursor. Migratecursor = truetoCursor::Drawnandcursor = falsetoCursor::Hidden.capture::Modeis#[non_exhaustive]; it was only ever built inside the crate.Config::{vaapi, v4l2_decoder, v4l2_encoder}aredecoder_deviceandencoder_device: moq_video::Device. Migratevaapito both set toDevice::Render(path),v4l2_decodertodecoder_device = Device::Video(path), andv4l2_encodertoencoder_device = Device::Video(path).Kind::Autono longer opens hardware that drives another kind of device (before, VA-API came ahead of a named V4L2 node). A named render node whose NVIDIA driver check cannot read it (missing, not a device) passes over NVENC/NVDEC with that reason and goes on to VA-API and, underAuto, software, the same with or withoutnvidiacompiled in.--vaapi-devicenow conflicts with--v4l2-encoder/--v4l2-decoderin the same command, since one selector names one device; the flags exist on every platform and do nothing off Linux.Decisions
Taken without the maintainer (away); each is reviewable:
Auto, and software stays orthogonal. A named device passes over hardware that drives another kind of device; whether software may take over when the named hardware fails is stillKind's call (Autofalls back as it did with a named VA-API node;Hardwareerrors). Alternative: a named device disables software fallback. Recommend keeping it orthogonal:Kind::Hardwarealready says "no software".RenderandVideo, after the kernel node classes (/dev/dri/renderD*,/dev/video*), so no public type names a backend, as the crate doc promises.VK_EXT_physical_device_drm): no Vulkan load on the NVIDIA open path, and the sameueventread gives the driver check.cfg_attrthe usage derive was not verified to merge).moq transcode). Adding one later is additive. Sojust test interop --alldid not run.MIGRATE.mdentry: the quest asked for one, but #8024 stopped per-PR entries, and AGENTS.md puts the note in Impact for the release cut.Validation
renderD128, no NVIDIA, no V4L2 M2M, libva not loadable from the dev shell):Render("/dev/dri/renderD128")+Hardware:nvenc: does not open render node /dev/dri/renderD128(sysfs reportedDRIVER=amdgpu), VA-API tried that node, V4L2 passed over.Video("/dev/video11")+Hardware: NVENC/NVDEC and VA-API passed over, V4L2 tried the node.Render("/dev/dri/renderD199")(absent) andRender("/proc/self/status")(not a device): errors naming the path. Since review, a failed driver check counts against NVIDIA alone, soAutogoes on to VA-API and software (unit-tested on both sides).Autounchanged: every hardware backend tried, then openh264.moqwithcapture,transcode:moq transcode --vaapi-device ... --v4l2-encoder ...andmoq import capturewith both flags fail with clap's conflict error;--helpshows the flags.UnsupportedCodec), theueventparser, and the render node to CUDA ordinal mapping fed two fake PCI identities. NVIDIA on real hardware is untested: no host here has one.just checkpasses.Follow-ups
None.
Models
Size: M
Implementer: Claude Code, claude-opus-5-5, medium effort (arm A)
Implementer: Claude Code, claude-opus-5-5, low effort (iterate, S, arm A)
🤖 Generated with Claude Code
(Written by Claude Opus 5.5 with medium effort)
Review
Rewritten by
quest reviewafter each round.Head: 217aa57
Base: origin/main at fc38289
Risk: high,
The branch replaces public configuration fields in moq-video and moq-transcode, which breaks downstream callers until they migrate or the change is reverted.Classified: medium by default
Reviewer: Codex, gpt-6.1-sol, high effort
Session:
01a1e4e4-ca51-7512-854c-305b49b00dfa, round 2Score: 8/10,
No actionable defects were found in the incremental changes, but builds, tests, and multi-GPU runtime behavior remain unvalidated.Raised the risk to high:
The branch replaces public configuration fields in moq-video and moq-transcode, which breaks downstream callers until they migrate or the change is reverted.Rounds: 2; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none