Skip to content

test(vision_mixer): register the cudadownload stand-in once, never remove it - #950

Merged
srperens merged 1 commit into
mainfrom
fix/cuda-input-test-registry
Oct 2, 2026
Merged

srperens merged 1 commit into
mainfrom
fix/cuda-input-test-registry

Conversation

@srperens

@srperens srperens commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Description

vision_mixer_cuda_input_test (from #948) crashed in about one run in four: 11 of 40 runs locally, and it took down CI on #949. The failure was an ElementFactory instance_of assertion or a segfault. The bug is in the test, not in the input front.

Cause: each test registered a stand-in cudadownload and removed it from the registry again, so that the missing-adapter test could find it absent. Registry::remove_feature frees the factory while the element class keeps a plain, non-refcounted pointer to it. The next registration or lookup under that name then read freed memory. The lock between the tests did not prevent this.

Fix:

  • The stand-in is registered once per process and never removed.
  • The missing-adapter test moves to its own binary, vision_mixer_cuda_missing_test, so nothing is registered in its process.
  • The shared Media Player → Vision Mixer harness moves to backend/tests/vision_mixer_cuda/.
  • The test bodies and assertions are unchanged.

Type of Change

  • Bug fix (test only)

Testing

  • Before: 11 of 40 runs of vision_mixer_cuda_input_test failed locally (macOS).
  • After: 40 of 40 runs of vision_mixer_cuda_input_test (2 tests) and 40 of 40 of vision_mixer_cuda_missing_test (1 test, no skip) pass.
  • cargo clippy --all-targets -- -D warnings and cargo fmt are clean.
  • No revert check: the guards' assertions are unchanged, and this PR changes only how the stand-in is registered.

🤖 Generated with Claude Code

…move it

vision_mixer_cuda_input_test crashed in about one run in four (11 of 40
locally, and on CI in PR #949) with an ElementFactory instance_of
assertion or a segfault. Each test registered a stand-in cudadownload and
removed it from the registry afterwards, so the missing-adapter test
could see it absent. Registry::remove_feature frees the factory while the
element class keeps a plain pointer to it, so the next registration or
lookup under that name read freed memory; the lock between the tests did
not help.

The stand-in is now registered once per process and never removed, and
the missing-adapter test moves to its own binary,
vision_mixer_cuda_missing_test, where nothing is registered. The shared
Media Player -> Vision Mixer harness moves to tests/vision_mixer_cuda/.
The test bodies are unchanged. 40 of 40 runs of each binary pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@srperens
srperens merged commit 8084a5b into main Oct 2, 2026
9 checks passed
@srperens
srperens deleted the fix/cuda-input-test-registry branch October 2, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant