Skip to content

semantic_mutants: fix docstring example and reject non-positive --timeout - #8676

Open
Kaivyyy wants to merge 1 commit into
ItsNotRexed:mainfrom
Kaivyyy:fix/semantic-mutants-cli-validation
Open

Kaivyyy wants to merge 1 commit into
ItsNotRexed:mainfrom
Kaivyyy:fix/semantic-mutants-cli-validation

Conversation

@Kaivyyy

@Kaivyyy Kaivyyy commented Nov 23, 2026

Copy link
Copy Markdown

Claim: #8504 (comment)

What changed and why

  1. Docstring example contradicts the CLI (tools/semantic_mutants.py:4): the second usage example passed both --op ds_swizzle_b32 and --function swizzle, even though --op, --function, and --lines are in a mutually exclusive group (add_mutually_exclusive_group(required=True)), so running the documented example failed with exit 2 (error: argument --function: not allowed with argument --op). Updated the example to --function swizzle.
  2. Non-positive --timeout (tools/semantic_mutants.py:205-209): --timeout 0 or --timeout -1 was accepted by argparse and either passed a negative timeout to subprocess.run (causing an immediate baseline timeout after copying tools/) or ran with a 0s deadline. Now rejected up front with ap.error("--timeout must be at least 1") (exit 2).

Tests

Run on Windows 11, CPython 3.12.10, CPU-only (no GPU used, no game files):

  • python -I tests/test_semantic_mutants.py CliValidation -v — 2/2 OK (test_timeout_below_one_is_usage_error, test_docstring_examples_parse_with_list; both fail on main)
  • python -I scripts/check_no_game_data.py tools/semantic_mutants.py tests/test_semantic_mutants.py — exit 0
  • python -m compileall -q tools/semantic_mutants.py tests/test_semantic_mutants.py — exit 0
  • python -I tools/semantic_mutants.py --help — exit 0
  • git diff --check upstream/main — clean

Notes

@Grimkeh Grimkeh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent Linux CPU review (2ff72b9e)

What changed: semantic_mutants docstring example fix + reject non-positive --timeout.

Checked: test_semantic_mutants 10 OK.

Looks correct; no game files.

@o-psi

o-psi commented Nov 23, 2026

Copy link
Copy Markdown

AI-assisted QA (Codex via T3) at 2ff72b9e97a1a07267f006b8c792468b6b1c3805, Linux x86_64 / CPython 3.14.10, CPU-only. Re-ran python -I tests/test_semantic_mutants.py -v: 10/10 passed, including CLI validation/docstring examples and weak/strong mutation tests. Audited logs for six independent checks (38 subprocess cases): invalid timeouts, positive listing boundaries, rejection before I/O, default/1-second synthetic mutation runs, and baseline timeout enforcement. No actionable findings in this scoped CLI review. Windows, GPU, game/corpus tests, and the broad translator suite were not run; hosted CI awaits maintainer approval.

@ne1i

ne1i commented Nov 23, 2026

Copy link
Copy Markdown

Tested 2ff72b9e on Linux, CPython 3.14, CPU only, synthetic inputs, merged onto main 867d922f: pass

  • python -I tests/test_semantic_mutants.py: Ran 10 tests, OK. With only the non-test files reverted to main: FAILED (failures=3), so the new tests exercise the change.
  • compileall and scripts/check_no_game_data.py on the changed files: clean.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants