Skip to content

rust: Port the group content extent in obs-scene.c to obs-scene #1919

Closed

Description

@rdoupe

Unit

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)

  1. 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.
  2. 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.
  3. 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.
  4. 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

  1. rdoupe commented on Oct 23, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #1919.

  2. added
    claimed
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions