PE loader: render_resolution renders RAGE titles at the screen's aspect #730

Open
MrCheese5 wants to merge 5 commits from upstream-pr/735 into main
MrCheese5 commented 2026-11-24 04:17:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MrCheese5 on 2026-11-24T04:17:38Z.


Stacked on #555, #732, #733 and #734; only the top commit belongs here. It uses present::screen_size() from #734.

On a 21:9 screen the newer retail game still rendered 16:9, so it was pillarboxed. RAGE titles take their back buffer size from a mode table in read-only data: {w, h, 60, 1} × 5, the largest 3840x2160. With render_resolution ("native" by default, so nothing changes unless it is set; "WxH"; or "screen"; XCL_RENDER_RES), three things are patched when the executable is mapped. Each is found by its bytes, never by an address, and when a pattern is not found, a warning is logged and nothing is patched:

  • The table's largest mode becomes the render size.
  • A debug break after the full-size targets are allocated becomes a nop. It fires when their arena has more than 2 MB left over, and the normal path follows it.
  • The loads of the title's output size (3840x2160, the console's output; it sits next to the render size its setter writes) read the render size instead. Without this, the UI was laid out for the render size but drawn as if the screen were 4K: scaled by render/4K twice, with the bottom 17 % black and the right-hand prompts off the screen.

The arena does not grow (5120x2160 overran it by 22 MB, and 4416x1864 by 1.9 MB through 128x128 tile padding), so a size must fit 3840x2176 in tiles. "screen" picks the largest 128-aligned size within 2 % of the monitor's aspect ratio: 4224x1792 for 21:9, 4992x1408 for 32:9, 3456x2176 for 16:10, and no change for 16:9.

What is in it

  • crates/xcl/src/widescreen.rs: the render size from the setting and the three patches, with unit tests on synthetic bytes (render size settings, only the largest mode rewritten, the break becoming a nop, the output-size loads retargeted and others left alone, and nothing done without the setter)
  • crates/xcl/src/loader.rs: patch_image when the main executable is mapped, before page protections
  • crates/xcl/src/hle/d3d12x/present.rs: screen_size()
  • crates/xcl/src/config.rs, crates/xcl/src/lib.rs, README.md: render_resolution

