[PR #6016] [MERGED] Recover the renderer after graphics device loss #6609

Closed
opened 2026-11-03 06:23:44 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6016
Author: @kacpherek
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/gpu-device-loss


📝 Commits (4)

  • d3fdb8d Recover the renderer after graphics device loss
  • c92f035 Merge upstream main into GPU recovery fix
  • b773fa4 Merge remote-tracking branch 'origin/main' into HEAD
  • e37e2f1 Device recovery: pass translucent batching to the rebuilt renderer

📊 Changes

2 files changed (+86 additions, -1 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+13 -0)
📝 crates/horizon-client/src/game.rs (+73 -1)

📄 Description

What and why

Addresses #5869. After wgpu reports a lost graphics device, stop submitting work to it and rebuild the renderer on a new device at the next redraw. Recreate the GPU-backed atlas and world meshes, retain screenshot requests, and stop after another loss within 60 seconds instead of looping. Split-screen deliberately exits with an error because its renderers and compositors share the device and must be recovered together.

The crash report shows DXGI_ERROR_DEVICE_REMOVED; it does not establish why the device was lost. This change attempts to recover from that condition and does not claim to fix the underlying driver, hardware, or rendering fault.

Kind

  • bug: a crash or a breakage

Vanilla reference

Horizon-specific graphics-device recovery; no vanilla gameplay change.

Other projects' code

Read wgpu-core 30.0.1 (MIT OR Apache-2.0), the existing dependency, to check how mapping errors trigger the device-lost callback. No code copied. github.com/gfx-rs/wgpu@40f4a34eba/wgpu-core

Self-check

pr_ready (tools/pr_ready.py on device-591, against origin/main at 71b1ed56f, 4 min 3 s)

Check Result
Scope ✅ 2 files, +84 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 523 passed (48 s)
rustfmt ✅ (8 s)
clippy ✅ (1 min 11 s)
tests: horizon-client, horizon-client-render ✅ 2562 passed (1 min 53 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Validation

  • python3 tools/pr_ready.py --base origin/main: passed, including 523 Python tests, 2,562 Rust tests, rustfmt, Clippy and doc tests. The affected parity harnesses were listed for CI because prepared vanilla data is unavailable.
  • cargo check -p horizon-client --offline: passed.
  • A real Windows / DX12 GPU reset and an end-to-end game run have not been tested here. The machine is macOS, and the prepared game resources are absent. Verify device-loss recovery, world meshes and atlas contents, screenshot handling, and repeated loss on Windows before merging.
  • Vanilla parity harnesses require the prepared Minecraft data and are not runnable here.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/6016 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/gpu-device-loss` --- ### 📝 Commits (4) - [`d3fdb8d`](https://github.com/horizon-rust/horizon/commit/d3fdb8d19c800d7b17dc470d48d678941e1396be) Recover the renderer after graphics device loss - [`c92f035`](https://github.com/horizon-rust/horizon/commit/c92f0357c93406bfb44440d24e35302e18ebf001) Merge upstream main into GPU recovery fix - [`b773fa4`](https://github.com/horizon-rust/horizon/commit/b773fa45c1e141c10ad4222ad63d5428614d0b8a) Merge remote-tracking branch 'origin/main' into HEAD - [`e37e2f1`](https://github.com/horizon-rust/horizon/commit/e37e2f163f4a75fbf18ca7b965b387fa96a865a5) Device recovery: pass translucent batching to the rebuilt renderer ### 📊 Changes **2 files changed** (+86 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+13 -0) 📝 `crates/horizon-client/src/game.rs` (+73 -1) </details> ### 📄 Description ## What and why Addresses #5869. After wgpu reports a lost graphics device, stop submitting work to it and rebuild the renderer on a new device at the next redraw. Recreate the GPU-backed atlas and world meshes, retain screenshot requests, and stop after another loss within 60 seconds instead of looping. Split-screen deliberately exits with an error because its renderers and compositors share the device and must be recovered together. The crash report shows DXGI_ERROR_DEVICE_REMOVED; it does not establish why the device was lost. This change attempts to recover from that condition and does not claim to fix the underlying driver, hardware, or rendering fault. ## Kind - [x] bug: a crash or a breakage ## Vanilla reference Horizon-specific graphics-device recovery; no vanilla gameplay change. ## Other projects' code Read wgpu-core 30.0.1 (MIT OR Apache-2.0), the existing dependency, to check how mapping errors trigger the device-lost callback. No code copied. https://github.com/gfx-rs/wgpu/tree/40f4a34ebaf56f9a046231f54125ad046239d3f3/wgpu-core ## Self-check **pr_ready** (`tools/pr_ready.py` on device-591, against origin/main at 71b1ed56f, 4 min 3 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +84 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 523 passed (48 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (1 min 11 s) | | tests: horizon-client, horizon-client-render | ✅ 2562 passed (1 min 53 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | ## Validation - `python3 tools/pr_ready.py --base origin/main`: passed, including 523 Python tests, 2,562 Rust tests, rustfmt, Clippy and doc tests. The affected parity harnesses were listed for CI because prepared vanilla data is unavailable. - `cargo check -p horizon-client --offline`: passed. - A real Windows / DX12 GPU reset and an end-to-end game run have not been tested here. The machine is macOS, and the prepared game resources are absent. Verify device-loss recovery, world meshes and atlas contents, screenshot handling, and repeated loss on Windows before merging. - Vanilla parity harnesses require the prepared Minecraft data and are not runnable here. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:23:44 +07:00
Sign in to join this conversation.
No milestone
No project
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
horizon-rust/horizon#6609
No description provided.