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

Closed
github-bot wants to merge 664 commits from github-bot/gh-450 into main AGit
Owner

@⁠Kal0s-design on GitHub · 2026-11-29 17:13 UTC · original
Kal0s-design:fix/intel-mesh-rest → main · +60456 −5464 · 207 files · 664 commits · closed without merging

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

**@⁠Kal0s-design** on GitHub · 2026-11-29 17:13 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/450) `Kal0s-design:fix/intel-mesh-rest` → `main` · +60456 −5464 · 207 files · 664 commits · closed without merging 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)
Port of gilmarcs' workaround from trustno1-coder/VIctory-NVIDIA #546
(their #227): 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. A small vertex-only "rest" pipeline with
an empty root signature is bound in its place first.

VICTORY_MESH_REST=off|bind|draw, default bind on an Intel adapter and off
elsewhere, so other cards record exactly what they did.

Adapted to this tree, which has no central title_call:
- crate::list::working_list leaves the mesh pipeline for the title calls
  that record work (copies, clears, barriers, sync, value writes, waits),
  and with_state does too before draws, dispatches and indirect executions
  (as upstream's host_list/title_call), so what a draw records before its
  bind goes past no mesh pipeline; calls that only set state or binding
  (topology, viewports, scissors, targets, tables, constants, buffers) go
  through with_set_state and keep it, as upstream's with_set_state and
  with_binding;
- also before ExecuteIndirect's argument copies, before a host library
  (FidelityFX, DLSS) records through crate::external::record, and when a
  host list closes;
- a draw state that sees the list's rest count change binds its pipeline
  and graphics root signature again: the same path a change of pipeline
  takes, after which every root argument is set again by the bind.

The per-frame log line appears only when the mode is on.

Co-Authored-By: gilmarcs <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 17:15:22 +00:00
With bind, every draw and dispatch leaves a bound mesh pipeline first,
the next mesh dispatch included, so each mesh dispatch binds its pipeline
again: the #448 log shows as many rests as mesh binds (about 2,100 a
frame, up to 8,186).

lazy (opt-in, never the default) routes the two mesh dispatch calls
through with_set_state when the mode is lazy: a mesh pipeline bound stays
bound before the next mesh dispatch, and the draw state does not bind it
again. Everything else leaves it as with bind: other draws, dispatches
and indirect executions, the title calls that record work, a host
library, the list closing.

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 (its
vertex data's refresh, its tables, the moves of its targets into the
render target state) already goes past its own one; the module doc
now says so, and no longer says that a run of mesh dispatches
keeps its one bind, which did not hold with bind or draw.

For an A/B of frame rate on an Arc card against bind; untested there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On an Arc B580 (#448; same build c2536e7, launcher, home and shader and
pipeline caches, only VICTORY_MESH_REST changed) a run with bind lost the
device after 280 s, right after a cold 7.2 s pipeline creation; a run
with draw ran 852 s with no device removal, until the title was
suspended and closed. One run each, but the longest this tree has run on
that card in seven (82 to 280 s before).

So an Intel card now gets draw by default: the rest pipeline is bound
and draws its one clipped point. bind stays available. lazy, which keeps
the mesh pipeline between two mesh dispatches, now draws the point too
(Mode::draws), so that it differs from the default only in where it
rests. Other cards still default to off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A run meant as lazy ran with draw (its log says mode=Draw throughout) and
hung at 639 s, so draw is two runs now: 852 s with no removal and 639 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-29 19:09 UTC · original

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** on GitHub · 2026-11-29 19:09 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/450#issuecomment-7261051283) 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.
With mode=Lazy confirmed at startup, the run lost the host at 216 s, and
the per-frame line showed 6,550 rests for 6,551 mesh binds: in the title
two mesh dispatches almost never follow each other with nothing recorded
between them, so lazy spares next to no rests. It stays opt-in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot closed this pull request 2026-11-30 17:08:32 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-30 17:06 UTC · original

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.

**@⁠TaynanGT** on GitHub · 2026-11-30 17:06 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/450#issuecomment-7285722910) `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

This discussion has been locked. Commenting is limited to contributors.
No description provided.