VICTORY_MWAITX_SLEEP=1 on Intel hybrid: exceptions go to 0, frame time does not improve #1062

Open
opened 2026-11-26 03:56:53 +00:00 by github-bot · 3 comments
Owner

@⁠Hugo373 on GitHub · 2026-11-25 18:03 UTC · original

VICTORY_MWAITX_SLEEP=1 on Intel hybrid: the exceptions go, the frame does not improve

Summary

On a Core Ultra 7 255HX, PR #1029's switches do what they claim mechanically —
monitorx/mwaitx emulated exceptions fall from a peak of 298,753/s to 0 — but frame time
does not improve. Draw-matched over settled frames the difference is within noise, and it is
not faster.

Machine

CPU Intel Core Ultra 7 255HX, 20 cores / 20 threads (hybrid P+E)
GPU RTX 5080 Laptop 16 GB, driver 621.01
RAM 31.4 GB
OS Windows 11 26300
Tree ca8829f

Every other report on this scene is on AMD. This may be why nobody has hit it.

The exceptions

From the per-frame console CPU instructions line, monitorx per second:

run first sample peak
without the switches 3,494 298,753
with 0 0

226 samples without; not one non-zero sample with.

The frame

Settled world frames only, draw-matched to a common window, both runs in the same scene:

frames ms/frame draws/frame µs/draw
without 9 280 5,831 48.1
with 11 293 5,877 49.9

+3.8 % — slightly slower, inside run-to-run variation.

Components, same window:

without with
preparing 66 ms 66 ms
copies 51 ms 55 ms
on GPU 106 ms 96 ms
copying back 8 ms 10 ms

The freed thread is not the constraint here: on GPU is ~100 ms of a ~290 ms frame and
preparing does not move at all.

Reading

The switch replaces a spin on a fence value with a sleep. On this part the spin was not costing
anything measurable, and the sleep's wake-up latency is of the same order as what it saves. On
a hybrid P/E part there may also be a cost to waking on the wrong core class.

If the intent is to help Intel hosts, the exception count is what it fixes and that is worth
having — but it should not be presented as a frame-rate win for them.

Caveats

  • One machine, one configuration, two runs. Not reproduced.
  • Both runs are in the same scene but not the same camera position; draw-matching is the only
    control. Comparisons on raw means were off by a factor of two and are not trusted here.
  • CPU utilisation was not measured directly, so the 99.7 % → 0.3 % figure is not confirmed —
    only that the exceptions it targets are gone.

Reproduction

Reach the world, stand still, and compare two runs differing only in VICTORY_MWAITX_SLEEP /
VICTORY_MWAITX_PATCH. Read monitorx from the console CPU instructions line, and frame time
from the fps, ms/frame line against draws/frame.

