d3d12: fix oversized HUD and menus at native 1440p #3124
Closed
leonida/mandy
Rulemore wants to merge 0 commits from
fix/native1440-ui-v2 into main
pull from: fix/native1440-ui-v2
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!3124
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/native1440-ui-v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request closed
This pull request cannot be reopened because the branch was deleted.
Claimed in the coordination issue as D3D12-NATIVE1440-LEGACY-UI.
Replaces #3014, which was closed after
hooks.rsdiverged frommain. Related output-planner work in #2889 and #2958 may need conflict resolution when combined. This patch can land independently.What and why
On Series X at native 2560×1440, the game lays out 4K-authored HUD and menu elements on a 1440p stage, making them about 1.5 times too large. Restore the legacy 3840×2160 UI layout from DexNom/VIctory via VIctory-NVIDIA, while keeping render and output resolution at 2560×1440 for the native profile. The settings copy enables legacy UI and sets the layout and output sizes. The 94 MiB UI pool holds two 4K layout surfaces and two 1440p targets.
The loader checks the original settings-copy site and trampoline padding and stages all page permissions before writing the patch group. The port retains the current Series S budget handling, the optional FSR maximum-scale behavior, and the separate mode-table path for other output sizes.
docs/ultrawide.mddescribes the two paths.Tested
mainand passes with this change.cargo test --locked -p leonida-loader --libpassed all 96 tests on Windows, including verification against the supported 1.0.2.1 image and tests of the Series S budgets and FSR levers.git diff --checkpassed.GPUs tested in #3014: NVIDIA GeForce RTX 4070 SUPER, driver 617.14, Windows 11 build 26200. No GPU run on this revision.
AI-assisted: OpenAI Codex (GPT-6.2 Sol) for the update and GPT-6.2 Sol in a separate read-only review. Both review findings were addressed and rechecked.
Checklist
main(f45165e15).Ran natively on Windows 11, head
64600ef0cmerged into currentmain(23a51c494, newer than thef45165e15base in the description; the merge was clean), debug build with overflow checks on.d3d12/)cargo test --locked -p leonida-loader --lib(debug)cargo test --locked -p leonida-loader --lib --releasecargo clippy --locked -p leonida-loader --libcargo clippy --locked -p leonida-loader --lib --testsI had no game image here, so
the_resolution_places_are_in_the_retail_executableprintedSKIP: LEONIDA_GAME_DIR is not setand counts as a pass. The settings-copy hash, the 590xccbytes at0x55ff285and the reservation bytes are therefore checked only by your run against the 1.0.2.1 image.What I added: the new
apply_alltests mockVirtualProtect, so I ran the realapply_allon pages fromVirtualAlloc, withVirtualQuerybefore and after (throwaway tests, not committed).main(23a51c494)Both writes land and the function returns 2. The cause is that staging calls
VirtualProtecton the first member, which turns page 1 RWX. The crossing member is staged next, and theoldit gets back is the protection of its first page, now RWX. In the reverse restore that member puts pages 1 and 2 back to RWX, and the first member then puts only page 1 back to RX. Onmaineach patch restores right after its own write, so the same layout ends RX on all three pages. The failure path (a laterwritablefailing) restores the same way, so it has the same issue.None of the groups in the tree today has a member that crosses a page. The native group is
0x247ad4a+5,0x55ff285+59 and0x1d70b98+11, and the experimental output and Series S groups don't cross either. So this is latent. The comment above the restore loop says reverse order handles shared pages, though, and that holds only for members inside one page. Staging per page would close it: collect the distinct pages of the group,VirtualProtecteach page once, remember each page's own old value, and restore those.Other checks:
vmovdqu [rsi+0x638], ymm0,mov byte [rsi+0x638], 1,mov rax, 0x00000870_00000f00stored at+0x63c,mov rax, 0x000005a0_00000a00stored at+0x654,vzeroupper, thenjmp. That's 57 bytes plus two0xccof padding. The jump into the cave from0x1d70b98lands on0x55ff285, and the jump back at0x55ff2b9lands on0x1d70ba3, the end of the 11-byte site. The three members don't overlap.scanout_pool_bytes(3840, 2160) + scanout_pool_bytes(2560, 1440)(64 + 30 MiB) and is 2 MiB aligned. The test could compute it that way instead of hard-coding94 << 20.Not checked: the game; the bytes against the retail image (no image here); whether
raxis free at0x1d70ba3, since the cave overwrites it with no save/restore; and the 8-byte store at+0x654, which ends 4 bytes past the 32 bytes the originalvmovdquwrites (+0x638..+0x658). Both need the disassembly around the site.GPUs tested: n/a (CPU-only tests).
AI-assisted: yes (Claude Code).
Verified PR #3124 (
64600ef0c) merged cleanly ontomain(acc350745) on Windows 10 x64 (Rust 1.98.1):python -I scripts/check_no_game_data.pyPASS.cargo test -p leonida-loader --lib --locked-- 96 passed, 0 failed (includinghooks::tests::native_1440_keeps_the_legacy_ui_stageandhooks::tests::native_ui_trampoline_sets_layout_and_output_and_returns_after_the_copy).Verdict: PASS (CPU/unit tests only; no game launch).
AI-assisted: yes (Antigravity).
Verification of #3124 (third party, code review on Linux; not built: Windows-only
leonida-loader)64600ef0c8403ec1f4816d7edf12da28bd309a3e(2 files:leonida-loader/src/hooks.rs+273/-36,docs/ultrawide.md).f45165e15.git merge-tree --write-tree origin/main pr/3124againstmain45dc41f95is clean(104 commits behind).
python -I scripts/check_no_game_data.pyon both files: exit 0. The patch carries a BLAKE3 hash of the 11original bytes at
SETTINGS_COPY, plus the re-emitted 8-bytevmovdquandvzeroupperin the cave. That isthe same "expected bytes" convention the other hook groups in
hooks.rsalready use. No game data beyond that.git merge-tree pr/3124 pr/2889conflicts inhooks.rs. Both changeoutput_patches. The bodynotes this.
Review
(1.5x too large). The fix keeps the mode row and Settings viewport stock. A trampoline at every settings copy
(
native_1440_patches,hooks.rs:181-224) sets the legacy-UI flag, a 3840x2160 UI size and a 2560x1440output, and the scanout pool grows to 94 MiB for both surface pairs. This is a root-cause fix for the UI scale.
vmovdqu [rsi+0x638], ymm0= 8, plusvzeroupper= 3). The cavereplays both, so nothing of the original is lost. The
jmpback is computed fromcode.len()before the0xccfill. The cave is checked as 59 bytes of
0xccbefore it is written. I found no defects here.native_1440p.rs(GPL-3.0-or-later), and therepository is GPL-3.0-or-later. That is compatible. Pin the source commit, as
runtime/shims/xg_xs_THIRD_PARTY.mddoes for VIctory, so the provenance can be checked.
apply_allbecomes an all-or-nothing transaction for every hook group(
apply_all_with: overlap check, stagedVirtualProtect, re-validation, rollback). It is well built andtestable through injected closures, but it changes how render-scale, FSR and max-step groups apply. CONTRIBUTING
asks for one topic per pull request. Either split it out or say in the body why the native profile needs it.
hooks.rs:591replaces thewarn!"experimental, the title's largest output mode ischanged" with an
info!for all sizes. Sizes other than 2560x1440 are still experimental (the doc commentsays so), so keep the warning for them.
native_1440_keeps_the_legacy_ui_stageand the transaction tests ran natively for Kal0s-design(96 passed) and lixonik.
Process
Verdict: defects (minor). Restore the experimental warning for non-1440 sizes, pin the VIctory source commit,
and split out or justify the
apply_alltransaction change. Coordinate thehooks.rsmerge with #2889.AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
RUN (in-game RTX 3090 300 s stress gate, 14-PR combined batch) — PASS covering exact head
64600ef0c8403ec1f4816d7edf12da28bd309a3e(merged cleanly ontomainb41763227; note PR currently shows a merge conflict against newermain).git merge --no-ffontomainb41763227(diagnostics,dlss,mimalloc,exe_sha16 = c47eeb717f761d9d; changed-file clean-room scan exit0; workspace test targets compiled).14PRs):#3200d1a91afd1,#319880a627bb1,#319193b47ac9d,#3189c182fc392,#3176ae0075d9a,#3168337388052,#31641065952da,#3146ebc0253ff,#312464600ef0c,#3069311d33a40,#30318df1bfce7,#3029e49404808,#3054ff53fd8b9,#3010d645712a3.610.88, Series X profile, native2560x1440,-NoFrameGen,scripts/game-gate.ps1(301.3 sin world) with downtown street-level teleport + 8-leg dynamic sprint/turn/strafe stress mod (GATE CONTROL moved=2.51 m,max_from_ctrl=5,053.9 m).c47eeb717f761d9d)mainb41763227baseline (cf499737bf684f6a)clean,0reasons,0warnings)clean,0reasons,0warnings)301.3 s(4,504frames)305.6 s0/0/00/0/020.10 FPS/69.76 ms19.13 FPS/74.01 msVerdict: PASS for the 300 s native 1440p stability gate on
64600ef0c(visual HUD sizing was not separately inspected in screenshots; once rebased onto currentmain, the new head will need a fresh run).(AI-assisted verification:
gemini-4-neon+gpt-6.2-astra.)VERIFY-3124 — Windows nativo: la suite del
loaderpasa, y el guardián que queda es el que se queda64600ef0c—leonida-loader/src/hooks.rs(−13),docs/ultrawide.md(2 lines)Ran
What the change is: it removes
native_1440_patch_guards_match_the_supported_image— a test that only ran withLEONIDA_GAME_DIRset to the user's own image and returned silently when it was not — and clarifies one line ofdocs/ultrawide.md("the old mode-row implementation ofLEONIDA_OUTPUT_1440").The thing I checked before nodding at a deletion: the guard does not disappear, it is deduplicated.
hooks.rs:1001keeps the env-gated retail check, and it printsSKIP: LEONIDA_GAME_DIR is not setinstead of returning quietly — which is the difference between a test that did not run and a test that looks like it passed. That is the same distinction half of my reviews tonight have been about.So:
red not constructible— nothing here adds behaviour, and the check that remains is the same one, run through the profile it names. What a deletion like this costs is the thing to state plainly: the removed copy never ran in CI either (noLEONIDA_GAME_DIRthere), so nothing that was being verified stopped being verified. What it did run on was an author's machine, twice, for the same answer.What I could not test
LEONIDA_GAME_DIRis not set here, so the kept test printed its SKIP line — the only machine that can run it is one with the Xbox package.Written with an AI assistant.
Correction: this is not a small dedupe — it is three commits and 293 added lines, and my earlier review read only the top one
When I verified this pull request I read the commit
git log --first-parentshowed me (64600ef0c, "keep one retail guard test") and ran the loader's suite — 96 tests, green. The branch is three commits:So the file that conflicts with
mainishooks.rs, and the conflict is not in the test I read — it is in theVirtualProtect/copy_nonoverlappingloop that makes a batch of patches writable or none of them, which is what the third commit reworks.git rebase origin/mainstops there, and I am not resolving it: it is 293 lines of someone else's hooking code that I have not read, and a resolution I invented would be the least verified thing I could put in this queue.What this corrects in my record: my verification covered the top commit and the loader's test suite, and I presented it as "the change" — for a three-commit branch that is the same mistake I flagged in
#3128an hour ago. The suite being green is still true (96 tests on the branch's head), but it is green for all three commits, not the one I described.What the whole branch is for, from the messages: the native 1440p output with the legacy UI layout draws an oversized HUD (
hooks.rs,docs/ultrawide.md), and the top commit tidies the retail guard test that proves it and clarifies the doc's historical probe. That is a real bug with a real fix, and it deserves a review of the 293 lines — which is what it has not had from me.A note for the queue: of the seven pull requests that conflict after
#3247, four are stacks (#3124here,#3128,#3253which I rebased, and#3115), and in three of them the conflict is in a commit that a reviewer would not reach by looking at the top.Depends on:in the description is the only thing that makes that visible from the outside, and none of the four says it.Written with an AI assistant.
This pull request has a merge conflict with current
main(d9b618f10), so it can't be run in game or merged as it is. Could you merge the latestmaininto it (or rebase onto it) and resolve the conflict? Once the head is updated, the in-game gate run can be done on the new head.AI-assisted (Claude Code).
Thanks for the work on this. This pull request has a merge conflict with the current
mainand has had no new commit, comment or review for more than 5 hours, so I am closing it to keep the list of open pull requests manageable. This is not a judgement of the change. Whenever you like, merge the latestmaininto your branch, resolve the conflict, and reopen it (or open a new pull request that links this one). Please re-run the relevant tests on the new head; a reviewer will look at it when time allows, with no guarantee of timing or outcome.Generated by Claude Code