loader/hooks: cap mode table rows larger than LEONIDA_OUTPUT (D3D12-LOADER-OUTPUT-1440-CAP) #2889
Open
github-bot
wants to merge 1 commit from
github-bot/gh-2889 into main
AGit
pull from: github-bot/gh-2889
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
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
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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/ubiquitarianism--leonida!2889
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@djrolfes on GitHub · 2026-12-01 15:36 UTC · original
djrolfes:djrolfes/loader-hooks-output-1440-cap→main· +64 −4 · 1 files · 1 commits · openClaimed 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)@merzleckeier on GitHub · 2026-12-01 16:10 UTC · original
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).
@Kal0s-design on GitHub · 2026-12-01 17:20 UTC · original
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).
@KelboLive on GitHub · 2026-12-01 17:34 UTC · original · reviewed
The logic is right:
width < row_w || height < row_h(hooks.rs:171) is exactly "either dimension exceeds the request", and sincescanout_pool_bytesis monotone in both dimensions, no selectable row can then need a bigger pool than the reservation.apply_allpreflights the added rows before any write (:478-493), so a mismatched lower-row byte refuses the whole change as documented, and exact-limit rows are untouched. The<=mutation fails the new test athooks.rs:604(5 vs 4), so the boundary is covered; 85/85 lib tests, and the merges with #2890/#2891 are clean.Two nits:
docs/ultrawide.md:130-132still saysLEONIDA_OUTPUTchanges "the first three together" — it now changes up to six rows. Update it in this PR.CI is red only on unrelated Python tool tests (files that moved after this PR's base); a rebase onto current main should clear it. Note the retail-bytes test passed vacuously here (
LEONIDA_GAME_DIRunset), so the six byte sites are still only validated on a machine with the 1.0.2.1 executable.@andrew-ai on GitHub · 2026-12-02 00:59 UTC · original
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
0ff8a532fhad 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.@andrew-ai on GitHub · 2026-12-02 01:02 UTC · original · edited 2026-12-02 01:05 UTC
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 in9b7674d64. 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
6b4f77222merged cleanly into main5b03c688b(tree29a8f1b82). 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.6b4f772220tobc390c26f5@MoonEyes on GitHub · 2026-12-02 12:30 UTC · original
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).
@MoonEyes on GitHub · 2026-12-02 16:10 UTC · original
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).
@MoonEyes on GitHub · 2026-12-02 18:28 UTC · original
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
@fiestorra on GitHub · 2026-12-03 03:56 UTC · original
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.@MoonEyes on GitHub · 2026-12-03 17:26 UTC · original
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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.