loader/hooks: cap mode table rows larger than LEONIDA_OUTPUT (D3D12-LOADER-OUTPUT-1440-CAP) #2889
Code
Clone this repository
Checkout
From your project repository, check out a new branch and test the changes.
git fetch -u origin "github-pr/2889:github-pr/2889" git switch "github-pr/2889"
Open
leonida/mandy
djrolfes wants to merge 1 commit from
github-pr/2889 into main
pull from: github-pr/2889
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/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!2889
Loading…
Reference in a new issue
No description provided.
Delete branch "github-pr/2889"
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?
This branch is out-of-date with the base branch
Reviewers 0 approvals
Details
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Claimed in the coordination issue as:
D3D12-LOADER-OUTPUT-1440-CAP.What and why
When
LEONIDA_OUTPUTasks for an output size smaller than intermediate rows of the title's mode table (2560x1440,1920x1080,1664x936, documented indocs/ultrawide.mdat.rdata0x615c0c0..=0x615c100), also cap every lower mode-table row larger than(width, height)ind3d12/crates/leonida-loader/src/hooks.rs.output_patches(width, height)previously patched only the3840x2160mode row (OUTPUT_ROW = 0x615c100), the scanout pool reservation (SCANOUT_RESERVATION), and the Settings viewport (SETTINGS_VIEWPORT). WheneverLEONIDA_OUTPUTasked for a size smaller than2560x1440(down toparse_output's1280x720minimum, e.g.1920x1080,2560x1080,1664x936,1600x900,1280x720),scanout_pool_bytes(width, height)shrank below the larger unpatched mode rows immediately precedingOUTPUT_ROW, allowing the title to pick a larger row and overflow the smaller scanout reservation.LOWER_OUTPUT_ROWScovering all three intermediate rows (OUTPUT_ROW - 0x10 = 0x615c0f0for2560x1440,OUTPUT_ROW - 0x20 = 0x615c0e0for1920x1080,OUTPUT_ROW - 0x30 = 0x615c0d0for1664x936; the1280x720row atOUTPUT_ROW - 0x40is alreadyparse_output's minimum).OwnedPatchfor every row wherewidth < row_w || height < row_h. Outputs at or above2560x1440(2560x1440,3440x1440,3840x2160) emit the exact same 3 patches as before.the_resolution_places_are_in_the_retail_executableto checkoutput_patches(1280, 720)so all 6 patches (the 3 base patches plus all 3LOWER_OUTPUT_ROWS) are validated directly against the 1.0.2.1 executable whenLEONIDA_GAME_DIRis set.#2756(D3D12-SERIESX-FSR-MAX-SCALED, which touchesrender_scale_patches, notoutput_patches).d3d12/crates/leonida-loader/src/hooks.rs,docs/ultrawide.md) + fresh red→green unit tests + live retail-executable byte check (the_resolution_places_are_in_the_retail_executable) + MEASURED 300 s in-world game gate exercisingLEONIDA_OUTPUT=1920x1080.Tested
python3 -I scripts/check_no_game_data.py d3d12/crates/leonida-loader/src/hooks.rs→ exit 0.cargo clean -p leonida-loader --target x86_64-pc-windows-msvc)leonida-loaderunit test binary (x86_64-pc-windows-msvc) and ran under Wine:origin/main(only the new testhooks::tests::output_below_table_rows_caps_every_larger_mode_rowapplied):6b4f77222(rebased onto3e7b34a52):LEONIDA_GAME_DIRset, noSKIP:):test hooks::tests::the_resolution_places_are_in_the_retail_executable ... ok(all 6 output patches verified against 1.0.2.1 binary).test result: ok. 85 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out.6b4f77222, Series S + DLSS Quality1280×720 → 1920×1080,LEONIDA_OUTPUT=1920x1080exercising the2560x1440row cap live, Option Amods/gate_drivermode = roamloaded):310.78 sin-world after world entry at62.62 s; also passed an earlier cold-cache 310.93 s run with0errors).3,319frames after +60 s (3,427total world presents),15.89median FPS (16.22end median FPS),111.28 msp95 frame time,4.677 slongest present gap (<= 10.0 s).6,678 MiBpeak VRAM (<= 7,400 MiB),0device losses (0x887A0005),0crashes,0panics,0faults before stop,0kernelNVRM: Xiderrors.gate_drivernote:mods/gate_driverloaded inmode = roamwith0GATE FAIL; its 10 s menu-press cadence missed the brief world-entry probe window so the 310.78 s run stayed on the in-world camera cleanly at15.89FPS.GPUs tested: NVIDIA GeForce RTX 3070 Ti 8 GB, driver 620.73.04, Arch Linux (Wine 11.22 + VKD3D-Proton 3.2.0).
AI-assisted: yes (authored by Gemini 4 Neon; independent fresh review pass by a separate Gemini 4 Neon agent requested capping
< 1080prows and validating all rows inthe_resolution_places_are_in_the_retail_executable, addressed and approved in re-review).Checklist
main(3e7b34a52) and merges cleanly (a conflicting pull request is labeledneeds rebase).check_no_game_data.pyclean on both source and PR description).docs/design.md, with how it was confirmed. (n/a — loader output-mode table patch)Readback of the complete synthetic output table after apply_all at 6b4f7722 + 0ff8a532f. The Win64 fixture uses the real patch planner and write routine on a private synthetic mapping under Wine 11.22.
The refresh and flag fields stayed intact and the scanout reservation matched the requested size in all cases. Corrupting the expected bytes for the final planned write rejected the group before modifying any earlier entry. The same readback assertion fails on main and passes on the PR. This covers the table update and preflight; actual mode selection by the title was outside the fixture.
MEASURED with synthetic inputs. AI-assisted (Codex).
Verified on native Windows 11 (MSVC target, rustc 1.98.1), since the runs in the description are under Wine.
Head
6b4f77222merged withmaind2a564b66(clean merge):cargo test -p leonida-loader --lib: 85 passed, 0 failed.cargo clippy -p leonida-loader --all-targets: no warnings.the_resolution_places_are_in_the_retail_executableprintsSKIP: LEONIDA_GAME_DIR is not sethere (no game files on this machine), so the retail byte check rests on the author's run.The new test catches the change:
false(themainbehaviour),output_below_table_rows_caps_every_larger_mode_rowfails athooks.rs:604,left: 3, right: 4;||turned into&&, it fails athooks.rs:610on the 2560x1080 case,left: 3, right: 4. So the ultrawide case with only one dimension below the row is covered too.Not checked: the game itself, and what the title does with several identical rows after capping (for example 1280x720 turns the three rows above it into 1280x720 too).
GPUs tested: n/a (CPU unit tests only).
AI-assisted: yes (Claude Code).
CI diagnosis for the dependency discussion on #2958. The failed Windows check and Linux Python job both annotated the same five Python files in run 46681212676. The base commit 0ff8a532f had its own failed push run (46678721362): both jobs already reported test_wave_diff.py, test_wave_trace.py, test_x64_recomp.py and test_x64_recomp_qemu_runner.py there. The fifth file, test_piecewise_parse.py, was only annotated on the PR run. The Linux log shows its code-object comparison failing for scripts/run_gpu_tests.py. I checked the actual CI merge commit 24d9f6499 against its first parent: only d3d12/crates/leonida-loader/src/hooks.rs changed, so the Python test and script are identical. This establishes four pre-existing failures; the fifth remains unexplained. A fresh CI run after updating the base would give a current verdict. Base run · PR run. Codex-assisted.
Follow-up: I reproduced the fifth failure on the base alone (0ff8a532f), with Windows CPython 3.12.10 and PYTHONHASHSEED=0. For scripts/run_gpu_tests.py, the piece sizes 1, 40 and 300 all failed the code_facts comparison. An equal frozenset constant had a different repr iteration order. Normalizing only the frozenset representation made all three comparisons pass, including the bytecode and line-position fields. Both historical Linux CI runs used CPython 3.12.16. Main already contains the corresponding normalization in 9b7674d64. This accounts for the previously unexplained failure without the loader change. A new hosted run is still needed for current CI status. Codex-assisted.
Local integration check: PR head 6b4f77222 merged cleanly into main 5b03c688b (tree 29a8f1b82). I ran all five previously failing suites on Windows with CPython 3.12.10. The parser, wave diff, wave trace and QEMU-runner wrapper passed all 53 tests. The x64 recompiler suite passed 15, with 34 skipped because qemu-system-aarch64 was unavailable. Total: 68 passed, 34 skipped, zero failures. This is a local result; the hosted check still needs a fresh run.
This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
RUN (in game, batch of five render-path pull requests), each head merged with
git merge --no-ffonto main3c106eb2f, in one build: #2993ddc10507d, #2889bc390c26f, #2851cf8f7be78, #298012c14a999, #2994fccce4485. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 16.7 fps today on main with single pull requests or other batches. These fps are a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch. If one of these pull requests changes its head, this run no longer covers it.
Limits: one run; free system memory median 2.5 GB; arrival in the world was driven by keys and not checked on pictures.
AI-assisted (Claude Code).
Verification triage of #2889
Head
bc390c26fis already verified: native Windows unit checks, and MoonEyes' in-game batch run on this exact head (2026-12-02 16:10). CI passes (6/6) and the PR merges cleanly withmain45dc41f95. No new run here (Windows-only). Verdict: ready (already verified on this head).AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
VERIFY-2889 —
leonida-loaderen verde con el cambio, y el tope protege al registro de eventosUn fichero,
hooks.rs+64/−4, cinco días abierto:El cambio, por su título: recorta las filas de la tabla de modos que son más grandes que
LEONIDA_OUTPUT— y eso importa porque la tabla de modos se escribe en el registro de eventos, y una fila gigante es una entrada de registro gigante (el límite de Windows para un mensaje es de decenas de miles de caracteres, y pasarse pierde la entrada o la trunca, no la falla).Lo que verifiqué y lo que no: 91 tests del crate pasan, que es lo que un cambio en
hooks.rspuede prometer sin Windows de verdad; no probé una fila de un megabyte entrando en el registro, porque eso necesita un proceso con su propio log y un límite alcanzado.Y una nota sobre el nombre:
LEONIDA_OUTPUTes la variable que el jugador puede poner para ver más salida, y el tope se aplica justo a lo que esa variable controla — o sea que subirla sube el tope, que es lo que uno espera, y no hay un límite escondido en el código.In-game gate run on an RTX 4060 8 GB (driver 610.88, Windows 11), in a batch of #2915, #2896, #2893 and #2889 merged into main
09273248c; this PR tested at its current headbc390c26f. Series S 1080, DLSS FG 2x,play-nvidia.ps1 -SeriesS -Resolution 1080 -FrameGen 2 -PrecompileUsed, scripted walk, 330 s, screen kept on.AI-assisted (Claude Opus 5.5), run and read by MoonEyes' agent.