Xeon E5-2670 v3 (Haswell, 16 GB): nothing starts without clwb; with it, menus navigate and loading reaches the world #68

Closed
opened 2026-11-26 03:49:04 +00:00 by github-bot · 0 comments
Owner

@⁠weslley560-bit on GitHub · 2026-11-24 00:10 UTC · original

This host has no clwb, so emulate_amd_only does not cover it and the title
stops 1.5 s in. With the instruction dealt with, everything up to the world runs
on a 12-year-old CPU.

Hardware: Windows 11 25H2, Intel Xeon E5-2670 v3 (Haswell-EP, 12C/24T), 16 GB,
AMD Radeon RX 6750 XT (RDNA2, 12 GB), Adrenalin 26.11.2, 1920x1080. The game
files are on a F HDD spinning disk.

Build: main at 1dd7afd, cargo build --profile diag -p victory --features diagnostics.

clwb stops it before anything runs

VIctory: unhandled exception 0xc000001d at victory-image-b99f876b74d4a77f.dll+0x4ecc84a
rax 0x177d001f rcx 0x177d0000 rdx 0x0 rbx 0x1
#0 +0x4ecc84a
#1 +0x247905f
#2 +0x19f4f54
#3 +0x580437e
#4 +0x43a4911
#5 +0x224070b
#6 +0x23cf00a
#7 +0x2215eca

The instruction at +0x4ecc84a is clwb (66 41 0f ae 31), inside a write-back
loop over a run of cache lines:
0x144ecc841 lea rax, [r9 + rax - 1]
0x144ecc846 and r9, 0xffffffffffffffc0
0x144ecc84a clwb byte ptr [r9]
0x144ecc84f add r9, 0x40
0x144ecc853 cmp r9, rax
0x144ecc856 jbe 0x144ecc84a

clwb came with Skylake-SP and Zen 2. Haswell, Broadwell, Skylake client,
Kaby Lake and Coffee Lake do not have it, so the opcode raises #UD. Nothing in
emulate_amd_only matches 66 [REX] 0f ae /6, so the exception goes back to
EXCEPTION_CONTINUE_SEARCH and the process ends.

Frames +0x224070b, +0x23cf00a and +0x2215eca are the ones ending #7's trace
and #23's, so this is the same startup path: a Raptor Lake has clwb and gets to
+0x4e8aa70, a Haswell does not and stops 26 KB earlier.

clwb and clflush leave the same bytes in memory; clwb only keeps the line
valid in cache afterwards. So the site can be rewritten and re-run rather than
emulated — 3e where the 66 was, /7 where the /6 was:
before clwb 66 41 0f ae 31
after clflush 3e 41 0f ae 39

tls.rs:55 already protects, writes and restores pages to patch title code, so
the handler does the same: recognise the ModRM, VirtualProtect the site,
patch it, FlushInstructionCache, restore the protection, continue. The site is
reached once and the loop then runs natively, so it costs no exception per line.
I have this locally and it works; happy to send it as a PR.

What runs with it

First-boot screens all of them, navigating with a pad
Frame rate 30.0 fps, 33.3 ms/frame on the RX 6750 XT; 5-15 fps on WARP
Intro video plays, sound works
Loading into the world completes
Device loss none on the GPU. On WARP the device is removed at the loading screen with DXGI_ERROR_DEVICE_RESET (0x887A0007)

That WARP result may be worth knowing for #29: on this AMD card the device holds
through every stage, the same as on the RX 9070 XT and unlike the NVIDIA reports
in #11, #16 and #27. It only fell over on the software adapter.

Where it ends

The world comes up black, as the README says, and a moment later the title
aborts itself:
VIctory: unhandled exception 0xc0000005 at victory-image-b99f876b74d4a77f.dll+0x23cf683 (write 0x0)
rax 0x0 rbx 0x0 rcx 0xd0024c348 rdx 0x1
#0 +0x23cf683
#1 +0x2215c35
#2 +0x2215eca

This is not a bad pointer in our code. +0x23cf683 is a deliberate abort:
0x1423cf66b cmp byte ptr [rsp + 0x34], 1
0x1423cf670 jne 0x1423cf683
...
0x1423cf683 mov dword ptr [0], 0x4d8bd421 ; magic, to force the fault
0x1423cf68e add rsp, 0x48
0x1423cf692 ret

