[PR #388] [MERGED] vk_fuzz_run: read a wave32 one-word dump from vk_compute_test's larger buffer #441

Closed
opened 2026-11-26 20:17:53 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/388
Author: @Sangonapou
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD

Base: main ← Head: fix-vk-fuzz-run-short-request


📝 Commits (3)

  • 791778d vk_fuzz_run: read a wave32 one-word dump from vk_compute_test's larger buffer
  • 2bf664f test_vk_fuzz_run: a distinct sentinel past the wave and per-lane values in the read_dump test
  • 8dcc396 test_vk_fuzz_run: read_dump of a wave64 one-word request from a two-group dump

📊 Changes

2 files changed (+45 additions, -4 deletions)

View changed files

📝 tests/test_vk_fuzz_run.py (+29 -0)
📝 tools/vk_fuzz_run.py (+16 -4)

📄 Description

Claimed in the coordination issue as: claim in #14. This carries on my PR 7756 from the original repository, which was not among the 251 old-pr/* branches; same commit, rebased on main ece4ba5b.

What and why

tools/vk_fuzz_run.run_programs accepted a VKC_DUMP only when it was exactly 4 * words * wave bytes. vk_compute_test's output buffer is at least one 64-thread group of words (VKC_OUT_WORDS only raises it), and VKC_DUMP writes the whole buffer. So a request under 64 words (wave32 with words=1: 128 bytes asked, 256 written) failed the check, and every program came back as vk_compute_test exit 0 even though it had run and stored the right words. The docstring allows words 1, 2, 4 and 8; 2, 4 and 8 were never affected, and no current caller passes 1.

  • read_dump(path, words, wave) returns the first words * wave words of a dump at least that long, or None when it is missing or short.
  • A missing or short dump now reports vk_compute_test: no dump of N bytes or more instead of vk_compute_test exit 0.

Tested

NVIDIA GeForce RTX 3080 Ti Laptop (subgroup 32), NVIDIA 621.24, Vulkan 1.4.357, Windows 11 Pro (build 26300); runtime built from this branch with scripts\build_runtime.ps1 (MSVC 19.51); llvm-mc 23.1.6 (conda-forge).

Two real programs (v_add_nc_u32 of 5 and 3; v_not_b32 of 0x12345678) through run_programs at wave32:

words main ece4ba5b this branch
1 vk_compute_test exit 0 (both) [8], [0xedcba987]
2, 4, 8 correct identical to main
  • tests/test_vk_fuzz_run.py: 15 OK (new test_read_dump_takes_the_first_wave_of_a_larger_buffer: a 64-word dump for wave32 words=1, an exact-size dump, a short and a missing one).
  • tests/test_fmisc_diff.py (a vk_fuzz_run caller): 34 OK.
  • python -m compileall, scripts/check_no_game_data.py on both files: clean.

On the original repo, PR 7756 had four independent checks (two CPU-side parser sweeps over all eight shapes, a mocked run_programs probe and a revert check), all passing.

AI-assisted: yes (Claude Code)

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable: no translator change.)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/388 **Author:** [@Sangonapou](https://github.com/Sangonapou) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `fix-vk-fuzz-run-short-request` --- ### 📝 Commits (3) - [`791778d`](https://github.com/ubiquitarianism/leonida/commit/791778dfb3d7923712f7e1803200c07848a12155) vk_fuzz_run: read a wave32 one-word dump from vk_compute_test's larger buffer - [`2bf664f`](https://github.com/ubiquitarianism/leonida/commit/2bf664f2289c809052a44dec9c3e825783ffa028) test_vk_fuzz_run: a distinct sentinel past the wave and per-lane values in the read_dump test - [`8dcc396`](https://github.com/ubiquitarianism/leonida/commit/8dcc396423253c3ac2ed39e157cb2e42353990e8) test_vk_fuzz_run: read_dump of a wave64 one-word request from a two-group dump ### 📊 Changes **2 files changed** (+45 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_vk_fuzz_run.py` (+29 -0) 📝 `tools/vk_fuzz_run.py` (+16 -4) </details> ### 📄 Description Claimed in the coordination issue as: [claim in #14](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121846026). This carries on my PR 7756 from the original repository, which was not among the 251 `old-pr/*` branches; same commit, rebased on `main` `ece4ba5b`. ### What and why `tools/vk_fuzz_run.run_programs` accepted a `VKC_DUMP` only when it was exactly `4 * words * wave` bytes. `vk_compute_test`'s output buffer is at least one 64-thread group of words (`VKC_OUT_WORDS` only *raises* it), and `VKC_DUMP` writes the whole buffer. So a request under 64 words (wave32 with `words=1`: 128 bytes asked, 256 written) failed the check, and every program came back as `vk_compute_test exit 0` even though it had run and stored the right words. The docstring allows `words` 1, 2, 4 and 8; 2, 4 and 8 were never affected, and no current caller passes 1. - `read_dump(path, words, wave)` returns the first `words * wave` words of a dump at least that long, or `None` when it is missing or short. - A missing or short dump now reports `vk_compute_test: no dump of N bytes or more` instead of `vk_compute_test exit 0`. ### Tested NVIDIA GeForce RTX 3080 Ti Laptop (subgroup 32), NVIDIA 621.24, Vulkan 1.4.357, Windows 11 Pro (build 26300); runtime built from this branch with `scripts\build_runtime.ps1` (MSVC 19.51); `llvm-mc` 23.1.6 (conda-forge). Two real programs (`v_add_nc_u32` of 5 and 3; `v_not_b32` of `0x12345678`) through `run_programs` at wave32: | `words` | `main` `ece4ba5b` | this branch | |---|---|---| | 1 | `vk_compute_test exit 0` (both) | `[8]`, `[0xedcba987]` | | 2, 4, 8 | correct | identical to `main` | - `tests/test_vk_fuzz_run.py`: 15 OK (new `test_read_dump_takes_the_first_wave_of_a_larger_buffer`: a 64-word dump for wave32 `words=1`, an exact-size dump, a short and a missing one). - `tests/test_fmisc_diff.py` (a `vk_fuzz_run` caller): 34 OK. - `python -m compileall`, `scripts/check_no_game_data.py` on both files: clean. On the original repo, PR 7756 had four independent checks (two CPU-side parser sweeps over all eight shapes, a mocked `run_programs` probe and a revert check), all passing. AI-assisted: yes (Claude Code) ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (Not applicable: no translator change.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:53 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#441
No description provided.