Repository navigation
[BUNDLE] NVIDIA stack: Impre-visible's tree (wave64 #189 + the world-run list, 12 PRs) checked together, stacked on #1589 - #1638
MamaLeVrai wants to merge 140 commits into
Conversation
Since the world bring-up, main no longer builds on Linux: victory-gpu names host_resource outside its cfg(windows), and victory-hle reaches Windows-only modules (xmem, files, lifecycle, the text entry dialog). This gates those uses only, as the smallest base for a native Linux runtime: - view_format and the D3D12 allocator hookup are Windows-only, like what they call. - XLaunchNewGame ends the title only on Windows; the text entry dialog answers "dismissed" elsewhere. - translate --validate / --pipelines refuse to start off Windows (no host DXIL validator or D3D12 there); translation itself runs. - Tests that parse the test binary as a PE image, or use Windows title paths, are ignored off Windows with the reason. Tested: Linux (CachyOS, rustc 1.98.1): cargo test --workspace passes (162 passed, 13 ignored). cargo check --target x86_64-pc-windows-msvc --all-targets gives the same diagnostics as before (none). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pixel programs that use the I/J VGPRs as plain values (custom interpolation, math on the weights) failed with "barycentrics read directly". They are now channels y and z of an SV_Barycentrics input (SM 6.1+, the emitter targets 6.6) declared with the interpolation mode of their kind (perspective/linear, center/centroid/sample), one element per mode (semantic index 0 and 1), with the Barycentrics shader flag and SFI0 feature. GFX10 interpolates P0 + i (P1 - P0) + j (P2 - P0) with P0 the provoking vertex, which the host's barycentrics weight as vertex 0, so i = y and j = z. The VGPRs are loaded on first use as a value, so programs that only feed them to v_interp_* declare nothing new. A console signature's own SV_Barycentrics row (D3D name 23) is parsed and reused. Pull-model barycentrics stay unsupported. SV_Barycentrics is left unpacked (no row, packing location -1), like other non-packed system values: the DXIL validator refuses it in a row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
v_interp_p1/p2 (and the f16 forms) fed with an i or j that is not the loaded input VGPR now evaluate each half as the hardware does: P0 + i (P1 - P0) for the first, the old dst + j (P2 - P0) for the second, with the vertex values read by attributeAtVertex. That needs the element declared constant, so every other interpolation of the same attribute row is weighed from its vertices with SV_Barycentrics of its mode, and flat reads stay loadInput of the provoking vertex. v_interp_mov of P10 and P20 reads P1 - P0 and P2 - P0 the same way when the program also interpolates the attribute (so the hardware holds the deltas); alone it is still refused. The translate command's tally counts Interp::Weighted as interpolated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
…us, and COM/DLL handle leaks
`VICTORY_SHOW_TARGET=<w>x<h>-f<format>` (e.g. `2560x1440-f28`) shows the last render target of that size and DXGI format each frame instead of the title's frame: it is copied 1:1 to the top left of the back buffer, and only when its format is the window's. Draws and dispatches still run as before; only what reaches the window changes. With the world's lit image black, this shows what its earlier passes did draw: on Grand Theft Auto VI, a 2560x1440 RGBA8 target of the geometry pass shows the scene's objects (packed surface data, so false colours). The target is the one `capture::note_target` last saw bound, so it needs a diagnostics build; without the variable nothing changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
image_sample_d_cl was refused by name, and behind it every program hit a cube sample with explicit gradients, refused as "a cube sample with ... gradients". Both now translate to sampleGrad: - A cube's gradients on GFX10 are of the face coordinates (s, t), four addresses rather than six, so the coordinates follow at 4. They become the direction's gradients through the face's linear part of cube_direction (u = 2s - 3, v = 2t - 3; the major axis does not move), in the new cube_gradient. - `_cl`: the level-of-detail clamp follows the coordinates and is passed as sampleGrad's clamp. translate --validate on shaders.rpf: vertex/pixel 12172 -> 12197 validated; both errors are gone from the list. Not yet compared against the console's sampling at runtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… on divergent s_barrier
lower.rs: keep the PR's lazy barycentric VGPR inputs next to main's `Reg::S(n)` arm for uninitialized SGPRs. mod.rs: the barycentric test helper passes the structure to resource::track, which now takes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
DXIL allows at most two SV_Barycentrics input elements, one perspective
and one linear. A program reading both perspective center and centroid
I/J as values declared two perspective elements, which the validator
refuses ("There can only be up to two input attributes of
SV_Barycentrics with different perspective interpolation mode").
The second mode of the same kind is now an Unsupported reason rather
than a second element. Reusing the first element would hand centroid
reads center weights (or the reverse), which differ on edge pixels: a
silent wrong value. Before this PR such reads were refused anyway.
Test: center + centroid values are refused; centroid alone still
translates with one element.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
The ISA's special cases in its order: a NaN numerator or denominator comes back quieted, 0/0 and inf/inf give NaN, x/0 and inf/x a signed infinity, 0/x and x/inf a signed zero, otherwise |S0| with the quotient's sign. Worked on the f32 values of the f16 operands, which are exact.
The ISA's "exponent of S0 all ones -> overflow" check runs before the final |S0| case, so a NaN quotient with a finite, non-zero numerator and denominator gives sign | infinity, as measured on gfx1036 hardware. The zero, infinity and invalid checks still come first.
These write SCC, but their lowering gave no SCC value, so the generic "result is not zero" stood in. The ISA sets it otherwise: - s_min_i32/u32, s_max_i32/u32: SCC = 1 when src0 is the value chosen (src0 < src1 for min, src0 > src1 for max). - s_lshl1..4_add_u32: SCC = 1 when (src0 << n) + src1 overflows 32 bits, through bits shifted out of src0 or the add's carry. So s_min_u32(5, 3) left SCC = 1 (3 is not zero) where the hardware leaves 0, and s_lshl1_add_u32(1, 0xFFFFFFFE) left 0 where it leaves 1; an s_cselect or s_cbranch_scc after them took the wrong side.
The d16 forms of the typed buffer loads return each channel as 16 bits, two per VGPR, low half first; the decoder already sizes their data that way. The lowering only treated `buffer_` names as d16, so a tbuffer_load_format_d16_* went through the 32-bit path: the first VGPR got channel x as a 32-bit value (the f32 bits of 1.0 instead of the f16 pair (1.0, 2.0)) and the other channels were dropped. The format path now packs its channels for d16: integer formats keep their low 16 bits, the other formats become f16 (as the MUBUF d16 path converts them).
Add Wave64Mode (Native, Wave32, Emulate) and TranslateOptions so Wave64 compute shaders lower and run on 32-lane GPUs (NVIDIA/Intel) and narrower hosts such as WARP instead of failing CreateComputePipelineState with E_INVALIDARG on WaveSize(64). - Add Wave64Mode, TranslateOptions, translate_with, and emit_with while keeping translate/emit defaulting to Wave64Mode::Native. - Resolve constant-lane SGPR spills across v_writelane_b32/v_readlane_b32 via resource::spilled_sgprs. - Implement virtual 64-lane mapping for Wave32 (two aligned 32-lane waves) and portable LDS emulation without WAVE_OPS for narrower hosts, with post-dominator uniformity checks to reject cross-half barriers in divergent control flow rather than hanging. - Auto-detect host wave capabilities in victory-gpu::Host (with VICTORY_WAVE64_EMULATE override and mode byte in shader_cache keys) and in victory translate --pipelines. - Add synthetic RDNA2 compute tests (PSO validation + execution on hardware GPU and WARP).
SDATA on s_atc_probe and s_atc_probe_buffer is a 7-bit immediate, the buffer resource is four dwords, and GLC/DLC are not operands of either.
…PP, host) Incorporate verified follow-up fixes from PR Marvisak#189 reviewers and contributors: - Fence single-console-wave LDS accesses at group-uniform joins/exits and reject unfenceable divergent regions (fixes marquezinii's split-block stale LDS readback; from alfycs#1 by @erickbobd). - Allow Wave32 divergent v_readfirstlane per half without LDS barriers (fixes waterfall loops / common divergent refusals reported by @AKA0GHOST and @NuraadGit), preserve ValUniform propagation across unguarded v_mov_b32 copies for uniform v_readfirstlane in divergent branches (@marquezinii), and return lane 0 when EXEC == 0 in emulated_readfirstlane. - Clamp DPP row_shr/row_shl lane indices using inside before read_lane/exchange_64 to avoid out-of-range waveReadLaneAt on WARP 1.0.22 (@ifBars). - Verify DXGI_ADAPTER_FLAG_SOFTWARE in shader::emit::host::Host::new(true) for Wine/DXVK (@dpalacios69, @tanishq-dubey), base recommended_wave64_mode_matches_device_capabilities on queried capabilities (@ifBars), and serialize wave64 GPU tests under valu_tests::ONE_AT_A_TIME (@r4tedx). Co-authored-by: erickbobd <188809599+erickbobd@users.noreply.github.com>
Avoid false positives in plan_lds_fences on Wave32: - Skip need_lds_barriers in Wave32 when total_threads <= 32 (single native host wave). - Track reads vs writes/atomics separately in plan_lds_fences so multiple pure ds_read* instructions inside a divergent region or loop are allowed while RAW/WAW/WAR hazards remain rejected.
buffer_gl0_inv and buffer_gl1_inv name a buffer but read no descriptor, so resource tracking refused them before lowering. Skip descriptor tracking for _inv buffer instructions and lower the pair to nothing, as the existing scalar cache instructions already are. Add a synthetic full-pipeline test.
|
Tested For context, an earlier clean upstream revision ( Still blocked at the first 3D scene. DRED showed one list stopped at command 795 of 2283, in a series of DispatchMesh calls, followed by two lists that hadn't started. Removal reason was DXGI_ERROR_DEVICE_HUNG. No per-mesh marker identified the shader. The last captured normal frame showed the opening story card. No pipeline skips or forced render target. AI-assisted test and analysis. Happy to compare the same setup against a specific follow-up fix. |
…on old validators
PSV0 shared one string-table copy of a repeated semantic name (TEXCOORD0
and TEXCOORD1 pointing at the same "TEXCOORD"). DXC's PSV writer writes
one copy per element, and validators before 1.8 compare PSV0 byte for
byte, so any signature repeating a name was rejected there ("Pipeline
State Validation does not match"); 1.8 compares the strings and accepted
both. Checked against dxil.dll 1.7, 1.8 and 1.9.
Validator::version() reads IDxcVersionInfo; the compute-derivative test
skips dxil.dll validation when the validator predates 1.8, which rejects
dx.valver 1.8 outright. Translated shaders never go through dxil.dll.
Reported by @alexdeliu.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
ryotdev: thank you. 117 compute PSOs rejected for 64 lanes at For the hang in the DispatchMesh run (command 795 of 2283) two diagnostics PRs that this tree does not have are the next step, so I built the same tree with them: branch
To run it: a diagnostics build with AI-assisted (Claude Code); no game data. |
….dll is older than validator 1.8" This reverts commit 119b763.
…tic names per element, skip on validators older than 1.8) The author's head now does what the bundle's own commit did (a validator version query and the skip below 1.8), and fixes the second failing test at its cause; the bundle's commit is reverted just before this merge. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ring The shader chain moved: Marvisak#306 is at its author's new head (e3067ae), and the bundle's own validator commit is reverted. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…centrics The shader chain moved: Marvisak#306 is at its author's new head (e3067ae), and the bundle's own validator commit is reverted. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
First NVIDIA run of this bundle: RTX 5090 (32-lane waves), driver 621.40, Windows 11 Pro 10.0.28000, Rust 1.98.1, head
1.
On AMD 86 is not widened, which is why the RX 6950 XT run is green. Suggested fix: compare against the format the texture was created with, i.e. 2. The title itself was not run on this exact bundle. (Runs of #189 and #1523 alone on this machine: #1586.) AI use: Claude Code (Claude Opus 5.5) ran the commands, traced the failure and wrote this; I checked it. |
…bustness The shader chain moved: Marvisak#306 is at its author's new head (e3067ae), and the bundle's own validator commit is reverted. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The shader chain moved: Marvisak#306 is at its author's new head (e3067ae), and the bundle's own validator commit is reverted. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Offline shader counts on a retail dumpResult: +226 programs over #1402 (head 119b763), 0 lost. Head 0be02a1, compared with #1402 at 119b763: 23,412 → 23,638 validated.
These are exactly the 226 programs that #1504 gains on top of #1492 (measured there). #1504 is in this bundle's history. So the bundle's other changes, wave64 compute and the world-run list, change no offline count. That fits: their effect is on the runtime side (pipelines the host refuses, device removal), which an offline Method: |
The shader chain moved: Marvisak#306 is at its author's new head (e3067ae), and the bundle's own validator commit is reverted. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
71fb802 to
ab4a6e6
Compare
|
Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
|
Automated triage for the maintainers. Needs rebase. This pull request conflicts with Generated by Claude Code |
One PR in place of 12. The tree Impre-visible ran on a GTX 1660 under Linux (their report on #1589) as one branch, checked: wave64 compute on 32-lane hosts (#189, as merged in #1589) plus the list of the world-run stack of #1632 and #1523 (NVIDIA hosts: widen unsupported 16-bit targets, size the view heap to the host's limit). In their run on #1589 the compute pipelines refused by the host went from 111 to 0, with no device removal. Every head is merged unchanged onto
mainplus #1589, and the result is built and tested together.What is inside
873548f2dbfe5d2dab001226617951ceb1eb08e4c897587b42ecd19687a195863be4e0489d84135fa370c61bff946edfe7131a4692a1Changes made while bundling
No PR was edited. Everything below is a separate commit or the body of a merge commit. The list is the one of #1632 (see there for #1077, #1175, #1516 and #542) and the same kinds of overlap came up again, plus the new ones of #189 and #1523:
root_uavs: Shaders, GPU: root UAVs (stacked on #489) #1077 adds the field toHostShader; the literals in three tests that other PRs of the stack add (cs_with_wave_sizeinemit/host.rsfrom Shaders: emulate Wave64 compute shaders on Wave32 and narrower hosts #189,validate_and_create_cs_psoinemit/shader.rs, the root view test) get it.keep_dynamic), so Shaders, GPU: root UAVs (stacked on #489) #1077'sself.dynamic.push(..)for a root UAV becomeslist.keep_dynamic(heap, index, 1).const RENDER_TARGETinhost_texture; the second one is dropped. GPU: drop unsupported UAV/RT flags on typed host textures and guard RTV creation #1040's testhost_texture_drops_unsupported_uav_flag_for_b5g5r5a1assumed that every adapter refuses a typed UAV on B5G5R5A1_UNORM, wherehost_textureonly drops what the adapter refuses (an RX 6950 XT accepts it, so it failed onmainplus GPU: drop unsupported UAV/RT flags on typed host textures and guard RTV creation #1040 alone); it now asks the adapter withCheckFeatureSupport.valu_tests.rs, both kept; a test of Shaders: zero missing typed-buffer components #1516 buildsPartswithout Shaders: emulate Wave64 compute shaders on Wave32 and narrower hosts #189'soptionsfield and now has it.bound_raw_offset) is applied to the stack's one raw-view branch (SRV range, UAV range or heap buffer, Shaders: scalar loads through a heap buffer that vector accesses use read a buffer view #1015 and Shaders: scalar buffer loads from a UAV read it raw #1055); the test helper it adds needed the structured program as the fourth argument ofresource::track(63 open PRs call resource::track with three arguments and break cargo test once merged (since 6638098) #801),optionsonParts(Shaders: emulate Wave64 compute shaders on Wave32 and narrower hosts #189) androot_uavsonHostShader(Shaders, GPU: root UAVs (stacked on #489) #1077).#302 and #489 are inside #1077's own commits and are not marked as merged by this bundle.
Left out, and why
385dad2) leaves the 16-bit part to gpu: packed 16-bit render targets are R8G8B8A8 where the GPU cannot render to them #89 and keeps only the view-heap sizing; the author found that the host's cap on NVIDIA (1,000,000 slots, debug layer ID 645) leaves the search nothing to find. This branch keeps the head that was run (946edfe, with the 16-bit widening), because that is the tree the reports measured; a tree without GPU: size a capped view heap to the host's limit #1523 would not be the one they tested.mask_dwordinemit/lower.rs): two different rewrites of the same code. Impre-visible left it out of their tree for the same reason, and it is in [BUNDLE] World-run stack from Impre-visible's report: 12 PRs (#1077 #1175 #523 #530 #1040 #1406 #1392 #1407 #1516 #1388 #1189 #542), stacked on #1511 #1632, which does not contain Shaders: emulate Wave64 compute shaders on Wave32 and narrower hosts #189. Which of the two to keep, or how to join them, is for the authors and the maintainer.v_readfirstlanein divergent control flow (64), a structured buffer of unknown stride (56), LDS accesses without a uniform fence in split wave64 (40), a 64-lane ballot in divergent control flow (35), an address not from a root parameter (29); the final image was still dark.Verification
Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain):
cargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test --workspace --lockedmain: 342 passed, 6 ignored)The title was not run, so this says nothing about in-game effect. No game data is used or committed.
Re-verify in one go
To confirm that no component PR moved since this was built, compare each
Headabove withgh pr view <n> --repo Marvisak/VIctory --json headRefOid. If one differs, the branch needs a rebuild: merge the new head in the same order.If this lands
The component heads are in the history unchanged, so each PR's commits and authorship are kept and GitHub should mark them merged. Merging them one by one instead works too, with the exceptions noted above.
AI-assisted (Claude Code); no game data.
🤖 Generated with Claude Code