You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rust: Port the scene bounds placement in obs-scene.c to obs-scene #1637
calculate_bounds_data, add_alignment, and the crop_to_bounds predicate in libobs/obs-scene.c.h, to obs-scene.
Phase and position
Phase 6, tracked by #444. After the scale half (obs_bounds_fit_scale, #1468) and the scene blend lookups (#1520). #1616 folded those into one obs-scene crate, one module per extracted file.
Dependencies and existing tests
Depends on obs_bounds_fit_scale. test_scene_bounds_fit covers that scale half. test_group_empty_bounds covers an empty group through a real scene. Nothing pins alignment inside the box, the bounds crop, or the flip adjustment.
The first PR is the characterization. Move the placement math into obs_bounds_place (behavior-neutral, no Rust) and pin the current C behavior with cmocka. Absolute-versus-relative bounds stay in calculate_bounds_data, because that calls size_to_absolute and needs the scene. The Rust port is a later PR, after this one merges.
Notes
add_alignment stays a non-EXPORT symbol declared in obs-internal.h. Item alignment and transitions keep calling it. No public header change, and no intended behavior change. Odd cases (the width axis wins when both sides overflow, integer division toward zero, roundf half away from zero, a non-flipped crop discarding that axis of alignment) are pinned as characterized, not endorsed.
Claiming: scene bounds placement (calculate_bounds_data, add_alignment, and the crop_to_bounds predicate in libobs/obs-scene.c.h)
This PR moves that math into obs_bounds_place and adds a cmocka test that pins the current C behavior. No Rust. Absolute-versus-relative bounds stay in calculate_bounds_data, because that still calls size_to_absolute.
After it merges, a second PR ports obs_bounds_place to obs-scene (Tier 1 through Tier 3) and moves the file into a ported group.
RED 3b9c0ae73: all 16 safe-core mirrors fail on stubs. GREEN is local: focused Tier 1/layout/differential coverage passes, native workspace tests pass, and Clippy/Dylint pass. Linux Tier 2 is running locally before GREEN is pushed. No C test or public header edits; internal symbols stay hidden. No differences on C-defined conversions; out-of-range/nonfinite float-to-integer conversions are excluded from parity because C is undefined there (Rust saturates). The PR stays draft through current-head CI verification.
Activity
nathan-v commentedon Oct 21, 2026
Claiming: scene bounds placement (
calculate_bounds_data,add_alignment, and thecrop_to_boundspredicate inlibobs/obs-scene.c.h)obs_bounds_placeand adds a cmocka test that pins the current C behavior. No Rust. Absolute-versus-relative bounds stay incalculate_bounds_data, because that still callssize_to_absolute.obs_bounds_placetoobs-scene(Tier 1 through Tier 3) and moves the file into a ported group.The first PR opens today.
nathan-v commentedon Oct 21, 2026
Characterization is up: #1640
It moves the placement math into
obs_bounds_placeand pins the current C with cmocka. No Rust. The port is the next PR, after this one merges.nathan-v commentedon Oct 21, 2026
Rust port draft: #1661
RED
3b9c0ae73: all 16 safe-core mirrors fail on stubs. GREEN is local: focused Tier 1/layout/differential coverage passes, native workspace tests pass, and Clippy/Dylint pass. Linux Tier 2 is running locally before GREEN is pushed. No C test or public header edits; internal symbols stay hidden. No differences on C-defined conversions; out-of-range/nonfinite float-to-integer conversions are excluded from parity because C is undefined there (Rust saturates). The PR stays draft through current-head CI verification.