Repository navigation
rust: Port graphics/bounds.c to obs-graphics - #344
Merged
Merged
Conversation
Pins the exports in graphics/bounds.c: w cleared by move and merge, kept by scale, index 8 writing corner 6, a ray or line miss leaving *t unchanged, and min_dist independent of the plane distance. bounds_plane_test and bounds_under_plane read an uninitialized w, and a rejected matrix4_inv leaves bounds_intersects_obb's inverse uninitialized. Those paths are not called. Refs obs-rust#343
test_bounds_move fails because Bounds::move_by returns a zero box: left (0, 0, 0, 0)-(0, 0, 0, 0), right (11, 1, 3.5, 0)-(14, 4, 6.5, 0). 17 of 18 Tier 1 tests fail. The one that passes is the ray miss, which is also the empty result. Refs obs-rust#343
The 18 Tier 1 bounds tests pass. Tier 3 bounds_parity is bit-exact against the C oracle for the defined functions, 256 cases, and the layout matches bounds.h. Dropping the segment-length divide in intersection_line makes bounds_matches_c_oracle fail on line t; that break was reverted. bounds_under_plane and bounds_plane_test set w to 0. The C bool return of plane_test is 1 for codes 1, 2, and 3. A rejected matrix4_inv uses a zero matrix, and those inputs are excluded from parity. ENABLE_RUST_LIBOBS drops graphics/bounds.c. Exports are in obs-graphics-bounds.txt. Header-inline helpers stay C. Fixes obs-rust#343 Local-Gate: v1 tree=88e0239623057a1af286a81ff0e120ec30eaed36 secs=108 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791793482,"gate":"rust/all/fmt","host":"linux-x86_64","key":"71f6d73a34848e54e5b690583d672bcf3e98049eb47b5ae2e3e365ecc4158997","lane":"lint","parents":["46e2bf79799061988dd2a3f0ebcb3a0408e3c78b"],"secs":12,"stamp":"622f947c07732a97009c873761b43846","tree":"88e0239623057a1af286a81ff0e120ec30eaed36","v":1,"via":"run"} Ci-Attestation: {"at":1791793482,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"71f6d73a34848e54e5b690583d672bcf3e98049eb47b5ae2e3e365ecc4158997","lane":"lint","parents":["46e2bf79799061988dd2a3f0ebcb3a0408e3c78b"],"secs":12,"stamp":"db7291aa602fdf29d8fcca54f5ba39b4","tree":"88e0239623057a1af286a81ff0e120ec30eaed36","v":1,"via":"run"} Ci-Attestation: {"at":1791793482,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"585392382dbf92222b8d4c4478d8ab87aaef125d12276db681d51809e1ca8b00","lane":"rust-test","parents":["46e2bf79799061988dd2a3f0ebcb3a0408e3c78b"],"secs":44,"stamp":"b41bb8dec20cb61864e88a00ecc07779","tree":"88e0239623057a1af286a81ff0e120ec30eaed36","v":1,"via":"run"} Ci-Attestation: {"at":1791793482,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"113e7c03da0aefdf5deba3a37244a6c35cfaf5258be5e8ec5d4b972ab47968bd","lane":"tier2-linux","parents":["46e2bf79799061988dd2a3f0ebcb3a0408e3c78b"],"secs":52,"stamp":"0adfb102c3daffd57220690823e017cd","tree":"88e0239623057a1af286a81ff0e120ec30eaed36","v":1,"via":"run"}
Member
|
Verified locally, rebased onto master and stamped. The new head is
The rebase conflicted with #338 (plane), which also added Merging once CI is green. |
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 #343.
Ports
libobs/graphics/bounds.ctoobs-graphics. Header-inline helpers stay C.ENABLE_RUST_LIBOBSdropsgraphics/bounds.c. Exports are inlibobs/cmake/rust-exports.d/obs-graphics-bounds.txt.Commits
3581d4014characterization:test/cmocka/test_bounds.c. It does not callbounds_plane_test,bounds_under_plane, or a singularbounds_intersects_obb(those read uninitialized memory in C).90c2da46aRED.test_bounds_movefails becauseBounds::move_byreturns a zero box: left(0, 0, 0, 0)-(0, 0, 0, 0), right(11, 1, 3.5, 0)-(14, 4, 6.5, 0). 17 of 18 Tier 1 tests fail. The one that passes is the ray miss, which is also the empty result.9f0af2910GREEN.What passed here
boundstests.bounds_layout_matches_c_header(size 32, align 16).bounds_matches_c_oracle, 256 cases, bit-exact (NaN equals NaN).export_list(3 tests).clippy -p obs-graphics --all-targets -- -D warnings.tfromintersection_linewithout dividing by the segment length madebounds_matches_c_oraclefail online t. That break was reverted.Intentional differences
bounds_under_planeandbounds_plane_testset the cornerwto 0. C leaves it uninitialized andvec3_dotreads it, so those two are not compared to the oracle. The safeplane_testreturnsBOUNDS_OUTSIDE(1),BOUNDS_INSIDE(2), orBOUNDS_PARTIAL(3). The C function is declaredbool, and this compiler stores 1 for every branch (plane_test_abi_byte). The shim returns that byte.bounds_intersects_obbuses a zero matrix when|det| < 0.0005. C leaves that inverse uninitialized. Parity skips those matrices.vec3_min/vec3_maxfollow SSE: the second lane unless the comparison holds. A ray or line miss does not write*t.bounds_get_pointwrites a corner for index 8 and writes nothing fori > 8.Not run
Docker is not installed, so Tier 2 cmocka (
./unittest) and the local-gate stamp were not run. This does not claim CI is green. Please add theclaimedlabel on #343. If this branch is behind master at review, rebase onto master and stamp; #338 (plane.c) also editslibobs/CMakeLists.txtandrust/README.md.