Skip to content

test(cmocka): test_darken_transparent measures the drawn scene (#3389) - #3433

Merged
vpacher merged 2 commits into
masterfrom
fix/3389-darken-wait-drawn
Nov 1, 2026
Merged

vpacher merged 2 commits into
masterfrom
fix/3389-darken-wait-drawn

Conversation

@vpacher

@vpacher vpacher commented Nov 1, 2026

Copy link
Copy Markdown
Member

Fixes #3389. Refs #3238.

Why

In the asan job (run 41281819710), darken_keeps_background_where_transparent failed at test_darken_transparent.c:325, because the first run_scene() measured before the scene was drawn:

normal: mean luma left (transparent) 0.0, right (opaque) 0.0 (black is 16)

Luma 0 is below video black: those frames reached the probe encoder as an all-zero NV12 buffer, before the first draw. run_scene() stopped after 10 encoded frames, drawn or not.

What changes

  • The probe encoder counts the frames that show the scene: the opaque half above video black (16), which a drawn frame never reaches (it measures 71).
  • run_scene() measures once 10 such frames arrived, for up to 10 s instead of 3 s, so the slower sanitizer builds under load have room. If they never arrive, the case fails with that message instead of comparing undrawn frames.
  • The flaky entry of the test leaves the sanitizer known list.

No assertion is removed, and the measured values of drawn frames do not change.

Commits

  • RED eefd078: drops the known-list entry, so the asan job counts the test again. The RED evidence is the CI run above.
  • GREEN 7f10d77: the wait.

Tests

The early read did not reproduce on a local build box with 24 cores: the asan build of master under load (12 and 20 runs at a time, other cores busy) passed 143 of 144 runs, and the one failure was obs_startup failing (obs_init_hotkeys) with 20 X servers at once, not the measurement. GREEN in the same setup measured the same values in every run that started (normal 180.0/71.0, darken 180.0/71.0). The next asan nightlies show whether the flake is gone.

Tier 2 passes in the local gate. Local gate, stamped head 7f10d77: 4 min 21 s (lint 38 s, rust-test 81 s, cross 37 s, tier2-linux 261 s).

Checklist

🤖 Generated with Claude Code

vpacher and others added 2 commits November 1, 2026 16:00
…3389)

Drop its flaky entry from the sanitizer known list. In the asan job
(run 41281819710), darken_keeps_background_where_transparent failed at
test_darken_transparent.c:325 because the first run_scene() measured
before the scene was drawn:

  normal: mean luma left (transparent) 0.0, right (opaque) 0.0 (black is 16)

run_scene() stops after 10 encoded frames, and under load the first
frames reach the probe encoder as an all-zero NV12 buffer.

Fails: the asan job, under load, as in run 41281819710; locally under
load as recorded in the GREEN commit.

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

The probe encoder counts the frames that show the scene (the opaque
half above video black, 16), and run_scene() measures once 10 of them
arrived, for up to 10 s instead of 3 s, so the slower sanitizer builds
under load have room. If they never arrive the case fails with that
message instead of comparing undrawn frames. No assertion is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=1f0259860f8615a801a299e434a61ef10626812f secs=262 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run,macos-native:n/a,windows-native:n/a
Ci-Attestation: {"at":1793545713,"gate":"rust/all/fmt","host":"linux-x86_64","key":"cbcf5ddabbcc82d6beac476a7f52c7944b7614a086d3c244a44dcd1f1cac64a2","lane":"lint","parents":["eefd078a9f126edf9b990cbb49fca470200d52f6"],"secs":38,"stamp":"30e257e35c0f649bad189c35061d0277","tree":"1f0259860f8615a801a299e434a61ef10626812f","v":1,"via":"run"}
Ci-Attestation: {"at":1793545713,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"cbcf5ddabbcc82d6beac476a7f52c7944b7614a086d3c244a44dcd1f1cac64a2","lane":"lint","parents":["eefd078a9f126edf9b990cbb49fca470200d52f6"],"secs":38,"stamp":"d6a54bf9ad3ac8274441e29c2a0913b1","tree":"1f0259860f8615a801a299e434a61ef10626812f","v":1,"via":"run"}
Ci-Attestation: {"at":1793545713,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"c9feb1708a900e09b69c96ea29722ade956fbf945a8e3d8023cac80b17b187b9","lane":"rust-test","parents":["eefd078a9f126edf9b990cbb49fca470200d52f6"],"secs":81,"stamp":"d0fa3e25bee7df1b9b2c7766b787d2ac","tree":"1f0259860f8615a801a299e434a61ef10626812f","v":1,"via":"run"}
Ci-Attestation: {"at":1793545713,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"5988a515b6c53d16e303281a99b1f4ab78246c3d04a14b396fd0e2a1105aff0f","lane":"cross","parents":["eefd078a9f126edf9b990cbb49fca470200d52f6"],"secs":37,"stamp":"4634765efcd50586158bf01552298c77","tree":"1f0259860f8615a801a299e434a61ef10626812f","v":1,"via":"run"}
Ci-Attestation: {"at":1793545713,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"5988a515b6c53d16e303281a99b1f4ab78246c3d04a14b396fd0e2a1105aff0f","lane":"cross","parents":["eefd078a9f126edf9b990cbb49fca470200d52f6"],"secs":37,"stamp":"e51d59f5042559ed99afb01a2ccb0c0b","tree":"1f0259860f8615a801a299e434a61ef10626812f","v":1,"via":"run"}
Ci-Attestation: {"at":1793545713,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"5988a515b6c53d16e303281a99b1f4ab78246c3d04a14b396fd0e2a1105aff0f","lane":"cross","parents":["eefd078a9f126edf9b990cbb49fca470200d52f6"],"secs":37,"stamp":"8bd5b80150a54cde1adfc3d7027b604d","tree":"1f0259860f8615a801a299e434a61ef10626812f","v":1,"via":"run"}
Ci-Attestation: {"at":1793545713,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"5988a515b6c53d16e303281a99b1f4ab78246c3d04a14b396fd0e2a1105aff0f","lane":"cross","parents":["eefd078a9f126edf9b990cbb49fca470200d52f6"],"secs":37,"stamp":"530a6b11f6d30769c0e75e03ee7b96a8","tree":"1f0259860f8615a801a299e434a61ef10626812f","v":1,"via":"run"}
Ci-Attestation: {"at":1793545713,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"855b2c105d2a8af7c6f33293570904fe6ce8d57e7edc8b3ad51ebf8cbbaaf74b","lane":"tier2-linux","parents":["eefd078a9f126edf9b990cbb49fca470200d52f6"],"secs":261,"stamp":"11b5a54fd8811043e57b23bb26abef00","tree":"1f0259860f8615a801a299e434a61ef10626812f","v":1,"via":"run"}
@vpacher
vpacher requested a review from zackees as a code owner November 1, 2026 15:08
@vpacher
vpacher enabled auto-merge November 1, 2026 15:09

@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: LGTM. The test was added in this repo (#1406), not upstream, so changing how it waits is within the rules. Waiting for frames that show the scene (luma above video black) instead of any 10 frames fixes the race at its cause, the assertion thresholds are unchanged, and a run that never draws now fails with a clear message instead of measuring zeros. The 10 s ceiling is reasonable under asan.

@vpacher
vpacher added this pull request to the merge queue Nov 1, 2026
Merged via the queue into master with commit 425a4db Nov 1, 2026
36 checks passed
@vpacher
vpacher deleted the fix/3389-darken-wait-drawn branch November 1, 2026 15:19
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.

test: test_darken_transparent measures the output before the scene is drawn in the asan job

2 participants