GPU: reject empty query heaps at creation #2909

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

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-25 23:44 UTC · original
andrewpozdnakov7-jpg:codex2/reject-empty-query-heap → main · +33 −0 · 1 files · 1 commits · open

Summary

Reject zero-count query heaps before creating a guest object or returning a successful probe. CreateQueryHeap now returns E_INVALIDARG for a timestamp heap with no queries.

Verification

  • Native D3D12 WARP at feature level 11_0 returns E_INVALIDARG for count zero and leaves the output slot untouched. Count one creates a heap. Microsoft documents the positive-count requirement in Queries.
  • The same synthetic test calls the guest device vtable before and after the change. Main returns S_OK and creates a zero-count object, and returns S_FALSE with no output slot. The patch returns E_INVALIDARG in both cases, leaves the output untouched, and still creates the one-query heap.
  • Four default query tests, the full app-local WARP GPU suite (247 passed, 1 ignored), strict GPU Clippy with default and all features, and staged asset policy passed.
**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-25 23:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/2909) `andrewpozdnakov7-jpg:codex2/reject-empty-query-heap` → `main` · +33 −0 · 1 files · 1 commits · open ### Summary Reject zero-count query heaps before creating a guest object or returning a successful probe. `CreateQueryHeap` now returns `E_INVALIDARG` for a timestamp heap with no queries. ### Verification - Native D3D12 WARP at feature level 11_0 returns `E_INVALIDARG` for count zero and leaves the output slot untouched. Count one creates a heap. Microsoft documents the positive-count requirement in [Queries](https://learn.microsoft.com/en-us/windows/win32/direct3d12/queries#creating-query-heaps). - The same synthetic test calls the guest device vtable before and after the change. Main returns `S_OK` and creates a zero-count object, and returns `S_FALSE` with no output slot. The patch returns `E_INVALIDARG` in both cases, leaves the output untouched, and still creates the one-query heap. - Four default query tests, the full app-local WARP GPU suite (247 passed, 1 ignored), strict GPU Clippy with default and all features, and staged asset policy passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:17:16 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 02:20 UTC · original

Automated triage for the maintainers.

Needs work. query.rs create now returns E_INVALIDARG for a query heap with count == 0. On main the query heap is a stub (Heap { object, desc }) with no host heap behind it, so a zero count harms nothing today, and the change only alters a return value. CI check passes. To change the verdict: evidence that the title creates an empty query heap and depends on the error, or that the console runtime returns it (its compiler output, a hardware trace, or public documentation of the console API). Without that, it is a guard for a case the title does not reach.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 02:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/2909#issuecomment-7180702523) <!-- victory-triage v1 head=a414bb28033cd66aa51b571a5f09569dd49f1bf0 verdict=needs-work at=2026-11-26T02:20:10Z --> Automated triage for the maintainers. **Needs work.** `query.rs` `create` now returns `E_INVALIDARG` for a query heap with `count == 0`. On `main` the query heap is a stub (`Heap { object, desc }`) with no host heap behind it, so a zero count harms nothing today, and the change only alters a return value. CI `check` passes. To change the verdict: evidence that the title creates an empty query heap and depends on the error, or that the console runtime returns it (its compiler output, a hardware trace, or public documentation of the console API). Without that, it is a guard for a case the title does not reach. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request can be merged automatically.
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/2909/head:github-bot/gh-2909'
git switch 'github-bot/gh-2909'

Merge

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