[BUNDLE] GPU host copies, descriptors, sampler heaps and footprints: 5 PRs, #322 #982 #409 #474 #1206 (rebuilt on main 70564ae) #1426

Open
github-bot wants to merge 12 commits from github-bot/gh-1426 into main AGit
Owner

@⁠MamaLeVrai on GitHub · 2026-11-24 17:57 UTC · original
MamaLeVrai:bundle/gpu-fixes-2 → main · +732 −68 · 4 files · 12 commits · open

One PR in place of 5. After main moved, this bundle keeps the 5 of its earlier 15 PRs that still merge; the left-out ones are listed below. The earlier description follows, and may mention PRs or measurements that no longer apply. Fifteen GPU PRs on host memory copies, upload buffers, adapter selection, descriptor tables, sampler heaps, texture footprints and root signature validation. Every head is merged unchanged onto main (70564ae, after the maintainer's 28 commits of Nov 24, 22:36 CET), and the result is built and tested together.

For reviewers and for anyone verifying with an agent (Claude, Codex, a person): this is a [BUNDLE] PR. The re-verification commands are below, so one run covers all of it.

What is inside

PR Author Head Title
#322 jsthope b58d198d9 GPU: copy into title memory without asking for its region first
#982 chemokita13 b4abe5db6 GPU: pool upload buffers across command list resets
#409 ToxicmaggotRP 340499c44 GPU: match D3D12 copyable texture footprints
#474 nathanbzrr e34cb5396 GPU: sanitize CreateSamplerX LOD range, bias clamp, and invalid enum values
#1206 geiyiliyabumo ef0c3e944 GPU: validate null args in create_deserializer to prevent d3d12 AV and add root.rs tests

Changes made while bundling

No PR was edited, and there is no hand resolution: a PR that does not merge as it is, is left out (below).

Left out, and why

Rebuilt on the new main. The earlier version of this bundle had 15 PRs; 5 merge here in order, each checked with clippy as it went in.

  • #202: merges, but the workspace no longer compiles with it next to the others.
  • #208: conflicts with the new main (or with an earlier PR of this bundle) in crates/victory-gpu/src/host.rs.
  • #435: conflicts with the new main (or with an earlier PR of this bundle) in crates/victory-gpu/src/host.rs.
  • #1217: conflicts with the new main (or with an earlier PR of this bundle) in crates/victory-gpu/src/host.rs.
  • #1283: conflicts with the new main (or with an earlier PR of this bundle) in crates/victory-gpu/src/host.rs.
  • #123: conflicts with the new main (or with an earlier PR of this bundle) in crates/victory-gpu/src/descriptor/host.rs.
  • #251: conflicts with the new main (or with an earlier PR of this bundle) in crates/victory-gpu/src/descriptor/host.rs.
  • #1032: conflicts with the new main (or with an earlier PR of this bundle) in crates/victory-gpu/src/descriptor/host.rs.
  • #55: conflicts with the new main (or with an earlier PR of this bundle) in crates/victory-gpu/src/resource.rs.
  • #933: merges, but the workspace no longer compiles with it next to the others.

Verification

Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain):

Check Result
cargo clippy --workspace --all-targets --locked -- -D warnings clean
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings clean
cargo test --workspace --locked 490 passed, 0 failed, 7 ignored (one run; main: 476 passed, 7 ignored)

The title was not run, so this says nothing about in-game effect. No game data is used or committed.

Re-verify in one go

git fetch https://github.com/MamaLeVrai/VIctory.git bundle/gpu-fixes-2
git checkout FETCH_HEAD
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo test --workspace --locked

To confirm that no component PR moved since this was built, compare each Head above with gh pr view <n> --repo Marvisak/VIctory --json headRefOid. If one differs, the branch needs a rebuild: merge the new head in the same order.

If this lands

The component heads are in the history unchanged, so each PR's commits and authorship are kept and GitHub should mark them merged. Merging them one by one instead works too, with the exceptions noted above.

AI-assisted (Claude Code); no game data.

🤖 Generated with Claude Code

