GPU: report default buffer alignment from GetDesc #2690

Open
github-bot wants to merge 1 commit from github-bot/gh-2690 into main AGit
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-25 18:17 UTC · original
andrewpozdnakov7-jpg:codex2/buffer-get-desc-alignment → main · +66 −1 · 1 files · 1 commits · open

Problem

GetDesc returns the creation description's alignment of zero for a buffer created with the default alignment. Native D3D12 reports the effective 64 KiB alignment for the same buffer. Zero is the creation shorthand for 64 KiB. D3D12 buffer description

Change

Resolve the default alignment in the buffer description returned by GetDesc.

Verification

  • The same synthetic 256-byte committed buffer and guest vtable query on main 13f91ca reports alignment 0, while native D3D12 WARP reports 65536. Both report 65536 after the change.
  • The explicit 65536-byte alignment control reports 65536 on both versions. All 18 resource tests, strict victory-gpu Clippy, and the staged policy passed.

Coordination claim

AI-assisted (Codex 2). Please retain the Git author on cherry-pick or rebase. If folding this change into another commit, please retain Co-authored-by: andrewpozdnakov7-jpg [email protected].

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-25 18:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/2690) `andrewpozdnakov7-jpg:codex2/buffer-get-desc-alignment` → `main` · +66 −1 · 1 files · 1 commits · open ## Problem GetDesc returns the creation description's alignment of zero for a buffer created with the default alignment. Native D3D12 reports the effective 64 KiB alignment for the same buffer. Zero is the creation shorthand for 64 KiB. [D3D12 buffer description](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_resource_desc#buffers) ## Change Resolve the default alignment in the buffer description returned by GetDesc. ## Verification - The same synthetic 256-byte committed buffer and guest vtable query on main 13f91ca reports alignment 0, while native D3D12 WARP reports 65536. Both report 65536 after the change. - The explicit 65536-byte alignment control reports 65536 on both versions. All 18 resource tests, strict victory-gpu Clippy, and the staged policy passed. [Coordination claim](https://git.gtahub.st/github/Marvisak--VIctory/issues/1633) AI-assisted (Codex 2). Please retain the Git author on cherry-pick or rebase. If folding this change into another commit, please retain Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.
Resolve the default buffer alignment on output. The same guest resource query reports zero on main and matches native D3D12 WARP at 65536 bytes after the change.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:12:07 +00:00
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 18:53 UTC · original

Matches native semantics: GetDesc resolves the creation shorthand (0 = default 64 KiB for buffers) to the effective alignment. Verified the test compares against a real committed WARP buffer for both inputs, not just the constant.

**@⁠kotekompotek** on GitHub · 2026-11-25 18:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/2690#issuecomment-7171553502) Matches native semantics: GetDesc resolves the creation shorthand (0 = default 64 KiB for buffers) to the effective alignment. Verified the test compares against a real committed WARP buffer for both inputs, not just the constant.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 18:59 UTC · original

Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and review of 78bf751c (on 13f91ca):

Verification (rustc 1.98.1 MSVC)

  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings and --features diagnostics: 0 warnings.
  • RTX 5090: cargo test --locked -p victory-gpu --features diagnostics --lib resource: 20 passed, 0 failed (buffer_get_desc_reports_the_effective_alignment: input 65536 -> native 65536, guest 65536; input 0 -> native 65536, guest 65536).
  • WARP (VICTORY_D3D12_WARP=1): cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1: 199 passed, 0 failed, 1 ignored.

Review Notes

  • Scoping the 0 -> KIB_64 default strictly to desc.dimension == BUFFER matches D3D12 GetDesc() and resource::footprint without altering texture alignments (4 KiB / 64 KiB / 4 MiB MSAA). Clean and ready to merge.
**@⁠fuzeofficlal** on GitHub · 2026-11-25 18:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/2690#issuecomment-7171680163) Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and review of `78bf751c` (on `13f91ca`): ### Verification (`rustc 1.98.1` MSVC) - `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` and `--features diagnostics`: **0 warnings**. - **RTX 5090:** `cargo test --locked -p victory-gpu --features diagnostics --lib resource`: **20 passed, 0 failed** (`buffer_get_desc_reports_the_effective_alignment`: `input 65536 -> native 65536, guest 65536`; `input 0 -> native 65536, guest 65536`). - **WARP (`VICTORY_D3D12_WARP=1`):** `cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1`: **199 passed, 0 failed, 1 ignored**. ### Review Notes - Scoping the `0 -> KIB_64` default strictly to `desc.dimension == BUFFER` matches D3D12 `GetDesc()` and `resource::footprint` without altering texture alignments (`4 KiB` / `64 KiB` / `4 MiB` MSAA). Clean and ready to merge.
Author
Owner

@⁠oni-swr on GitHub · 2026-11-25 19:41 UTC · original

Independent WARP/CPU verification

Head: 78bf751c5baa2f2f7f9b8d0386512c31d34de971
Base: origin/main 13f91caee25f2fdf2c062be5f7a27f058e51cbca
Status: open, non-draft; clean merge tree; no oni-swr comment on this head.

