GPU: state the DRED stop command as the first uncompleted op (#22) #39

Manually merged
github merged 1 commit from github-bot/gh-39 into main 2026-11-26 08:21:47 +00:00 AGit
Owner

@⁠FictionHub on GitHub · 2026-11-25 23:57 UTC · original
FictionHub:fix/dred-stop-command-wording → main · +66 −4 · 1 files · 1 commits · merged 2026-11-26 08:17 UTC

Addresses #22.

What the report got right, and what it got wrong

Host::removal_data() printed:

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

for nine lists in #16. That is genuinely misleading, but not for the reason in the issue. Microsoft's docs for D3D12_AUTO_BREADCRUMB_NODE say pLastBreadcrumbValue contains the number of pCommandHistory ops completed, and that the last successfully completed op is at index value - 1. So history[done] is the first op that had not completed. The old wording reads like one-based command numbering ("command 0 of 498"), which invites exactly the misreading in the report. Changing the opcode to history[done + 1], as the issue suggests, would name the wrong command instead. In 0 of 498 (op 46), op 46 is BEGIN_COMMAND_LIST, i.e. no breadcrumb in that list had completed.

Change

  • Extracted stopped_command() in crates/victory-gpu/src/host.rs. It keeps history[done] as the named op and states the semantics explicitly: the number of completed commands, the last completed op (when there is one), and the zero-based index of the first uncompleted one.
  • If the runtime reports done >= BreadcrumbCount, or more breadcrumbs than the array holds, the detail line is skipped instead of indexing out of range. The existing in_flight() and indirect/pipelines detail is unchanged.
  • Added breadcrumbs::the_named_op_is_the_first_command_that_had_not_completed, a hardware-free test with synthetic op codes for done == 0, mid-list, the last command, a finished list, an inconsistent count, and u32::MAX.

The output for the #16 case becomes:

no command completed of 498; the first uncompleted is command index 0 (op 46) of "victory host list 814"

Verification

  • cargo test --locked -p victory-gpu --lib breadcrumbs -- --nocapture: 1 passed.
  • cargo test --workspace --locked: all crates pass except 7 pre-existing hardware tests in victory-shader (emit::intersect_tests::* and emit::valu_tests::*) that fail on this host with hardware: compute_pipeline failed: The parameter is incorrect. No game files are involved.
  • cargo xtask policy: 246 files ok (synthetic test data only, no assets).
  • cargo clippy --workspace --all-targets --locked -- -D warnings fails before and after this change on pre-existing warnings (for example victory-formats operator precedence and draw::State::tables visibility); cargo clippy -p victory-gpu --all-targets --locked shows no warning on the changed lines.

No CONTRIBUTING.md exists; docs/asset-policy.md and .github/workflows/ci.yml were followed. AI-assisted: code review and tests were generated with assistance; all test data is synthetic.

#22

**@⁠FictionHub** on GitHub · 2026-11-25 23:57 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/39) `FictionHub:fix/dred-stop-command-wording` → `main` · +66 −4 · 1 files · 1 commits · merged 2026-11-26 08:17 UTC Addresses #22. ## What the report got right, and what it got wrong `Host::removal_data()` printed: ``` a list stopped at command 0 of 498 (op 46) ``` for nine lists in #16. That is genuinely misleading, but not for the reason in the issue. [Microsoft's docs for `D3D12_AUTO_BREADCRUMB_NODE`](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_auto_breadcrumb_node) say `pLastBreadcrumbValue` contains *the number of `pCommandHistory` ops completed*, and that the last successfully completed op is at index `value - 1`. So `history[done]` is the **first op that had not completed**. The old wording reads like one-based command numbering ("command 0 of 498"), which invites exactly the misreading in the report. Changing the opcode to `history[done + 1]`, as the issue suggests, would name the wrong command instead. In `0 of 498 (op 46)`, op 46 is `BEGIN_COMMAND_LIST`, i.e. no breadcrumb in that list had completed. ## Change - Extracted `stopped_command()` in `crates/victory-gpu/src/host.rs`. It keeps `history[done]` as the named op and states the semantics explicitly: the number of completed commands, the last completed op (when there is one), and the zero-based index of the first uncompleted one. - If the runtime reports `done >= BreadcrumbCount`, or more breadcrumbs than the array holds, the detail line is skipped instead of indexing out of range. The existing `in_flight()` and indirect/pipelines detail is unchanged. - Added `breadcrumbs::the_named_op_is_the_first_command_that_had_not_completed`, a hardware-free test with synthetic op codes for `done == 0`, mid-list, the last command, a finished list, an inconsistent count, and `u32::MAX`. The output for the #16 case becomes: ``` no command completed of 498; the first uncompleted is command index 0 (op 46) of "victory host list 814" ``` ## Verification - `cargo test --locked -p victory-gpu --lib breadcrumbs -- --nocapture`: 1 passed. - `cargo test --workspace --locked`: all crates pass except 7 pre-existing hardware tests in `victory-shader` (`emit::intersect_tests::*` and `emit::valu_tests::*`) that fail on this host with `hardware: compute_pipeline failed: The parameter is incorrect.` No game files are involved. - `cargo xtask policy`: 246 files ok (synthetic test data only, no assets). - `cargo clippy --workspace --all-targets --locked -- -D warnings` fails before and after this change on pre-existing warnings (for example `victory-formats` operator precedence and `draw::State::tables` visibility); `cargo clippy -p victory-gpu --all-targets --locked` shows no warning on the changed lines. No `CONTRIBUTING.md` exists; `docs/asset-policy.md` and `.github/workflows/ci.yml` were followed. AI-assisted: code review and tests were generated with assistance; all test data is synthetic. #22
pLastBreadcrumbValue is the count of completed breadcrumbs, so history[done]
is the first op that had not completed. The old "stopped at command {done}
of {count} (op X)" read like one-based numbering and was mistaken for the
last completed command (issue #22). Say the count, the last completed op
and the zero-based index of the first uncompleted one explicitly, and skip
the detail when the reported count is out of range.

Refs #22
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:31:29 +00:00
Author
Owner

@⁠avatarmanz on GitHub · 2026-11-26 07:55 UTC · original

Merged into main in the next push (tests pass); thanks.

**@⁠avatarmanz** on GitHub · 2026-11-26 07:55 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/39#issuecomment-7185977230) Merged into main in the next push (tests pass); thanks.
github manually merged commit eb79746392 into main 2026-11-26 08:21:47 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.