GPU: grow per-list upload scratch on demand #1246

Manually merged
github merged 1 commit from gh-pr/1246/head into gh-pr/1246/base 2026-11-26 04:24:50 +00:00
Owner

@⁠LaunchDoesntCode on GitHub · 2026-11-24 16:46 UTC · original
gpu/grow-list-upload-scratch → main · +50 −8 · 1 files · 1 commits · merged 2026-11-25 00:17 UTC

The first scratch allocation on each host command list currently reserves 4 MiB, even for a 256-byte request. This starts per-list chunks at 64 KiB, grows them to fit up to 4 MiB, and reuses them after a fenced reset. Larger requests still get a dedicated upload. The optional victory_gpu::scratch=debug trace reports each new chunk's requested and allocated sizes.

On an integrated Windows WARP playtest build, 158 distinct command lists allocated 261 scratch chunks totaling 30.4 MiB during loading. At the old fixed size, the first chunk of each of those lists alone would account for 632 MiB. These figures describe cumulative chunk allocations. They do not measure peak process memory or frame time.

The regression test uses a D3D12 list to check 256-byte alignment, small and large requests, overflow, and reuse of the same upload addresses after submission and reset. On this branch based on ffe310e, the Windows diagnostics GPU suite passed 54 tests with one ignored. Workspace Clippy with all targets and features, the default workspace check with all targets, and the asset-policy check also passed.

Related to #982, which pools transient uploads across lists. This change sizes the scratch chunks retained by each list.

**@⁠LaunchDoesntCode** on GitHub · 2026-11-24 16:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/1246) `gpu/grow-list-upload-scratch` → `main` · +50 −8 · 1 files · 1 commits · merged 2026-11-25 00:17 UTC The first scratch allocation on each host command list currently reserves 4 MiB, even for a 256-byte request. This starts per-list chunks at 64 KiB, grows them to fit up to 4 MiB, and reuses them after a fenced reset. Larger requests still get a dedicated upload. The optional `victory_gpu::scratch=debug` trace reports each new chunk's requested and allocated sizes. On an integrated Windows WARP playtest build, 158 distinct command lists allocated 261 scratch chunks totaling **30.4 MiB** during loading. At the old fixed size, the first chunk of each of those lists alone would account for **632 MiB**. These figures describe cumulative chunk allocations. They do not measure peak process memory or frame time. The regression test uses a D3D12 list to check 256-byte alignment, small and large requests, overflow, and reuse of the same upload addresses after submission and reset. On this branch based on `ffe310e`, the Windows diagnostics GPU suite passed 54 tests with one ignored. Workspace Clippy with all targets and features, the default workspace check with all targets, and the asset-policy check also passed. Related to #982, which pools transient uploads across lists. This change sizes the scratch chunks retained by each list.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:24:49 +00:00
github manually merged commit 59035de94c into gh-pr/1246/base 2026-11-26 04:24:50 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 17:59 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 59035de: cargo test -p victory-gpu passes, 51 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 17:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/1246#issuecomment-7139997504) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 59035de: `cargo test -p victory-gpu` passes, 51 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠fladit123 on GitHub · 2026-11-24 18:02 UTC · original

Independent focused validation of 59035de94c4a7c42361994ea861641a7ac78c2e9 on NVIDIA Ada Lovelace.

Environment

  • RTX 4060 8 GB, driver 610.88
  • Intel Core i5-12400F, 32 GB RAM
  • Windows 11, Rust 1.98.1 MSVC

The regression test list_scratch_grows_to_fit_and_reuses_fenced_chunks passed on both the physical RTX 4060 and WARP. Separate instrumentation confirmed that the test reached both GPU submissions rather than returning early.

The existing alignment, allocation growth and fenced reuse assertions passed.

Limitations: The build used a zero-byte BCPack placeholder with the original table excluded. This is focused validation, not a clean full-workspace result. Peak memory reduction and scratch payload integrity were not independently measured.

No game data or proprietary console SDK material was used.

AI use: OpenAI Codex assisted with test execution and instrumentation; ChatGPT (GPT-6.2) assisted with reporting.

**@⁠fladit123** on GitHub · 2026-11-24 18:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/1246#issuecomment-7140063016) Independent focused validation of `59035de94c4a7c42361994ea861641a7ac78c2e9` on NVIDIA Ada Lovelace. **Environment** - RTX 4060 8 GB, driver 610.88 - Intel Core i5-12400F, 32 GB RAM - Windows 11, Rust 1.98.1 MSVC The regression test `list_scratch_grows_to_fit_and_reuses_fenced_chunks` passed on both the physical RTX 4060 and WARP. Separate instrumentation confirmed that the test reached both GPU submissions rather than returning early. The existing alignment, allocation growth and fenced reuse assertions passed. **Limitations:** The build used a zero-byte BCPack placeholder with the original table excluded. This is focused validation, not a clean full-workspace result. Peak memory reduction and scratch payload integrity were not independently measured. No game data or proprietary console SDK material was used. **AI use:** OpenAI Codex assisted with test execution and instrumentation; ChatGPT (GPT-6.2) assisted with reporting.
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!1246
No description provided.