Bind a rest pipeline in place of a mesh pipeline before other work on Intel (Arc) #450

Closed
Kal0s-design wants to merge 664 commits from upstream-pr/450 into main
Kal0s-design commented 2026-11-29 17:13:23 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Kal0s-design on 2026-11-29T17:13:23Z.


Refs #448. Draft.

Update: the default on Intel is now draw (third commit, 84462d6). The #448 reporter ran the same build, launcher, home and caches with only VICTORY_MESH_REST changed. With bind the device was lost after 280 s. With draw the run lasted 852 s with no device removal, until the title was suspended and closed, and the heavy-scene median went from 2.8 to 3.7 fps. A second run meant as lazy actually ran with draw (its log says mode=Draw throughout) and hung at 639 s (0x887A0006). So draw is 852 s and 639 s against 280 s for bind and 82-151 s without the rest pipeline: the best default so far, but not a complete fix. A real lazy run (startup mode=Lazy) lost the host at 216 s with 6,550 rests a frame for 6,551 mesh binds: the title's mesh dispatches almost never follow one another with nothing between them, so lazy spares next to no rests. It stays opt-in (7284911 puts all four runs in the module doc). Order on that card: draw 639-852 s > bind 280 s > lazy 216 s > no rest pipeline 82-151 s. bind stays available, and lazy now draws the point too.

First result on an Arc B580, from the #448 reporter (driver 32.0.101.9175, same profile as their earlier runs): the run lasted 280 s against 82-151 s before, with no mesh-pipeline refusals and no 0x8007000e. The log showed VICTORY_MESH_REST=Bind binding a rest pipeline for each mesh pipeline bound, about 2,100 a frame and up to 8,186. It ended right after a cold 7.2 s pipeline creation, the separate cause noted in #448. Whether the rests cost frames still needs a same-scene comparison.

A port of gilmarcs' workaround from trustno1-coder/VIctory-NVIDIA #546 (merged there, for their #227), with gilmarcs as co-author. Their finding: on an Arc B580 (driver 32.0.101.9175), a mesh pipeline left bound on a command list while copies, clears, dispatches or barriers are recorded after it hangs the GPU (DXGI_ERROR_DEVICE_HUNG). The pipeline's contents don't matter, and binding is enough. Three B580 owners reported it fixed the hang on that tree.

What it does. A tiny vertex-only "rest" pipeline with an empty root signature (mesh_rest.rs, taken from #546 nearly as is) is bound in place of a mesh pipeline before other work is recorded. VICTORY_MESH_REST=off|bind|draw|lazy: the default is now draw on an Intel adapter (was bind, see the update above) and off everywhere else, so NVIDIA and AMD record exactly the commands they did, and the new log line appears only with the mode on.

Adapted to this tree, which has no central title_call:

  • with_state leaves the mesh pipeline before draws, dispatches and indirect executions, as upstream's host_list/title_call does, so what a draw records before its bind (refresh copies, uploads) goes past no mesh pipeline. A new working_list does the same for the calls that record work directly: copies, clears, barriers, sync, value writes, waits.
  • Calls that only set state or binding (topology, viewports, scissors, targets, tables, constants, buffers) go through a new with_set_state and keep the mesh pipeline bound, like upstream's with_set_state/with_binding. I checked that none of those setters records anything onto the host list.
  • The mesh pipeline is also left before ExecuteIndirect's argument copies, before a host library (FidelityFX, DLSS) records through external::record (upstream has no such path), and when a host list closes.
  • After a rest, the draw state binds its pipeline and graphics root signature again. That's the same path a change of pipeline takes, so every root argument is set again by the bind.
  • Upstream's step that unsettles a held indirect run has no counterpart here, since this tree doesn't hold indirect executions back.

Second commit: VICTORY_MESH_REST=lazy (opt-in, never the default), for a frame-rate A/B. With bind, the leave at the start of every draw and dispatch includes the next mesh dispatch, so each mesh dispatch binds its pipeline again. That's why the #448 log shows as many rests as mesh binds. lazy (which since the third commit also draws the rest's point) sends the two mesh-dispatch calls through with_set_state, so a mesh pipeline stays bound from one mesh dispatch to the next, and the draw state doesn't bind it again. Everything else still leaves it, as with bind. The cost: what a mesh dispatch records before its bind then goes past the previous mesh pipeline. In every mode, what it records after its own bind (refresh of its vertex data, its tables, the moves of its targets to the render-target state) already goes past its own mesh pipeline. The module doc now says this, and drops its earlier claim that a run of mesh dispatches keeps one bind, which wasn't true for bind or draw. Untested on an Arc card. cargo test -p victory-gpu --lib passes with =lazy (530), the default suite (530) and --all-features -- --test-threads=1 (597) pass, and clippy with and without --all-features is clean.

