Repository navigation
Port upstream correctness wave 6 (18 PRs: descriptor-as-data naming, uniform phis, GPU workers) - #6
Merged
Conversation
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.
…port when the device is removed With `VICTORY_SHADER_BREADCRUMBS=1` in a diagnostics build, every loop of a translated shader stores its iteration count (`atomicMax`) in a host buffer: 1,024 slots of 8 words, a shader's slot taken from its container's digest. The buffer is a shared (system memory) one, so what the GPU wrote survives a device removal; it is cleared before each submission. The shader reaches it through a UAV in the last dynamic slot of each host view heap, at the index the host passes in the first user-data dword past the console's: no new root parameter and no per-draw binding. When the device is removed the failure report names the five loops that counted most and the pipelines of their slots, which says which shader's loop ran away where the removal data only names a command. Off, nothing changes: not the DXIL, nor the root signature, nor the shader cache's key. On, the census translates and validates the same programs (the validator accepts the extra UAV in vertex, pixel, compute and mesh shaders; 140,150 loop stores emitted in the 25,902 programs). Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
…st lane, one atomic a wave The breadcrumb of a loop was one `atomicMax` a lane a back edge: a wave of 32 or 64 lanes made that many atomic operations on the same word every iteration. The loop count now goes through a wave maximum (`WaveActiveMax`, unsigned) and the first active lane stores it, so the word still holds the largest count any lane reached, with one atomic a wave. The store ends the block of the back edge, so the block the loop's phis take as the edge's source is the one where the edge ends. The census (25,902 programs, validator) is unchanged with the switch on: the same programs validate as with it off. Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
The host driver compiles pipelines on our worker threads. On an RTX 5080 (driver 32.0.16.1692) NVIDIA's compiler (nvgpucomp64.dll) recursed past the default 2 MB stack while creating a world compute pipeline (c7d7a6283fad3cd6): "thread 'victory-pipelines-4' has overflowed its stack", 0xc00000fd, then the pipeline was refused with E_OUTOFMEMORY and its dispatches dropped. A 64 MB stack is reserved address space, committed only as the compiler uses it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The census's largest refusal row (771 programs at ffe310e) came from three different places under one reason, so a census could not tell which one to lower. Each now names what the program reads: - a descriptor that scalar buffer loads (s_buffer_load_dword*) use first: its record count (dword 2) by the view's kind (raw, structured, constant buffer, other), or its address or format; "used by scalar loads before a vector access" when a vector access later decides the view; - s_memtime and s_memrealtime as timestamps, s_get_waveid_in_workgroup as the wave's index in its group; - scalar stores, scalar scratch loads and cache instructions. A load through a root view's address now says it reads that view's memory rather than "a descriptor read only as data". Only the reasons change: every read stops the program as before, no IR is emitted for them, and what translates today is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e a buffer view A descriptor fetched from the resource heap by index has no used-resource entry, so a scalar buffer load (s_buffer_load_dword*) through it was lowered through a 64 KiB constant buffer handle. When vector buffer loads read the same descriptor, the slot holds a buffer SRV (the title made it one), and reading it through a CBV handle is a descriptor of the wrong type, which D3D12 leaves undefined. Such loads now read the slot as a raw buffer, as table SRVs already do. A descriptor also written through (a UAV) and one only scalar loads read are unchanged. In the title's shaders.rpf this changes 38,829 scalar loads in about 1,900 of 26,084 programs; emit and validation counts are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A descriptor every lane shares, chosen by an if/else nested in another, reaches the outer join with an edge that is itself a join. Such an edge was refused with "a descriptor chosen by control flow": each edge had to be a heap load. The heap index is now computed recursively: a load's index, or a phi at the join of what each predecessor computes at its end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The validator rebuilds ISG1/OSG1 from the module's signatures and compares bytes. It sorts rows by register, then by semantic name offset (DXC's sort_sig), not by column: with validator 1.6 every arbitrary semantic has its own name, so rows of one register keep element order. We sorted them by column, and a register whose elements come in another order (a w channel declared before the xyz of the same register) failed with "Container part 'Program Input/Output Signature' does not match expected for module". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ir::build fills every instruction's register lists twice. `effects()` collects `Vec<Reg>` (two allocations), and the caller immediately maps each one into `Vec<(Reg, Value)>` (two more), freeing the first pair. For lists that are almost always two to four entries, that is four allocations and two copies per instruction, on every instruction of every program. Have `effects()` and its helpers collect the `(Reg, Value)` pairs directly, with the placeholder the SSA pass fills in. Two allocations per instruction instead of four; `Inst` and everything downstream are unchanged. Measured with the synthetic bench in #1002 (no game data), ten interleaved rounds per arm, nanoseconds per instruction, at 256/1k/4k/16k instructions: ir::build 308 -> 269, 375 -> 324, 407 -> 340, 402 -> 353 (0.835-0.878) translation 898 -> 872, 898 -> 825, 951 -> 875, 956 -> 912 (0.919-0.971) gfx10::decode, structure, lower and the rest are unchanged. The emitted DXIL is byte-identical at all four sizes. cargo test --workspace --locked: 342 passed, 0 failed, 7 ignored. Both clippy configurations clean; cargo xtask policy ok.
v_cndmask_b32 and v_*_co_ci_u32 refused when their scalar mask was not one structure followed (a plain SGPR number). In compute with console lanes the lane now tests its own bit of the register (pair in wave64); inline 0 and -1 masks are constants. Taken from upstream PR #585 (mask part only; its descriptor-dimension hunk is left to the resource work). Offline corpus (26148 programs): "a select on an untracked mask" 288 -> 0, no new refusal text; those programs now stop at later refusals (descriptor read as data +205, unknown stride +32, descriptor address/format +33), so compute programs emitted only 1441 -> 1443. Synthetic test on hardware: fails before, passes after. WARP cannot pin a wave size, so the test skips it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A descriptor dword the translation cannot rebuild from the host view stopped the program with "a descriptor's address or format read as data" (92 programs at ffe310e), whatever the dword. Each now names what it holds: an image's address, array pitch or mip limits, compression fields or metadata address; a buffer's address, stride or high address, or format and swizzle. A census can then tell which ones a program needs, as a buffer's stride, say, can come from the used-resource list. Only the reasons change. Dwords past the descriptor keep the old one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….rs tests (1 -> 17)
…moves (fixes #750)
Flag exactly DXC's gradient-op classification in non-mesh compute: the implicit-derivative samples (60/61/64), the LOD query (81), and the explicit derivatives (83..=86). Validators before 1.8 reject all of these outside the pixel stage. Bfi and the dot products (53..=56) are arithmetic and stay on 1.6; SampleGrad/SampleLevel (62/63) take explicit gradients and are already accepted in compute.
The first commit left a heap descriptor of no listed kind that a vector buffer store or atomic also uses on the constant buffer path, which is a CBV handle on the UAV the title made. Scalar loads through it now read a raw UAV (11 | 0x1000), as #1055 does for a table's UAV; read-only use stays a raw SRV. The test's store case now expects no CBV handle. In the title's shaders.rpf no program has this case (all 38,829 changed loads are the read-only one); emit and validation counts are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # crates/victory-shader/src/emit/waterfall_tests.rs # crates/victory-shader/src/resource.rs
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # crates/victory-shader/src/emit/mod.rs
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # crates/victory-shader/src/emit/lower.rs # crates/victory-shader/src/emit/valu_tests.rs
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # crates/victory-shader/src/emit/lower.rs
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # crates/victory-gpu/src/descriptor/host.rs # crates/victory-gpu/src/host.rs # crates/victory-gpu/src/lib.rs # crates/victory-gpu/src/pipeline/host.rs # crates/victory-shader/src/emit/lower.rs
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # crates/victory-shader/src/emit/lower.rs
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # crates/victory-shader/src/emit/lower.rs
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # crates/victory-shader/src/emit/lower.rs
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # crates/victory-shader/src/emit/container.rs
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # crates/victory-gpu/src/pipeline/make.rs # crates/victory-shader/src/structure.rs
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # crates/victory-shader/src/emit/shader.rs
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # crates/victory-gpu/src/texture.rs
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # crates/victory-hle/src/modules/net.rs
…s, GPU workers Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…e-ops compute pipelines Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…line Upstream's own DXIL for this shader is rejected by real adapters at CreateComputePipelineState (E_INVALIDARG) on hardware and WARP alike; upstream CI has no GPU, so it never ran. Revert the diag probe; run the cases on whichever backend accepts, and report when none can. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration Bot
added a commit
that referenced
this pull request
Nov 24, 2026
…uniform phis, GPU workers) Covers upstream PRs merged into devin/correctness-wave-6 (#6). The untracked-mask v_cndmask test now tolerates adapters that reject the emitted pipeline: upstream's own DXIL for it is refused at CreateComputePipelineState on hardware and WARP alike, and upstream CI has no GPU to ever see that. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wave 6 of the upstream port campaign: 18 PRs from
Marvisak/VIctorymerged into the fork (+4534/−604, 31 files): #1021, #1033, #1129, #1185, #1224, #1182, #1112, #1084, #1083, #1081, #1014, #1015, #1012, #1022, #1013, #1065, #1191, #1213.Highlights:
descriptor_datainemit/lower.rs, #1083): a scalar load read only for its numbers now names what each dword holds instead of a single blanket error.usescollects every resource descriptor whose source leaves name the load; eachFields::Smemuse writes per-dwordVal::Missingwith a reason (smem_reason), and the kind is inherited from a same-entry load used as a resource. Field-level reasons come fromdescriptor_field(image, rel)("a buffer descriptor's stride or high address read as data", ...). A load through a root view's address errors asa root view's memory read with scalar loads; a table load with no use still reads the bound console descriptor words (#1198 behavior preserved for ray tracing).uniform_heap_index'sSource::Phiarm recurses per-predecessor withcur_edgetracking sov_readfirstlane/sampler phi sources resolve correctly;mask_condhandles Scalar masks,i32lane bits with wave64 hi, andConstviaresource::inlinedecode.ensure_workers()+ WORK queue inpipeline/make.rs,budget()early-out,PIPELINE_STACKrestored;GPU_RANGES+near_heapsreport nearby heaps on DRED page faults.UploadFootprint/footprint_sizeper-subresource detile loop withchangedoverlap filtering.FALLBACKnames (WSAConnectByList,GetAddrInfoExA,WinHttpGetProxySettingsEx) missing on the runner.container.rstail rebuilt (PSV0/signature sorts incl.rows_of_one_register_keep_element_order_not_column_order),bvh_tests/image_atomic_tests/root_view_tests/valu_testsgains,resource.rsjoined-descriptor partial-write cases.Notes:
lower.rsexpectations from the conflict were reconciled: field-specific reasons replace genericOTHER; thes_buffer_load_dwordbuffer-view arm was dropped per #1083; the root-view scalar-load test now asserts success sinceroot_view_smem(#1055/#1056) handles it.Partsinitializers gainedcrumbs: None(breadcrumb plumbing).-D warningsandcargo fmtclean. Local tests pass except ~45 that require an SM 6.6 device (absent on this VM; they pass on the GPU CI runner).Link to Devin session: https://app.devin.ai/sessions/39a24dfe2c184165b42b2108a96286b6
Open in Devin Desktop: https://app.devin.ai/desktop/session/39a24dfe2c184165b42b2108a96286b6?variant=devin
Requested by: @Personed