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

Merged
leonida/mandy
quietfold merged 1 commit from fix/wave64-pipeline-audit-validation into main 2026-11-28 10:51:48 +00:00

Pull request successfully merged and closed

quietfold commented 2026-11-25 04:39:54 +00:00

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)).
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)`).
copilot-pull-request-reviewer[bot] reviewed 2026-11-25 04:40:05 +00:00
copilot-pull-request-reviewer[bot] left a comment
No description provided.
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.
GeorgiyDemo commented 2026-11-25 04:50:16 +00:00

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.

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.
sodove commented 2026-11-28 10:44:31 +00:00

#1563 | head 7b1ae5b22ed7acc1da9f5646ee02620a3464998a | python3 -I tests/test_wave64_pipeline_audit.py -v | red: 17 run, 8 failures, 3 errors | green: 17 passed | Red → green

The pipeline audit tests exercised subgroup bounds, unknown shader stages, empty chains and report handling.

Base 3bd936ecd98995bca3e1da83d5e28d2343001aef was merged into the recorded PR head for the second run. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Counts include unittest subtest events where applicable. AI-assisted with OpenAI Codex. Batch claim.

#1563 | head `7b1ae5b22ed7acc1da9f5646ee02620a3464998a` | `python3 -I tests/test_wave64_pipeline_audit.py -v` | red: 17 run, 8 failures, 3 errors | green: 17 passed | **Red → green** The pipeline audit tests exercised subgroup bounds, unknown shader stages, empty chains and report handling. Base `3bd936ecd98995bca3e1da83d5e28d2343001aef` was merged into the recorded PR head for the second run. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Counts include unittest subtest events where applicable. AI-assisted with OpenAI Codex. [Batch claim](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7237873883).
MoonEyes commented 2026-11-28 10:51:44 +00:00

Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 19 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18). Targeted batch of 19 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.