Report D3D12 background processing request failures #3301

Open
merzleckeier wants to merge 2 commits from upstream-pr/3301 into main
merzleckeier commented 2026-12-03 06:08:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T06:08:55Z.


Claimed in the coordination issue as D3D12-BACKGROUND-REQUEST-RESULT.

What and why

When LEONIDA_D3D12_BACKGROUND=0 is requested, the startup log says the background shader work is switched off even if the request returns an error. If the device lacks ID3D12Device6, there is no log for the request. This makes the applied policy hard to establish from a device-removal report.

Keep the success message for a successful D3D12 call. If the interface query or the API call fails, warn once during device creation and include its HRESULT. Either result allows device creation to proceed. The switch, default, and D3D12 call arguments are unchanged. This covers the existing startup request from host.rs. It does not import the runtime scheduling policy from closed #2847.

Tested

  • Compiled the exact old and new Rust call sites into synthetic D3D12 probes with MSVC. On AMD Raphael with Wine 11.22 / VKD3D-Proton 3.1 (0bb64c56, RADV 26.3.1), the old probe logged switched off with ok=false. The new one warns that the work could not be disabled and logs hresult=0x80004001. Both probes exit successfully; setting the switch to 1 produces no request log.
  • Built the leonida-gpu diagnostics library tests for x86_64-pc-windows-msvc with Rust 1.98.1. The switch catalog, changed-file clean-room check, and git diff --check passed.
  • No title input was used. This is a logging check, not a device-removal reproduction.

GPUs tested: AMD Raphael integrated graphics, RADV 26.3.1, Linux/Wine 11.22 with VKD3D-Proton 3.1.

AI-assisted: OpenAI Codex (GPT-6.2), with independent read-only review by GPT-6.2 Sol.

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5621026867 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3301). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T06:08:55Z. --- Claimed in the coordination issue as [D3D12-BACKGROUND-REQUEST-RESULT](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7369426902). ### What and why When `LEONIDA_D3D12_BACKGROUND=0` is requested, the startup log says the background shader work is switched off even if the request returns an error. If the device lacks `ID3D12Device6`, there is no log for the request. This makes the applied policy hard to establish from a device-removal report. Keep the success message for a successful D3D12 call. If the interface query or the API call fails, warn once during device creation and include its HRESULT. Either result allows device creation to proceed. The switch, default, and D3D12 call arguments are unchanged. This covers the existing startup request from `host.rs`. It does not import the runtime scheduling policy from closed #2847. ### Tested - Compiled the exact old and new Rust call sites into synthetic D3D12 probes with MSVC. On AMD Raphael with Wine 11.22 / VKD3D-Proton 3.1 (`0bb64c56`, RADV 26.3.1), the old probe logged `switched off` with `ok=false`. The new one warns that the work could not be disabled and logs `hresult=0x80004001`. Both probes exit successfully; setting the switch to `1` produces no request log. - Built the `leonida-gpu` diagnostics library tests for `x86_64-pc-windows-msvc` with Rust 1.98.1. The switch catalog, changed-file clean-room check, and `git diff --check` passed. - No title input was used. This is a logging check, not a device-removal reproduction. GPUs tested: AMD Raphael integrated graphics, RADV 26.3.1, Linux/Wine 11.22 with VKD3D-Proton 3.1. AI-assisted: OpenAI Codex (GPT-6.2), with independent read-only review by GPT-6.2 Sol. ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption.
fiestorra commented 2026-12-03 06:13:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T06:13:43Z.


VERIFY-3301 — 715/1 y cero tests nuevos, en un cambio que es todo de informar

1 file changed, 20 insertions(+), 10 deletions(-)
cargo test -p leonida-gpu --lib
  715 passed; 1 failed; 59 ignored     ← 715 es el número de main; ningún test nuevo
  tests nuevos                         0

El título: «Report D3D12 background processing request failures».

Y el cambio es de los que se miden leyendo, no ejecutando: reportar fallos de una petición en segundo plano — se cambia un camino de error que no devolvía nada para que devuelva lo que falló. En la suite eso no se mueve, y es correcto: no hay comportamiento nuevo que un test pueda fijar hasta que exista un consumidor del informe.

Lo que sí se puede medir y no tiene: el informe. Un cambio que añade información puede tener un test de la información — que el fallo llegue con su código y su mensaje, aunque nadie lo escuche todavía — y veinte líneas sin un test es el mismo caso que #2962 y #2980 esta noche.

Lo que verifiqué: la suite entera del crate con el cambio, sin un solo test distinto.
Lo que no: que el fallo se informe al jugador — eso necesita el fallo, y el fallo necesita el juego.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7369600696 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3301#issuecomment-7369600696). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T06:13:43Z. --- ## VERIFY-3301 — 715/1 y **cero tests nuevos**, en un cambio que es todo de informar ``` 1 file changed, 20 insertions(+), 10 deletions(-) cargo test -p leonida-gpu --lib 715 passed; 1 failed; 59 ignored ← 715 es el número de main; ningún test nuevo tests nuevos 0 ``` **El título**: **«Report D3D12 background processing request failures»**. **Y el cambio es de los que se miden leyendo, no ejecutando**: **reportar fallos de una petición en segundo plano** — **se cambia un camino de error que no devolvía nada para que devuelva lo que falló.** **En la suite eso no se mueve, y es correcto: no hay comportamiento nuevo que un test pueda fijar hasta que exista un consumidor del informe.** **Lo que sí se puede medir y no tiene**: **el informe.** **Un cambio que *añade información* puede tener un test de la información** — **que el fallo llegue con su código y su mensaje, aunque nadie lo escuche todavía** — **y veinte líneas sin un test es el mismo caso que `#2962` y `#2980` esta noche.** **Lo que verifiqué**: **la suite entera del crate con el cambio, sin un solo test distinto.** **Lo que no**: **que el fallo se informe al jugador** — **eso necesita el fallo, y el fallo necesita el juego.**
merzleckeier commented 2026-12-03 06:21:22 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T06:21:22Z.


