Repository navigation
Conversation
|
Triage verdict — Split the overlapping flag change and verify sampling semantics ( Evidence
Checks and limits
Next step
This verification was AI-assisted. |
|
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at Overlap, from reading: #1237 (quad-lane gradients to AI-assisted (Claude Code). |
|
Checked both fixes against the title itself: identical to Validation fixes are easy to ship without ever asking whether they change the executable, so I ran the title with both branches merged (this one and #2016), on this machine, in the same scenario I always use: session 1 (interactive desktop), RTX 4090, driver
Identical, line for line. That is what I expected and it is worth saying why: the run dies at frame 64, before the title reaches the passes that use the 735 compute programs and the 868 vertex programs, so neither fix can show up in this window. The values on the two validator lines were already 0 because the runtime path does not validate at all — the fixes matter to So: no regression in what the title does today, and no improvement either. I would rather write that down than let a green check on the census imply the game changed. The caveat from the pull request stands and is the one thing I still owe: the level-0 sampling in No game data is involved: counts and warnings. Written with an AI assistant. |
|
Independent synthetic comparison on Windows, RTX 3080 and WARP. I tested each head separately on upstream
Both runtime adapters created the pipelines and returned the same values across all 32 lanes, in two runs per tree. This shows the level-zero path changes observable host sampling for the same synthetic input, while the 1.8 metadata change preserves the existing host readback. Microsoft documents quad-based compute derivatives in Shader Model 6.6. The test does not establish which result matches the console for this instruction. All inputs were synthetic. No game files were used. AI-assisted (OpenAI Codex). |
|
Corpus measurement on the real
+1,602 = 735 compute (this PR) + 867 vertex (the UAV flag commit that is also in this branch). Worth stating in the body: the branch carries two commits — One good sign for the compute half on an older validator: these modules still validate with the SDK 1.7 |
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (940d32f, Windows 11 x64, Rust 1.98.1 MSVC):
cargo test -p victory-shader --lib a_compute_shader_samples_at_level_zero— passedcargo clippy -p victory-shader --all-targets— 0 warningscargo xtask policy— ok (183 files ok)
Clean fix lowering compute shader samples at level 0 instead of implicit derivatives, plus matching shader feature flags. Looks good.
AI-assisted (Gemini 4 Neon).
catminou4
left a comment
There was a problem hiding this comment.
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f, cargo test -p victory-shader --locked.
146 passed / 0 failed / 2 ignored. Compute shader samples at level 0, not with derivatives (+2 tests; references 735 affected programs) — fixes a real-world translation regression class; mixed apps+shader, apps half Windows-only.
6a16a66 to
34d0b4e
Compare
|
Rebased so this pull request no longer carries #2016's commit, and measured alone: 23,918 → 24,653 When I opened this I had stacked it on #2016 (the vertex UAV flags), so the branch contained that commit and the two could not be merged in either order without a resolution in It is now rebased onto
and with #2016 also applied the pair reaches 25,520, which is the number I quoted before — the arithmetic was right, only the dependency was wrong. Re-checked after the rebase: No game data is involved: counts and error text. Written with an AI assistant. |
|
Measured offline on the title's shaders (the method in #1247): merged onto main
It is the same 735 programs in both cases: all of main's "Entry function performs some operation that is incompatible with the shader stage" rejections. The two PRs merge cleanly with each other, but they are alternatives that reach the result in different ways:
The offline counts can't tell which one renders as the console does. Where those samples relied on derivative-based mip selection, level 0 would always read the top mip. The choice probably comes down to that behaviour, or to the host-runtime question raised on #1065, rather than to the counts. Offline counts only; no program names or data. |
|
Automated triage for the maintainers. Proposed close (unchanged). The new commit only adds the missing closing brace of the test before What would change this verdict: evidence that the console's This PR will be closed in 48 hours unless the author pushes a change that addresses this or a maintainer removes the label. CI: passing ( Generated by Claude Code |
…ced after it
Compiled code sets a descriptor, or the high half of the table address
it loads one through, inside a region that `s_cbranch_execz` skips when
no lane would run it, and reads it after the region. The phi where the
region ends joins the region's words with what the skip leaves in the
registers (an EXEC save, a lane mask), and tracking refused the read
("a descriptor neither loaded nor built", then "an address into a
descriptor heap with an untracked high half").
Scalar writes are the whole wave's: a lane that reaches the end without
running the region reads what another lane's run set, so the per-lane
branch structurisation makes of the skip does not hold for them. Where
every edge that fails to trace is such a skip and the other edges agree,
the read is of the region's source, provided its handle can be made
where the region ends: a constant, or a load or built descriptor whose
address only reads values that dominate that point. A table address's
high half set in such a region counts as set. Reads that trace today
are unchanged. The rule is in the module notes and docs/architecture.md;
a skip's edge holding a descriptor tracking cannot follow is a shortcut.
Offline `translate --validate` over the title's 25,982 programs: the
three "a descriptor neither loaded nor built" refusals are gone; two of
them validate, the third now reaches the validator's compute-derivative
check (the class #2027 addresses). No other program's outcome changes.
`dx.op.sample` takes derivatives, and a compute shader has none: the validator refuses the module with "Function uses features incompatible with the shader stage (cs) of the entry function". Measured on the offline census over a local 1.0.2.1 shader archive (26,503 containers), validator SDK 10.0.26100 dxil.dll 1.9, the class is 735 programs, every one of them a compute shader, and the ones dumped all carry three uses of the implicit `sample` next to hundreds of explicit `sampleLevel`: billboard_nobump:CS_RaytracingResolve_a56bfb9c_Wrapped Cs cloth_default:CS_RaytracingResolve_b1139868_Wrapped Cs threads (32,1,1), wave 32, no shader flags declared The console's `image_sample` in that stage has no derivatives to take either, so level 0 is what it means; emitting `sampleLevel` with 0 keeps the meaning and makes the module valid. Census before and after, same archive, same validator: before incompatibles 735, validated 23,918 after incompatibles 0, validated 24,653 stacked on Marvisak#2016 (the vertex UAV flags): 25,520 validated, from 23,918 on main. The choice of operation is `sample_op`, which is also what the test pins: `("sampleLevel.f32", 62)` for a compute stage, `("sample.f32", 60)` elsewhere.
34d0b4e to
34f3cc5
Compare
|
For the choice between this, #1065 and #1237: #2999 adds a GPU test that tells them apart, an |
|
Accepted: without ISA evidence this is a semantic guess, and I am measuring it The verdict is fair. What the PR has is "the validator refuses The measurement I am running before touching this again: take the containers of the programs that fail, decode the image instruction's opcode field with our own decoder (
Until one of those is measured, this branch stays as it is and the 48-hour close should take it. I would rather have it closed than merged on a guess. Written with an AI assistant. |
|
Closing it: the pack names its LOD explicitly, and this would guess for 1,838 instructions I measured what I said I would, and the answer is that this branch should not land. Decoding every container of the title's shader pack and counting the image-sample instruction each program actually carries, per stage:
So the compute programs are not short of LOD information: the overwhelming majority carry Three outcomes were possible when I started; the data points away from the one this branch assumed. If the plain form is a decoding gap (a variant our table does not carry), the fix is in the decoder and those instructions never reach the lowering. If it is what the console compiler emitted, the hardware has no derivative source there either, and what it does is an ISA question — not something to settle by making the validator accept the module. I would rather close this than merge a semantic change on 1,838 instructions. The measurement that would reopen it: an ISA reference or a hardware test showing what plain Thanks for holding it — the 48-hour close was the right call. Written with an AI assistant. |
…ompute follow the console's lane quads (Marvisak#2027, on Marvisak#1237) # Conflicts: # crates/victory-shader/src/emit/lower.rs
…ompute follow the console's lane quads (Marvisak#2027, on Marvisak#1237) # Conflicts: # crates/victory-shader/src/emit/lower.rs
A compute shader has no derivatives to sample with: 735 programs, all
Cs, all refused for it — andsampleLevelat level 0 fixes themThe next class after #1987, and this time the reason was in the run I had already made: the validator's
note:line said735 programs, every one of them a compute shader (
735 x Cs, no other stage). I dumped three of them (VICTORY_EMIT_DUMP) and disassembled withdxc -dumpbin:Three implicit
dx.op.samplenext to hundreds of explicit ones, in a stage that has no neighbours to take derivatives from.dx.op.sampleis not a legal operation forcs— no shader model makes it one without the mesh/amplification derivatives feature — and the console'simage_samplein that stage has no derivatives either: level 0 is what the instruction means there.So the lowering now asks the stage: a compute program samples at level 0 with
sampleLevel(62) and keepssample(60) everywhere the implicit form is legal. The choice issample_op(compute), and the test pins the pair.Measured on the offline census over the same local 1.0.2.1 archive (26,503 containers), validator SDK 10.0.26100
dxil.dll1.9:incompatible with the shader stagemain940d32f25,520 is 1,602 more programs than
main: the 868 vertex programs of #1987 and these 735, minus the one that was in both classes.One caveat worth stating, because it is the difference between "valid" and "right": the console program samples with whatever filter and coordinate the shader computed, and level 0 is the honest reading of "implicit level in a stage with no derivatives". If a title's compute shader relied on something else — a derivative register the console keeps per lane — this would change what it samples. That is worth a picture comparison on the raytracing resolve passes, which are the ones in this class, and I have not run the title to look at them.
Recipe:
cargo test -p victory-shader --locked --lib249 passed, 3 ignored;cargo test --workspace --locked26 suites with the one failuremainalso has in a session without a desktop;clippy --workspace --all-targetswith and without--all-featuresclean under-D warnings;rustfmt --checkwith the same 19 hunksmainalready has inlower.rsand no others.No game data is involved: program names, counts, operation names and thread-group sizes.
Written with an AI assistant.