d3d12-hle: notify mapped aliases after partial DirectStorage scatter writes (D3D12-DSTORAGE-PARTIAL-SCATTER-NOTICE) #2982
Open
github-bot
wants to merge 1 commit from
github-bot/gh-2982 into main
AGit
pull from: github-bot/gh-2982
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!2982
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2982"
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?
@EdenBendheim on GitHub · 2026-12-01 22:24 UTC · original
EdenBendheim:fix/dstorage-partial-scatter-notice→main· +150 −41 · 2 files · 1 commits · openClaimed in the coordination issue as: D3D12-DSTORAGE-PARTIAL-SCATTER-NOTICE (#2570)
What and why
In
d3d12/crates/leonida-hle/src/modules/xmem.rs,write_physicalvalidates the page list up front and then maps and copies one contiguous physical run at a time. Previously it returnedbool, so ifView::mapfailed on a second or later physical run, the earlier run's bytes were already mutated in physical memory whiledstorage.rsreceivedfalseand skippedpages_writtenfor that copied prefix (unlike the contiguous-page path, which already notifies on partial error). If retries were exhausted, mapped aliases were left mutated with no GPU completion notice.This change:
Result<(), usize>fromwrite_physical(Err(0)on validation/first-run failure;Err(done)advancing only after a run's bytes are actually copied).dstorage.rs, callspages_writtenfor any nonempty copied prefix before sleeping/retrying or returning failure, preserving existing retry counts/backoff,LEONIDA_STREAM_NOTICEhandling, and zero extra notices on the immediate-success fast path.Err(0)with zero notices), verified under both default andLEONIDA_STREAM_NOTICE=0.Tested
d3d12/(Windows 11, Ryzen 9 5900X, synthetic pages, no game files):c4ca57615production code + new test fixture):cargo test -p leonida-hle --locked→FAILED. 246 passed; 2 failed; 2 ignored(both aliases missed the 32-byte partial-prefix notices).cargo test -p leonida-hle --locked→ok. 248 passed; 0 failed; 2 ignored(plus integration test1 passed; all 3 focused scatter tests pass withLEONIDA_STREAM_NOTICE=0).cargo clippy -p leonida-hle --locked --all-targets --no-deps -- -D warnings: passed (0 warnings inleonida-hle).python -I scripts/check_no_game_data.py(both touched files and full tracked tree): passed.GPUs tested: n/a (CPU-only
leonida-hlesynthetic page tests on Windows 11, Ryzen 9 5900X + NVIDIA RTX 3090 driver 610.88)AI-assisted: yes (Gemini 4 Neon orchestrator; Codex GPT-6.2 Astra research & implementation; Codex GPT-6.1 Sol independent read-only review)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).@MoonEyes on GitHub · 2026-12-02 12:34 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 17:06 UTC · original
RUN (in game, batch of eleven render-path pull requests), each head merged with
git merge --no-ffonto main3c106eb2f, in one build: #3071c2065b540, #298265155eceb, #296400a068106, #310779333e26b, #2833823087ec3, #2947b07f64346, #291933e2e4c13, #2962a4a26ec63, #2847c8b950cb4, #3114c4ebe52de, #26640e2b6287c. 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 17.2 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, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it.
Limits: one run; free system memory was low (median 0.6 GB); arrival in the world was driven by keys and not checked on pictures. An earlier attempt of this batch is not counted: two runs were started at the same time by mistake on one GPU (no device loss in either, but the measure is not clean).
AI-assisted (Claude Code).
@MoonEyes on GitHub · 2026-12-02 18:18 UTC · original
Verification of #2982 (third party, code review on Linux; not built: Windows-only
leonida-hle)65155eceb91a7dc4d4c515d07fb00210256d641a(2 files:dstorage.rs+43/-24,xmem.rs+107/-17).c4ca57615.git merge-tree --write-tree origin/main pr/2982againstmain45dc41f95is clean(329 commits behind). CI on the head: 6/6 success.
python -I scripts/check_no_game_data.pyon both files: exit 0.3c106eb2fincludes65155eceb(PASS, no device loss).Review
write_physicalcopies one physical run at a time. IfView::mapfailed on a later run, the earlierruns' bytes had already changed while the caller got
falseand skippedpages_written, so mapped aliases werenever told. Returning
Err(copied)(xmem.rs:964-981) and noticing[offset, offset + copied)on every failedattempt (
dstorage.rs:1729-1731) fixes it at the source.dstorage.rs:1729-1752) re-copies from the start on each try, so a run noticed on a failedattempt is written again and noticed again. That is redundant but correct: an extra notice only costs a re-look.
The final failure path keeps
E_INVALIDARGand the two warnings frommain.last_os_error()is read right after the failed call. Whenruns()fails (unknown page) there was no OS call,so the logged
last_erroris unrelated. That was already the case onmain. Nit only.fail_scatter_mapandrecord_scatter_noticeare#[cfg(test)], so they cost nothing in release.The
thread_local!cells are test-onlyCell/RefCellwith no destructor, which keeps clear of the AGENTS.mdthread-exit trap (that rule is for
gta6rt.exe, but this is fine either way).scatter_noticesfails thesecond run on its first attempt and checks the bytes at both aliases and the per-attempt notices. On
mainthenotice list for the failed attempt would be empty, so this is a meaningful red. The red side does not build on
main(new signature), so it was not run here.Process
Verdict: ready (not built here).
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
@fiestorra on GitHub · 2026-12-03 05:13 UTC · original
VERIFY-2982 — el único fallo es el de la visibilidad del escritorio, con los valores a la vista
Y
left: 0, right: 0es la firma exacta del diagnóstico que ya hice:IsWindowVisibledevuelve 0 porque el escritorio de esta sesión no está visible, no porque el estilo de la ventana haya perdidoWS_VISIBLE. Mi ramahle-visible-stylecambia esa aserción por la del estilo y esta prueba pasa.Así que no es un fallo de esta PR — y con el número delante se lo puede decir a cualquier autor sin que tenga que creérselo.
El cambio: notificar los alias mapeados después de un
DirectStoragedisperso parcial —dstorage.rsyxmem.rs, 150 líneas, yxmem.rscon la mayoría (el mapa de alias es donde vive la traducción). UnDirectStorageque escribe sólo parte de un recurso mapeado tiene que avisar a los alias de esa parte, no a todos — y el caso que se rompe es una textura que se ve a medias, que es exactamente el tipo de fallo que se nota en pantalla y no en un log.Lo que verifiqué: 247 tests de
hleen verde menos el de la ventana, y el fallo es del entorno, con los dos valores impresos.Lo que no: el
DirectStorageparcial de verdad contra el juego — eso necesita el título cargando sus datos.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.