Diagnostics: trace command-list waits and memory write progress #1251

Closed
github-bot wants to merge 1 commit from gh-pr/1251/head into gh-pr/1251/base
Owner

@⁠LaunchDoesntCode on GitHub · 2026-11-24 16:47 UTC · original
diagnostics/trace-command-list-memory-waits → main · +48 −5 · 4 files · 1 commits · closed without merging

Which list will produce the value a command list is waiting for, and how far did that write get? This adds opt-in diagnostics for the 32-bit masked and 64-bit wait requests, queue fence calls, and the lifecycle of a constant-value write on a host command list. The existing wait behavior is unchanged.

Enable VICTORY_LOG=info,victory_gpu::sync_wait=trace,victory_gpu::sync_write=trace in a diagnostics build. Match the guest memory address, value and width to the requested comparison. For the producer, follow the same host list and write across recorded, submitted (after the D3D12 execute call, with its submission fence), and stored (after writing the guest bytes). Timestamp writes are excluded.

In a Windows WARP loading trace on an integrated playtest build, 42 of 43 addresses in the final wait set had an exact-value producer recorded. None of those producers had been submitted after recording the write when the title stopped. A later run with a separate copyback optimization completed three expected writes and both texture readbacks, then lost the software graphics device. These observations distinguish a pending producer from a device failure and do not establish playable world rendering.

On this standalone branch based on ffe310e, a WARP run produced a wait event and the same constant write at all three stages in order. The diagnostics GPU suite passed 53 tests with one ignored. Workspace Clippy with all targets and features, the default workspace check with all targets, and the asset-policy check passed.

Related to #1023, which implements ordered waits. The trace can be used to validate its producer ordering separately.

**@⁠LaunchDoesntCode** on GitHub · 2026-11-24 16:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/1251) `diagnostics/trace-command-list-memory-waits` → `main` · +48 −5 · 4 files · 1 commits · closed without merging Which list will produce the value a command list is waiting for, and how far did that write get? This adds opt-in diagnostics for the 32-bit masked and 64-bit wait requests, queue fence calls, and the lifecycle of a constant-value write on a host command list. The existing wait behavior is unchanged. Enable `VICTORY_LOG=info,victory_gpu::sync_wait=trace,victory_gpu::sync_write=trace` in a diagnostics build. Match the guest memory address, value and width to the requested comparison. For the producer, follow the same host list and write across `recorded`, `submitted` (after the D3D12 execute call, with its submission fence), and `stored` (after writing the guest bytes). Timestamp writes are excluded. In a Windows WARP loading trace on an integrated playtest build, 42 of 43 addresses in the final wait set had an exact-value producer recorded. None of those producers had been submitted after recording the write when the title stopped. A later run with a separate copyback optimization completed three expected writes and both texture readbacks, then lost the software graphics device. These observations distinguish a pending producer from a device failure and do not establish playable world rendering. On this standalone branch based on `ffe310e`, a WARP run produced a wait event and the same constant write at all three stages in order. The diagnostics GPU suite passed 53 tests with one ignored. Workspace Clippy with all targets and features, the default workspace check with all targets, and the asset-policy check passed. Related to #1023, which implements ordered waits. The trace can be used to validate its producer ordering separately.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:25:05 +00:00
github-bot closed this pull request 2026-11-26 04:25:05 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 17:59 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 17a15da: cargo test -p victory-gpu passes, 50 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 17:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/1251#issuecomment-7139996300) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 17a15da: `cargo test -p victory-gpu` passes, 50 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:20 UTC · original

Automated triage for the maintainers.

Needs work. The tracing is useful and compiled only with the diagnostics feature. The trace_value_write calls in Host::execute and HostList::defer_write read correctly, including the per-run grouping when VICTORY_GPU_TIMING is set. CI: passing.

What needs settling:

  • Argument layout of the two wait slots. In crates/victory-gpu/src/list.rs, the shared wait_value stub is replaced with wait32, read as (reference: u32, mask: u32, flags: u32), and wait64, read as (reference: u64, flags: u32). The trace output is only as good as that layout, and the PR gives no evidence for it. Please name the source (for example, the title's own call sites). Otherwise, log the arguments under the old signature and leave them unnamed.
  • Doc comment. The comment explaining why waits are no-ops now sits only on wait32. Move it so it covers both functions.
  • Formatting. The new functions put several parameters on one line. Run rustfmt on the changed hunks.

Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/1251#issuecomment-7149444435) <!-- victory-triage v1 head=17a15daf7a8e9ca0eefde82e643bcdb2930a3f03 verdict=needs-work at=2026-11-25T01:20:16Z --> Automated triage for the maintainers. **Needs work.** The tracing is useful and compiled only with the `diagnostics` feature. The `trace_value_write` calls in `Host::execute` and `HostList::defer_write` read correctly, including the per-run grouping when `VICTORY_GPU_TIMING` is set. CI: passing. What needs settling: - **Argument layout of the two wait slots.** In `crates/victory-gpu/src/list.rs`, the shared `wait_value` stub is replaced with `wait32`, read as `(reference: u32, mask: u32, flags: u32)`, and `wait64`, read as `(reference: u64, flags: u32)`. The trace output is only as good as that layout, and the PR gives no evidence for it. Please name the source (for example, the title's own call sites). Otherwise, log the arguments under the old signature and leave them unnamed. - **Doc comment.** The comment explaining why waits are no-ops now sits only on `wait32`. Move it so it covers both functions. - **Formatting.** The new functions put several parameters on one line. Run rustfmt on the changed hunks. --- _Generated by [Claude Code](https://claude.ai/code)_

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/Marvisak--VIctory!1251
No description provided.