OLD-9807: buffer_bounds_probe non-numeric --waves exits 2 instead of a traceback (carries #80) #1299

Open
github-bot wants to merge 3 commits from github-bot/gh-1299 into main AGit
Owner

@⁠muhammadumairmustafa on GitHub · 2026-11-24 21:30 UTC · original
muhammadumairmustafa:old-9807 → main · +10 −1 · 2 files · 3 commits · open

Claimed in the coordination issue as: OLD-9807 (in #14)

What and why

Carries forward old-pr/9807 (draft #80, originally by nino-exe).

A non-numeric --waves argument (e.g. --waves 32,abc) in tools/buffer_bounds_probe.py raised an uncaught ValueError traceback and exited 1, whereas the docstring specifies bad arguments exit 2. Wrapping the integer parse in try / except ValueError lets invalid values fall through to the existing validation check that prints the error and returns 2. Adds test_waves_that_are_not_numbers in tests/test_buffer_bounds_probe.py.

Tested

Ran python -I tests/test_buffer_bounds_probe.py locally on Windows (CPU-only, synthetic tests only, no game files): 6 tests run in 0.830s, OK.

AI-assisted: yes

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.
**@⁠muhammadumairmustafa** on GitHub · 2026-11-24 21:30 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1299) `muhammadumairmustafa:old-9807` → `main` · +10 −1 · 2 files · 3 commits · open Claimed in the coordination issue as: OLD-9807 (in #14) ### What and why Carries forward `old-pr/9807` (draft #80, originally by `nino-exe`). A non-numeric `--waves` argument (e.g. `--waves 32,abc`) in `tools/buffer_bounds_probe.py` raised an uncaught `ValueError` traceback and exited `1`, whereas the docstring specifies bad arguments exit `2`. Wrapping the integer parse in `try / except ValueError` lets invalid values fall through to the existing validation check that prints the error and returns `2`. Adds `test_waves_that_are_not_numbers` in `tests/test_buffer_bounds_probe.py`. ### Tested Ran `python -I tests/test_buffer_bounds_probe.py` locally on Windows (CPU-only, synthetic tests only, no game files): 6 tests run in 0.830s, OK. AI-assisted: yes ### Checklist - [x] 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:46:30 +00:00
Author
Owner

@⁠fin-github on GitHub · 2026-11-24 21:41 UTC · original · reviewed

  • python -I tests/test_buffer_bounds_probe.py on the PR: 6 tests OK.
  • The PR's test file against main (4a50cafc7): test_waves_that_are_not_numbers fails, so the test catches it.

Turning the ValueError into an empty list so the existing message and exit 2 handle it is neat. Nit: the new test
method has no blank line before or after it (the old blank line after test_bad_waves was replaced), unlike the
rest of the class.

Tested on Windows 11 Pro 26200, CPython 3.14.4, applied on main 4a50cafc7. No GPU or game files used. AI-assisted (Claude Code).

**@⁠fin-github** on GitHub · 2026-11-24 21:41 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1299#pullrequestreview-6047867492) · **reviewed** - `python -I tests/test_buffer_bounds_probe.py` on the PR: 6 tests OK. - The PR's test file against `main` (4a50cafc7): `test_waves_that_are_not_numbers` fails, so the test catches it. Turning the `ValueError` into an empty list so the existing message and exit 2 handle it is neat. Nit: the new test method has no blank line before or after it (the old blank line after `test_bad_waves` was replaced), unlike the rest of the class. Tested on Windows 11 Pro 26200, CPython 3.14.4, applied on main 4a50cafc7. No GPU or game files used. AI-assisted (Claude Code).
Author
Owner

@⁠muhammadumairmustafa on GitHub · 2026-11-24 22:07 UTC · original

  • python -I tests/test_buffer_bounds_probe.py on the PR: 6 tests OK.
  • The PR's test file against main (4a50caf): test_waves_that_are_not_numbers fails, so the test catches it.

Turning the ValueError into an empty list so the existing message and exit 2 handle it is neat. Nit: the new test method has no blank line before or after it (the old blank line after test_bad_waves was replaced), unlike the rest of the class.

Tested on Windows 11 Pro 26200, CPython 3.14.4, applied on main 4a50caf. No GPU or game files used. AI-assisted (Claude Code).

Thanks for testing and reviewing! Restored the blank lines before and after test_waves_that_are_not_numbers.

**@⁠muhammadumairmustafa** on GitHub · 2026-11-24 22:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1299#issuecomment-7145824266) > * `python -I tests/test_buffer_bounds_probe.py` on the PR: 6 tests OK. > * The PR's test file against `main` ([4a50caf](https://github.com/ubiquitarianism/leonida/commit/4a50cafc7af8b5a842c85a3794b286232495068d)): `test_waves_that_are_not_numbers` fails, so the test catches it. > > Turning the `ValueError` into an empty list so the existing message and exit 2 handle it is neat. Nit: the new test method has no blank line before or after it (the old blank line after `test_bad_waves` was replaced), unlike the rest of the class. > > Tested on Windows 11 Pro 26200, CPython 3.14.4, applied on main [4a50caf](https://github.com/ubiquitarianism/leonida/commit/4a50cafc7af8b5a842c85a3794b286232495068d). No GPU or game files used. AI-assisted (Claude Code). Thanks for testing and reviewing! Restored the blank lines before and after `test_waves_that_are_not_numbers`.
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/1299/head:github-bot/gh-1299'
git switch 'github-bot/gh-1299'

Merge

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