Repository navigation
drm/asahi: g17: replay render groups firmware retired without executing - #307
Merged
Merged
Conversation
A render group can be retired by firmware without its fragment pass ever running: the tiler start record is written, the fragment end record is not, both completion stamps already cover the group, its job list is empty and no recovery is reported. On Neo this happens to an innocent owner (the compositor) at the instant another client's compute command fails with a zero-duration completion record. The front group then polls Pending forever, the 2 s scheduler timeout fires, fail_after_observation takes the strict abandonment witness and fails the owner's VM with EIO. The compositor's device is lost and the desktop freezes. Use the same witness to recognise the abandoned group as soon as it retires, and publish the same command again instead of failing it. In Pair::retire_front a lone, outer-published front group that polls Pending is checked with retirement::abandoned (executed groups are never accepted); the proof has to hold on two observations at least 2 ms apart so a single sample straddling a firmware update cannot trigger it. The dead generation's free-list and QoS accounting is completed exactly as the timeout path does, the record is retired and the packet is parked on the pair with its publication state reset; its completion stays unsignalled and no VM status is recorded. Firmware::replay_render, run by the event worker next to the compute replay and never during recovery, prepares and publishes the parked packet again through the ordinary path (fresh ordinal, descriptors, scene and timestamp record). A closed owner, a cancelled packet or a stale context settle the replay with ECANCELED, which does not poison the VM; other publication failures settle it with their error as before. Completion::begin_replay bounds the attempts to three, after which the previous EIO settlement applies. The original submission's scheduler timeout is ignored while its packet is parked, and a processor stop drains a parked replay like active groups. Nothing of an abandoned group reached its attachments, which only the fragment stage writes, so re-running the tiler and fragment passes from the same command is the first execution as far as render targets are concerned. Tiler-side pipeline statistics may count twice; vertex-stage side effects exist only behind an opt-in diagnostic. Tested on Neo (A18 Pro, G17P) with failing ray-query clients next to an animating compositor: the first incident at 81.455 s was replayed at 81.468 s (slot 4, qids [8, 9], pass [tiler start, 0], stamps covering the group) and the compositor kept rendering with no device loss, where the previous kernels lost the desktop in three out of three runs. With this change and VerboseFaults set, two further boots logged 2 and 3 replayed groups over 13 and 24 failing clients (the first boot differed only in the log string), with no device loss and the compositor still rendering. Boots of earlier builds with the same replay logic ran about 1,500 ray-query, ray-tracing pipeline and mesh conformance cases without failing clients and logged no replay. With the VerboseFaults debug flag, each replay is logged with its slot and the pass record that proved the group was not executed. Co-Authored-By: Claude Fable 5.1 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Neo (T8140), when one client's GPU work fails, the firmware can retire another client's render without running its fragment pass. In our testing the innocent client was the compositor. The tiler start record is written, the fragment end record never is, the stamps cover the group, and no recovery is reported.
The kernel then waits out the 2 s scheduler timeout.
fail_after_observation()settles the group as abandoned with EIO and marks the innocent owner's VM as lost. Hyprland keeps running but outputs empty frames: the desktop freezes or goes blank until the session restarts.A diagnostic build caught this three times. Each time Hyprland's render (slot 4, qids [8, 9]) was submitted at the same instant another client's compute failed.
Fix
VerboseFaultsdebug flag, each replay is logged.Safety: only the fragment stage writes attachments, and its end record was never written, so the replay is the first execution as far as render targets are concerned. Tiler-side pipeline statistics may count twice.
Hardware validation (Neo, A18 Pro)
Reproduction: deliberately failing compute clients while the compositor animates the screensaver.
The committed files are byte-identical to the module tested on the final boot, which logged 3 replays over 24 failing clients.
🤖 Generated with Claude Code