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/math-extra.c to obs-graphics #351
Phase 5, last graphics-math unit in docs/rust-port/testing-policy.md (after bounds.c, #344). Tracking issue #45.
Dependencies and existing tests
Depends on vec2 and vec3, which are already ported. No cmocka characterization test exists; it lands first in this port. vec3_rand calls rand_float.
Notes
get_percentage and get_percentagei are header-inline and stay C. No new public struct, so there is no layout test.
polar_to_cart, and cart_to_polar when the length is outside EPSILON, copy an uninitialized w (vec3_copy of a local that never writes w). polar_to_norm does not write w. vec3_close is one-sided (component < epsilon, not an absolute difference), so calc_torque treats some far-apart pairs as equal. rand_float draws from the C library rand. No SIMD.
Characterization commit: test/cmocka/test_math_extra.c pins the current exports. Header-inline get_percentage and get_percentagei stay C. The test does not read w after polar_to_cart or a non-zero cart_to_polar (that lane is uninitialized in C).
RED: Tier 1 tests against empty stubs (zero vectors and 0.0).
GREEN: safe core, C shims, Tier 3 parity against obs-c-oracle, ENABLE_RUST_LIBOBS drops graphics/math-extra.c, export fragment libobs/cmake/rust-exports.d/obs-graphics-math_extra.txt. Remove the oracle's unrenamed rand_float host so the Rust shim provides it for vec3_rand.
First PR today, after this comment. Please add the claimed label; I cannot.
Activity
nathan-v commentedon Oct 12, 2026
Claiming: libobs/graphics/math-extra.c
test/cmocka/test_math_extra.cpins the current exports. Header-inlineget_percentageandget_percentageistay C. The test does not readwafterpolar_to_cartor a non-zerocart_to_polar(that lane is uninitialized in C).0.0).obs-c-oracle,ENABLE_RUST_LIBOBSdropsgraphics/math-extra.c, export fragmentlibobs/cmake/rust-exports.d/obs-graphics-math_extra.txt. Remove the oracle's unrenamedrand_floathost so the Rust shim provides it forvec3_rand.First PR today, after this comment. Please add the
claimedlabel; I cannot.rust: Port graphics/math-extra.c to obs-graphics (GREEN)
rust: Port graphics/math-extra.c to obs-graphics (#352)