tests: GPU readback for dynamic 64-bit vector shifts (GPU-VALU64-SHIFTS) #590
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/590"
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 ubiquitarianism/leonida. Originally posted by JiyouProt on 2026-11-24T09:19:49Z.
Claimed in the coordination issue as: GPU-VALU64-SHIFTS — https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7126974854
What and why
The existing 64-bit vector-shift rules have CPU semantic coverage but no dedicated GPU fixture. Add
cs_w32_shift64: 64 memory-fed cases cross eight boundary values with counts 0, 1, 31, 32, 33, 63, 64 and 65. It exercisesv_lshlrev_b64,v_lshrrev_b64andv_ashrrev_i64, with destinations overlapping the count register, one source word, or the entire source pair.Both GPU runners compare all 640 heap words against a Python integer oracle: 384 result words and 256 unchanged input words. Runtime-loaded inputs prevent constant folding. The private heap input is cleaned up after each run. Six CPU tests cover boundary answers, late-result/input corruption, missing/truncated readbacks, unsupported Int64 and filtered-runner pass/fail/skip verdicts. Document the fixture and its ISA reference in
docs/testing.md. No translator behavior changes.Tested
Windows 11 26H2 build 26300.9974, Python 3.14.3, based on current main
7430f59b2755418f5db1682446a4ccef10d455b1. Harness rebuilt from this tree using LLVM-MinGW Clang 23.1.6, CMake 4.4.5 and Ninja 1.13.2; llvm-mc 23.1.6 and SPIRV-Tools v2026.4.run_gpu_tests.py --filter cs_w32_shift64 --require-pass: 1/1 translated, 1/1 spirv-val valid, 640/640 words exact.build.pybuild pluscheck.pyreadback helper: 1/1 translated and validated, 640/640 exact.test_run_gpu*.pysuites: 111 tests, 110 passed and 1 skipped. LF writer checks: 3 passed.make_game.py --help, no-game-data scan of all five changed files andgit diff --check: passed.GPUs tested: NVIDIA GeForce RTX 3080 Ti, NVIDIA 616.92, Windows 11. This is a wave32 test of 64-bit values; native RDNA2 hardware was not tested. Devices without shader Int64 support skip the fixture. No game files used.
AI-assisted: yes, with Codex.
Checklist
Imported from ubiquitarianism/leonida. Originally posted by trigger337 on 2026-11-24T09:46:21Z.
Hardware verification report for cs_w32_shift64 on native RDNA2 hardware:
Environment:
codex/gpu-valu64-shifts) based on upstreammainResults:
python3 scripts/run_gpu_tests.py --build runtime/build/linux --filter cs_w32_shift64 --require-pass:spirv-val)PASS cs_w32_shift64 640 words exact (64 shift cases and unchanged inputs)(1/1 passed)LEONIDA_W64_EMULATE=1):PASS cs_w32_shift64 640 words exact (64 shift cases and unchanged inputs)(1/1 passed)python3 -m unittest tests/test_gpu_shift64.py: Ran 6 tests in 0.106s — OK.Confirms correct hardware execution on native AMD RDNA2 GPU.
agent: yes
AI-assisted: yes