Fix the start-up crash on ultrawide monitors: size the UI pool for the 16:9 UI targets the title makes #2766

Open
github-bot wants to merge 4 commits from github-bot/gh-2766 into main AGit
Owner

@⁠mehmetraif on GitHub · 2026-11-29 17:03 UTC · original
mehmetraif:main → main · +51 −9 · 1 files · 4 commits · open

Fix the start-up crash on ultrawide monitors: size the UI pool for the 16:9 UI targets the title makes

Summary

Since v2026.11.29.01 the output size follows the main monitor's shape (16576c03, 8e81b84c). On a 21:9 monitor that gives a 3440x1440 output, and native_1440p::prepare sizes the UI pool for two 3440x1440 UI targets. The title still makes two 2560x1440 targets (a 16:9 UI at the output's height). That leaves 0xC40000 bytes of the pool unused. The title's own check allows at most 0x1FFFFF left over (0x247AF25), so it hits int3 at 0x247AF2D in System Init, before frame 0. The game closes about 2 s after launch, every time.

This PR sizes the pool from the UI targets the title actually makes (ui_target_size): on an output wider than 16:9 they are 16:9 at the output's height. 16:9 outputs get the same pool as before (0x5E00000).

Symptom

  • v2026.11.29.01 closes about 2 s after start, every launch. v2026.11.28.03 (the previous release) works on the same machine, with the same files and settings.
  • crashes.log: 6 crashes, all at the same place:
    VIctory: unhandled exception 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x247af2d (breakpoint ...)
      rax 0xc40000 ...
    
  • The title's crash context: Game State: System Init, Frame: 0.
  • The play log of a crashing run maps the image from cache\images\native-3440x1440-upscaler-performance-sdr\. A working run on the previous release uses native-1440p-upscaler-performance-sdr\ and logs display mode reported to the title width=2560 height=1440.

Environment

