Repository navigation
rust: port graphics/quat.c to obs-graphics - #172
Merged
Merged
Conversation
The existing cmocka test only covered the header-inline setters. Pin the exported quat.c functions, and add the matching Rust tests against todo!() cores. soldr cargo test -p obs-graphics --test quat: 0 passed, 13 failed.
The safe core follows quat.c, including the SSE quat_dot order and the matrix3-as-matrix4 cast. quat_mul stores the vector before reading the scalar weights, so an aliased destination matches C. Header-inline helpers stay in quat.h. Tier 1, layout, and Tier 3 parity pass. Flipping the product scalar's sign fails mul_matches_c_oracle. No intentional differences from C.
Member
|
Verified locally (soldr cache disabled):
Will merge once CI is green. Thanks for claiming on #148 first. |
This was referenced Oct 11, 2026
10 of 22 tasks
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 #148
What and why
Ports
libobs/graphics/quat.cintoobs-graphics. The eleven exported functions move behindENABLE_RUST_LIBOBS. Header-inline helpers inquat.hstay C.quat_get_dircomputes the Z axis ofmatrix3_from_quat(that file stays C).quat_from_matrix3reads the matrix as amatrix4, including each axiswlane, as the C cast does.quat_mulstores the vector before reading the scalar weights, so a destination that aliases an input matches C.No intentional differences from C.
RED → GREEN
5a3a59639.soldr cargo test -p obs-graphics --test quat— 0 passed, 13 failed (todo!()).soldr cargo test --workspace --lockedpassed (Tiers 1–3).soldr cargo clippy --workspace --all-targets --locked -- -D warningspassed../lint(clang-format, gersemi, rustfmt, clippy) passed.mul_matches_c_oracle.rust/tools/linux-validate/run.sh, OFF and ON) was not run here. This machine has no Docker.Checklist
masterclaimedlabel.Refs #45