Name the rung that lost, not one the runtime lacks

A device left on the CPU gave the first failure as the reason, which on
any runtime but NVIDIA's is "TensorRT execution provider is not enabled
in this build". The reason is now the last rung that was tried and lost,
"WebGPU 150.8 ms, slower than the CPU's 26.6 ms"; the full list is still
in the status's failures.
This commit is contained in:
2026-10-04 21:00:15 -04:00
parent 85dee4375b
commit 2ced6f114f
+10 -1
View File
@@ -166,7 +166,16 @@ pub fn run(runtime: Runtime) {
}
if cache.rung.is_none() {
cache.rung = Some(Rung::Cpu);
cache.reason = match cache.failed.first() {
// The rung that tried and lost, not the first one the runtime was
// never built with: "WebGPU 150 ms, slower than the CPU" says why
// this device is on the CPU, "TensorRT not enabled" does not.
let tried = cache
.failed
.iter()
.rev()
.find(|(_, why)| !why.contains("in this build"))
.or(cache.failed.first());
cache.reason = match tried {
Some((r, why)) => format!("{} {}", r.label(), first_line(why)),
None => "the only rung on this platform".into(),
};