Laptop ASUS ROG Zephyrus G14 (GU405AR)
CPU Intel Core Ultra 9 386H
GPU NVIDIA GeForce RTX 5070 Ti Laptop GPU, 12 GB, driver 621.40 (hybrid with Intel Graphics)
RAM 32 GB
OS Windows 11 Pro 10.0.26300
Main monitor LG ultrawide 3440x1440 @ 239 Hz on the NVIDIA GPU (the laptop's 2880x1800 panel is the second screen)
Settings Series X, DLSS performance, DLSS frame generation 6x, VICTORY_MENU_RES=1080to1440
Release v2026.11.29.01 crashes; v2026.11.28.03 works

Root cause

apps/victory/src/native_1440p.rs in prepare(), at v2026.11.29.01:

let pool_size = u32::try_from(
    (ui_surface_bytes(LEGACY_UI_WIDTH, LEGACY_UI_HEIGHT)? * 2 + ui_surface_bytes(width(), height())? * 2)
        .next_multiple_of(2 << 20),
)?;

width()/height() is the output size. Since 16576c03 that is 3440x1440 on a 21:9 main monitor. The UI targets the title makes do not follow it.

Evidence

  1. The crash site is the left-over check. The UI setup computes what is left of the pool into rax, then runs cmp rax, 0x1FFFFF at 0x247AF25, a jbe, and int3 at 0x247AF2D. This is the check the comment in prepare() already describes. rax at the crash is 0xC40000 in all 6 crashes.

  2. The patched pool is the 3440-wide one. In the cached image native-3440x1440-upscaler-performance-sdr\victory-image-b99f876b74d4a77f.dll, the UI pool's mov ecx at 0x247AD4A holds 0x06A00000.

  3. The numbers match exactly. 64 KiB-tiled RGBA8 surfaces are made of 128x128 tiles:

    Surface Tiles Bytes
    3840x2160 legacy UI surface 30 x 17 0x1FE0000
    2560x1440 UI target 20 x 12 0xF00000
    3440x1440 UI target 27 x 12 0x1440000
    • Pool as patched: 2 x 0x1FE0000 + 2 x 0x1440000 = 0x6840000, rounded up to 2 MiB = 0x6A00000 (matches 2).
    • Used by the title, with 2560x1440 targets: 2 x 0x1FE0000 + 2 x 0xF00000 = 0x5DC0000.
    • Left over: 0x6A00000 - 0x5DC0000 = 0xC40000. This is exactly rax at the crash (matches 1), and more than 0x1FFFFF, so the check fails.

So the title makes 16:9 UI targets at the output's height (2560x1440 for 3440x1440), and the pool must be sized for those.

The fix

apps/victory/src/native_1440p.rs:

  • ui_target_size((w, h)): the size of the title's UI targets. On an output wider than 16:9 it is (h * 16 / 9, h); otherwise (w, h) as before.
  • ui_pool_bytes(output): two legacy surfaces plus two UI targets of ui_target_size(output), rounded up to 2 MiB. prepare() uses it.
  • New test the_ui_pool_fits_the_ui_targets_the_title_makes. It pins the 16:9 pool (0x5E00000, unchanged) and the 21:9 numbers above (0x6A00000 asserted, 0xC40000 left over). It also checks that the new 21:9 pool leaves no more than 0x1FFFFF over the title's use.

16:9 outputs are unchanged: ui_target_size((2560, 1440)) == (2560, 1440) and the pool stays 0x5E00000.

Testing

  • cargo test -p victory -- native_1440p: 6 passed, 0 failed. This includes the new test and the existing the_output_follows_the_monitor_shape.
  • cargo build --release --locked -p victory builds, on toolchain 1.98.1 from rust-toolchain.toml.
  • Tested in game on the machine above (ASUS ROG Zephyrus G14, RTX 5070 Ti Laptop, LG 3440x1440 main monitor): it works. The test used the release build of v2026.11.29.01 (829188e9) with this patch. VICTORY_NATIVE_SIZE was not set, so the monitor's shape picked 3440x1440. The settings were the same as in the crashing runs.
    • The image maps from native-3440x1440-upscaler-performance-sdr\, the same profile that crashed before.
    • The UI pool's mov ecx at 0x247AD4A now holds 0x05E00000 (it was 0x06A00000).
    • It gets past System Init: first frame presented ms=4808. It played into the game for about 3.5 minutes at 60–100 fps (DLSS performance, frame generation on).
    • It closed normally when the window was closed (window closed: suspending the title … ending the title). There is no new entry in crashes.log.
    • On the same machine, the unpatched v2026.11.29.01 crashed on every start (6 of 6).

Workaround for the current release

Add this line to %LOCALAPPDATA%\victory\victory-settings.txt:

VICTORY_NATIVE_SIZE=2560x1440

The F1 menu keeps every VICTORY_* line when it saves. With this line, v2026.11.29.01 takes the 16:9 path that 16:9 monitors use.

Open questions

  • 16:10 and narrower outputs (for example 2304x1440 from a 2560x1600 monitor) are left as before: UI targets at the output's size. No crash data was available for them. If the title fits its 16:9 UI inside narrower outputs too, the targets would be 2304x1296 and the pool would be about 2.25 MiB too large, which would hit the same assert. A 16:10 log would settle it.
  • The presented window is still 2560x1440 on 21:9. The fixed run logs presenting to a window width=2560 height=1440, as v2026.11.28.03 does on this monitor. So the start-up crash is fixed, but whether the 21:9 picture fills the monitor may need its own follow-up. This PR does not change it.
  • Not from this PR: during the first-start shader build, the fixed run logged 570 host pipelines failed (all 0x8007000e, mostly mesh pipelines, 16:44:25–16:46:29). The process had about 27 GB private, 44 GB committed. This PR only changes one constant in the title's UI pool, so it does not touch pipeline creation.

Logs

ultrawide-crash-logs.zip
All paths have the Windows user and the game folder name redacted.

  • crashes.log: all 6 crashes, same site and rax.
  • crash-run-v2026.11.29.01-3440x1440.log: a full play log of a crashing run.
  • title-crash-context-v2026.11.29.01.log: the title's crash context (System Init, frame 0).
  • good-run-previous-build-2560x1440-first-150-lines.log: the start of a working run on v2026.11.28.03, for comparison.
  • fixed-build-run-3440x1440-excerpt.log: the run with this PR on the 3440x1440 monitor. It has the first 260 lines (through the first frame), every fps line and the exit lines.

Credits

Reported and tested by @⁠mehmetraif on an ASUS ROG Zephyrus G14 with a 21:9 monitor. Analysis and patch made with Claude Code.

🤖 Generated with Claude Code

**@⁠mehmetraif** on GitHub · 2026-11-29 17:03 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2766) `mehmetraif:main` → `main` · +51 −9 · 1 files · 4 commits · open # Fix the start-up crash on ultrawide monitors: size the UI pool for the 16:9 UI targets the title makes ## Summary Since v2026.11.29.01 the output size follows the main monitor's shape (16576c03, 8e81b84c). On a 21:9 monitor that gives a 3440x1440 output, and `native_1440p::prepare` sizes the UI pool for two **3440x1440** UI targets. The title still makes two **2560x1440** targets (a 16:9 UI at the output's height). That leaves `0xC40000` bytes of the pool unused. The title's own check allows at most `0x1FFFFF` left over (`0x247AF25`), so it hits `int3` at `0x247AF2D` in System Init, before frame 0. The game closes about 2 s after launch, every time. This PR sizes the pool from the UI targets the title actually makes (`ui_target_size`): on an output wider than 16:9 they are 16:9 at the output's height. 16:9 outputs get the same pool as before (`0x5E00000`). ## Symptom - v2026.11.29.01 closes about 2 s after start, every launch. v2026.11.28.03 (the previous release) works on the same machine, with the same files and settings. - `crashes.log`: 6 crashes, all at the same place: ``` VIctory: unhandled exception 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x247af2d (breakpoint ...) rax 0xc40000 ... ``` - The title's crash context: `Game State: System Init`, `Frame: 0`. - The play log of a crashing run maps the image from `cache\images\native-3440x1440-upscaler-performance-sdr\`. A working run on the previous release uses `native-1440p-upscaler-performance-sdr\` and logs `display mode reported to the title width=2560 height=1440`. ## Environment | | | |---|---| | Laptop | ASUS ROG Zephyrus G14 (GU405AR) | | CPU | Intel Core Ultra 9 386H | | GPU | NVIDIA GeForce RTX 5070 Ti Laptop GPU, 12 GB, driver 621.40 (hybrid with Intel Graphics) | | RAM | 32 GB | | OS | Windows 11 Pro 10.0.26300 | | Main monitor | LG ultrawide **3440x1440** @ 239 Hz on the NVIDIA GPU (the laptop's 2880x1800 panel is the second screen) | | Settings | Series X, DLSS performance, DLSS frame generation 6x, `VICTORY_MENU_RES=1080to1440` | | Release | v2026.11.29.01 crashes; v2026.11.28.03 works | ## Root cause `apps/victory/src/native_1440p.rs` in `prepare()`, at v2026.11.29.01: ```rust let pool_size = u32::try_from( (ui_surface_bytes(LEGACY_UI_WIDTH, LEGACY_UI_HEIGHT)? * 2 + ui_surface_bytes(width(), height())? * 2) .next_multiple_of(2 << 20), )?; ``` `width()`/`height()` is the output size. Since 16576c03 that is 3440x1440 on a 21:9 main monitor. The UI targets the title makes do not follow it. ### Evidence 1. **The crash site is the left-over check.** The UI setup computes what is left of the pool into `rax`, then runs `cmp rax, 0x1FFFFF` at `0x247AF25`, a `jbe`, and `int3` at `0x247AF2D`. This is the check the comment in `prepare()` already describes. `rax` at the crash is **`0xC40000`** in all 6 crashes. 2. **The patched pool is the 3440-wide one.** In the cached image `native-3440x1440-upscaler-performance-sdr\victory-image-b99f876b74d4a77f.dll`, the UI pool's `mov ecx` at `0x247AD4A` holds **`0x06A00000`**. 3. **The numbers match exactly.** 64 KiB-tiled RGBA8 surfaces are made of 128x128 tiles: | Surface | Tiles | Bytes | |---|---|---| | 3840x2160 legacy UI surface | 30 x 17 | `0x1FE0000` | | 2560x1440 UI target | 20 x 12 | `0xF00000` | | 3440x1440 UI target | 27 x 12 | `0x1440000` | - Pool as patched: 2 x `0x1FE0000` + 2 x `0x1440000` = `0x6840000`, rounded up to 2 MiB = **`0x6A00000`** (matches 2). - Used by the title, with 2560x1440 targets: 2 x `0x1FE0000` + 2 x `0xF00000` = **`0x5DC0000`**. - Left over: `0x6A00000` - `0x5DC0000` = **`0xC40000`**. This is exactly `rax` at the crash (matches 1), and more than `0x1FFFFF`, so the check fails. So the title makes 16:9 UI targets at the output's height (2560x1440 for 3440x1440), and the pool must be sized for those. ## The fix `apps/victory/src/native_1440p.rs`: - `ui_target_size((w, h))`: the size of the title's UI targets. On an output wider than 16:9 it is `(h * 16 / 9, h)`; otherwise `(w, h)` as before. - `ui_pool_bytes(output)`: two legacy surfaces plus two UI targets of `ui_target_size(output)`, rounded up to 2 MiB. `prepare()` uses it. - New test `the_ui_pool_fits_the_ui_targets_the_title_makes`. It pins the 16:9 pool (`0x5E00000`, unchanged) and the 21:9 numbers above (`0x6A00000` asserted, `0xC40000` left over). It also checks that the new 21:9 pool leaves no more than `0x1FFFFF` over the title's use. 16:9 outputs are unchanged: `ui_target_size((2560, 1440)) == (2560, 1440)` and the pool stays `0x5E00000`. ## Testing - [x] `cargo test -p victory -- native_1440p`: **6 passed, 0 failed**. This includes the new test and the existing `the_output_follows_the_monitor_shape`. - [x] `cargo build --release --locked -p victory` builds, on toolchain 1.98.1 from `rust-toolchain.toml`. - [x] **Tested in game on the machine above (ASUS ROG Zephyrus G14, RTX 5070 Ti Laptop, LG 3440x1440 main monitor): it works.** The test used the release build of v2026.11.29.01 (`829188e9`) with this patch. `VICTORY_NATIVE_SIZE` was not set, so the monitor's shape picked 3440x1440. The settings were the same as in the crashing runs. - The image maps from `native-3440x1440-upscaler-performance-sdr\`, the same profile that crashed before. - The UI pool's `mov ecx` at `0x247AD4A` now holds **`0x05E00000`** (it was `0x06A00000`). - It gets past System Init: `first frame presented ms=4808`. It played into the game for about 3.5 minutes at 60–100 fps (DLSS performance, frame generation on). - It closed normally when the window was closed (`window closed: suspending the title` … `ending the title`). There is no new entry in `crashes.log`. - On the same machine, the unpatched v2026.11.29.01 crashed on every start (6 of 6). ## Workaround for the current release Add this line to `%LOCALAPPDATA%\victory\victory-settings.txt`: ``` VICTORY_NATIVE_SIZE=2560x1440 ``` The F1 menu keeps every `VICTORY_*` line when it saves. With this line, v2026.11.29.01 takes the 16:9 path that 16:9 monitors use. ## Open questions - **16:10 and narrower outputs** (for example 2304x1440 from a 2560x1600 monitor) are left as before: UI targets at the output's size. No crash data was available for them. If the title fits its 16:9 UI inside narrower outputs too, the targets would be 2304x1296 and the pool would be about 2.25 MiB too large, which would hit the same assert. A 16:10 log would settle it. - **The presented window is still 2560x1440 on 21:9.** The fixed run logs `presenting to a window width=2560 height=1440`, as v2026.11.28.03 does on this monitor. So the start-up crash is fixed, but whether the 21:9 picture fills the monitor may need its own follow-up. This PR does not change it. - **Not from this PR:** during the first-start shader build, the fixed run logged `570 host pipelines failed` (all `0x8007000e`, mostly mesh pipelines, 16:44:25–16:46:29). The process had about 27 GB private, 44 GB committed. This PR only changes one constant in the title's UI pool, so it does not touch pipeline creation. ## Logs [ultrawide-crash-logs.zip](https://github.com/user-attachments/files/35577682/ultrawide-crash-logs.zip) All paths have the Windows user and the game folder name redacted. - `crashes.log`: all 6 crashes, same site and `rax`. - `crash-run-v2026.11.29.01-3440x1440.log`: a full play log of a crashing run. - `title-crash-context-v2026.11.29.01.log`: the title's crash context (System Init, frame 0). - `good-run-previous-build-2560x1440-first-150-lines.log`: the start of a working run on v2026.11.28.03, for comparison. - `fixed-build-run-3440x1440-excerpt.log`: the run with this PR on the 3440x1440 monitor. It has the first 260 lines (through the first frame), every fps line and the exit lines. ## Credits Reported and tested by @⁠mehmetraif on an ASUS ROG Zephyrus G14 with a 21:9 monitor. Analysis and patch made with Claude Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 17:05:54 +00:00
This pull request has changes conflicting with the target branch.
  • apps/victory/src/native_1440p.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2766'
git switch 'github-bot/gh-2766'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2766'
git switch 'github-bot/gh-2766'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2766'
git switch 'main'
git merge --squash 'github-bot/gh-2766'
git switch 'main'
git merge --ff-only 'github-bot/gh-2766'
git switch 'main'
git merge 'github-bot/gh-2766'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/trustno1-coder--VIctory-NVIDIA!2766
No description provided.