[core] Log where and on which driver a device was lost #11172
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 318 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.345
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #11172"
general
weight: 0.35
kpreid
Connections
Split out of #11135, as requested there by @bherbruck, so the logging can land and be backported on its own. It changes no behaviour.
Description
When a backend error loses a device, the device-lost callback usually says only "Unexpected error variant (driver implementation is at fault)" or "Device is lost". A user log then can't tell which operation failed, with which native result, or on which driver.
This logs one error when the device is lost, with:
handle_hal_errorwith#[track_caller],The Vulkan backend also logs the
VkResultof an error it did not expect, whichDeviceError::Unexpectedcannot carry. DX12 and Metal already log their native error at that point.The message passed to the device-lost callback is unchanged, because it can reach web content. The log line fires only for the first loss of a device.
Testing
cargo fmtandcargo clippy --all-targets --all-featuresare clean.ERRORline, which points at the fence wait inDevice::maintain. The PCI IDs were added after this run.!A lost device, before and after: the new log line
Squash or Rebase?
One commit.
LLM Use?
Claude Code wrote the code and this description at my direction, and ran the device testing in #11135.
Checklist
CHANGELOG.mdentries for the user-facing effects of this change are present.wgpumay be affected behaviorally.