Repository navigation
feat(rust): integer motion extractor in Rust (motion_rust), RC4 lane M - #2096
Merged
Merged
Conversation
lusoris
force-pushed
the
rc4/rust-extractor-framework
branch
from
October 7, 2026 14:26
e99e0f4 to
5962a1a
Compare
16 of 26 tasks
lusoris
force-pushed
the
rc4/rust-extractor-framework
branch
from
October 7, 2026 15:19
5962a1a to
e8886a9
Compare
42 tasks
lusoris
force-pushed
the
rc4/rust-extractor-framework
branch
from
October 7, 2026 16:43
e8886a9 to
ccf7ccf
Compare
lusoris
force-pushed
the
rc4/motion-twin
branch
from
October 7, 2026 17:03
5e57fb0 to
b44f81b
Compare
lusoris
marked this pull request as ready for review
October 7, 2026 17:03
lusoris
force-pushed
the
rc4/motion-twin
branch
2 times, most recently
from
October 7, 2026 19:57
07e531e to
9513474
Compare
…2548 landed twice (#2560) * fix(test): drop the second MALLOC_PERTURB_ entry and state row that #2548 landed twice #2548 landed the merge train's squash of its first revision, which still carried its own MALLOC_PERTURB_=0 entry for test_gpu_picture_pool_uaf and a state row for the same bug; #2547 had already landed both. core/test/meson.build now lists the entry once (#2547's), docs/state.md keeps T-GPU-POOL-UAF-TEST-FILLS-HOST-MEMORY-2026-10-08 only, and the #2548 changelog and rebase-note fragments no longer claim that fix. Signed-off-by: Lusoris <lusoris@proton.me>
… (ADR-2199) (#2423) * ci(hooks): run actionlint under a deadline so a deadlock fails loudly (ADR-2199) actionlint v1.7.12 writes the script of a `run:` block to shellcheck's stdin pipe before it starts shellcheck, so it deadlocks when the script is larger than the pipe. A user over fs.pipe-user-pages-soft gets pipes of 8 KiB, which made the pre-push hook hang on about every other push. scripts/ci/run_actionlint.py gives the run 90 seconds, terminates the process group, names the cause and exits 124; it never reports a pass for a run that did not finish. The hook and `make lint-actions` both go through it. The defect is upstream (rhysd/actionlint#702). Decision Q-078. Restore SIGQUIT for actionlint and signal only it, so the hang dump survives a background start where non-interactive shells ignore SIGQUIT by default. Signed-off-by: Lusoris <lusoris@proton.me>
#2096) * feat(rust): port the integer motion extractor to Rust (motion_rust)
lusoris
force-pushed
the
rc4/motion-twin
branch
from
October 8, 2026 02:16
9513474 to
615f8b0
Compare
This was referenced Oct 8, 2026
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
RC4 lane M of #1723: the integer
motionextractor (motion_sad_score,motion2,motion3,motion_five_frame_window,motion_moving_average) in Rust asmotion_rust, bit-identical tointeger_motion.c. Lands bottom-up per Q-083 after the framework #2086 (ADR-1713, accepted as written, ledger Q-087); the lane's commits are squashed onto the rebased framework (no conflict).Landed base: #2086 (framework, ADR-1713) is on master; this branch was rebased onto master
61c90165bwith the framework's commits dropped, retargeted tomaster, and queued with the other twins (Q-083). Re-gate on that head: Rust build 0 warnings,--suite=fast --suite=rust386 OK, 0 fail; harness--feature motionon netflix, checker1, checker10 at--threads 0,1,4: 27 of 27 EQUAL (five-fixture run below from the framework head, same twin and C code).Re-run on the rebased head (
-Denable_rust_features=true -Db_lto=false,-j4):rust_twin_diff.py --feature motion --fixtures netflix,checker1,checker10,sparks10,bbb4k --threads 0,1,4→ 45 of 45 cells EQUAL (bbb4k all 200 frames), compared with master's currentinteger_motion.c; fast +rustsuites 380 OK, 0 fail;cargo test -p vmafx-fex -p vmafx-fex-motion14 passed;cargo fmt --check,cargo clippy --workspace --all-targets -D warningsclean;pre-commit run --filesover every changed file: pass.Incremental motion (#2290, ADR-2090) is not on master yet; when it lands it gives the C extractor an
advancehook and carries the shim trampoline andmotion_rust::advancewith it (maintainer answer Q-093, request MI-1), so this twin keeps derivingmotion2/motion3at its flush until then.Crate
core/src/rust/feature/motion(vmafx-fex-motion,forbid(unsafe_code), no dependency beyondvmafx-fex):sad.rs(motion_score_pipeline_8/_16, reflect-101 mirror,i328-bit path andi649-16-bit path, per-rowu32wrap),window.rs(motion_flush_one,vmaf_motion_window_flush,motion_blend, CMINternary),extractor.rs(init/extract/flush),options.rs. All eight options of the C table are implemented; none refused.Evidence (zeus, build-rs, CPU only,
-Db_lto=false)rust_twin_diff.py --feature motion --fixtures netflix,checker1,checker10,sparks10,bbb4k(all 200 4K frames), exit 0, every cell EQUAL, 0 max abs diff:motion_max_val=18(SDR models)motion_five_frame_window=1:motion_moving_average=1:motion_max_val=18(HFR models)Both
feature_backendschecked by the harness (motion/motion_rust). Extra option sets (36 runs, netflix, checker1, sparks10; all EQUAL):motion_force_zero,debug(4 metrics),debug+ five-frame,mbf=0.5:mbo=10,mfw=2,mmxv=5,ffw,mma, a combined set,force_0+debug,mbf=0:mbo=0,mfw=0.Proven check: changing the horizontal rounding constant (
1 << 15to1 << 14) turns the netflix cells into 229e9-ulp diffs; reverted.Unit tests (
cargo test -p vmafx-fex-motion): 72 SAD cases (sizes 3x3 to 576x324, 8/10/12/16 bit, random / one-bit / sparse) with values taken from the compiled C pipelines; the flush derivation against a line-by-line port ofmotion_flush_one(three-frame, five-frame, moving average, blend); CMINNaN behaviour.cargo clippy -p vmafx-fex-motion --all-targets -- -D warningsandcargo fmt --all --checkclean; Meson suiterust3/3.Throughput (single thread,
--threads 1, ms/frame, median of 3, wall time of the wholevmaf --feature motionrun, host load 40-57 during the runs so noisy)Speed is not a gate in RC4. The
--threads 1measurement needed the local patch of request M-1 (below).Request to F
rc4-requests/M-1.md: with--threads N(N >= 1) a Rust twin that has aflushfails (problem flushing context):flush_non_temporal_cpu_extractors()flushes the shared, never-initialised fex, sotwin_flush()finds no instance. A 5-line fix incore/src/libvmaf.c(initialise the shared context of a Rust twin before its flush) is given in the request and verified (threads 1 and 4 equal to C); not committed here, F owns the file. The harness cells run with the default thread setting, so they do not see it.Deliverables (ADR-0108)
AGENTS.mdinvariant note — no rebase-sensitive invariants beyond the rebase note; the twin mirrorsinteger_motion.c.changelog.d/added/rust-motion-twin.md.docs/rebase-notes.d/rust-motion-twin.md, "Rustmotiontwin mirrorsinteger_motion.c".Docs:
docs/metrics/motion.md"Rust implementation". State: no state delta, no C defect found. Provenance:rust-integer-motionfamily inscripts/dev/relicense_provenance.toml.Reproducer
meson setup build-rs core -Denable_rust_features=true -Denable_cuda=false \ -Denable_sycl=false -Denable_hip=false -Db_lto=false nice -n 15 ninja -C build-rs -j2 python3 scripts/ci/rust_twin_diff.py --vmaf build-rs/tools/vmaf --feature motion \ --fixtures netflix,checker1,checker10,sparks10,bbb4k cargo test -p vmafx-fex-motion