Tested

  • RTX 4090 (driver 621.14), i9-14900K, Windows 11 26200, Rust stable-x86_64-pc-windows-msvc, debug tests, release smoke runs
  • cargo test -p xcl --lib widescreen: covered by the suite run below
  • cargo test --workspace -- --test-threads=1: 702 passed, 0 failed, 41 ignored; SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64)
  • Single-threaded on purpose: with --test-threads=4, GPU tests on this machine hang or lose the device tonight on main too (bdab194 and 91f9a5e; bdab194 had passed with 4 threads earlier the same night, and the driver logs GPU errors). Single-threaded, main 91f9a5e passes (cargo test -p xcl --lib -- --test-threads=1: 647 passed, 0 failed).
  • An earlier run on this machine, with render_resolution = "screen" on a 5120x2160 monitor (the newer retail game's account screen, intro video and loading art): a 4224x1792 back buffer at 30 fps. The UI spans the full width with its prompts in the wide screen's corner, round icons stay round, and the video and art fill 21:9. The smoke run below is with the default "native", which patches nothing.

Regression run
Both runs use a fresh data root of their own and the default settings (a 1280x720 window, nothing new turned on), so this shows that nothing else changes.

xcl-smoke v1
commit: 91f9a5e9f03156ea82dc55a18f7704862da7a5db
gpu: NVIDIA GeForce RTX 4090
title: Xbox
seconds: 60
exit: 0x0
frames shown: 811 (PresentX 811)
presents per 2 s (last 3): 37 34 36
device removals: 0
crashes: 0
peak commit: 15536 MB
xcl-smoke v1
commit: 0c43a53620aba918699412e4ba25c314b45a3b73
gpu: NVIDIA GeForce RTX 4090
title: Xbox
seconds: 60
exit: 0x0
frames shown: 841 (PresentX 841)
presents per 2 s (last 3): 37 36 37
device removals: 0
crashes: 0
peak commit: 15561 MB

Not tested

  • The 3D camera's projection and FOV at 21:9: the world does not load yet (#505).
  • The pause menu, map, cutscenes and in-game HUD at 21:9.
  • Titles other than RAGE ones with render_resolution set (expected to log that no display-mode table was found and change nothing; not run).
  • AMD and wave64 GPUs.

AI use

  • Claude Code with Claude Opus 5.5: wrote the code, the tests and this description; the hardware checks above are runs on the machine named under Tested.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5465992068 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/735). Originally posted by [MrCheese5](https://github.com/MrCheese5) on 2026-11-24T04:17:38Z. --- Stacked on #555, #732, #733 and #734; only the top commit belongs here. It uses `present::screen_size()` from #734. On a 21:9 screen the newer retail game still rendered 16:9, so it was pillarboxed. RAGE titles take their back buffer size from a mode table in read-only data: `{w, h, 60, 1}` × 5, the largest 3840x2160. With `render_resolution` ("native" by default, so nothing changes unless it is set; "WxH"; or "screen"; `XCL_RENDER_RES`), three things are patched when the executable is mapped. Each is found by its bytes, never by an address, and when a pattern is not found, a warning is logged and nothing is patched: - The table's largest mode becomes the render size. - A debug break after the full-size targets are allocated becomes a nop. It fires when their arena has more than 2 MB left over, and the normal path follows it. - The loads of the title's output size (3840x2160, the console's output; it sits next to the render size its setter writes) read the render size instead. Without this, the UI was laid out for the render size but drawn as if the screen were 4K: scaled by render/4K twice, with the bottom 17 % black and the right-hand prompts off the screen. The arena does not grow (5120x2160 overran it by 22 MB, and 4416x1864 by 1.9 MB through 128x128 tile padding), so a size must fit 3840x2176 in tiles. "screen" picks the largest 128-aligned size within 2 % of the monitor's aspect ratio: 4224x1792 for 21:9, 4992x1408 for 32:9, 3456x2176 for 16:10, and no change for 16:9. **What is in it** - `crates/xcl/src/widescreen.rs`: the render size from the setting and the three patches, with unit tests on synthetic bytes (render size settings, only the largest mode rewritten, the break becoming a nop, the output-size loads retargeted and others left alone, and nothing done without the setter) - `crates/xcl/src/loader.rs`: `patch_image` when the main executable is mapped, before page protections - `crates/xcl/src/hle/d3d12x/present.rs`: `screen_size()` - `crates/xcl/src/config.rs`, `crates/xcl/src/lib.rs`, `README.md`: `render_resolution` **Tested** - RTX 4090 (driver 621.14), i9-14900K, Windows 11 26200, Rust stable-x86_64-pc-windows-msvc, debug tests, release smoke runs - `cargo test -p xcl --lib widescreen`: covered by the suite run below - `cargo test --workspace -- --test-threads=1`: 702 passed, 0 failed, 41 ignored; SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64), `gpu_wave32_program_in_wave64_hardware` (no wave64) - Single-threaded on purpose: with `--test-threads=4`, GPU tests on this machine hang or lose the device tonight on `main` too (bdab194 and 91f9a5e; bdab194 had passed with 4 threads earlier the same night, and the driver logs GPU errors). Single-threaded, `main` 91f9a5e passes (`cargo test -p xcl --lib -- --test-threads=1`: 647 passed, 0 failed). - An earlier run on this machine, with `render_resolution = "screen"` on a 5120x2160 monitor (the newer retail game's account screen, intro video and loading art): a 4224x1792 back buffer at 30 fps. The UI spans the full width with its prompts in the wide screen's corner, round icons stay round, and the video and art fill 21:9. The smoke run below is with the default "native", which patches nothing. **Regression run** Both runs use a fresh data root of their own and the default settings (a 1280x720 window, nothing new turned on), so this shows that nothing else changes. ``` xcl-smoke v1 commit: 91f9a5e9f03156ea82dc55a18f7704862da7a5db gpu: NVIDIA GeForce RTX 4090 title: Xbox seconds: 60 exit: 0x0 frames shown: 811 (PresentX 811) presents per 2 s (last 3): 37 34 36 device removals: 0 crashes: 0 peak commit: 15536 MB ``` ``` xcl-smoke v1 commit: 0c43a53620aba918699412e4ba25c314b45a3b73 gpu: NVIDIA GeForce RTX 4090 title: Xbox seconds: 60 exit: 0x0 frames shown: 841 (PresentX 841) presents per 2 s (last 3): 37 36 37 device removals: 0 crashes: 0 peak commit: 15561 MB ``` **Not tested** - The 3D camera's projection and FOV at 21:9: the world does not load yet (#505). - The pause menu, map, cutscenes and in-game HUD at 21:9. - Titles other than RAGE ones with `render_resolution` set (expected to log that no display-mode table was found and change nothing; not run). - AMD and wave64 GPUs. **AI use** - Claude Code with Claude Opus 5.5: wrote the code, the tests and this description; the hardware checks above are runs on the machine named under **Tested**. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
RandomGithub12309 commented 2026-11-24 07:06:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RandomGithub12309 on 2026-11-24T04:39:44Z.


Test run and review of 0c43a53620aba918699412e4ba25c314b45a3b73 merged cleanly onto main (f4ce27c):

Tested

  • Hardware: NVIDIA GeForce RTX 5050 Laptop GPU (driver 32.0.16.2114, wave32, SM 6.6), Intel Core Ultra 7 255HX (20 cores), Windows 11 Build 26300, rustc 1.100.0 stable-x86_64-pc-windows-msvc, debug build
  • Commands & Results:
    • First cargo test --workspace -- --test-threads=4: 669 passed, 1 failed in src/lib.rs — hle::d3d12x::real::readback_routing_tests::coherent_buffer_sanitizes_console_flags_and_state panicked on VirtualFree(mem, 0, MEM_RELEASE) != 0 (real.rs:5388, an unrelated OpenExistingHeapFromAddress teardown timing flake on main).
    • Re-run standalone (coherent_buffer_sanitizes_console_flags_and_state): 1 passed, 0 failed.
    • Full workspace re-run (cargo test --workspace -- --test-threads=4): 711 passed, 0 failed, 41 ignored (downscale::tests::*, pick_monitor_by_setting, and all 4 widescreen::tests::* pass).
  • SKIPPED: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64)

