Add 'victory doctor' command #183

Open
AndradeTK wants to merge 1 commit from upstream-pr/183 into main
AndradeTK commented 2026-11-24 22:18:12 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by AndradeTK on 2026-11-24T22:18:12Z.


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.
<!-- greyfinch-sync:fxceless/victory-fork:issue:6592529456 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/183). Originally posted by [AndradeTK](https://github.com/AndradeTK) on 2026-11-24T22:18:12Z. --- 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.
copilot-pull-request-reviewer[bot commented 2026-11-24 23:09:04 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-24T22:23:45Z.

Review: COMMENTED


The doctor can issue incorrect readiness verdicts by conflating shader capabilities, requiring an optional validator DLL, mixing data from different GPU adapters, and omitting the required AVX2 check.

4 open issues
What changed in this PR

Adds victory doctor, a diagnostic command that reports host hardware and shader support and estimates world readiness without requiring game data.

Changes:

  • Collects OS, CPU, memory, GPU, and validator-path diagnostics.
  • Adds readiness verdict logic with five unit tests.
  • Exposes GPU capability information and wires the command into the CLI.
File Description
crates/​victory-gpu/​src/​lib.rs Exposes host GPU capability information.
Cargo.lock Records new CLI dependencies.
apps/​victory/​src/​main.rs Registers and dispatches the doctor command.
apps/​victory/​src/​doctor.rs Implements diagnostics, readiness verdicts, and tests.
apps/​victory/​Cargo.toml Adds GPU and Windows API dependencies.

Review effort: Balanced

<!-- greyfinch-sync:fxceless/victory-fork:review:6048353852 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/183#pullrequestreview-6048353852). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/copilot-pull-request-reviewer%5Bbot%5D) on 2026-11-24T22:23:45Z. **Review:** COMMENTED --- <!-- ccr-overview-v2 --> ### 🟡 Changes recommended The doctor can issue incorrect readiness verdicts by conflating shader capabilities, requiring an optional validator DLL, mixing data from different GPU adapters, and omitting the required AVX2 check. <details open> <summary><strong>4 open issues</strong></summary> - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> [Separate shader-model and mesh-shader readiness checks](https://github.com/fxceless/victory-fork/pull/183#discussion_r4687360274) · New - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> [Do not require dxil.dll for readiness](https://github.com/fxceless/victory-fork/pull/183#discussion_r4687360308) · New - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> [Require AVX2 support before reporting READY](https://github.com/fxceless/victory-fork/pull/183#discussion_r4687360345) · New - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> [Report GPU facts from the runtime adapter](https://github.com/fxceless/victory-fork/pull/183#discussion_r4687360387) · New </details> <details> <summary><strong>What changed in this PR</strong></summary> Adds `victory doctor`, a diagnostic command that reports host hardware and shader support and estimates world readiness without requiring game data. **Changes:** - Collects OS, CPU, memory, GPU, and validator-path diagnostics. - Adds readiness verdict logic with five unit tests. - Exposes GPU capability information and wires the command into the CLI. | File | Description | | ---- | ----------- | | `crates/​victory-gpu/​src/​lib.rs` | Exposes host GPU capability information. | | `Cargo.lock` | Records new CLI dependencies. | | `apps/​victory/​src/​main.rs` | Registers and dispatches the `doctor` command. | | `apps/​victory/​src/​doctor.rs` | Implements diagnostics, readiness verdicts, and tests. | | `apps/​victory/​Cargo.toml` | Adds GPU and Windows API dependencies. | </details> <sub>Review effort: Balanced</sub>
Izumemori commented 2026-11-24 23:09:36 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Izumemori on 2026-11-24T22:28:05Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7146265010 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/183#issuecomment-7146265010). Originally posted by [Izumemori](https://github.com/Izumemori) on 2026-11-24T22:28:05Z. --- 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.
Copilot commented 2026-11-24 23:09:42 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Copilot on 2026-11-24T22:23:44Z.

Code review location: apps/victory/src/doctor.rs; line 13

@@ -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.

<!-- greyfinch-sync:fxceless/victory-fork:review-comment:4687360274 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/183#discussion_r4687360274). Originally posted by [Copilot](https://github.com/Copilot) on 2026-11-24T22:23:44Z. **Code review location:** `apps/victory/src/doctor.rs`; line 13 ~~~~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.
Copilot commented 2026-11-24 23:09:42 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Copilot on 2026-11-24T22:23:44Z.

Code review location: apps/victory/src/doctor.rs; line 23

@@ -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.

<!-- greyfinch-sync:fxceless/victory-fork:review-comment:4687360308 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/183#discussion_r4687360308). Originally posted by [Copilot](https://github.com/Copilot) on 2026-11-24T22:23:44Z. **Code review location:** `apps/victory/src/doctor.rs`; line 23 ~~~~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.
Copilot commented 2026-11-24 23:09:42 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Copilot on 2026-11-24T22:23:44Z.

Code review location: apps/victory/src/doctor.rs; line 90

@@ -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.

<!-- greyfinch-sync:fxceless/victory-fork:review-comment:4687360345 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/183#discussion_r4687360345). Originally posted by [Copilot](https://github.com/Copilot) on 2026-11-24T22:23:44Z. **Code review location:** `apps/victory/src/doctor.rs`; line 90 ~~~~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.
Copilot commented 2026-11-24 23:09:42 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Copilot on 2026-11-24T22:23:44Z.

Code review location: apps/victory/src/doctor.rs; line 144

@@ -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.

<!-- greyfinch-sync:fxceless/victory-fork:review-comment:4687360387 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/183#discussion_r4687360387). Originally posted by [Copilot](https://github.com/Copilot) on 2026-11-24T22:23:44Z. **Code review location:** `apps/victory/src/doctor.rs`; line 144 ~~~~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.
deepdev237 commented 2026-11-25 04:11:23 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by deepdev237 on 2026-11-25T04:03:24Z.


🤖 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

<!-- greyfinch-sync:fxceless/victory-fork:comment:7152487782 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/183#issuecomment-7152487782). Originally posted by [deepdev237](https://github.com/deepdev237) on 2026-11-25T04:03:24Z. --- > 🤖 **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>
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/183:upstream-pr/183'
git switch 'upstream-pr/183'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/183'
git switch 'upstream-pr/183'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/183'
git switch 'upstream-pr/183'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/183'
git switch 'main'
git merge --squash 'upstream-pr/183'
git switch 'main'
git merge --ff-only 'upstream-pr/183'
git switch 'main'
git merge 'upstream-pr/183'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!183
No description provided.