native_1440p: size UI pool for 16:9 targets and keep taller screens 16:9 #2524

Closed
Pietr wants to merge 1 commit from upstream-pr/2524 into main
Pietr commented 2026-11-29 13:51:20 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Pietr on 2026-11-29T13:51:20Z.


[pr-fix] Fixes #2339, #2391

What it changes

Fixes the immediate 0x80000003 (int3) crash at +0x247af2d (0x247AF25 UI pool slack check) in System Init, frame 0 on non-16:9 monitors and non-1440p output sizes:

  1. Compute UI_POOL (0x247AD4A) from the 16:9 UI target size (ui_target_size / ui_pool_bytes):
    • On 2560x1440 and wider outputs (3024x1440, 3032x1440, 3440x1440, 5120x1440), the title allocates 2 * 3840x2160 (0x3FC0000) + 2 * 2560x1440 (0x1E00000) = 0x5DC0000, so the pool is 0x5E00000 (94 MiB, 0x40000 unused <= 0x1FFFFF).
    • On 1920x1080 and 1920x1200, the title allocates 2 * 3840x2160 (0x3FC0000) + 2 * 1920x1080 (0x10E0000) = 0x50A0000.
      • Previously on 1920x1200 (#2339), sizing for 1920x1200 produced 0x5400000 (84 MiB), leaving 0x360000 unused (rax = 0x360000 > 0x1FFFFF at +0x247af2d).
      • Note: hardcoding 0x5E00000 (94 MiB) fixes ultrawide, but would still leave 0xD60000 > 0x1FFFFF unused and crash on 1920x1080 and 1920x1200.
      • Sizing via ui_target_size(output) gives 0x5200000 (82 MiB, 0x160000 unused <= 0x1FFFFF).
  2. Keep taller-than-16:9 monitors (w * 9 < h * 16, e.g. 1920x1200, 2560x1600) on 16:9 in for_monitor:
    • Picks (1920, 1080) on 1920x1200 and (2560, 1440) on 2560x1600 (explicit VICTORY_NATIVE_SIZE overrides still work).

How it was tested

  • GPU and profile: NVIDIA GeForce RTX 5060 Laptop GPU, 1920x1200 display, Series X, DLSS Quality + Frame Generation
  • Before: immediate 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x247af2d (rax 0x360000) right after the 84 MB 0x5400000 XMemVirtualAlloc in System Init, frame 0
  • After: starts cleanly past System Init
  • cargo test -p victory --locked passed: yes (79 unit tests + 1 cache_paths + 2 census, including updated the_output_follows_the_monitor_shape and new ui_pool_size_fits_within_assert_slack_for_all_output_shapes)
  • cargo clippy --no-deps -p victory --all-targets --locked -- -D warnings passed: yes
  • cargo xtask policy --staged passed: yes

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #2060, #2309, #2409 (all three hardcode a 94 MiB 0x5E00000 pool for every output size, which resolves ultrawide but does not cover 1920x1080 / 1920x1200 0x50A0000 allocations).
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5551364475 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2524). Originally posted by [Pietr](https://github.com/Pietr) on 2026-11-29T13:51:20Z. --- [pr-fix] Fixes #2339, #2391 ## What it changes Fixes the immediate `0x80000003` (`int3`) crash at `+0x247af2d` (`0x247AF25` UI pool slack check) in `System Init`, frame 0 on non-16:9 monitors and non-1440p output sizes: 1. **Compute `UI_POOL` (`0x247AD4A`) from the 16:9 UI target size (`ui_target_size` / `ui_pool_bytes`)**: - On `2560x1440` and wider outputs (`3024x1440`, `3032x1440`, `3440x1440`, `5120x1440`), the title allocates `2 * 3840x2160` (`0x3FC0000`) + `2 * 2560x1440` (`0x1E00000`) = `0x5DC0000`, so the pool is **`0x5E00000` (94 MiB, `0x40000` unused `<= 0x1FFFFF`)**. - On `1920x1080` and `1920x1200`, the title allocates `2 * 3840x2160` (`0x3FC0000`) + `2 * 1920x1080` (`0x10E0000`) = `0x50A0000`. - Previously on `1920x1200` (#2339), sizing for `1920x1200` produced `0x5400000` (84 MiB), leaving `0x360000` unused (`rax = 0x360000 > 0x1FFFFF` at `+0x247af2d`). - Note: hardcoding `0x5E00000` (94 MiB) fixes ultrawide, **but would still leave `0xD60000 > 0x1FFFFF` unused and crash on `1920x1080` and `1920x1200`**. - Sizing via `ui_target_size(output)` gives **`0x5200000` (82 MiB, `0x160000` unused `<= 0x1FFFFF`)**. 2. **Keep taller-than-16:9 monitors (`w * 9 < h * 16`, e.g. `1920x1200`, `2560x1600`) on 16:9 in `for_monitor`**: - Picks `(1920, 1080)` on `1920x1200` and `(2560, 1440)` on `2560x1600` (explicit `VICTORY_NATIVE_SIZE` overrides still work). ## How it was tested - **GPU and profile:** NVIDIA GeForce RTX 5060 Laptop GPU, 1920x1200 display, Series X, DLSS Quality + Frame Generation - **Before:** immediate `0x80000003` at `victory-image-b99f876b74d4a77f.dll+0x247af2d` (`rax 0x360000`) right after the 84 MB `0x5400000` `XMemVirtualAlloc` in `System Init`, frame 0 - **After:** starts cleanly past `System Init` - **`cargo test -p victory --locked` passed:** yes (79 unit tests + 1 `cache_paths` + 2 `census`, including updated `the_output_follows_the_monitor_shape` and new `ui_pool_size_fits_within_assert_slack_for_all_output_shapes`) - **`cargo clippy --no-deps -p victory --all-targets --locked -- -D warnings` passed:** yes - **`cargo xtask policy --staged` passed:** yes ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #2060, #2309, #2409 (all three hardcode a 94 MiB `0x5E00000` pool for every output size, which resolves ultrawide but does not cover `1920x1080` / `1920x1200` `0x50A0000` allocations).
Lyrnc commented 2026-11-29 21:41:21 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Lyrnc on 2026-11-29T21:41:21Z.


The crash logs from v2026.11.29.01 say the title picks its two UI targets by the output's width alone: the largest of 3840x2160, 2560x1440, 1920x1080 and 1600x900 that is no wider than the output, whatever the output's height. The rule here (16:9 inside the output, capped at 2560x1440) agrees with that on 1440-high outputs 2560 to 3839 wide, and at 1920x1200. On outputs lower than 1440 and wider than 16:9 it makes the pool too small, and main starts those today.

What the title made. v2026.11.29.01 sized the pool from the output, so what was left over (or what ran out) gives the targets. The two 3840x2160 legacy surfaces take 0x3FC0000; a 64 KiB tile is 128x128 RGBA8 pixels.

Output Pool on .01 Result Targets the title made
5120x1440 (#2292, #2521) 0x7C00000 (124 MiB) allocator assert 3840x2160 (needs 0x7F80000)
3440x1440 (#2055, #2766) 0x6A00000 0xC40000 left over 2560x1440 (0x5DC0000)
2752x1152 (#2060) 0x5A00000 allocator assert; starts with 0x5E00000 2560x1440
2560x1080 (#2287) 0x5800000 allocator assert 2560x1440
2288x960 (#2339, fenix849's log) 0x5200000 gets past the UI setup 1920x1080 (0x50A0000)
1920x1200 (#2339, this PR) 0x5400000 0x360000 left over 1920x1080
1696x1064 (#2624, #2521) 0x5000000 0x340000 left over 1600x900 (0x4CC0000)

2288x960 and 1696x1064 are what a 3440x1440 and a 2560x1600 desktop at 150 % scaling give on main (the process is not DPI aware yet).

The three rules side by side. These are worked out from the table above. Only the entries marked "measured" were run.

Case main (33e9fed2, 0x5E00000 always) this PR by width
2560x1080 desktop starts (measured with #2060's 0x5E00000, RomanFama592 on #2210) 0x5200000: smaller than the 0x5800000 that ran out 0x5E00000
2752x1152 desktop starts (measured, #2060) 0x5200000: too small 0x5E00000
3440x1440 at 150 % (2288x960) 0xD60000 left over: stops 0x4E00000: too small 0x5200000
1920x1200 desktop 0xD60000 left over: stops 1920x1080 output, 0x5200000: starts (your test) 0x5200000
2560x1600 desktop (2304x1440 on main) 0xD60000 left over (not measured at this size) 2560x1440 output: starts 0x5200000
2560x1600 at 150 % (1696x1064 on main) 0x1140000 left over: stops 2560x1440 output: starts 0x4E00000
VICTORY_NATIVE_SIZE=1920x1080 0xD60000 left over: stops 0x5200000: starts 0x5200000
5120x1440 desktop allocator assert (measured on f72cec77, see #2210) 0x5E00000: too small 0x8000000, not run

2288x960 and an asked 1920x1080 got past the UI setup on v2026.11.29.01. On main they should now stop at the left-over check. Nobody has reported that yet on .02 to .04.

Picking the targets by width fits every row:

/// The title's two UI targets for an output `width` pixels wide: the
/// largest of its 16:9 sizes no wider than the output, whatever its height.
fn ui_target_size(width: u32) -> (u32, u32) {
    const SIZES: [(u32, u32); 5] = [(3840, 2160), (2560, 1440), (1920, 1080), (1600, 900), (1280, 720)];
    SIZES.into_iter().find(|&(w, _)| width >= w).unwrap_or((1280, 720))
}

With that, the for_monitor change here is no longer needed for the start. Whether a 16:10 desktop gets 1920x1200 or 1920x1080 is then a picture choice. For outputs 3840 or more wide, #2210 and #2404 write the display mode to the output's size, and the title then makes targets of the output's size. If those go in, the pool there should follow them, not this rule. With the stock mode, the 3840x2160 step gives a pool that fits, but nobody has tested whether the title then plays at 5120x1440. Below 1600 wide (the 1280x720 step) is not measured.

There is a reference version in Lyrnc/VIctory-NVIDIA 0c10c823 (branch fix/startup-ui-pool), with a test that checks the pool against each measured row. It needs one fix: its doc table gives 94 MiB for the 5120x1440 row, but #2292's log shows 0x7C00000 (124 MiB). It has not been tested in game, and cargo test was not run on it. The branch's first commit, 057248a3 by cansevenhalim0-ui, made 2560x1440 the default output again, as #2526 does. Main kept the monitor's shape, so that commit is not part of this. I can open the width rule as its own PR if you would rather keep this one as it is.

AI use: Claude Code (Claude Opus 5.5) read the crash and play logs, worked out the pool sizes and wrote the commit and this comment.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7263072011 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2524#issuecomment-7263072011). Originally posted by [Lyrnc](https://github.com/Lyrnc) on 2026-11-29T21:41:21Z. --- The crash logs from v2026.11.29.01 say the title picks its two UI targets by the output's width alone: the largest of 3840x2160, 2560x1440, 1920x1080 and 1600x900 that is no wider than the output, whatever the output's height. The rule here (16:9 inside the output, capped at 2560x1440) agrees with that on 1440-high outputs 2560 to 3839 wide, and at 1920x1200. On outputs lower than 1440 and wider than 16:9 it makes the pool too small, and main starts those today. What the title made. v2026.11.29.01 sized the pool from the output, so what was left over (or what ran out) gives the targets. The two 3840x2160 legacy surfaces take 0x3FC0000; a 64 KiB tile is 128x128 RGBA8 pixels. | Output | Pool on .01 | Result | Targets the title made | |---|---|---|---| | 5120x1440 (#2292, #2521) | 0x7C00000 (124 MiB) | allocator assert | 3840x2160 (needs 0x7F80000) | | 3440x1440 (#2055, #2766) | 0x6A00000 | 0xC40000 left over | 2560x1440 (0x5DC0000) | | 2752x1152 (#2060) | 0x5A00000 | allocator assert; starts with 0x5E00000 | 2560x1440 | | 2560x1080 (#2287) | 0x5800000 | allocator assert | 2560x1440 | | 2288x960 (#2339, fenix849's log) | 0x5200000 | gets past the UI setup | 1920x1080 (0x50A0000) | | 1920x1200 (#2339, this PR) | 0x5400000 | 0x360000 left over | 1920x1080 | | 1696x1064 (#2624, #2521) | 0x5000000 | 0x340000 left over | 1600x900 (0x4CC0000) | 2288x960 and 1696x1064 are what a 3440x1440 and a 2560x1600 desktop at 150 % scaling give on main (the process is not DPI aware yet). The three rules side by side. These are worked out from the table above. Only the entries marked "measured" were run. | Case | main (33e9fed2, 0x5E00000 always) | this PR | by width | |---|---|---|---| | 2560x1080 desktop | starts (measured with #2060's 0x5E00000, RomanFama592 on #2210) | 0x5200000: smaller than the 0x5800000 that ran out | 0x5E00000 | | 2752x1152 desktop | starts (measured, #2060) | 0x5200000: too small | 0x5E00000 | | 3440x1440 at 150 % (2288x960) | 0xD60000 left over: stops | 0x4E00000: too small | 0x5200000 | | 1920x1200 desktop | 0xD60000 left over: stops | 1920x1080 output, 0x5200000: starts (your test) | 0x5200000 | | 2560x1600 desktop (2304x1440 on main) | 0xD60000 left over (not measured at this size) | 2560x1440 output: starts | 0x5200000 | | 2560x1600 at 150 % (1696x1064 on main) | 0x1140000 left over: stops | 2560x1440 output: starts | 0x4E00000 | | `VICTORY_NATIVE_SIZE=1920x1080` | 0xD60000 left over: stops | 0x5200000: starts | 0x5200000 | | 5120x1440 desktop | allocator assert (measured on f72cec77, see #2210) | 0x5E00000: too small | 0x8000000, not run | 2288x960 and an asked 1920x1080 got past the UI setup on v2026.11.29.01. On main they should now stop at the left-over check. Nobody has reported that yet on .02 to .04. Picking the targets by width fits every row: ```rust /// The title's two UI targets for an output `width` pixels wide: the /// largest of its 16:9 sizes no wider than the output, whatever its height. fn ui_target_size(width: u32) -> (u32, u32) { const SIZES: [(u32, u32); 5] = [(3840, 2160), (2560, 1440), (1920, 1080), (1600, 900), (1280, 720)]; SIZES.into_iter().find(|&(w, _)| width >= w).unwrap_or((1280, 720)) } ``` With that, the `for_monitor` change here is no longer needed for the start. Whether a 16:10 desktop gets 1920x1200 or 1920x1080 is then a picture choice. For outputs 3840 or more wide, #2210 and #2404 write the display mode to the output's size, and the title then makes targets of the output's size. If those go in, the pool there should follow them, not this rule. With the stock mode, the 3840x2160 step gives a pool that fits, but nobody has tested whether the title then plays at 5120x1440. Below 1600 wide (the 1280x720 step) is not measured. There is a reference version in Lyrnc/VIctory-NVIDIA 0c10c823 (branch `fix/startup-ui-pool`), with a test that checks the pool against each measured row. It needs one fix: its doc table gives 94 MiB for the 5120x1440 row, but #2292's log shows 0x7C00000 (124 MiB). It has not been tested in game, and `cargo test` was not run on it. The branch's first commit, 057248a3 by cansevenhalim0-ui, made 2560x1440 the default output again, as #2526 does. Main kept the monitor's shape, so that commit is not part of this. I can open the width rule as its own PR if you would rather keep this one as it is. AI use: Claude Code (Claude Opus 5.5) read the crash and play logs, worked out the pool sizes and wrote the commit and this comment. 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Pull request closed

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
trustno1-coder/VIctory-NVIDIA!2524
No description provided.