Review

  • Inherits #732 / #555's pre-Present q.Signal ordering in crates/xcl/src/hle/d3d12x/present.rs.
  • In crates/xcl/src/widescreen.rs: render_size("WxH", ...) returns Some((w, h)) and patch_image still rewrites the executable's mode table when !fits(w, h), logging only a warning afterward; patch_output_size (widescreen.rs:174) also subtracts 0x20 from disp32 with checked subtraction instead of wrapping_sub(0x20).

Not tested

  • 21:9 monitor / multi-monitor DPI scaling / Alt+Enter fullscreen interactively, retail executable binary patching via xcl run, AMD / wave64

AI use

  • Antigravity with Gemini 4 Hydrogen — merged 0c43a53 onto f4ce27c, audited widescreen.rs and the stacked changes, ran the workspace suite, and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7122223287 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/735#issuecomment-7122223287). Originally posted by [RandomGithub12309](https://github.com/RandomGithub12309) on 2026-11-24T04:39:44Z. --- Test run and review of `0c43a53620aba918699412e4ba25c314b45a3b73` merged cleanly onto `main` (`f4ce27c`): **Tested** - Hardware: NVIDIA GeForce RTX 5050 Laptop GPU (driver `32.0.16.2114`, wave32, SM 6.6), Intel Core Ultra 7 255HX (20 cores), Windows 11 Build 26300, `rustc 1.100.0` `stable-x86_64-pc-windows-msvc`, debug build - Commands & Results: - First `cargo test --workspace -- --test-threads=4`: `669 passed, 1 failed` in `src/lib.rs` — `hle::d3d12x::real::readback_routing_tests::coherent_buffer_sanitizes_console_flags_and_state` panicked on `VirtualFree(mem, 0, MEM_RELEASE) != 0` (`real.rs:5388`, an unrelated `OpenExistingHeapFromAddress` teardown timing flake on `main`). - Re-run standalone (`coherent_buffer_sanitizes_console_flags_and_state`): **1 passed, 0 failed**. - Full workspace re-run (`cargo test --workspace -- --test-threads=4`): **711 passed, 0 failed, 41 ignored** (`downscale::tests::*`, `pick_monitor_by_setting`, and all 4 `widescreen::tests::*` pass). - `SKIPPED`: `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` (`no wave64`) **Review** - Inherits `#732` / `#555`'s pre-`Present` `q.Signal` ordering in `crates/xcl/src/hle/d3d12x/present.rs`. - In `crates/xcl/src/widescreen.rs`: `render_size("WxH", ...)` returns `Some((w, h))` and `patch_image` still rewrites the executable's mode table when `!fits(w, h)`, logging only a warning afterward; `patch_output_size` (`widescreen.rs:174`) also subtracts `0x20` from `disp32` with checked subtraction instead of `wrapping_sub(0x20)`. **Not tested** - 21:9 monitor / multi-monitor DPI scaling / Alt+Enter fullscreen interactively, retail executable binary patching via `xcl run`, AMD / wave64 **AI use** - Antigravity with Gemini 4 Hydrogen — merged `0c43a53` onto `f4ce27c`, audited `widescreen.rs` and the stacked changes, ran the workspace suite, and wrote this report.