Checked here (an NVIDIA card, so only off by default, or forced on):

  • cargo test -p victory-gpu --lib passes with VICTORY_MESH_REST unset, =bind and =draw (529 each, two new). With =bind, --all-features -- --test-threads=1 also passes. The new a_bound_mesh_pipeline_is_left_once checks that a rest is recorded once per bound mesh pipeline (closing included) and never with the mode off. rest_pipeline_binds_draws_and_runs builds, draws and runs the rest pipeline on the device.
  • Clippy, with and without --all-features, and cargo xtask policy: clean. victory-hle and victory tests pass.
  • The commit also cherry-picks cleanly onto #439's branch (cfd5ebd), where the gpu tests pass with the mode off and on (557).

Not covered: no unit test binds a title mesh pipeline, so the draw-path rests are only exercised in the game. Per #448's own runs, an unbind removed the mesh-pipeline refusals but not the later device removal, so this is expected to help with the hang, not the whole #448 regression.

AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5553105891 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/450). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-11-29T17:13:23Z. --- Refs #448. **Draft.** **Update: the default on Intel is now `draw` (third commit, 84462d6).** The #448 reporter ran the same build, launcher, home and caches with only `VICTORY_MESH_REST` changed. With `bind` the device was lost after 280 s. With `draw` the run lasted **852 s with no device removal**, until the title was suspended and closed, and the heavy-scene median went from 2.8 to 3.7 fps. A second run meant as `lazy` actually ran with `draw` (its log says `mode=Draw` throughout) and **hung at 639 s** (`0x887A0006`). So `draw` is 852 s and 639 s against 280 s for `bind` and 82-151 s without the rest pipeline: the best default so far, but not a complete fix. A real `lazy` run (startup `mode=Lazy`) lost the host at **216 s** with 6,550 rests a frame for 6,551 mesh binds: the title's mesh dispatches almost never follow one another with nothing between them, so `lazy` spares next to no rests. It stays opt-in (7284911 puts all four runs in the module doc). Order on that card: `draw` 639-852 s > `bind` 280 s > `lazy` 216 s > no rest pipeline 82-151 s. `bind` stays available, and `lazy` now draws the point too. First result on an Arc B580, from the #448 reporter (driver 32.0.101.9175, same profile as their earlier runs): the run lasted **280 s against 82-151 s** before, with no mesh-pipeline refusals and no `0x8007000e`. The log showed `VICTORY_MESH_REST=Bind` binding a rest pipeline for each mesh pipeline bound, about 2,100 a frame and up to 8,186. It ended right after a cold 7.2 s pipeline creation, the separate cause noted in #448. Whether the rests cost frames still needs a same-scene comparison. A port of gilmarcs' workaround from trustno1-coder/VIctory-NVIDIA #546 (merged there, for their #227), with gilmarcs as co-author. Their finding: on an Arc B580 (driver 32.0.101.9175), a mesh pipeline left bound on a command list while copies, clears, dispatches or barriers are recorded after it hangs the GPU (`DXGI_ERROR_DEVICE_HUNG`). The pipeline's contents don't matter, and binding is enough. Three B580 owners reported it fixed the hang on that tree. **What it does.** A tiny vertex-only "rest" pipeline with an empty root signature (`mesh_rest.rs`, taken from #546 nearly as is) is bound in place of a mesh pipeline before other work is recorded. `VICTORY_MESH_REST=off|bind|draw|lazy`: the default is now `draw` on an Intel adapter (was `bind`, see the update above) and `off` everywhere else, so NVIDIA and AMD record exactly the commands they did, and the new log line appears only with the mode on. **Adapted to this tree,** which has no central `title_call`: - `with_state` leaves the mesh pipeline before draws, dispatches and indirect executions, as upstream's `host_list`/`title_call` does, so what a draw records before its bind (refresh copies, uploads) goes past no mesh pipeline. A new `working_list` does the same for the calls that record work directly: copies, clears, barriers, sync, value writes, waits. - Calls that only set state or binding (topology, viewports, scissors, targets, tables, constants, buffers) go through a new `with_set_state` and keep the mesh pipeline bound, like upstream's `with_set_state`/`with_binding`. I checked that none of those setters records anything onto the host list. - The mesh pipeline is also left before ExecuteIndirect's argument copies, before a host library (FidelityFX, DLSS) records through `external::record` (upstream has no such path), and when a host list closes. - After a rest, the draw state binds its pipeline and graphics root signature again. That's the same path a change of pipeline takes, so every root argument is set again by the bind. - Upstream's step that unsettles a held indirect run has no counterpart here, since this tree doesn't hold indirect executions back. **Second commit: `VICTORY_MESH_REST=lazy` (opt-in, never the default), for a frame-rate A/B.** With `bind`, the leave at the start of every draw and dispatch includes the next mesh dispatch, so each mesh dispatch binds its pipeline again. That's why the #448 log shows as many rests as mesh binds. `lazy` (which since the third commit also draws the rest's point) sends the two mesh-dispatch calls through `with_set_state`, so a mesh pipeline stays bound from one mesh dispatch to the next, and the draw state doesn't bind it again. Everything else still leaves it, as with `bind`. The cost: what a mesh dispatch records before its bind then goes past the previous mesh pipeline. In every mode, what it records after its own bind (refresh of its vertex data, its tables, the moves of its targets to the render-target state) already goes past its own mesh pipeline. The module doc now says this, and drops its earlier claim that a run of mesh dispatches keeps one bind, which wasn't true for `bind` or `draw`. Untested on an Arc card. `cargo test -p victory-gpu --lib` passes with `=lazy` (530), the default suite (530) and `--all-features -- --test-threads=1` (597) pass, and clippy with and without `--all-features` is clean. **Checked here (an NVIDIA card, so only off by default, or forced on):** - `cargo test -p victory-gpu --lib` passes with `VICTORY_MESH_REST` unset, `=bind` and `=draw` (529 each, two new). With `=bind`, `--all-features -- --test-threads=1` also passes. The new `a_bound_mesh_pipeline_is_left_once` checks that a rest is recorded once per bound mesh pipeline (closing included) and never with the mode off. `rest_pipeline_binds_draws_and_runs` builds, draws and runs the rest pipeline on the device. - Clippy, with and without `--all-features`, and `cargo xtask policy`: clean. `victory-hle` and `victory` tests pass. - The commit also cherry-picks cleanly onto #439's branch (cfd5ebd), where the gpu tests pass with the mode off and on (557). **Not covered:** no unit test binds a title mesh pipeline, so the draw-path rests are only exercised in the game. Per #448's own runs, an unbind removed the mesh-pipeline refusals but not the later device removal, so this is expected to help with the hang, not the whole #448 regression. AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
TaynanGT commented 2026-11-29 19:09:14 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T19:09:14Z.


Thanks for retaining the upstream credit and separating the modes. The two draw runs support further Intel-only testing, but not a stability claim. Keep lazy opt-in and the non-Intel path unchanged. The next matched Arc test should verify effective mode, device-removal timing, pipeline creation, upload backlog and rendered frame times before promoting the workaround.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7261051283 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/450#issuecomment-7261051283). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-29T19:09:14Z. --- Thanks for retaining the upstream credit and separating the modes. The two draw runs support further Intel-only testing, but not a stability claim. Keep lazy opt-in and the non-Intel path unchanged. The next matched Arc test should verify effective mode, device-removal timing, pipeline creation, upload backlog and rendered frame times before promoting the workaround.
TaynanGT commented 2026-11-30 17:06:13 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:06:13Z.


main has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current main and open a new PR; I'll review it there.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7285722910 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/450#issuecomment-7285722910). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-30T17:06:13Z. --- `main` has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current `main` and open a new PR; I'll review it there.

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
TaynanGT/Vice-Tay!450
No description provided.