app,hle: fix Series X 1440p UI scaling and harden XMem failed remaps #78

Manually merged
github merged 1 commit from gh-pr/78/head into gh-pr/78/base 2026-12-01 20:07:12 +00:00
Owner

@⁠Androtim on GitHub · 2026-11-29 05:10 UTC · original
Androtim:feat/iter80-1440p-ui-scaling-and-xmem-harden → main · +244 −66 · 2 files · 1 commits · merged 2026-11-29 14:31 UTC

Summary

Fix two correctness issues for Series X 1440p rendering and HLE virtual/physical memory remapping:

  • Series X 1440p UI scaling & pool sizing (\pps/victory/src/native_1440p.rs): Enables the title's legacy UI flag (\LEGACY_UI_PRESET, \LEGACY_UI_FLAG_STORE) and sizes the UI surface pool for two 3840x2160 legacy UI buffers plus two 2560x1440 targets (94 MiB aligned to 2 MiB) so HUD elements, tooltips, and menus scale properly onto 2560x1440 without overlapping or asserting.
  • Harden \XMem\ failed remaps (\crates/victory-hle/src/modules/xmem.rs): Validates all source/physical slices before \unmap\ in \XMemMapPhysicalPages, \lias_as, and \map_aliases\ (\missing_source) so failed or out-of-range remaps leave existing destination mappings intact instead of leaving unmapped holes. Preserves PR #35's 21-bit physical page number reuse.

Rig Specs Tested On

  • CPU: Intel Core i7-13700F
  • GPU & VRAM: NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM)
  • System RAM: 32 GiB
  • OS & GPU Driver: Windows 11 Build 26300, NVIDIA driver 32.0.16.2124

Run Settings & Profile

  • Build & Commit SHA: plain --release\ & --features diagnostics\ verified at pre-rebase \f5a6c7\ (rebased cleanly onto \origin/main\ \8d89ba6\ -> $sha80)
  • Console Profile & Internal Resolution / Scale: \series-x\ with \VICTORY_NATIVE_1440P=1, \VICTORY_TEXTURE_MIP_DROP=1\ (\min_size=1024), \VICTORY_CARD_BUFFERS_MB=1024, \VICTORY_CARD_WINDOWS_MB=256, \VICTORY_CARD_ROOM_FOR_TARGETS_MB=512, \VICTORY_DSTORAGE_STAGING_MB=64, \VICTORY_TEXTURE_ROOM_PERCENT=80, \VICTORY_SLOT_EVICT=1\ (\79/\75), \VICTORY_READBACK_POOL=1, \VICTORY_NAN_SCRUB=1, \VICTORY_NO_WATCHDOG=1\
  • Ray Tracing: \off\
  • Upscaling: \DLSS quality\
  • Frame Generation: \off\
  • Verification Command: \ erify-world.ps1\ (\WorldSeconds=75, \AutoNudgeMenu)
  • Scene / Area & Session Length: Open-world exterior + character deck scene at native 2560x1440 (1280x720 50%-scaled captured frames, \ irst_world_frame=8464, \75s\ / \14\ windows, up to \13712\ draws/frame)