LocranKing commented 2026-11-24 07:06:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by LocranKing on 2026-11-24T04:46:56Z.


Tested on Windows 11 + NVIDIA GeForce RTX 3060 Ti (8 GB, wave32).

Tested

  • Commit: 0c43a53620aba918699412e4ba25c314b45a3b73 (pr-735, clean tree)
  • Hardware / software: Windows 11 Home Build 26200, AMD Ryzen 5 5500, 31.8 GB RAM, NVIDIA GeForce RTX 3060 Ti (8024 MiB VRAM, driver 32.0.16.2101), rustc 1.100.0 (x86_64-pc-windows-msvc, MSVC 14.44.35207), DXC 1.9.2602.17 (SDK 10.0.26100.0), --release
  • cargo test --workspace --release --no-fail-fast -- --test-threads=4: 702 passed, 0 failed, 41 ignored, exit 0; 2 (no wave64) skipped (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware)

Regression run (scripts/smoke.ps1, 60 s, XCL_NETWORK=0, default render_resolution = "native", title folder name redacted)

main (64b3f35):

xcl-smoke v1
commit: 64b3f35599bb7102f55d640e1a791e7d6dd3b175
gpu: NVIDIA GeForce RTX 3060 Ti
title: retail-1.0.2.1
seconds: 60
exit: 0x0
frames shown: 544 (PresentX 545)
presents per 2 s (last 3): 22 22 21
device removals: 0
crashes: 0
peak commit: 15491 MB

PR #735 (0c43a53):

xcl-smoke v1
commit: 0c43a53620aba918699412e4ba25c314b45a3b73
gpu: NVIDIA GeForce RTX 3060 Ti
title: retail-1.0.2.1
seconds: 60
exit: 0x0
frames shown: 499 (PresentX 499)
presents per 2 s (last 3): 21 20 22
device removals: 0
crashes: 0
peak commit: 15468 MB

Not tested: Ultrawide XCL_RENDER_RES=screen / WxH patching on a non-16:9 monitor, debug build, XCL_SAMPLE_* tests on this branch, AMD / wave64 hardware.

AI use: Antigravity (Gemini 4 Hydrogen) ran the build, tests, and smoke runs and drafted this report from the command outputs.

<!-- greyfinch-sync:ivall/xcl:comment:7122333563 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/735#issuecomment-7122333563). Originally posted by [LocranKing](https://github.com/LocranKing) on 2026-11-24T04:46:56Z. --- Tested on Windows 11 + NVIDIA GeForce RTX 3060 Ti (8 GB, wave32). **Tested** - Commit: `0c43a53620aba918699412e4ba25c314b45a3b73` (`pr-735`, clean tree) - Hardware / software: Windows 11 Home Build 26200, AMD Ryzen 5 5500, 31.8 GB RAM, NVIDIA GeForce RTX 3060 Ti (`8024 MiB VRAM`, driver `32.0.16.2101`), `rustc 1.100.0` (`x86_64-pc-windows-msvc`, MSVC `14.44.35207`), DXC `1.9.2602.17` (SDK `10.0.26100.0`), `--release` - `cargo test --workspace --release --no-fail-fast -- --test-threads=4`: **702 passed, 0 failed, 41 ignored**, exit `0`; `2 (no wave64)` skipped (`gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`) **Regression run** (`scripts/smoke.ps1`, 60 s, `XCL_NETWORK=0`, default `render_resolution = "native"`, title folder name redacted) main (`64b3f35`): ``` xcl-smoke v1 commit: 64b3f35599bb7102f55d640e1a791e7d6dd3b175 gpu: NVIDIA GeForce RTX 3060 Ti title: retail-1.0.2.1 seconds: 60 exit: 0x0 frames shown: 544 (PresentX 545) presents per 2 s (last 3): 22 22 21 device removals: 0 crashes: 0 peak commit: 15491 MB ``` PR #735 (`0c43a53`): ``` xcl-smoke v1 commit: 0c43a53620aba918699412e4ba25c314b45a3b73 gpu: NVIDIA GeForce RTX 3060 Ti title: retail-1.0.2.1 seconds: 60 exit: 0x0 frames shown: 499 (PresentX 499) presents per 2 s (last 3): 21 20 22 device removals: 0 crashes: 0 peak commit: 15468 MB ``` **Not tested:** Ultrawide `XCL_RENDER_RES=screen` / `WxH` patching on a non-16:9 monitor, debug build, `XCL_SAMPLE_*` tests on this branch, AMD / wave64 hardware. **AI use:** Antigravity (`Gemini 4 Hydrogen`) ran the build, tests, and smoke runs and drafted this report from the command outputs.
MesshM commented 2026-11-24 07:06:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T04:47:41Z.


