Tests: image instructions in the per-lane lowering and on the GPU #1815
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1825"
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?
Imported from ivall/xcl. Originally posted by MiguelMachado-dev on 2026-11-24T21:28:24Z.
Stacked on #1797; only the top commit (
434f428) belongs here. The commit under it,c2b0c00, is #1797's8ec49c0cherry-picked ontomainc4d37bewith the same diff. Once #1797 is inmain, this PR is rebased and only the tests remain.These are tests for image instructions in the per-lane form (#1745), the MIMG follow-up listed on #1269. They need #1797: without its
vgpr_useschange, the per-lane form refuses every image instruction with NSA addresses, and the threelower_dxiltests fail. Part of #1269.What is in it
Tests: image instructions in the per-lane lowering and on the GPU(434f428). Tests only, in the files'#[cfg(test)]modules, +271/−1:crates/xcl/src/gpu/recomp/lower.rs:decode_bytes,mimg(an image instruction with NSA dwords) andimage_program;image_instructions_in_coalesced_runs_and_whole_quads: image instructions join a coalesced guarded run. An implicit-LODIMAGE_SAMPLEstays out of the run, and a PS refuses it in a block that not every lane reaches.crates/xcl/src/gpu/recomp/lower_dxil.rs:image_instructions_pass_every_register_they_use(CPU): everyIMAGE_*instruction, over DIM, A16, D16, DMASK, GLC and sequential or 11 scattered NSA addresses, gets through the per-lane compute lowering with no register missing from the bridge.per_lane_image_instructions_agree_with_the_hlsl_path_on_the_gpu:SAMPLE_L, resinfo,GATHER4_LZ, and GLC compare-swap and add.a_per_lane_bvh_with_nsa_addresses_runs_on_the_gpu: a BVH ray with NSA addresses gives the same memory with four memory windows, with one window, and on the HLSL path.Tested
Setup:
cargo build --workspace && cargo test --workspace -- --test-threads=4:434f428: 965 passed, 0 failed, 43 ignored (lib: 916 / 0 / 23);mainc4d37be: 959 passed, 0 failed, 43 ignored (lib: 910 / 0 / 23).By module at
434f428, 0 failed in each:gpu::dxil::gpu::recomp::lower::gpu::recomp::lower_dxil::gpu::recomp::lane_masks::gpu::rdna2::SKIPPED GPU tests: 23 lines, the same on both runs, and none in the new tests.
V_MUL_F16,V_PK_MUL_F16andV_CVT_F16_F32, whose #1426 semantics differ from the console's.heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: it cannot disable the driver cache, which needs Windows Developer Mode.The three
lower_dxiltests fail without #1797's change. I checked that on #1745's branch at3ca3633, before it was merged.Regression run
crates/xcl/srcthatpr_check.pycounts as runtime, and until #1797 is merged the diff also has #1797's commit.mainand this PR is rebased, the diff is test-only. It can then take thetest-onlylabel after review, or a smoke pair.Not tested
AI use
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T21:37:22Z.
Same results on Ampere: RTX 3070 8 GB (32-lane waves, no wave64), driver 616.56, Windows 11, debug,
434f428onmainc4d37be:image_instructions_in_coalesced_runs_and_whole_quads,image_instructions_pass_every_register_they_use,per_lane_image_instructions_agree_with_the_hlsl_path_on_the_gpu,a_per_lane_bvh_with_nsa_addresses_runs_on_the_gpu).gpu::dxil::84 passed, 1 ignored;gpu::recomp::lower::35 passed;gpu::recomp::lower_dxil::15 passed; 0 failed in each (--test-threads=4).The whole workspace was not run.
AI-assisted (Claude Code). Synthetic tests only.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T00:50:53Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
upstream-sync referenced this pull request2026-11-25 06:04:27 +00:00
Imported from ivall/xcl. Originally posted by Chrysana on 2026-11-25T19:31:01Z.
AMD run of
434f428, for "Wave64, AMD and heap windows" under Not tested. The four new tests pass on an RX 9070 XT (RDNA4) and on an RDNA2 iGPU, and the suite matches your RTX 5080 counts exactly: 965 / 0 / 43 on this head, 959 / 0 / 43 onc4d37be. One limit on what this covers: both GPU tests run their programs as wave32 (kernel(&insts, false),wave64: false), andimage_programis wave32 code (S_AND_SAVEEXEC_B32). So on wave64 hardware they still run 32 lanes, and wave64 stays untested by these tests on any GPU.Setup: AMD Radeon RX 9070 XT 16 GB (RDNA4, wave64), driver 32.0.32015.2008; Ryzen 7 9800X3D, whose Radeon iGPU is RDNA2 (
XCL_ADAPTER=1); Windows 11 26200.9974, rustc 1.100.0 MSVC, debug. Head as pushed (434f428, with #1797's commit under it), and its basec4d37be, each in its own checkout and target folder.Full suite (RX 9070 XT,
cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4):434f428c4d37beV_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32refusals (at wave32 and at wave64). The other 2 areheap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows here either) andpso_measurement_compiles_an_exact_synthetic_record(no Developer Mode).The new tests and your module table, on each GPU (
cargo test -p xcl --lib -- --test-threads=4 <filter>):image_instructions_in_coalesced_runs_and_whole_quadsimage_instructions_pass_every_register_they_useper_lane_image_instructions_agree_with_the_hlsl_path_on_the_gpua_per_lane_bvh_with_nsa_addresses_runs_on_the_gpugpu::dxil::gpu::recomp::lower::gpu::recomp::lower_dxil::gpu::recomp::lane_masks::gpu::rdna2::0 failed everywhere. So AMD's drivers give the HLSL path's registers and textures for the NSA and sequential loads, the samples (including D16 and
SAMPLE_L), resinfo,GATHER4_LZ, the GLC compare-swap and add, and the BVH ray with four memory windows and with one.On wave64: making the GPU test cover it would take a wave64 form of
image_program(S_AND_SAVEEXEC_B64, a 64-bit compare mask, EXEC high set) and 64-lane texture layouts (the 8×4 compare-swap and add targets hold 32 texels). That's more than a flag, so I didn't make a local variant. If you add one, I can run it on this card.Not tested
main: it conflicts incrates/xcl/src/gpu/dxil/lower_image.rs, so these runs are on the head as pushed.AI use
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T11:04:44Z.
Independent RTX 3080 Ti check of #1825 head
434f4289. The stockper_lane_image_instructions_agree_with_the_hlsl_path_on_the_gpuandimage_instructions_pass_every_register_they_usetests each passed: 1 passed, 0 failed, 0 ignored, no GPU skip. Command for each:cargo test --offline --locked -j 4 -p xcl --lib <test-name> -- --nocapture --test-threads=1, with a writable isolated DXIL cache. Windows 11 build 26300, RTX 3080 Ti / driver 621.35, Ryzen 7 9800X3D, DXC 1.8.2502.11.The stock GPU fixture exposes one mip, so it cannot distinguish
IMAGE_SAMPLE_LZselecting mip zero from every sample effectively selecting mip zero. I locally extended the test-only runner texture to two point-sampled mips with distinct known values. On this exact PR head plus the test patch,IMAGE_SAMPLE_LZreturned the expected mip-zero texels, while an explicitIMAGE_SAMPLE_Lat LOD one returned the independent mip-one values (100 and 102). The focused command above passed 1/0/0, no skip. This is additional coverage, not a production failure; I did not run the whole workspace suite on the patch.Two-mip synthetic test diff (test code only)
For integration, #1797 remains open and conflicting, and #1825 is stacked on it and also conflicts with current
main. The old world-load hang in #2647 is a separate runtime question; this fixture does not resolve it. AI use: Codex (GPT-6.2 Sol) wrote and ran the local test extension and checked the results; Codex (GPT-6.2 Astra) reviewed the LOD coverage boundary.Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T11:26:31Z.
Integration follow-up to the #1797 rebase resolution and matched suite. I locally stacked #1825 tip
434f4289on the rebased #1797 candidate atmain623d02e4. This is an unpublished local stack, not a change to this PR's head.The #1825
lower.rshunk merges directly. Itslower_dxil.rsconflict is placement at the tests module's end: keep the current destination tests, then append the three authored testsimage_instructions_pass_every_register_they_use,per_lane_image_instructions_agree_with_the_hlsl_path_on_the_gpu, anda_per_lane_bvh_with_nsa_addresses_runs_on_the_gpubefore the module's closing brace. All 193 authored lines in that hunk retain their content and order. No production change is needed in this child.On Windows 11 build 26300, RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, DXC 1.8.2502.11,
cargo build --workspacepassed. With separate writable DXIL caches,cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapturereported 1,458 passed / 0 failed / 47 ignored on cleanmainand 1,464 / 0 / 47 on the local stacked candidate. Both logged 25 GPU skip notices; the stock image and BVH GPU tests in this PR ran and passed. After the parent and child are pushed on clean commits, their current-head CI must run; the runtime parent needs a new clean-head smoke pair, while this test-only child needs the repository's test-only waiver if its checks require one. AI use: Codex (GPT-6.2 Sol) resolved and tested the local stack; Codex (GPT-6.2 Astra) reviewed its image and D16 paths.Imported from ivall/xcl. Originally posted by throny on 2026-11-28T23:28:27Z.
Two contributors checked independently and found that #886 #1797 solves the same problem (for #885) in a different way: #1607, group D138. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:54:32Z.
Triage (#1607) – head
434f428Stacked on #1797. Its lower commit
c2b0c00has the same diff as #1797's8ec49c0. Only434f428(tests) belongs here.Main now has its own exact MIMG
vgpr_uses(mimg_vgpr_uses, from43c56dc), so therdna2.rshalf of the base commit conflicts with code that is already on main. Main still lacks thelower_image.rscompare-swap change from #1797 (it readsvdata + 1for every atomic).image_instructions_pass_every_register_they_useprobably still needs that change. After a rebase, the tests should be re-run against main'svgpr_uses.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Pull request closed