**@⁠MamaLeVrai** on GitHub · 2026-11-24 17:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/1426) `MamaLeVrai:bundle/gpu-fixes-2` → `main` · +732 −68 · 4 files · 12 commits · open **One PR in place of 5.** After `main` moved, this bundle keeps the 5 of its earlier 15 PRs that still merge; the left-out ones are listed below. The earlier description follows, and may mention PRs or measurements that no longer apply. Fifteen GPU PRs on host memory copies, upload buffers, adapter selection, descriptor tables, sampler heaps, texture footprints and root signature validation. Every head is merged unchanged onto `main` (`70564ae`, after the maintainer's 28 commits of Nov 24, 22:36 CET), and the result is built and tested together. > For reviewers and for anyone verifying with an agent (Claude, Codex, a person): this is a `[BUNDLE]` PR. The re-verification commands are below, so one run covers all of it. ## What is inside | PR | Author | Head | Title | |---|---|---|---| | #322 | jsthope | `b58d198d9` | GPU: copy into title memory without asking for its region first | | #982 | chemokita13 | `b4abe5db6` | GPU: pool upload buffers across command list resets | | #409 | ToxicmaggotRP | `340499c44` | GPU: match D3D12 copyable texture footprints | | #474 | nathanbzrr | `e34cb5396` | GPU: sanitize CreateSamplerX LOD range, bias clamp, and invalid enum values | | #1206 | geiyiliyabumo | `ef0c3e944` | GPU: validate null args in create_deserializer to prevent d3d12 AV and add root.rs tests | ## Changes made while bundling No PR was edited, and there is no hand resolution: a PR that does not merge as it is, is left out (below). ## Left out, and why **Rebuilt on the new `main`.** The earlier version of this bundle had 15 PRs; 5 merge here in order, each checked with clippy as it went in. - **#202**: merges, but the workspace no longer compiles with it next to the others. - **#208**: conflicts with the new `main` (or with an earlier PR of this bundle) in crates/victory-gpu/src/host.rs. - **#435**: conflicts with the new `main` (or with an earlier PR of this bundle) in crates/victory-gpu/src/host.rs. - **#1217**: conflicts with the new `main` (or with an earlier PR of this bundle) in crates/victory-gpu/src/host.rs. - **#1283**: conflicts with the new `main` (or with an earlier PR of this bundle) in crates/victory-gpu/src/host.rs. - **#123**: conflicts with the new `main` (or with an earlier PR of this bundle) in crates/victory-gpu/src/descriptor/host.rs. - **#251**: conflicts with the new `main` (or with an earlier PR of this bundle) in crates/victory-gpu/src/descriptor/host.rs. - **#1032**: conflicts with the new `main` (or with an earlier PR of this bundle) in crates/victory-gpu/src/descriptor/host.rs. - **#55**: conflicts with the new `main` (or with an earlier PR of this bundle) in crates/victory-gpu/src/resource.rs. - **#933**: merges, but the workspace no longer compiles with it next to the others. ## Verification Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain): | Check | Result | |---|---| | `cargo clippy --workspace --all-targets --locked -- -D warnings` | clean | | `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` | clean | | `cargo test --workspace --locked` | 490 passed, 0 failed, 7 ignored (one run; `main`: 476 passed, 7 ignored) | The title was not run, so this says nothing about in-game effect. No game data is used or committed. ## Re-verify in one go ```powershell git fetch https://github.com/MamaLeVrai/VIctory.git bundle/gpu-fixes-2 git checkout FETCH_HEAD cargo clippy --workspace --all-targets --locked -- -D warnings cargo clippy --workspace --all-targets --all-features --locked -- -D warnings cargo test --workspace --locked ``` To confirm that no component PR moved since this was built, compare each `Head` above with `gh pr view <n> --repo Marvisak/VIctory --json headRefOid`. If one differs, the branch needs a rebuild: merge the new head in the same order. ## If this lands The component heads are in the history unchanged, so each PR's commits and authorship are kept and GitHub should mark them merged. Merging them one by one instead works too, with the exceptions noted above. AI-assisted (Claude Code); no game data. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Two copies into title memory asked the host about the destination before
every copy. copy_mapped's own comment tells what that costs: asking
VirtualQuery about the source took about 2 ms per copy in the title's big
pools, because the query walks the page tables to the end of the region
with the same state, whatever the size of the copy.

- A list's copy into title memory checked that the whole destination was
  committed first, with VirtualQuery. The destinations were private pools
  of about 600 MiB.
- The copy-back of what shaders wrote used WriteProcessMemory, which asks
  for the destination's region before it writes: the same walk for every
  64 KiB piece.

Both now rely on the kernel copy the other copies already use
(ReadProcessMemory on our own process). It fails on a destination page
that is not mapped writable as it does on a source page it cannot read,
without faulting. A title destination is asked for its region only after
its copy has failed, which keeps the page retries (they write their zeros
themselves) off unmapped memory. write_mapped does what it did: mapped
pages are written, unmapped and read-only ones are not.

One difference: a title destination that was not all mapped used to be
left alone, and the bytes before its first unmapped page may now arrive
(the kernel copy stops at that page). No title copy of the run below had
such a destination, and none failed.

Measured in the world (first mission's intro; i7-13650HX, RTX 4060
Laptop, diagnostics build), with the old and the new call timed on the
same copies of one run, 41 frames of about 1.15 s each:

  title copies, 80 per frame (0.45 MB): the check alone 59.5 ms per
  frame; the whole copy now 0.56 ms
  copy-back, 110 pieces per frame (4.9 MB): 38.6 ms per frame; now
  0.55 ms

That is 98 ms of a frame (8.6 %) down to about 1 ms. In stacks of the
submitting thread sampled at 10 Hz, VirtualQuery under these two calls
was 47 of 462 samples before and 0 of 189 after.

Two tests run both copies against reserved memory with a committed block
on each side of a hole (no GPU, no game data).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Transient upload buffers allocated during list recording (buffer copies, large scratch allocations) were previously created as new committed resources on every copy and dropped on list reset. They are now retained in a host-wide pool upon HostList::reset (bounded to 32 buffers, aligned to D3D12 64 KiB placement granularity) and reused by subsequent uploads with matching or compatible capacities.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:31:17 +00:00
Author
Owner

@⁠sinan-cmyk on GitHub · 2026-11-24 18:45 UTC · original

Runtime boot check on real hardware with a retail dump

Result: no difference from main in this test.

I merged head 3fc262e onto main ffe310e (clean merge), built it (release), and ran victory run <title exe> --execute with an empty data folder for 100 s, without any input. I compared the run with main built and run the same way.

main ffe310e this PR
Reaches the first-boot screens yes yes
Caption at 100 s (one sample) 30 fps, 12 draws/frame 30 fps, 12 draws/frame
Frames presented 2,048 2,048
crashes.log entries 0 0
Committed memory 11.1 GB 11.1 GB

Warnings: 7, the same kinds as on main with one exception. The two 2560×1440 render targets that log "no host texture" (creation fails with 0x80070057) on main now log "host texture without a use the host refuses" and are dropped. That looks like the intended change.

Limits. Without input, the title stays on the first-boot screens. This run does not exercise saves, the intro video, the start screen, loading or the world. It shows only that the change does not break startup or the first menus on this machine. I did not run the PR's tests.

Machine: Ryzen 7 7800X3D, RTX 4070 SUPER, Windows 11 25H2, game 1.0.2.1. AI-assisted (Claude Code).

**@⁠sinan-cmyk** on GitHub · 2026-11-24 18:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/1426#issuecomment-7141110468) ### Runtime boot check on real hardware with a retail dump **Result: no difference from `main` in this test.** I merged head 3fc262e onto `main` ffe310e (clean merge), built it (release), and ran `victory run <title exe> --execute` with an empty data folder for 100 s, without any input. I compared the run with `main` built and run the same way. | | `main` ffe310e | this PR | |---|---|---| | Reaches the first-boot screens | yes | yes | | Caption at 100 s (one sample) | 30 fps, 12 draws/frame | 30 fps, 12 draws/frame | | Frames presented | 2,048 | 2,048 | | `crashes.log` entries | 0 | 0 | | Committed memory | 11.1 GB | 11.1 GB | **Warnings:** 7, the same kinds as on `main` with one exception. The two 2560×1440 render targets that log "no host texture" (creation fails with 0x80070057) on `main` now log "host texture without a use the host refuses" and are dropped. That looks like the intended change. **Limits.** Without input, the title stays on the first-boot screens. This run does not exercise saves, the intro video, the start screen, loading or the world. It shows only that the change does not break startup or the first menus on this machine. I did not run the PR's tests. Machine: Ryzen 7 7800X3D, RTX 4070 SUPER, Windows 11 25H2, game 1.0.2.1. AI-assisted (Claude Code).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:27 UTC · original

Automated triage for the maintainers.

Needs rebase. This pull request conflicts with main (conflicting: crates/victory-gpu/src/host.rs, crates/victory-gpu/src/resource.rs). It will be reviewed once it is rebased onto the current main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/1426#issuecomment-7149564452) <!-- victory-triage v1 head=2f996192dbd7307153ee3b19a235e8a6178f61bd verdict=needs-rebase at=2026-11-25T01:27:18Z --> Automated triage for the maintainers. **Needs rebase.** This pull request conflicts with `main` (conflicting: `crates/victory-gpu/src/host.rs`, `crates/victory-gpu/src/resource.rs`). It will be reviewed once it is rebased onto the current `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/resource.rs
  • crates/victory-gpu/src/sampler.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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