**@⁠Hugo373** on GitHub · 2026-11-25 18:03 UTC · [original](https://github.com/fxceless/victory-fork/issues/1062) # `VICTORY_MWAITX_SLEEP=1` on Intel hybrid: the exceptions go, the frame does not improve ## Summary On a Core Ultra 7 255HX, PR #1029's switches do what they claim mechanically — `monitorx`/`mwaitx` emulated exceptions fall from a peak of **298,753/s to 0** — but frame time does not improve. Draw-matched over settled frames the difference is within noise, and it is not faster. ## Machine | | | |---|---| | CPU | Intel Core Ultra 7 255HX, 20 cores / 20 threads (hybrid P+E) | | GPU | RTX 5080 Laptop 16 GB, driver 621.01 | | RAM | 31.4 GB | | OS | Windows 11 26300 | | Tree | `ca8829f` | Every other report on this scene is on AMD. This may be why nobody has hit it. ## The exceptions From the per-frame `console CPU instructions` line, `monitorx` per second: | run | first sample | peak | |---|---:|---:| | without the switches | 3,494 | **298,753** | | with | **0** | **0** | 226 samples without; not one non-zero sample with. ## The frame Settled world frames only, draw-matched to a common window, both runs in the same scene: | | frames | ms/frame | draws/frame | µs/draw | |---|---:|---:|---:|---:| | without | 9 | 280 | 5,831 | **48.1** | | with | 11 | 293 | 5,877 | **49.9** | **+3.8 %** — slightly slower, inside run-to-run variation. Components, same window: | | without | with | |---|---:|---:| | preparing | 66 ms | 66 ms | | copies | 51 ms | 55 ms | | on GPU | 106 ms | 96 ms | | copying back | 8 ms | 10 ms | The freed thread is not the constraint here: `on GPU` is ~100 ms of a ~290 ms frame and `preparing` does not move at all. ## Reading The switch replaces a spin on a fence value with a sleep. On this part the spin was not costing anything measurable, and the sleep's wake-up latency is of the same order as what it saves. On a hybrid P/E part there may also be a cost to waking on the wrong core class. If the intent is to help Intel hosts, the exception count is what it fixes and that is worth having — but it should not be presented as a frame-rate win for them. ## Caveats - One machine, one configuration, two runs. Not reproduced. - Both runs are in the same scene but not the same camera position; draw-matching is the only control. Comparisons on raw means were off by a factor of two and are not trusted here. - CPU utilisation was not measured directly, so the 99.7 % → 0.3 % figure is not confirmed — only that the exceptions it targets are gone. ## Reproduction Reach the world, stand still, and compare two runs differing only in `VICTORY_MWAITX_SLEEP` / `VICTORY_MWAITX_PATCH`. Read `monitorx` from the `console CPU instructions` line, and frame time from the `fps, ms/frame` line against `draws/frame`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:56:53 +00:00
Author
Owner

@⁠alexis27yt on GitHub · 2026-11-25 19:03 UTC · original

Author of #1029 here. You're right on the main point, and the PR text already says the frame-rate effect is unmeasured. It was never meant as a frame-rate claim. On a 20-core part where ~100 ms of a ~290 ms frame is on the GPU and preparing doesn't move, one freed hardware thread isn't the constraint (fxceless saw the same on a 14700KF). The 99.7 % → 0.3 % figure is from the synthetic loop test, not from the game, as the PR says.

One thing in the data, though: 0 exceptions is what VICTORY_MWAITX_PATCH=1 gives, not VICTORY_MWAITX_SLEEP=1.

  • With SLEEP alone, every sleep still goes through one monitorx + one mwaitx exception (the 1 ms wake-ups during a long wait), so the line should show a few hundred a second. That matches Proudnoob4's SLEEP run above: 191-217/s, with "mwaitx slept: woken 16-17, timed out 45-49".
  • PATCH rewrites both instructions in place at their first exception, so they never trap again (0/s). But the loop then keeps spinning on pause: the hardware thread stays ~98 % busy, it just stops paying Windows' exception dispatch. When both are set, PATCH wins.

So "with the switches" most likely measured PATCH, the mode that does not free the thread. If you get the chance, a run with only VICTORY_MWAITX_SLEEP=1 would tell whether freeing the thread changes anything on this part. On a GPU-bound 20-core laptop I wouldn't expect much either way; the case where it could matter is a part with few cores and no E-cores (e.g. 6C/12T), which nobody has measured in game yet.

Agreed it shouldn't be read as a frame-rate win for Intel hosts unless a run shows one.

**@⁠alexis27yt** on GitHub · 2026-11-25 19:03 UTC · [original](https://github.com/fxceless/victory-fork/issues/1062#issuecomment-7171767380) Author of #1029 here. You're right on the main point, and the PR text already says the frame-rate effect is unmeasured. It was never meant as a frame-rate claim. On a 20-core part where ~100 ms of a ~290 ms frame is on the GPU and preparing doesn't move, one freed hardware thread isn't the constraint (fxceless saw the same on a 14700KF). The 99.7 % → 0.3 % figure is from the synthetic loop test, not from the game, as the PR says. One thing in the data, though: **0 exceptions is what `VICTORY_MWAITX_PATCH=1` gives, not `VICTORY_MWAITX_SLEEP=1`.** - With SLEEP alone, every sleep still goes through one `monitorx` + one `mwaitx` exception (the 1 ms wake-ups during a long wait), so the line should show a few hundred a second. That matches Proudnoob4's SLEEP run above: 191-217/s, with "mwaitx slept: woken 16-17, timed out 45-49". - PATCH rewrites both instructions in place at their first exception, so they never trap again (0/s). But the loop then **keeps spinning** on `pause`: the hardware thread stays ~98 % busy, it just stops paying Windows' exception dispatch. When both are set, PATCH wins. So "with the switches" most likely measured PATCH, the mode that does not free the thread. If you get the chance, a run with **only** `VICTORY_MWAITX_SLEEP=1` would tell whether freeing the thread changes anything on this part. On a GPU-bound 20-core laptop I wouldn't expect much either way; the case where it could matter is a part with few cores and no E-cores (e.g. 6C/12T), which nobody has measured in game yet. Agreed it shouldn't be read as a frame-rate win for Intel hosts unless a run shows one.
Author
Owner

@⁠Hugo373 on GitHub · 2026-11-25 19:14 UTC · original

Follow-up with the corrected measurement — you're right, my first run set both and measured PATCH.

What I got wrong

The run I reported set VICTORY_MWAITX_SLEEP=1 and VICTORY_MWAITX_PATCH=1. So the 0 exceptions was PATCH, and PATCH is the mode that keeps the thread spinning. The +3.8 % I quoted was the cost of stopping exception dispatch, not of freeing a thread. Withdrawn.

SLEEP alone

VICTORY_MWAITX_SLEEP=1     (PATCH not set)

monitorx / mwaitx per second, from the per-frame console CPU instructions line:

first sample mean peak
SLEEP alone 61 135 433

24 samples. That is the "few hundred a second" you predicted, and it is what Proudnoob4's run shows too. So the switch is doing the thread-freeing thing.

For contrast, same machine: PATCH gave a flat 0, and neither gave 59,163–298,753.

Frame time — and why I am not confident in it

Draw-matched over settled world frames, 19 frames each:

ms/frame draws/frame µs/draw
no mwaitx 341 3,927 86.9
SLEEP only 383 3,724 103.0
+15.1 %

I do not trust that number. The two runs are in different scenes — draw ranges 2,008–7,476 against 834–5,027, frame times 202–784 ms against 190–1,669 ms. The window I matched on is wide enough to hide a scene change, and I have been wrong about exactly this twice today: comparing two runs that stood in different places and reading the difference as a configuration effect. One of those errors is why my first report here was wrong.

So the honest answer to your question is: on this part, freeing the thread does not obviously help, and I cannot show it hurts either. Which is what you expected for a GPU-bound 20-core hybrid.

What would settle it

Two runs in the same scene, camera at rest, alternating — your A-B-A-B shape rather than my two separate runs. I can do that if it's worth the time; if you think a 6C/12T part is the only case where it matters, say so and I will leave it here rather than spend runs on a part that cannot show the effect.

Machine, for the record

Core Ultra 7 255HX (20C/20T hybrid), RTX 5080 Laptop, 31.4 GB, Windows 11 26300, tree ca8829f + #868. Gameplay frames at ~3,700–3,900 draws; on GPU ~36–56 ms of a ~350–500 ms frame, so it is not GPU-bound at the frame level the way the README's 4070 numbers are.

**@⁠Hugo373** on GitHub · 2026-11-25 19:14 UTC · [original](https://github.com/fxceless/victory-fork/issues/1062#issuecomment-7172006054) Follow-up with the corrected measurement — you're right, my first run set both and measured PATCH. ## What I got wrong The run I reported set `VICTORY_MWAITX_SLEEP=1` **and** `VICTORY_MWAITX_PATCH=1`. So the 0 exceptions was PATCH, and PATCH is the mode that keeps the thread spinning. The +3.8 % I quoted was the cost of stopping exception dispatch, not of freeing a thread. Withdrawn. ## SLEEP alone ``` VICTORY_MWAITX_SLEEP=1 (PATCH not set) ``` `monitorx` / `mwaitx` per second, from the per-frame `console CPU instructions` line: | | first sample | mean | peak | |---|---:|---:|---:| | SLEEP alone | 61 | **135** | **433** | 24 samples. That is the "few hundred a second" you predicted, and it is what Proudnoob4's run shows too. So the switch is doing the thread-freeing thing. For contrast, same machine: PATCH gave a flat **0**, and neither gave 59,163–298,753. ## Frame time — and why I am not confident in it Draw-matched over settled world frames, 19 frames each: | | ms/frame | draws/frame | µs/draw | |---|---:|---:|---:| | no mwaitx | 341 | 3,927 | 86.9 | | SLEEP only | 383 | 3,724 | 103.0 | | | | | **+15.1 %** | **I do not trust that number.** The two runs are in different scenes — draw ranges 2,008–7,476 against 834–5,027, frame times 202–784 ms against 190–1,669 ms. The window I matched on is wide enough to hide a scene change, and I have been wrong about exactly this twice today: comparing two runs that stood in different places and reading the difference as a configuration effect. One of those errors is why my first report here was wrong. So the honest answer to your question is: **on this part, freeing the thread does not obviously help, and I cannot show it hurts either.** Which is what you expected for a GPU-bound 20-core hybrid. ## What would settle it Two runs in the *same* scene, camera at rest, alternating — your A-B-A-B shape rather than my two separate runs. I can do that if it's worth the time; if you think a 6C/12T part is the only case where it matters, say so and I will leave it here rather than spend runs on a part that cannot show the effect. ## Machine, for the record Core Ultra 7 255HX (20C/20T hybrid), RTX 5080 Laptop, 31.4 GB, Windows 11 26300, tree `ca8829f` + #868. Gameplay frames at ~3,700–3,900 draws; `on GPU` ~36–56 ms of a ~350–500 ms frame, so it is not GPU-bound at the frame level the way the README's 4070 numbers are.
Author
Owner

@⁠alexis27yt on GitHub · 2026-11-25 19:22 UTC · original

I'd leave it here. Your SLEEP-only numbers (61 / 135 / 433 per second) show the switch does what it should mechanically, which is what this issue needed to settle. On a 20-thread hybrid, one freed hardware thread is unlikely to show in the frame whatever the run shape, so A-B-A-B runs there would spend time on a part that can't show the effect. And noted on your last line: at 36-56 ms on the GPU of a 350-500 ms frame, it's the CPU side, but with plenty of threads to spare.

The case that could show it is a 6C/12T part with no E-cores. I have one (i5-12400F), but I can't measure it in game: everything I've done so far is synthetic tests against the runtime, without the title's executable or its base files, so I can't run the game itself. That run will have to come from someone who has both on a part like that.

Until then, #1029 stands as an exception-count fix for Intel hosts, not a frame-rate one.

**@⁠alexis27yt** on GitHub · 2026-11-25 19:22 UTC · [original](https://github.com/fxceless/victory-fork/issues/1062#issuecomment-7172197000) I'd leave it here. Your SLEEP-only numbers (61 / 135 / 433 per second) show the switch does what it should mechanically, which is what this issue needed to settle. On a 20-thread hybrid, one freed hardware thread is unlikely to show in the frame whatever the run shape, so A-B-A-B runs there would spend time on a part that can't show the effect. And noted on your last line: at 36-56 ms on the GPU of a 350-500 ms frame, it's the CPU side, but with plenty of threads to spare. The case that could show it is a 6C/12T part with no E-cores. I have one (i5-12400F), but I can't measure it in game: everything I've done so far is synthetic tests against the runtime, without the title's executable or its base files, so I can't run the game itself. That run will have to come from someone who has both on a part like that. Until then, #1029 stands as an exception-count fix for Intel hosts, not a frame-rate one.
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/fxceless--victory-fork#1062
No description provided.