d3d12: say how many submissions were not yet seen finished when the device went (D3D12-REMOVAL-CONTEXT-IN-AIR) #2705
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2705"
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?
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-11-30T09:07:09Z.
Claimed in the coordination issue as: D3D12-REMOVAL-CONTEXT-IN-AIR (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7273688756)
What and why
When the host device is removed,
host::removal_contextwrites what the submitting thread was doing. For every phase except "waiting for the card" it appends "(nothing of ours was running on the card)". With submissions sent ahead, the submitting thread is often preparing the next submission while earlier ones haven't been seen finished. The same line then ends withsubmissions started X finished Y, and X > Y contradicts the claim that the card was idle. Someone reading a removal report takes the wrong lead from it.The phase text now comes from a small
submitting_phase(phase, in_air), wherein_airisSTARTED - FINISHED: the submissions of ours started and not yet seen finished. It says "nothing of ours was running" only when that number is 0. Otherwise it gives the number, as "1 submission / N submissions of ours started and not yet seen finished" (STARTEDcounts a submission from the start of its preparation, so the one being prepared is included; wording corrected ind35907845after review). That count is of what wasn't observed complete, not proof that those lists were still executing, and the wording says only that. "Waiting for the card" and everything else in the report are unchanged.This is the same change as TaynanGT/Vice-Tay#451 on the same code (VIctory lineage).
Tested
host::trail::the_removal_phase_names_submissions_not_yet_seen_finishedchecks the five shapes (idle, 1, N, waiting, copy-back). As a negative control, ignoringin_airmakes it fail. The existingthe_removal_report_says_the_newest_things_donestill passes.cargo test -p leonida-gpu --lib: 560 passed, 0 failed, 50 ignored.cargo clippy -p leonida-gpu --all-targets: no warning in the changed lines. The workspace-wide-D warningsrun already stops onmain, inleonida-luaandleonida-shader.GPUs tested: n/a (CPU unit tests)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-30T09:34:10Z.
Independent Wine check of
0695de54merged ontomain171af5d93. The two stockhost::trailtests passed on RTX 4070 SUPER (NVIDIA 620.73.04) and Radeon 610M (RADV 26.3.1), Wine 11.22, VKD3D-Proton 3.1.0, Rust 1.98.1 MSVCdiagwith diagnostics.There is a distinction between started and sent in the report.
Host::submitincrementsSTARTEDatsubmit: gathering what to ask about, before preparing the lists and advancing the queue sequence or callingExecuteCommandLists. ConsequentlySTARTED - FINISHEDincludes the current submission during preparation.I captured the actual
removal_context()immediately after that increment in a fresh process submitting a synthetic 512-byte copy. On both real adapters the snapshot had queue sequence0,STARTED=1,FINISHED=0. The line waspreparing a submission (1 submission of ours sent and not yet seen finished). After the synchronous submission returned, the queue sequence was1,STARTED=FINISHED=1, and all 512 readback bytes matched. The test invoked the formatter alone during preparation and completed on healthy GPUs.I verified the wording
1 submission of ours started and not yet seen finished(plus the plural equivalent) in a local comparison. Both stock tests and the new preparation test passed, 3/3 on each GPU. This wording describes the existing counter, including preparation.AI-assisted: yes (OpenAI Codex).
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-11-30T09:40:04Z.
Thanks, that's right:
STARTEDis counted at the start of preparation, so the one being prepared is inSTARTED - FINISHED. Pushedd35907845, which says "started and not yet seen finished" (singular and plural) and notes in the doc comment what the counter includes.host::trailtests pass (2/2).AI-assisted: yes
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-30T09:47:11Z.
Confirmed
d35907845merged ontomain4014af7fewith the original synthetic 512-byte copy under Wine 11.22 / VKD3D-Proton 3.1.0. On both RTX 4070 SUPER and Radeon 610M the report now says1 submission of ours started and not yet seen finishedwhile the queue sequence is still 0. After submission, all 512 bytes match. The two stockhost::trailtests and the preparation probe passed 3/3 on each adapter.AI-assisted: yes (OpenAI Codex).
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T15:27:55Z.
Independent check on Windows (not the author), at
d35907845.cargo test --locked --jobs 8 -p leonida-gpu --lib -- --test-threads=8: 560 passed, 0 failed, 50 ignored in 14.2 s.The diff is
host.rsonly (no new unit test), so this is compile + regression coverage; I did not repeat the Wine/512-byte-copy scenario already reported above.Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, NVIDIA RTX 4070 Ti SUPER (driver 621.01), Rust 1.98.1 pinned.
AI-assisted: yes (opencode).
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-11-30T15:42:35Z.
@KelboLive thanks for the Windows run. One correction: the diff does add a unit test in
host.rs,host::trail::the_removal_phase_names_submissions_not_yet_seen_finished, which checks the in-air count in the removal-phase text (cargo test -p leonida-gpu --lib -- the_removal_phase_names).AI-assisted: yes
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T08:33:53Z.
RUN - VERIFY-2705-RTX4060 - by MoonEyes (another person than the author) on head
d35907845, with #2836, #2835, #2695, #2696, #2689, #2699 and #2705 merged together intomain9372a4d4f(clean).main9372a4d4fand thenmain+ the seven, one run each, same save: 0 device lost, 0 panics, 0 exceptions in both, about 490 s in the world each, alive at the time limit. Frame rate median 17.8 with the seven and 15.0 onmain, not a comparison: other work ran on the PC during themainrun.main9372a4d4f+ the seven (Windows): leonida-hle 243, leonida-gpu 602, leonida-formats 47, leonida 47, leonida-shader 403 of 405: twosource_hash_testsfailed on a stale build script of mine (a target folder shared with an older branch) and pass after a rebuild of it (3 of 3).Limits: one card, one run per arm, two arms only, the seven together. Values only, no game data.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T09:24:38Z.
Merging. Head
d35907845merges cleanly withmain3bf2844a5and does not force a rebase of #2566. CI green on this head and on main. In-game run on the RTX 4060 posted above (this head, with the six others, about 490 s in the world, 0 device lost, pictures compared with main). Tests on main + the seven: leonida-hle, leonida-gpu, leonida-formats, leonida, leonida-shader, 0 failed. Verified on it by KelboLive (Windows) and merzleckeier (Wine). Merged by MoonEyes.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-01T09:33:24Z.
done: the merge is clean on Windows:
descriptor/host.rs's sibling,host.rs, and the runner's suite with it.main7fbcd456e(after #2705, two commits,host.rs+36/-9), three runs ofcargo test -p leonida-gpu --lib:Three runs because this crate is the one with the known concurrency flake - and none of them hit it, which is a sample of three and not evidence the flake is gone. What the three do establish is that the merge did not introduce a failure: 600 is one more than
mainhad before, so #2705 brings a test with it.And it lands on top of #2766 and #2852's area without any of the descriptor tests moving, which is the third change to
descriptor/host.rsorhost.rstoday that the suite has absorbed.AI-assisted: yes - DeepSeek v4.1 (flash), three runs on the merged tree.
Written with an AI assistant.