Skip to content

obs-scene: Port the scene group transform - #1724

Merged
zackees merged 2 commits into
obs-rust:masterfrom
nathan-v:port/scene-group-transform
Oct 22, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
nathan-v:port/scene-group-transform

Conversation

@nathan-v

@nathan-v nathan-v commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1719

#1722 merged as 8534113ae. This branch is the port only, rebased onto cfd212d34. That master includes #1762, which drops CR from format_conversion.effect before techniques_exist_in_the_effect searches it. Windows Tier 2 on d4c5be432 failed that search (Planar_Y, run 39741036217) because the runner checkout is CRLF. Two commits: acf949975 (RED) and c8bd1616a (GREEN).

What and why

obs_scene_transform_val and obs_scene_group_transform are the Rust core in obs-scene. The scene still reads the item, still converts absolute and relative coordinates, still inverts the draw transform when an item joins a group, and still calls update_item_transform. The two shims stay hidden. test_scene_group_transform still compiles the C, so it cannot see the swap. Tier 3 does.

Translation moves position only. Scale is the column length after the translation is cleared, and a scale that is not greater than zero takes the minus sign, so a zero scale becomes negative zero. A rotation in the matrix does not change the scale. The C writes x_base and never reads it; the Rust core skips that store. No intentional differences.

RED → GREEN

  • RED commit: acf949975 obs-scene: Add the group transform tests. soldr cargo test -p obs-data --test obs-tests-core group_transform failed 7/7. Six panic in group_transform (not yet implemented: obs_scene_group_transform) and transform_val_includes_translation panics in transform_val (not yet implemented: obs_scene_transform_val).
  • GREEN commit: c8bd1616a. Tier 1 scene::group_transform is 7/7. Tier 3 is layout, the cmocka cases, and a proptest over every f32 bit pattern. Flipping the scale sign test from > to >= failed cmocka_cases_match_oracle: rust (0, 0), oracle (-0, -0). Reverted. vec4_len and the scale multiply are written out in the scene object, so it does not call into the obs-graphics unit that contains ep_free. test_scene_bounds_place_rust links that archive against libobs.so and cannot see the hidden adapter symbols (runs 39730507255 and 39731439560). After this rebase the 10 group-transform tests passed again.
  • Real app: no behavior change.

Local checks

  • soldr cargo fmt --all --check, clang-format (2987 files), gersemi (522 files), soldr cargo clippy --workspace --all-targets --locked -- -D warnings, and soldr cargo dylint --all -- --workspace --lib --bins passed.

  • soldr cargo test --workspace --locked passed, including the 10 group-transform tests. Doctests passed. The lane's x86_64-pc-windows-gnu --no-run step does not run here: soldr wants a Windows or Linux host for that target.

  • ./lint's Python self-tests still fail on this Mac before rustfmt (bash 3, the Darwin linker, /tmp vs /private/tmp). ci/test_build_groups.py and ci/test_ported_sources.py passed after the unity file was staged.

  • Linux Tier 2 in Docker did not reach ctest. test_ws_screenshot_srgb includes utils/Obs.h on the case-insensitive mount, and test_scene_bounds_place_rust fails with undefined references to obs_effect_parser_destroy_element and the other hidden adapter symbols. nm on that libobs.so.30 shows obs_scene_transform_val and obs_scene_group_transform as local text. No stamp. PR CI runs the Linux jobs.

  • The cross lane did not get past the Windows MSVC target. Host cc has no windows.h (thread_name_seh.c) and no stdio.h for the jansson build. That is this machine's SDK, not the port. The macOS cross target did not run.

Checklist

  • Base is master (or the description starts with a Stacked: note)
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits
  • User-visible change: its line in docs/features.md is added or updated (not applicable: no user-visible change)
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes (-W..., ratchets): built with scripting ON (PR CI builds no OBS app: run gh workflow run ci.yml --ref <branch> for the full builds) and cross-checked with clang and MSVC (not applicable: no flag change)
  • Intentional differences from C listed in the parity test header and rust/README.md (ports)

@nathan-v
nathan-v force-pushed the port/scene-group-transform branch 4 times, most recently from c28ddca to d4c5be4 Compare October 22, 2026 07:31
Tier 1 mirrors test_scene_group_transform. The core is still todo, so
the seven cases panic: not yet implemented.

Refs obs-rust#1719
The safe core matches obs-scene-group-transform.c.h. The two shims stay
hidden. The scene still converts absolute and relative coordinates, still
inverts the draw transform, and still calls update_item_transform. The C
file moves to libobs.ported-scene-group-transform.

vec4_len and the scale multiply are the header operations, written out in
this object. A call into obs-graphics can land in the codegen unit that
contains ep_free, and test_scene_bounds_place_rust cannot see those hidden
adapter symbols.

Tier 1 scene::group_transform is 7/7. Tier 3 parity is 3/3, including a
proptest over every f32 bit pattern. Flipping the scale sign test from
> to >= failed cmocka_cases_match_oracle: rust (0, 0), oracle (-0, -0).
Reverted. No intentional differences.

Fixes obs-rust#1719
@nathan-v
nathan-v force-pushed the port/scene-group-transform branch from d4c5be4 to c8bd161 Compare October 22, 2026 14:05
@nathan-v
nathan-v marked this pull request as ready for review October 22, 2026 16:43
@nathan-v
nathan-v requested a review from zackees as a code owner October 22, 2026 16:43
@zackees
zackees added this pull request to the merge queue Oct 22, 2026
Merged via the queue into obs-rust:master with commit 6f32813 Oct 22, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

rust: Port the scene group transform in obs-scene.c to obs-scene

2 participants