Thanks for the point about testing the log itself. 670df262 now runs the same opt-in/reporting function used at startup with a thread-local subscriber. The regression checks no request with the switch unset or 1, INFO on success, and WARN with the exact HRESULT for both E_NOINTERFACE and E_NOTIMPL. All four targeted MSVC host tests passed under Wine. In a separate Windows probe using the same regression, restoring the old INFO … switched off, ok=false behavior made it fail. The new diff passed independent read-only review.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7369741908 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3301#issuecomment-7369741908). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T06:21:22Z. --- Thanks for the point about testing the log itself. `670df262` now runs the same opt-in/reporting function used at startup with a thread-local subscriber. The regression checks no request with the switch unset or `1`, INFO on success, and WARN with the exact HRESULT for both `E_NOINTERFACE` and `E_NOTIMPL`. All four targeted MSVC host tests passed under Wine. In a separate Windows probe using the same regression, restoring the old `INFO … switched off, ok=false` behavior made it fail. The new diff passed independent read-only review.
MoonEyes commented 2026-12-03 06:47:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T06:47:49Z.


RUN (in game, batch of four pull requests), each head merged with git merge --no-ff onto main d9b618f10, in one build: #2851 488416598, #3299 898b87802, #3301 670df262b, #3302 0bb75e0ba. RTX 4060 8 GB, driver 610.88, Windows 11. Series S, -Resolution 1080, frame generation 2x, -PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.

What Result
Device lost / device removed 0
Exceptions, panics, hang watchdog, GPU stall, title suspended 0
Process alive at the end yes, stopped by the time limit
Rendered fps, last 240 s (48 samples) median 16.6, mean 16.8
Rendered fps, last 120 s median 16.6
Time under 5 fps in the world 0 %

For reference, the same machine and route rendered 13.3 to 17.2 fps on other batches in the last day. 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; arrival in the world was driven by keys and not checked on pictures; -PrecompileUsed was used, so the default start (every known pipeline precompiled) was not exercised. #2851 was in an earlier batch on another head; this run covers its current head, with LEONIDA_TITLE_MEMORY_SCALE unset. #3299's switch is opt-in and hardware ray tracing was not on in this 8 GB profile, so it was not exercised. #3302 changes where Pool allocations go by default; this run shows nothing fell over with it, not whether it saves memory. #3301 only reports failures; none was provoked. The precompile before the world took 468 s against about 155 s for most batches: something in this batch leaves the pipeline cache cold (not looked into).

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7370242191 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3301#issuecomment-7370242191). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-03T06:47:49Z. --- RUN (in game, batch of four pull requests), each head merged with `git merge --no-ff` onto main `d9b618f10`, in one build: #2851 `488416598`, #3299 `898b87802`, #3301 `670df262b`, #3302 `0bb75e0ba`. RTX 4060 8 GB, driver 610.88, Windows 11. Series S, `-Resolution 1080`, frame generation 2x, `-PrecompileUsed`, the same walking route as the other runs on this machine, 330 s after reaching the world. | What | Result | |---|---| | Device lost / device removed | 0 | | Exceptions, panics, hang watchdog, GPU stall, title suspended | 0 | | Process alive at the end | yes, stopped by the time limit | | Rendered fps, last 240 s (48 samples) | median 16.6, mean 16.8 | | Rendered fps, last 120 s | median 16.6 | | Time under 5 fps in the world | 0 % | For reference, the same machine and route rendered 13.3 to 17.2 fps on other batches in the last day. 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; arrival in the world was driven by keys and not checked on pictures; `-PrecompileUsed` was used, so the default start (every known pipeline precompiled) was not exercised. #2851 was in an earlier batch on another head; this run covers its current head, with `LEONIDA_TITLE_MEMORY_SCALE` unset. #3299's switch is opt-in and hardware ray tracing was not on in this 8 GB profile, so it was not exercised. #3302 changes where Pool allocations go by default; this run shows nothing fell over with it, not whether it saves memory. #3301 only reports failures; none was provoked. The precompile before the world took 468 s against about 155 s for most batches: something in this batch leaves the pipeline cache cold (not looked into). AI-assisted (Claude Code).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3301:upstream-pr/3301'
git switch 'upstream-pr/3301'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3301'
git switch 'upstream-pr/3301'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3301'
git switch 'upstream-pr/3301'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3301'
git switch 'main'
git merge --squash 'upstream-pr/3301'
git switch 'main'
git merge --ff-only 'upstream-pr/3301'
git switch 'main'
git merge 'upstream-pr/3301'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!3301
No description provided.