You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rust: Port libobs/graphics/bounds.c to obs-graphics #343
Phase 5 graphics math. Policy order: quat.c, matrix3.c, matrix4.c, plane.c, bounds.c, axisang.c, math-extra.c. quat, matrix3, matrix4, and axisang are already on master. plane.c is open PR #338 and is not a dependency of this file. Tracking issue #45.
Dependencies and existing tests
Depends on vec3 (add, mul, min, max, abs, len, dot, transform, transform3x4, plane distance), matrix4_inv, and matrix3_transpose. It does not call any function in plane.c. struct plane is already in obs-graphics.
No cmocka test covers bounds.c. The characterization test lands first in the port PR.
Notes
Header-inline helpers (bounds_zero, bounds_copy, bounds_inside, bounds_vec3_inside, bounds_intersects_ray, bounds_intersects_line) stay C.
bounds_plane_test is declared bool and returns BOUNDS_OUTSIDE (1), BOUNDS_INSIDE (2), or BOUNDS_PARTIAL (3). The near and far corners leave w uninitialized, and vec3_plane_dist dots that lane. bounds_under_plane also leaves w uninitialized and dots it. bounds_intersects_obb calls matrix4_inv into an uninitialized matrix and, when |det| < 0.0005, C writes nothing.
The Rust core will define those three paths (w = 0, and a zero matrix when the inverse is rejected) and record them as intentional differences. Parity will not compare the uninitialized-w paths, and it will skip singular bounds_intersects_obb inputs.
Characterization commit: test/cmocka/test_bounds.c pins the current exports. Header-inline helpers stay C. bounds_plane_test and bounds_under_plane read an uninitialized w, and bounds_intersects_obb reads an uninitialized inverse when |det| < 0.0005, so those paths are not asserted from cmocka.
RED commit: Tier 1 Rust tests against empty stubs (0 / false / None), and the failing test name recorded in the PR.
GREEN commit: safe core, C shims, layout test, and a 256-case proptest against obs-c-oracle. bounds_under_plane sets w to 0. A rejected matrix4_inv uses a zero matrix. Both are intentional differences, excluded from parity, and named in rust/README.md. bounds_plane_test's safe API returns the 1/2/3 code; the exported byte matches whatever this compiler's bool conversion of that return actually stores.
One PR, branch port/bounds, base master. I expect to open it today.
Please add the claimed label. I cannot apply labels on an existing issue.
Activity
nathan-v commentedon Oct 12, 2026
Claiming: libobs/graphics/bounds.c
test/cmocka/test_bounds.cpins the current exports. Header-inline helpers stay C.bounds_plane_testandbounds_under_planeread an uninitializedw, andbounds_intersects_obbreads an uninitialized inverse when|det| < 0.0005, so those paths are not asserted from cmocka.0/false/None), and the failing test name recorded in the PR.obs-c-oracle.bounds_under_planesetswto 0. A rejectedmatrix4_invuses a zero matrix. Both are intentional differences, excluded from parity, and named inrust/README.md.bounds_plane_test's safe API returns the 1/2/3 code; the exported byte matches whatever this compiler'sboolconversion of that return actually stores.port/bounds, basemaster. I expect to open it today.Please add the
claimedlabel. I cannot apply labels on an existing issue.test/cmocka: Add bounds characterization test
rust: Add bounds tests against empty stubs (RED)
rust: Port graphics/bounds.c to obs-graphics (GREEN)