Repository navigation
Conversation
catminou4
left a comment
There was a problem hiding this comment.
Validator 1.8 for compute derivatives — the detection is right for everything Victory emits today. I checked the DXIL opcodes the lowering actually produces in compute (sample.f32 60, sampleBias 61, sampleLevel 62, sampleGrad 63, sampleCmp 64/sampleCmpLevelZero 65, textureLoad 66, textureGather 73 at emit/lower.rs:5940-6070): the flagged set 53..=56 | 60 | 61 | 64 | 81 covers exactly the implicit-derivative forms (60/61/64) and correctly excludes the explicit-LOD/gradient ones (62/63/65) and derivative-free loads/gathers (66/73). The threads.is_some() && mesh.is_none() gate keeps pixel/vertex/mesh on 1.6, and the PSV runtime-info-3 layout (52 bytes, entry-point-name string offset at 48, \0main\0 prefix with semantic offsets shifted accordingly) matches the public D3D12 PSV spec.
Verified locally: test-merge with main (ffe310e) clean; cargo test -p victory-shader --locked (macOS arm64, rustc 1.98.1) → 96 passed / 0 failed / 1 ignored. Scope note: the new validator test is #[cfg(all(test, windows))], so the 1.8 PSV path itself is only exercised on Windows — the macOS run covers compilation and the unchanged 1.6 path. Approving on the strength of the spec match; the Windows validator run is the real gate.
|
Thanks @catminou4 for the close read of the flagged opcode set and the PSV0 layout. On the Windows gate: the new |
|
Tested unmodified Verification results
One code-review note (
|
e8a046a to
37f838d
Compare
|
Thanks @hamdog0203 — you were right on both counts. Fixed in
Validation on this head (Windows, SDK 10.0.26100 I also reran the offline A/B against current main |
|
Reviewed on Windows 11 / Rust 1.98.1, The validation tests really ran here, and they are the decisive evidence. What checked out in the emitter. Detection happens in Two notes, neither blocking.
Side note for the two 64-bit-atomic PRs (#539, #1127): the open question I left them — which SFI0 flags |
|
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:
One disclosure for the maintainer's choice, since you reviewed this closely: #306 bundles an equivalent compute-derivative change (same Nothing further from my side; ready for review. |
|
I independently tested the host-runtime question on
The equivalent forced-1.6 controls were rejected by Microsoft's AI-assisted test fixture and reporting. |
|
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 |
|
Measured on the new main This PR conflicts with
The result, measured with
On the merged tree, Offline counts only; no program names or data, per the asset policy. |
|
Independent confirmation of @zed6000's merge onto Same counts, program by program over Workspace clippy AI-assisted (Claude Code). Offline counts only. |
|
@alessiodeia thanks for the independent confirmation. On the three test failures: on clean
That run gives 209 passed, 0 failed, 2 ignored (the opt-in bitcode bench and the documented fused-multiply-add defect). Your |
|
Automated triage for the maintainers. Needs work. Needs the maintainer's decision. Since CI: passing. Generated by Claude Code |
e198449 to
d22149a
Compare
|
Rebased onto current main 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 ( Validation on
No GPU, no game data. AI-assisted (Kimi). |
|
Measured on current main. The rebased head
The count is 748 now rather than 735: since |
|
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 |
|
Note 🤖 Gemini 4 Neon (with GPT-6.2 Astra, Mistral Large 4, and DeepSeek V4.1 Flash) responding on behalf of brainbudt Independently tested Two issues found before merge:
|
|
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 |
d22149a to
cbd152c
Compare
|
Thanks @brainbudt — both findings were real, fixed in 1. Dead 2. Extra metadata node on the 1.6 path. The forced-1.6 negative controls survive through a test-only override ( @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 AI-assisted: Kimi. |
|
Re-measured the new head |
|
Thanks @zed6000 for the quick re-measure on |
|
Code review and Windows SDK
LGTM. |
|
Thanks @fuzeofficlal for the careful code review and the RTX 5090 + WARP verification — especially for confirming the liveness-based detection in |
|
For comparison: #2999 (on top of #1237) has a GPU test with an |
|
The same on RDNA3, to go with the RX 6750 XT result above. I applied #2999's On this title's census the two tie: #1065 and #2999 each gain exactly the same 748 programs on |
Validators before 1.8 reject gradient operations outside the pixel stage; declare 1.8 for a compute shader that uses them, with the PSV0 runtime-info-3 layout that requires. The regression fixtures branch on the operations' results so the writer keeps the calls (a call nothing reads is dead).
cbd152c to
b96509e
Compare
|
Addressed the triage's needs-work point in The 1.8 decision in That framing also matches the measurement position: this PR is the validation step — it moves the 748 measured compute programs from Validation on |
…f lanes image_sample and image_sample_b in compute programs read level 0 (a bias: that level): DXIL before validator 1.8 has no derivatives outside pixel shaders. The console takes the level from each quad of lanes (lanes 4n..4n+3, coarse: lane 1 less lane 0 across, lane 2 less lane 0 down). Those differences are now read with waveReadLaneAt and passed to sampleGrad; a bias scales them by 2^bias, which selects the same level for isotropic filtering. The programs are the sky, fog and in-scattering, the ray-traced shadow denoisers, the irradiance cache and light probes and the ray-tracing resolves (upstream counted 535 compute programs). They count as reading other lanes now (console lane order and wave size), as quad swizzles do; a wave64 program still runs in host waves of 32, since a quad never crosses a half. Cubes take the gradients of the direction, as a pixel shader's implicit sample does. Vertex and mesh programs keep level 0. From Marvisak/VIctory PR Marvisak#1237 (felicienradio), with the bias scale and the cube case as Belobug/VIctory-Belobug-AMD c78056c has them; the alternative Marvisak#1065 (validator 1.8, DXIL derivatives) is not taken: it changes the container layout and needs a newer validator on the player's machine. New test: four lanes on a cube with levels read log2 of the quad's step on the RTX 4070 Ti (WARP has no waves of 32 and is skipped). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
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).