Repository navigation
fix(cli): pass long-opt ids into parse_unsigned for threads/subsample/cpumask - #1712
Conversation
…/cpumask Passing short option characters made error() walk off long_opts and abort on invalid values. Match gpumask/frame_cnt by using ARG_THREADS, ARG_SUBSAMPLE, and ARG_CPUMASK. Fixes Netflix#1694
|
Tiny CLI parse fix for #1694 — three ARG_* ids so invalid --threads/--subsample/--cpumask print Invalid argument instead of aborting. Happy to revise. |
Exercise malformed --threads, --subsample and --cpumask values through the real executable, checking normal usage errors instead of process aborts. Preserve zero, decimal and hexadecimal parsing coverage in the C suite. AI-assisted regression coverage. Verified against each original option-ID mutation and the full native libvmaf test suite.
|
Thanks for the patch, the fix looks correct. I'd prefer not to add this ad-hoc Python harness and meson.build addition though, we could consider a broader CLI argument error coverage separately, instead of an ad-hoc test for these three cases. Could you reduce the patch to just the 3-line fix? |
|
Also, please ignore the windows CI failure, I have an open workaround (#1722) but will wait to see if the upstream package maintainer can provide a checksum to fix it properly. |
Drop ad-hoc Python harness and test additions per maintainer review from @nilfm99, keeping strictly the 3-line CLI argument parse fix for ARG_THREADS, ARG_SUBSAMPLE, and ARG_CPUMASK.
|
Thanks @nilfm99! Updated head to |
Summary
Invalid values for
--threads,--subsample, and--cpumaskmadevmafabort instead of printing the usual Invalid argument message. Those three cases passed short option characters intoparse_unsigned, soerror()could not find them inlong_opts.Pass
ARG_THREADS,ARG_SUBSAMPLE, andARG_CPUMASK, matching--gpumask/--frame_cnt.Fixes #1694
Test plan
vmaf ... --threads abcprints Invalid argument (no abort)--subsample abcand--cpumask abc