Test run of 0c43a53620aba918699412e4ba25c314b45a3b73 on AMD RDNA4. I merged it onto current main 64b3f35 locally (clean merge), so the tree tested includes the stack under it (#555, #732, #733, #734).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 711 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 670 passed, 0 failed, 21 ignored
  • 0 SKIPPED; all present / downscale tests pass, downscale_matches_a_cpu_area_filter included.

Review: Patching a RAGE title's mode table in read-only data to the screen's aspect is title-specific and needs a retail title to check, which I do not have; I can only report that the stack builds and the suite passes on AMD, and I reviewed the top commit's structure, not its patch offsets.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

<!-- greyfinch-sync:ivall/xcl:comment:7122345030 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/735#issuecomment-7122345030). Originally posted by [MesshM](https://github.com/MesshM) on 2026-11-24T04:47:41Z. --- Test run of `0c43a53620aba918699412e4ba25c314b45a3b73` on AMD RDNA4. I merged it onto current `main` `64b3f35` locally (clean merge), so the tree tested includes the stack under it (#555, #732, #733, #734). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **711 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 670 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; all `present` / `downscale` tests pass, `downscale_matches_a_cpu_area_filter` included. **Review:** Patching a RAGE title's mode table in read-only data to the screen's aspect is title-specific and needs a retail title to check, which I do not have; I can only report that the stack builds and the suite passes on AMD, and I reviewed the top commit's structure, not its patch offsets. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
adriadam10 commented 2026-11-25 11:09:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by adriadam10 on 2026-11-25T11:08:10Z.


@MrCheese5 below 2560x1440 the title still allocates its display targets at 2560x1440 (it takes the largest mode, and only the last entry is rewritten); a one-commit fix on top of your branch, with a 854x480 smoke run on a GTX 1050 Ti: MrCheese5/xcl#1. (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ivall/xcl:comment:7160639224 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/735#issuecomment-7160639224). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-11-25T11:08:10Z. --- @MrCheese5 below 2560x1440 the title still allocates its display targets at 2560x1440 (it takes the largest mode, and only the last entry is rewritten); a one-commit fix on top of your branch, with a 854x480 smoke run on a GTX 1050 Ti: MrCheese5/xcl#1. (Claude Code, Claude Opus 5.5)
DavidM1911 commented 2026-11-25 12:06:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T11:38:45Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7161314638 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/735#issuecomment-7161314638). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T11:38:45Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
pickles976 commented 2026-11-25 20:08:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-25T19:24:55Z.


720p runtime finding: the shipped FSR4 DLL rejects the requested output dimensions. This is a compatibility constraint to account for when exposing lower render sizes, not a request for a GPU-specific patch.

Tested a local integration of this PR's resolution changes plus MrCheese5/xcl#1 (2dfece0b480d7d740b03ad810180efd0f6579a9a), with XCL_RENDER_RES=1280x720, Series S/lockhart, retail 1.0.2.1. Linux 6.17.0-40, Wine/vkd3d-proton, RTX 4060 Laptop 8 GB, NVIDIA 590.48.01. Not the exact stacked PR tree: our build also carries sparse-mapping, Wine-vtable/guard and GPU-source-staging changes; primary-monitor query replaces the selected-monitor helper, and screen was not used. Focused widescreen tests: 5 passed; release cross-build passed.

Observed in a 60-second wall-bounded, isolated-Xvfb trial:

render size: the title's largest display mode (3840x2160, table at +0x615c0c0) is now 1280x720
[debug] FSR_API_DEBUG_ERROR: Shipping FSR4 configuration mismatch: maxUpscaleSize must be 1920x1080; received 1280x720. Only the fixed-resolution Quality shader tables are included.

The other two patches matched too (one arena check; five output-size loads). Source frame dumps 20/140 were black; 260 through 740 were 1280x720 but a flat dark background. Inspected frame 740 visually: no visible menu or world. Later activity logs show about 60 presents/2s, which is NOT gameplay at 30fps. I have not established that the FSR rejection causes the flat background.

The loaded amd_fidelityfx_upscaler_xbox.dll is a symlink to the supplied asset, with matching SHA-256 faff02f294a7e9149ce079dffe3dedbcabe99b1f180ab14222aa8689e00a75fa; no binary patch to it. Its UTF-16 strings contain this fixed-resolution diagnostic plus fixed maxRenderSize/per-frame-renderSize and dynamic-resolution restrictions. Merely removing the validation would not establish that the packaged shader tables support another size.

Guard stopped the entire trial at 60s (forced termination, exit 137; wrapper 61.04s). Peak sampled NVIDIA memory 5804 MiB; minimum available RAM 7638.8 MiB. No new kernel log entries; GPU returned to 11 MiB. Missing EDID/display-metadata errors from Xvfb also remain. Not verified: error-free execution, correct UI/world rendering, sustained gameplay performance, or 15-minute stability. No matched VRAM A/B claim.

Earlier offline/mode-table verification is on the existing follow-up: https://github.com/MrCheese5/xcl/pull/1#issuecomment-7171997029 . Rather than duplicate that work, I am reporting this additional runtime constraint here. Existing VIctory PC-FidelityFX work is tracked in Marvisak/VIctory#730 (now in its main module, with remaining Series X scale work in #1793); that may be a useful implementation reference, not something tested in this XCL run.

AI assistance: OpenAI coding assistant adapted the local integration, ran these checks, and wrote this report from observed outputs.

Follow-up with XCL_RENDER_RES=1920x1080 (compatible output size): the frame dump was 1920x1080 and no FSR_API_DEBUG_ERROR appeared before cutoff. The existing fsr4_console_upscaler_creates_a_context_probe in console_dlls_e2e.rs already documents 1280x720 input / 1920x1080 output for this packaged DLL; output dimensions must not be confused with internal render dimensions. I have not captured the running title's FFX description/return code, so this is not proof of successful upscaling or its internal size.

The same conservative post-freeze guard terminated this trial at 42.95 s sampled / 43.67 s wrapper time: NVIDIA memory reached 6058 MiB against the 6000 MiB cutoff, available RAM 7609.9 MiB. This is not hardware OOM; the cutoff intentionally reserves headroom after a previous whole-host freeze. Last XCL accounting: target pages 812 MB (832 MB pools), sparse pools 4096 MB (4036 MB mapped), arenas 195 MB in use / 258 MB made. Logs also reported same-recording command-list resubmission while a previous submit remained on the GPU (debug layer id 553); no causal attribution here. No new kernel entries and GPU returned to 11 MiB. Gameplay was not reached, and the guard was not relaxed to force a longer run.

<!-- greyfinch-sync:ivall/xcl:comment:7172262085 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/735#issuecomment-7172262085). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-25T19:24:55Z. --- **720p runtime finding: the shipped FSR4 DLL rejects the requested output dimensions.** This is a compatibility constraint to account for when exposing lower render sizes, not a request for a GPU-specific patch. Tested a local integration of this PR's resolution changes plus MrCheese5/xcl#1 (`2dfece0b480d7d740b03ad810180efd0f6579a9a`), with `XCL_RENDER_RES=1280x720`, Series S/lockhart, retail 1.0.2.1. Linux 6.17.0-40, Wine/vkd3d-proton, RTX 4060 Laptop 8 GB, NVIDIA 590.48.01. **Not the exact stacked PR tree:** our build also carries sparse-mapping, Wine-vtable/guard and GPU-source-staging changes; primary-monitor query replaces the selected-monitor helper, and `screen` was not used. Focused widescreen tests: 5 passed; release cross-build passed. Observed in a 60-second wall-bounded, isolated-Xvfb trial: ```text render size: the title's largest display mode (3840x2160, table at +0x615c0c0) is now 1280x720 [debug] FSR_API_DEBUG_ERROR: Shipping FSR4 configuration mismatch: maxUpscaleSize must be 1920x1080; received 1280x720. Only the fixed-resolution Quality shader tables are included. ``` The other two patches matched too (one arena check; five output-size loads). Source frame dumps 20/140 were black; 260 through 740 were 1280x720 but a flat dark background. Inspected frame 740 visually: **no visible menu or world**. Later activity logs show about 60 presents/2s, which is NOT gameplay at 30fps. I have not established that the FSR rejection causes the flat background. The loaded `amd_fidelityfx_upscaler_xbox.dll` is a symlink to the supplied asset, with matching SHA-256 `faff02f294a7e9149ce079dffe3dedbcabe99b1f180ab14222aa8689e00a75fa`; no binary patch to it. Its UTF-16 strings contain this fixed-resolution diagnostic plus fixed maxRenderSize/per-frame-renderSize and dynamic-resolution restrictions. Merely removing the validation would not establish that the packaged shader tables support another size. Guard stopped the entire trial at 60s (forced termination, exit 137; wrapper 61.04s). Peak sampled NVIDIA memory 5804 MiB; minimum available RAM 7638.8 MiB. No new kernel log entries; GPU returned to 11 MiB. Missing EDID/display-metadata errors from Xvfb also remain. **Not verified:** error-free execution, correct UI/world rendering, sustained gameplay performance, or 15-minute stability. No matched VRAM A/B claim. Earlier offline/mode-table verification is on the existing follow-up: https://github.com/MrCheese5/xcl/pull/1#issuecomment-7171997029 . Rather than duplicate that work, I am reporting this additional runtime constraint here. Existing VIctory PC-FidelityFX work is tracked in Marvisak/VIctory#730 (now in its main module, with remaining Series X scale work in #1793); that may be a useful implementation reference, not something tested in this XCL run. AI assistance: OpenAI coding assistant adapted the local integration, ran these checks, and wrote this report from observed outputs. **Follow-up with `XCL_RENDER_RES=1920x1080` (compatible output size):** the frame dump was 1920x1080 and no `FSR_API_DEBUG_ERROR` appeared before cutoff. The existing `fsr4_console_upscaler_creates_a_context_probe` in `console_dlls_e2e.rs` already documents 1280x720 input / 1920x1080 output for this packaged DLL; output dimensions must not be confused with internal render dimensions. I have not captured the running title's FFX description/return code, so this is not proof of successful upscaling or its internal size. The same conservative post-freeze guard terminated this trial at 42.95 s sampled / 43.67 s wrapper time: NVIDIA memory reached 6058 MiB against the 6000 MiB cutoff, available RAM 7609.9 MiB. This is **not hardware OOM**; the cutoff intentionally reserves headroom after a previous whole-host freeze. Last XCL accounting: target pages 812 MB (832 MB pools), sparse pools 4096 MB (4036 MB mapped), arenas 195 MB in use / 258 MB made. Logs also reported same-recording command-list resubmission while a previous submit remained on the GPU (debug layer id 553); no causal attribution here. No new kernel entries and GPU returned to 11 MiB. Gameplay was not reached, and the guard was not relaxed to force a longer run.
claudetools-gh commented 2026-11-26 08:04:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by claudetools-gh on 2026-11-26T07:51:16Z.


@MrCheese5 one thing for sizes below 2560x1440: patch rewrites only the largest mode, so with XCL_RENDER_RES=1920x1080 the title still finds its 2560x1440 mode and takes that one. On an RTX 5070 Ti with the retail title, the log said the largest mode was now 1920x1080, and every frame was still presented at 2560x1440.

Rewriting every mode with more pixels than the render size fixes it. The back buffer is then 1920x1080, and the 3-D targets are 1280x720 (a target dump in the world: render target … 1280x720 format 10). The world went from about 2.1 to about 3.2 presents a second in the same scene. The change we run, inside patch's loop over the tables:

        // a size below 3840x2160 would leave a larger mode (2560x1440) as the title's
        // largest; every mode with more pixels than `size` becomes `size` too
        for (k, m) in MODES.iter().enumerate().take(MODES.len() - 1) {
            if u64::from(m[0]) * u64::from(m[1]) > u64::from(size.0) * u64::from(size.1) {
                let o = i + 16 * k;
                data[o..o + 4].copy_from_slice(&size.0.to_le_bytes());
                data[o + 4..o + 8].copy_from_slice(&size.1.to_le_bytes());
            }
        }

and a test:

    #[test]
    fn patch_to_a_smaller_size_leaves_no_larger_mode() {
        let mut data = table_bytes();
        assert_eq!(patch(&mut data, (1920, 1080)), vec![0]);
        let modes: Vec<(u32, u32)> = (0..MODES.len())
            .map(|k| {
                let w = u32::from_le_bytes(data[16 * k..16 * k + 4].try_into().unwrap());
                let h = u32::from_le_bytes(data[16 * k + 4..16 * k + 8].try_into().unwrap());
                (w, h)
            })
            .collect();
        assert_eq!(modes, vec![(1280, 720), (1664, 936), (1920, 1080), (1920, 1080), (1920, 1080)]);
    }

Your 5120x2160 case is unchanged (no mode is larger), and patch_rewrites_the_largest_mode_only still passes. Tested on a port of your top commit onto main 08db802 without the rest of the stack: cargo test --release -p xcl --lib -- widescreen, 5 passed.

Not tested: sizes between the table's modes other than 1920x1080; the UI at that size (the movement hint drew correctly at 1920x1080).

AI-assisted.

<!-- greyfinch-sync:ivall/xcl:comment:7185907591 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/735#issuecomment-7185907591). Originally posted by [claudetools-gh](https://github.com/claudetools-gh) on 2026-11-26T07:51:16Z. --- @MrCheese5 one thing for sizes below 2560x1440: `patch` rewrites only the largest mode, so with `XCL_RENDER_RES=1920x1080` the title still finds its 2560x1440 mode and takes that one. On an RTX 5070 Ti with the retail title, the log said the largest mode was now 1920x1080, and every frame was still presented at 2560x1440. Rewriting every mode with more pixels than the render size fixes it. The back buffer is then 1920x1080, and the 3-D targets are 1280x720 (a target dump in the world: `render target … 1280x720 format 10`). The world went from about 2.1 to about 3.2 presents a second in the same scene. The change we run, inside `patch`'s loop over the tables: ```rust // a size below 3840x2160 would leave a larger mode (2560x1440) as the title's // largest; every mode with more pixels than `size` becomes `size` too for (k, m) in MODES.iter().enumerate().take(MODES.len() - 1) { if u64::from(m[0]) * u64::from(m[1]) > u64::from(size.0) * u64::from(size.1) { let o = i + 16 * k; data[o..o + 4].copy_from_slice(&size.0.to_le_bytes()); data[o + 4..o + 8].copy_from_slice(&size.1.to_le_bytes()); } } ``` and a test: ```rust #[test] fn patch_to_a_smaller_size_leaves_no_larger_mode() { let mut data = table_bytes(); assert_eq!(patch(&mut data, (1920, 1080)), vec![0]); let modes: Vec<(u32, u32)> = (0..MODES.len()) .map(|k| { let w = u32::from_le_bytes(data[16 * k..16 * k + 4].try_into().unwrap()); let h = u32::from_le_bytes(data[16 * k + 4..16 * k + 8].try_into().unwrap()); (w, h) }) .collect(); assert_eq!(modes, vec![(1280, 720), (1664, 936), (1920, 1080), (1920, 1080), (1920, 1080)]); } ``` Your 5120x2160 case is unchanged (no mode is larger), and `patch_rewrites_the_largest_mode_only` still passes. Tested on a port of your top commit onto `main` `08db802` without the rest of the stack: `cargo test --release -p xcl --lib -- widescreen`, 5 passed. **Not tested:** sizes between the table's modes other than 1920x1080; the UI at that size (the movement hint drew correctly at 1920x1080). AI-assisted.
Foniass commented 2026-12-01 04:01:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:01:46Z.


Triage (#1607) – head 0c43a53

Stacked on #734 and #733 (and the closed #555 / #732 commits under them); only 0c43a536 belongs here. No other open or merged PR changes a title's render resolution.
The patches in widescreen.rs are opt-in (render_resolution defaults to "native") and found by byte signature. patch_output_size rewrites every RIP-relative load in the executable sections whose target equals the output-size address, so a false match is unlikely but possible.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7300305397 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/735#issuecomment-7300305397). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:01:46Z. --- **Triage (#1607)** – head 0c43a53 Stacked on #734 and #733 (and the closed #555 / #732 commits under them); only 0c43a536 belongs here. No other open or merged PR changes a title's render resolution. The patches in `widescreen.rs` are opt-in (`render_resolution` defaults to "native") and found by byte signature. `patch_output_size` rewrites every RIP-relative load in the executable sections whose target equals the output-size address, so a false match is unlikely but possible. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/735:upstream-pr/735'
git switch 'upstream-pr/735'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/735'
git switch 'upstream-pr/735'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/735'
git switch 'upstream-pr/735'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/735'
git switch 'main'
git merge --squash 'upstream-pr/735'
git switch 'main'
git merge --ff-only 'upstream-pr/735'
git switch 'main'
git merge 'upstream-pr/735'
git push origin 'main'
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
xcl-dev/xcl!730
No description provided.