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

Closed
github-bot wants to merge 1 commit from gh-pr/2058/head into gh-pr/2058/base
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 04:16 UTC · original
fuzeofficlal:fix/gpu-getdesc-return-outptr-779 → main · +91 −5 · 3 files · 1 commits · closed without merging

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.
**@⁠fuzeofficlal** on GitHub · 2026-11-25 04:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/2058) `fuzeofficlal:fix/gpu-getdesc-return-outptr-779` → `main` · +91 −5 · 3 files · 1 commits · closed without merging 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`.
Return `out` in `RAX` from `descriptor::desc`, `queue::desc`,
`resource::heap_desc`, and `resource::resource_desc` to match the x64
COM ABI for by-value struct returns.

Closes #779.

Co-authored-by: BlueDragonReal <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:53:21 +00:00
github-bot closed this pull request 2026-11-26 04:53:21 +00:00
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 04:41 UTC · original

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).

**@⁠upipibi** on GitHub · 2026-11-25 04:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/2058#issuecomment-7153078986) 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).
Author
Owner

@⁠BlueCatsz on GitHub · 2026-11-25 08:42 UTC · original

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.

**@⁠BlueCatsz** on GitHub · 2026-11-25 08:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/2058#issuecomment-7157376705) 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.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 09:24 UTC · original · edited 2026-11-25 11:23 UTC

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

**@⁠Marvisak** on GitHub · 2026-11-25 09:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/2058#issuecomment-7158287595) · edited 2026-11-25 11:23 UTC <!-- 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)_
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 10:41 UTC · original

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.

**@⁠fuzeofficlal** on GitHub · 2026-11-25 10:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/2058#issuecomment-7160035879) 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.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:05 UTC · original

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.

**@⁠Marvisak** on GitHub · 2026-11-25 22:05 UTC · [original](https://github.com/Marvisak/VIctory/pull/2058#issuecomment-7175922204) 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

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2058
No description provided.