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

Closed
LaunchDoesntCode wants to merge 1 commit from upstream-pr/1251 into main
LaunchDoesntCode commented 2026-11-24 16:47:35 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LaunchDoesntCode on 2026-11-24T16:47:35Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6586868071 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1251). Originally posted by [LaunchDoesntCode](https://github.com/LaunchDoesntCode) on 2026-11-24T16:47:35Z. --- 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.
Zipettte commented 2026-11-24 18:06:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T17:59:25Z.


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).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7139996300 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1251#issuecomment-7139996300). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T17:59:25Z. --- 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)._
upstream-sync closed this pull request 2026-11-25 02:03:42 +00:00
Marvisak commented 2026-11-25 02:05:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:20:18Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149444435 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1251#issuecomment-7149444435). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:20:18Z. --- <!-- 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

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1251
No description provided.