GPU: return hidden output pointer from GetDesc COM methods #2056

Closed
fuzeofficlal wants to merge 1 commit from upstream-pr/2058 into main
fuzeofficlal commented 2026-11-25 04:16:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T04:16:51Z.


Closes #779.

Summary

  • Return out in RAX from descriptor::desc (0x40), queue::desc (0xd0/0xe0), resource::heap_desc (0x40), and resource::resource_desc (0x50) to satisfy the x64 COM ABI for by-value structure returns (GetDesc), matching allocation_info and custom_heap_properties.
  • Guard against null this in addition to null out before writing the descriptor.

Testing

  • Added vtable dispatch tests in descriptor::tests, queue::tests, and resource::tests verifying that RAX equals the caller's out buffer pointer, the returned descriptor fields match, and null this/out pointers are handled safely.
  • cargo test -p victory-gpu, cargo clippy --workspace --all-targets --all-features -- -D warnings, and cargo xtask policy.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6597090678 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2058). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-25T04:16:51Z. --- Closes #779. ### Summary - Return `out` in `RAX` from `descriptor::desc` (`0x40`), `queue::desc` (`0xd0`/`0xe0`), `resource::heap_desc` (`0x40`), and `resource::resource_desc` (`0x50`) to satisfy the x64 COM ABI for by-value structure returns (`GetDesc`), matching `allocation_info` and `custom_heap_properties`. - Guard against null `this` in addition to null `out` before writing the descriptor. ### Testing - Added vtable dispatch tests in `descriptor::tests`, `queue::tests`, and `resource::tests` verifying that `RAX` equals the caller's `out` buffer pointer, the returned descriptor fields match, and null `this`/`out` pointers are handled safely. - `cargo test -p victory-gpu`, `cargo clippy --workspace --all-targets --all-features -- -D warnings`, and `cargo xtask policy`.
catminou4 commented 2026-11-25 05:05:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T04:17:33Z.

Review: COMMENTED


Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.

GetDesc COM methods return the hidden output pointer — COM ABI correctness fix.

<!-- greyfinch-sync:Marvisak/VIctory:review:6051789498 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2058#pullrequestreview-6051789498). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T04:17:33Z. **Review:** COMMENTED --- Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff. GetDesc COM methods return the hidden output pointer — COM ABI correctness fix.
DenRakEiw commented 2026-11-25 05:05:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T04:44:47Z.

Review: APPROVED


Verified locally merged onto origin/main (940d32f, Windows 11 x64, Rust 1.98.1 MSVC):

  • cargo test -p victory-gpu --lib get_desc_returns_its_output_pointer — 2 passed, 0 failed (heap_get_desc_returns_its_output_pointer and queue_get_desc_returns_its_output_pointer)
  • cargo clippy -p victory-gpu --all-targets — 0 warnings
  • cargo xtask policy — ok (183 files ok)

Clean MSVC ABI fix returning the hidden out pointer from GetDesc COM methods with targeted unit tests. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6051980512 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2058#pullrequestreview-6051980512). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T04:44:47Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (`940d32f`, Windows 11 x64, Rust 1.98.1 MSVC): - `cargo test -p victory-gpu --lib get_desc_returns_its_output_pointer` — 2 passed, 0 failed (`heap_get_desc_returns_its_output_pointer` and `queue_get_desc_returns_its_output_pointer`) - `cargo clippy -p victory-gpu --all-targets` — 0 warnings - `cargo xtask policy` — ok (`183 files ok`) Clean MSVC ABI fix returning the hidden `out` pointer from `GetDesc` COM methods with targeted unit tests. Looks good. AI-assisted (Gemini 4 Neon).
upipibi commented 2026-11-25 05:06:23 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T04:41:40Z.


Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at 600abfd. victory-gpu: 143 passed, 2 failed, 2 ignored; the new heap_get_desc_returns_its_output_pointer and queue_get_desc_returns_its_output_pointer pass. The 2 failures are #1744's heap-cap failures on main. Same as main on this hardware. Not run: a title.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7153078986 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2058#issuecomment-7153078986). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T04:41:40Z. --- Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at `600abfd`. `victory-gpu`: 143 passed, 2 failed, 2 ignored; the new `heap_get_desc_returns_its_output_pointer` and `queue_get_desc_returns_its_output_pointer` pass. The 2 failures are #1744's heap-cap failures on `main`. Same as `main` on this hardware. Not run: a title. AI-assisted (Claude Code).
BlueCatsz commented 2026-11-25 09:06:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by BlueCatsz on 2026-11-25T08:42:47Z.


