Repository navigation
fix: 12 medium/low round-3 bundle — SYCL ceiling, meson conflicts, CLI bounds, y4m, fuzz, motion debug, docs - #857
Merged
Conversation
… overflow vmaf_v0.6.1 plus debug/extended options can register 12+ extractors in a single VmafSyclState. The previous ceiling of 8 caused a silent -ENOSPC rejection with no fallback, aborting the run. Changes: - MAX_GRAPH_EXTRACTORS: 8 → 16 (covers expected upper bound of ~12 extractors with headroom; the fixed-size array still avoids heap allocation inside the graph-recording hot path). - vmaf_sycl_graph_register: return code on overflow changed from -ENOSPC to -ENOMEM (semantically correct for a slot-count exhaustion; the error message also hints at the fix). No behaviour change for runs with ≤ 8 extractors. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
enable_avx512=true with enable_asm=false is a contradictory configuration: the AVX-512 path is pure assembly and cannot be compiled without the assembler. The previous warning() silently no-opped the AVX-512 build, masking the misconfiguration from the user. Replace with error() so the user learns immediately that the option combination is invalid and must correct it before proceeding. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Setting --threads to an arbitrarily large value (e.g. 10000) caused the thread pool to spawn thousands of threads, exhausting virtual memory and OOM-killing the process. After parse_unsigned(), clamp settings->thread_cnt to the number of online hardware processors (sysconf _SC_NPROCESSORS_ONLN on POSIX, GetSystemInfo on Windows). Emits a stderr warning when the cap fires. Applies to cli_parse.cpp (C++23 build source) and the C mirror file cli_parse.c kept for upstream-sync reference. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
`_dst += _y4m->pic_w * _y4m->pic_h` used plain int * int arithmetic before advancing an unsigned char pointer. For frames where pic_w * pic_h exceeds INT_MAX (~46340 x 46340), this is signed-integer overflow — undefined behaviour under C99/C11 (SEI CERT C INT30-C / INT32-C). Fix: `_dst += (size_t)_y4m->pic_w * _y4m->pic_h`, matching the identical cast already present in the sibling functions y4m_convert_42xmpeg2_42xjpeg (line 220) and y4m_convert_42xpaldv_42xjpeg (line 315). Added a matching explanatory comment to keep the three functions consistent. docs/state.md updated per CLAUDE §12 r13. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Meson currently defaults extract_all_objects() to non-recursive, but will silently change the default in Meson 2.0. Add explicit recursive: false to all 7 call sites (arm64 NEON x4, arm64 SVE2 x2, CUDA x1) to lock in the current intent and silence the future deprecation warning. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The function was wrapped in `#if 0` since its introduction and was never assigned to a conversion-function pointer, making it permanently unreachable. It also contained unsigned-int arithmetic that would overflow signed int for large frames — the same class of issue fixed in the live C411 converter. Deleting it outright is safer than leaving dead code that silently rots. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…256 KiB
FUZZ_MAX_DIM_DIGITS was 6 (allowing up to "999999") but
FUZZ_MAX_INPUT_BYTES was only 65536. A single-row 4:2:0 frame at
99999 px wide already needs ~150 KiB of luma+chroma payload, so the
overflow path was unreachable during fuzzing — the corpus would be
dropped by the size gate before the parser ever saw an over-width
header. Fix by reducing FUZZ_MAX_DIM_DIGITS to 5 ("99999" max) and
raising FUZZ_MAX_INPUT_BYTES from 64 KiB to 256 KiB, making the two
constants mutually consistent and reopening the overflow path to the
fuzzer.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…l-parse leak Nightly runs of fuzz_json_model reached 1.1 GB peak RSS in 180-second windows, suggesting the embedded libsvm sub-parser accumulates allocations across inputs. Add rss_limit_mb=512 to the fuzz_json_model matrix entry so libFuzzer aborts before RSS climbs into OOM territory; all other harnesses keep the default 2048 MB. Audit of the harness revealed a second issue: the collection-variant cleanup only freed model_c / collection on rc==0, so a partial parse that populated key "0" then failed on key "1" leaked both objects. Fix: always call vmaf_model_destroy / vmaf_model_collection_destroy after vmaf_read_json_model_collection_from_buffer regardless of the return code. With the leak closed, re-enable ASan leak detection (detect_leaks=1) in __asan_default_options; the original detect_leaks=0 work-around is no longer needed. The single-model path (vmaf_read_json_model) already calls vmaf_model_destroy on failure via the fail: label; no change there. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
integer_motion_cuda.c had debug=true as the default for the debug VmafOption, while integer_motion.c (the CPU implementation) uses false. This caused every CUDA motion scoring run to emit per-frame debug writes unconditionally, doubling score-write traffic compared to the CPU path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…equired-options message When `--width 0` (or `--height 0`) is supplied alongside valid height, pixel_format, and bitdepth arguments, the existing check `!(width && height && pix_fmt && bitdepth)` treats the explicit zero as "not provided" and emits the generic "required options missing" list. That message implies the user forgot the flag when they actually supplied an invalid value. Add explicit zero-value guards in cli_parse.cpp before the generic block so the user sees "--width must be > 0" (or "--height must be > 0") instead. The guard only fires when at least one sibling YUV field is also set so that the lone-zero case (e.g. only --width 0, nothing else) still falls through to the more helpful "all four required" listing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The struct reproduction at lines 224-225 showed VmafRef *ref and void *priv without any access qualifier, implying they were part of the usable public API. Both fields are opaque libvmaf-internal state (the header itself documents them as "do not touch"). Add explicit "INTERNAL — ... do not access" comment text to match the header's intent and prevent callers from dereferencing these fields. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add a belt-and-suspenders check before computing pic_cnt = 2 * (thread_cnt + 1) + 1 that rejects --threads values >= (UINT_MAX - 3) / 2, which would wrap the unsigned arithmetic to a small pool size and deadlock the picture pool fetcher on frame N+1. The companion CLI hardware-core cap is the primary defence; this guard makes the invariant self-documenting and survivable even if that cap is absent. Also add the missing <limits.h> include required by UINT_MAX. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lusoris
marked this pull request as ready for review
June 8, 2026 19:28
This was referenced Jun 12, 2026
This was referenced May 31, 2026
11 of 27 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
Bundle of 12 medium/low round-3 fixes. Held as DRAFT until prior PRs land + master CI green.
Test plan
git grep '^<<<<<<'empty)Reproducer / smoke-test command
Deep-dive deliverables (ADR-0108)
changelog.d/fixed/fuzz-json-model-rss-limit.mdincluded (commit 8); remaining items are cosmetic/config-level fixes that do not warrant individual user-facing changelog entries per ADR-0221state.md touch
DRAFT — do not mark ready or admin-merge. Will be readied after ssim_hip rewrite lands.