Repository navigation
libobs: Read the remaining graphics inputs before writing dst - #680
Merged
Merged
Conversation
The twelve functions left on obs-rust#370 still return a different value when dst overlaps an input. These tests run each public one on separate storage and on that overlap. graphics_alias_rest: 10 failed, 0 passed. The cmocka twin is test_graphics_alias_rest. get_3x3_submatrix is static, so it has no test entry. gs_u8x4_to_float4 is only in the cmocka file.
Snapshot the lanes each function reads again after storing dst. quat_mul and calc_torque shims were copying that second read; they now use the values taken before the store. Non-overlapping calls are unchanged. test_calc_torque_dst_aliases_v1 now expects (5, 0, 0).
The mirror case builds a plane. matrix3.h only names it, so the
Linux cmocka build rejected the union.
Local-Gate: v1 tree=8b012803f640e9a444ca6e0faeac71a7c6094836 secs=495 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1791956953,"gate":"rust/all/fmt","host":"linux-x86_64","key":"0a90b8b12a4804ae2e72554f958fee6c329a62b1e580ac0a6244221245bfab72","lane":"lint","parents":["8f556380021e029d1b520f4a7e8f92f601a6fe16"],"secs":43,"stamp":"f9d1e5e8f9f70b38f863e6b41ae20740","tree":"8b012803f640e9a444ca6e0faeac71a7c6094836","v":1,"via":"run"}
Ci-Attestation: {"at":1791956953,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"0a90b8b12a4804ae2e72554f958fee6c329a62b1e580ac0a6244221245bfab72","lane":"lint","parents":["8f556380021e029d1b520f4a7e8f92f601a6fe16"],"secs":43,"stamp":"d3dd19c70127c214d8da0c53bba8f4f4","tree":"8b012803f640e9a444ca6e0faeac71a7c6094836","v":1,"via":"run"}
Ci-Attestation: {"at":1791956953,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"cb8666bbbc9479aad98e77d1fce4bd3565a11f0b124cf084a7a8cd3a3ffceabf","lane":"rust-test","parents":["8f556380021e029d1b520f4a7e8f92f601a6fe16"],"secs":122,"stamp":"8a4ebf3c0d85fb183e96cd654fd148a6","tree":"8b012803f640e9a444ca6e0faeac71a7c6094836","v":1,"via":"run"}
Ci-Attestation: {"at":1791956953,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"5301910eb3f2675848ce30ef0fe7308ee7ee7a72ad0d75c337850cc699f97d02","lane":"cross","parents":["8f556380021e029d1b520f4a7e8f92f601a6fe16"],"secs":114,"stamp":"43677f364173669518f0b33cf9a65d23","tree":"8b012803f640e9a444ca6e0faeac71a7c6094836","v":1,"via":"run"}
Ci-Attestation: {"at":1791956953,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"5301910eb3f2675848ce30ef0fe7308ee7ee7a72ad0d75c337850cc699f97d02","lane":"cross","parents":["8f556380021e029d1b520f4a7e8f92f601a6fe16"],"secs":114,"stamp":"dc1f9e8bee8ef7b17f25c79cc90819d4","tree":"8b012803f640e9a444ca6e0faeac71a7c6094836","v":1,"via":"run"}
Ci-Attestation: {"at":1791956953,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"5301910eb3f2675848ce30ef0fe7308ee7ee7a72ad0d75c337850cc699f97d02","lane":"cross","parents":["8f556380021e029d1b520f4a7e8f92f601a6fe16"],"secs":114,"stamp":"cb76a7d1a1bea4582c2d74a91ac28e6c","tree":"8b012803f640e9a444ca6e0faeac71a7c6094836","v":1,"via":"run"}
Ci-Attestation: {"at":1791956953,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"5301910eb3f2675848ce30ef0fe7308ee7ee7a72ad0d75c337850cc699f97d02","lane":"cross","parents":["8f556380021e029d1b520f4a7e8f92f601a6fe16"],"secs":114,"stamp":"4d5c7fc30574031efefb98cd1f26f636","tree":"8b012803f640e9a444ca6e0faeac71a7c6094836","v":1,"via":"run"}
Ci-Attestation: {"at":1791956953,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"5301910eb3f2675848ce30ef0fe7308ee7ee7a72ad0d75c337850cc699f97d02","lane":"cross","parents":["8f556380021e029d1b520f4a7e8f92f601a6fe16"],"secs":114,"stamp":"5a22640db95b0865b4f4bfb9d136d087","tree":"8b012803f640e9a444ca6e0faeac71a7c6094836","v":1,"via":"run"}
Ci-Attestation: {"at":1791956953,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"5301910eb3f2675848ce30ef0fe7308ee7ee7a72ad0d75c337850cc699f97d02","lane":"cross","parents":["8f556380021e029d1b520f4a7e8f92f601a6fe16"],"secs":114,"stamp":"838fece41d7263832529d65c89f2bebd","tree":"8b012803f640e9a444ca6e0faeac71a7c6094836","v":1,"via":"run"}
Ci-Attestation: {"at":1791956953,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"14e3dc82055d93fb556941051e7364a305b06398a89693210c2ef22b75e49f7b","lane":"tier2-linux","parents":["8f556380021e029d1b520f4a7e8f92f601a6fe16"],"secs":216,"stamp":"ba37afd5a3e78c2ad6f4c7ca14eac522","tree":"8b012803f640e9a444ca6e0faeac71a7c6094836","v":1,"via":"run"}
Member
|
Verified red → green locally (
On the edit to the existing
|
zackees
force-pushed
the
fix/370-graphics-alias
branch
from
October 14, 2026 05:49
dfac4b3 to
a9d88cf
Compare
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.
Description
The other twelve functions from #370, plus the private helper
get_3x3_submatrix, stored a lane and then read an input that shared that storage. Each one now copies what it still needs, then writes. Signatures stay as they are.get_3x3_submatrixstays static.quat_mulandcalc_torquein the Rust shims were re-reading after that store so they would match the old C result. They read first now.One overlapping result changes.
calc_torquewithdst == v1, v1(10, 0, 0), v2 at the origin, torque 0.5, used to come back(-10, 0, 0). That was the scaled direction added to itself. The separate-storage result is(5, 0, 0), and the aliased call matches it.test_calc_torque_dst_aliases_v1expects(5, 0, 0). Calls that do not overlap are unchanged.get_3x3_submatrixhas no cmocka entry. Exporting it would be a new symbol. Callers already pass a local 9-float buffer. The Rustmatrix4submatrix already copied its input.Motivation and Context
Fixes #370. The bounds and plane half landed in #423.
How Has This Been Tested?
RED is
c5c2a2f92.graphics_alias_restwas 10 failed, 0 passed. The shim or the C oracle disagreed with the separate-storage result forquat_mul,quat_from_matrix4,quat_from_matrix3,vec3_rotate,vec3_transform3x4,matrix3_scale,matrix3_mirrorv,matrix3_mirror,calc_torque, andpolar_to_norm.GREEN is
70b2528dc. Those 10 pass.dfac4b3baincludesplane.hso the cmocka mirror case compiles.matrix3.honly namesstruct plane.Host is macOS aarch64, soldr 0.9.31:
soldr cargo fmt --all --checksoldr cargo clippy --workspace --all-targets --locked -- -D warningssoldr cargo dylint --all -- --workspace --lib --binssoldr cargo test --workspace --locked./lintstops in its Python self-test on this machine.ci/test_local_gate_probe.pyrunssoldr cargo test --target x86_64-pc-windows-gnu, and soldr 0.9.31 refuses that target on macOS.ci/test_windows_package_arguments.pyfails when pwsh is installed: PowerShell returns/private/var/...and the test expects/var/.... There is no local-gate stamp. This is a fork PR, so the Linux jobs run on GitHub anyway.Linux Docker is image
obs-rust-linux-validate, arm64 Ubuntu 26.04, gcc 15.2.0, rustc 1.98.1. The container is arm64. The GitHub ubuntu-26.04 job is x86_64.rust/tools/linux-validate/run.sh:test_graphics_alias_restandtest_math_extrapassed OFF and ON.cargo test -p obs-graphicsin that image did not run. The oracle buildswcsdepadwith-Werror=sign-conversion, and arm64wchar_tis unsigned, so the compile stops indstr-libc.c. The x86_64 runner does not hit that. Tier 2 uses-Wno-sign-conversionand did build.Codex and a second static review both came back clean. Neither ran the suite.
Types of changes
Overlapping
calc_torqueis the one call whose result changes. It now matches the separate-storage call.Checklist: