wave64_graphics_scan: harden --out guards, OSError privacy, atomic JSON, and tie-breaking (WAVE64-GRAPHICS-SCAN-CLI-AND-IO) #1582

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

@⁠IlyassRS3 on GitHub · 2026-11-25 05:05 UTC · original
IlyassRS3:fix/wave64-graphics-scan-cli-and-io → main · +171 −8 · 2 files · 1 commits · open

Item: WAVE64-GRAPHICS-SCAN-CLI-AND-IO (unclaimed — coordination issue #14 is at GitHub's 2,500-comment cap with no successor open issue yet, and 0 open PRs touch tools/wave64_graphics_scan.py).

Summary

  • Reject empty or whitespace-only --out values instead of silently skipping --out "" or creating a whitespace-named file for --out " ", and validate the resolved symlink target's parent directory before scanning.
  • Catch OSError when enumerating/reading shader listings or writing --out and exit cleanly with code 2, stripping scanned shader filenames from error details so names stay inside the work folder.
  • Publish --out JSON atomically via file_mode.published_mode + replace_retry.replace with allow_nan=False and a trailing \n before printing stdout, preserving any existing report on write failure and leaving non-regular targets (e.g. /dev/null) intact.
  • Break equal-count ties alphabetically ((-count, op)) in occurrences and mask_word_source for deterministic JSON and console output.

Verification

  • python3 -W error -I tests/test_wave64_graphics_scan.py -v: 24/24 passed.
  • python3 -I tests/test_text_write_line_endings.py: 3/3 passed.
  • python3 -I scripts/check_no_game_data.py tools/wave64_graphics_scan.py tests/test_wave64_graphics_scan.py: passed.
  • python3 -m compileall -q tools/wave64_graphics_scan.py tests/test_wave64_graphics_scan.py: passed.
  • Mutation check (running the new test suite against unpatched main:tools/wave64_graphics_scan.py): failures=5, errors=3 across all new assertions.

AI-assisted: yes
GPUs tested: none (CPU-only Python tool; synthetic fixtures only, no game data)

**@⁠IlyassRS3** on GitHub · 2026-11-25 05:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1582) `IlyassRS3:fix/wave64-graphics-scan-cli-and-io` → `main` · +171 −8 · 2 files · 1 commits · open Item: `WAVE64-GRAPHICS-SCAN-CLI-AND-IO` (unclaimed — coordination issue #14 is at GitHub's 2,500-comment cap with no successor open issue yet, and 0 open PRs touch `tools/wave64_graphics_scan.py`). ### Summary - Reject empty or whitespace-only `--out` values instead of silently skipping `--out ""` or creating a whitespace-named file for `--out " "`, and validate the resolved symlink target's parent directory before scanning. - Catch `OSError` when enumerating/reading shader listings or writing `--out` and exit cleanly with code 2, stripping scanned shader filenames from error details so names stay inside the work folder. - Publish `--out` JSON atomically via `file_mode.published_mode` + `replace_retry.replace` with `allow_nan=False` and a trailing `\n` before printing stdout, preserving any existing report on write failure and leaving non-regular targets (e.g. `/dev/null`) intact. - Break equal-count ties alphabetically (`(-count, op)`) in `occurrences` and `mask_word_source` for deterministic JSON and console output. ### Verification - `python3 -W error -I tests/test_wave64_graphics_scan.py -v`: 24/24 passed. - `python3 -I tests/test_text_write_line_endings.py`: 3/3 passed. - `python3 -I scripts/check_no_game_data.py tools/wave64_graphics_scan.py tests/test_wave64_graphics_scan.py`: passed. - `python3 -m compileall -q tools/wave64_graphics_scan.py tests/test_wave64_graphics_scan.py`: passed. - Mutation check (running the new test suite against unpatched `main:tools/wave64_graphics_scan.py`): `failures=5, errors=3` across all new assertions. AI-assisted: yes GPUs tested: none (CPU-only Python tool; synthetic fixtures only, no game data)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:57:12 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 05:05 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 05:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1582#pullrequestreview-6052129215) · **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 05:20 UTC · original

Tested 7817a454a 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_graphics_scan.py: 24 passed, 2 subtests passed at this head.
  • The same file on main: 8 failed, 18 passed — the --out guards, atomic write and the unreadable-listing/name-leak handling are not there.
  • Not run: the scan against real shader listings; only the synthetic tests.

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

**@⁠GeorgiyDemo** on GitHub · 2026-11-25 05:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1582#issuecomment-7153671424) Tested `7817a454a` 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_graphics_scan.py`: **24 passed, 2 subtests passed** at this head. - The same file on `main`: **8 failed**, 18 passed — the `--out` guards, atomic write and the unreadable-listing/name-leak handling are not there. - Not run: the scan against real shader listings; 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/1582/head:github-bot/gh-1582'
git switch 'github-bot/gh-1582'

Merge

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