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 group content extent in obs-scene.c to obs-scene #1919
The group content extent in libobs/obs-scene.c.h, into rust/obs-scene (new module extent). This is the min/max fold over the four corners of every item's box_transform in resize_scene_base, and the size step: scale = max - min, cx/cy from ceilf, already saturated by #1840. An empty scene gives cx = cy = 0.
The rest stays C: the loops in resize_scene_base, the child shift (it calls update_item_transform), resize_scene and resize_group.
Plan (one PR)
Move the fold and the size step into libobs/obs-scene-extent.c.h, behind hidden obs_scene_extent_add() and obs_scene_extent_size(). resize_scene_base keeps its loops. This is a behaviour-neutral commit of its own.
Characterization test (test_group_extent) against the moved C. It covers:
one item, several items and rotated items;
a fractional extent rounded up;
the empty scene;
NaN in a transform: the </> compares skip it, so the Rust fold must use the same compares;
±infinity and out-of-range sizes.
RED, then GREEN: the safe Rust fold plus shims in a libobs.ported-scene-extent group. No seam is needed: C passes a pointer to item->box_transform. The exported-symbol count is unchanged.
Tier 3 parity against the original C: a proptest over finite, huge, NaN and infinite transforms, with bit-equal f32 results. Also a deliberate-break check and port_comparison numbers.
These real-libobs tests must stay green on both lanes: test_group_child_drift, test_group_empty_bounds, test_scene_group_transform and test_scene_dup_group_children.
Activity
rdoupe commentedon Oct 23, 2026
Claiming: #1919.
libobs: Move the scene content extent out
test: Characterize the scene content extent
obs-scene: Add the scene content extent tests
obs-scene: Port the scene content extent
obs-scene: Check the scene content extent port against the C
docs: Record the scene content extent port
libobs: Move the scene content extent out
test: Characterize the scene content extent
obs-scene: Add the scene content extent tests
obs-scene: Port the scene content extent
obs-scene: Check the scene content extent port against the C
docs: Record the scene content extent port
libobs: Move the scene content extent out
test: Characterize the scene content extent
obs-scene: Add the scene content extent tests
obs-scene: Port the scene content extent
obs-scene: Check the scene content extent port against the C
docs: Record the scene content extent port
libobs: Move the scene content extent out
test: Characterize the scene content extent
obs-scene: Add the scene content extent tests
obs-scene: Port the scene content extent
obs-scene: Check the scene content extent port against the C
docs: Record the scene content extent port
obs-scene: Port the group content extent (obs-rust#1922)