Shaders: use validator 1.8 for compute derivatives #1065
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1065
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1065"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Halfect on GitHub · 2026-11-24 15:26 UTC · original
Halfect:fix/cs-implicit-sample-dxil18→main· +252 −10 · 3 files · 1 commits · openWhat
Validators before 1.8 reject gradient operations outside the pixel stage with
Entry function performs some operation that is incompatible with the shader stage, although a compute shader using them is valid SM 6.x. The emitter declares every shader as validator 1.6, so those compute shaders are rejected even though they emit cleanly.The emitter now derives the validator version from the module's written calls:
Module::uses(the same liveness-filtered scan that feeds the shader-feature flags) reports a gradient operation, matching DXC's gradient classification — the implicit-derivative samples (Sample60,SampleBias61,SampleCmp64), the LOD query (CalculateLOD81), and the explicit derivatives (DerivCoarseX/Y,DerivFineX/Y, 83–86). Only a non-mesh compute shader with a live gradient op:dx.valver1.8 instead of 1.6;PSV0layout (runtime info version 3, 52 bytes, naming the entry point at strings offset 1) instead of the 1.6 layout (version 2, 48 bytes).Bfiand 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. Because the decision looks at the written calls, a dead call — a sample whose result nothing reads, dropped by the writer — does not bump the version, and a shader without live gradient ops declares 1.6 by reusing thedx.versionmetadata node: vertex, pixel, mesh and gradient-free compute shaders are byte-identical to before (the new byte-pin test matches main's exact containers).Adds five Windows regressions: a compute shader with an implicit sample validates (and its forced-1.6 twin is rejected), a compute
DerivCoarseXvalidates at 1.8 and is rejected at 1.6, a computeDot3keeps validator 1.6 and validates, a compute sample with a discarded result stays on 1.6 and validates, and the derivative-free pixel/compute containers are byte-pinned.Host runtime note. A validator-1.8 container also needs a host runtime that accepts one. Current Windows 11 D3D12 and the SDK 10.0.26100 validator accept it, but an older host runtime would refuse such a compute pipeline at creation time rather than at translation. The bump is per shader, so only the gradient-using compute programs (24 measured below) are affected; every other shader stays a 1.6 container.
Offline title measurement
translate --validate --list --jobs 4over the local 1.0.2.1 shader archive (26,503 containers, dxil.dll 10.0.26100), comparing mainffe310ewith this head across 25,896 matched program labels:incompatible with the shader stagevalidator error and now validate.Checks
cargo test --locked -p victory-shader --lib, CPU-only suite skipping the GPU groups (diff_tests,valu_tests,waterfall_tests,stub_pipeline_is_created) andheap_direct_texture_reads_mark_their_heap_index: 230 passed, 3 failed, 3 ignored. The three failures (stride_testspair,gathers_at_a_level_match_the_hardware) reproduce identically on unmodified13f91caon this machine, and the skipped heap test aborts the harness (STATUS_ACCESS_VIOLATION) identically on unmodified13f91cahere — all pre-existing D3D12-device environment issues; this PR changes no code they exercise.emit::shadertests pass with the SDK 10.0.26100dxil.dllvalidator actually loaded (no skips), including the forced-1.6 negative controls.cargo clippy --locked -p victory-shader --lib --tests -- -D warnings: clean.cargo xtask policy: 184 files ok.git diff --check: clean.Offline translation and DXIL validation only; no title executable or world run, and no shader contents or extracted data included. AI-assisted (Kimi).
cbd152cc1dtob96509e836@Halfect on GitHub · 2026-11-24 15:49 UTC · original
Thanks @catminou4 for the close read of the flagged opcode set and the PSV0 layout. On the Windows gate: the new
compute_implicit_sample_validatesregression did run on Windows on this head (e8a046a2) with the SDK 10.0.26100dxil.dllloaded, and the validator accepted the emitted 1.8 module; the CPU-only library suite there was 98 passed, 0 failed, 1 ignored. Agreed the macOS run only covers compilation plus the unchanged 1.6 path — the Windows validator result is the behavioral check for this change. Nothing further from my side; ready for review.@hamdog0203 on GitHub · 2026-11-24 15:59 UTC · original
Tested unmodified
e8a046aindependently on Windows 11 Build 26200, NVIDIA GeForce RTX 4060 (driver621.35, 32-lane waves), Rust1.98.1, and Windows SDKdxil.dll(10.0.26100.0):Verification results
cargo clippy --workspace --all-targets --locked -- -D warnings: passcargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passcargo test -p victory-shader --locked -- --nocapture compute_implicit_sample_validates: pass againstdxil.dll(verified not skipped; forcingvalver 1.6as a negative control failsdxil.dllwithFunction uses features incompatible with the shader stage (cs))cargo test --workspace --locked(RTX 4060): all workspace tests pass (victory-shader: 121 passed, 0 failed, 1 benchmark ignored)VICTORY_WARP=1 cargo test -p victory-shader --locked: 121 passed, 0 failed, 1 ignoredcargo xtask policy: 154 files okHost::compute_pipelineon RTX 4060):CreateComputePipelineStatesucceeds with the validator-1.8 /PSVRuntimeInfo3container for both[32, 1, 1]and[8, 8, 1]thread groups.One code-review note (
crates/victory-shader/src/emit/shader.rs)In
Shader::op:In DXIL,
53..=56areUMsad/Dot2/Dot3/Dot4, whereas explicit derivatives (DerivCoarseX,DerivCoarseY,DerivFineX,DerivFineY) are83..=86. Verified againstdxil.dllwithdx.op.unary.f32(83, ...)in a compute shader:dxil.dllstill rejects it one8a046a(becausedx.valverstays1.6), and accepts it whenvalidator18is enabled.Synthetic tests +
dxil.dll+ RTX 4060 hardware only; no game data. AI-assisted.@Zipettte on GitHub · 2026-11-24 16:30 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at e8a046a:
cargo test -p victory-shaderpasses, 121 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@Halfect on GitHub · 2026-11-24 16:33 UTC · original
Thanks @hamdog0203 — you were right on both counts. Fixed in
37f838d:60 | 61 | 64 | 81 | 83..=86.53..=56(Bfi/Dot2/Dot3/Dot4) are arithmetic and no longer bump the validator version, so a derivative-free compute shader using them stays byte-identical to main. Explicit derivatives (DerivCoarseX/Y,DerivFineX/Y, 83–86) now trigger 1.8 as your probe showed they must.compute_explicit_derivative_validates(op 83 validates at 1.8; its forced-1.6 twin is rejected) andcompute_dot3_stays_on_validator_1_6(op 55 does not set the flag, and the resulting 1.6 module validates). The implicit-sample test also gained your forced-1.6 negative control.Validation on this head (Windows, SDK 10.0.26100
dxil.dll): the three regressions pass with the validator actually loaded; the CPU-only library suite is 100 passed, 0 failed, 1 ignored; clippy-D warningsandcargo xtask policy(154 files) clean. No GPU execution was used.I also reran the offline A/B against current main
ffe310e(26,503 containers, 25,896 matched labels): compute 1,417 → 1,441 validated of 1,441 emitted; the only transitions are 24 ×incompatible with the shader stage→ validated; vertex/pixel and mesh outcomes are identical, 0 regressions. The PR body is updated with the corrected opcode set and this measurement. Ready for another look.@adamdotpy on GitHub · 2026-11-24 16:53 UTC · original
Reviewed on Windows 11 / Rust 1.98.1,
37f838don currentmain(ffe310e, merges as it stands), isolated target dir. Verified:cargo test -p victory-shader --lib123 passed / 1 ignored, including the three new tests; clippy--all-targets --all-features --locked -D warningsclean; release build ofvictoryfine.The validation tests really ran here, and they are the decisive evidence.
dxil.dllfrom SDK 10.0.26100 is present at the validator's default path on this machine, so with--nocapturethere is no "no dxil.dll; skipped" line:compute_implicit_sample_validatesbuilds a compute shader callingsample(opcode 60), validates the 1.8 container successfully, and asserts the same module declared 1.6 is rejected;compute_explicit_derivative_validatesdoes the same forDerivCoarseX(83);compute_dot3_stays_on_validator_1_6confirms dot products (55) do not bump the version and still validate at 1.6. That is exactly the check I asked #539 and #1127 to carry for their SFI0 bits — this PR is the template for it.What checked out in the emitter. Detection happens in
op()and is gated onthreads.is_some() && mesh.is_none(), so pixel and mesh shaders are untouched and only compute shaders with a derivative-class opcode bump — minimal blast radius, anddx.valveris written infinish(), after every op, so the flag is complete by then. The opcode set matches the comment's reasoning (implicit-derivative samples 60/61/64, LOD 81, explicit derivatives 83..=86; SampleLevel/SampleGrad 62/63 excluded because they take explicit gradients). The PSV0 change is the validator 1.8 runtime-info-3 layout: 52-byte info with the entry-point string offset at 48, and the strings section starting"\0main\0"— consistent with the DXIL metadata change in the same commit.Two notes, neither blocking.
"main"in the PSV0 strings. The emitter's entry is alwaysmaintoday, so it is correct, but an assert or comment tying the two would keep them from drifting if the entry name ever changes.Side note for the two 64-bit-atomic PRs (#539, #1127): the open question I left them — which SFI0 flags
dxil.dlldemands foratomicBinOp.i64— is settled the same way this PR settles the validator version: emit the op, validate at each candidate flag set, keep the one that passes and assert the other fails. Neither PR has that yet.@Halfect on GitHub · 2026-11-24 17:02 UTC · original
Thanks @adamdotpy for the careful review — especially for confirming the three regressions really validated rather than skipped, and for checking the gating and PSV0 layout against the DXIL rules.
Both notes addressed:
"main": agreed.Shader::finishalways names the entrymaintoday; I'll tie the PSV0 string to it with a comment/assert on the next push, if one is needed. I'd rather keep the reviewed head37f838dstable than churn it for a comment-only change.One disclosure for the maintainer's choice, since you reviewed this closely: #306 bundles an equivalent compute-derivative change (same
dx.valver1.8 + runtime-info-3 mechanism) alongside four other fixes. The differences here: this PR's flagged set additionally covers the explicit derivatives (83–86, after @hamdog0203's DXC classification correction; #306 flags only 60/61/64/81), the detection sits inShader::opso any emission path is covered, and it carries the forced-1.6 negative controls. Both clear the same observed census group (all 24 failing programs callsample); this one is the focused single-purpose version.Nothing further from my side; ready for review.
@rafaconvaitis on GitHub · 2026-11-24 17:06 UTC · original
I independently tested the host-runtime question on
37f838dusing two synthetic shaders, without game data. On Windows 11 build 26300, both the NVIDIA GeForce RTX 4070 (driver32.0.16.1664, adapter confirmed by device LUID) and inbox WARP created the signed DXIL 1.8 compute PSOs and executed one four-thread group.DerivCoarseX(float(SV_GroupThreadID.x))[1.0, 1.0, 1.0, 1.0][7.25, 7.25, 7.25, 7.25]The equivalent forced-1.6 controls were rejected by Microsoft's
dxil.dll 1.8.2502.8validator before PSO creation, as expected. This confirms execution and readback for the two instruction shapes on this host. Older D3D12 runtimes and the title's actual shaders are outside this result. The fixture also passed focused Clippy with warnings as errors.AI-assisted test fixture and reporting.
@adamdotpy on GitHub · 2026-11-24 17:16 UTC · original
Thanks for the independent confirmation @rafaconvaitis — RTX 4070 + WARP both creating and executing the signed DXIL 1.8 compute PSOs with the 1.6 controls rejected by
dxil.dll 1.8.2502.8matches what I measured on37f838dhere (validator really ran, not skipped). That closes the host-runtime question on current hardware/driver; noted on the thread.@zed6000 on GitHub · 2026-11-24 22:02 UTC · original
Measured on the new main
70564ae, the largest remaining gap there. With dxil.dll 1.8.2502, 735 compute programs emit on70564aebut fail validation with "Entry function performs some operation that is incompatible with the shader stage". This PR clears all of them.This PR conflicts with
70564aein two hunks, because main added geometry shaders in the same places. I merged it onto70564aeand resolved both by keeping both sides:emit/container.rs,psv(): main'sif let Some(max) = p.gs { ... }block stays. Yourif p.validator18 { info[48..52] ... }block follows it, and the final line is yourout.extend(&info[..info_size as usize]), not main'sout.extend(info).emit/shader.rs,dx.valver: your 1.6/1.8 selection fromself.compute_derivatives, with main's updated comment (0 pixel, 1 vertex, 2 geometry, 5 compute, 13 mesh).The result, measured with
victory translate --validate --listonshaders.rpf(1.0.2.1) and compared program by program with70564ae:70564ae70564ae+ this PROn the merged tree,
cargo test -p victory-shader --libgives 212 passed and 0 failed on an RX 7900 XTX (RDNA3). Clippy with-D warningsis clean with and without--all-features.Offline counts only; no program names or data, per the asset policy.
@alessiodeia on GitHub · 2026-11-24 22:47 UTC · original
Independent confirmation of @zed6000's merge onto
70564ae, on NVIDIA (RTX 2070 SUPER, Turing, driver 621.40). I resolved the two hunks the same way, independently: main'sp.gsblock followed byvalidator18, thenout.extend(&info[..info_size as usize]), and the 1.6/1.8dx.valverselection with main's geometry comment. The branch isalessiodeia:rebase/1065-on-70564ae(6e26c67) if anyone wants it.Same counts, program by program over
shaders.rpfwithdxil.dll1.9.2609: validated 24,785 → 25,520 (+735, 0 lost), compute 1,886 → 2,621 of 2,621. The only validator failure left on the merged tree is the 71 mesh programs withvertex plus primitive output size is greater than 32768, which70564aehas as well.Workspace clippy
-D warningsis clean. On this cardcargo test -p victory-shaderhas 3 failures:stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride,stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zerosandsynthetic_tests::gathers_at_a_level_match_the_hardware. All 3 fail identically on clean70564aehere (dispatch failed: E_INVALIDARGon the hardware device), so they're NVIDIA-side issues on main, not this PR.AI-assisted (Claude Code). Offline counts only.
@zed6000 on GitHub · 2026-11-24 22:49 UTC · original
@alessiodeia thanks for the independent confirmation. On the three test failures: on clean
70564aeall three pass on AMD (RX 7900 XTX, RDNA3, hardware device, no WARP):stride_tests::a_heap_buffer_read_by_element_takes_the_views_stridestride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zerossynthetic_tests::gathers_at_a_level_match_the_hardwareThat run gives 209 passed, 0 failed, 2 ignored (the opt-in bitcode bench and the documented fused-multiply-add defect). Your
dispatch failed: E_INVALIDARGon Turing therefore looks NVIDIA-specific, as you suspected, and unrelated to this PR.@Marvisak on GitHub · 2026-11-25 00:33 UTC · original · edited 2026-11-26 04:21 UTC
Automated triage for the maintainers.
Needs work. Needs the maintainer's decision. Since
cbd152cthe only change is the requested comment at the validator-1.8 decision inShader::finish(emit/shader.rs), explaining that in multi-row groups the host forms quads from 2x2 tiles while the console's quads are four lanes of one row. The decision itself is open: with this PR, 2D compute groups validate but take their implicit level from the host's tiling (RX 6750 XT and RX 7900 XTX read level 3 where the console gives level 1), and #2999 handles the quad layout for multi-row groups. Whether to take 1.8 now, right only for one-row groups, or to wait for that approach is the maintainer's call.CI: passing.
Generated by Claude Code
@zed6000 on GitHub · 2026-11-25 00:43 UTC · original
For the "needs rebase" triage above: a rebase onto current main exists and is measured. This PR merged onto
70564aewith the two-hunk resolution described above (the same resolution as alessiodeia'srebase/1065-on-70564ae) merges cleanly onto main4118f33. Measured there:4118f334118f33+ the rebased PRcargo test -p victory-shader --libon the merged tree gives 249 passed, 0 failed on an RX 7900 XTX. The 137 merges between70564aeand4118f33don't change any program's outcome on this data, so the earlier numbers still hold. All 735 are the "Entry function performs some operation that is incompatible with the shader stage" rejections, the largest remaining gap on main. Offline counts only; no program names or data.@Halfect on GitHub · 2026-11-25 01:22 UTC · original
Rebased onto current main
ccfb029and pushede198449. Both conflict resolutions keep main's geometry-shader handling alongside the validator-1.8 behavior; the PR still changes onlyemit/container.rsandemit/shader.rs(+155/-10).Validation on macOS with the project toolchain (Rust 1.98.1):
cargo test --locked -p victory-shader --lib -- --skip diff_tests --skip valu_tests --skip waterfall_tests --skip stub_pipeline_is_created: 144 passed, 0 failed, 2 ignored.cargo xtask policy: 182 files ok.cargo clippy --locked -p victory-shader --lib --tests -- -D warningsstops on five warnings that reproduce identically on clean mainccfb029(checked in a separate worktree). They are inemit/mod.rs/emit/lower.rs, which this PR does not change.Windows
dxil.dllvalidation was not rerun on macOS; the earlier Windows validation and independent rebased A/B measurements are in the thread above.@zed6000 on GitHub · 2026-11-25 01:39 UTC · original
@Halfect confirmed on the title's shaders. Your rebased head
e198449, merged onto mainccfb029(a clean merge), measured with the same method (victory translate --validate --list,shaders.rpf1.0.2.1, dxil.dll 1.8.2502, program by program):ccfb029ccfb029+e198449cargo test -p victory-shader --libon the merged tree gives 249 passed and 0 failed on an RX 7900 XTX (RDNA3). All 735 are the "Entry function performs some operation that is incompatible with the shader stage" rejections, the largest remaining gap on main. Offline counts only; no program names or data.@hadrianhola on GitHub · 2026-11-25 04:06 UTC · original
#1065 and #1237 on Windows 10 (the "older host runtime" case), program by program. I'm not the author of either.
Host: Windows 10 22H2 (19045), RTX 4060, driver 610.88,
dxil.dll1.8.2502. The D3D12 Agility SDK 1.620 runtime sits besidevictory.exe(the #175/#362 exports). The in-box runtime stops at SM 6.5, so without itHost::newrefuses the device and nothing gets a pipeline.Both PRs are merged onto main
940d32f. #1065 (e198449) merges cleanly. #1237 (a3346f9) has one conflict inlower.rs, which I resolved by keepingquad_gradientsandhelpers_read/helper_reads_ownside by side, as @wildheathen did. Measured withvictory translate --validate --pipelines --listovershaders.rpf(1.0.2.1) and compared program by program:940d32fE_INVALIDARGE_INVALIDARGand 1 out-of-memory.cd94d35regression already tracked in #1973/#1987.Counts only; no shader names, hashes or data. AI-assisted (Claude Code).
@Halfect on GitHub · 2026-11-25 09:53 UTC · original
Thanks @hadrianhola for the Windows 10 run — that directly closes the host-runtime caveat in the PR body: with the Agility 1.620 runtime beside the executable (which SM 6.6 needs anyway), Windows 10 accepts all 723 of this PR's validator-1.8 containers with the same pipeline outcomes as main, and the 12
E_INVALIDARGrefusals are identical on all three trees. Good to have the equivalence with #1237 measured on the older-runtime host as well. Nothing further from my side; ready for review.@Halfect on GitHub · 2026-11-25 17:22 UTC · original
Rebased onto current main
13f91caand pushedd22149a; theemit/shader.rsconflict resolved by keeping both sides (main's UAV-declaration test alongside this PR's derivative tests). The branch merges cleanly again.One fixture fix the rebase exposed: main's writer now drops a call nothing reads ("a phi or a value nothing reads is dropped"), and these tests called the sample/derivative ops with dead results — so the emitted modules no longer contained a gradient op and the forced-1.6 negative controls were vacuously accepted (caught locally: both negative controls failed after the plain rebase). The fixtures now branch on the operations' results (
extract+ compare + conditional branch), which keeps the calls live; the negative controls reject again.Validation on
d22149a(Windows, CPU-only, SDK 10.0.26100dxil.dllreally loaded):cargo test --locked -p victory-shader --lib emit::shader: 4 passed / 0 failed — including both forced-1.6 negative controls rejecting and main'suavs_outside_pixel_and_compute_programs_are_declared.heap_direct_texture_reads_mark_their_heap_index, which aborts the harness with an access violation on this machine, identically on unmodified main): 269 passed, 3 failed — the same three D3D12-device dispatch tests (stride_testspair,gathers_at_a_level_match_the_hardware) that fail on clean main here.cargo clippy --locked -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 184 files ok.git diff --check: clean.No GPU, no game data. AI-assisted (Kimi).
@zed6000 on GitHub · 2026-11-25 18:26 UTC · original
Measured on current main. The rebased head
d22149a, merged onto main13f91ca(a clean merge), with the same method as before (victory translate --validate --list,shaders.rpf1.0.2.1, dxil.dll 1.8.2502, program by program):13f91ca13f91ca+d22149aThe count is 748 now rather than 735: since
940d32f, 13 more compute programs reach emission on main and then hit the same validator error, and this PR clears them too.cargo test -p victory-shader --libon the merged tree gives 273 passed and 0 failed on an RX 7900 XTX. This is the largest single remaining gap on main. Offline counts only; no program names or data.@Halfect on GitHub · 2026-11-25 19:32 UTC · original
Thanks @zed6000 for the fresh A/B on the rebased head. The numbers line up with the change's intent: 748 compute programs move from
incompatible with the shader stageto validated, 0 lost, vertex/pixel and mesh identical — and the 735 → 748 delta is explained by the 13 compute programs that started reaching emission on main since940d32fand hit the same validator error. Good to also have the merged tree green on the RX 7900 XTX (273 passed). Nothing further from my side; ready for review.@brainbudt on GitHub · 2026-11-25 20:23 UTC · original
Independently tested
d22149aemerged with13f91cae(Windows 11 + Microsoftdxil.dll1.8.2505.32 + WARP, Linux x86-64, and Windows MSVCcargo check --tests). All four focused Windows emitter tests passed withdxil.dll1.8.2505.32 loaded, including both forced-1.6 negative controls, and WARP created the live derivative pipeline.Two issues found before merge:
image_samplestill declares validator 1.8 (crates/victory-shader/src/emit/shader.rs:250): When a synthetic GFX10 compute shader discards itsimage_sampleresult,dxc -dumpbinshows zero sample calls on bothmainand this PR, yet this PR still emits validator1.8. Microsoft validator 1.7 acceptsmain's output and rejects this PR's output (Validator version in metadata (1.8) is not supported; maximum: (1.7)). Deriving the 1.8 selection from live emitted calls inModule::uses()(with a dead-sample regression test) avoids this regression.crates/victory-shader/src/emit/shader.rs:922): Plain vertex (+8 B), pixel (+8 B), and compute (+4 B) shaders change DXIL bytes and container hashes on the 1.6 path. Reusing the existingversionmetadata node on the 1.6 path restores the base hashes (verified on pixel and Dot3 compute controls).@gmankab on GitHub · 2026-11-25 20:24 UTC · original
I adapted this commit to the native Linux branch and ran the three derivative regressions with Microsoft's Linux libdxil 1.9.2609. All three executed and passed. The implicit-sample and explicit-derivative controls with validator 1.6 were rejected as expected, and the arithmetic control kept validator 1.6.
In a separate native RX 6800 test, both descriptor paths hit a GPUVM invalid read in the same compute-indirect breadcrumb range. The translated shader in that range contains implicit samples and the Linux validator rejects its original 1.6 container with the stage error described here. That identifies a validation defect in the suspect shader. The patched hardware run will test whether the GPU fault persists.
Tested-on: Fedora Linux 45, Microsoft Linux DXIL validator 1.9.2609
Assisted-by: gpt-6.2 sol xhigh
@Halfect on GitHub · 2026-11-25 21:12 UTC · original
Thanks @brainbudt — both findings were real, fixed in
cbd152c.1. Dead
image_sampledeclaring 1.8. The eager flag inShader::opis gone.Module::uses— the liveness-filtered scan that already feeds the SFI0 feature flags — now also reports gradient operations, reading a livedx.opcall's opcode (its first argument);finishderives the decision asuses.derivatives && compute && !mesh, so a call the writer drops declares nothing. Your regression exists asa_dead_sample_stays_on_validator_1_6: a computeimage_samplewith a discarded result declares 1.6 and validates with the SDK 10.0.26100dxil.dll.2. Extra metadata node on the 1.6 path.
dx.valvernow reuses thedx.versionnode unless 1.8 is actually declared. Pinned bya_shader_without_derivatives_reuses_the_version_node(len + FNV of a minimal pixel and a minimal compute container); I also verified those pins against unmodified13f91cain a scratch test — pixel(1268, 0x0cf4762f4d364c15), compute(1252, 0xe811e2546d1c9513), identical on both — so the 1.6 path is byte-identical to before this PR.The forced-1.6 negative controls survive through a test-only override (
force_validator18), since the live-call derivation would otherwise re-derive 1.8 for the control module.@gmankab Thanks for the native-Linux run — good to have all three regressions passing with the Linux libdxil 1.9.2609, and the 1.6 controls rejected as expected.
Validation on
cbd152c(Windows, CPU-only): the sixemit::shadertests pass withdxil.dllactually loaded; the CPU-only library suite is 230 passed, 3 failed — the same three pre-existing D3D12-device failures (stride_testspair,gathers_at_a_level_match_the_hardware) that fail identically on unmodified13f91caon this machine, and theheap_direct_texture_reads_mark_their_heap_indexharness abort also reproduces on unmodified13f91ca; clippy-D warningsclean;cargo xtask policy184 files ok;git diff --checkclean. The PR body is updated to match.AI-assisted: Kimi.
@zed6000 on GitHub · 2026-11-25 21:22 UTC · original
Re-measured the new head
cbd152con main13f91ca(a clean merge), with the same method (shaders.rpf1.0.2.1, dxil.dll 1.8.2502, program by program): +748, 0 lost (25,594). These are exactly the same 748 programs asd22149a, so the narrower 1.8 detection changes no program's outcome on this title.cargo test -p victory-shader --libgives 275 passed and 0 failed on an RX 7900 XTX. Offline counts only; no program names or data.@Halfect on GitHub · 2026-11-25 21:32 UTC · original
Thanks @zed6000 for the quick re-measure on
cbd152c— the same 748 programs at +748 / 0 lost confirms the liveness-based detection (and the reuseddx.versionnode on the 1.6 path) changed no program's outcome, which is exactly what @brainbudt's two findings required. CI is green on this head as well (checkpassed in run 45702073311). Nothing further from my side; ready for review.@fuzeofficlal on GitHub · 2026-11-26 01:31 UTC · original
Code review and Windows SDK
10.0.26100.0dxil.dll+ RTX 5090 + WARP verification at headcbd152cc1d92merged cleanly ontomain(63bcca43c6a0;emit/lower.rsuntouched):emit/bitcode.rs:528-558,emit/shader.rs:914-925,emit/container.rs:169-251):Module::uses()scans only live emitted instructions (plan.live) for DXIL derivative/implicit-sample ops (60 | 61 | 64 | 81 | 83..=86), so dead samples eliminated before writing do not bump the validator version.dx.valver = (1, 8)andPSV0RuntimeInfo v3 (52 B with entry name offset1); all other shaders stay byte-for-byte on validator1.6andPSV0v2 (48 B).10.0.26100.0dxil.dll, NVIDIA RTX 5090 + WARP,VICTORY_D3D12_DEBUG=1, Rust 1.98.1):cargo xtask policy:191 files ok;cargo clippy(default +--features diagnostics): 0 warningsemit::shader::tests(6/6, including livedxil.dllvalidation of compute implicit sample & explicit derivatives and 1.6 preservation on dead/non-derivative shaders),emit::container::(1/1),emit::bitcode::(12/12, 1 ignored), andemit::semantics_tests(34/34 on both RTX 5090 and WARP, 1 ignored) all passed.LGTM.
@Halfect on GitHub · 2026-11-26 02:10 UTC · original
Thanks @fuzeofficlal for the careful code review and the RTX 5090 + WARP verification — especially for confirming the liveness-based detection in
Module::uses(dead samples no longer bump the version) and the byte-identical 1.6 path for non-derivative shaders. Good to have the six emitter tests validating with the SDKdxil.dllreally loaded on another machine. Nothing further from my side; ready for review.@wwwwwwww3333333 on GitHub · 2026-11-26 03:06 UTC · original
For comparison: #2999 (on top of #1237) has a GPU test with an
[8, 8, 1]group whose lane quads give level 1 and whose 2x2 tiles give level 3. With this PR rebased onto main63bcca4it read 3 on an RX 6750 XT, since the host's compute derivatives use 2x2 tiles of threads in a two-dimensional group, while the console's quad is four threads of one row. In one-row groups the two agree, as the earlier comparisons found.@zed6000 on GitHub · 2026-11-26 03:36 UTC · original
The same on RDNA3, to go with the RX 6750 XT result above. I applied #2999's
synthetic_tests.rs(only the test, none of its lowering) to this PR's headcbd152cmerged ontomain63bcca4and rancompute_samples_take_derivatives_from_lane_quadson an RX 7900 XTX: it fails withwave32 hardware: thread (0, 0) sampled level 3, the lane quads give 1 (2x2 tiles give 3). So RDNA3 also forms compute quads from 2x2 tiles in an[8, 8, 1]group. On #2999 itself the same test reads level 1 on every lane, in Wave32 and Wave64, on hardware and WARP.On this title's census the two tie: #1065 and #2999 each gain exactly the same 748 programs on
63bcca4, 0 lost (measured on #2999 and in #1247). The difference is which mip 2D compute groups sample on the host. Offline tests only; no program names or data.@Halfect on GitHub · 2026-11-26 04:05 UTC · original
Addressed the triage's needs-work point in
b96509e(comment-only change; the declaration logic is untouched).The 1.8 decision in
Shader::finishnow states the limitation in place: declaring 1.8 makes a derivative-using compute program accepted, but the host's derivative semantics are not the console's — console compute lanes are x-major, so a quad of a multi-row group is four lanes of one row, while the host forms 2x2 tiles; an implicit level (andDerivCoarseY/FineY) of a multi-row group therefore comes from the host's tiling, not the console's row. One-row groups agree either way, which is why the earlier one-row measurements showed no difference. Reproducing the console's quad layout for multi-row groups (the #2999 direction) is noted as future work that does not gate this declaration.That framing also matches the measurement position: this PR is the validation step — it moves the 748 measured compute programs from
incompatible with the shader stageto validated with 0 losses; the quad-layout correctness question applies to what those programs then compute and belongs to the follow-up work.Validation on
b96509e(Windows, CPU-only, SDK 10.0.26100dxil.dllreally loaded): the sixemit::shadertests pass, including both forced-1.6 negative controls;cargo clippy --locked -p victory-shader --lib --tests -- -D warningsclean;cargo xtask policy184 files ok;git diff --checkclean. No GPU, no game data. AI-assisted (Kimi).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.