DRED "stopped at command N (op X)" names the last completed command, not the one that hung #22

Closed
opened 2026-11-26 03:31:23 +00:00 by github-bot · 1 comment
Owner

@⁠itsonewi on GitHub · 2026-11-25 23:42 UTC · original

The DRED stop location printed in a device-removal line names the last command that completed, not the one that hung, and one report already reads the wrong command from it.

Where

crates/victory-gpu/src/host.rs:5900-5906:

let done = p.pLastBreadcrumbValue.as_ref().copied().unwrap_or(0);
if done < p.BreadcrumbCount && !p.pCommandHistory.is_null() {
    let history = std::slice::from_raw_parts(p.pCommandHistory, p.BreadcrumbCount as usize);
    text.push_str(&format!("; a list stopped at command {done} of {} (op {})", p.BreadcrumbCount, history[done as usize].0));

pLastBreadcrumbValue is documented as the value of the last breadcrumb that was reached/completed before the device removal, so history[done] is the last command that finished. The command the GPU was executing when it died is done + 1. When done == 0 the line names command 0, which by construction did complete.

Why it matters now

#16 has nine lines of the form

a list stopped at command 0 of 498 (op 46)
a list stopped at command 0 of 5 (op 46)
a list stopped at command 0 of 2 (op 46)

Every one is 0 of N and every one prints the same op 46. If op 46 were the hung command it would have to be the same opcode in nine lists of wildly different length and at index 0 in a 498-command list, which is the signature of "this is command 0, not the interesting one". As reported, the output tells the reader "op 46 is the command" when it means "only the first command of each of these lists completed", and the actual stop location is history[1] (or, when nothing ran, none of them).

Suggestion

  • Print both: stopped after command {done} (op {}); the next is {done+1} (op {}), with done + 1 < BreadcrumbCount checked.
  • When done == 0 && BreadcrumbCount > 1, say no command beyond the first completed instead of naming an opcode, so the line cannot be misread as naming the hung command.
  • The breadcrumbs (done/count, list) summary a few lines above is the more useful datum; when the extended output is available it would be worth printing the first list with done > 0 (or saying that there is none), since that is the only list whose stop location is meaningful.

Not checked

Source reading only, at 0a43566. I have no DRED-capable machine here and did not reproduce #16; the documentation reading of pLastBreadcrumbValue above is the part worth double-checking before changing the message.

AI use

AI-assisted review (source reading). No build, no hardware run, no game files.

**@⁠itsonewi** on GitHub · 2026-11-25 23:42 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/22) The DRED stop location printed in a device-removal line names the last command that **completed**, not the one that hung, and one report already reads the wrong command from it. ## Where `crates/victory-gpu/src/host.rs:5900-5906`: ```rust let done = p.pLastBreadcrumbValue.as_ref().copied().unwrap_or(0); if done < p.BreadcrumbCount && !p.pCommandHistory.is_null() { let history = std::slice::from_raw_parts(p.pCommandHistory, p.BreadcrumbCount as usize); text.push_str(&format!("; a list stopped at command {done} of {} (op {})", p.BreadcrumbCount, history[done as usize].0)); ``` `pLastBreadcrumbValue` is documented as the value of the last breadcrumb that **was reached/completed** before the device removal, so `history[done]` is the last command that finished. The command the GPU was executing when it died is `done + 1`. When `done == 0` the line names command 0, which by construction did complete. ## Why it matters now #16 has nine lines of the form ``` a list stopped at command 0 of 498 (op 46) a list stopped at command 0 of 5 (op 46) a list stopped at command 0 of 2 (op 46) ``` Every one is `0 of N` and every one prints the same `op 46`. If `op 46` were the hung command it would have to be the same opcode in nine lists of wildly different length *and* at index 0 in a 498-command list, which is the signature of "this is command 0, not the interesting one". As reported, the output tells the reader "op 46 is the command" when it means "only the first command of each of these lists completed", and the actual stop location is `history[1]` (or, when nothing ran, none of them). ## Suggestion - Print both: `stopped after command {done} (op {}); the next is {done+1} (op {})`, with `done + 1 < BreadcrumbCount` checked. - When `done == 0 && BreadcrumbCount > 1`, say `no command beyond the first completed` instead of naming an opcode, so the line cannot be misread as naming the hung command. - The `breadcrumbs (done/count, list)` summary a few lines above is the more useful datum; when the extended output is available it would be worth printing the first list with `done > 0` (or saying that there is none), since that is the only list whose stop location is meaningful. ## Not checked Source reading only, at `0a43566`. I have no DRED-capable machine here and did not reproduce #16; the documentation reading of `pLastBreadcrumbValue` above is the part worth double-checking before changing the message. ## AI use AI-assisted review (source reading). No build, no hardware run, no game files.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:31:23 +00:00
github-bot 2026-11-26 08:24:50 +00:00
Author
Owner

@⁠avatarmanz on GitHub · 2026-11-26 08:18 UTC · original

Fixed by #39, now in main (0ce46d5a).

**@⁠avatarmanz** on GitHub · 2026-11-26 08:18 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/22#issuecomment-7186445889) Fixed by #39, now in main (0ce46d5a).
This discussion has been locked. Commenting is limited to contributors.
No milestone
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
github/avatarmanz--VIctory-7900XTX#22
No description provided.