mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:35:53 +01:00
[PR #590] [MERGED] tests: GPU readback for dynamic 64-bit vector shifts (GPU-VALU64-SHIFTS) #631
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#631
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/590
Author: @JiyouProt
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism
Base:
main← Head:codex/gpu-valu64-shifts📝 Commits (1)
49d904ftests: GPU readback for dynamic 64-bit vector shifts (GPU-VALU64-SHIFTS)📊 Changes
5 files changed (+169 additions, -0 deletions)
View changed files
📝
docs/testing.md(+11 -0)📝
runtime/test/shaders/check.py(+28 -0)➕
runtime/test/shaders/cs_w32_shift64.asm(+29 -0)📝
scripts/run_gpu_tests.py(+5 -0)➕
tests/test_gpu_shift64.py(+96 -0)📄 Description
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.