victory system: say what this machine is, and what stands in the way (#104) #268

Open
github-bot wants to merge 55 commits from github-bot/gh-268 into rx9070xt AGit
Owner

@⁠redlight-06 on GitHub · 2026-11-26 15:14 UTC · original
redlight-06:system → rx9070xt · +3575 −265 · 43 files · 55 commits · open

Closes #104.

victory system prints, with no title and no game file, what a run on this machine would meet: the Windows version, the processor and its AVX2, the memory and the commit limit, then for every adapter the facts that decide whether VIctory can run at all — waves, shader model, mesh shaders, binding tier, the largest shader-visible view heap it makes, and the upload heap — and finally the risks that follow from them. --version carries the commit the build was made from, so a report can be placed against a build (#104's first line).

On the laptop this was written on (the free-memory numbers move between runs; this is one run with nothing else going on):

VIctory 0.1.0 (d684ee0), debug build
Windows 11, build 26100.3624
CPU: AMD Ryzen 9 8945HX with Radeon Graphics, 32 threads, AVX2 yes
Memory: 31.8 GiB RAM (18.0 GiB free), commit 42.6 GiB free of 75.7 GiB
GPU (used): NVIDIA GeForce RTX 5060 Laptop GPU [10de:2d59], driver 32.0.15.9621, 7899 MiB dedicated, 16280 MiB shared
    shader model 6.7, mesh shaders yes, waves of 32 to 32 lanes, resource binding tier 3, view heap of 1000000 views, enough for the title's, GPU upload heap yes
Known blockers:
- Waves of 32 to 32 lanes: console wave64 compute programs are dropped where their cross-lane code cannot be split (#9)
- 42.6 GiB of commit free: the title's own working set is said to run 40-46 GiB, so a long session may meet 1455 as it streams (#15)

It was run against the title

With the full game files to hand, the branch boots the title and reaches the world load, which is what the report above is checked against:

  • the Xbox account picker at a steady 30 fps, then the whole first-run flow (language → navigation → legal notices → privacy/ToS → world streaming) navigable from the keyboard, once the window has focus;
  • the world load opens core_restofworld.rpf and story000_restofworld.rpf and draws 400–5,900 draws a frame at 0–1 fps with about 15.7 GB private and climbing — the 32-lane waves (#9) doing their work, not a crash;
  • two compute pipelines are refused during the load: host pipeline refused error=E_INVALIDARG shaders=[compute 02384a60fda6f2d0] (twice), each followed by a dispatch without a host pipeline dropped. Same shape as #259, on 6.7 rather than an under-6.6 runtime, so the two may be worth comparing after all — this machine's shader model is not the reason;
  • host view heap capped at 1000000 appears once, which is the #15/#74 warning in the log rather than only in system's output.

Two things the run changed in this branch

  • The shader model decode. D3D_SHADER_MODEL_6_0 is 0x60, not 100, so the 0x67 this device answers is 6.7. The first version of this branch printed "6.3" and listed a shader-model blocker that was not there; system::shader_model() now reads the value as the model it names, with a test (0x60→6.0, 0x67→6.7, 0x69→6.9) and a run of the title to confirm the mesh pipelines build.
  • The commit figure is not called a verdict any more. The title reached the world load with 40.5 GiB of commit free, so a hard "43 GiB or Windows refuses" line was a claim this module cannot test. What it says now is the figure and the working set it is measured against (the README's 40–46 GiB), as a risk.

How the facts are got

The same calls a run makes, so a report is what a run meets:

  • adapters: CreateDXGIFactory1, EnumAdapters1; the software adapter skipped. A laptop that lists one card under two Luids (two display paths) is named once.
  • per adapter: D3D12CreateDevice(&adapter, D3D_FEATURE_LEVEL_12_0), then CheckFeatureSupport for OPTIONS1 (waves), SHADER_MODEL, OPTIONS7 (mesh shader tier), OPTIONS (binding tier), OPTIONS16 (upload heap), and a descriptor-heap probe at 1<<22, 1<<21 and 1,000,000 — the three sizes probe_view_limit asks, so the number agrees with what a run decides.
  • the used adapter: the one the default device (D3D12CreateDevice(None, ...)) is made on, matched by LUID.
  • memory: GlobalMemoryStatusEx; the commit limit is physical plus paging file, which is what the title's own working set meets.
  • Windows: CurrentBuild and UBR (a REG_DWORD) from HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion; 22000 and up is Windows 11.
  • processor: ProcessorNameString (trimmed — the registry pads it), GetSystemInfo for the thread count, IsProcessorFeaturePresent(PF_AVX2_INSTRUCTIONS_AVAILABLE).
  • Wine: whether ntdll exports wine_get_version (#6, #19).

What changes

  • crates/victory-gpu/src/system.rs: Facts, Cpu, Memory, Gpu, shader_model(), the rendering and the blocker rules — no device needed, eleven tests that feed made-up machines (a machine that runs the title; 32-lane waves; a title-sized view heap; no mesh shaders; little commit; plenty of commit; Wine; a build that does not know its commit; two adapters where one makes no device; only the used one marked; a shader model value read as the model it names).
  • crates/victory-gpu/src/system/gather.rs (Windows): the calls above. The non-Windows build gets a default Facts, so the workspace still builds.
  • apps/victory/src/main.rs, build.rs: the system subcommand, and the commit in --version — the script used to watch .git/HEAD alone, whose text does not change when a commit lands on the branch, so --version kept naming whichever commit was HEAD when it first ran; it now watches the branch's own file (or packed-refs) too. apps/victory/Cargo.toml gains victory-gpu — already linked through victory-hle, so no new package.
  • crates/victory-hle/src/modules/gameinput.rs: VICTORY_PAD_LOG=1 (diagnostics builds) logs the pad reading the title is handed, which is how the front end was driven in the run above.
  • README.md: a paragraph next to the other commands.

Verified

  • cargo test -p victory-gpu --lib system:: — 11 passed.
  • cargo test -p victory — 2 passed.
  • cargo run -p victory -- system and -- --version on Windows 11 26100.3624 / Ryzen 9 8945HX / RTX 5060 Laptop, built on a mingw toolchain, so the raw D3D12CreateDevice and registry paths are exercised for real.
  • victory run --execute against the full game files: boots to the front end, the first-run flow completes, the world load starts (numbers above), no crash in about forty minutes of run time across attempts.
  • clippy: nothing new from these files (cargo clippy -p victory-gpu --lib reports only the warnings already in the tree on 1.98 — the 25 manual_is_multiple_of ones I listed in a comment).

Not verified

  • The world load was never played past: at 0–1 fps on 32-lane waves this machine cannot tell "still streaming" from "stuck", so nothing here claims the prologue is reachable on NVIDIA.
  • The E_INVALIDARG compute pipelines are observed, not explained: no D3D12 debug layer on this machine (no D3D12 debug layer error=0x887A002D), so there is no driver message to read yet.
  • The view-heap probe creates three heaps in a row per adapter; on this machine that is instant, and the sizes are the same three probe_view_limit tries — but I have not run it on a card that has to page-fault to answer (the AMD RDNA3 case in descriptor/host.rs's comment).
**@⁠redlight-06** on GitHub · 2026-11-26 15:14 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/268) `redlight-06:system` → `rx9070xt` · +3575 −265 · 43 files · 55 commits · open Closes #104. `victory system` prints, with no title and no game file, what a run on this machine would meet: the Windows version, the processor and its AVX2, the memory and the commit limit, then for every adapter the facts that decide whether VIctory can run at all — waves, shader model, mesh shaders, binding tier, the largest shader-visible view heap it makes, and the upload heap — and finally the risks that follow from them. `--version` carries the commit the build was made from, so a report can be placed against a build (#104's first line). On the laptop this was written on (the free-memory numbers move between runs; this is one run with nothing else going on): ``` VIctory 0.1.0 (d684ee0), debug build Windows 11, build 26100.3624 CPU: AMD Ryzen 9 8945HX with Radeon Graphics, 32 threads, AVX2 yes Memory: 31.8 GiB RAM (18.0 GiB free), commit 42.6 GiB free of 75.7 GiB GPU (used): NVIDIA GeForce RTX 5060 Laptop GPU [10de:2d59], driver 32.0.15.9621, 7899 MiB dedicated, 16280 MiB shared shader model 6.7, mesh shaders yes, waves of 32 to 32 lanes, resource binding tier 3, view heap of 1000000 views, enough for the title's, GPU upload heap yes Known blockers: - Waves of 32 to 32 lanes: console wave64 compute programs are dropped where their cross-lane code cannot be split (#9) - 42.6 GiB of commit free: the title's own working set is said to run 40-46 GiB, so a long session may meet 1455 as it streams (#15) ``` ## It was run against the title With the full game files to hand, the branch boots the title and reaches the world load, which is what the report above is checked against: - the Xbox account picker at a steady 30 fps, then the whole first-run flow (language → navigation → legal notices → privacy/ToS → world streaming) navigable from the keyboard, once the window has focus; - the world load opens `core_restofworld.rpf` and `story000_restofworld.rpf` and draws 400–5,900 draws a frame at 0–1 fps with about 15.7 GB private and climbing — the 32-lane waves (#9) doing their work, not a crash; - two compute pipelines are refused during the load: `host pipeline refused error=E_INVALIDARG shaders=[compute 02384a60fda6f2d0]` (twice), each followed by `a dispatch without a host pipeline dropped`. Same shape as #259, on 6.7 rather than an under-6.6 runtime, so the two may be worth comparing after all — this machine's shader model is not the reason; - `host view heap capped at 1000000` appears once, which is the #15/#74 warning in the log rather than only in `system`'s output. ## Two things the run changed in this branch - **The shader model decode.** `D3D_SHADER_MODEL_6_0` is `0x60`, not 100, so the `0x67` this device answers is 6.7. The first version of this branch printed "6.3" and listed a shader-model blocker that was not there; `system::shader_model()` now reads the value as the model it names, with a test (0x60→6.0, 0x67→6.7, 0x69→6.9) and a run of the title to confirm the mesh pipelines build. - **The commit figure is not called a verdict any more.** The title reached the world load with 40.5 GiB of commit free, so a hard "43 GiB or Windows refuses" line was a claim this module cannot test. What it says now is the figure and the working set it is measured against (the README's 40–46 GiB), as a risk. ## How the facts are got The same calls a run makes, so a report is what a run meets: - adapters: `CreateDXGIFactory1`, `EnumAdapters1`; the software adapter skipped. A laptop that lists one card under two Luids (two display paths) is named once. - per adapter: `D3D12CreateDevice(&adapter, D3D_FEATURE_LEVEL_12_0)`, then `CheckFeatureSupport` for `OPTIONS1` (waves), `SHADER_MODEL`, `OPTIONS7` (mesh shader tier), `OPTIONS` (binding tier), `OPTIONS16` (upload heap), and a descriptor-heap probe at 1<<22, 1<<21 and 1,000,000 — the three sizes `probe_view_limit` asks, so the number agrees with what a run decides. - the used adapter: the one the default device (`D3D12CreateDevice(None, ...)`) is made on, matched by LUID. - memory: `GlobalMemoryStatusEx`; the commit limit is physical plus paging file, which is what the title's own working set meets. - Windows: `CurrentBuild` and `UBR` (a `REG_DWORD`) from `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion`; 22000 and up is Windows 11. - processor: `ProcessorNameString` (trimmed — the registry pads it), `GetSystemInfo` for the thread count, `IsProcessorFeaturePresent(PF_AVX2_INSTRUCTIONS_AVAILABLE)`. - Wine: whether `ntdll` exports `wine_get_version` (#6, #19). ## What changes - `crates/victory-gpu/src/system.rs`: `Facts`, `Cpu`, `Memory`, `Gpu`, `shader_model()`, the rendering and the blocker rules — no device needed, eleven tests that feed made-up machines (a machine that runs the title; 32-lane waves; a title-sized view heap; no mesh shaders; little commit; plenty of commit; Wine; a build that does not know its commit; two adapters where one makes no device; only the used one marked; a shader model value read as the model it names). - `crates/victory-gpu/src/system/gather.rs` (Windows): the calls above. The non-Windows build gets a default `Facts`, so the workspace still builds. - `apps/victory/src/main.rs`, `build.rs`: the `system` subcommand, and the commit in `--version` — the script used to watch `.git/HEAD` alone, whose text does not change when a commit lands on the branch, so `--version` kept naming whichever commit was HEAD when it first ran; it now watches the branch's own file (or `packed-refs`) too. `apps/victory/Cargo.toml` gains `victory-gpu` — already linked through `victory-hle`, so no new package. - `crates/victory-hle/src/modules/gameinput.rs`: `VICTORY_PAD_LOG=1` (diagnostics builds) logs the pad reading the title is handed, which is how the front end was driven in the run above. - `README.md`: a paragraph next to the other commands. ## Verified - `cargo test -p victory-gpu --lib system::` — 11 passed. - `cargo test -p victory` — 2 passed. - `cargo run -p victory -- system` and `-- --version` on Windows 11 26100.3624 / Ryzen 9 8945HX / RTX 5060 Laptop, built on a mingw toolchain, so the raw `D3D12CreateDevice` and registry paths are exercised for real. - `victory run --execute` against the full game files: boots to the front end, the first-run flow completes, the world load starts (numbers above), no crash in about forty minutes of run time across attempts. - clippy: nothing new from these files (`cargo clippy -p victory-gpu --lib` reports only the warnings already in the tree on 1.98 — the 25 `manual_is_multiple_of` ones I listed in a comment). ## Not verified - The world load was never played past: at 0–1 fps on 32-lane waves this machine cannot tell "still streaming" from "stuck", so nothing here claims the prologue is reachable on NVIDIA. - The `E_INVALIDARG` compute pipelines are observed, not explained: no D3D12 debug layer on this machine (`no D3D12 debug layer error=0x887A002D`), so there is no driver message to read yet. - The view-heap probe creates three heaps in a row per adapter; on this machine that is instant, and the sizes are the same three `probe_view_limit` tries — but I have not run it on a card that has to page-fault to answer (the AMD RDNA3 case in `descriptor/host.rs`'s comment).
The Windows version, the processor and the memory, every adapter with the waves, shader model, mesh shaders, binding tier and the largest shader-visible view heap it makes, and the blockers that follow: wave64 compute dropped (#9), the title's view heap (#15, #74), a commit under the title's 43 GiB (1455), Wine (#6, #19). None of it needs a title.

The facts come from the calls a run makes -- DXGI adapter enumeration, D3D12CreateDevice and CheckFeatureSupport per adapter, the same three descriptor-heap sizes probe_view_limit asks, GlobalMemoryStatusEx, and two registry values -- so a report says what a run would meet.

--version carries the commit the build knew, via build.rs, so a report can be placed against a build.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 15:20:29 +00:00
Author
Owner

@⁠redlight-06 on GitHub · 2026-11-26 15:16 UTC · original

A heads-up on the clippy step, so a red CI is not read as this branch failing:

On the pinned toolchain (1.98.1) cargo clippy --workspace --all-targets -- -D warnings already fails on rx9070xt without this branch, on manual_is_multiple_of and friends — 25 errors in files this branch does not touch:

  • crates/victory-gpu/src/host/indirects.rs 8
  • crates/victory-gpu/src/draw.rs 3
  • crates/victory-gpu/src/shadow.rs 2
  • crates/victory-gpu/src/pipeline/known.rs 2
  • crates/victory-gpu/src/host/send.rs 2
  • crates/victory-gpu/src/resource.rs 2
  • crates/victory-gpu/src/host.rs 2
  • crates/victory-gpu/src/land.rs 1
  • crates/victory-gpu/src/watch.rs 1

system.rs and system/gather.rs are clean under the same run (cargo clippy -p victory-gpu --lib --message-format short reports nothing for them). I left the pre-existing ones alone rather than mixing an unrelated mass edit into this PR.

**@⁠redlight-06** on GitHub · 2026-11-26 15:16 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/268#issuecomment-7196029700) A heads-up on the clippy step, so a red CI is not read as this branch failing: On the pinned toolchain (1.98.1) `cargo clippy --workspace --all-targets -- -D warnings` already fails on `rx9070xt` without this branch, on `manual_is_multiple_of` and friends — 25 errors in files this branch does not touch: - `crates/victory-gpu/src/host/indirects.rs` 8 - `crates/victory-gpu/src/draw.rs` 3 - `crates/victory-gpu/src/shadow.rs` 2 - `crates/victory-gpu/src/pipeline/known.rs` 2 - `crates/victory-gpu/src/host/send.rs` 2 - `crates/victory-gpu/src/resource.rs` 2 - `crates/victory-gpu/src/host.rs` 2 - `crates/victory-gpu/src/land.rs` 1 - `crates/victory-gpu/src/watch.rs` 1 `system.rs` and `system/gather.rs` are clean under the same run (`cargo clippy -p victory-gpu --lib --message-format short` reports nothing for them). I left the pre-existing ones alone rather than mixing an unrelated mass edit into this PR.
@ -0,0 +159,4 @@
if supports(device, D3D12_FEATURE_SHADER_MODEL, &mut model) {
// The call answers with the highest it takes of the one asked for:
// 6.0 is 100, so 103 is 6.3.
gpu.shader_model = Some((6, model.HighestShaderModel.0.saturating_sub(100) as u32));
Author
Owner

@⁠gut0to on GitHub · 2026-11-26 15:31 UTC · original

D3D_SHADER_MODEL values use hexadecimal nibbles (6_0 = 0x60, 6_6 = 0x66), so subtracting decimal 100 maps 6.6 to 6.2 and saturates 6.0 to 0. This makes the system report inaccurate and can produce false shader-model blockers. Could this decode the major/minor nibbles (or use an explicit mapping) and cover 6.0, 6.6, and 6.8 in a test?

**@⁠gut0to** on GitHub · 2026-11-26 15:31 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/268#discussion_r4710482092) D3D_SHADER_MODEL values use hexadecimal nibbles (`6_0 = 0x60`, `6_6 = 0x66`), so subtracting decimal 100 maps 6.6 to 6.2 and saturates 6.0 to 0. This makes the system report inaccurate and can produce false shader-model blockers. Could this decode the major/minor nibbles (or use an explicit mapping) and cover 6.0, 6.6, and 6.8 in a test?
Author
Owner

@⁠gut0to on GitHub · 2026-11-26 15:31 UTC · original · reviewed

AI-assisted review; I checked the D3D_SHADER_MODEL values against Microsoft documentation. I did not run the code or the game.

**@⁠gut0to** on GitHub · 2026-11-26 15:31 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/268#pullrequestreview-6076804437) · **reviewed** AI-assisted review; I checked the D3D_SHADER_MODEL values against Microsoft documentation. I did not run the code or the game.
Author
Owner

@⁠ySKELLETONX on GitHub · 2026-11-26 16:17 UTC · original

Confirming gut0to's point, and it changes the #259 reading: D3D_SHADER_MODEL is nibble-coded (D3D_SHADER_MODEL_6_6 = 0x66), so the 103 this machine returns is 0x67, shader model 6.7, not 6.3. gather.rs:162 turns that into 6.3, and asking for 6.4–6.9 and always getting the same 103 back is just the driver capping at 6.7.

So the shader-model lead for #259 doesn't hold: the gate at crates/victory-shader/src/emit/host.rs:107 compares HighestShaderModel.0 < D3D_SHADER_MODEL_6_6.0, i.e. 0x67 < 0x66, which is false, so an RTX 5060/5070 Laptop passes it. The E_INVALIDARG there has another cause. The "Shader model 6.3" blocker in the sample output is the same artifact.

A decode that matches the type: let m = model.HighestShaderModel.0 as u32; (m >> 4, m & 0xf).

On overlap: #104 (mine, against main) is the same victory system + commit-in---version feature and already decodes the model this way. Since rx9070xt is now the default branch, I'm happy to port #104 onto it, or to review this one once the decode is fixed. Whichever the maintainer prefers, so we don't end up with two copies of the same command.

**@⁠ySKELLETONX** on GitHub · 2026-11-26 16:17 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/268#issuecomment-7197443566) Confirming gut0to's point, and it changes the #259 reading: `D3D_SHADER_MODEL` is nibble-coded (`D3D_SHADER_MODEL_6_6 = 0x66`), so the `103` this machine returns is `0x67`, **shader model 6.7**, not 6.3. `gather.rs:162` turns that into 6.3, and asking for 6.4–6.9 and always getting the same 103 back is just the driver capping at 6.7. So the shader-model lead for #259 doesn't hold: the gate at `crates/victory-shader/src/emit/host.rs:107` compares `HighestShaderModel.0 < D3D_SHADER_MODEL_6_6.0`, i.e. `0x67 < 0x66`, which is false, so an RTX 5060/5070 Laptop passes it. The `E_INVALIDARG` there has another cause. The "Shader model 6.3" blocker in the sample output is the same artifact. A decode that matches the type: `let m = model.HighestShaderModel.0 as u32; (m >> 4, m & 0xf)`. On overlap: #104 (mine, against `main`) is the same `victory system` + commit-in-`--version` feature and already decodes the model this way. Since `rx9070xt` is now the default branch, I'm happy to port #104 onto it, or to review this one once the decode is fixed. Whichever the maintainer prefers, so we don't end up with two copies of the same command.
D3D_SHADER_MODEL_6_0 is 0x60, not 100: a device that answers 0x67 is
shader model 6.7, and the report called it 6.3 and listed the title's
shaders as blocked on a host that takes them. Running the title on an
RTX 5060 Laptop showed the difference: mesh pipelines build there.
VICTORY_PAD_LOG=1 (diagnostics) logs the buttons and keys handed to the
title whenever it asks while something is down. A start screen that looks
dead is then either a front end that never asks (no lines) or one that asks
and gets the right pad (lines, with the button the keyboard map chose).
Author
Owner

@⁠redlight-06 on GitHub · 2026-11-26 16:34 UTC · original

Ran the title on this machine with the branch, to see the fact sheet against a real run (RTX 5060 Laptop, 32 lanes, 32 GB RAM).

  • It boots to the Xbox account picker at a steady 30 fps (21 draws/frame), and the front end is navigable from the keyboard once the window has focus: language → navigation experience → legal notices → privacy/ToS → world streaming. (Focus is the catch: SetForegroundWindow alone is refused here; a tapped Alt first gets it.)
  • It reached the world load: the title opens core_restofworld.rpf and story000_restofworld.rpf and then renders 400–2,800 draws a frame at 0–1 fps (0.8–2.7 s a frame) with about 15.7 GB private and climbing. I stopped it there; that is the waves of 32 to 32 lanes blocker at work, not a crash.
  • VICTORY_PAD_LOG=1 (new, diagnostics) says what the title is handed when it asks: readings come every ~9 ms with the button the keyboard map chose — so a start screen that looks dead can now be told from one that never asks.
  • Two warnings worth a look, both compute: host pipeline refused error=E_INVALIDARG shaders=[compute 2da4beb386509b77] (twice, during the load) and a dispatch without a host pipeline dropped. There is also placed unordered texture view not mirrored.

Correction this run forced on the fact sheet: the first version read D3D_SHADER_MODEL as if 6.0 were 100, so the 0x67 this device answers came out "6.3" and the title's shaders were blamed for it. 6.0 is 0x60. Fixed in 3c15774, and victory system now says 6.7 here — which the mesh pipelines that build at runtime agree with.

**@⁠redlight-06** on GitHub · 2026-11-26 16:34 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/268#issuecomment-7197822236) Ran the title on this machine with the branch, to see the fact sheet against a real run (RTX 5060 Laptop, 32 lanes, 32 GB RAM). - It boots to the Xbox account picker at a steady 30 fps (`21 draws/frame`), and the front end is navigable from the keyboard once the window has focus: language → navigation experience → legal notices → privacy/ToS → world streaming. (Focus is the catch: `SetForegroundWindow` alone is refused here; a tapped Alt first gets it.) - It reached the world load: the title opens `core_restofworld.rpf` and `story000_restofworld.rpf` and then renders 400–2,800 draws a frame at 0–1 fps (0.8–2.7 s a frame) with about 15.7 GB private and climbing. I stopped it there; that is the `waves of 32 to 32 lanes` blocker at work, not a crash. - `VICTORY_PAD_LOG=1` (new, diagnostics) says what the title is handed when it asks: readings come every ~9 ms with the button the keyboard map chose — so a start screen that looks dead can now be told from one that never asks. - Two warnings worth a look, both compute: `host pipeline refused error=E_INVALIDARG shaders=[compute 2da4beb386509b77]` (twice, during the load) and `a dispatch without a host pipeline dropped`. There is also `placed unordered texture view not mirrored`. Correction this run forced on the fact sheet: the first version read `D3D_SHADER_MODEL` as if 6.0 were 100, so the 0x67 this device answers came out "6.3" and the title's shaders were blamed for it. 6.0 is 0x60. Fixed in 3c15774, and `victory system` now says 6.7 here — which the mesh pipelines that build at runtime agree with.
The script watched .git/HEAD, whose text does not change when a commit lands
on the branch (it keeps saying "ref: refs/heads/..."), so --version kept
naming whichever commit was HEAD the first time the script ran. Watch the
branch's own file too, or packed-refs in a packed checkout.

The commit figure is also no longer called a verdict: a run reached the world
streaming in with 40.5 GiB of commit free, so what the module can say is the
working set it is measured against (README: 40-46 GiB) and the 1455 risk,
not a threshold it cannot test.
Author
Owner

@⁠redlight-06 on GitHub · 2026-11-26 16:47 UTC · original

Two more commits, both found by running the title against the branch.

--version was naming the wrong commit. build.rs watched .git/HEAD only, whose text does not change when a commit lands on the branch, so the version kept the hash it first saw (7c350be while the branch was at 1f75c2d). It now watches the branch's own file (or packed-refs) as well; victory --version and git rev-parse --short=7 HEAD agree again. That matters for this very issue: a report can only be placed against a build if the build names the commit it was actually made from.

The commit figure is no longer called a verdict. The title reached the world load with 40.5 GiB of commit free, so "43 GiB or Windows refuses 1455" was a claim this module cannot test. It now prints the figure and the working set it is measured against (the README's 40–46 GiB), as a risk.

What the run refused, in case it is useful to someone with a debug layer: two compute pipelines, E_INVALIDARG, shaders=[compute 02384a60fda6f2d0], each followed by a dispatch without a host pipeline dropped. The shader translated fine (shader translated stage=compute hash=02384a60fda6f2d0), so it is PSO creation and not lowering — the same shape as #259, on an SM 6.7 runtime. This machine has no D3D12 debug layer (0x887A002D), so the driver's own words are not available here.

The PR body now carries the run instead of a "no title here" caveat, including the numbers behind the 32-lane waves blocker: 400–5,900 draws a frame at 0–1 fps with ~15.7 GB private, which is why nothing here claims the prologue is reachable on NVIDIA.

**@⁠redlight-06** on GitHub · 2026-11-26 16:47 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/268#issuecomment-7198097146) Two more commits, both found by running the title against the branch. **`--version` was naming the wrong commit.** `build.rs` watched `.git/HEAD` only, whose text does not change when a commit lands on the branch, so the version kept the hash it first saw (`7c350be` while the branch was at `1f75c2d`). It now watches the branch's own file (or `packed-refs`) as well; `victory --version` and `git rev-parse --short=7 HEAD` agree again. That matters for this very issue: a report can only be placed against a build if the build names the commit it was actually made from. **The commit figure is no longer called a verdict.** The title reached the world load with 40.5 GiB of commit free, so "43 GiB or Windows refuses 1455" was a claim this module cannot test. It now prints the figure and the working set it is measured against (the README's 40–46 GiB), as a risk. What the run refused, in case it is useful to someone with a debug layer: two compute pipelines, `E_INVALIDARG`, `shaders=[compute 02384a60fda6f2d0]`, each followed by `a dispatch without a host pipeline dropped`. The shader translated fine (`shader translated stage=compute hash=02384a60fda6f2d0`), so it is PSO creation and not lowering — the same shape as #259, on an SM 6.7 runtime. This machine has no D3D12 debug layer (`0x887A002D`), so the driver's own words are not available here. The PR body now carries the run instead of a "no title here" caveat, including the numbers behind the 32-lane waves blocker: 400–5,900 draws a frame at 0–1 fps with ~15.7 GB private, which is why nothing here claims the prologue is reachable on NVIDIA.
Author
Owner

@⁠WellyngtonSantos on GitHub · 2026-11-26 18:58 UTC · original

Thanks for victory system. A report that collects the machine for you is exactly what a tester without a working setup needs. I ran it at d684ee0 on two hosts that none of the outputs in this PR cover: an old pre-RDNA card, and Wine. Neither machine has the title, so this is the tool alone, which is the case the PR is meant for.

How it was built

Cross-compiled on Linux with cargo-xwin, using the pinned 1.98.1 toolchain:

cargo xwin build -p victory --release --target x86_64-pc-windows-msvc

It built cleanly in 1 min 43 s, with 13 warnings in victory-gpu (two dropping_copy_types in pipeline/known.rs, lines 64 and 223). --version prints victory 0.1.0 (d684ee0), so the commit stamp works for a cross-compiled build too. The same victory.exe (SHA-256 d6f5c4fc…ccfd8e) was used on both hosts.

Host 1: Windows 11, Radeon RX 580 (Polaris), 16 GB

VIctory 0.1.0 (d684ee0), release build
Windows 11, build 26200.9974
CPU: Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz, 6 threads, AVX2 yes
Memory: 15.9 GiB RAM (3.3 GiB free), commit 6.6 GiB free of 23.9 GiB
GPU (used): AMD Radeon RX 580 2048SP [1002:6fdf], driver 31.0.21925.1001, 8170 MiB dedicated, 8164 MiB shared
    shader model 6.7, mesh shaders no, waves of 64 to 64 lanes, resource binding tier 3, view heap of 4194304 views, enough for the title's, GPU upload heap no
Known blockers:
- No mesh shaders (shader model 6.6): the passes that use them are dropped
- 6.6 GiB of commit free: the title's own working set is said to run 40-46 GiB, so a long session may meet 1455 as it streams (#15)
  • Works on GCN4 with AMD's legacy Polaris driver (31.0.21925). The legacy driver reports shader model 6.7 and wave64 only, so the wave64 programs from #9 would not be dropped here. Mesh shaders are what stops it, and the report says so.
  • Suggestion: total RAM. This host has 15.9 GiB in total, and the README recommends 64 GB (32 GB later). Only the commit line hints at the gap, and commit depends on the page file. A separate line, for example 15.9 GiB of RAM: the README recommends 64 GB, would show it to testers on smaller machines even when the page file is large.

Host 2: Wine 10.0 on Debian 13 (headless, Xvfb), i7-2600, GeForce GTX 1050 Ti

Run as xvfb-run -a wine victory.exe system with a fresh prefix and Debian's wine 10.0 package. The NVIDIA driver is 550.163.01, with Vulkan available.

VIctory 0.1.0 (d684ee0), release build
Windows 10, build 19043
CPU: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz, 8 threads, AVX2 no
Memory: 15.1 GiB RAM (7.1 GiB free), commit 71.8 GiB free of 86.6 GiB
GPU: NVIDIA GeForce GTX 470 [10de:06cd], driver 9.21.13.9135, 15452 MiB dedicated, 7726 MiB shared
    shader model unknown, mesh shaders no, waves of 0 to 0 lanes, resource binding tier 0, no shader-visible view heap, GPU upload heap no
Known blockers:
- Wine: the title's own anti-tamper ends the run (#6, #19); use Windows in a virtual machine
- No adapter makes a device of feature level 12.0
  • A missing AVX2 is not listed as a blocker. The CPU line says AVX2 no, and this Sandy Bridge CPU really has none, but Known blockers doesn't mention it, although the README lists AVX2 as a requirement. In crates/victory-gpu/src/system.rs, Facts::blockers() checks Wine, the adapter, waves, the view heap, mesh shaders, shader model and commit, but never cpu.avx2, even though the field's own doc comment says zlib-rs and the translator's copies rely on it. On a Windows host with such a CPU and a capable GPU, the report would end with "No known blockers." This is the one finding I'd call a bug. Something like if !self.cpu.avx2 { out.push("No AVX2: …".into()) } before the adapter check would also show it when no adapter qualifies, as it does here.
  • Wine detection works, with the right advice (#6, #19).
  • Under Wine the adapter is Wine's placeholder, not the real card: a GTX 470 with a made-up driver version, and a commit figure that doesn't match the host. With no X driver for the card, Wine never reached the real GPU through vkd3d, so no device of feature level 12.0 was made. That's expected here, since the report already says not to use Wine. But the GPU and memory lines under Wine can't be trusted. Something like "under Wine the adapter and memory figures come from Wine, not the hardware" next to the Wine blocker could keep a tester from reading too much into them.

Available for more testing

Both machines are available for anything that doesn't need the title: rerunning victory system on later commits, checking the AVX2 and RAM lines once they change, the build and cross-compile path, and Wine/Linux behaviour. We don't have the game, so in-game reports aren't something we can give. Happy to rerun on any commit you point me to.

**@⁠WellyngtonSantos** on GitHub · 2026-11-26 18:58 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/268#issuecomment-7201048373) Thanks for `victory system`. A report that collects the machine for you is exactly what a tester without a working setup needs. I ran it at d684ee0 on two hosts that none of the outputs in this PR cover: an old pre-RDNA card, and Wine. Neither machine has the title, so this is the tool alone, which is the case the PR is meant for. ### How it was built Cross-compiled on Linux with [cargo-xwin](https://github.com/rust-cross/cargo-xwin), using the pinned 1.98.1 toolchain: ``` cargo xwin build -p victory --release --target x86_64-pc-windows-msvc ``` It built cleanly in 1 min 43 s, with 13 warnings in `victory-gpu` (two `dropping_copy_types` in `pipeline/known.rs`, lines 64 and 223). `--version` prints `victory 0.1.0 (d684ee0)`, so the commit stamp works for a cross-compiled build too. The same `victory.exe` (SHA-256 `d6f5c4fc…ccfd8e`) was used on both hosts. ### Host 1: Windows 11, Radeon RX 580 (Polaris), 16 GB ``` VIctory 0.1.0 (d684ee0), release build Windows 11, build 26200.9974 CPU: Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz, 6 threads, AVX2 yes Memory: 15.9 GiB RAM (3.3 GiB free), commit 6.6 GiB free of 23.9 GiB GPU (used): AMD Radeon RX 580 2048SP [1002:6fdf], driver 31.0.21925.1001, 8170 MiB dedicated, 8164 MiB shared shader model 6.7, mesh shaders no, waves of 64 to 64 lanes, resource binding tier 3, view heap of 4194304 views, enough for the title's, GPU upload heap no Known blockers: - No mesh shaders (shader model 6.6): the passes that use them are dropped - 6.6 GiB of commit free: the title's own working set is said to run 40-46 GiB, so a long session may meet 1455 as it streams (#15) ``` - **Works on GCN4 with AMD's legacy Polaris driver (31.0.21925).** The legacy driver reports shader model 6.7 and wave64 only, so the wave64 programs from #9 would not be dropped here. Mesh shaders are what stops it, and the report says so. - **Suggestion: total RAM.** This host has 15.9 GiB in total, and the README recommends 64 GB (32 GB later). Only the commit line hints at the gap, and commit depends on the page file. A separate line, for example `15.9 GiB of RAM: the README recommends 64 GB`, would show it to testers on smaller machines even when the page file is large. ### Host 2: Wine 10.0 on Debian 13 (headless, Xvfb), i7-2600, GeForce GTX 1050 Ti Run as `xvfb-run -a wine victory.exe system` with a fresh prefix and Debian's `wine` 10.0 package. The NVIDIA driver is 550.163.01, with Vulkan available. ``` VIctory 0.1.0 (d684ee0), release build Windows 10, build 19043 CPU: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz, 8 threads, AVX2 no Memory: 15.1 GiB RAM (7.1 GiB free), commit 71.8 GiB free of 86.6 GiB GPU: NVIDIA GeForce GTX 470 [10de:06cd], driver 9.21.13.9135, 15452 MiB dedicated, 7726 MiB shared shader model unknown, mesh shaders no, waves of 0 to 0 lanes, resource binding tier 0, no shader-visible view heap, GPU upload heap no Known blockers: - Wine: the title's own anti-tamper ends the run (#6, #19); use Windows in a virtual machine - No adapter makes a device of feature level 12.0 ``` - **A missing AVX2 is not listed as a blocker.** The CPU line says `AVX2 no`, and this Sandy Bridge CPU really has none, but `Known blockers` doesn't mention it, although the README lists AVX2 as a requirement. In `crates/victory-gpu/src/system.rs`, `Facts::blockers()` checks Wine, the adapter, waves, the view heap, mesh shaders, shader model and commit, but never `cpu.avx2`, even though the field's own doc comment says `zlib-rs` and the translator's copies rely on it. On a Windows host with such a CPU and a capable GPU, the report would end with "No known blockers." This is the one finding I'd call a bug. Something like `if !self.cpu.avx2 { out.push("No AVX2: …".into()) }` before the adapter check would also show it when no adapter qualifies, as it does here. - **Wine detection works,** with the right advice (#6, #19). - **Under Wine the adapter is Wine's placeholder,** not the real card: a GTX 470 with a made-up driver version, and a commit figure that doesn't match the host. With no X driver for the card, Wine never reached the real GPU through vkd3d, so no device of feature level 12.0 was made. That's expected here, since the report already says not to use Wine. But the GPU and memory lines under Wine can't be trusted. Something like "under Wine the adapter and memory figures come from Wine, not the hardware" next to the Wine blocker could keep a tester from reading too much into them. ### Available for more testing Both machines are available for anything that doesn't need the title: rerunning `victory system` on later commits, checking the AVX2 and RAM lines once they change, the build and cross-compile path, and Wine/Linux behaviour. We don't have the game, so in-game reports aren't something we can give. Happy to rerun on any commit you point me to.
github-bot force-pushed github-bot/gh-268 from d684ee048c to ec27391454 2026-11-27 01:33:47 +00:00 Compare
On this machine (NVIDIA RTX 5060, waves of 32 lanes) three compute
programs of the title are refused with a bare E_INVALIDARG:

  host pipeline refused error=参数错误。 (0x80070057) shaders=[compute 02384a60fda6f2d0]

The DXIL is not the problem: dxv validates it, and `dxc -dumpbin` shows
what the refusal is about - NumThreads=(128,1,1), WaveSize=64. The
translator keeps WaveSize(64) wherever it cannot split a console wave
into 32-lane halves, and a device whose waves are at most 32 lanes
refuses that pipeline. The log said nothing about it, so it read as a
driver fault.

`victory_shader::dxbc::wave_size` reads the width a container asks for
out of PSV0, and the compute pipeline creation names the console width
before asking the device:

  no host pipeline: the compute program asks for wider waves than the host runs

No behaviour change for programs the host can run.
Author
Owner

@⁠redlight-06 on GitHub · 2026-11-27 01:53 UTC · original

One more commit, and it closes the E_INVALIDARG I could not explain in the report above.

The three refused compute programs are console wave64 programs, not broken DXIL:

  • victory translate --warm <one-hash> into an empty cache gives the translated container; dxv.exe on its DXIL says Validation succeeded.
  • dxc -dumpbin says what the refusal is about: NumThreads=(128,1,1), WaveSize=64.
  • This machine answers D3D12_FEATURE_D3D12_OPTIONS1 with waves of 32 to 32 lanes, and lower() keeps WaveSize(64) exactly where it cannot split a console wave into 32-lane halves. D3D12 then refuses CreateComputePipelineState with E_INVALIDARG and the log said nothing about why.

So the bare error was #9 showing up at pipeline creation, and it read like a driver fault. victory_shader::dxbc::wave_size now reads the width a container asks for out of PSV0, and compute pipeline creation names it before asking the device. Same run, same shader, after the change:

INFO  victory_gpu::pipeline: shader translated stage="compute" hash=02384a60fda6f2d0 user_data=1 samplers=0
WARN  victory_gpu::pipeline::host: no host pipeline: the compute program asks for wider waves than the host runs shaders=[compute 02384a60fda6f2d0] wave=64 host_wave=32

No behaviour change for programs the host can run (wave_size returns None when the container leaves the width to the device), and the check only fires for compute stages.

Repro for anyone on a 32-lane host:

victory translate --warm hashes.txt <game dir> --jobs 4      # fresh VICTORY_CACHE_DIR
# the one entry under <cache>/shaders/ is a VSH2 wrapper: u32 source length, source, u32 stage, u32 dxil length, DXIL
dxv.exe that.dxil ; dxc.exe -dumpbin that.dxil | findstr WaveSize
**@⁠redlight-06** on GitHub · 2026-11-27 01:53 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/268#issuecomment-7207654589) One more commit, and it closes the `E_INVALIDARG` I could not explain in the report above. The three refused compute programs are **console wave64 programs**, not broken DXIL: - `victory translate --warm <one-hash> ` into an empty cache gives the translated container; `dxv.exe` on its DXIL says `Validation succeeded.` - `dxc -dumpbin` says what the refusal is about: `NumThreads=(128,1,1)`, `WaveSize=64`. - This machine answers `D3D12_FEATURE_D3D12_OPTIONS1` with waves of 32 to 32 lanes, and `lower()` keeps `WaveSize(64)` exactly where it cannot split a console wave into 32-lane halves. D3D12 then refuses `CreateComputePipelineState` with `E_INVALIDARG` and the log said nothing about why. So the bare error was #9 showing up at pipeline creation, and it read like a driver fault. `victory_shader::dxbc::wave_size` now reads the width a container asks for out of `PSV0`, and compute pipeline creation names it before asking the device. Same run, same shader, after the change: ``` INFO victory_gpu::pipeline: shader translated stage="compute" hash=02384a60fda6f2d0 user_data=1 samplers=0 WARN victory_gpu::pipeline::host: no host pipeline: the compute program asks for wider waves than the host runs shaders=[compute 02384a60fda6f2d0] wave=64 host_wave=32 ``` No behaviour change for programs the host can run (`wave_size` returns `None` when the container leaves the width to the device), and the check only fires for compute stages. Repro for anyone on a 32-lane host: ``` victory translate --warm hashes.txt <game dir> --jobs 4 # fresh VICTORY_CACHE_DIR # the one entry under <cache>/shaders/ is a VSH2 wrapper: u32 source length, source, u32 stage, u32 dxil length, DXIL dxv.exe that.dxil ; dxc.exe -dumpbin that.dxil | findstr WaveSize ```
Author
Owner

@⁠redlight-06 on GitHub · 2026-11-27 06:05 UTC · original
On crates/victory-gpu/src/system/gather.rs line 162 (outdated):

@@ -0,0 +1,378 @@
+//! Asking this machine for its facts.
+//!
+//! Nothing here needs a title, a game file or a window: the adapters are
+//! enumerated and a device made on each, exactly as the host side makes
+//! one (`host`), so what a report says is what a run would meet.
+
+use windows::Win32::Foundation::ERROR_SUCCESS;
+use windows::Win32::Graphics::Direct3D::D3D_FEATURE_LEVEL_12_0;
+use windows::Win32::Graphics::Direct3D12::{
+    D3D_SHADER_MODEL_6_9, D3D12_DESCRIPTOR_HEAP_DESC, D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE,
+    D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, D3D12_FEATURE_D3D12_OPTIONS,
+    D3D12_FEATURE_D3D12_OPTIONS1, D3D12_FEATURE_D3D12_OPTIONS7, D3D12_FEATURE_D3D12_OPTIONS16,
+    D3D12_FEATURE_DATA_D3D12_OPTIONS, D3D12_FEATURE_DATA_D3D12_OPTIONS1,
+    D3D12_FEATURE_DATA_D3D12_OPTIONS7, D3D12_FEATURE_DATA_D3D12_OPTIONS16,
+    D3D12_FEATURE_DATA_SHADER_MODEL, D3D12_FEATURE_SHADER_MODEL,
+    D3D12_MESH_SHADER_TIER_NOT_SUPPORTED, D3D12CreateDevice, ID3D12DescriptorHeap, ID3D12Device,
+};
+use windows::Win32::Graphics::Dxgi::{
+    CreateDXGIFactory1, DXGI_ADAPTER_FLAG_SOFTWARE, IDXGIAdapter1, IDXGIDevice, IDXGIFactory1,
+};
+use windows::Win32::System::LibraryLoader::{GetModuleHandleW, GetProcAddress};
+use windows::Win32::System::Registry::{
+    HKEY, HKEY_LOCAL_MACHINE, KEY_READ, REG_DWORD, REG_SZ, REG_VALUE_TYPE, RegCloseKey,
+    RegOpenKeyExW, RegQueryValueExW,
+};
+use windows::Win32::System::SystemInformation::{
+    GetSystemInfo, GlobalMemoryStatusEx, MEMORYSTATUSEX, SYSTEM_INFO,
+};
+use windows::Win32::System::Threading::{
+    IsProcessorFeaturePresent, PF_AVX2_INSTRUCTIONS_AVAILABLE,
+};
+use windows::core::{IUnknown, Interface, PCWSTR, s, w};
+
+use super::{Cpu, Facts, Gpu, Memory};
+
+/// Views the largest host view heap is tried at, past the title's own (see
+/// `RAW_TWINS` in `descriptor/host.rs`).
+const MOST_VIEWS: u32 = 1 << 22;
+
+/// Views the next largest is tried at.
+const MORE_VIEWS: u32 = 1 << 21;
+
+/// Views a host that takes neither holds: the title's own heap just fits.
+const TITLE_VIEWS: u32 = 1_000_000;
+
+pub(crate) fn gather() -> Facts {
+    let (gpus, used) = adapters();
+    Facts {
+        version: env!("CARGO_PKG_VERSION").to_owned(),
+        commit: None,
+        debug: cfg!(debug_assertions),
+        windows: windows_version(),
+        cpu: cpu(),
+        memory: memory(),
+        gpus,
+        used,
+        wine: wine(),
+    }
+}
+
+/// Every adapter that is not the software one, and which of them a run would
+/// use: the one the default device is made on.
+fn adapters() -> (Vec<Gpu>, Option<usize>) {
+    // SAFETY: plain COM calls; every object made here is released as it goes.
+    unsafe {
+        let Ok(factory) = CreateDXGIFactory1::<IDXGIFactory1>() else {
+            return (Vec::new(), None);
+        };
+        // The adapter a run gets: whatever the default device is made on.
+        let mut default: Option<ID3D12Device> = None;
+        let luid = if D3D12CreateDevice(None, D3D_FEATURE_LEVEL_12_0, &mut default).is_ok() {
+            default.as_ref().map(|d| d.GetAdapterLuid())
+        } else {
+            None
+        };
+        let mut gpus = Vec::new();
+        let mut used = None;
+        for i in 0.. {
+            let Ok(adapter) = factory.EnumAdapters1(i) else {
+                break;
+            };
+            let Ok(desc) = adapter.GetDesc1() else {
+                continue;
+            };
+            if desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE.0 as u32 != 0 {
+                continue;
+            }
+            let described = utf16(&desc.Description);
+            let name = described.trim_end();
+            // A laptop with two display paths lists the one card twice, under
+            // two Luids: the report names it once.
+            if gpus
+                .iter()
+                .any(|g: &Gpu| g.name == name && g.device == desc.DeviceId)
+            {
+                continue;
+            }
+            let mut gpu = Gpu {
+                name: name.to_owned(),
+                vendor: desc.VendorId,
+                device: desc.DeviceId,
+                driver: driver_version(&adapter),
+                dedicated: desc.DedicatedVideoMemory as u64,
+                shared: desc.SharedSystemMemory as u64,
+                ..Gpu::default()
+            };
+            if let Some(device) = device_on(&adapter) {
+                caps(&device, &mut gpu);
+            }
+            if luid.is_some_and(|l| {
+                l.LowPart == desc.AdapterLuid.LowPart && l.HighPart == desc.AdapterLuid.HighPart
+            }) {
+                used = Some(gpus.len());
+            }
+            gpus.push(gpu);
+        }
+        // No LUID to match (the default device may be the software one): the
+        // first adapter that makes a device of feature level 12.0 is the one a
+        // run would use.
+        if used.is_none() {
+            used = gpus.iter().position(|g| g.shader_model.is_some());
+        }
+        (gpus, used)
+    }
+}
+
+/// A device of the feature level the runtime asks for, on `adapter`.
+fn device_on(adapter: &IDXGIAdapter1) -> Option<ID3D12Device> {
+    let unknown: IUnknown = adapter.cast().ok()?;
+    let mut device: Option<ID3D12Device> = None;
+    // SAFETY: plain COM call; the device is released by its owner.
+    unsafe { D3D12CreateDevice(Some(&unknown), D3D_FEATURE_LEVEL_12_0, &mut device) }.ok()?;
+    device
+}
+
+fn driver_version(adapter: &IDXGIAdapter1) -> Option<[u16; 4]> {
+    // SAFETY: plain COM call.
+    let version = unsafe { adapter.CheckInterfaceSupport(&IDXGIDevice::IID) }.ok()? as u64;
+    Some([
+        (version >> 48) as u16,
+        (version >> 32) as u16,
+        (version >> 16) as u16,
+        version as u16,
+    ])
+}
+
+/// What a device says it can do, and the largest shader-visible view heap it
+/// makes. The heap is the question `descriptor/host.rs` asks once per
+/// run (`probe_view_limit`), so a report answers it with the same number.
+fn caps(device: &ID3D12Device, gpu: &mut Gpu) {
+    let mut options1 = D3D12_FEATURE_DATA_D3D12_OPTIONS1::default();
+    if supports(device, D3D12_FEATURE_D3D12_OPTIONS1, &mut options1) {
+        gpu.wave_min = options1.WaveLaneCountMin;
+        gpu.wave_max = options1.WaveLaneCountMax;
+    }
+    let mut model = D3D12_FEATURE_DATA_SHADER_MODEL {
+        HighestShaderModel: D3D_SHADER_MODEL_6_9,
+    };
+    if supports(device, D3D12_FEATURE_SHADER_MODEL, &mut model) {
+        // The call answers with the highest it takes of the one asked for:
+        // 6.0 is 100, so 103 is 6.3.
+        gpu.shader_model = Some((6, model.HighestShaderModel.0.saturating_sub(100) as u32));

Right — and it is already fixed on this branch, in b72f317 system: read the shader model value as the model it names (#104) (the commit after the one this comment was left on).

system.rs now carries const SHADER_MODEL_6_0: u32 = 0x60; and

pub fn shader_model(value: u32) -> (u32, u32) {
    (6, value.saturating_sub(SHADER_MODEL_6_0))
}

so the nibbles are read as written, with the test a_shader_model_value_is_read_as_the_model_it_names covering 0x60 → (6,0), 0x63 → (6,3), 0x67 → (6,7), 0x69 → (6,9), and 0x50 → (6,0) (the clamp case).

What it changed for the report on this machine: D3D12_FEATURE_DATA_SHADER_MODEL answers 0x67, which the old decode printed as shader model 6.3 and turned into a false "the title's shaders are written for 6.6 and above" blocker. It now prints shader model 6.7 and the blocker list is down to the two real ones (32-lane waves, commit headroom).

The current output, from the same build that ran the title:

GPU (used): NVIDIA GeForce RTX 5060 Laptop GPU [10de:2d59], driver 32.0.15.9621, 7899 MiB dedicated, 16280 MiB shared
    shader model 6.7, mesh shaders yes, waves of 32 to 32 lanes, resource binding tier 3, view heap of 1000000 views, enough for the title's, GPU upload heap yes
Known blockers:
- Waves of 32 to 32 lanes: console wave64 compute programs are dropped where their cross-lane code cannot be split (#9)
- 40.5 GiB of commit free: ...
**@⁠redlight-06** on GitHub · 2026-11-27 06:05 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/268#discussion_r4716206850) On `crates/victory-gpu/src/system/gather.rs` line 162 (outdated): ```diff @@ -0,0 +1,378 @@ +//! Asking this machine for its facts. +//! +//! Nothing here needs a title, a game file or a window: the adapters are +//! enumerated and a device made on each, exactly as the host side makes +//! one (`host`), so what a report says is what a run would meet. + +use windows::Win32::Foundation::ERROR_SUCCESS; +use windows::Win32::Graphics::Direct3D::D3D_FEATURE_LEVEL_12_0; +use windows::Win32::Graphics::Direct3D12::{ + D3D_SHADER_MODEL_6_9, D3D12_DESCRIPTOR_HEAP_DESC, D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE, + D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, D3D12_FEATURE_D3D12_OPTIONS, + D3D12_FEATURE_D3D12_OPTIONS1, D3D12_FEATURE_D3D12_OPTIONS7, D3D12_FEATURE_D3D12_OPTIONS16, + D3D12_FEATURE_DATA_D3D12_OPTIONS, D3D12_FEATURE_DATA_D3D12_OPTIONS1, + D3D12_FEATURE_DATA_D3D12_OPTIONS7, D3D12_FEATURE_DATA_D3D12_OPTIONS16, + D3D12_FEATURE_DATA_SHADER_MODEL, D3D12_FEATURE_SHADER_MODEL, + D3D12_MESH_SHADER_TIER_NOT_SUPPORTED, D3D12CreateDevice, ID3D12DescriptorHeap, ID3D12Device, +}; +use windows::Win32::Graphics::Dxgi::{ + CreateDXGIFactory1, DXGI_ADAPTER_FLAG_SOFTWARE, IDXGIAdapter1, IDXGIDevice, IDXGIFactory1, +}; +use windows::Win32::System::LibraryLoader::{GetModuleHandleW, GetProcAddress}; +use windows::Win32::System::Registry::{ + HKEY, HKEY_LOCAL_MACHINE, KEY_READ, REG_DWORD, REG_SZ, REG_VALUE_TYPE, RegCloseKey, + RegOpenKeyExW, RegQueryValueExW, +}; +use windows::Win32::System::SystemInformation::{ + GetSystemInfo, GlobalMemoryStatusEx, MEMORYSTATUSEX, SYSTEM_INFO, +}; +use windows::Win32::System::Threading::{ + IsProcessorFeaturePresent, PF_AVX2_INSTRUCTIONS_AVAILABLE, +}; +use windows::core::{IUnknown, Interface, PCWSTR, s, w}; + +use super::{Cpu, Facts, Gpu, Memory}; + +/// Views the largest host view heap is tried at, past the title's own (see +/// `RAW_TWINS` in `descriptor/host.rs`). +const MOST_VIEWS: u32 = 1 << 22; + +/// Views the next largest is tried at. +const MORE_VIEWS: u32 = 1 << 21; + +/// Views a host that takes neither holds: the title's own heap just fits. +const TITLE_VIEWS: u32 = 1_000_000; + +pub(crate) fn gather() -> Facts { + let (gpus, used) = adapters(); + Facts { + version: env!("CARGO_PKG_VERSION").to_owned(), + commit: None, + debug: cfg!(debug_assertions), + windows: windows_version(), + cpu: cpu(), + memory: memory(), + gpus, + used, + wine: wine(), + } +} + +/// Every adapter that is not the software one, and which of them a run would +/// use: the one the default device is made on. +fn adapters() -> (Vec<Gpu>, Option<usize>) { + // SAFETY: plain COM calls; every object made here is released as it goes. + unsafe { + let Ok(factory) = CreateDXGIFactory1::<IDXGIFactory1>() else { + return (Vec::new(), None); + }; + // The adapter a run gets: whatever the default device is made on. + let mut default: Option<ID3D12Device> = None; + let luid = if D3D12CreateDevice(None, D3D_FEATURE_LEVEL_12_0, &mut default).is_ok() { + default.as_ref().map(|d| d.GetAdapterLuid()) + } else { + None + }; + let mut gpus = Vec::new(); + let mut used = None; + for i in 0.. { + let Ok(adapter) = factory.EnumAdapters1(i) else { + break; + }; + let Ok(desc) = adapter.GetDesc1() else { + continue; + }; + if desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE.0 as u32 != 0 { + continue; + } + let described = utf16(&desc.Description); + let name = described.trim_end(); + // A laptop with two display paths lists the one card twice, under + // two Luids: the report names it once. + if gpus + .iter() + .any(|g: &Gpu| g.name == name && g.device == desc.DeviceId) + { + continue; + } + let mut gpu = Gpu { + name: name.to_owned(), + vendor: desc.VendorId, + device: desc.DeviceId, + driver: driver_version(&adapter), + dedicated: desc.DedicatedVideoMemory as u64, + shared: desc.SharedSystemMemory as u64, + ..Gpu::default() + }; + if let Some(device) = device_on(&adapter) { + caps(&device, &mut gpu); + } + if luid.is_some_and(|l| { + l.LowPart == desc.AdapterLuid.LowPart && l.HighPart == desc.AdapterLuid.HighPart + }) { + used = Some(gpus.len()); + } + gpus.push(gpu); + } + // No LUID to match (the default device may be the software one): the + // first adapter that makes a device of feature level 12.0 is the one a + // run would use. + if used.is_none() { + used = gpus.iter().position(|g| g.shader_model.is_some()); + } + (gpus, used) + } +} + +/// A device of the feature level the runtime asks for, on `adapter`. +fn device_on(adapter: &IDXGIAdapter1) -> Option<ID3D12Device> { + let unknown: IUnknown = adapter.cast().ok()?; + let mut device: Option<ID3D12Device> = None; + // SAFETY: plain COM call; the device is released by its owner. + unsafe { D3D12CreateDevice(Some(&unknown), D3D_FEATURE_LEVEL_12_0, &mut device) }.ok()?; + device +} + +fn driver_version(adapter: &IDXGIAdapter1) -> Option<[u16; 4]> { + // SAFETY: plain COM call. + let version = unsafe { adapter.CheckInterfaceSupport(&IDXGIDevice::IID) }.ok()? as u64; + Some([ + (version >> 48) as u16, + (version >> 32) as u16, + (version >> 16) as u16, + version as u16, + ]) +} + +/// What a device says it can do, and the largest shader-visible view heap it +/// makes. The heap is the question `descriptor/host.rs` asks once per +/// run (`probe_view_limit`), so a report answers it with the same number. +fn caps(device: &ID3D12Device, gpu: &mut Gpu) { + let mut options1 = D3D12_FEATURE_DATA_D3D12_OPTIONS1::default(); + if supports(device, D3D12_FEATURE_D3D12_OPTIONS1, &mut options1) { + gpu.wave_min = options1.WaveLaneCountMin; + gpu.wave_max = options1.WaveLaneCountMax; + } + let mut model = D3D12_FEATURE_DATA_SHADER_MODEL { + HighestShaderModel: D3D_SHADER_MODEL_6_9, + }; + if supports(device, D3D12_FEATURE_SHADER_MODEL, &mut model) { + // The call answers with the highest it takes of the one asked for: + // 6.0 is 100, so 103 is 6.3. + gpu.shader_model = Some((6, model.HighestShaderModel.0.saturating_sub(100) as u32)); ``` Right — and it is already fixed on this branch, in `b72f317 system: read the shader model value as the model it names (#104)` (the commit after the one this comment was left on). `system.rs` now carries `const SHADER_MODEL_6_0: u32 = 0x60;` and ```rust pub fn shader_model(value: u32) -> (u32, u32) { (6, value.saturating_sub(SHADER_MODEL_6_0)) } ``` so the nibbles are read as written, with the test `a_shader_model_value_is_read_as_the_model_it_names` covering `0x60 → (6,0)`, `0x63 → (6,3)`, `0x67 → (6,7)`, `0x69 → (6,9)`, and `0x50 → (6,0)` (the clamp case). What it changed for the report on this machine: `D3D12_FEATURE_DATA_SHADER_MODEL` answers `0x67`, which the old decode printed as `shader model 6.3` and turned into a false "the title's shaders are written for 6.6 and above" blocker. It now prints `shader model 6.7` and the blocker list is down to the two real ones (32-lane waves, commit headroom). The current output, from the same build that ran the title: ``` GPU (used): NVIDIA GeForce RTX 5060 Laptop GPU [10de:2d59], driver 32.0.15.9621, 7899 MiB dedicated, 16280 MiB shared shader model 6.7, mesh shaders yes, waves of 32 to 32 lanes, resource binding tier 3, view heap of 1000000 views, enough for the title's, GPU upload heap yes Known blockers: - Waves of 32 to 32 lanes: console wave64 compute programs are dropped where their cross-lane code cannot be split (#9) - 40.5 GiB of commit free: ... ```
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-27 07:26 UTC · original

Tested victory system at bb666a6 on an RX 7900 XT (RDNA3), driver 32.0.32029.2010, Windows 11 26300.9974. I merged bb666a6 onto a-publier 4eb6cfd (local commit 46fd93f) and made a release build with Rust 1.98.1.

Merge: one conflict, in gameinput.rs State::poll, against #295. I kept #295's fold(stand_in, merged) and put the VICTORY_PAD_LOG block after it. The rest merged cleanly. system:: 11/11, dxbc:: 3/3 and cargo test -p victory pass.

Output, with the CPU and memory lines left out. With VICTORY_D3D12_ADAPTER=0 it was the same apart from free memory:

VIctory 0.1.0 (46fd93f), release build
Windows 11, build 26300.9974
GPU (used): AMD Radeon RX 7900 XT [1002:744c], driver 32.0.32029.2010, 20440 MiB dedicated, 16339 MiB shared
    shader model 6.8, mesh shaders yes, waves of 32 to 64 lanes, resource binding tier 3, view heap of 4194304 views, enough for the title's, GPU upload heap no
Known blockers:
- (one line about free commit, left out)
  • The build and UBR match the registry. The driver matches the one Windows lists. 20440 MiB fits a 20 GB card.
  • The device answers 0x68, which b72f317 reads as 6.8. Waves 32-64, mesh shaders and binding tier 3 are what RDNA3 should report.
  • The 1<<22 heap is the RDNA3 case that "Not verified" names. It was created and released with no error in every run, and all runs exited 0. The System event log has no amdkmdag, Display or TDR entries around the runs. This covers creation only. The fault in descriptor/host.rs came from a shader reading past the end of the heap, and system does not do that.
  • GPU upload heap no is right here. The BAR is 256 MiB (Resizable BAR off).

From the code at bb666a6. This machine has one adapter, so it could not show these:

  • (used) still comes from D3D12CreateDevice(None, ...). On rx9070xt, the branch's base, a run makes its device with create_preferred_device() (crates/victory-gpu/src/host.rs:1017). That function honours VICTORY_D3D12_ADAPTER, and otherwise takes the first high-performance adapter with SM 6.6 or higher. On an iGPU + dGPU machine the mark and the device a run uses can differ, and VICTORY_D3D12_ADAPTER never moves the mark.
  • The heap sizes match probe_view_limit() only with raw twins on (the default). With VICTORY_RAW_VIEWS=0 a run uses 1<<21, but system still reports 4194304.
  • SHADER_MODEL is still asked once, at 6_9. A D3D12 runtime that does not know 6_9 rejects the query instead of capping it, so the line would read "unknown". blockers() checks the shader model only when it is Some, so the shader-model blocker would be skipped on exactly the older runtimes it is meant for. The runtime's own gate (shader_model() in crates/victory-shader/src/emit/host.rs) asks at 6_6, so on such a runtime a run and system disagree. Stepping down from 6_9 when the query fails would avoid that. The 26300 runtime accepts the query.

Build: ec27391 still builds every watched path from ../../.git/. In a git worktree .git is a file, so ../../.git/HEAD does not exist and cargo reruns the script on every build. Two no-op cargo build --release -p victory in a row each logged the file apps\victory\../../.git/HEAD is missing and recompiled the victory crate. --version is still correct (46fd93f). From the code, a build with no .git at all (the tarball case in the script's own comment) does the same, because ../../.git/HEAD is always watched. Paths from git rev-parse --git-path HEAD and --git-common-dir would cover worktrees. Watching HEAD only when it exists would cover the tarball case.

Not tested: the title, a machine with two adapters, an older D3D12 runtime, a run with VICTORY_RAW_VIEWS=0, a build outside a git checkout, the bb666a6 wave check (this card runs 64-lane waves).

**@⁠adrianmjim** on GitHub · 2026-11-27 07:26 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/268#issuecomment-7212470187) Tested `victory system` at bb666a6 on an RX 7900 XT (RDNA3), driver 32.0.32029.2010, Windows 11 26300.9974. I merged bb666a6 onto a-publier 4eb6cfd (local commit 46fd93f) and made a release build with Rust 1.98.1. Merge: one conflict, in `gameinput.rs` `State::poll`, against #295. I kept #295's `fold(stand_in, merged)` and put the `VICTORY_PAD_LOG` block after it. The rest merged cleanly. `system::` 11/11, `dxbc::` 3/3 and `cargo test -p victory` pass. Output, with the CPU and memory lines left out. With `VICTORY_D3D12_ADAPTER=0` it was the same apart from free memory: ``` VIctory 0.1.0 (46fd93f), release build Windows 11, build 26300.9974 GPU (used): AMD Radeon RX 7900 XT [1002:744c], driver 32.0.32029.2010, 20440 MiB dedicated, 16339 MiB shared shader model 6.8, mesh shaders yes, waves of 32 to 64 lanes, resource binding tier 3, view heap of 4194304 views, enough for the title's, GPU upload heap no Known blockers: - (one line about free commit, left out) ``` - The build and UBR match the registry. The driver matches the one Windows lists. 20440 MiB fits a 20 GB card. - The device answers 0x68, which b72f317 reads as 6.8. Waves 32-64, mesh shaders and binding tier 3 are what RDNA3 should report. - The 1<<22 heap is the RDNA3 case that "Not verified" names. It was created and released with no error in every run, and all runs exited 0. The System event log has no amdkmdag, Display or TDR entries around the runs. This covers creation only. The fault in `descriptor/host.rs` came from a shader reading past the end of the heap, and `system` does not do that. - `GPU upload heap no` is right here. The BAR is 256 MiB (Resizable BAR off). From the code at bb666a6. This machine has one adapter, so it could not show these: - `(used)` still comes from `D3D12CreateDevice(None, ...)`. On rx9070xt, the branch's base, a run makes its device with `create_preferred_device()` (`crates/victory-gpu/src/host.rs:1017`). That function honours `VICTORY_D3D12_ADAPTER`, and otherwise takes the first high-performance adapter with SM 6.6 or higher. On an iGPU + dGPU machine the mark and the device a run uses can differ, and `VICTORY_D3D12_ADAPTER` never moves the mark. - The heap sizes match `probe_view_limit()` only with raw twins on (the default). With `VICTORY_RAW_VIEWS=0` a run uses 1<<21, but `system` still reports 4194304. - `SHADER_MODEL` is still asked once, at 6_9. A D3D12 runtime that does not know 6_9 rejects the query instead of capping it, so the line would read "unknown". `blockers()` checks the shader model only when it is `Some`, so the shader-model blocker would be skipped on exactly the older runtimes it is meant for. The runtime's own gate (`shader_model()` in `crates/victory-shader/src/emit/host.rs`) asks at 6_6, so on such a runtime a run and `system` disagree. Stepping down from 6_9 when the query fails would avoid that. The 26300 runtime accepts the query. Build: ec27391 still builds every watched path from `../../.git/`. In a git worktree `.git` is a file, so `../../.git/HEAD` does not exist and cargo reruns the script on every build. Two no-op `cargo build --release -p victory` in a row each logged `the file apps\victory\../../.git/HEAD is missing` and recompiled the `victory` crate. `--version` is still correct (`46fd93f`). From the code, a build with no `.git` at all (the tarball case in the script's own comment) does the same, because `../../.git/HEAD` is always watched. Paths from `git rev-parse --git-path HEAD` and `--git-common-dir` would cover worktrees. Watching `HEAD` only when it exists would cover the tarball case. Not tested: the title, a machine with two adapters, an older D3D12 runtime, a run with `VICTORY_RAW_VIEWS=0`, a build outside a git checkout, the bb666a6 wave check (this card runs 64-lane waves).
github-bot force-pushed github-bot/gh-268 from bb666a6ce9 to 12fc45e3ae 2026-11-27 14:30:18 +00:00 Compare
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/268/head:github-bot/gh-268'
git switch 'github-bot/gh-268'

Merge

Merge the changes and update on Forgejo.
git switch 'rx9070xt'
git merge --no-ff 'github-bot/gh-268'
git switch 'github-bot/gh-268'
git rebase 'rx9070xt'
git switch 'rx9070xt'
git merge --ff-only 'github-bot/gh-268'
git switch 'github-bot/gh-268'
git rebase 'rx9070xt'
git switch 'rx9070xt'
git merge --no-ff 'github-bot/gh-268'
git switch 'rx9070xt'
git merge --squash 'github-bot/gh-268'
git switch 'rx9070xt'
git merge --ff-only 'github-bot/gh-268'
git switch 'rx9070xt'
git merge 'github-bot/gh-268'
git push origin 'rx9070xt'
This discussion has been locked. Commenting is limited to contributors.
No description provided.