A compare against 1 fails and the code writes a magic value through a null
pointer to raise the exception. 0x4d8bd421 appears once in the whole image.
Its caller is a guarded indirect call, which is a registered callback:
0x142215c27 mov rax, qword ptr [rip + 0x4fa071a]
0x142215c2e test rax, rax
0x142215c31 je 0x142215c35
0x142215c33 call rax
0x142215c35 mov dword ptr [0], 0 ; the NULL-callback path, not taken

So the callback fired and asserted from the inside. Whatever it checks was not
what it wanted at the first world frame.

This ran on 1dd7afd. 35b054e says copy-backs of shader-written ranges
"used to overwrite what the title's CPU wrote meanwhile, which crashed the
title", which sounds like exactly this. I will rebuild at 35b054e and report
whether it stays up, but I am filing the clwb part now because it is separate
and affects every CPU older than Skylake.

Not #23

I checked whether this was the 6.5 GB XMemVirtualAlloc failure, and it is not.
The page file is 25 GB with a peak use of 4.7 GB, so the commit limit was never
the wall here; there is no os error 1455 anywhere in the log. The title's own
report at the abort reads memory.load_percent 86 with
system.memory.free 2300596, so memory was tight but nothing refused an
allocation.

Smaller things

  • The crashes.log lands in %LOCALAPPDATA%\victory\data\7952987A\crashes.log,
    because run.rs does temp.with_file_name("crashes.log"). The README says the
    data folder. I looked in the wrong place first.
  • victory_gpu::copystat shows 431 to 728 page faults per frame during the
    menus. With the archives on a spinning disk, some of that may be the title
    streaming; I have not separated it from our copy path.

What I can test

This is the oldest CPU the project is likely to see in practice — anything
before Skylake-SP has the same problem — and I have it permanently, on RDNA2,
which is what the project is developed against. I can run any build you want and
report the next fault, and I can send the clwb change as a PR.

