Repository navigation
test(cmocka): wait for a painted program frame in the screenshot sRGB tests (#2785) - #2787
Merged
Merged
Conversation
… tests Both screenshot sRGB tests waited for eight raw-video deliveries and then sampled the program's centre pixel. Those deliveries begin as soon as the output source is set and are black until the scene has drawn once, so on a cold runner (llvmpipe still compiling the scene's shaders) the loop stopped on a black pre-render frame and the case failed with `program (0, 0, 0)` while the screenshot itself was correct - master push run 40683133291, first case of both binaries only. Wait for a raw frame whose program pixel is not black instead (none of the cases expects black), bounded at 10 s, and fail with the format, bound and raw frame count so a program that never renders says so.
zackees
commented
Oct 28, 2026
zackees
left a comment
Member
Author
There was a problem hiding this comment.
Coordinator review: looks right, and the mechanism is sound.
Read against origin/master (ecf72dd5f). Verified from the diff and both files at eab5b5689:
frames_seen()returnsprogram_framesunderprogram_mutexin both binaries, so passing it asstartand comparingprogram_frames > startinsidewait_for_painted_program()is a genuine "a frame arrived after this call began", not a comparison between two counters. (The PR body's "countsobs_add_raw_video_callback()deliveries" is accurate but a step removed:raw_video()is what incrementsprogram_frames.)- The non-black gate is the correct predicate: none of the 13 cases (
7frontend +6ws) expects a black program pixel, so "r,g,b not all zero" is exactly "the scene has drawn". Theframes > starthalf keeps it from passing on a stale pixel from the previous case. - The failure path is bounded at 10 s and reports format, bound and raw-frame count, so a genuine "never renders" regression fails with a reason instead of a black-pixel mismatch.
fail_msgdoes not abort, so on timeoutcapture()continues and the case will usually also print its pixel mismatch — two messages on one failure, which is harmless and arguably useful. - No product code,
test/cmocka/only: nodocs/features.mdline is correct under AGENTS.md (no user-visible change), and no local gate stamp is needed for this shape. clang-format --dry-run --Werrorclean on both files here (21.1.8; the PR says 22.1.3 — both pass, so no version drift in the formatting of the added hunks).- CI evidence:
Build 🧱 / Qt Frontend Linux 🐧— the lane that was red on master — is green on this head, which is the authoritative run for these two binaries. Rust Tier 2 windows/macos were still in progress at review time; the coordinator will queue once all checks complete.
Nothing to fix. Leaving the merge to the queue once the two remaining Tier 2 lanes finish.
Member
Author
|
Handed off to the coordinator. Green: No local gate stamp: this touches only two |
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.
Fixes #2785.
Build 🧱 / Qt Frontend Linux 🐧was red on master push run40683133291
(head
3f29f24e2):test_frontend_screenshot_srgbandtest_ws_screenshot_srgbboth failed only their first case,nv12_orange_is_unchanged, with a correct screenshot and a black programpixel:
Every later case in both binaries reported the right program pixel.
RED
The RED evidence is that master push run's log; there is no code-level RED
commit because the defect is in the test's wait, not in a product behaviour
that a new test could pin:
frames_seen()countsobs_add_raw_video_callback()deliveries. Those start assoon as
obs_set_output_source()is set and are black until the scene hasdrawn once (
llvmpipe, 2 physical cores, cold shader cache on that runner), andthe bound is only 100 * 20 ms = 2 s, so the loop exits on black pre-render
frames. That is why only the first case of each binary fails: the shaders are
warm afterwards and the very same loop then sees painted frames. The loop also
has no failure path when the frames never arrive — it silently proceeds with
the initialised
{0, 0, 0}.GREEN
wait_for_painted_program()pumps one frame per 20 ms until a raw frame hasbeen delivered and the program pixel is no longer black, bounded at 10 s;
on timeout the case fails with the format, the elapsed bound and the raw frame
count, so the next occurrence says which half went wrong instead of reporting a
black-pixel mismatch. None of these cases expects black, so "not black" is
exactly what says the scene has drawn. No product code changes.
Verified from this checkout's Tier 2 Linux build volume (both targets are built
there,
OS_LINUX+Qt6+libobs-opengl,ENABLE_FRONTEND=OFFdoes notgate them):
clang-format 22.1.3 --dry-run --Werrorclean on both files (./lint'sC/C++ lane). No local gate stamp: this touches only
test/cmocka/C++ tests,no Rust, CMake or build input, and the binaries above were built and run
directly in the Tier 2 volume.
What this does not do
also passes (
MESA_SHADER_CACHE_DISABLE=true,--cpus=1, two runs each), sothe only reproduction is the CI log above; what the fix guarantees is that a
program that has not painted can no longer be sampled, bounded so a real
"never renders" regression still fails.
#2763's frame-timing extraction; that commit is in thefailing run's history, but the black-pixel-only-on-the-first-case pattern in
both binaries points at render warm-up, not at tick timing. If a reviewer
reads it the other way, the new timeout message will say so on the next red.
Refs the master red on
3f29f24e2; nodocs/features.mdline (no user-visiblechange).