Heads-up for maintainers and @fuzeofficlal: #779 already had PR #1093 opened from BlueCatsz:fix/gpu-getdesc-return-ptr (ef2f8fa1), which was mistakenly auto-closed at 00:31 UTC shortly before #779's 03:52 UTC triage comment asked for a PR from that branch. I've appealed on #1093 to have it reopened so maintainers don't end up reviewing the same change twice.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7157376705 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2058#issuecomment-7157376705). Originally posted by [BlueCatsz](https://github.com/BlueCatsz) on 2026-11-25T08:42:47Z. --- Heads-up for maintainers and @fuzeofficlal: #779 already had PR #1093 opened from `BlueCatsz:fix/gpu-getdesc-return-ptr` (`ef2f8fa1`), which was mistakenly auto-closed at `00:31 UTC` shortly before `#779`'s `03:52 UTC` triage comment asked for a PR from that branch. I've appealed on #1093 to have it reopened so maintainers don't end up reviewing the same change twice.
Xvania7 commented 2026-11-25 10:06:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Xvania7 on 2026-11-25T09:50:42Z.

Review: APPROVED


Verified locally merged onto origin/main (940d32f, head 600abfd, Windows 10 x64 19045, NVIDIA GeForce RTX 5060, Rust 1.98.1 MSVC):

  • cargo test -p victory-gpu --lib -- --test-threads=1 resource::tests:: — 10 passed, 0 failed
  • cargo test -p victory-gpu --lib -- --test-threads=1 descriptor::tests:: — 6 passed, 0 failed (including heap_get_desc_returns_its_output_pointer)
  • cargo clippy -p victory-gpu --all-targets -- -D warnings — 0 warnings

Clean RAX output-pointer fix for GetDesc COM methods.

<!-- greyfinch-sync:Marvisak/VIctory:review:6055284984 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2058#pullrequestreview-6055284984). Originally posted by [Xvania7](https://github.com/Xvania7) on 2026-11-25T09:50:42Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (`940d32f`, head `600abfd`, Windows 10 x64 19045, NVIDIA GeForce RTX 5060, Rust 1.98.1 MSVC): - `cargo test -p victory-gpu --lib -- --test-threads=1 resource::tests::` — 10 passed, 0 failed - `cargo test -p victory-gpu --lib -- --test-threads=1 descriptor::tests::` — 6 passed, 0 failed (including `heap_get_desc_returns_its_output_pointer`) - `cargo clippy -p victory-gpu --all-targets -- -D warnings` — 0 warnings Clean RAX output-pointer fix for GetDesc COM methods.
Marvisak commented 2026-11-25 10:07:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T09:24:27Z.


Automated triage for the maintainers.

Merge candidate.

The new head d4bbd6f keeps the fix for #779. descriptor.rs desc, queue.rs desc, resource.rs heap_desc and resource.rs resource_desc now return the hidden out pointer in RAX, which the Microsoft x64 convention requires for struct returns and which allocation_info/custom_heap_properties already do. As suggested, the unreachable this.is_null() guards and their assertions are gone. The tests call each method through its vtable slot and check the returned pointer and the descriptor fields. main still has the four ()-returning versions, so this is not yet landed.

#1093 (same change) is still closed. If it is reopened, only one of the two should land. This one merges cleanly and credits the other author.

CI: passing (check).