Environment: Windows x64, WARP selected (VICTORY_WARP=1, VICTORY_D3D12_WARP=1), dxil.dll 1.8.2502.11 from Windows SDK 10.0.26100.0; rustc 1.98.1.

Commands (each with CARGO_TARGET_DIR=D:\victory-warp-2690-target and the WARP variables above):

  • Baseline and PR: cargo test --locked -p victory-gpu
  • Baseline and PR diagnostics: cargo test --locked -p victory-gpu --features diagnostics
  • PR targeted: cargo test --locked -p victory-gpu buffer_get_desc_reports_the_effective_alignment
  • PR lint: cargo clippy --locked -p victory-gpu --all-targets -- -D warnings

Results: default baseline 195 passed, 1 ignored; PR 196 passed, 1 ignored. Diagnostics baseline 197 passed, 1 failed, 1 ignored; PR 199 passed, 1 ignored. The baseline-only failure was memory::tests::a_submission_that_missed_leaves_the_copies_at_once; it passed in the PR run. Targeted alignment test 1/1 passed. Clippy passed.

Negative control: restored the old resource_desc behavior; the alignment regression failed (exit 101), as expected. No implementation bug found.

Not tested: physical GPU, retail title, release build. AI-assisted: Codex (gpt-6-luna).

**@⁠oni-swr** on GitHub · 2026-11-25 19:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/2690#issuecomment-7172633883) Independent WARP/CPU verification Head: `78bf751c5baa2f2f7f9b8d0386512c31d34de971` Base: `origin/main` `13f91caee25f2fdf2c062be5f7a27f058e51cbca` Status: open, non-draft; clean merge tree; no `oni-swr` comment on this head. Environment: Windows x64, WARP selected (`VICTORY_WARP=1`, `VICTORY_D3D12_WARP=1`), `dxil.dll` 1.8.2502.11 from Windows SDK 10.0.26100.0; rustc 1.98.1. Commands (each with `CARGO_TARGET_DIR=D:\victory-warp-2690-target` and the WARP variables above): - Baseline and PR: `cargo test --locked -p victory-gpu` - Baseline and PR diagnostics: `cargo test --locked -p victory-gpu --features diagnostics` - PR targeted: `cargo test --locked -p victory-gpu buffer_get_desc_reports_the_effective_alignment` - PR lint: `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` Results: default baseline 195 passed, 1 ignored; PR 196 passed, 1 ignored. Diagnostics baseline 197 passed, 1 failed, 1 ignored; PR 199 passed, 1 ignored. The baseline-only failure was `memory::tests::a_submission_that_missed_leaves_the_copies_at_once`; it passed in the PR run. Targeted alignment test 1/1 passed. Clippy passed. Negative control: restored the old `resource_desc` behavior; the alignment regression failed (exit 101), as expected. No implementation bug found. Not tested: physical GPU, retail title, release build. AI-assisted: Codex (gpt-6-luna).
Author
Owner

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

Automated triage for the maintainers.

Merge candidate (recommend a look). resource_desc in crates/victory-gpu/src/resource.rs now reports 64 KiB instead of 0 for a buffer created with the default alignment. Nothing else changes: textures and explicit alignments are reported as before. The evidence is public D3D12 documentation plus a test that compares the guest's answer with a real committed buffer on the host device (it skips the comparison when there is no device), so the test checks native behaviour rather than repeating the code. The stored desc is not modified, so creation-side code that reads alignment == 0 is unaffected. One limit: the reference is PC D3D12; no title-side measurement shows the title reads this field.

CI: check passing on this head.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 22:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/2690#issuecomment-7176222100) <!-- victory-triage v1 head=78bf751c5baa2f2f7f9b8d0386512c31d34de971 verdict=merge-candidate at=2026-11-25T22:20:00Z --> Automated triage for the maintainers. **Merge candidate (recommend a look).** `resource_desc` in `crates/victory-gpu/src/resource.rs` now reports 64 KiB instead of 0 for a buffer created with the default alignment. Nothing else changes: textures and explicit alignments are reported as before. The evidence is public D3D12 documentation plus a test that compares the guest's answer with a real committed buffer on the host device (it skips the comparison when there is no device), so the test checks native behaviour rather than repeating the code. The stored `desc` is not modified, so creation-side code that reads `alignment == 0` is unaffected. One limit: the reference is PC D3D12; no title-side measurement shows the title reads this field. CI: `check` passing on this head. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2690/head:github-bot/gh-2690'
git switch 'github-bot/gh-2690'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2690'
git switch 'github-bot/gh-2690'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2690'
git switch 'github-bot/gh-2690'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2690'
git switch 'main'
git merge --squash 'github-bot/gh-2690'
git switch 'main'
git merge --ff-only 'github-bot/gh-2690'
git switch 'main'
git merge 'github-bot/gh-2690'
git push origin 'main'
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!2690
No description provided.