Skip to content

test(libobs): characterize obs_source_frame_copy (Refs #5720) - #5721

Draft
zackees wants to merge 2 commits into
masterfrom
test/5720-source-frame-copy
Draft

zackees wants to merge 2 commits into
masterfrom
test/5720-source-frame-copy

Conversation

@zackees

@zackees zackees commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Refs #5720.

Adds an actual-library cmocka characterization of the public obs_source_frame_copy, which no tracked test called directly before (test_source_frame_copy_steps covers only the plan leaves). Six cases on caller-owned frames, with no core startup or GPU:

  • metadata (flip, flags, trc, full_range, max_luminance, timestamp, color_matrix) is copied, while the destination's size, format, strides, plane pointers, refs and prev_frame stay as they were, and the source is left unchanged;
  • color range min/max is copied only for limited range and kept for full range;
  • equal strides copy the whole plane once; padded strides in both directions copy rows of the smaller line size and leave the padding alone;
  • the row count comes from the destination height, chroma rows round up for odd heights, and the source format picks the planes (an NV12 source copies two planes into an "RGBA" destination);
  • YUVA and I40A copy four planes, I40A's alpha at full height;
  • P216 has no copy plan, so only the metadata is copied.

Test-only: one new tests.d fragment (same shape as test_source_frame_init, no host condition, both libobs backends), no graph, production, public header or existing test change.

Validation. All 6 cases pass when built with GCC and Clang (-Wall -Wextra, ASan+UBSan, no warnings in the fixture) against the stock upstream C libobs 30 shared library. That shows the assertions describe the original C behaviour. They were not run locally against this repo's reference or hybrid libobs; Tier 2 CI runs both. Full SOLDR_PORCELAIN=0 ./lint passed (exit 0, final lane ok 97.1 s). ./push pushed without complete signed client evidence, so ordinary PR CI is required. No RED commit: this is characterization of existing behaviour, and there is no production change for it to fail against.

Follow-ups: a later extraction must keep copy_frame_data shared, since it has three other internal callers in obs-source.c.h. The Rust swap comes after that.

Held draft: backpressure is closed (exit 75), so auto-merge stays off. Head b72b6a5.

🤖 Generated with Claude Code

@zackees zackees changed the title test(libobs): register source frame copy characterization (Refs #5720) test(libobs): characterize obs_source_frame_copy (Refs #5720) Nov 25, 2026
@obs-rust-project-manager obs-rust-project-manager Bot moved this to In progress in obs-rust Multiview Nov 25, 2026
@rdoupe

rdoupe commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Heads-up: #5741 (the obs_source_frame_copy port, claimed on #5714 at 16:57 UTC) also adds test/cmocka/test_source_frame_copy.c, characterizing the same function on both builds, then swaps it. Whichever of the two lands second will need to rebase onto the other; happy to fold your cases into mine or rebase onto yours, whichever you prefer.

@zackees
zackees force-pushed the test/5720-source-frame-copy branch from b72b6a5 to 4484050 Compare November 26, 2026 10:11
@obs-rust-project-manager obs-rust-project-manager Bot moved this from In progress to Stalled in obs-rust Multiview Nov 29, 2026
@obs-rust-project-manager obs-rust-project-manager Bot moved this from Stalled to Needs fix in obs-rust Multiview Dec 4, 2026
zackees and others added 2 commits December 4, 2026 10:24
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Client-Checks: {"checks":{"base":"152c528e41cbfc33e0a17189d18f7ca81191937b","coverage":"all-tracked-applicable-files","diff":["test/cmocka/build/test-graph.json","test/cmocka/test_source_frame_copy_characterization.c"],"head":"0886c9e098b3d2f1ce59a500d6d8d890d463a5d6","tools":{"orchestrator-python":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]","schema-dependencies":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.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 21503\n   compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ISO8859X Regexps Automata RelaxNG Schemas Modules Debug"},"tracked-digest":"b1ea9548afc9eb9966cdc59e079f83c2d5f0f3cd027fd3ca18a5c52e2d889951","tree":"ab0a7d6f69bd22f0ffdf65f44877d2f5160e7251"}}
Ci-Attestation: {"at":1795687273,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["1609f4f7c53bd907624ce5c6c498aa09936843eb"],"secs":152,"stamp":"909b7e84a7345bcc866cb14eac55f7a7","tree":"ab0a7d6f69bd22f0ffdf65f44877d2f5160e7251","v":1,"via":"run"}
Ci-Attestation: {"at":1795687273,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["1609f4f7c53bd907624ce5c6c498aa09936843eb"],"secs":152,"stamp":"8e24d21c0cb61e315e3bc52d69209df5","tree":"ab0a7d6f69bd22f0ffdf65f44877d2f5160e7251","v":1,"via":"run"}
Ci-Attestation: {"at":1795687273,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["1609f4f7c53bd907624ce5c6c498aa09936843eb"],"secs":152,"stamp":"24f791c2ddc38e27945bb31bd2b9e108","tree":"ab0a7d6f69bd22f0ffdf65f44877d2f5160e7251","v":1,"via":"run"}
Ci-Attestation: {"at":1795687273,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["1609f4f7c53bd907624ce5c6c498aa09936843eb"],"secs":152,"stamp":"c4f7e5f61f37f8915dc57d0aeb2c6084","tree":"ab0a7d6f69bd22f0ffdf65f44877d2f5160e7251","v":1,"via":"run"}
Ci-Attestation: {"at":1796410121,"gate":"general/all/client-lint","host":"linux-x86_64","key":"4751a827bfe6a7813ddce8970770e625484f6f82dd0994e6c33d2484583aecce","lane":"client-lint","parents":["42a9b03efec10a57d1dd92b400f3725d16231afa"],"secs":62,"stamp":"e780be8ac5ce63f5091739037476f376","tree":"bde0f8439a2ab9d8d8e9782ff0bf501768f921f9","v":1,"via":"run"}
Ci-Attestation: {"at":1795687273,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["1609f4f7c53bd907624ce5c6c498aa09936843eb"],"secs":152,"stamp":"c02761040f15c21c0c335f5112bf150d","tree":"ab0a7d6f69bd22f0ffdf65f44877d2f5160e7251","v":1,"via":"run"}
Ci-Attestation: {"at":1796410123,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"4751a827bfe6a7813ddce8970770e625484f6f82dd0994e6c33d2484583aecce","lane":"client-lint","parents":["42a9b03efec10a57d1dd92b400f3725d16231afa"],"secs":62,"stamp":"ce4ca940691a3c44ea38a9e0ef2d2ab9","tree":"bde0f8439a2ab9d8d8e9782ff0bf501768f921f9","v":1,"via":"run"}
Ci-Attestation: {"at":1796410123,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"4751a827bfe6a7813ddce8970770e625484f6f82dd0994e6c33d2484583aecce","lane":"client-lint","parents":["42a9b03efec10a57d1dd92b400f3725d16231afa"],"secs":62,"stamp":"41ca8583d95978b7a576184a1459b25f","tree":"bde0f8439a2ab9d8d8e9782ff0bf501768f921f9","v":1,"via":"run"}
Ci-Attestation: {"at":1796410122,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"4751a827bfe6a7813ddce8970770e625484f6f82dd0994e6c33d2484583aecce","lane":"client-lint","parents":["42a9b03efec10a57d1dd92b400f3725d16231afa"],"secs":62,"stamp":"4830c71773b6e208ada21b36848ffc81","tree":"bde0f8439a2ab9d8d8e9782ff0bf501768f921f9","v":1,"via":"run"}
Ci-Attestation: {"at":1796410122,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"4751a827bfe6a7813ddce8970770e625484f6f82dd0994e6c33d2484583aecce","lane":"client-lint","parents":["42a9b03efec10a57d1dd92b400f3725d16231afa"],"secs":62,"stamp":"62efce4dd602e9ec7af0b52b8865ac58","tree":"bde0f8439a2ab9d8d8e9782ff0bf501768f921f9","v":1,"via":"run"}
Ci-Attestation: {"at":1796410122,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"4751a827bfe6a7813ddce8970770e625484f6f82dd0994e6c33d2484583aecce","lane":"client-lint","parents":["42a9b03efec10a57d1dd92b400f3725d16231afa"],"secs":62,"stamp":"f540f6276834fff7b08abeaac237275a","tree":"bde0f8439a2ab9d8d8e9782ff0bf501768f921f9","v":1,"via":"run"}
Ci-Attestation: {"at":1796410122,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"4751a827bfe6a7813ddce8970770e625484f6f82dd0994e6c33d2484583aecce","lane":"client-lint","parents":["42a9b03efec10a57d1dd92b400f3725d16231afa"],"secs":62,"stamp":"f1c58600e52e810d6d49b48b30988fde","tree":"bde0f8439a2ab9d8d8e9782ff0bf501768f921f9","v":1,"via":"run"}
Ci-Attestation: {"at":1796410122,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"4751a827bfe6a7813ddce8970770e625484f6f82dd0994e6c33d2484583aecce","lane":"client-lint","parents":["42a9b03efec10a57d1dd92b400f3725d16231afa"],"secs":62,"stamp":"2537a4d46421e48e752cf0151b5fb726","tree":"bde0f8439a2ab9d8d8e9782ff0bf501768f921f9","v":1,"via":"run"}
Ci-Attestation: {"at":1796410123,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"4751a827bfe6a7813ddce8970770e625484f6f82dd0994e6c33d2484583aecce","lane":"client-lint","parents":["42a9b03efec10a57d1dd92b400f3725d16231afa"],"secs":62,"stamp":"dcbef512804dec07cf4a369386af340c","tree":"bde0f8439a2ab9d8d8e9782ff0bf501768f921f9","v":1,"via":"run"}
Ci-Attestation: {"at":1796410122,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"4751a827bfe6a7813ddce8970770e625484f6f82dd0994e6c33d2484583aecce","lane":"client-lint","parents":["42a9b03efec10a57d1dd92b400f3725d16231afa"],"secs":62,"stamp":"5fddbeb6282b42a784307d6515f1ec3b","tree":"bde0f8439a2ab9d8d8e9782ff0bf501768f921f9","v":1,"via":"run"}
Ci-Attestation: {"at":1796410122,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"4751a827bfe6a7813ddce8970770e625484f6f82dd0994e6c33d2484583aecce","lane":"client-lint","parents":["42a9b03efec10a57d1dd92b400f3725d16231afa"],"secs":62,"stamp":"82dcaa5e1cadf71077a67b2909d45d84","tree":"bde0f8439a2ab9d8d8e9782ff0bf501768f921f9","v":1,"via":"run"}
Ci-Attestation: {"at":1796410122,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"4751a827bfe6a7813ddce8970770e625484f6f82dd0994e6c33d2484583aecce","lane":"client-lint","parents":["42a9b03efec10a57d1dd92b400f3725d16231afa"],"secs":62,"stamp":"b3b183667c658c70b41cfd22855e7e7c","tree":"bde0f8439a2ab9d8d8e9782ff0bf501768f921f9","v":1,"via":"run"}
Ci-Attestation: {"at":1796410122,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"4751a827bfe6a7813ddce8970770e625484f6f82dd0994e6c33d2484583aecce","lane":"client-lint","parents":["42a9b03efec10a57d1dd92b400f3725d16231afa"],"secs":62,"stamp":"23fa32d123a0fddb45f6010f7ff29ecf","tree":"bde0f8439a2ab9d8d8e9782ff0bf501768f921f9","v":1,"via":"run"}
Ci-Attestation: {"at":1795687853,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"86c43e67ed5ceb1466f1b3f1b0a1627b16915a5af19a13d86d4c54188c5dc321","lane":"client-test-x86_64-unknown-linux-gnu","parents":["1609f4f7c53bd907624ce5c6c498aa09936843eb"],"secs":579,"stamp":"60e0cd2859bc8d9779e7996f613cadfb","tree":"ab0a7d6f69bd22f0ffdf65f44877d2f5160e7251","v":1,"via":"run"}
@zackees
zackees force-pushed the test/5720-source-frame-copy branch from 4484050 to 2524ef9 Compare December 4, 2026 18:48

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs fix

Development

Successfully merging this pull request may close these issues.

2 participants