Measurements & Verification

  • Base FPS (without Frame Gen): \9.7 fps\ median (\103.3 ms\ frame time, +0.80 fps\ vs Series S \8.9 fps\ baseline)
  • VRAM / RAM Usage: \6152 MB\ peak (\6124.0 MB\ median) / \6923 MB\ min budget (\
**@⁠Androtim** on GitHub · 2026-11-29 05:10 UTC · [original](https://github.com/Androtim/MiniVI/pull/78) `Androtim:feat/iter80-1440p-ui-scaling-and-xmem-harden` → `main` · +244 −66 · 2 files · 1 commits · merged 2026-11-29 14:31 UTC ## Summary Fix two correctness issues for Series X 1440p rendering and HLE virtual/physical memory remapping: - **Series X 1440p UI scaling & pool sizing (\pps/victory/src/native_1440p.rs\):** Enables the title's legacy UI flag (\LEGACY_UI_PRESET\, \LEGACY_UI_FLAG_STORE\) and sizes the UI surface pool for two 3840x2160 legacy UI buffers plus two 2560x1440 targets (94 MiB aligned to 2 MiB) so HUD elements, tooltips, and menus scale properly onto 2560x1440 without overlapping or asserting. - **Harden \XMem\ failed remaps (\crates/victory-hle/src/modules/xmem.rs\):** Validates all source/physical slices before \unmap\ in \XMemMapPhysicalPages\, \lias_as\, and \map_aliases\ (\missing_source\) so failed or out-of-range remaps leave existing destination mappings intact instead of leaving unmapped holes. Preserves PR #35's 21-bit physical page number reuse. ## Rig Specs Tested On - **CPU:** Intel Core i7-13700F - **GPU & VRAM:** NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM) - **System RAM:** 32 GiB - **OS & GPU Driver:** Windows 11 Build 26300, NVIDIA driver 32.0.16.2124 ## Run Settings & Profile - **Build & Commit SHA:** plain \--release\ & \--features diagnostics\ verified at pre-rebase \f5a6c7\ (rebased cleanly onto \origin/main\ \8d89ba6\ -> \$sha80\) - **Console Profile & Internal Resolution / Scale:** \series-x\ with \VICTORY_NATIVE_1440P=1\, \VICTORY_TEXTURE_MIP_DROP=1\ (\min_size=1024\), \VICTORY_CARD_BUFFERS_MB=1024\, \VICTORY_CARD_WINDOWS_MB=256\, \VICTORY_CARD_ROOM_FOR_TARGETS_MB=512\, \VICTORY_DSTORAGE_STAGING_MB=64\, \VICTORY_TEXTURE_ROOM_PERCENT=80\, \VICTORY_SLOT_EVICT=1\ (\79\/\75\), \VICTORY_READBACK_POOL=1\, \VICTORY_NAN_SCRUB=1\, \VICTORY_NO_WATCHDOG=1\ - **Ray Tracing:** \off\ - **Upscaling:** \DLSS quality\ - **Frame Generation:** \off\ - **Verification Command:** \ erify-world.ps1\ (\WorldSeconds=75\, \AutoNudgeMenu\) - **Scene / Area & Session Length:** Open-world exterior + character deck scene at native 2560x1440 (1280x720 50%-scaled captured frames, \ irst_world_frame=8464\, \75s\ / \14\ windows, up to \13712\ draws/frame) ## Measurements & Verification - **Base FPS (without Frame Gen):** \9.7 fps\ median (\103.3 ms\ frame time, \+0.80 fps\ vs Series S \8.9 fps\ baseline) - **VRAM / RAM Usage:** \6152 MB\ peak (\6124.0 MB\ median) / \6923 MB\ min budget (\
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 20:07:11 +00:00
github manually merged commit e9a0e99c1e into gh-pr/78/base 2026-12-01 20:07:12 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-11-29 06:03 UTC · original

Automated triage for the maintainers (not an approval).

Verdict: needs-gpu-test · CI (check): passing

Summary

  • apps/victory/src/native_1440p.rs: Replaces the 1440p scanout-only pool sizing and UI_VIEWPORT_LOAD patch with enabling the title's legacy UI flag (LEGACY_UI_PRESET at 0x01e0_fb69 -> mov al, 1; nop*4, LEGACY_UI_FLAG_STORE at 0x0261_92f9 -> mov byte ptr [rsi+0x13c], 1) and sizing UI_POOL (0x0247_ad4a) for two 3840x2160 legacy UI surfaces plus two 2560x1440 targets (0x5E00000 / 94 MiB). Stock bytes are verified via BLAKE3 hashes before patching, and no retail bytes are committed.
  • crates/victory-hle/src/modules/xmem.rs:
    • map_pages now resolves and validates all page_table() slices before calling unmap, leaving the destination intact on unknown page numbers.
    • alias_as now collects all source slices via physical.slice_at before calling unmap, preventing both partial-unmap holes on missing source pages and self-clobbering on overlapping ranges (to < from + len && from < to + len).
    • map_aliases adds a missing_source pre-check across all pages in the batch (accounting for earlier entries in the same call) and skips Some(None) entries in the batch loop rather than unmapping destinations if a source disappears between groups.
    • Adds unit tests a_remap_that_cannot_be_served_changes_nothing, a_source_counts_as_the_entries_before_it_leave_it, and batched_copies_that_cannot_be_served_change_nothing, and updates the existing alias_as test.

Notes

  • Logic, x86-64 patch encodings, lock ordering (title_memory_remapping -> physical -> page_table), and CI are all clean.
  • Minor behavioral note: in map_aliases, when side_by_side() <= 1, the fallback ranges.iter().all(|&(to, from, len)| alias(to, from, len)) validates each range individually rather than pre-checking all ranges together as missing_source does on the multi-threaded path.
  • Because patches_the_retail_image_for_1440p is skipped in CI without VICTORY_DISPLAY_PROFILE_TEST_IMAGE and the native_1440p changes alter Series X UI render-target pool sizing (94 MiB) and UI scaling patches, a local real-GPU smoke test with the retail image is warranted before merging.

Generated with Antigravity CLI (agy).

**@⁠Androtim** on GitHub · 2026-11-29 06:03 UTC · [original](https://github.com/Androtim/MiniVI/pull/78#issuecomment-7251620141) <!-- minivi-triage v1 head=e9a0e99c1e484f5455b379e6843ffe2ae2ad98a1 verdict=needs-gpu-test ci=passing at=2026-11-29T06:04:01Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Summary - **`apps/victory/src/native_1440p.rs`**: Replaces the 1440p scanout-only pool sizing and `UI_VIEWPORT_LOAD` patch with enabling the title's legacy UI flag (`LEGACY_UI_PRESET` at `0x01e0_fb69` -> `mov al, 1; nop*4`, `LEGACY_UI_FLAG_STORE` at `0x0261_92f9` -> `mov byte ptr [rsi+0x13c], 1`) and sizing `UI_POOL` (`0x0247_ad4a`) for two 3840x2160 legacy UI surfaces plus two 2560x1440 targets (`0x5E00000` / 94 MiB). Stock bytes are verified via BLAKE3 hashes before patching, and no retail bytes are committed. - **`crates/victory-hle/src/modules/xmem.rs`**: - `map_pages` now resolves and validates all `page_table()` slices before calling `unmap`, leaving the destination intact on unknown page numbers. - `alias_as` now collects all source slices via `physical.slice_at` before calling `unmap`, preventing both partial-unmap holes on missing source pages and self-clobbering on overlapping ranges (`to < from + len && from < to + len`). - `map_aliases` adds a `missing_source` pre-check across all pages in the batch (accounting for earlier entries in the same call) and skips `Some(None)` entries in the batch loop rather than unmapping destinations if a source disappears between groups. - Adds unit tests `a_remap_that_cannot_be_served_changes_nothing`, `a_source_counts_as_the_entries_before_it_leave_it`, and `batched_copies_that_cannot_be_served_change_nothing`, and updates the existing `alias_as` test. ### Notes - Logic, x86-64 patch encodings, lock ordering (`title_memory_remapping` -> `physical` -> `page_table`), and CI are all clean. - Minor behavioral note: in `map_aliases`, when `side_by_side() <= 1`, the fallback `ranges.iter().all(|&(to, from, len)| alias(to, from, len))` validates each range individually rather than pre-checking all ranges together as `missing_source` does on the multi-threaded path. - Because `patches_the_retail_image_for_1440p` is skipped in CI without `VICTORY_DISPLAY_PROFILE_TEST_IMAGE` and the `native_1440p` changes alter Series X UI render-target pool sizing (94 MiB) and UI scaling patches, a local real-GPU smoke test with the retail image is warranted before merging. --- _Generated with Antigravity CLI (`agy`)._
Author
Owner

@⁠Androtim on GitHub · 2026-11-29 06:58 UTC · original

Completed local retail-image patch test and live 75s Series X 1440p GPU verification on e9a0e99 (pr80-sx-native-1440p):

  • Local patches_the_retail_image_for_1440p (run with VICTORY_DISPLAY_PROFILE_TEST_IMAGE set): 1 passed; 0 failed in 0.16s.
  • Live 75s Series X 1440p RTX 4060 Ti 8 GiB GPU run:
    • Reached real 3D world (14 windows, max 13712 draws), median FPS 9.7 fps (103.3 ms)
    • Max VRAM: 6152 MB / 6923 MB budget (over=0 MB)
    • Crashes / host texture errors: 0 / 0 | Shader translation: untranslated=1
    • Visually inspected 24 captured frames (frame-9264.png, frame-9384.png, median luma 104.08, edge energy 7.8, 0.0% near-black/magenta): 1440p HUD/minimap proportions and world rendering are clean.
**@⁠Androtim** on GitHub · 2026-11-29 06:58 UTC · [original](https://github.com/Androtim/MiniVI/pull/78#issuecomment-7252180833) Completed local retail-image patch test and live 75s Series X 1440p GPU verification on `e9a0e99` (`pr80-sx-native-1440p`): - Local `patches_the_retail_image_for_1440p` (run with `VICTORY_DISPLAY_PROFILE_TEST_IMAGE` set): **1 passed; 0 failed** in `0.16s`. - Live 75s Series X 1440p RTX 4060 Ti 8 GiB GPU run: - Reached real 3D world (`14` windows, max `13712` draws), median FPS `9.7 fps` (`103.3 ms`) - Max VRAM: `6152 MB` / `6923 MB` budget (`over=0 MB`) - Crashes / host texture errors: `0` / `0` | Shader translation: `untranslated=1` - Visually inspected 24 captured frames (`frame-9264.png`, `frame-9384.png`, median luma `104.08`, edge energy `7.8`, `0.0%` near-black/magenta): 1440p HUD/minimap proportions and world rendering are clean.
Author
Owner

@⁠Androtim on GitHub · 2026-11-29 14:31 UTC · original

Automated RTX 4060 Ti 8 GB Wave 3 A/B hardware verification passed (playtest/wave3 vs origin/main c7ed150 — 5/5 A/B gates PASS):

  • Hardware cargo test (RTX 4060 Ti): victory-gpu 542 passed, 0 failed (36 ignored); victory-shader 323 passed, 0 Wave 3 regressions (the 3 PSV0 validation failures in emit::rect::tests and emit::barycentric_tests also fail identically on origin/main c7ed150).
  • Automated 45s in-world A/B (scripts/verify-world.ps1, DLSS Quality + golden autosave):
    • FPS: median 10.25 fps vs 10.7 fps baseline (min FPS improved 6.9 vs 4.2, preparing 45.35 ms vs 50.3 ms)
    • Stability: 0 crashes / 0 DRED / 0 untranslated shaders
    • VRAM: max 5948 MB vs 6073 MB (-125 MB, 0 MB over budget)
    • Texture backlog: final_waiting=5487 vs 7350 (-1863); no room for new ones 38 vs 43
    • Residency stalls: mapped_rate=20.95 ms/s vs 37.22 ms/s (-44%)
    • Visual check: Clean rendered frames (frame-10645.png, frame-10669.png), luma 82.77 vs 23.2, edge energy 2.27 vs 1.81, magenta 0.0%.
**@⁠Androtim** on GitHub · 2026-11-29 14:31 UTC · [original](https://github.com/Androtim/MiniVI/pull/78#issuecomment-7257374948) Automated RTX 4060 Ti 8 GB Wave 3 A/B hardware verification passed (`playtest/wave3` vs `origin/main` `c7ed150` — **5/5 A/B gates PASS**): - **Hardware `cargo test` (RTX 4060 Ti):** `victory-gpu` **542 passed, 0 failed** (36 ignored); `victory-shader` **323 passed, 0 Wave 3 regressions** (the 3 PSV0 validation failures in `emit::rect::tests` and `emit::barycentric_tests` also fail identically on `origin/main` `c7ed150`). - **Automated 45s in-world A/B (`scripts/verify-world.ps1`, DLSS Quality + golden autosave):** - **FPS:** median `10.25 fps` vs `10.7 fps` baseline (min FPS improved **`6.9`** vs `4.2`, preparing **`45.35 ms`** vs `50.3 ms`) - **Stability:** **0** crashes / **0** DRED / **0** untranslated shaders - **VRAM:** max **`5948 MB`** vs `6073 MB` (**-125 MB**, `0 MB` over budget) - **Texture backlog:** `final_waiting=5487` vs `7350` (**-1863**); `no room for new ones` `38` vs `43` - **Residency stalls:** `mapped_rate=20.95 ms/s` vs `37.22 ms/s` (**-44%**) - **Visual check:** Clean rendered frames (`frame-10645.png`, `frame-10669.png`), luma `82.77` vs `23.2`, edge energy `2.27` vs `1.81`, magenta `0.0%`.
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/Androtim--MiniVI!78
No description provided.