Preserve the D3D12 device removal reason in the process exit #3213
Closed
github-bot
wants to merge 1 commit from
github-bot/gh-3213 into main
AGit
pull from: github-bot/gh-3213
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!3213
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3213"
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?
@ubiquitarianism on GitHub · 2026-12-02 19:35 UTC · original
ProjectLeonida:t3/propagate-host-failure-hresult→main· +79 −13 · 5 files · 1 commits · closed without mergingClaimed in the coordination issue as D3D12-HOST-FAILURE-HRESULT. Claim
Depends on: #3146 (overlapping callback edit). Whichever PR lands second must retain the pipeline-book flush between crash logging and
TerminateProcess. #3210 combines cleanly with this change and handles the PowerShell wrapper's exit-code forwarding.What and why
The D3D12 host failure callback now carries the failing HRESULT from
GetDeviceRemovedReasonthrough to the Windows process exit status. Crash diagnostics are preserved. If there is no removal reason, the process still exits withDXGI_ERROR_DEVICE_REMOVED(0x887A0005).The game gate classifies REMOVED, HUNG, and RESET as
device_lostfrom either signed or unsigned exit codes, including when no crash log reaches the gate. This change affects failure reporting only.Tested
device_lostin both signed and unsigned form.cargo test -p leonida-hle --locked --libpassed 249 tests with two ignored benchmarks.python -I tests/test_game_gate.pyandpython -I tests/test_game_run_summary.pypassed all 53 tests, including 36 gate tests.python -I scripts/check_no_game_data.pypassed.GPUs tested — N/A. Verification used synthetic inputs on Windows without game files or GPU hardware tests.
AI-assisted — GPT-6.2 Sol implementation and separate read-only GPT-6.2 Sol review of head
9a9966901aedf147874e0a5764433ce4e7263e52.Checklist
mainand merges cleanly.@merzleckeier on GitHub · 2026-12-02 19:55 UTC · original
Reproduced both CI failures on
9a9966901.tests/test_d3d12_switches.pypasses onb41763227and fails on this head becauseLEONIDA_TEST_HOST_GPU_REMOVAL_REASONis missing fromd3d12/docs/switches.md. The catalog includes an Only in tests section. Regenerating it would add the test name. In a scratch checkout, changing the private subprocess marker toTEST_D3D12_HOST_GPU_REMOVAL_REASONalso made the catalog check and all 20 switch tests pass. Linux job · Windows job.For the combined diagnostics path with #3210, I also fed the summary signed and unsigned
0x887A0006. Withgame_exitedboth producedevice_lostand preserve the hex code. With onlylauncher_exited, which #3210 emits if the supervisor never observes the child, the summary returnsnot_startedwith a null exit code. This is a separate follow-up to preserve the available diagnostic in the early-exit path. Synthetic events only.AI-assisted: OpenAI Codex (GPT-6).
@fiestorra on GitHub · 2026-12-02 20:44 UTC · original
VERIFY-3213 — Windows nativo: el código de salida lleva la razón real, con control sintético
(this PR)b41763227= currentmainmain—merge-treeclean,git merge --no-ffcleanRan
The one Rust failure is this machine's:
modules::lifecycle::tests::borderless_from_the_start_stays_shown_when_framed_againfails identically on cleanmain(247 passed, 1 failed) and also alone, with no interactive desktop — it is a window-lifecycle test, not this change.Negative controls
tools/game_gate.pyreverted tomain, tests kept →FAIL: test_device_loss_exit_codes_fail_after_the_stop_without_a_crash_log.removal_reason.unwrap_or(DXGI_ERROR_DEVICE_REMOVED)with the constant, rebuilt and ran the test →assertion left == right failed: expected 0x887a0006, got 0x887a0005. The test really does read the process exit status, and it fails exactly the way the old code behaved.Read, so the claim is not just the test's:
fail()takes the reason fromhost.device.GetDeviceRemovedReason()'sErr(e)(host.rs:1396), not from the HRESULT of whatever call failed — so the exit code can now be0x887A0006(device hung) or0x887A0007(device reset) instead of always the generic0x887A0005. That is whatgame_gateneeds to tell a removal from a hang. The test spawns itself three times (two synthetic reasons and none) and comparesoutput.status.code()with the expected value, plus the crash text on stderr.What I could not test
Verdict: red then green on native Windows, with the propagation proven at the process level.
Written with an AI assistant.
@lixonik on GitHub · 2026-12-02 21:04 UTC · original
Verified PR #3213 (
9a9966901) merged cleanly ontomain(8a9235d02) on native Windows 10 x64 (Rust 1.98.1):python -I scripts/check_no_game_data.pyPASS.test_game_gate.py:maintools/game_gate.py+ PR tests): FAILED (failures=4, skipped=2) ontest_device_loss_exit_codes_fail_after_the_stop_without_a_crash_log(2289696774,-2005270522,2289696775,-2005270521).cargo test -p leonida-hle --lib --locked d3d12x::-- 2 passed, 0 failed (includinghost_gpu_failure_sets_the_process_exit_code).cargo test -p leonida-gpu --features diagnostics --lib --locked host:: -- --skip depth_bounds_pipeline_loads_and_filters_draws-- 168 passed, 0 failed, 24 ignored (pre-existing Win10 test tracked in #2855 skipped).Verdict: PASS (Windows unit + Python tests; no game launch).
AI-assisted: yes (Antigravity -- Gemini 4 Neon).
@MoonEyes on GitHub · 2026-12-02 22:00 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).
@limittox on GitHub · 2026-12-03 04:40 UTC · original
RUN (in game): this PR alone against
mainalone, 3 runs each, interleaved. No device loss or crash in any run. No fps difference that three runs can resolve. The changed failure path was not triggered.9a9966901merged ontomain2791b7756withgit merge --no-ff --no-commit, built, then the merge was aborted. There were no conflicts:mainhasn't touched the PR's files since its base.main2791b7756alone.-Dlss quality(1280x720 → 1920x1080).main, PR, PR,main,main, PR.mainmainmainmain25.4–25.5, PR 24.3–25.8.mainrun was 11.2 fps.What this doesn't cover: the change itself.
fail()→host_gpu_failednever ran, and the new exit status was not observed on hardware.tools/game_gate.pyclassification of exit codes wasn't exercised either.Limits: one machine, DLSS quality only, scripted input, picture checked only for blank frames.
AI-assisted: Claude Opus 5.5 (Claude Code) built both versions, scripted the runs and wrote this report. A separate read-only reviewer agent rechecked it against the raw logs.
@merzleckeier on GitHub · 2026-12-03 05:00 UTC · original
Integration check on this head
9a996690and #3146ebc0253fovermaind9b618f10. The sole source conflict is inhost_gpu_failed. The scratch resolution keeps crash logging, thenknown::flush_on_gpu_failure(), thenTerminateProcesswith the supplied HRESULT or REMOVED fallback.That tree built for Windows MSVC. Under Wine, the subprocess test passed for HUNG, RESET, and the fallback, and both of #3146’s writer tests passed (request acknowledgement and bounded wait). Regenerating
d3d12/docs/switches.mdpicked up the test-only marker and all 20 catalog tests passed on the scratch pair.Separately, current
mainplus #3218 passed 38 gate tests and 17 summary tests. Adding this head gave 39 and 17, respectively. All of these checks used synthetic inputs. The paired run verifies the subprocess status and writer tests; the game run in the preceding comment covers live rendering. AI-assisted with OpenAI Codex.@MoonEyes on GitHub · 2026-12-03 18:03 UTC · original
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
Pull request closed