mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:30:53 +01:00
[PR #1238] bench_wave64: exercise partial ballots and check the stock shader output #1272
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#1272
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/1238
Author: @titoreinaldo
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:contrib/r2-ballot📝 Commits (1)
5a1e17fbench_wave64: exercise partial ballots and check the stock shader readback📊 Changes
4 files changed (+66 additions, -3 deletions)
View changed files
📝
runtime/test/shaders/cs_bench_mix.asm(+3 -2)📝
runtime/test/vk_compute_test.cpp(+35 -0)📝
scripts/bench_wave64.py(+7 -1)📝
tests/test_bench_wave64.py(+21 -0)📄 Description
Claimed in the coordination issue as: SHADER-BENCH-MIX-BALLOT
Claim in #14
What and why
The stock benchmark used the bottom two bits of
(index * 0x9e3779b1) ^ indexfor its ballot. Those bits always cancel, so no lane was selected. A broken prefix count in the upper half of the wave could still give identical output across runs and GPUs.Using bits 8–9 selects 16,896 of the first 65,536 inputs. Each 32-lane half has 7–9 participants, and the halves have different counts in every one of those 1,024 workgroups. The harness now checks the stock shader’s output against a CPU implementation after timing, including its whole-wave prefix, neighbor reads and branches. Custom benchmark shaders retain the existing dump mode.
Tested
vk_compute_test cs_bench_mix.spv 65535 bench_mix: 4,194,240 words checked per GPU, zero mismatches, output hash7d38f475(withVKC_BENCH=1).python -I scripts/bench_wave64.py --emulated-only --build <build> --groups 1024 --procs 2 --reps 2returned the same hashc80c78fbon each GPU.python -I tests/test_bench_wave64.pypassed all 15 tests.58be9cdfran 6,168 translator tests in 470 files with zero failing files. Verified a clean merge withmainat705ea091and with #1054.GPUs tested: Windows 11 Pro 26H2 build 26300.9974. NVIDIA GeForce RTX 3070 eGPU, driver 610.88, reported subgroup 32..32. Intel(R) Arc(TM) Graphics, driver 32.0.101.8132, reported subgroup 8..32. Both runs used wave64 emulation, and each harness log identified its selected device. Native wave64 hardware coverage is still open.
AI-assisted: yes, OpenAI Codex. Synthetic shader and buffers.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.