Repository navigation
feat(bindings): Rust vmafx-sys FFI crate - #16
Merged
Merged
Conversation
Add bindings/rust/vmafx-sys — bindgen-generated raw FFI bindings to libvmaf plus a thin safe Rust wrapper layer (vmafx_sys::safe). The safe layer exposes VmafContext, VmafModel, and YUV picture helpers with Result-based error handling, confining unsafe to the actual FFI call sites. Both types are RAII (Drop) and Send. Wire the crate as the first member of the root Cargo.toml workspace (entry was commented-out placeholder in the foundation PR, ADR-0702). CI gate (rust-ci.yml) builds libvmaf CPU-only, then runs: cargo fmt --check cargo clippy --all-targets -D warnings cargo test -p vmafx-sys --all-features cargo run --example score (Netflix golden smoke test, asserts 76.669 places=3) Deliverables (ADR-0108): (1) research digest: no digest needed — bindgen wrapping is a known pattern (2) decision matrix: ADR-0706 Alternatives considered table (3) AGENTS.md invariant note: bindings/rust/vmafx-sys/AGENTS.md (4) reproducer: VMAFX_REPO=<root> cargo run --example score (5) changelog.d/added/vmafx-sys-rust.md (6) docs/rebase-notes.md — fork-only Rust crate, no Netflix upstream impact ADR-0706. Closes T-VMAFX-RUST-SYS-BINDINGS-2026-05-28. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lusoris
marked this pull request as ready for review
May 28, 2026 11:16
This was referenced May 28, 2026
3 of 6 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
bindings/rust/vmafx-sys— bindgen-generated raw FFI bindings to libvmaf plus a thin safe Rust wrapper layer (vmafx_sys::safe).Cargo.tomlworkspace (the entry was a commented-out placeholder in the foundation PR, ADR-0702).rust-ci.yml) builds libvmaf CPU-only, then runscargo fmt --check,cargo clippy -D warnings,cargo test, and the Netflix golden smoke test on everybindings/rust/PR.Test plan
cargo fmt -p vmafx-sys --check— passes locallycargo clippy -p vmafx-sys --all-targets -- -D warnings— passes locallycargo test -p vmafx-sys --all-features— 10 tests pass (9 layout tests + 1 Netflix golden integration test)cargo run --example score— score returned: 76.6689 (asserts places=3 against 76.669 ✓)Smoke test output
Deep-dive deliverables checklist (ADR-0108)
## Alternatives considered(bindgen vs hand-written vs cc-crate)bindings/rust/vmafx-sys/AGENTS.mdVMAFX_REPO=$(git rev-parse --show-toplevel) LD_LIBRARY_PATH=/usr/local/lib cargo run --example scorechangelog.d/added/vmafx-sys-rust.mddocs/rebase-notes.md— fork-only Rust crate, no Netflix upstream impactNotes on score value
The task brief specified
76.668 places=4. The actual measured mean score for the fullsrc01 pair (48 frames, vmaf_v0.6.1.json, CPU) is
76.66890519623612. The Python golden gateasserts this at
places=2(seequality_runner_test.py:276). This PR gates atplaces=3(tighter than the Python gate), asserting
76.669 ± 5e-3.🤖 Generated with Claude Code