Repository navigation
Conversation
The console's wave operations include a pixel shader's helper lanes; the host's leave them out. A loop that serves one lane's value per pass (v_readfirstlane, then the lanes with that value) never serves a helper lane whose value no live lane shares, and a loop over a range taken from a whole-wave min/max gives a helper lane an unreliable range. Such a lane runs to the loop limit; on an RTX 3080 that made single draws of Grand Theft Auto VI's world (PS_VehicleLiveryOff..., PS_Textured_Eight) take longer than the driver allows, which reset the GPU. Each was found with every draw and dispatch made to finish before the next. Where the host runs shader model 6.7, pixel shaders with wave operations are now emitted as 6.7 with the entry attribute "waveops-include-helper-lanes" (DXC's [WaveOpsIncludeHelperLanes]); the attribute group is written only into modules that use it, so other shaders' bytes are unchanged. Without 6.7, v_readfirstlane in a pixel shader gives a helper lane its own value: what the console gives it on the pass that serves it. The setting is part of the translation, so the shader cache keys on it. The RTX 3080 reports 6.7; all of the title's vertex and pixel pipelines build with it. With it, the vehicle draw no longer hangs; another draw (MSR_VS_CascadeShadows_drawskinned) still does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Melow-code
left a comment
There was a problem hiding this comment.
Two points block this PR. Two points are questions. One point is context.
Blocking: the cache key freezes a value that can be set later
build() builds the key once in a OnceLock. The key now includes helper_lane_waves(). set_helper_lane_waves() runs in Host::create(), after D3D12CreateDevice. Nothing makes create() run before the first build(). If build() runs first, the key freezes with helper_lane_waves() == false. The cache then serves 6.6 translations on a 6.7 host, or the reverse. This is the same OnceLock race that PR #2369 addresses. Fix: set the value before the first key is built, or read the value when the key is used, not when it is frozen.
Blocking: no test
The PR adds 107 lines and no test. Nothing covers the DXIL group-5 attribute (waveops-include-helper-lanes), the 6.7 header (version and shader model), or the select(isHelperLane, a, r) fallback. The repo requires a test that fails before the fix and passes after. Please add one for each change, or say why a test is not possible.
Question: set_function_attr overwrites the attribute
set_function_attr writes funcs[i].attr = Some(attr) with no check. main is created with attr = None, so this is safe today. If main ever carries another attribute, this overwrites it. Should the setter reject an already-set attribute?
Question: two call sites for set_helper_lane_waves
victory-gpu/src/host.rs::create() and victory-shader/src/emit/host.rs both call set_helper_lane_waves(). The two crates share one global AtomicBool. Could the two hosts disagree in one process? Are both call sites needed?
Context: the remaining hang is a vertex shader
The PR notes that MSR_VS_CascadeShadows_drawskinned still hangs. That is a vertex shader, outside this pixel-only fix. This is context, not a defect in this PR.
Assisted-by: DeepSeek V4 Pro (OpenCode)
Generated with Claude Code
|
Automated triage for the maintainers. Needs rebase. This PR conflicts with current Generated by Claude Code |
catminou4
left a comment
There was a problem hiding this comment.
Helper-lane wave operations gated on SM 6.7 (CheckFeatureSupport), mergeable=False against main 940d32f — needs a rebase. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Note SM 6.7 requires Agility SDK 1.7x — ties to #2383.
|
Regression data point on the full retail dump: this PR gains 808 programs but loses 3,002, so the net is -2,194 validated. Method:
Program-by-program (
So the helper-lane pixel work does what it says for its own stage (that is presumably the +808), but something in the same tree makes scalar memory reads fail to trace in the mesh/vertex lowering. Worth running this exact command before merging; if you want, I can also bisect the PR's commits to say which one introduces the Baseline command and dump are the same as in the #1458 reports. |
|
Correction to my comment above - the regression is not in this PR, and I compared against the wrong baseline. The PR's merge-base is
So on its own base this PR is neutral: 21,724 before, 21,724 after, same lost set ( Apologies for the noise - the fix is to rebase the PR on current main and re-run, where the expected number is 23,918. |
…me and shader validation (by gomeaw) Takes the place of the adapter selection hand-ported earlier on this branch: the pull request also makes the offline pipeline check use the selected adapter and its wave width, wants shader model 6.6 of it, and adds VICTORY_D3D12_ADAPTER to pick one by index or name. Kept beside it: Host::max_wave_lanes (DexNom DexNom#16) and the shader model 6.7 query (Marvisak Marvisak#2373). README hunk left out. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
AMD data, Radeon 780M (RDNA3 iGPU, reports SM 6.8), Windows 11, head 58f0be9. I wrote a hardware test for this: a pixel program (hand-assembled console ISA) that serves one per-pixel key per pass (
So the 6.7 path does fix helper lanes on RDNA3 (3/3 runs), and WARP needs it too (it leaves helpers out of Two problems though:
Happy to share the test ( AI-assisted (Claude). |
|
Follow-up on the validator failure: it comes from let valver16 = self.m.md_node(vec![Some(one), Some(six)]);
self.m.named_md("dx.valver", vec![valver16]);(in place of With that change on 58f0be9 and validation fatal again, the helper-lane draw test validates and gives 0 wrong neighbours in wave64 on both the Radeon 780M and WARP (main: 8 and 18). The test is now its own PR, #NUMBER, ignored as a defect until a fix like this one lands. AI-assisted (Claude). |
|
@Vyto-Line I rebased this onto main 63bcca4 with the validator fix, in case it's useful: https://github.com/kilolimaVI/VIctory/commits/shader/helper-lane-waves
On a Radeon 780M with validation fatal: the helper-lane test gives 0 wrong neighbours on the 780M and on WARP (main: 8 and 18); Feel free to pull it into this PR. If you'd rather I open it as a separate PR that keeps your commit, say so. AI-assisted (Claude). |
|
@Vyto-Line since this is labeled "needs rebase" and there was no reply to the rebased branch, I opened #3749 to carry it forward. Your commit is in it unchanged, with your authorship, plus the If you'd rather update this PR yourself, say so and I'll close #3749. AI-assisted (Claude). |
The console's wave operations include a pixel shader's helper lanes; the host's leave them out. A loop that serves one lane's value per pass (v_readfirstlane, then the lanes with that value) never serves a helper lane whose value no live lane shares, and a loop over a range taken from a whole-wave min/max gives a helper lane an unreliable range. Such a lane runs to the loop limit; on an RTX 3080 that made single draws of Grand Theft Auto VI's world (PS_VehicleLiveryOff..., PS_Textured_Eight) take longer than the driver allows, which reset the GPU. Each was found with every draw and dispatch made to finish before the next.
Where the host runs shader model 6.7, pixel shaders with wave operations are now emitted as 6.7 with the entry attribute
"waveops-include-helper-lanes" (DXC's [WaveOpsIncludeHelperLanes]); the attribute group is written only into modules that use it, so other shaders' bytes are unchanged. Without 6.7, v_readfirstlane in a pixel shader gives a helper lane its own value: what the console gives it on the pass that serves it.
The setting is part of the translation, so the shader cache keys on it. The RTX 3080 reports 6.7; all of the title's vertex and pixel pipelines build with it. With it, the vehicle draw no longer hangs; another draw (MSR_VS_CascadeShadows_drawskinned) still does.