fix(rendering): recreate renderer when surface errors persist across frames - #15304
fix(rendering): recreate renderer when surface errors persist across frames#15304daven613 wants to merge 1 commit into
Conversation
…frames After a GPU engine reset (e.g. Intel xe driver killing a hung job), surface texture acquisition can fail with a Validation error on every subsequent frame. The event loop treats Validation as transient and skips the frame, but never escalates - so the window stays frozen forever while the render loop retries the same failing call each frame. Track consecutive failed frames per window and, once an error the event loop would otherwise ignore has persisted for MAX_CONSECUTIVE_RENDER_FAILURES frames, escalate to the existing drop/recreate renderer recovery path. Genuinely transient validation errors still just skip a frame as before. Fixes warpdotdev#15303 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @daven613 on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment |
|
Every PR must be linked to a same-repo issue before Oz can review it. This PR is linked to #15303, but no linked issue is marked See the contribution guidelines for the full readiness model. Powered by Oz |
There was a problem hiding this comment.
Every PR must be linked to a same-repo issue before Oz can review it.
This PR is linked to #15303, but no linked issue is marked ready-to-implement yet. Only repository maintainers apply that label, so please wait for a maintainer to mark the issue. Once it is marked, push a new commit or comment /oz-review to re-trigger review.
See the contribution guidelines for the full readiness model.
Powered by Oz
Manual testing: reproduced the GPU reset and verified recovery ✅Tested this branch (1ef6569) on the same machine and GPU where the original bug hit twice (#15303): Ubuntu-based Linux, kernel 7.0.0-28-generic, Intel integrated GPU (LNL) on the Method
Result — before/after behavior Before (unpatched, stable v0.2026.08.05.09.03, from #15303): after the identical kernel event, the window froze permanently; After (this branch): the window stalled for ~1 second and then resumed scrolling, fully interactive. The log shows the new path firing exactly as designed — device lost → exactly 10 consecutive (then normal frame rendering resumes; the session, scrollback, and running command were all preserved) Transient-error behavior preserved During normal use of the same test build, a one-off Also verified
|
Description
After a GPU engine reset (e.g. the Intel
xekernel driver killing a hung GPU job on Linux),surface.get_current_texture()can fail withValidationon every subsequent frame. Today the event loop treatsSurfaceError(Validation)as transient — it logs, skips the frame, and hopes — and never escalates. The result is a window that is frozen forever while the process, terminal server, and all pty sessions stay alive, withwarp.logfilling with:This PR adds a per-window
consecutive_render_failurescounter. On any render error the counter increments (reset on the next successful frame). Errors that already trigger recovery (SurfaceConfigureError,SurfaceError(Lost),DeviceLost,Unknown) behave exactly as before. Errors that were previously ignored — notablySurfaceError(Validation)— now escalate to the same existingdrop_renderer+recreate_rendererrecovery path once they have persisted forMAX_CONSECUTIVE_RENDER_FAILURES(10) consecutive frames. Genuinely transient validation errors (the case the current skip-a-frame behavior was written for) still just skip a frame or two and never reach the threshold.The counter is reset when the renderer is recreated, so if the first rebuild doesn't take (e.g. the GPU is still resetting), the new renderer gets another full threshold's worth of frames before we try again, rather than rebuilding on every frame.
Linked Issue
Fixes #15303
ready-to-specorready-to-implement— filed together with this PR; flagging for triage per the "PRs opened without a linked issue" flow in CONTRIBUTING.mdTesting
I have manually tested my changes locally
Manually reproduced and verified: built
warp-ossfrom this branch on the affected machine, forced GT0 engine resets viaxedebugfs until the kernel killed an in-flight warp-oss job (the exact trigger from [Linux] Window frozen forever after Intel xe GPU engine reset: surface Validation error loops instead of triggering renderer recovery #15303), and confirmed recovery: exactly 10 consecutiveSurfaceError(Validation)frames, thenRecreating the renderer..., then a clean re-init and a fully interactive window — ~1s of visible stall, session preserved. Full logs and method in this comment. On the unpatched stable build, the identical kernel event froze the window permanently (6+ hours of the same log loop until killed).Transient path preserved: an organic one-off surface
Timeoutduring the same test session skipped a single frame without triggering a rebuild; idle-window resets and media-engine (GT1) resets cause no errors and no rebuilds.cargo check -p warpuipasses on the patched tree (Rust 1.92.0).Real-world failure evidence and the full root-cause trace are in [Linux] Window frozen forever after Intel xe GPU engine reset: surface Validation error loops instead of triggering renderer recovery #15303.
No new automated tests: the behavior under test is the interaction between the winit event loop and a lost GPU device, which has no existing test harness in
warpui; the change is confined to the error-handling arm ofredraw_window.CHANGELOG-BUG-FIX: Recover the renderer when surface errors persist across frames (e.g. after a GPU reset on Linux) instead of leaving the window frozen.
🤖 Generated with Claude Code