Repository navigation
Conversation
|
Hardware check on an AMD RDNA3 machine found a problem in the new sample harness, not obviously in the opcode lowering:
Since the author's runs were on WARP (and WARP doesn't exist at SM 6.6 here), the new tests currently cannot validate the AMD hardware path. Before merging, the harness should be checked on a discrete AMD GPU (descriptor table/sampler binding), or the tests should say they are WARP-only. I can re-run once that is adjusted. |
catminou4
left a comment
There was a problem hiding this comment.
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (ffe310e), cargo test -p victory-shader --locked → 96 passed, 0 failed. Hardware/valu/waterfall execution tests are #[cfg(all(test, windows))] and run only on Windows; macOS covers lowering/structure unit tests.
TFE image loads/samples/gathers lowered via CheckAccessFullyMapped (s_load_dwords/mimg_sample const encoders, run_sample_cases across formats); 767-line diff with hardware/WARP SM 6.6 coverage.
|
@Calvix2k, I ran the two new tests at
All six RTX mismatches came from the comparison operations. For example, the first red gather returned the raw texels I also ran the plain Rerun on the Radeon. The depth fixture commit is directly on top of From your existing PR checkout with the same Agility SDK setup: git fetch https://github.com/steven-seagull27/VIctory.git refs/heads/codex/pr1687-comparison-depth
git cherry-pick 9253683 6598b11
$env:VICTORY_WARP = '0'
cargo test -p victory-shader --lib --locked -- image_gather4_c_lz_and_offset_match_d3d12 image_sample_offset_variants_match_d3d12 --nocapture --test-threads=1Could you share whether both tests pass on the RX 7800 XT? If either still returns zeros, the failing case and the result of your plain-sample control would help narrow it down. |
|
Marking this as draft rather than forcing the rebase: upstream 70564ae rewrote the image-address/a16 and opcode machinery this patch was built on, so it needs a real rework against the new image() code. On top of that, the AMD hardware run showed the new |
df9c423 to
2e6482c
Compare
|
Reworked on 70564ae: upstream already handles the general _o address/offset machinery, so this now implements only the real gap — Still draft because the test story is not finished: the original sample harness returns zeros on a discrete AMD GPU (even for a control |
|
Pixel readback on I drew to a 2×2 target with a translated GFX10 pixel shader, a single-mip 4×4 RGBA32F texture, and a point/clamp sampler. Each source texel’s red value was
Both versions passed DXIL validation and created the graphics pipelines. The PR’s existing compute validation test also passes with the fix. An asymmetric texture and nonzero, distinct X and Y make this case visible in readback. These measurements use synthetic shaders and textures. |
The words before the coordinates are the offset, the bias and the compare value; the \�xtra\ count already sums them for the packed (a16) path. The coordinate base counted the bias only for the exact name \image_sample_b\, so \image_sample_b_o\ sampled at (bias, X). Use \�xtra\ instead. Reported and measured by AlanQiang0418 in Marvisak#1687 (image_sample_b_o read the texel at 11 instead of 32 on an RTX 5080 and on WARP, both correct with this change).
|
@AlanQiang0418 Thank you — the analysis is right and the fix is in What I changed: the coordinate base was I could not reproduce your readback here: my host is Windows 10, where this adapter reports SM 6.5 and WARP SM 6.2, so the GPU probe suites ( We should also keep your harness: a translated pixel shader, a 4×4 RGBA32F with |
The words before the coordinates are the offset, the bias and the compare value; the \�xtra\ count already sums them for the packed (a16) path. The coordinate base counted the bias only for the exact name \image_sample_b\, so \image_sample_b_o\ sampled at (bias, X). Use \�xtra\ instead. Reported and measured by AlanQiang0418 in Marvisak#1687 (image_sample_b_o read the texel at 11 instead of 32 on an RTX 5080 and on WARP, both correct with this change).
f9979c8 to
b62d2e3
Compare
|
Four synthetic comparison-gather cases reach DXIL emission on
To reproduce with the PR’s I tried early refusals in the comparison-gather arm for the unsupported dimensions and for the cube offset form. All four then returned AI-assisted. |
|
@Dathinel Thank you — both rejections were real, and they are refused at translation now instead of reaching the validator (
New CPU test If you re-run your table on the new head: the four rows should now be refusals, like other unsupported image dimensions, and the passing rows unchanged. Thank you for checking the cube offset case — that one would have been a runtime device removal on drivers that enforce it. |
|
Automated triage for the maintainers. Needs rebase. This PR no longer merges cleanly into Previous verdict for this head: merge candidate. Generated by Claude Code |
|
On the tests the triage asks for, the two halves are different sizes of work, so here is what is possible and what I propose. Comparison-gather readback.
Both are therefore test-infrastructure work of a follow-up's size, and I cannot run either here: this host has no SM 6.6 device (the reason #1991 exists), so I would be writing them blind and iterating on CI. What I propose, in order of preference:
Which do you prefer? I am happy to do (3) if it is the answer, but I would rather not claim value coverage I cannot execute. |
|
@Calvix2k, I ported the depth fixture to The test now uses an
All six matched. On the original RGBA fixture the RTX returned raw texels From the PR branch at git fetch https://github.com/steven-seagull27/VIctory.git refs/heads/codex/pr1687-depth-offset-ca9bf9f
git cherry-pick 91b745ddbf7af330ccc5815581f0211fe3afc0d3
cargo test -p victory-shader --lib --locked comparison_gathers_return_their_four_comparisons -- --nocapture --test-threads=1Could you or another RX 7800 XT tester rerun this with the same SM 6.6 setup and confirm a hardware readback for all three cases? That would close the remaining Radeon question for this compute fixture. |
|
@steven-seagull27 thank you — I took your commit as You also found a real hole in mine: the On the Radeon readback: I cannot provide it. This machine (Windows 10, RX 7800 XT) has no SM 6.6 device for the test binaries — the in-box runtime stops at 6.5 and the Agility runtime is not loaded for Locally: the test compiles, skips, and the lowering/refusal tests plus clippy pass. CI is running on the new head. |
|
Radeon hardware readback for your three cases, on the depth fixture you sent (
That is the Radeon question closed for the compute fixture from my side; the lowering, the refusals and the shader suite also pass on the same setup. |
|
@Calvix2k, I resolved the conflict with upstream The three gather readbacks still match on RTX 5080 and Windows built-in WARP on that merge. I ran each three times, with the D3D12 adapter identified and all four comparisons read back for each case.
The DXIL lowering/validation test, invalid-dimension refusal test, and upstream legacy-multiply test also passed. Strict all-target, all-feature shader Clippy and the asset-policy check passed. With your PR branch checked out, these commands apply the tested resolution while keeping all existing commit IDs: git fetch https://github.com/steven-seagull27/VIctory.git codex/pr1687-current-main
git merge --ff-only FETCH_HEADAI-assisted with Codex. The RX 7800 XT result remains your earlier independent run. |
|
@Calvix2k I found a case where this branch and #1489 differ. With a 4×4 R32_FLOAT depth view, reference 7.5, and the same four neighbors, the red comparison gather returned I merged the two branches on my fork. It keeps both authors’ histories, your extra offset sample opcodes, and #1489’s signed-offset depth fixture and red-only guard. The joint regression explicitly checks masks 2, 4 and 8 for both plain and offset comparison gather. Your red gather cases and the six signed-offset/threshold cases from #1489 still passed on both adapters. The cube validator and refusal fixtures, strict shader Clippy and asset policy passed. Joint commit To try this on your PR branch: git fetch https://github.com/steven-seagull27/VIctory.git codex/pr1687-with-1489
git merge --ff-only FETCH_HEAD
cargo test -p victory-shader --lib --locked gather -- --test-threads=1The broad AI-assisted with Codex. |
On the new image lowering: image_gather4_c_lz(_o) lower to textureGatherCmp with a comparison sampler and the reference value, and the _o forms of image_sample_lz/l/b/d/c/c_lz are accepted with the offset word read before bias/coordinates/LOD. Gather offsets keep their own bit positions. This is the remaining gap after upstream added the general offset handling.
Adds the synthetic sample helpers and a validation-only test for the new names: image_gather4_c_lz(_o) and image_sample_lz/lz_o/l_o/c_lz_o. Each shader is lowered and validated by dxil.dll; no GPU execution, so the AMD sample-harness problem does not affect it.
The words before the coordinates are the offset, the bias and the compare value; the \�xtra\ count already sums them for the packed (a16) path. The coordinate base counted the bias only for the exact name \image_sample_b\, so \image_sample_b_o\ sampled at (bias, X). Use \�xtra\ instead. Reported and measured by AlanQiang0418 in Marvisak#1687 (image_sample_b_o read the texel at 11 instead of 32 on an RTX 5080 and on WARP, both correct with this change).
main added Parts::view_marks and HostShader::view_marks; the test this branch adds built both without them, which fails to compile after a rebase even though nothing else changed.
DXIL gathers exist for 2D, 2D array and cube textures only, and a cube
gather takes its offset as undef. A console comparison gather of a 1D, 1D
array or 3D image, or a cube gather with texel offsets, therefore emitted
a module the validator rejects ("the declared resource kind", "out of
bound offset must be undef"), which is a device removal on drivers that
enforce it.
Return the translator's usual refusal for those four cases. The gather
test helper now returns its error so a refusal can be asserted without a
device, and gathers_of_a_1d_3d_or_offset_cube_image_are_refused covers
them. Reported by Dathinel on this pull request.
The comparison gathers were lowered and validated, but their values were never read back: a wrong address order or a sampler comparison applied to the wrong operand would have passed. Dispatch both forms (2D and 2D with a texel offset) over a 4x4 texture with a point, clamp, less-equal sampler and compare the four results the shader stores against the texels of the gather's footprint.
WARP (and the reference rasterizer) select comparison sampling from the filter's comparison bit, not from ComparisonFunc alone: with a plain point filter it gathered zeros.
0.375 * 4 lands on a half-texel, where WARP's gather rounds to the other texel than the hardware's; 0.4 and 0.7 are unambiguous on both.
The offset form's four texels differ by one on WARP (as the existing gather tests record for its rounding); the hardware is the reference for that form, so assert it there and skip WARP's.
f08c8e4 to
401e940
Compare
Summary
Reworked on 70564ae. Upstream already has the general _o address/offset machinery, so this now implements the actual gaps:
image_gather4_c_lz(_o)lower totextureGatherCmpwith a comparison sampler and the reference value; gather offsets keep their bit positions._osample names are accepted:image_sample_lz_o,l_o,b_o,d_o,c_o,c_lz_o; the offset word is read before bias/coordinates/LOD.Tests
comparison_gathers_and_offset_samples_lower_and_validatebuilds synthetic compute shaders for the comparison gathers andimage_sample_lz/lz_o/l_o/c_lz_o, lowers them and validates every container withdxil.dll. Validation-only: it does not use the AMD sample-execution harness (which currently reads zeros for a control sample on a discrete AMD GPU). Bias/implicit-derivative sample forms are pixel-only and are not exercised by this compute test.Validation
--all-targets --all-features -D warningsandcargo xtask policy(174 files) passed.cargo check -p victory-shader --testspassed.Value tests (this revision)
comparison_gathers_return_their_four_comparisons(by steven-seagull27): a compute dispatch over a 4x4R32_FLOATdepth view with a point, clamp, less-equal sampler. Plain gather,_owith offset 0 and_owith offset (1, 0) must return the comparison of the four footprint texels; RTX 5080 and WARP agree on all three. The earlier fixture used an RGBA32F view, which D3D12 does not support for comparison gathers — the result there depended on the driver.gathers_of_a_1d_3d_or_offset_cube_image_are_refused: the four forms DXIL cannot declare (1D, 1D array, 3D, cube with offsets) are refused at translation.