Skip to content

Crash reports: name the host's CPU and Windows build - #213

Merged
Marvisak merged 1 commit into
Marvisak:mainfrom
Dufftwt:fix/crash-log-names-host
Nov 25, 2026
Merged

Marvisak merged 1 commit into
Marvisak:mainfrom
Dufftwt:fix/crash-log-names-host

Conversation

@Dufftwt

@Dufftwt Dufftwt commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

What's wrong

Two facts about the host decide whether many crashes are bugs at all, and a crash report contains neither:

  • The CPU. The console's CPU is a Zen 2, and title code uses AMD-only instructions that Intel CPUs lack (clwb before Ice Lake, clzero, monitorx, SSE4a…). The loader emulates the ones it knows. Whether an 0xc000001d is a known case, an unknown instruction or something else depends entirely on the CPU.
  • The Windows build. It decides which D3D12 runtime and shader model are available (Windows 10's in-box runtime stops at SM 6.5, Windows 10: the host device stops at shader model 6.5 (needs the D3D12 Agility SDK) #84).

Neither is in the console output or in crashes.log. So every report needs a follow-up question, or reporters type their specs by hand, and some guess wrong (#103 guessed at the instruction without knowing it depended on the CPU generation).

What the fix does

In crash.rs:

  • When the crash log is set up (log_crashes_to, at title start), the loader reads two values once:
    • the CPU's brand string, from cpuid leaves 0x80000002–0x80000004;
    • the real Windows version, from RtlGetVersion. GetVersionEx would return whatever the executable's manifest declares instead.
  • Unhandled exceptions, panics and host GPU failures (log_crash) now end with one more line, host: <CPU>, Windows <major.minor.build>. It comes just before the title's last debug output, which those reports already end with.

At crash time nothing is queried: the line was formatted at startup. First-chance reports don't change.

victory-loader gets two more windows-sys features for RtlGetVersion and its structure: Wdk_System_SystemServices and Win32_System_SystemInformation. It already uses Wdk_System_Threading.

How it behaves after the fix

VIctory: unhandled exception 0xc000001d at victory-image-….dll+0x4ecc84a
  rax … rbx …
  …
  #0  victory-image-….dll+0x4ecc84a
  …
  host: Intel(R) Core(TM) i3-10100F CPU @ 3.60GHz, Windows 10.0.19045

The same line goes to crashes.log, so a pasted report or log file says by itself what machine it came from.

Tests

The new test the_host_line_names_the_cpu_and_windows checks that the line has the form host: <non-empty CPU name>, Windows <a>.<b>.<c> with a major version of 10 or more.

I ran cargo test --workspace on GitHub's windows-latest with Rust 1.98.1 from rust-toolchain.toml:

  • This PR: everything passes. victory-loader has 19 passed, the other crates have 0 failed. On that runner the new test's line is host: AMD EPYC 9V74 80-Core Processor, Windows 10.0.26100.
  • The end of an unhandled-exception report: a throwaway test, used only on my CI branch, reports a synthetic illegal instruction. On main the report ends with the stack:
    VIctory: unhandled exception 0xc000001d at victory_loader-….exe+0xf9cf0
      #0  victory_loader-….exe+0xf9cf0
    
    With this PR:
    VIctory: unhandled exception 0xc000001d at victory_loader-….exe+0x102a30
      #0  victory_loader-….exe+0x102a30
      host: AMD EPYC 9V74 80-Core Processor, Windows 10.0.26100
    
  • I ran with --test-threads=1. With 4 threads, the shader crate's GPU tests sometimes crash on that runner (STATUS_ACCESS_VIOLATION), on unmodified main as well.

Not tested: a crash in the title.

Related: #7, #84, #102, #103, #106. It touches different lines of crash.rs than #198 and #204 and merges cleanly with both.

Whether a crash is a missing instruction depends on the CPU (Intel CPUs
lack some of the console's AMD-only instructions), and which D3D12
runtime there is depends on the Windows build, yet a report carries
neither, so every report has needed a follow-up question.

Unhandled exceptions, panics and host GPU failures now end with a
"host:" line naming the CPU's brand string and the real Windows
version (RtlGetVersion), read once when the crash log is set up.
muhammed-aksoy pushed a commit to muhammed-aksoy/VIctory that referenced this pull request Nov 24, 2026
edsuuu referenced this pull request in edsuuu/VI-BR-PORT Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeremygold02

Copy link
Copy Markdown
Contributor

Thanks @Dufftwt for making the host line in crash reports identify the CPU and Windows build.

I tested commit 7f00a62a4b861f0a051cc600470ce0570ab43c6f with:

cargo test --locked -p victory-loader --lib the_host_line_names_the_cpu_and_windows -- --test-threads=1

The targeted test passed (1 passed, 0 failed; 18 filtered). the_host_line_names_the_cpu_and_windows verifies the host: line framing and newline, requires a nonempty CPU name without surrounding whitespace or NULs, and checks for three numeric Windows version components with a major version of at least 10.

This validates the formatted host-information line. It does not generate or inspect a full crash report from an actual exception.

@mercuryVM mercuryVM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested 7f00a62 on Windows 11, RTX 5070, MSVC: the workspace passes (196 outside victory-shader).

  • Safety screen: the Cargo.toml change only adds two windows-sys features (Wdk_System_SystemServices, Win32_System_SystemInformation) to the existing dependency, with no new crate.
  • RtlGetVersion is the right call, since GetVersionEx is manifest-shimmed. The CPUID brand string reads leaves 0x80000002–4 after checking the max extended leaf.
  • Computing both at log_crashes_to time, so the crash path only formats a stored string, is the right choice for a crash handler.
  • Worth knowing: the CPU model and Windows build end up in crashes.log, which users paste into public issues. Both are low-sensitivity and exactly what reports need, but the README's crash-log section could mention it.

No issues found.

AI-assisted (Claude Code).

mercuryVM added a commit to mercuryVM/VIctory that referenced this pull request Nov 24, 2026
…d Windows build

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yourmomsbasement pushed a commit to yourmomsbasement/VIctory_Dev that referenced this pull request Nov 24, 2026
Merges Marvisak#188 Marvisak#213 Marvisak#214 Marvisak#219 Marvisak#221 Marvisak#311 Marvisak#324 Marvisak#363 Marvisak#406 Marvisak#454 Marvisak#529 Marvisak#560 Marvisak#708 Marvisak#937
Marvisak#941 Marvisak#963 Marvisak#1111 Marvisak#1159 Marvisak#1304 Marvisak#1306 onto main (ffe310e), each head unchanged,
no conflicts.

One change of mine: the long-format import descriptor code Marvisak#963 adds nests
`if size == 0` in an `if let`, which clippy::collapsible_if rejects under
-D warnings; it is now one `if let ... && size == 0` (clippy --fix, no
change of behaviour).

cargo clippy --workspace --all-targets --locked -- -D warnings, with and
without --all-features, is clean and cargo test --workspace --locked passes
(388 passed, 7 ignored; main has 342 passed, 6 ignored).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
@Marvisak
Marvisak merged commit 71ac890 into Marvisak:main Nov 25, 2026

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Merge candidate. This adds a host: <CPU brand string>, Windows <major.minor.build> line to crash reports, panics and log_crash output in crates/victory-loader/src/crash.rs, computed once in log_crashes_to from cpuid leaves 0x80000002-4 and RtlGetVersion, so nothing is queried at crash time. The Cargo.toml change only enables two more features of windows-sys, which the loader already uses; no new dependency. Small note: first-chance breakpoint reports (VICTORY_CRASH_BREAKPOINTS=1) go through the same path and will carry the line too, contrary to the PR body; harmless.

CI: no check runs on the head commit.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants