[PR #1563] wave64_pipeline_audit: validate half-specified subgroup bounds, unknown stages, empty chains, and --report (WAVE64-PIPELINE-AUDIT-VALIDATION) #1587

Open
opened 2026-11-26 20:21:46 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1563
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: fix/wave64-pipeline-audit-validation


📝 Commits (1)

  • 7b1ae5b wave64_pipeline_audit: validate half-specified subgroup bounds, unknown stages, empty chains, and --report

📊 Changes

2 files changed (+63 additions, -11 deletions)

View changed files

📝 tests/test_wave64_pipeline_audit.py (+43 -2)
📝 tools/wave64_pipeline_audit.py (+20 -9)

📄 Description

Item ID: WAVE64-PIPELINE-AUDIT-VALIDATION (new item; coordination issue #14 is at GitHub's 2,500-comment cap with no open successor at PR time — confirmed 0 open PRs touch tools/wave64_pipeline_audit.py)

Summary

  • Reject half-specified subgroup size ranges: Device.read() previously accepted min_subgroup_size == 0 with max_subgroup_size > 0 (also bypassing the minimum <= default <= maximum check when minimum == 0), and assess() evaluated 0 <= wanted <= max as true and falsely reported exact (required-width). Now Device.read() rejects bool(minimum) != bool(maximum) while still allowing (0, 0) for devices without VK_EXT_subgroup_size_control, and assess() requires caps.minimum > 0 for required-width.
  • Handle missing or unknown stages in assess(): return Assessment("unknown", "unknown-stage") instead of raising raw KeyError on missing "stage" or stages outside STAGE_BITS (such as "hs" or None).
  • Reject empty pipeline chains in build_report(): raise a clear ValueError("pipeline chain has no shader stages") instead of max() iterable argument is empty.
  • Validate --report before auditing and catch RecursionError in load_json(): reject empty/whitespace --report paths (previously --report " " exited 0 and created a literal " " file in cwd, and --report "" resolved to Path(".") and tried to overwrite cwd after writing a temp file in cwd.parent) and reject existing directories before running the audit.

Testing

  • AI-assisted: yes
  • GPUs tested: none (CPU/Python stdlib tool; no GPU, no game files)
  • python3 -W error -I tests/test_wave64_pipeline_audit.py -v: 17/17 passed
  • python3 -W error -I tests/test_text_write_line_endings.py -v: 3/3 passed
  • python3 -I scripts/check_no_game_data.py tools/wave64_pipeline_audit.py tests/test_wave64_pipeline_audit.py: passed
  • python3 -m compileall -q make_game.py tools tests: passed
  • Mutation check against unpatched main:tools/wave64_pipeline_audit.py: all 4 new/updated tests fail (FAILED (failures=8, errors=3)).

🔄 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/1563 **Author:** [@IlyassRS3](https://github.com/IlyassRS3) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/wave64-pipeline-audit-validation` --- ### 📝 Commits (1) - [`7b1ae5b`](https://github.com/ubiquitarianism/leonida/commit/7b1ae5b22ed7acc1da9f5646ee02620a3464998a) wave64_pipeline_audit: validate half-specified subgroup bounds, unknown stages, empty chains, and --report ### 📊 Changes **2 files changed** (+63 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_wave64_pipeline_audit.py` (+43 -2) 📝 `tools/wave64_pipeline_audit.py` (+20 -9) </details> ### 📄 Description Item ID: `WAVE64-PIPELINE-AUDIT-VALIDATION` (new item; coordination issue #14 is at GitHub's 2,500-comment cap with no open successor at PR time — confirmed 0 open PRs touch `tools/wave64_pipeline_audit.py`) ## Summary - **Reject half-specified subgroup size ranges**: `Device.read()` previously accepted `min_subgroup_size == 0` with `max_subgroup_size > 0` (also bypassing the `minimum <= default <= maximum` check when `minimum == 0`), and `assess()` evaluated `0 <= wanted <= max` as true and falsely reported `exact` (`required-width`). Now `Device.read()` rejects `bool(minimum) != bool(maximum)` while still allowing `(0, 0)` for devices without `VK_EXT_subgroup_size_control`, and `assess()` requires `caps.minimum > 0` for `required-width`. - **Handle missing or unknown stages in `assess()`**: return `Assessment("unknown", "unknown-stage")` instead of raising raw `KeyError` on missing `"stage"` or stages outside `STAGE_BITS` (such as `"hs"` or `None`). - **Reject empty pipeline chains in `build_report()`**: raise a clear `ValueError("pipeline chain has no shader stages")` instead of `max() iterable argument is empty`. - **Validate `--report` before auditing and catch `RecursionError` in `load_json()`**: reject empty/whitespace `--report` paths (previously `--report " "` exited 0 and created a literal `" "` file in cwd, and `--report ""` resolved to `Path(".")` and tried to overwrite cwd after writing a temp file in `cwd.parent`) and reject existing directories before running the audit. ## Testing - AI-assisted: yes - GPUs tested: none (CPU/Python stdlib tool; no GPU, no game files) - `python3 -W error -I tests/test_wave64_pipeline_audit.py -v`: **17/17 passed** - `python3 -W error -I tests/test_text_write_line_endings.py -v`: **3/3 passed** - `python3 -I scripts/check_no_game_data.py tools/wave64_pipeline_audit.py tests/test_wave64_pipeline_audit.py`: passed - `python3 -m compileall -q make_game.py tools tests`: passed - Mutation check against unpatched `main:tools/wave64_pipeline_audit.py`: all 4 new/updated tests fail (`FAILED (failures=8, errors=3)`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#1587
No description provided.