GPU: return S_FALSE when private data is already absent #2899

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/2901 into main
andrewpozdnakov7-jpg commented 2026-11-25 23:30:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T23:30:19Z.


Use the result of removal to return S_OK when a null-data SetPrivateData call clears an entry and S_FALSE when the GUID is already absent. Native D3D12 on WARP returned those results on consecutive clears.

The same synthetic COM object test on 842b0cb reports S_OK on the second clear. With this patch it matches the native result. The test also clears a stored zero-byte value and checks that the same GUID on another object keeps its data. The object tests passed (five passed, one ignored). The app-local WARP GPU suite passed (246 passed, one ignored), along with both strict GPU Clippy configurations and the staged asset policy.

SetPrivateData API · Coordination claim

Please retain the Git author if moving the patch. If you fold it into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6615919192 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2901). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-25T23:30:19Z. --- Use the result of removal to return `S_OK` when a null-data `SetPrivateData` call clears an entry and `S_FALSE` when the GUID is already absent. Native D3D12 on WARP returned those results on consecutive clears. The same synthetic COM object test on `842b0cb` reports `S_OK` on the second clear. With this patch it matches the native result. The test also clears a stored zero-byte value and checks that the same GUID on another object keeps its data. The object tests passed (five passed, one ignored). The app-local WARP GPU suite passed (246 passed, one ignored), along with both strict GPU Clippy configurations and the staged asset policy. [SetPrivateData API](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12object-setprivatedata) · [Coordination claim](https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7177534033) Please retain the Git author if moving the patch. If you fold it into another commit, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`.
kotekompotek commented 2026-11-26 00:03:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T23:34:09Z.

Review: COMMENTED


Correct D3D12 semantics: removing private data that isn't there reports S_FALSE, distinct from a successful removal. The test covers both the present and absent-key cases. LGTM.

<!-- greyfinch-sync:Marvisak/VIctory:review:6066469918 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2901#pullrequestreview-6066469918). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T23:34:09Z. **Review:** COMMENTED --- Correct D3D12 semantics: removing private data that isn't there reports S_FALSE, distinct from a successful removal. The test covers both the present and absent-key cases. LGTM.
fuzeofficlal commented 2026-11-26 00:03:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T23:39:19Z.

Review: COMMENTED


Verified head 89414cb0 cleanly merged onto origin/main (63bcca43) on Windows 11 x64.

Code Review

  • Returning S_OK when map.remove(&key).is_some() and S_FALSE otherwise in set_private_data (crates/victory-gpu/src/object.rs) matches native D3D12 ID3D12Object::SetPrivateData behavior on repeated null-data clears and zero-byte stored values, while keeping object isolation intact.

Local Verification

  • cargo test --locked -p victory-gpu --lib object::tests: 5/5 passed (1 ignored release benchmark).
  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Looks clean and ready to merge.

<!-- greyfinch-sync:Marvisak/VIctory:review:6066518931 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2901#pullrequestreview-6066518931). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-25T23:39:19Z. **Review:** COMMENTED --- Verified head `89414cb0` cleanly merged onto `origin/main` (`63bcca43`) on Windows 11 x64. ### Code Review - Returning `S_OK` when `map.remove(&key).is_some()` and `S_FALSE` otherwise in `set_private_data` (`crates/victory-gpu/src/object.rs`) matches native D3D12 `ID3D12Object::SetPrivateData` behavior on repeated null-data clears and zero-byte stored values, while keeping object isolation intact. ### Local Verification - `cargo test --locked -p victory-gpu --lib object::tests`: **5/5 passed** (1 ignored release benchmark). - `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: `191 files ok`. Looks clean and ready to merge.
Dukestar69 commented 2026-11-26 03:04:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T02:27:47Z.

Review: APPROVED


Tested merged onto origin/main (63bcca4) on Windows 11 x64:

  • cargo test -p victory-gpu --lib object::tests: 5 passed, 0 failed, 1 ignored.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6067754003 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2901#pullrequestreview-6067754003). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T02:27:47Z. **Review:** APPROVED --- Tested merged onto `origin/main` (`63bcca4`) on Windows 11 x64: - `cargo test -p victory-gpu --lib object::tests`: **5 passed, 0 failed, 1 ignored**. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Marvisak commented 2026-11-26 03:05:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T02:16:33Z.


Automated triage for the maintainers.

Merge candidate (a recommendation to look, not an approval). In object.rs set_private_data, clearing with null data now returns S_OK when an entry was removed and S_FALSE when the GUID was already absent. That matches the native WARP result the PR reports. The store path is unchanged, and the test covers both cases, including another GUID that keeps its data. The change is small and self-contained. CI check passes.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7180637280 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2901#issuecomment-7180637280). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-26T02:16:33Z. --- <!-- victory-triage v1 head=89414cb04546859a605bd086b0f2e55015b42548 verdict=merge-candidate at=2026-11-26T02:16:30Z --> Automated triage for the maintainers. **Merge candidate** (a recommendation to look, not an approval). In `object.rs` `set_private_data`, clearing with null data now returns `S_OK` when an entry was removed and `S_FALSE` when the GUID was already absent. That matches the native WARP result the PR reports. The store path is unchanged, and the test covers both cases, including another GUID that keeps its data. The change is small and self-contained. CI `check` passes. --- _Generated by [Claude Code](https://claude.ai/code)_
futurepro62 commented 2026-11-26 11:04:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T10:22:17Z.


NVIDIA full-suite run, to go with the reports above by Dukestar69, fuzeofficlal, since none of them names a GPU run. Tested exact head 89414cb (on its base 842b0cb).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 866 passed, 0 failed, 10 ignored.
  • No new #[test] functions in the diff.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7189275546 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2901#issuecomment-7189275546). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-26T10:22:17Z. --- NVIDIA full-suite run, to go with the reports above by Dukestar69, fuzeofficlal, since none of them names a GPU run. Tested exact head `89414cb` (on its base `842b0cb`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **866 passed, 0 failed, 10 ignored**. - No new `#[test]` functions in the diff. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2901:upstream-pr/2901'
git switch 'upstream-pr/2901'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2901'
git switch 'upstream-pr/2901'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2901'
git switch 'upstream-pr/2901'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2901'
git switch 'main'
git merge --squash 'upstream-pr/2901'
git switch 'main'
git merge --ff-only 'upstream-pr/2901'
git switch 'main'
git merge 'upstream-pr/2901'
git push origin 'main'
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
Marvisak/VIctory!2899
No description provided.