GPU: implement SetMarker, BeginEvent, and EndEvent on command lists (slots 0x1c0-0x1d0) #1168

Closed
geiyiliyabumo wants to merge 2 commits from upstream-pr/1168 into main
geiyiliyabumo commented 2026-11-24 16:19:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T16:19:14Z.


Summary

Closes #859

Full verification details and change notes are documented in #859 (commit a74fe6b, based on main ffe310e).

 crates/victory-gpu/src/list.rs | 369 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 366 insertions(+), 3 deletions(-)

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check on edited files: PASS
  • cargo xtask policy: PASS (zero game files/data)
  • cargo clippy --all-targets --locked -- -D warnings (default + --features diagnostics where applicable): PASS
  • Targeted & crate unit/GPU tests: PASS

AI-assisted; synthetic tests only, no game files.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6586337228 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1168). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-24T16:19:14Z. --- ### Summary Closes #859 Full verification details and change notes are documented in #859 (commit `a74fe6b`, based on `main` `ffe310e`). ```text crates/victory-gpu/src/list.rs | 369 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 366 insertions(+), 3 deletions(-) ``` ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check` on edited files: **PASS** - `cargo xtask policy`: **PASS** (zero game files/data) - `cargo clippy --all-targets --locked -- -D warnings` (default + `--features diagnostics` where applicable): **PASS** - Targeted & crate unit/GPU tests: **PASS** *AI-assisted; synthetic tests only, no game files.*
fuzeofficlal commented 2026-11-24 17:04:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-24T16:45:10Z.


Tested SetPredication / SetMarker / BeginEvent / EndEvent on RTX 5090 and WARP (VICTORY_D3D12_DEBUG=1 and VICTORY_D3D12_DRED=1). One subtle interaction with DRED breadcrumbs in set_marker:

  • Double SETMARKER desynchronizes HostList::removal_data: When VICTORY_D3D12_DRED=1 is enabled (crate::host::dred_on()), host.note_op(...) already emits a host list.SetMarker(...) breadcrumb so HostList::notes stays strictly 1:1 with D3D12_AUTO_BREADCRUMB_OP_SETMARKER entries (host.rs:685). Calling host.note_op(...) and then unconditionally calling host.list.SetMarker(...) emits two SETMARKER breadcrumbs for one note entry, shifting all subsequent crash breadcrumbs on that command list by one. Returning early after note_op when dred_on() is active (with decoded UTF-16LE/UTF-8 marker text) preserves exact 1:1 breadcrumb indexing.
  • For the CPU-backed upload path in set_predication, recording note_read(..., (gpu, 8)) on upload.GetGPUVirtualAddress() also lets DRED page-fault attribution match the staged 8-byte predicate buffer, and guarding note_op until upload succeeds avoids orphaned notes on allocation failure.

Reference commit verified with VICTORY_D3D12_DRED=1 + 64-bit high-bit deferred write readback on RTX 5090 & WARP: github.com/fuzeofficlal/VIctory@b1d1dee5c3

<!-- greyfinch-sync:Marvisak/VIctory:comment:7138151964 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1168#issuecomment-7138151964). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-24T16:45:10Z. --- Tested `SetPredication` / `SetMarker` / `BeginEvent` / `EndEvent` on RTX 5090 and WARP (`VICTORY_D3D12_DEBUG=1` and `VICTORY_D3D12_DRED=1`). One subtle interaction with DRED breadcrumbs in `set_marker`: - **Double `SETMARKER` desynchronizes `HostList::removal_data`**: When `VICTORY_D3D12_DRED=1` is enabled (`crate::host::dred_on()`), `host.note_op(...)` already emits a host `list.SetMarker(...)` breadcrumb so `HostList::notes` stays strictly 1:1 with `D3D12_AUTO_BREADCRUMB_OP_SETMARKER` entries (`host.rs:685`). Calling `host.note_op(...)` and then unconditionally calling `host.list.SetMarker(...)` emits two `SETMARKER` breadcrumbs for one note entry, shifting all subsequent crash breadcrumbs on that command list by one. Returning early after `note_op` when `dred_on()` is active (with decoded UTF-16LE/UTF-8 marker text) preserves exact 1:1 breadcrumb indexing. - For the CPU-backed upload path in `set_predication`, recording `note_read(..., (gpu, 8))` on `upload.GetGPUVirtualAddress()` also lets DRED page-fault attribution match the staged 8-byte predicate buffer, and guarding `note_op` until `upload` succeeds avoids orphaned notes on allocation failure. Reference commit verified with `VICTORY_D3D12_DRED=1` + 64-bit high-bit deferred write readback on RTX 5090 & WARP: https://github.com/fuzeofficlal/VIctory/commit/b1d1dee5c387f7fa68be389d0e0a1d7aea7d2c4b
geiyiliyabumo commented 2026-11-24 18:05:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T17:16:55Z.


Thanks @fuzeofficlal for catching the DRED breadcrumb desynchronization and upload-path attribution!

Folded both fixes into this PR:

  • In \set_marker, when \crate::host::dred_on()\ is enabled, decode UTF-16LE/UTF-8 marker labels into \host.note_op(...)\ and return early instead of emitting a second host \SetMarker, keeping \HostList::notes\ strictly 1:1 with \D3D12_AUTO_BREADCRUMB_OP_SETMARKER.
  • In \set_predication, defer
    ote_read\ on the CPU-backed upload path until \host.upload(device, 8)\ succeeds and record (upload.GetGPUVirtualAddress(), 8)\ for DRED page-fault attribution.

Re-verified \cargo test -p victory-gpu --features diagnostics --lib list::tests\ (3/3 passed) with \VICTORY_D3D12_DRED=1\ on both WARP and AMD Radeon RX 9060 XT, plus \clippy\ (default + --all-features\ -D warnings) and \cargo xtask policy.

AI-assisted; synthetic tests only, no game files.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7138958971 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1168#issuecomment-7138958971). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-24T17:16:55Z. --- Thanks @fuzeofficlal for catching the DRED breadcrumb desynchronization and upload-path attribution! Folded both fixes into this PR: - In \set_marker\, when \crate::host::dred_on()\ is enabled, decode UTF-16LE/UTF-8 marker labels into \host.note_op(...)\ and return early instead of emitting a second host \SetMarker\, keeping \HostList::notes\ strictly 1:1 with \D3D12_AUTO_BREADCRUMB_OP_SETMARKER\. - In \set_predication\, defer \ ote_read\ on the CPU-backed upload path until \host.upload(device, 8)\ succeeds and record \(upload.GetGPUVirtualAddress(), 8)\ for DRED page-fault attribution. Re-verified \cargo test -p victory-gpu --features diagnostics --lib list::tests\ (3/3 passed) with \VICTORY_D3D12_DRED=1\ on both WARP and AMD Radeon RX 9060 XT, plus \clippy\ (default + \--all-features\ \-D warnings\) and \cargo xtask policy\. *AI-assisted; synthetic tests only, no game files.*
Zipettte commented 2026-11-24 18:06:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T18:00:54Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 3247043: cargo test -p victory-gpu passes, 52 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:7140032329 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1168#issuecomment-7140032329). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T18:00:54Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 3247043: `cargo test -p victory-gpu` passes, 52 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Marvisak commented 2026-11-25 01:08:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:38:32Z.


Automated triage for the maintainers.

Merge candidate. Update after your reply: set_predication is gone, so slot 0xf8 stays E_NOTIMPL as on main, and the PR now covers only slots 0x1c0/0x1c8/0x1d0 in crates/victory-gpu/src/list.rs. On main these slots are object::missing entries: they log once and return E_NOTIMPL, which a void method's caller ignores. Here they forward the title's metadata and payload to the host SetMarker/BeginEvent/EndEvent, with a null pointer or zero size mapped to no payload. With DRED on, set_marker records only through HostList::note_op, so notes stays 1:1 with the SETMARKER breadcrumbs. Rendering is unchanged; the gain is labelled PIX captures and DRED reports. The tests check the slots in both list tables and run the calls, including null and zero-size payloads, on a host device. CI: passing (check).


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148725008 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1168#issuecomment-7148725008). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:38:32Z. --- <!-- victory-triage v1 head=e752367ae6c33349112013e561bdcdbcd573ab4d verdict=merge-candidate at=2026-11-25T07:23:04Z --> Automated triage for the maintainers. **Merge candidate.** Update after your reply: `set_predication` is gone, so slot 0xf8 stays `E_NOTIMPL` as on `main`, and the PR now covers only slots 0x1c0/0x1c8/0x1d0 in `crates/victory-gpu/src/list.rs`. On `main` these slots are `object::missing` entries: they log once and return `E_NOTIMPL`, which a void method's caller ignores. Here they forward the title's metadata and payload to the host `SetMarker`/`BeginEvent`/`EndEvent`, with a null pointer or zero size mapped to no payload. With DRED on, `set_marker` records only through `HostList::note_op`, so `notes` stays 1:1 with the `SETMARKER` breadcrumbs. Rendering is unchanged; the gain is labelled PIX captures and DRED reports. The tests check the slots in both list tables and run the calls, including null and zero-size payloads, on a host device. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
geiyiliyabumo commented 2026-11-25 02:06:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-25T01:54:09Z.


Rebased cleanly onto \main\ (\ccfb029). \cargo test -p victory-gpu --locked\ (143 passed, 0 failed), \cargo clippy -p victory-gpu --all-targets --locked -- -D warnings, and \cargo xtask policy\ all pass.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150091792 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1168#issuecomment-7150091792). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-25T01:54:09Z. --- Rebased cleanly onto \main\ (\ccfb029\). \cargo test -p victory-gpu --locked\ (143 passed, 0 failed), \cargo clippy -p victory-gpu --all-targets --locked -- -D warnings\, and \cargo xtask policy\ all pass.
upstream-sync changed title from [PR #1168] GPU: implement SetPredication, SetMarker, BeginEvent, and EndEvent on command lists to [PR #1168] GPU: implement SetMarker, BeginEvent, and EndEvent on command lists (slots 0x1c0-0x1d0) 2026-11-25 05:05:14 +00:00
geiyiliyabumo commented 2026-11-25 05:06:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-25T04:10:12Z.


Narrowed this PR as suggested in triage: removed \SetPredication\ (slot \

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152593696 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1168#issuecomment-7152593696). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-25T04:10:12Z. --- Narrowed this PR as suggested in triage: removed \SetPredication\ (slot \
upstream-sync closed this pull request 2026-11-25 22:02:49 +00:00
Marvisak commented 2026-11-25 22:04:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T21:59:41Z.


Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing because the title never calls these slots (an unimplemented list slot logs its first call, and no title run has logged them), and for the title's newer list layout their positions are not settled. Two methods were added to the base list somewhere between 0x1b8 and 0x1e8, and the marker call the console upscaler makes at 0x1d8 does not have the PC BeginEvent/EndEvent shape. Filling 0x1c0-0x1d0 on a guess would replace the log that is meant to pin them with a host call that could read title pointers as marker payloads. The gain, even when right, is PIX labels only.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7175801770 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1168#issuecomment-7175801770). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T21:59:41Z. --- Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing because the title never calls these slots (an unimplemented list slot logs its first call, and no title run has logged them), and for the title's newer list layout their positions are not settled. Two methods were added to the base list somewhere between 0x1b8 and 0x1e8, and the marker call the console upscaler makes at 0x1d8 does not have the PC `BeginEvent`/`EndEvent` shape. Filling 0x1c0-0x1d0 on a guess would replace the log that is meant to pin them with a host call that could read title pointers as marker payloads. The gain, even when right, is PIX labels only. If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

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!1168
No description provided.