d3d12: stop using the deprecated fetch_update for the doubles host state #654

Merged
JeffreyBytes merged 1 commit from upstream-pr/654 into main 2026-12-02 21:23:09 +00:00
JeffreyBytes commented 2026-12-02 14:31:46 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-12-02T14:31:46Z.


Summary

Rust 1.99 deprecates AtomicU8::fetch_update, so Clippy with -D warnings fails at runtime/d3d12/src/device/shader_cache/native_doubles.rs:27. This also fails check --no-gpu on current main.

The replacement, try_update, is newer than our Rust 1.95 minimum, and #[allow(deprecated)] would only hide the warning. note_host now runs the same compare-exchange loop by hand (compare_exchange_weak, AcqRel/Acquire), applying joined() to the current value until the exchange succeeds. The state it settles on is unchanged.

Tested

  • The checks relevant to this change passed
  • Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below
  • Where the table calls for AMD and NVIDIA, they passed on both. Otherwise, say which vendor still needs to run them:

No behavior changes, so no new test. joined() holds the logic and already has tests in src/tests/device/shader_cache/native_doubles.rs. The loop itself is mechanical. This is not a shader-translation or GPU path change, so I ran no GPU checks.

GPU, driver and backend: none, CPU-only checks.

Commands run and their results:

cargo clippy -p tuxbox-d3d12 --all-targets -- -D warnings   # passes (failed before on rustc 1.99.0)
python tuxbox.py check --no-gpu   # 13 passed, 0 failed, 0 not run

I cross-built the crate's test binary with cargo xwin test -p tuxbox-d3d12 --lib --no-run --target x86_64-pc-windows-msvc and ran it under Wine in a throwaway prefix. native_doubles passes: 2 passed, 0 failed.

wine tuxbox_d3d12-<hash>.exe native_doubles
test device::shader_cache::native_doubles::tests::one_device_without_doubles_settles_the_process ... ok
test device::shader_cache::native_doubles::tests::a_host_without_doubles_keeps_the_ordinary_keys ... ok
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 657 filtered out
<!-- greyfinch-sync:brcly/TuxBox:issue:5608518036 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/654). Originally posted by [JeffreyBytes](https://github.com/JeffreyBytes) on 2026-12-02T14:31:46Z. --- ## Summary Rust 1.99 deprecates `AtomicU8::fetch_update`, so Clippy with `-D warnings` fails at `runtime/d3d12/src/device/shader_cache/native_doubles.rs:27`. This also fails `check --no-gpu` on current main. The replacement, `try_update`, is newer than our Rust 1.95 minimum, and `#[allow(deprecated)]` would only hide the warning. `note_host` now runs the same compare-exchange loop by hand (`compare_exchange_weak`, AcqRel/Acquire), applying `joined()` to the current value until the exchange succeeds. The state it settles on is unchanged. ## Tested - [x] The checks relevant to this change passed - [x] Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below - [ ] Where the table calls for AMD and NVIDIA, they passed on both. Otherwise, say which vendor still needs to run them: No behavior changes, so no new test. `joined()` holds the logic and already has tests in `src/tests/device/shader_cache/native_doubles.rs`. The loop itself is mechanical. This is not a shader-translation or GPU path change, so I ran no GPU checks. GPU, driver and backend: none, CPU-only checks. Commands run and their results: ```text cargo clippy -p tuxbox-d3d12 --all-targets -- -D warnings # passes (failed before on rustc 1.99.0) python tuxbox.py check --no-gpu # 13 passed, 0 failed, 0 not run ``` I cross-built the crate's test binary with `cargo xwin test -p tuxbox-d3d12 --lib --no-run --target x86_64-pc-windows-msvc` and ran it under Wine in a throwaway prefix. `native_doubles` passes: 2 passed, 0 failed. ```text wine tuxbox_d3d12-<hash>.exe native_doubles test device::shader_cache::native_doubles::tests::one_device_without_doubles_settles_the_process ... ok test device::shader_cache::native_doubles::tests::a_host_without_doubles_keeps_the_ordinary_keys ... ok test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 657 filtered out ```
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
brcly/TuxBox!654
No description provided.