[PR #4010] [MERGED] Renderer: fullscreen loading crash (Validation acquire + animated sprites layout) #5353

Closed
opened 2026-11-03 05:11:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4010
Author: @WhyFovius
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: fix/fullscreen-loading-crash


📝 Commits (1)

  • 1761eb0 Renderer: a Validation acquire recovers, animated sprites layout stays inside the error scopes

📊 Changes

2 files changed (+41 additions, -9 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+29 -1)
📝 crates/horizon-client-render/src/gfx/animate.rs (+12 -8)

📄 Description

> 🤖 Opened by WhyFovius's AI agent (Claude), not by WhyFovius personally.

Fixes #3866

What happens

Opening a world fullscreen could crash ~8 s into the loading screen, twice in a row for the reporter. The log had ~130 000 lines of loading screen frame failed: surface acquisition failed validation, then the crash report: wgpu Validation Error, In ComputePipeline::get_bind_group_layout, ComputePipeline with 'Animated sprites' label is invalid. Windowed mode started fine.

Why

Two faults stack up:

  • draw_frame answered CurrentSurfaceTexture::Validation with Err on every frame, and the loading screen runs ControlFlow::Poll — so the caller logged the warn ~16k times a second while nothing ever recovered. Per wgpu-30, acquire reports Validation when the swapchain cannot be used as configured (a configuration raced with a submission); it is recoverable, like Outdated.
  • SpriteAnimator::new asked the animated sprites pipeline for its bind group layout after the error scopes inside pipeline() had been popped. A device lost during that window makes create_compute_pipeline return a silent invalid placeholder — device-lost errors bypass error scopes (ErrorType::DeviceLost => return in wgpu-core) — so the scopes saw nothing and the pipeline was trusted. The out-of-scope get_bind_group_layout then hit wgpu's uncaptured-error path, which panics (wgpu_core.rs:2445 — the exact line in the report).

The fix

  • pipeline() returns (ComputePipeline, BindGroupLayout) with get_bind_group_layout(0) queried while the scopes are still open: a validation error there is caught by the scope and the animator falls back to the CPU path, as it already does for drivers without working compute shaders. SpriteAnimator::new uses the returned layout; the panicking call is gone.
  • The Validation arm of acquire now gets the swapchain a fresh configuration like Outdated, and once that has not helped, reattaches the window like Lost. The frame is skipped (Ok(false)) instead of failed, so a fullscreen loading screen no longer spins on an error: it recovers, or at worst skips frames quietly. The failure counter resets on the next acquired frame.

The compositor's own acquire already handles Validation benignly (_ => return false), so it needed nothing.

Self-check

python tools/pr_ready.py --quick

Check Result
Scope ✅ 2 files, +41 −9
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 444 passed (40 s)
rustfmt ✅ (6 s)
clippy ✅ (8 s)
tests: horizon-client-render ✅ 550 passed (20 s)
doc tests ✅ 0 passed (2 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses

🤖 Generated with Claude Code


🔄 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/4010 **Author:** [@WhyFovius](https://github.com/WhyFovius) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/fullscreen-loading-crash` --- ### 📝 Commits (1) - [`1761eb0`](https://github.com/horizon-rust/horizon/commit/1761eb084210c84f9fe3d8fcfc3ca9d69e96c045) Renderer: a Validation acquire recovers, animated sprites layout stays inside the error scopes ### 📊 Changes **2 files changed** (+41 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+29 -1) 📝 `crates/horizon-client-render/src/gfx/animate.rs` (+12 -8) </details> ### 📄 Description > 🤖 Opened by WhyFovius's AI agent (Claude), not by WhyFovius personally. Fixes #3866 ## What happens Opening a world fullscreen could crash ~8 s into the loading screen, twice in a row for the reporter. The log had ~130 000 lines of `loading screen frame failed: surface acquisition failed validation`, then the crash report: `wgpu Validation Error, In ComputePipeline::get_bind_group_layout, ComputePipeline with 'Animated sprites' label is invalid`. Windowed mode started fine. ## Why Two faults stack up: - `draw_frame` answered `CurrentSurfaceTexture::Validation` with `Err` on every frame, and the loading screen runs `ControlFlow::Poll` — so the caller logged the warn ~16k times a second while nothing ever recovered. Per wgpu-30, acquire reports `Validation` when the swapchain cannot be used as configured (a configuration raced with a submission); it is recoverable, like `Outdated`. - `SpriteAnimator::new` asked the animated sprites pipeline for its bind group layout *after* the error scopes inside `pipeline()` had been popped. A device lost during that window makes `create_compute_pipeline` return a silent invalid placeholder — device-lost errors bypass error scopes (`ErrorType::DeviceLost => return` in wgpu-core) — so the scopes saw nothing and the pipeline was trusted. The out-of-scope `get_bind_group_layout` then hit wgpu's uncaptured-error path, which panics (`wgpu_core.rs:2445` — the exact line in the report). ## The fix - `pipeline()` returns `(ComputePipeline, BindGroupLayout)` with `get_bind_group_layout(0)` queried while the scopes are still open: a validation error there is caught by the scope and the animator falls back to the CPU path, as it already does for drivers without working compute shaders. `SpriteAnimator::new` uses the returned layout; the panicking call is gone. - The `Validation` arm of acquire now gets the swapchain a fresh configuration like `Outdated`, and once that has not helped, reattaches the window like `Lost`. The frame is skipped (`Ok(false)`) instead of failed, so a fullscreen loading screen no longer spins on an error: it recovers, or at worst skips frames quietly. The failure counter resets on the next acquired frame. The compositor's own acquire already handles `Validation` benignly (`_ => return false`), so it needed nothing. ## Self-check `python tools/pr_ready.py --quick` | Check | Result | | --- | --- | | Scope | ✅ 2 files, +41 −9 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 444 passed (40 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (8 s) | | tests: horizon-client-render | ✅ 550 passed (20 s) | | doc tests | ✅ 0 passed (2 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:11:59 +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#5353
No description provided.