Repository navigation
Conversation
LAKSHYA-cmd-tech
approved these changes
Nov 23, 2026
LAKSHYA-cmd-tech
left a comment
There was a problem hiding this comment.
Independent review on Windows 11 x64, Python 3.12.
- Adds comprehensive truncation fuzzing across every byte offset in
tests/test_sgd5_effects.py(test_every_truncation_is_a_usage_error_not_a_traceback), verifying that truncation at any field boundary always exits 2 with a clean usage/parser error and never raises an unhandledstruct.errororIndexErrortraceback. python -I -m compileall -q tests/test_sgd5_effects.py(exit 0)python -I tests/test_sgd5_effects.py(11/11 passed, 1 skipped)python -I tools/sgd5_effects.py --help(exit 0)python -I scripts/check_no_game_data.py(exit 0)git diff --checkclean (0).
LGTM. AI-assisted; synthetic test harnesses only, zero game data or GPU used.
Contributor
|
Tested f8c403f on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass. Ran the test files this PR adds or changes, from a clean checkout of the PR head: AI-assisted (Claude Code). |
|
Tested
Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting; claimed in #8047. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed as BUILD-1627: #6910 (comment)
What
tools/sgd5_effects.pyis listed in the Up for grabs table as raising an uncaughtstruct.erroron truncated database fields (lines 114-132, 145-174, 258-266). On currentupstream/main(bd3f061ad) I could not reproduce that: every read goes throughu32(), which raisesValueError("truncated SGD5 count")beforestructis touched, andmain()turnsValueErrorinto a parser error. A random-byte and every-prefix fuzz of a synthetic database (28,192 runs) gave onlyValueError.So there is no code bug to fix here. This PR adds the regression test that was missing: it cuts a synthetic database at every byte offset and runs the CLI (
main) with no query,--list-effectsand--effect --technique; each run must either succeed or exit 2 with a usage error, never astruct.errororIndexErrortraceback. The existingtest_bad_framing_and_truncationonly cuts at two offsets.Only
tests/test_sgd5_effects.pychanges. It does not overlap #5743 (which bounds reads against the database limit and guardsprogram_identity).Tests
~/src/Leonida/.venv/bin/python -I tests/test_sgd5_effects.py->Ran 11 tests in 9.9s, OK (skipped=1)(the skip needsLEONIDA_GAME_DIR). Synthetic data only.Negative control
Removing the
if pos + 4 > len(data): raise ValueError("truncated SGD5 count")guard fromu32()makes the new test fail withstruct.errorat many cut points (e.g. cut=10, 100, 101), for all three argument sets. The guard was then restored.AI-assisted.