Skip to content

test: excuse deinterlace skips by the ticks libobs did not render (Fixes #5374) - #5425

Merged
zackees merged 2 commits into
masterfrom
fix/5374-deinterlace-stall-accounting
Nov 22, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/5374-deinterlace-stall-accounting

Conversation

@rdoupe

@rdoupe rdoupe commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #5374. Test-only: test_deinterlace_2x_field_order counted a multi-tick render stall on a loaded runner as a cadence bug. It failed in the merge queue on the C reference and ejected an unrelated PR.

What changes

  • raw_video records, for every output frame, whether video-io repeated the frame before it, meaning the same cache entry was delivered again. That happens only when the graphics thread missed ticks: video_sleep counts them as lagged, and video_output_cur_frame delivers the last rendered frame once per missed tick. Each rendered frame gets its own cache entry.
  • The field accounting moves into a pure function, count_fields(), with skips_ok() and holds_ok(). There are seven fixed-sequence cases (accounting_*_50i_into_50, which run under the 50i-into-50 entry).
  • GREEN rule: a repeated frame is not a hold. A skip is excused by up to the number of ticks not rendered since the field before it. With no repeated frames the rules are exactly the old ones, including the one late tick allowed by test(deinterlace): allow one skipped field for a single late tick (#456) #2904. A skip or hold with no stall, a skip longer than the stall, or a stall in an earlier window still fails.
  • Each case's summary line now prints N repeated frames (L lagged, D dropped by video-io) excuse E skipped fields.

No known-flaky.txt entry was added, and none is left behind.

Evidence

RED (commit 1, Tier 2 in Docker: OBS_CTEST_JOBS=10 uv run --no-project rust/tools/linux-validate/run.py --repeat 2 --tests '^test_deinterlace_2x_field_order_50i_into_50$'). The two stall sequences fail under the old rules, and the five must-fail sequences pass:

[  FAILED  ] accounting_stall_excuses_its_skip_50i_into_50     (skips_ok is not true)
[  FAILED  ] accounting_stall_repeats_are_not_holds_50i_into_50 (3 != 1)

GREEN, full Tier 2 for both builds, with 10 repeats of all five rates under load: 13 busy loops on 16 cores (load average about 17), running only during the repeat phases.

OFF: 100% tests passed, 0 tests failed out of 1074; repeat: 0 failed out of 5 (until-fail:10)
ON:  100% tests passed, 0 tests failed out of 1074; repeat: 0 failed out of 5 (until-fail:10)

Busy loops on this host never stalled the renderer: all 650 measured cases logged 0 repeated frames. So I also forced real stalls. I ran the built binary from the kept Tier 2 build volume (CMOCKA_TEST_FILTER='*_50i_into_50', under xvfb-run) and froze the process with SIGSTOP/SIGCONT for 100 ms every 2.5 s. In every case, on both libraries, the repeated-frame count equals libobs's own lagged count. The buffered cases skipped 2-4 fields after a 3-4 tick stall. All were excused, and the old rules would have failed every one, the same way the merge-queue run did:

yadif 2x, top field first, after a pause, 50i into 50 fps: ... 3 skipped ... 3 repeated frames (3 lagged, 0 dropped by video-io) excuse 3
discard 2x (retro), top field first, 50i into 50 fps (C reference): ... 4 skipped ... 4 repeated frames (4 lagged, 0 dropped by video-io) excuse 4

With 60 ms freezes (1-2 ticks), all 22 cases pass on both libraries, and the repeated count again equals the lagged count each time.

Not covered, and not changed here: a freeze of the whole process also stops the thread that feeds frames. An unbuffered source then gets its frames late and skips them one render after the stall window (after_pause_linear_2x_unbuffered: 3 skipped (at most 2 in a row), 4 repeated frames (4 lagged) excuse 1). That is late input, not a render stall. The test fails that way with or without this change, and none of the CI failures scanned in #5374 show it. So I did not widen the excuse past the stall's own window.

🤖 Generated with Claude Code

rdoupe and others added 2 commits November 21, 2026 20:39
…ED, Refs #5374)

Record, for every output frame of test_deinterlace_2x_field_order,
whether video-io repeated the frame before it (the same cache entry: a
tick the graphics thread missed), and print the repeated, lagged and
video-io dropped counts in each case's summary. The field accounting
moves into count_fields(), a pure function, with fixed-sequence cases.

RED: a 3-tick stall (the failing run of #5374) and stall repeats are
still counted as a skip and a hold.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
 #5374)

When the graphics thread misses N ticks, video-io repeats the last
rendered frame for them and the next render shows the field that is due
by then: up to N fields were never due at a rendered tick. The field
accounting no longer counts those repeats as holds, and excuses a skip
by up to the ticks not rendered since the field before it. With no
repeated frames the rules are unchanged, including the one late tick
allowed by #2904; a skip or hold with no stall, or a skip past the
stall, still fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ci-Attestation: {"at":1795311679,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":70,"stamp":"43c71a68cbc74d9bc2f597ebff597917","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311679,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":70,"stamp":"f564239d403c85ebeea6d16bc9a6a815","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311679,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":70,"stamp":"f1e5f3da544614e3f1ef64a8de9c4822","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311679,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":70,"stamp":"03153b4f7b8976677891ef543c9004b5","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311608,"gate":"general/all/client-lint","host":"linux-x86_64","key":"68c72eb183c2ec14bfdfa02b1b3a3bf53f9be1dbae90d80dc91800a8e1e716c7","lane":"client-lint","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":68,"stamp":"96eefb001ac1163b67e3f1037b843069","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311679,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":70,"stamp":"93745534b7f53b48f77e8036035051c6","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311609,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"68c72eb183c2ec14bfdfa02b1b3a3bf53f9be1dbae90d80dc91800a8e1e716c7","lane":"client-lint","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":68,"stamp":"926bcfd66bc9e995184285db88b6f183","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311609,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"68c72eb183c2ec14bfdfa02b1b3a3bf53f9be1dbae90d80dc91800a8e1e716c7","lane":"client-lint","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":68,"stamp":"fb96360185785cccee6143bda2c7e211","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311608,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"68c72eb183c2ec14bfdfa02b1b3a3bf53f9be1dbae90d80dc91800a8e1e716c7","lane":"client-lint","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":68,"stamp":"c6eb47e9ffb7c6e8530081369f62f9d2","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311608,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"68c72eb183c2ec14bfdfa02b1b3a3bf53f9be1dbae90d80dc91800a8e1e716c7","lane":"client-lint","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":68,"stamp":"bccfd8e79336b4529e027acd8ca80140","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311608,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"68c72eb183c2ec14bfdfa02b1b3a3bf53f9be1dbae90d80dc91800a8e1e716c7","lane":"client-lint","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":68,"stamp":"55e12769df03ca97c7c64add096bc89d","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311608,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"68c72eb183c2ec14bfdfa02b1b3a3bf53f9be1dbae90d80dc91800a8e1e716c7","lane":"client-lint","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":68,"stamp":"7ec2f6772a38e8f06514cbe9757e59ff","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311608,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"68c72eb183c2ec14bfdfa02b1b3a3bf53f9be1dbae90d80dc91800a8e1e716c7","lane":"client-lint","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":68,"stamp":"1f2dc4e26d73ebbbe271be2cdfd0097e","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311608,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"68c72eb183c2ec14bfdfa02b1b3a3bf53f9be1dbae90d80dc91800a8e1e716c7","lane":"client-lint","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":68,"stamp":"0027820330180b08995f2bfe69bc9831","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311608,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"68c72eb183c2ec14bfdfa02b1b3a3bf53f9be1dbae90d80dc91800a8e1e716c7","lane":"client-lint","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":68,"stamp":"f90334cce9bf4440d90a1eca14914f95","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311608,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"68c72eb183c2ec14bfdfa02b1b3a3bf53f9be1dbae90d80dc91800a8e1e716c7","lane":"client-lint","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":68,"stamp":"ae5c8d845c407f9b16bb6bc4a2034d42","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311608,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"68c72eb183c2ec14bfdfa02b1b3a3bf53f9be1dbae90d80dc91800a8e1e716c7","lane":"client-lint","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":68,"stamp":"a8b8cdfcfc6d9f49dd976421b8c12869","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311608,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"68c72eb183c2ec14bfdfa02b1b3a3bf53f9be1dbae90d80dc91800a8e1e716c7","lane":"client-lint","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":68,"stamp":"36d51c23e007e584ccc87b6b1b236b23","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}
Ci-Attestation: {"at":1795311854,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"5be76905b23154b3363e0a67c67f84a8755c3e062e970cf2e2b374837be5332c","lane":"client-test-x86_64-unknown-linux-gnu","parents":["7c480ecb2a9718cfb9dd091cf9733861b7e4d747"],"secs":175,"stamp":"e1710cf632c31af90dbdbf1abdd60f19","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141","v":1,"via":"run"}

Client-Checks: {"checks":{"base":"1d9ab9704a899c04b9cd412283bda12491b55e77","coverage":"all-tracked-applicable-files","diff":["test/cmocka/test_deinterlace_2x_field_order.c"],"head":"ec16e2ff2817a8bbb8d4f16fd76b19bf03c129a2","tools":{"orchestrator-python":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]","schema-dependencies":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504-GITv2.15.4\n   compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Regexps Automata RelaxNG Schemas Schematron Modules Debug Zlib"},"tracked-digest":"73823c9dcea417b717d6234e358b9d8c555deb3e7f185755b375afa1c93bde69","tree":"fe41d69319c130c1ffc1c28b782ae6c78b169141"}}
@rdoupe
rdoupe requested a review from zackees as a code owner November 22, 2026 01:44

@zackees zackees left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinator review: approved.

  • Matches the #5374 triage plan: test-only, with libobs untouched. With no repeated frames the rules are exactly the old ones, including #2904's one late tick. A skip is excused only up to the ticks not rendered since the previous field, and a stall in an earlier window doesn't excuse a later skip. So the test is no weaker when there is no stall.
  • Accounting: it is now a pure count_fields() with fixed sequences. The RED commit shows the two stall sequences failing under the old rules, while the five must-fail sequences keep failing as they should.
  • Evidence goes past the plan: the forced SIGSTOP stalls show the repeated-frame count equal to libobs's own lagged count in every case, on both libraries. That rules out a hidden libobs skip.
  • Limit: the unbuffered late-input case is correctly left out of scope. It is late input, not a render stall. A follow-up belongs on #456, which the triage already asked for.
  • Known-flaky: no entry was added, so none is left behind.

@zackees
zackees enabled auto-merge November 22, 2026 02:03
@zackees
zackees added this pull request to the merge queue Nov 22, 2026
Merged via the queue into master with commit 7e17e73 Nov 22, 2026
46 checks passed
@zackees
zackees deleted the fix/5374-deinterlace-stall-accounting branch November 22, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Flaky: test_deinterlace_2x_field_order after_pause_linear_2x_50i_into_50 skips 3 fields on a loaded Dell runner

2 participants