mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:30:53 +01:00
[PR #1016] [MERGED] semantic_mutants: --source mutates any tools/ file, and tests outside tests/semantic run from a copy (MUTANTS-SOURCE) #1053
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1053
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1016
Author: @qhukz13
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @QemmHD
Base:
main← Head:cont/mutants-source📝 Commits (1)
dbc0c74semantic_mutants: --source mutates any tools/ file, and tests outside tests/semantic run from a copy (MUTANTS-SOURCE)📊 Changes
2 files changed (+136 additions, -8 deletions)
View changed files
📝
tests/test_semantic_mutants.py(+48 -0)📝
tools/semantic_mutants.py(+88 -8)📄 Description
Claimed in the coordination issue as: MUTANTS-SOURCE
What and why
tools/semantic_mutants.pycould only mutatetools/rdna2spirv.py, but much of the logic a test should catch lives in other tools:cfg_structure.py(structured CFG, see #808),lane_masks.py,wave64_emulate_opt.py,rdna2_decode.py(see #637). Reviewing those I had to write the mutations by hand.--source tools/<file>.pypicks the file to mutate (defaulttools/rdna2spirv.py, so existing uses are unchanged).--op,--function,--linesand the Python-logic mutations from #734 apply to it.tests/semanticfile runs in place throughLEONIDA_TOOLS_DIR, exactly as before.tools/by path, so a mutant in the privatetools/copy never reached it: reviewing #637, every mutant ofrdna2_decode.py"survived"tests/test_rdna2_decode.pythat way. Such a test now runs from a copy of the repository's tracked files (git ls-files, thentools/andtests/whole so untracked work comes along; a work folder inside the clone is never copied) with the mutant in that copy'stools/. It runs as a script when it has a__main__block, sincetest_cfg_structure.pyandtest_lane_masks.pyhave no unittest class forrun_testto find.run_testis unchanged, so this does not overlap #863 or #987.Tested
python -I tests/test_semantic_mutants.py: 23 tests OK. NewSourceOption:--sourcemust be a.pyundertools/; a probe script intests/(outsidetests/semantic) that importstools/cfg_structure.pyby path catchesdepthmutants, and the same probe without checks lets all of them survive.main:--source tools/rdna2_decode.py --lines <the VOP3 0x140 rename> tests/test_rdna2_decode.pycatches 2 of 2;--source tools/cfg_structure.py --function depth tests/test_cfg_structure.pycatches 2 of 4 (two statement removals indepthsurvive, a lead for a test). The default--lines 11766-11776 tests/semantic/test_alu_div_fixup_f32.pybehaves as before.compileall,tests/test_text_write_line_endings.py,scripts/check_no_game_data.py: OK.tests/test_tool_stdout_encoding.pyfails onmainwith and without this change (tools/native_pso_hashes.py, claimed separately).Linux, CPU only; no GPU, no game files.
AI-assisted (Claude Code).
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.