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. Merge candidate. Recommending a look, not approving. The head is the same as at the earlier note, and it still merges cleanly onto
CI: On your reply: noted. Nothing in it changes the verdict. Generated by Claude Code |
|
For the "needs rebase" triage above: a rebase onto current main exists and is measured. This PR merged onto
|
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.
37f838d to
e198449
Compare
|
Rebased onto current main Validation on macOS with the project toolchain (Rust 1.98.1):
Windows |
|
@Halfect confirmed on the title's shaders. Your rebased head
|
|
#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, Both PRs are merged onto main
Counts only; no shader names, hashes or data. AI-assisted (Claude Code). |
|
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 |
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 records when a non-mesh compute shader calls a gradient op — 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 for those shaders it: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. Vertex, pixel, mesh and gradient-free compute shaders are byte-identical to before.Adds three 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, and a computeDot3keeps validator 1.6 and validates.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 head37f838dacross 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): 100 passed, 0 failed, 1 ignored, including the three regressions above with their Windows DXIL validations (SDK 10.0.26100 dxil.dll).cargo clippy --locked -p victory-shader --lib --tests -- -D warnings: clean.cargo xtask policy: 154 files ok.Offline translation and DXIL validation only; no title executable or world run, and no shader contents or extracted data included. AI-assisted (Kimi).