Skip to content

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

Closed
LaunchDoesntCode wants to merge 1 commit into
Marvisak:mainfrom
LaunchDoesntCode:diagnostics/trace-command-list-memory-waits
Closed

LaunchDoesntCode wants to merge 1 commit into
Marvisak:mainfrom
LaunchDoesntCode:diagnostics/trace-command-list-memory-waits

Conversation

@LaunchDoesntCode

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Owner

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

@LaunchDoesntCode LaunchDoesntCode closed this by deleting the head repository Nov 25, 2026
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants