GPU: say in device-removed reports which user data is a table #427

Open
GamingRipperDoc wants to merge 2 commits from upstream-pr/427 into main
GamingRipperDoc commented 2026-11-24 03:15:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by GamingRipperDoc on 2026-11-24T03:15:29Z.


The device-removed report (op_text in crates/victory-gpu/src/draw.rs) prints [heap N: …] after every user-data value, constants included. That is easy to misread: on #304 I read u13=0x0 [heap 0: Shader(0, Some([42, 2, …]))] as "this mesh draw reads heap slot 0, a null 1D texture view", and it took a diagnostic run to find that u13 is a constant in all 144 shaders that use it (RootType::Constants), so the slot was unrelated.

Each value now says which it is:

before:  u8=0xa12100 [heap 329992: null] … u13=0x0 [heap 0: Shader(0, …)]
after:   u8=0xa12100 table [heap 329992: null] … u13=0x0 const [as heap index 0: Shader(0, …)]

The view after a constant is kept, labelled as heap index, since a shader with dynamic resources may index the heap with a constant. Only diagnostics builds change; one file, nothing else reads this text.

Checked: cargo build --profile diag -p victory --features diagnostics; cargo clippy -p victory-gpu --features diagnostics --all-targets (one existing warning, in host.rs); cargo test -p victory-gpu 43 passed; rustfmt --check on draw.rs reports the same 4 places as main and none in the changed lines; cargo xtask policy ok. Windows 10, RX 9070 XT.

Not checked: a device removal with this exact build. The root types were confirmed with a local variant that printed u13=0x0(Constants) in a real report (#304, third run); this PR's wording has not appeared in one.

No game data used.

AI-assisted (Claude Code); I ran the checks above on my machine.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6573808382 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/427). Originally posted by [GamingRipperDoc](https://github.com/GamingRipperDoc) on 2026-11-24T03:15:29Z. --- The device-removed report (`op_text` in `crates/victory-gpu/src/draw.rs`) prints `[heap N: …]` after every user-data value, constants included. That is easy to misread: on #304 I read `u13=0x0 [heap 0: Shader(0, Some([42, 2, …]))]` as "this mesh draw reads heap slot 0, a null 1D texture view", and it took a diagnostic run to find that `u13` is a constant in all 144 shaders that use it (`RootType::Constants`), so the slot was unrelated. Each value now says which it is: ``` before: u8=0xa12100 [heap 329992: null] … u13=0x0 [heap 0: Shader(0, …)] after: u8=0xa12100 table [heap 329992: null] … u13=0x0 const [as heap index 0: Shader(0, …)] ``` The view after a constant is kept, labelled `as heap index`, since a shader with dynamic resources may index the heap with a constant. Only diagnostics builds change; one file, nothing else reads this text. **Checked:** `cargo build --profile diag -p victory --features diagnostics`; `cargo clippy -p victory-gpu --features diagnostics --all-targets` (one existing warning, in `host.rs`); `cargo test -p victory-gpu` 43 passed; `rustfmt --check` on `draw.rs` reports the same 4 places as `main` and none in the changed lines; `cargo xtask policy` ok. Windows 10, RX 9070 XT. **Not checked:** a device removal with this exact build. The root types were confirmed with a local variant that printed `u13=0x0(Constants)` in a real report (#304, third run); this PR's wording has not appeared in one. No game data used. AI-assisted (Claude Code); I ran the checks above on my machine. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
mercuryVM commented 2026-11-24 06:52:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T05:11:43Z.

Review: APPROVED


Tested 57b8bf5 on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (264 passed, 0 failed). cargo check -p victory-gpu --features diagnostics is clean. That matters because the changed code only builds with that feature, which the default workspace test never compiles.

  • The output now labels every value table or const, and a constant's view is shown as as heap index. Table values still use v / 32 as before. Only diagnostics builds change.
  • Nit: the loop's let (kind, index) shadows the function's kind: String parameter. That is harmless here, since the parameter is only used before the loop, but a different name such as root would read better.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6034041377 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/427#pullrequestreview-6034041377). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T05:11:43Z. **Review:** APPROVED --- Tested 57b8bf5 on Windows 11, RTX 5070, MSVC: `cargo test --workspace --no-fail-fast` passes (264 passed, 0 failed). `cargo check -p victory-gpu --features diagnostics` is clean. That matters because the changed code only builds with that feature, which the default workspace test never compiles. - The output now labels every value `table` or `const`, and a constant's view is shown as `as heap index`. Table values still use `v / 32` as before. Only diagnostics builds change. - Nit: the loop's `let (kind, index)` shadows the function's `kind: String` parameter. That is harmless here, since the parameter is only used before the loop, but a different name such as `root` would read better. AI-assisted (Claude Code).
DaviTostes commented 2026-11-24 06:55:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T03:38:47Z.


Verified 57b8bf5 on Arch Linux x86_64, Windows MSVC release build under Wine 11.22 (victory-gpu, --test-threads=1): 43 passed, 0 failed, 1 ignored.

Not covered: the wording in a real device-removed report (not reproducible on this RADV/vkd3d setup) and title behaviour (no game data).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121289630 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/427#issuecomment-7121289630). Originally posted by [DaviTostes](https://github.com/DaviTostes) on 2026-11-24T03:38:47Z. --- Verified `57b8bf5` on **Arch Linux x86_64**, Windows MSVC release build under **Wine 11.22** (`victory-gpu`, `--test-threads=1`): **43 passed, 0 failed, 1 ignored**. Not covered: the wording in a real device-removed report (not reproducible on this RADV/vkd3d setup) and title behaviour (no game data).
mercuryVM commented 2026-11-24 08:02:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T07:16:14Z.

Review: APPROVED


Tested 16d395c on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (264 passed, 0 failed), and cargo check -p victory-gpu --features diagnostics is clean.

This commit is just the rename I suggested (kind → root), so the loop no longer shadows the kind: String parameter. No behaviour change.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6035134617 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/427#pullrequestreview-6035134617). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T07:16:14Z. **Review:** APPROVED --- Tested 16d395c on Windows 11, RTX 5070, MSVC: `cargo test --workspace --no-fail-fast` passes (264 passed, 0 failed), and `cargo check -p victory-gpu --features diagnostics` is clean. This commit is just the rename I suggested (`kind` → `root`), so the loop no longer shadows the `kind: String` parameter. No behaviour change. AI-assisted (Claude Code).
sennecools commented 2026-11-24 11:04:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sennecools on 2026-11-24T10:29:16Z.


Checked in real device-removed reports on an RX 9070 XT (RDNA 4), Windows 11 Pro 26300.

The build was a diag build of main 8e79c80 + this PR at 16d395c. It also included #493 and #537. #537 only changes report text. #493 does not touch op_text's user-data loop. There were six offline runs with VICTORY_D3D12_DRED=1, and each ended in a device removal with breadcrumbs.

  • The new wording appears in all six reports. Each report has 42 to 98 table values and 18 to 44 const values. 12 to 35 of the const values carry a view, shown as [as heap index N: …].
  • No user-data value appears in the old unlabelled form (uN=0x… [heap).
  • cargo build --profile diag -p victory --features diagnostics builds cleanly with the three merged together.

No game data is in this comment.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7128846305 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/427#issuecomment-7128846305). Originally posted by [sennecools](https://github.com/sennecools) on 2026-11-24T10:29:16Z. --- Checked in real device-removed reports on an RX 9070 XT (RDNA 4), Windows 11 Pro 26300. The build was a diag build of `main` 8e79c80 + this PR at 16d395c. It also included #493 and #537. #537 only changes report text. #493 does not touch `op_text`'s user-data loop. There were six offline runs with `VICTORY_D3D12_DRED=1`, and each ended in a device removal with breadcrumbs. - The new wording appears in all six reports. Each report has 42 to 98 `table` values and 18 to 44 `const` values. 12 to 35 of the `const` values carry a view, shown as `[as heap index N: …]`. - No user-data value appears in the old unlabelled form (`uN=0x… [heap`). - `cargo build --profile diag -p victory --features diagnostics` builds cleanly with the three merged together. No game data is in this comment. AI-assisted (Claude Code).
Marvisak commented 2026-11-25 01:07:38 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-gpu/src/draw.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148351997 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/427#issuecomment-7148351997). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:17:19Z. --- <!-- victory-triage v1 head=16d395ccc0974d634158a404b5cdbb2c0d5760a8 verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `crates/victory-gpu/src/draw.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/427:upstream-pr/427'
git switch 'upstream-pr/427'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/427'
git switch 'upstream-pr/427'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/427'
git switch 'upstream-pr/427'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/427'
git switch 'main'
git merge --squash 'upstream-pr/427'
git switch 'main'
git merge --ff-only 'upstream-pr/427'
git switch 'main'
git merge 'upstream-pr/427'
git push origin 'main'
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!427
No description provided.