**@⁠weslley560-bit** on GitHub · 2026-11-24 00:10 UTC · [original](https://github.com/Marvisak/VIctory/issues/68) This host has no `clwb`, so `emulate_amd_only` does not cover it and the title stops 1.5 s in. With the instruction dealt with, everything up to the world runs on a 12-year-old CPU. **Hardware:** Windows 11 25H2, Intel Xeon E5-2670 v3 (Haswell-EP, 12C/24T), 16 GB, AMD Radeon RX 6750 XT (RDNA2, 12 GB), Adrenalin 26.11.2, 1920x1080. The game files are on a F HDD spinning disk. **Build:** `main` at `1dd7afd`, `cargo build --profile diag -p victory --features diagnostics`. ### `clwb` stops it before anything runs VIctory: unhandled exception 0xc000001d at victory-image-b99f876b74d4a77f.dll+0x4ecc84a rax 0x177d001f rcx 0x177d0000 rdx 0x0 rbx 0x1 #0 +0x4ecc84a #1 +0x247905f #2 +0x19f4f54 #3 +0x580437e #4 +0x43a4911 #5 +0x224070b #6 +0x23cf00a #7 +0x2215eca The instruction at `+0x4ecc84a` is `clwb` (`66 41 0f ae 31`), inside a write-back loop over a run of cache lines: 0x144ecc841 lea rax, [r9 + rax - 1] 0x144ecc846 and r9, 0xffffffffffffffc0 0x144ecc84a clwb byte ptr [r9] 0x144ecc84f add r9, 0x40 0x144ecc853 cmp r9, rax 0x144ecc856 jbe 0x144ecc84a `clwb` came with Skylake-SP and Zen 2. Haswell, Broadwell, Skylake client, Kaby Lake and Coffee Lake do not have it, so the opcode raises `#UD`. Nothing in `emulate_amd_only` matches `66 [REX] 0f ae /6`, so the exception goes back to `EXCEPTION_CONTINUE_SEARCH` and the process ends. Frames `+0x224070b`, `+0x23cf00a` and `+0x2215eca` are the ones ending #7's trace and #23's, so this is the same startup path: a Raptor Lake has `clwb` and gets to `+0x4e8aa70`, a Haswell does not and stops 26 KB earlier. `clwb` and `clflush` leave the same bytes in memory; `clwb` only keeps the line valid in cache afterwards. So the site can be rewritten and re-run rather than emulated — `3e` where the `66` was, `/7` where the `/6` was: before clwb 66 41 0f ae 31 after clflush 3e 41 0f ae 39 `tls.rs:55` already protects, writes and restores pages to patch title code, so the handler does the same: recognise the ModRM, `VirtualProtect` the site, patch it, `FlushInstructionCache`, restore the protection, continue. The site is reached once and the loop then runs natively, so it costs no exception per line. I have this locally and it works; happy to send it as a PR. ### What runs with it | | | |---|---| | First-boot screens | all of them, navigating with a pad | | Frame rate | 30.0 fps, 33.3 ms/frame on the RX 6750 XT; 5-15 fps on WARP | | Intro video | plays, sound works | | Loading into the world | completes | | Device loss | **none on the GPU.** On WARP the device is removed at the loading screen with `DXGI_ERROR_DEVICE_RESET` (`0x887A0007`) | That WARP result may be worth knowing for #29: on this AMD card the device holds through every stage, the same as on the RX 9070 XT and unlike the NVIDIA reports in #11, #16 and #27. It only fell over on the software adapter. ### Where it ends The world comes up black, as the README says, and a moment later the title aborts itself: VIctory: unhandled exception 0xc0000005 at victory-image-b99f876b74d4a77f.dll+0x23cf683 (write 0x0) rax 0x0 rbx 0x0 rcx 0xd0024c348 rdx 0x1 #0 +0x23cf683 #1 +0x2215c35 #2 +0x2215eca This is not a bad pointer in our code. `+0x23cf683` is a deliberate abort: 0x1423cf66b cmp byte ptr [rsp + 0x34], 1 0x1423cf670 jne 0x1423cf683 ... 0x1423cf683 mov dword ptr [0], 0x4d8bd421 ; magic, to force the fault 0x1423cf68e add rsp, 0x48 0x1423cf692 ret A compare against `1` fails and the code writes a magic value through a null pointer to raise the exception. `0x4d8bd421` appears once in the whole image. Its caller is a guarded indirect call, which is a registered callback: 0x142215c27 mov rax, qword ptr [rip + 0x4fa071a] 0x142215c2e test rax, rax 0x142215c31 je 0x142215c35 0x142215c33 call rax 0x142215c35 mov dword ptr [0], 0 ; the NULL-callback path, not taken So the callback fired and asserted from the inside. Whatever it checks was not what it wanted at the first world frame. **This ran on `1dd7afd`.** `35b054e` says copy-backs of shader-written ranges "used to overwrite what the title's CPU wrote meanwhile, which crashed the title", which sounds like exactly this. I will rebuild at `35b054e` and report whether it stays up, but I am filing the `clwb` part now because it is separate and affects every CPU older than Skylake. ### Not #23 I checked whether this was the 6.5 GB `XMemVirtualAlloc` failure, and it is not. The page file is 25 GB with a peak use of 4.7 GB, so the commit limit was never the wall here; there is no `os error 1455` anywhere in the log. The title's own report at the abort reads `memory.load_percent` 86 with `system.memory.free` 2300596, so memory was tight but nothing refused an allocation. ### Smaller things - The `crashes.log` lands in `%LOCALAPPDATA%\victory\data\7952987A\crashes.log`, because `run.rs` does `temp.with_file_name("crashes.log")`. The README says the data folder. I looked in the wrong place first. - `victory_gpu::copystat` shows 431 to 728 page faults per frame during the menus. With the archives on a spinning disk, some of that may be the title streaming; I have not separated it from our copy path. ### What I can test This is the oldest CPU the project is likely to see in practice — anything before Skylake-SP has the same problem — and I have it permanently, on RDNA2, which is what the project is developed against. I can run any build you want and report the next fault, and I can send the `clwb` change as a PR.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:49:04 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#68
No description provided.