Repository navigation
obs-source: port obs_source_set_texcoords_centered to Rust (Fixes #5599) - #5600
Merged
Merged
Conversation
Move the body unchanged out of obs-source.c.h into obs-source-texcoords-centered-setter.c.h, still compiled in the live core-source group. The setter is hidden (obs-internal.h, no EXPORT), so the characterization that follows compiles this file into itself. No Rust, no behavior change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
New cmocka test on a test-owned struct obs_source: the setter stores texcoords_centered and no other byte, whatever the other bytes and the field held, and logs nothing; the real libobs getter then answers what was stored and writes nothing. The setter is hidden in libobs, so the test compiles its extracted C file into itself (C source only, like test_deinterlace_texture_allocation). NULL is outside the C contract and is not tested. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tier 1 mirrors of test_source_texcoords_centered_setter.c against a todo!() stub: boolean_queries::set_texcoords_centered. `soldr cargo test -p obs-data --test obs-tests-core -- source::boolean_queries::` fails the two new cases with "not yet implemented". Co-Authored-By: Claude Opus 5.5 <[email protected]>
The setter joins boolean_queries beside its already-ported getter. The shim rejects NULL before the field adapter (storing nothing and logging nothing) and stores a plain bool through the texcoords address of the existing obs_source_boolean_query_fields seam, without a lock, as the C did. No new adapter symbol. The extracted C file moves into the getter's reference-only group libobs.ported-source-boolean-queries. The C setter is hidden (obs-internal.h, no EXPORT), so its name goes into a new rust-hidden.d fragment for the module rather than the module's rust-exports.d list, which keeps only the two public getters. Tier 1 passes; Tier 3 compares store sequences on twin filled fixtures (only the centered byte changes, both fixtures equal, both getters answer the stored value), the adapter's field offset against the real header, and proptests, with the original C in the oracle. Co-Authored-By: Claude Opus 5.5 <[email protected]> Ci-Attestation: {"at":1795568838,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":94,"stamp":"0636819f5c90f0720c96387354ac9234","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568838,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":94,"stamp":"3636199cf5699c19c2ec364f78f3db30","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568838,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":94,"stamp":"7807830b6982cc8c137b984cee24976f","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568838,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":94,"stamp":"c1186aa0acc2f85015e1c961b38cba04","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568743,"gate":"general/all/client-lint","host":"linux-x86_64","key":"f789ffbfc648c28d2272b93db0e962e8b093942e9550fb45c6b73e81114f19c4","lane":"client-lint","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":97,"stamp":"357910bf7d9f02aef4a1abcf9d073b50","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568838,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":94,"stamp":"03eaba481d70f6bde84d490774a374a2","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568743,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"f789ffbfc648c28d2272b93db0e962e8b093942e9550fb45c6b73e81114f19c4","lane":"client-lint","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":97,"stamp":"afb7174c7c1a8362438c24c72aaa5122","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568743,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"f789ffbfc648c28d2272b93db0e962e8b093942e9550fb45c6b73e81114f19c4","lane":"client-lint","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":97,"stamp":"871852b05989610828dd2dcbcad8be54","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568743,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"f789ffbfc648c28d2272b93db0e962e8b093942e9550fb45c6b73e81114f19c4","lane":"client-lint","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":97,"stamp":"0927ecc2bbe548a59ac7cf23c4ae4cb9","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568743,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"f789ffbfc648c28d2272b93db0e962e8b093942e9550fb45c6b73e81114f19c4","lane":"client-lint","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":97,"stamp":"065b74fa5663d7e8a0b8ce91eb2655a2","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568743,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"f789ffbfc648c28d2272b93db0e962e8b093942e9550fb45c6b73e81114f19c4","lane":"client-lint","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":97,"stamp":"f0580619393b0808385e78b2ae197db7","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568743,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"f789ffbfc648c28d2272b93db0e962e8b093942e9550fb45c6b73e81114f19c4","lane":"client-lint","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":97,"stamp":"b05775fe90f533763a19061ef6ca3c53","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568743,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"f789ffbfc648c28d2272b93db0e962e8b093942e9550fb45c6b73e81114f19c4","lane":"client-lint","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":97,"stamp":"8d62f00cc0c60a27c9e948a37c3c7f74","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568743,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"f789ffbfc648c28d2272b93db0e962e8b093942e9550fb45c6b73e81114f19c4","lane":"client-lint","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":97,"stamp":"a37f801216c0c54f4c5d1da0e058dfca","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568743,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"f789ffbfc648c28d2272b93db0e962e8b093942e9550fb45c6b73e81114f19c4","lane":"client-lint","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":97,"stamp":"e629e8851dbd93983ff0128f52903803","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568743,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"f789ffbfc648c28d2272b93db0e962e8b093942e9550fb45c6b73e81114f19c4","lane":"client-lint","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":97,"stamp":"c8a8784cbd9be1015f9bbb09407ed649","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568743,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"f789ffbfc648c28d2272b93db0e962e8b093942e9550fb45c6b73e81114f19c4","lane":"client-lint","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":97,"stamp":"7b21c7c86be80f902db0edd9cf90ac44","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795568743,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"f789ffbfc648c28d2272b93db0e962e8b093942e9550fb45c6b73e81114f19c4","lane":"client-lint","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":97,"stamp":"52a8af311de5affa760f00392316f365","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Ci-Attestation: {"at":1795569031,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"2aad387d9726b508687b83101defae87fe2349e0f34e8d5d08a905f2fc8431c8","lane":"client-test-x86_64-unknown-linux-gnu","parents":["e39280a870411241060528ff7f8883cdf00d185d"],"secs":192,"stamp":"ba017ecfcc0343c1a113a03b87b8cf93","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c","v":1,"via":"run"} Client-Checks: {"checks":{"base":"4c10a6b5925b1fa6537a218873b5ea10e7fba5b1","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.ported-source-boolean-queries+.h.c","libobs/cmake/rust-hidden.d/obs-source-source_boolean_queries.txt","libobs/obs-internal.h","libobs/obs-source-texcoords-centered-setter.c.h","libobs/obs-source.c.h","rust/README.md","rust/obs-build/tests/native.rs","rust/obs-build/tests/native/registration/canonical_source_texcoords_centered_setter_swap_is_registered.rs","rust/obs-c-oracle/oracle/source_boolean_queries.c","rust/obs-source/src/boolean_queries.rs","rust/obs-source/src/ffi/source_boolean_queries.rs","rust/obs-source/tests/source/boolean_queries.rs","rust/obs-source/tests/source/boolean_queries_parity.rs","test/cmocka/build/test-graph.json","test/cmocka/test_source_texcoords_centered_setter.c","test/cmocka/tests.d/test_source_texcoords_centered_setter.cmake"],"head":"0c3af797962a9274f911548d85f128e718a1f422","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":"9f132feebf96e788d6fe5b1c2a52a297a57cabaea1bc5d0d44cf506a8e99c0f9","tree":"ec1b10c55e15b1ad6c7d954b62539cdcf849d09c"}}
rdoupe
marked this pull request as draft
November 25, 2026 01:11
rdoupe
marked this pull request as ready for review
November 25, 2026 02:59
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 #5599
What changes
obs_source_set_texcoords_centeredmoves out oflibobs/obs-source.c.hinto the obs-source crate. It joinsobs-source::boolean_queries, next toobs_source_get_texcoords_centered, which is already Rust.Commits, in order:
086174ae6libobs: the body moves verbatim intolibobs/obs-source-texcoords-centered-setter.c.h. The file stays in the livelibobs.core-sourcegroup, so this commit changes no behavior and adds no Rust. The extraction comes before the characterization because the setter is hidden (see below), so the test has to compile this file.a0f2b1565test: new cmocka characterizationtest/cmocka/test_source_texcoords_centered_setter.con a test-ownedstruct obs_source.centeredintotexcoords_centeredand changes no other byte, whatever the other bytes and the field held before. It never logs.e39280a87test: RED. The Tier 1 mirrors run against atodo!()core.c710c39aeobs-source: GREEN.boolean_queries::set_texcoords_centered. The C ABI shim stores a plain bool, without a lock, as the C did. It goes through thetexcoords_centeredaddress of the existingobs_source_boolean_query_fieldsadapter. There is no new adapter symbol, so the standalone link stubs (source-boolean-query-link-stubs.c) need no change.libobs.ported-source-boolean-queries. No new group.obs-build, and the rust/README row is updated.obs-internal.h(private) gets a comment only.Hidden, not exported. The issue said to list the name in
rust-exports.d/obs-source-source_boolean_queries.txt, but the C setter is declared inobs-internal.hwithoutEXPORT, so neither libobs build exports it. Its name goes into a newlibobs/cmake/rust-hidden.d/obs-source-source_boolean_queries.txtinstead, and the exports list keeps only the two public getters. The exported-symbol diff of linux-validate is clean. For the same reason, the new cmocka test cannot call the swapped symbol through libobs. It characterizes the C source only, astest_deinterlace_texture_allocationdoes, and reads back through the exported getter, which is the Rust one in hybrid. The swap itself runs in hybrid through its only caller,render_item()inobs-scene.c.h, which the scene-rendering tests reach.NULL. The C has no NULL check, so NULL is outside the contract and is not tested. The shim returns before the adapter on NULL, storing and logging nothing. This matches the getter shim and
obs_source_set_hidden.Callers checked before the swap. The only callers are the two
render_item()paths inlibobs/obs-scene.c.h. No plugin or frontend calls the setter; the win-capture plugins and obs-browser use the getter only. No--wrap=entry, cmocka link-support file or oracle stand-in defines the name, and no test target compilesobs-scene.c.horobs-source.c.hinto itself. Nothing needed a refit.No public header, existing C test or WebSocket change. No intentional differences. Tier 4 does not apply.
Tests
rust/obs-source/tests/source/boolean_queries.rs):test_source_texcoords_centered_setter,test_source_boolean_queries, and the scene-rendering callers (test_scene_rotated_scale_filter,test_group_empty_bounds,test_main_mix_before_video,test_scene_render_plan_steps[_rust]), on the C reference and on hybrid libobs.boolean_queries_parity.rs), the original C against the Rust export:offsetof(struct obs_source, texcoords_centered).hiddeninstead, each fail parity. Both were reverted.export_list(soldr cargo test -p obs-util --lib -- export_list) passes with the new hidden fragment.Test cost: all
boolean_queriesmodules take 0.02 s together (reduced parity level, debug build). Peak RSS is 21 MB over 20 runs. The tests start no threads of their own.Evidence
RED (
e39280a87):GREEN (
c710c39ae):./pushran the client lint and host test lanes, and both passed (the optional Swift lane exited 75 and attested nothing). The final commit is not signed, so the PR runs the ordinary selected CI.🤖 Generated with Claude Code