On your reply: thanks, the update addresses the earlier nit.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158287595 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2058#issuecomment-7158287595). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T09:24:27Z. --- <!-- victory-triage v1 head=d4bbd6f23cdb6c92bfb4346509fd7d2637c8f980 verdict=merge-candidate at=2026-11-25T11:23:19Z --> Automated triage for the maintainers. **Merge candidate.** The new head `d4bbd6f` keeps the fix for #779. `descriptor.rs` `desc`, `queue.rs` `desc`, `resource.rs` `heap_desc` and `resource.rs` `resource_desc` now return the hidden `out` pointer in RAX, which the Microsoft x64 convention requires for struct returns and which `allocation_info`/`custom_heap_properties` already do. As suggested, the unreachable `this.is_null()` guards and their assertions are gone. The tests call each method through its vtable slot and check the returned pointer and the descriptor fields. `main` still has the four `()`-returning versions, so this is not yet landed. #1093 (same change) is still closed. If it is reopened, only one of the two should land. This one merges cleanly and credits the other author. CI: passing (`check`). On your reply: thanks, the update addresses the earlier nit. --- _Generated by [Claude Code](https://claude.ai/code)_
fuzeofficlal commented 2026-11-25 11:05:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T10:41:12Z.


Updated in d4bbd6f2: dropped the unreachable this.is_null() checks/assertions per the triage note, and added Co-authored-by attribution for @BlueCatsz (#1093) — happy with whichever PR maintainers prefer to land.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7160035879 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2058#issuecomment-7160035879). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-25T10:41:12Z. --- Updated in `d4bbd6f2`: dropped the unreachable `this.is_null()` checks/assertions per the triage note, and added `Co-authored-by` attribution for @BlueCatsz (#1093) — happy with whichever PR maintainers prefer to land.
Xvania7 commented 2026-11-25 12:02:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Xvania7 on 2026-11-25T11:40:44Z.

Review: APPROVED


Re-verified d4bbd6f on Windows 10 + NVIDIA GeForce RTX 5060:

  • resource::tests:: (10 passed)
  • descriptor::tests:: (6 passed)
  • queue::tests:: (5 passed, including queue_get_desc_returns_its_output_pointer)
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings
  • cargo xtask policy: 182 files ok

Clean drop of the unreachable checks. Approving.

<!-- greyfinch-sync:Marvisak/VIctory:review:6056942445 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2058#pullrequestreview-6056942445). Originally posted by [Xvania7](https://github.com/Xvania7) on 2026-11-25T11:40:44Z. **Review:** APPROVED --- Re-verified `d4bbd6f` on Windows 10 + NVIDIA GeForce RTX 5060: - `resource::tests::` (10 passed) - `descriptor::tests::` (6 passed) - `queue::tests::` (5 passed, including `queue_get_desc_returns_its_output_pointer`) - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: 0 warnings - `cargo xtask policy`: 182 files ok Clean drop of the unreachable checks. Approving.
upstream-sync closed this pull request 2026-11-25 23:03:40 +00:00
Marvisak commented 2026-11-25 23:05:57 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:05:27Z.


Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing because the premise does not hold. On the console these GetDesc table entries take an explicit out pointer and return nothing, and the inline wrapper returns its own local copy, so no caller reads the return register. GetResourceAllocationInfo and GetCustomHeapProperties are different (they really return a struct through a hidden pointer), which is why allocation_info and custom_heap_properties return it. The new tests only assert the new return value.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7175922204 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2058#issuecomment-7175922204). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T22:05:27Z. --- Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing because the premise does not hold. On the console these `GetDesc` table entries take an explicit out pointer and return nothing, and the inline wrapper returns its own local copy, so no caller reads the return register. `GetResourceAllocationInfo` and `GetCustomHeapProperties` are different (they really return a struct through a hidden pointer), which is why `allocation_info` and `custom_heap_properties` return it. The new tests only assert the new return value. If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

Pull request closed

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!2056
No description provided.