Repository navigation
libobs: Characterize and extract obs_sceneitem_defer_update_begin/end - #5056
Merged
Merged
Conversation
Actual-library cmocka cases against the unchanged C: NULL diagnostics, begin never dispatching, nested pairs dispatching once on the outer end, an unmatched end taking the count negative (no dispatch, no deferral), group children only setting the update flag, the group item computing at once, and a parentless item reading nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Move both bodies verbatim out of obs-scene.c.h into obs-sceneitem-defer-update.c.h, after it in the core-source unity group. end() reaches the scene's do_update_transform() through the existing obs_sceneitem_bounds_update_transform adapter, which wraps that same macro. No behavior change, no Rust swap. Co-Authored-By: Claude Opus 5.5 <[email protected]> Ci-Attestation: {"at":1794985229,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":56,"stamp":"99fa100a3a379a3c25b26458b71b1ec6","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985229,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":56,"stamp":"d8918577fb20bdea6976380622319124","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985229,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":56,"stamp":"6f53480863e10ad37a0a6ce1a490b8ac","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985229,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":56,"stamp":"5295df2712f9bd840cd9590079562483","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985172,"gate":"general/all/client-lint","host":"linux-x86_64","key":"5fb221d6c6223d35092a8aff1e1b51875e9edaed9132e40e82c0d542725be413","lane":"client-lint","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":66,"stamp":"0a44954887aa2e71d60790dee4e2f68e","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985229,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":56,"stamp":"d74561106fb3b7e5c317c67ce4fe7956","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985173,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"5fb221d6c6223d35092a8aff1e1b51875e9edaed9132e40e82c0d542725be413","lane":"client-lint","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":66,"stamp":"2c994e7e25725d952f41743d6ca53160","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985173,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"5fb221d6c6223d35092a8aff1e1b51875e9edaed9132e40e82c0d542725be413","lane":"client-lint","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":66,"stamp":"98d833d83cdb4a0893d9f7f809046908","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985172,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"5fb221d6c6223d35092a8aff1e1b51875e9edaed9132e40e82c0d542725be413","lane":"client-lint","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":66,"stamp":"b87f735843ea84346deb74ea9cab4eae","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985172,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"5fb221d6c6223d35092a8aff1e1b51875e9edaed9132e40e82c0d542725be413","lane":"client-lint","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":66,"stamp":"4c8d6fb71b0430d4b0a1220305039bf2","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985172,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"5fb221d6c6223d35092a8aff1e1b51875e9edaed9132e40e82c0d542725be413","lane":"client-lint","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":66,"stamp":"c14d1cca1c2c1b5f465f6ed166052313","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985172,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"5fb221d6c6223d35092a8aff1e1b51875e9edaed9132e40e82c0d542725be413","lane":"client-lint","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":66,"stamp":"2e409d3f5b8a9788089bf3d24934ac3e","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985172,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"5fb221d6c6223d35092a8aff1e1b51875e9edaed9132e40e82c0d542725be413","lane":"client-lint","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":66,"stamp":"684f5228c5cb067420b13bfadd3cec5c","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985173,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"5fb221d6c6223d35092a8aff1e1b51875e9edaed9132e40e82c0d542725be413","lane":"client-lint","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":66,"stamp":"ba107908fbd7fe9e05484a286ec6717f","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985172,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"5fb221d6c6223d35092a8aff1e1b51875e9edaed9132e40e82c0d542725be413","lane":"client-lint","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":66,"stamp":"61d3efdaeae74be204da1861652dd8c1","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985172,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"5fb221d6c6223d35092a8aff1e1b51875e9edaed9132e40e82c0d542725be413","lane":"client-lint","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":66,"stamp":"60d41a0ec892fadd092e4ea51c4a816b","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985172,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"5fb221d6c6223d35092a8aff1e1b51875e9edaed9132e40e82c0d542725be413","lane":"client-lint","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":66,"stamp":"bf775447eae89f6a540748a8e13417a9","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985172,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"5fb221d6c6223d35092a8aff1e1b51875e9edaed9132e40e82c0d542725be413","lane":"client-lint","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":66,"stamp":"eabd299b0340b2f75a112e0337a8f0bb","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Ci-Attestation: {"at":1794985465,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"92cee59f812ec9a75919929d764b159419fe223b7dea9ba24bda1d36f3eaea38","lane":"client-test-x86_64-unknown-linux-gnu","parents":["07fe0967193674ab5f5ef2787388c338dc2e1563"],"secs":235,"stamp":"bafdc399a9c86a65462fc8ddf3737de0","tree":"80b5bc277ffd7135c06c300471156630d0173634","v":1,"via":"run"} Client-Checks: {"checks":{"base":"b0222edd92ae02507975f5585f8c15f01ee5bd9f","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core-source+.h.c","libobs/obs-scene.c.h","libobs/obs-sceneitem-defer-update.c.h","test/cmocka/test_scene_item_defer_update.c","test/cmocka/tests.d/test_scene_item_defer_update.cmake"],"head":"a2a752b98449a1b7ea4b393ad681d3d4f8f595c5","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":"21fb69f4859a6bb5f22c18903ae10473b21e569884ae03f1e2c574cd5b80ecaf","tree":"80b5bc277ffd7135c06c300471156630d0173634"}}
rdoupe
enabled auto-merge
November 18, 2026 07:33
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.
obs_sceneitem_defer_update_beginandobs_sceneitem_defer_update_endstill live in the middle ofobs-scene.c.h. This is the C-only step before their Rust port: characterize them against the unchanged C, then move both bodies verbatim into their own file. No Rust changes, no edits to existing C tests or public headers.What changes
test/cmocka/test_scene_item_defer_update.c(new, registered throughtests.d/): eight actual-library cases, observed through the scene'sitem_transformsignal and the source's size reads:LOG_DEBUGline, "obs_sceneitem_defer_update_begin: Null 'item' parameter" / "..._end: ...", and changes no item.begin()never asks for a transform; the matchingend()of an item of a scene computes it at once (one size read, one signal), every time.end()that brings the count back to exactly zero computes, once; a position setter while deferred computes nothing.end()takes the count below zero: no dispatch, and a negative count does not defer (a setter computes at once). Twobegin()s bring it back to zero without dispatching; the next pair behaves as usual. The count is not clamped (characterized, not endorsed).end()only sets the update flag (nothing read or signalled); the next walk of the outer scene computes it and clears the flag.end()computes at once.end()reads nothing and signals nothing, nested or not.libobs/obs-sceneitem-defer-update.c.h(new): both bodies, byte-for-byte, right afterobs-scene.c.hin the core-source unity group.do_update_transform()is a macro private toobs-scene.c.h, so the new file maps it onto the existing live adapterobs_sceneitem_bounds_update_transform()(obs-scene-item-bounds-setters-fields.c.h), which wraps that same macro and is what the extracted bounds setters already call.obs-scene.c.hloses those 17 lines.The existing
test_scene_transform_update_walk,test_scene_transform_states,test_scene_rotated_scale_filterandtest_scene_item_bounds_settersare unchanged and keep passing.Evidence
Characterization against the unchanged C (first commit only):
A cmocka
skip()also reports Passed, so I ran the binary directly in the same build tree underxvfb-run, against both libraries:[ PASSED ] 8 test(s), all eight[ OK ], none skipped. (A first draft probed with the crop setter, which only sets the flag; the C reference failed it, which is how the position setter came to be the probe.)After the move (both commits):
Run directly again after the move: 8/8 on both libraries;
nm -D libobs.so.30still exports both asT. The two function bodies, cut from the oldobs-scene.c.hand from the new file,diffempty.ci/test_build_groups.pyand./lintpass.Not covered: concurrent
begin()/end()from two threads; the atomics moved unchanged.Fixes #4646
🤖 Generated with Claude Code