Add 'victory doctor' command #183

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

@⁠AndradeTK on GitHub · 2026-11-24 22:18 UTC · original
AndradeTK:feat/doctor-command → main · +296 −0 · 5 files · 1 commits · open

Reports whether this machine can run the title's world, with no game data required: OS build, CPU, RAM and commit charge, primary GPU and VRAM, mesh-shader / shader-model 6.6 support, and the dxil.dll path, ending in a verdict (NOT READY / MENUS ONLY / READY). Verified locally on an i7-14700HX

  • RTX 5060 (16 GB RAM): prints 'MENUS ONLY: world needs ~24 GB of working set'. Includes 5 unit tests for the verdict logic; clippy clean.
**@⁠AndradeTK** on GitHub · 2026-11-24 22:18 UTC · [original](https://github.com/fxceless/victory-fork/pull/183) `AndradeTK:feat/doctor-command` → `main` · +296 −0 · 5 files · 1 commits · open Reports whether this machine can run the title's world, with no game data required: OS build, CPU, RAM and commit charge, primary GPU and VRAM, mesh-shader / shader-model 6.6 support, and the dxil.dll path, ending in a verdict (NOT READY / MENUS ONLY / READY). Verified locally on an i7-14700HX + RTX 5060 (16 GB RAM): prints 'MENUS ONLY: world needs ~24 GB of working set'. Includes 5 unit tests for the verdict logic; clippy clean.
Reports whether this machine can run the title's world, with no game data
required: OS build, CPU (+AVX2), RAM and commit charge, GPU name/VRAM from
the runtime adapter, shader model 6.6 and mesh-shader support, and the
dxil.dll path (informational). Ends in a verdict (NOT READY / MENUS ONLY /
READY). Addresses Copilot review: separate SM6.6 vs mesh-shader checks,
dxil.dll informational only, AVX2 requirement, GPU facts from runtime adapter.

Verified locally on i7-14700HX + RTX 5060 (16 GB RAM): prints
'MENUS ONLY: world needs ~24 GB of working set'. 7 unit tests for verdict;
clippy clean (victory + victory-gpu).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:37:44 +00:00
Author
Owner

@⁠Izumemori on GitHub · 2026-11-24 22:28 UTC · original

What's the point of this? First of all a "doctor" command should be diagnosing what is wrong, file integrity, other non trival checks. Not just run a plump compat check and exit. That's what a README and eyes are for. And second of all this whole thing is based on hardcoded assumptions that might and probably will be wrong within hours.

The separation into "can run menus" and "can run the game" also is useless outside initial debugging.

You're just adding extra code that doesn't do anything useful and will be immediately abandoned.

**@⁠Izumemori** on GitHub · 2026-11-24 22:28 UTC · [original](https://github.com/fxceless/victory-fork/pull/183#issuecomment-7146265010) What's the point of this? First of all a "doctor" command should be diagnosing what is wrong, file integrity, other non trival checks. Not just run a plump compat check and exit. That's what a README and eyes are for. And second of all this whole thing is based on hardcoded assumptions that might and probably will be wrong within hours. The separation into "can run menus" and "can run the game" also is useless outside initial debugging. You're just adding extra code that doesn't do anything useful and will be immediately abandoned.
Author
Owner

@⁠deepdev237 on GitHub · 2026-11-25 04:03 UTC · original · edited 2026-11-25 05:11 UTC

🤖 AI-generated. This comment was written by Claude Opus 5.5 (Anthropic, model claude-opus-5-5), running as an autonomous agent in Claude Code. The AI did the work it reports: it merged the branches, built, ran the commands, tests and game runs, and read the logs. A person asked for this testing; this text was not reviewed by them before posting. Please verify anything you rely on.

Full test environment
  • OS: Windows 11 Pro, version 10.0.26300 (build 26300)
  • CPU: AMD Ryzen 9 5950X, 16 cores / 32 threads
  • RAM: 24 GB DDR4 at 2666 MT/s; page file 32 GiB on the system drive, Windows commit limit 55.92 GiB
  • GPU: AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32015.7029 (dated 2026-10-18); D3D12 reports host wave lanes min 32 / max 64; DXGI local video memory budget 15,419 MB; mesh shaders and shader model 6.6 available
  • Also installed: a virtual display adapter (Parsec Virtual Display Adapter 0.45). VIctory ran on the RX 9060 XT.
  • Toolchain: rustc 1.98.1 (48a229cea 2026-09-01), cargo 1.98.1 (797e8a9bc 2026-08-05), LLVM 22.1.8, host x86_64-pc-windows-msvc
  • Build: cargo build --profile diag -p victory --features diagnostics (diag = release + debug info)
  • Base: victory-fork main 310c6eb6c16822ab95076aad61fce19bba86bb98
  • Game files: Series X build 1.0.2.1. This copy has zero-filled holes in 11 archives (about 338 MiB in all: levels.rpf, audio.rpf, pack/story000/story000.rpf, navmeshes.rpf and six data/ttdb/*.ttpf), so failures that depend on those bytes are not emulator bugs.
  • Full logs (local paths shortened): https://gist.github.com/deepdev237/785e05b02d0dcece7aac1303f7fe4ba8

Build report: this branch does not compile on Windows as it stands (head af3d4a4), alone or merged onto current main (310c6eb).

Error (cargo build --profile diag -p victory --features diagnostics, rustc 1.98.1, Windows 11 26300):

error[E0599]: no method named `shader_model_6_6` found for reference `&host::Host` in the current scope
  --> crates\victory-gpu\src\lib.rs:78:29

crates/victory-gpu/src/lib.rs calls h.shader_model_6_6(), but no such method exists in host.rs on this branch (git grep "fn shader_model_6_6" af3d4a4 finds nothing), on its merge base, or on main. The only shader-model query in host.rs is the one inside Host::mesh_shaders().

Fix I used locally (added next to mesh_shaders() in crates/victory-gpu/src/host.rs; all imports are already in scope there):

    /// Whether the host device reports shader model 6.6 (for `victory doctor`).
    pub(crate) fn shader_model_6_6(&self) -> bool {
        let mut model = D3D12_FEATURE_DATA_SHADER_MODEL {
            HighestShaderModel: D3D_SHADER_MODEL_6_6,
        };
        // SAFETY: the query writes its own structure of the given size.
        let ok = unsafe {
            self.device
                .CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, (&raw mut model).cast(), size_of_val(&model) as u32)
                .is_ok()
        };
        ok && model.HighestShaderModel.0 >= D3D_SHADER_MODEL_6_6.0
    }

With that change it builds. The full cargo test of victory, victory-game, victory-gpu, victory-hle, victory-loader and victory-shader passes (598 passed, 0 failed, 6 ignored) on main 310c6eb plus about 100 other open PRs merged together, on an AMD Radeon RX 9060 XT (driver 32.0.32015.7029) with a Ryzen 9 5950X and 24 GB RAM.

Two smaller merge notes from the same integration:

  • When merged together with #330, apps/victory/Cargo.toml ends up with victory-gpu.workspace = true twice (Cargo: duplicate key). Delete one of the two lines.
  • I have not judged what the command reports. This comment is only about the build.
Exact state tested
  • PR head: af3d4a41c948901f84a0c20e7a3183addf44e1fb (2026-11-24T18:07:48-06:00), merged with git merge --no-ff in the integration below.
  • The compile error appears on the first cargo build after the merge; with the method above added it builds cleanly (one unrelated dead_code warning: placed_filler_twins in resource.rs).
  • git grep -n "fn shader_model_6_6" af3d4a4 -- crates and the same on its merge base with main: no match. The only call is crates/victory-gpu/src/lib.rs:76 (shader_model_6_6: h.shader_model_6_6(),).
  • Not run: the victory doctor command itself. Only the build and the test suites were run.
Integration test run, every test binary

Command: cargo test --profile diag -p victory -p victory-game -p victory-gpu -p victory-hle -p victory-loader -p victory-shader --features victory/diagnostics, on main 310c6eb plus about 110 open PRs merged in order (list with outcomes: integration-merge-log.tsv in the gist). PR #445 is reverted there.

test binary passed failed ignored
victory (unit) 14 0 0
victory-game 16 0 0
victory-gpu (includes tests on the real D3D12 device) 186 0 3
victory-hle 112 0 0
victory-loader unit / no_dll_planting / load_probe / title_dlls 30 / 1 / 2 / 1 0 0
victory-shader (includes the hardware shader tests, 29.9 s) 236 0 3
total 598 0 6

Full output: integration-test-all.log in https://gist.github.com/deepdev237/785e05b02d0dcece7aac1303f7fe4ba8

**@⁠deepdev237** on GitHub · 2026-11-25 04:03 UTC · [original](https://github.com/fxceless/victory-fork/pull/183#issuecomment-7152487782) · edited 2026-11-25 05:11 UTC > 🤖 **AI-generated.** This comment was written by **Claude Opus 5.5** (Anthropic, model `claude-opus-5-5`), running as an autonomous agent in **Claude Code**. The AI did the work it reports: it merged the branches, built, ran the commands, tests and game runs, and read the logs. A person asked for this testing; this text was not reviewed by them before posting. Please verify anything you rely on. <details><summary>Full test environment</summary> - OS: Windows 11 Pro, version 10.0.26300 (build 26300) - CPU: AMD Ryzen 9 5950X, 16 cores / 32 threads - RAM: 24 GB DDR4 at 2666 MT/s; page file 32 GiB on the system drive, Windows commit limit 55.92 GiB - GPU: AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32015.7029 (dated 2026-10-18); D3D12 reports host wave lanes min 32 / max 64; DXGI local video memory budget 15,419 MB; mesh shaders and shader model 6.6 available - Also installed: a virtual display adapter (Parsec Virtual Display Adapter 0.45). VIctory ran on the RX 9060 XT. - Toolchain: rustc 1.98.1 (48a229cea 2026-09-01), cargo 1.98.1 (797e8a9bc 2026-08-05), LLVM 22.1.8, host `x86_64-pc-windows-msvc` - Build: `cargo build --profile diag -p victory --features diagnostics` (`diag` = release + debug info) - Base: victory-fork `main` `310c6eb6c16822ab95076aad61fce19bba86bb98` - Game files: Series X build 1.0.2.1. This copy has zero-filled holes in 11 archives (about 338 MiB in all: `levels.rpf`, `audio.rpf`, `pack/story000/story000.rpf`, `navmeshes.rpf` and six `data/ttdb/*.ttpf`), so failures that depend on those bytes are not emulator bugs. - Full logs (local paths shortened): https://gist.github.com/deepdev237/785e05b02d0dcece7aac1303f7fe4ba8 </details> Build report: this branch does not compile on Windows as it stands (head `af3d4a4`), alone or merged onto current `main` (`310c6eb`). **Error** (`cargo build --profile diag -p victory --features diagnostics`, rustc 1.98.1, Windows 11 26300): ``` error[E0599]: no method named `shader_model_6_6` found for reference `&host::Host` in the current scope --> crates\victory-gpu\src\lib.rs:78:29 ``` `crates/victory-gpu/src/lib.rs` calls `h.shader_model_6_6()`, but no such method exists in `host.rs` on this branch (`git grep "fn shader_model_6_6" af3d4a4` finds nothing), on its merge base, or on `main`. The only shader-model query in `host.rs` is the one inside `Host::mesh_shaders()`. **Fix I used locally** (added next to `mesh_shaders()` in `crates/victory-gpu/src/host.rs`; all imports are already in scope there): ```rust /// Whether the host device reports shader model 6.6 (for `victory doctor`). pub(crate) fn shader_model_6_6(&self) -> bool { let mut model = D3D12_FEATURE_DATA_SHADER_MODEL { HighestShaderModel: D3D_SHADER_MODEL_6_6, }; // SAFETY: the query writes its own structure of the given size. let ok = unsafe { self.device .CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, (&raw mut model).cast(), size_of_val(&model) as u32) .is_ok() }; ok && model.HighestShaderModel.0 >= D3D_SHADER_MODEL_6_6.0 } ``` With that change it builds. The full `cargo test` of `victory`, `victory-game`, `victory-gpu`, `victory-hle`, `victory-loader` and `victory-shader` passes (598 passed, 0 failed, 6 ignored) on `main` `310c6eb` plus about 100 other open PRs merged together, on an AMD Radeon RX 9060 XT (driver 32.0.32015.7029) with a Ryzen 9 5950X and 24 GB RAM. Two smaller merge notes from the same integration: - When merged together with #330, `apps/victory/Cargo.toml` ends up with `victory-gpu.workspace = true` twice (Cargo: `duplicate key`). Delete one of the two lines. - I have not judged what the command reports. This comment is only about the build. <details><summary>Exact state tested</summary> - PR head: `af3d4a41c948901f84a0c20e7a3183addf44e1fb` (2026-11-24T18:07:48-06:00), merged with `git merge --no-ff` in the integration below. - The compile error appears on the first `cargo build` after the merge; with the method above added it builds cleanly (one unrelated `dead_code` warning: `placed_filler_twins` in `resource.rs`). - `git grep -n "fn shader_model_6_6" af3d4a4 -- crates` and the same on its merge base with `main`: no match. The only call is `crates/victory-gpu/src/lib.rs:76` (`shader_model_6_6: h.shader_model_6_6(),`). - Not run: the `victory doctor` command itself. Only the build and the test suites were run. </details> <details><summary>Integration test run, every test binary</summary> Command: `cargo test --profile diag -p victory -p victory-game -p victory-gpu -p victory-hle -p victory-loader -p victory-shader --features victory/diagnostics`, on `main` `310c6eb` plus about 110 open PRs merged in order (list with outcomes: `integration-merge-log.tsv` in the gist). PR #445 is reverted there. | test binary | passed | failed | ignored | |---|---|---|---| | `victory` (unit) | 14 | 0 | 0 | | `victory-game` | 16 | 0 | 0 | | `victory-gpu` (includes tests on the real D3D12 device) | 186 | 0 | 3 | | `victory-hle` | 112 | 0 | 0 | | `victory-loader` unit / `no_dll_planting` / `load_probe` / `title_dlls` | 30 / 1 / 2 / 1 | 0 | 0 | | `victory-shader` (includes the hardware shader tests, 29.9 s) | 236 | 0 | 3 | | **total** | **598** | **0** | **6** | Full output: `integration-test-all.log` in https://gist.github.com/deepdev237/785e05b02d0dcece7aac1303f7fe4ba8 </details>
Author
Owner

@⁠Copilot on GitHub · 2026-11-24 22:23 UTC · original
On apps/victory/src/doctor.rs line 13 (outdated):

@@ -0,0 +1,255 @@
+//! `victory doctor`: report whether this machine can run the title's world,
+//! and what is missing. Needs no game data, so it can be run on any PC.
+
+use std::ptr;
+
+use anyhow::Result;
+use victory_gpu::gpu_info;
+use victory_shader::emit::validator::Validator;
+
+/// Pure verdict from the facts we gathered, so it can be unit-tested.
+pub fn verdict(mesh: bool, ram_gb: f64, vram_gb: f64, dxc: bool) -> &'static str {
+    if !mesh {
+        return "NOT READY: host lacks mesh shaders / shader model 6.6";

A host with shader model 6.6 but no mesh shaders can still run the menus (README.md:129-130), but the combined capability flag makes it report NOT READY. Expose shader-model and mesh-shader support separately, and return MENUS ONLY when only mesh shaders are missing.

**@⁠Copilot** on GitHub · 2026-11-24 22:23 UTC · [original](https://github.com/fxceless/victory-fork/pull/183#discussion_r4687360274) On `apps/victory/src/doctor.rs` line 13 (outdated): ```diff @@ -0,0 +1,255 @@ +//! `victory doctor`: report whether this machine can run the title's world, +//! and what is missing. Needs no game data, so it can be run on any PC. + +use std::ptr; + +use anyhow::Result; +use victory_gpu::gpu_info; +use victory_shader::emit::validator::Validator; + +/// Pure verdict from the facts we gathered, so it can be unit-tested. +pub fn verdict(mesh: bool, ram_gb: f64, vram_gb: f64, dxc: bool) -> &'static str { + if !mesh { + return "NOT READY: host lacks mesh shaders / shader model 6.6"; ``` A host with shader model 6.6 but no mesh shaders can still run the menus (`README.md:129-130`), but the combined capability flag makes it report NOT READY. Expose shader-model and mesh-shader support separately, and return MENUS ONLY when only mesh shaders are missing.
Author
Owner

@⁠Copilot on GitHub · 2026-11-24 22:23 UTC · original
On apps/victory/src/doctor.rs line 23 (outdated):

@@ -0,0 +1,255 @@
+//! `victory doctor`: report whether this machine can run the title's world,
+//! and what is missing. Needs no game data, so it can be run on any PC.
+
+use std::ptr;
+
+use anyhow::Result;
+use victory_gpu::gpu_info;
+use victory_shader::emit::validator::Validator;
+
+/// Pure verdict from the facts we gathered, so it can be unit-tested.
+pub fn verdict(mesh: bool, ram_gb: f64, vram_gb: f64, dxc: bool) -> &'static str {
+    if !mesh {
+        return "NOT READY: host lacks mesh shaders / shader model 6.6";
+    }
+    if ram_gb < 24.0 {
+        return "MENUS ONLY: world needs ~24 GB of working set (upgrade RAM)";
+    }
+    if vram_gb < 8.0 {
+        return "MENUS ONLY: world needs >= 8 GB of VRAM";
+    }
+    if !dxc {
+        return "MENUS ONLY: dxil.dll not found (install the Windows SDK)";
+    }

This reports MENUS ONLY on otherwise capable machines without dxil.dll, although translated shaders do not require the validator (crates/victory-shader/src/emit/validator.rs:1-3). Keep the DLL path informational rather than making it a readiness requirement, and update the corresponding verdict test.

**@⁠Copilot** on GitHub · 2026-11-24 22:23 UTC · [original](https://github.com/fxceless/victory-fork/pull/183#discussion_r4687360308) On `apps/victory/src/doctor.rs` line 23 (outdated): ```diff @@ -0,0 +1,255 @@ +//! `victory doctor`: report whether this machine can run the title's world, +//! and what is missing. Needs no game data, so it can be run on any PC. + +use std::ptr; + +use anyhow::Result; +use victory_gpu::gpu_info; +use victory_shader::emit::validator::Validator; + +/// Pure verdict from the facts we gathered, so it can be unit-tested. +pub fn verdict(mesh: bool, ram_gb: f64, vram_gb: f64, dxc: bool) -> &'static str { + if !mesh { + return "NOT READY: host lacks mesh shaders / shader model 6.6"; + } + if ram_gb < 24.0 { + return "MENUS ONLY: world needs ~24 GB of working set (upgrade RAM)"; + } + if vram_gb < 8.0 { + return "MENUS ONLY: world needs >= 8 GB of VRAM"; + } + if !dxc { + return "MENUS ONLY: dxil.dll not found (install the Windows SDK)"; + } ``` This reports MENUS ONLY on otherwise capable machines without `dxil.dll`, although translated shaders do not require the validator (`crates/victory-shader/src/emit/validator.rs:1-3`). Keep the DLL path informational rather than making it a readiness requirement, and update the corresponding verdict test.
Author
Owner

@⁠Copilot on GitHub · 2026-11-24 22:23 UTC · original
On apps/victory/src/doctor.rs line 90 (outdated):

@@ -0,0 +1,255 @@
+//! `victory doctor`: report whether this machine can run the title's world,
+//! and what is missing. Needs no game data, so it can be run on any PC.
+
+use std::ptr;
+
+use anyhow::Result;
+use victory_gpu::gpu_info;
+use victory_shader::emit::validator::Validator;
+
+/// Pure verdict from the facts we gathered, so it can be unit-tested.
+pub fn verdict(mesh: bool, ram_gb: f64, vram_gb: f64, dxc: bool) -> &'static str {
+    if !mesh {
+        return "NOT READY: host lacks mesh shaders / shader model 6.6";
+    }
+    if ram_gb < 24.0 {
+        return "MENUS ONLY: world needs ~24 GB of working set (upgrade RAM)";
+    }
+    if vram_gb < 8.0 {
+        return "MENUS ONLY: world needs >= 8 GB of VRAM";
+    }
+    if !dxc {
+        return "MENUS ONLY: dxil.dll not found (install the Windows SDK)";
+    }
+    "READY: menus + world possible (expect 2-4 fps on reference hardware)"
+}
+
+pub fn run() -> Result<()> {
+    println!("victory doctor");
+    println!();
+
+    // OS
+    let build = reg_string(
+        r"SOFTWARE\Microsoft\Windows NT\CurrentVersion",
+        "CurrentBuild",
+    )
+    .unwrap_or_else(|| "?".to_owned());
+    let ubr = reg_u32(r"SOFTWARE\Microsoft\Windows NT\CurrentVersion", "UBR")
+        .map(|n| n.to_string())
+        .unwrap_or_else(|| "0".to_owned());
+    println!("OS build     : {build}.{ubr}");
+
+    // CPU
+    let cpu = reg_string(
+        r"HARDWARE\DESCRIPTION\System\CentralProcessor\0",
+        "ProcessorNameString",
+    )
+    .unwrap_or_else(|| "unknown".to_owned());
+    println!("CPU          : {}", cpu.trim());
+
+    // Memory
+    let (total, avail, commit_total, commit_avail) = memory_status();
+    println!(
+        "RAM          : {:.1} GB total, {:.1} GB available",
+        total as f64 / 1e9,
+        avail as f64 / 1e9
+    );
+    println!(
+        "Commit       : {:.1} / {:.1} GB",
+        (commit_total as f64 - commit_avail as f64) / 1e9,
+        commit_total as f64 / 1e9
+    );
+
+    // GPU
+    let mut name = String::from("unknown");
+    let mut vram_gb = 0.0_f64;
+    if let Some((n, bytes)) = primary_adapter() {
+        name = n;
+        vram_gb = bytes as f64 / 1e9;
+    }
+    println!("GPU          : {name}");
+    println!("VRAM         : {vram_gb:.1} GB");
+
+    let info = gpu_info();
+    let mesh = info.as_ref().map(|i| i.mesh_shaders).unwrap_or(false);
+    println!("Mesh shaders : {}", if mesh { "yes" } else { "no" });
+
+    // dxc
+    let dxc_path = Validator::default_path();
+    println!(
+        "dxc.exe      : {}",
+        dxc_path
+            .as_ref()
+            .map(|p| p.display().to_string())
+            .unwrap_or_else(|| "not found".to_owned())
+    );
+
+    println!();
+    println!(
+        "{}",
+        verdict(mesh, total as f64 / 1e9, vram_gb, dxc_path.is_some())

The verdict never checks the CPU's required instruction set. README.md:129-131 requires AVX2, and victory-loader executes the title's original x86-64 code natively. A pre-AVX2 CPU paired with sufficient RAM and a modern GPU can therefore receive READY even though it cannot execute the title. Check AVX2 support before issuing the verdict and report NOT READY when it is absent.

**@⁠Copilot** on GitHub · 2026-11-24 22:23 UTC · [original](https://github.com/fxceless/victory-fork/pull/183#discussion_r4687360345) On `apps/victory/src/doctor.rs` line 90 (outdated): ```diff @@ -0,0 +1,255 @@ +//! `victory doctor`: report whether this machine can run the title's world, +//! and what is missing. Needs no game data, so it can be run on any PC. + +use std::ptr; + +use anyhow::Result; +use victory_gpu::gpu_info; +use victory_shader::emit::validator::Validator; + +/// Pure verdict from the facts we gathered, so it can be unit-tested. +pub fn verdict(mesh: bool, ram_gb: f64, vram_gb: f64, dxc: bool) -> &'static str { + if !mesh { + return "NOT READY: host lacks mesh shaders / shader model 6.6"; + } + if ram_gb < 24.0 { + return "MENUS ONLY: world needs ~24 GB of working set (upgrade RAM)"; + } + if vram_gb < 8.0 { + return "MENUS ONLY: world needs >= 8 GB of VRAM"; + } + if !dxc { + return "MENUS ONLY: dxil.dll not found (install the Windows SDK)"; + } + "READY: menus + world possible (expect 2-4 fps on reference hardware)" +} + +pub fn run() -> Result<()> { + println!("victory doctor"); + println!(); + + // OS + let build = reg_string( + r"SOFTWARE\Microsoft\Windows NT\CurrentVersion", + "CurrentBuild", + ) + .unwrap_or_else(|| "?".to_owned()); + let ubr = reg_u32(r"SOFTWARE\Microsoft\Windows NT\CurrentVersion", "UBR") + .map(|n| n.to_string()) + .unwrap_or_else(|| "0".to_owned()); + println!("OS build : {build}.{ubr}"); + + // CPU + let cpu = reg_string( + r"HARDWARE\DESCRIPTION\System\CentralProcessor\0", + "ProcessorNameString", + ) + .unwrap_or_else(|| "unknown".to_owned()); + println!("CPU : {}", cpu.trim()); + + // Memory + let (total, avail, commit_total, commit_avail) = memory_status(); + println!( + "RAM : {:.1} GB total, {:.1} GB available", + total as f64 / 1e9, + avail as f64 / 1e9 + ); + println!( + "Commit : {:.1} / {:.1} GB", + (commit_total as f64 - commit_avail as f64) / 1e9, + commit_total as f64 / 1e9 + ); + + // GPU + let mut name = String::from("unknown"); + let mut vram_gb = 0.0_f64; + if let Some((n, bytes)) = primary_adapter() { + name = n; + vram_gb = bytes as f64 / 1e9; + } + println!("GPU : {name}"); + println!("VRAM : {vram_gb:.1} GB"); + + let info = gpu_info(); + let mesh = info.as_ref().map(|i| i.mesh_shaders).unwrap_or(false); + println!("Mesh shaders : {}", if mesh { "yes" } else { "no" }); + + // dxc + let dxc_path = Validator::default_path(); + println!( + "dxc.exe : {}", + dxc_path + .as_ref() + .map(|p| p.display().to_string()) + .unwrap_or_else(|| "not found".to_owned()) + ); + + println!(); + println!( + "{}", + verdict(mesh, total as f64 / 1e9, vram_gb, dxc_path.is_some()) ``` The verdict never checks the CPU's required instruction set. `README.md:129-131` requires AVX2, and victory-loader executes the title's original x86-64 code natively. A pre-AVX2 CPU paired with sufficient RAM and a modern GPU can therefore receive READY even though it cannot execute the title. Check AVX2 support before issuing the verdict and report NOT READY when it is absent.
Author
Owner

@⁠Copilot on GitHub · 2026-11-24 22:23 UTC · original
On apps/victory/src/doctor.rs line 144 (outdated):

@@ -0,0 +1,255 @@
+//! `victory doctor`: report whether this machine can run the title's world,
+//! and what is missing. Needs no game data, so it can be run on any PC.
+
+use std::ptr;
+
+use anyhow::Result;
+use victory_gpu::gpu_info;
+use victory_shader::emit::validator::Validator;
+
+/// Pure verdict from the facts we gathered, so it can be unit-tested.
+pub fn verdict(mesh: bool, ram_gb: f64, vram_gb: f64, dxc: bool) -> &'static str {
+    if !mesh {
+        return "NOT READY: host lacks mesh shaders / shader model 6.6";
+    }
+    if ram_gb < 24.0 {
+        return "MENUS ONLY: world needs ~24 GB of working set (upgrade RAM)";
+    }
+    if vram_gb < 8.0 {
+        return "MENUS ONLY: world needs >= 8 GB of VRAM";
+    }
+    if !dxc {
+        return "MENUS ONLY: dxil.dll not found (install the Windows SDK)";
+    }
+    "READY: menus + world possible (expect 2-4 fps on reference hardware)"
+}
+
+pub fn run() -> Result<()> {
+    println!("victory doctor");
+    println!();
+
+    // OS
+    let build = reg_string(
+        r"SOFTWARE\Microsoft\Windows NT\CurrentVersion",
+        "CurrentBuild",
+    )
+    .unwrap_or_else(|| "?".to_owned());
+    let ubr = reg_u32(r"SOFTWARE\Microsoft\Windows NT\CurrentVersion", "UBR")
+        .map(|n| n.to_string())
+        .unwrap_or_else(|| "0".to_owned());
+    println!("OS build     : {build}.{ubr}");
+
+    // CPU
+    let cpu = reg_string(
+        r"HARDWARE\DESCRIPTION\System\CentralProcessor\0",
+        "ProcessorNameString",
+    )
+    .unwrap_or_else(|| "unknown".to_owned());
+    println!("CPU          : {}", cpu.trim());
+
+    // Memory
+    let (total, avail, commit_total, commit_avail) = memory_status();
+    println!(
+        "RAM          : {:.1} GB total, {:.1} GB available",
+        total as f64 / 1e9,
+        avail as f64 / 1e9
+    );
+    println!(
+        "Commit       : {:.1} / {:.1} GB",
+        (commit_total as f64 - commit_avail as f64) / 1e9,
+        commit_total as f64 / 1e9
+    );
+
+    // GPU
+    let mut name = String::from("unknown");
+    let mut vram_gb = 0.0_f64;
+    if let Some((n, bytes)) = primary_adapter() {
+        name = n;
+        vram_gb = bytes as f64 / 1e9;
+    }
+    println!("GPU          : {name}");
+    println!("VRAM         : {vram_gb:.1} GB");
+
+    let info = gpu_info();
+    let mesh = info.as_ref().map(|i| i.mesh_shaders).unwrap_or(false);
+    println!("Mesh shaders : {}", if mesh { "yes" } else { "no" });
+
+    // dxc
+    let dxc_path = Validator::default_path();
+    println!(
+        "dxc.exe      : {}",
+        dxc_path
+            .as_ref()
+            .map(|p| p.display().to_string())
+            .unwrap_or_else(|| "not found".to_owned())
+    );
+
+    println!();
+    println!(
+        "{}",
+        verdict(mesh, total as f64 / 1e9, vram_gb, dxc_path.is_some())
+    );
+    Ok(())
+}
+
+fn memory_status() -> (u64, u64, u64, u64) {
+    use windows::Win32::System::SystemInformation::{GlobalMemoryStatusEx, MEMORYSTATUSEX};
+    let mut ms = MEMORYSTATUSEX {
+        dwLength: std::mem::size_of::<MEMORYSTATUSEX>() as u32,
+        ..Default::default()
+    };
+    // SAFETY: a valid, sized structure.
+    if unsafe { GlobalMemoryStatusEx(&mut ms) }.is_ok() {
+        (
+            ms.ullTotalPhys,
+            ms.ullAvailPhys,
+            ms.ullTotalPageFile,
+            ms.ullAvailPageFile,
+        )
+    } else {
+        (0, 0, 0, 0)
+    }
+}
+
+fn primary_adapter() -> Option<(String, usize)> {
+    use windows::Win32::Graphics::Dxgi::{CreateDXGIFactory2, IDXGIFactory4};
+    // SAFETY: plain DXGI factory creation.
+    use windows::Win32::Graphics::Dxgi::DXGI_CREATE_FACTORY_FLAGS;
+    let factory: IDXGIFactory4 = unsafe { CreateDXGIFactory2(DXGI_CREATE_FACTORY_FLAGS(0)).ok()? };
+    let mut best: Option<(String, usize)> = None;
+    let mut i = 0u32;
+    loop {
+        // SAFETY: enumerated adapter; released when dropped.
+        let adapter = match unsafe { factory.EnumAdapters1(i) } {
+            Ok(a) => a,
+            Err(_) => break,
+        };
+        let desc = match unsafe { adapter.GetDesc1() } {
+            Ok(d) => d,
+            Err(_) => {
+                i += 1;
+                continue;
+            }
+        };
+        // Skip software adapters (DXGI_ADAPTER_FLAG_SOFTWARE = 0x2).
+        if desc.Flags & 0x2 != 0 {
+            i += 1;
+            continue;
+        }
+        let bytes = desc.DedicatedVideoMemory;
+        let name = String::from_utf16_lossy(&desc.Description)
+            .trim_end_matches('\0')
+            .to_owned();
+        if best.as_ref().map(|b| bytes > b.1).unwrap_or(true) {
+            best = Some((name, bytes));

On multi-GPU machines, choosing the adapter with the most VRAM can combine one GPU's name and memory with another GPU's capabilities: gpu_info() uses the runtime device created in crates/victory-gpu/src/host.rs:548. This can incorrectly pass the VRAM requirement using an unused GPU's memory. Obtain the description and VRAM from the runtime device's adapter LUID, as host.rs:603-604 already does, and report all GPU facts from that adapter.

**@⁠Copilot** on GitHub · 2026-11-24 22:23 UTC · [original](https://github.com/fxceless/victory-fork/pull/183#discussion_r4687360387) On `apps/victory/src/doctor.rs` line 144 (outdated): ```diff @@ -0,0 +1,255 @@ +//! `victory doctor`: report whether this machine can run the title's world, +//! and what is missing. Needs no game data, so it can be run on any PC. + +use std::ptr; + +use anyhow::Result; +use victory_gpu::gpu_info; +use victory_shader::emit::validator::Validator; + +/// Pure verdict from the facts we gathered, so it can be unit-tested. +pub fn verdict(mesh: bool, ram_gb: f64, vram_gb: f64, dxc: bool) -> &'static str { + if !mesh { + return "NOT READY: host lacks mesh shaders / shader model 6.6"; + } + if ram_gb < 24.0 { + return "MENUS ONLY: world needs ~24 GB of working set (upgrade RAM)"; + } + if vram_gb < 8.0 { + return "MENUS ONLY: world needs >= 8 GB of VRAM"; + } + if !dxc { + return "MENUS ONLY: dxil.dll not found (install the Windows SDK)"; + } + "READY: menus + world possible (expect 2-4 fps on reference hardware)" +} + +pub fn run() -> Result<()> { + println!("victory doctor"); + println!(); + + // OS + let build = reg_string( + r"SOFTWARE\Microsoft\Windows NT\CurrentVersion", + "CurrentBuild", + ) + .unwrap_or_else(|| "?".to_owned()); + let ubr = reg_u32(r"SOFTWARE\Microsoft\Windows NT\CurrentVersion", "UBR") + .map(|n| n.to_string()) + .unwrap_or_else(|| "0".to_owned()); + println!("OS build : {build}.{ubr}"); + + // CPU + let cpu = reg_string( + r"HARDWARE\DESCRIPTION\System\CentralProcessor\0", + "ProcessorNameString", + ) + .unwrap_or_else(|| "unknown".to_owned()); + println!("CPU : {}", cpu.trim()); + + // Memory + let (total, avail, commit_total, commit_avail) = memory_status(); + println!( + "RAM : {:.1} GB total, {:.1} GB available", + total as f64 / 1e9, + avail as f64 / 1e9 + ); + println!( + "Commit : {:.1} / {:.1} GB", + (commit_total as f64 - commit_avail as f64) / 1e9, + commit_total as f64 / 1e9 + ); + + // GPU + let mut name = String::from("unknown"); + let mut vram_gb = 0.0_f64; + if let Some((n, bytes)) = primary_adapter() { + name = n; + vram_gb = bytes as f64 / 1e9; + } + println!("GPU : {name}"); + println!("VRAM : {vram_gb:.1} GB"); + + let info = gpu_info(); + let mesh = info.as_ref().map(|i| i.mesh_shaders).unwrap_or(false); + println!("Mesh shaders : {}", if mesh { "yes" } else { "no" }); + + // dxc + let dxc_path = Validator::default_path(); + println!( + "dxc.exe : {}", + dxc_path + .as_ref() + .map(|p| p.display().to_string()) + .unwrap_or_else(|| "not found".to_owned()) + ); + + println!(); + println!( + "{}", + verdict(mesh, total as f64 / 1e9, vram_gb, dxc_path.is_some()) + ); + Ok(()) +} + +fn memory_status() -> (u64, u64, u64, u64) { + use windows::Win32::System::SystemInformation::{GlobalMemoryStatusEx, MEMORYSTATUSEX}; + let mut ms = MEMORYSTATUSEX { + dwLength: std::mem::size_of::<MEMORYSTATUSEX>() as u32, + ..Default::default() + }; + // SAFETY: a valid, sized structure. + if unsafe { GlobalMemoryStatusEx(&mut ms) }.is_ok() { + ( + ms.ullTotalPhys, + ms.ullAvailPhys, + ms.ullTotalPageFile, + ms.ullAvailPageFile, + ) + } else { + (0, 0, 0, 0) + } +} + +fn primary_adapter() -> Option<(String, usize)> { + use windows::Win32::Graphics::Dxgi::{CreateDXGIFactory2, IDXGIFactory4}; + // SAFETY: plain DXGI factory creation. + use windows::Win32::Graphics::Dxgi::DXGI_CREATE_FACTORY_FLAGS; + let factory: IDXGIFactory4 = unsafe { CreateDXGIFactory2(DXGI_CREATE_FACTORY_FLAGS(0)).ok()? }; + let mut best: Option<(String, usize)> = None; + let mut i = 0u32; + loop { + // SAFETY: enumerated adapter; released when dropped. + let adapter = match unsafe { factory.EnumAdapters1(i) } { + Ok(a) => a, + Err(_) => break, + }; + let desc = match unsafe { adapter.GetDesc1() } { + Ok(d) => d, + Err(_) => { + i += 1; + continue; + } + }; + // Skip software adapters (DXGI_ADAPTER_FLAG_SOFTWARE = 0x2). + if desc.Flags & 0x2 != 0 { + i += 1; + continue; + } + let bytes = desc.DedicatedVideoMemory; + let name = String::from_utf16_lossy(&desc.Description) + .trim_end_matches('\0') + .to_owned(); + if best.as_ref().map(|b| bytes > b.1).unwrap_or(true) { + best = Some((name, bytes)); ``` On multi-GPU machines, choosing the adapter with the most VRAM can combine one GPU's name and memory with another GPU's capabilities: `gpu_info()` uses the runtime device created in `crates/victory-gpu/src/host.rs:548`. This can incorrectly pass the VRAM requirement using an unused GPU's memory. Obtain the description and VRAM from the runtime device's adapter LUID, as `host.rs:603-604` already does, and report all GPU facts from that adapter.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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