Repository navigation
rust: port graphics/matrix4.c to obs-graphics - #227
Merged
Merged
Conversation
Local-Gate: v1 tree=313f273c26cb89c597191b5a887e5feec361d964 secs=121 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791715564,"gate":"rust/all/fmt","host":"linux-x86_64","key":"c8de349e80cfb5c337466788ae832195a14761a90f136bd9b01ab089b40e1542","lane":"lint","parents":["b9230fa9043e9ba0f1fc1b32a33f63e441cb71ec"],"secs":47,"stamp":"00bd55e424e505ee67220b85e3e35c7d","tree":"313f273c26cb89c597191b5a887e5feec361d964","v":1,"via":"run"}
Ci-Attestation: {"at":1791715564,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"c8de349e80cfb5c337466788ae832195a14761a90f136bd9b01ab089b40e1542","lane":"lint","parents":["b9230fa9043e9ba0f1fc1b32a33f63e441cb71ec"],"secs":47,"stamp":"aad4ec3b5fe62e8abf4cca6987eacf18","tree":"313f273c26cb89c597191b5a887e5feec361d964","v":1,"via":"run"}
Ci-Attestation: {"at":1791715564,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"cdc2aa43905eee6aa339504d38f93eacf39381488e7fa461d4d658640fec2063","lane":"rust-test","parents":["b9230fa9043e9ba0f1fc1b32a33f63e441cb71ec"],"secs":30,"stamp":"35a47fc16075527aca16e931c819d8d7","tree":"313f273c26cb89c597191b5a887e5feec361d964","v":1,"via":"run"}
Ci-Attestation: {"at":1791715564,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"fe9e5c59dc7ce8bbe415ddf2e7cc84716c2565b880bd7a5955634bfa5c51f00e","lane":"tier2-linux","parents":["b9230fa9043e9ba0f1fc1b32a33f63e441cb71ec"],"secs":44,"stamp":"39bfb796ae216a8e8f5b685422b864af","tree":"313f273c26cb89c597191b5a887e5feec361d964","v":1,"via":"run"}
Member
|
Verified locally, rebased onto master and stamped.
Non-blocking: ideally the characterization commit passes against the C on its own, so a fixup into |
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.
Summary
Ports
libobs/graphics/matrix4.ctoobs-graphics::matrix4and swaps it underENABLE_RUST_LIBOBS. Header-inline helpers stay inmatrix4.h.matrix4_mul_4x3_onlyis not exported (hidden in the C build);rotate_i,rotate_aa_i, andscale_icover it.Refs #150, #45.
Commits
159522cb7characterization cmocka testtest_matrix4.5cd84f211— Tier 1 tests against zero stubs.soldr cargo test -p obs-graphics --test matrix4: 11 failed, 1 passed.test_matrix4_transposepassed because the vec4 port already implemented the scalar transpose. The other 11 failassert_eq(left == right): stubs return an all-zero matrix,determinantreturns0.0, andtry_invreturnsSomeof that zero matrix.b9230fa90corrects the translation-inverse expectation. The inverse of a translation by(4, -2, 8)is(-4, 2, -8), soassert_identity(which requires a zero translation) was wrong.f631dd8fa— safe core, C shims, layout test, bit-exact Tier 3 parity,ENABLE_RUST_LIBOBSguard,rust-exports.d/obs-graphics-matrix4.txt.Tests
matrix4tests pass. The rest ofobs-graphicspasses.matrix4_matches_c_oracle, 256 proptest cases, bit equality (NaN == NaN). No ULP slack. The C transpose is SSE unpacks andmatrix4_muluses SSEvec4_dot; both only permute or sum lanes, andVec4::dotuses the SSE sum order, so the results match bit for bit. Determinant and inverse are scalar in C.|det| < 0.0005leavesdstunchanged.+1to-1madematrix4_matches_c_oraclefail (det shim!= C). Reverted.export_listpasses, including the new fragment.-D warningsis clean forobs-graphicsandobs-c-oracle.Tier 2 (
./unittest, OFF and ON) was not run here: Docker is not installed. CI should run it.No intentional differences from C.
The
claimedlabel on #150 needs a maintainer. The claim comment is on the issue.