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

Open
github-bot wants to merge 1 commit from github-bot/gh-1563 into main AGit
Owner

@⁠IlyassRS3 on GitHub · 2026-11-25 04:39 UTC · original
IlyassRS3:fix/wave64-pipeline-audit-validation → main · +63 −11 · 2 files · 1 commits · open

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)).
**@⁠IlyassRS3** on GitHub · 2026-11-25 04:39 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1563) `IlyassRS3:fix/wave64-pipeline-audit-validation` → `main` · +63 −11 · 2 files · 1 commits · open 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)`).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:56:46 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 04:40 UTC · original · reviewed

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-25 04:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1563#pullrequestreview-6051946492) · **reviewed** Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Author
Owner

@⁠GeorgiyDemo on GitHub · 2026-11-25 04:50 UTC · original

Tested 7b1ae5b22 on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), against main c7e82e26e (Python tool; no GPU):

  • pytest 9.2.0 on tests/test_wave64_pipeline_audit.py: 17 passed, 34 subtests passed at this head.
  • The same file on main: 11 failed, 14 passed, 26 subtests — the half-specified subgroup ranges, unknown stages, empty chains and --report guards are not enforced there.
  • Not run: the audit against real pipeline dumps; only the synthetic tests.

AI-assisted; synthetic fixtures only, no game data.

**@⁠GeorgiyDemo** on GitHub · 2026-11-25 04:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1563#issuecomment-7153208978) Tested `7b1ae5b22` on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), against `main` `c7e82e26e` (Python tool; no GPU): - pytest 9.2.0 on `tests/test_wave64_pipeline_audit.py`: **17 passed, 34 subtests passed** at this head. - The same file on `main`: **11 failed**, 14 passed, 26 subtests — the half-specified subgroup ranges, unknown stages, empty chains and `--report` guards are not enforced there. - Not run: the audit against real pipeline dumps; only the synthetic tests. AI-assisted; synthetic fixtures only, no game data.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1563/head:github-bot/gh-1563'
git switch 'github-bot/gh-1563'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1563'
git switch 'github-bot/gh-1563'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1563'
git switch 'github-bot/gh-1563'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1563'
git switch 'main'
git merge --squash 'github-bot/gh-1563'
git switch 'main'
git merge --ff-only 'github-bot/gh-1563'
git switch 'main'
git merge 'github-bot/gh-1563'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.