Repository navigation
libobs: Port obs_bounds_fit_scale to Rust - #1486
Merged
Merged
Conversation
Tier 1 mirrors of test_scene_bounds_fit call bounds_fit_scale, which is still todo!(). Eleven tests panic with "not yet implemented". Refs obs-rust#1468
The safe core follows the C branches, including the max-only strict edge and the outer flip of the original type. libobs-with-rust links the shim. The symbol stays hidden. Tier 1 and the oracle comparison pass. Flipping the outer axis fails tall_source_uses_the_other_axis. Refs obs-rust#1468
This was referenced Oct 20, 2026
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 #1468. Characterization landed in #1469. This is the port.
Description
obs_bounds_fit_scalemoves intoobs-scene-bounds.libobs-with-rustlinks the shim.obs-scene.ccalls it inside libobs. The C file has noEXPORT, so the symbol stays hidden.None and any other type leave the scale unchanged. Max-only becomes scale-inner only when a scaled side is past the box, and that path does not flip the axis. A zero size on the axis a fit would divide by leaves the scale unchanged.
vec2_mulfstays the header inline.No intentional differences.
Motivation and Context
Phase 6 libobs port of
libobs/obs-scene-bounds.c.h. The C file stays, so the C libobs and the cmocka test still compile it. The public header is unchanged.How Has This Been Tested?
macOS 27.0.1, aarch64. Rust toolchain from
rust-toolchain.toml, soldr,SOLDR_RUSTC_WRAPPER=none.RED → GREEN
215a0420c.soldr cargo test -p obs-data --test obs-tests-core scene_bounds::panicked in 11 tests withnot yet implemented: obs_bounds_fit_scale.bounds_type_values_match_obs_hpassed.6a727105d. The same filter passed 14 tests: the 12 Tier 1 cases and the two oracle comparisons (cmocka_cases_match_oracle,random_inputs_match_oracle).soldr cargo test --workspace --lockedpassed. Those runs were this patch. It was rebased onto master afterwards, with no conflict.tall_source_uses_the_other_axiswithScaleInner: 100x200 at (1, 1) gives (8, 8), expected (3, 3). Reverted.obs-rust-linux-validate. The GitHub runner is x86_64. Export sets match, 1766 symbols. OFF loads/build/tree/libobs/libobs.so.30. ON loads/build/tree/libobs-with-rust/libobs.so.30.test_scene_bounds_fitpassed OFF. It compiles the C file into the test, so it does not see the swap.test_group_empty_bounds(a dragged item at (642, 360)-(843, 460.5), expected (640, 360)-(840, 460)) andtest_scene_dup_group_children(the grouped item moved). Both ran against the C libobs. The same two showed up on obs-missing-files: port the missing-file list (Refs #1459) #1465. The lane exits on that ctest status, so ON was run on the same build tree withOBS_TIER2_STAGE=test OBS_TIER2_MODES=ON.test_scene_bounds_fit,test_ws_screenshot_srgb,test_ws_batch_order,test_ws_current_scene_removed, andtest_vlc_playlist_gappassed.test_ws_screenshot_srgbdoes not compile on this Mac untilutilsis a system include. The Docker mount is case-insensitive, so<obs.h>opensplugins/obs-websocket/src/utils/Obs.h. That change is not in the branch. With it, the test passed OFF. Linux CI checks out a case-sensitive tree, whereObs.his notobs.h.ci/test_build_groups.py,ci/test_naming.py,ci/test_ported_sources.py, the test-binary inventory, the platform ratchet, perf guards,soldr cargo fmt --all --check, workspace clippy-D warnings, dylint, andsoldr cargo test --workspace --locked. The aarch64-apple-darwin cross lane (clippy, dylint,test --no-run) passed.x86_64-pc-windows-gnuis refused by soldr on macOS aarch64. The msvc cross dies incc(windows.handstdio.hnot found).ci-lint local-gate runcannot finish here. Theci/self-tests hit/private/var, a missingreadelf, and Apple clang (ci/test_appimage_build_script.py,ci/test_tier2_xvfb_lifetime.py,ci/test_windows_package_arguments.py,ci/test_app_config_identity.py,ci/test_tier2_run.py), and that death comes before rustfmt. Those checks were run on their own. No stamp. The Debugpanic=abortcheck did not run: the lane stops when the pre-existing cmocka failures return.Types of changes
Checklist
master215a0420c, then GREEN6a727105d