tests: isolate semantic worker Python processes (TEST-SEMANTIC-ISOLATED-WORKERS) #863

Closed
leonida/mandy
KernelSmoker wants to merge 0 commits from kernelsmoker/test-semantic-isolated-workers into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

KernelSmoker commented 2026-11-24 14:47:57 +00:00

Claimed in the coordination issue as: TEST-SEMANTIC-ISOLATED-WORKERS — https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7134674247

What and why

Run semantic test workers under Python isolated mode so host PYTHONPATH and user site-packages cannot inject imports. The runner explicitly adds its suite directory before importing each module, and the mutant tester adds only its test directory and the semantic suite directory. Add poisoned-PYTHONPATH regressions for serial and parallel runner paths and for semantic mutation tests.

Tested

  • python3 -I tests/test_run_semantic_tests.py: passed (20 tests; its intentional failing-fixture subprocess is expected).
  • python3 -I tests/test_semantic_mutants.py: 13/13 passed.
  • python3 -I scripts/run_semantic_tests.py tests/semantic -j 16 in the Fedora 45 tool container (Python 3.15.2, SPIRV-Tools installed): 465 files, 6,108 tests, 0 failures.
  • python3 -I -m py_compile scripts/run_semantic_tests.py tools/semantic_mutants.py tests/test_run_semantic_tests.py tests/test_semantic_mutants.py: passed.
  • git diff --check: passed. Synthetic tests only; no game files.

GPUs tested: n/a (CPU-only test tooling)

AI-assisted: yes

Claimed in the coordination issue as: TEST-SEMANTIC-ISOLATED-WORKERS — https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7134674247 ### What and why Run semantic test workers under Python isolated mode so host `PYTHONPATH` and user site-packages cannot inject imports. The runner explicitly adds its suite directory before importing each module, and the mutant tester adds only its test directory and the semantic suite directory. Add poisoned-`PYTHONPATH` regressions for serial and parallel runner paths and for semantic mutation tests. ### Tested - `python3 -I tests/test_run_semantic_tests.py`: passed (20 tests; its intentional failing-fixture subprocess is expected). - `python3 -I tests/test_semantic_mutants.py`: 13/13 passed. - `python3 -I scripts/run_semantic_tests.py tests/semantic -j 16` in the Fedora 45 tool container (Python 3.15.2, SPIRV-Tools installed): **465 files, 6,108 tests, 0 failures**. - `python3 -I -m py_compile scripts/run_semantic_tests.py tools/semantic_mutants.py tests/test_run_semantic_tests.py tests/test_semantic_mutants.py`: passed. - `git diff --check`: passed. Synthetic tests only; no game files. GPUs tested: n/a (CPU-only test tooling) AI-assisted: yes
qhukz13 reviewed 2026-11-24 15:20:11 +00:00
qhukz13 left a comment
No description provided.
Checked 1f76d4a79 as the author of `tools/semantic_mutants.py` (Linux, CPU only): - Plain `-I` would break the tool: `python -I -m unittest <module>` from the test's folder cannot import the module (`-I` drops both `PYTHONPATH` and the working directory). The bootstrap here puts exactly the test's folder and `tests/semantic` back on `sys.path`, so that is handled. - `tests/test_semantic_mutants.py` and `tests/test_run_semantic_tests.py`: OK. - A real run, `--lines 11766-11776 tests/semantic/test_alu_div_fixup_f32.py`: 5 of 6 mutants caught, the same as before this change on `main`; `--op v_rcp_f64` with `test_valu_rcp_f64.py` (a file that sets up no `sys.path` itself) lists its mutants fine. - Merges cleanly with #660 and #734, which touch the same file. LGTM.
MoonEyes commented 2026-11-27 23:20:20 +00:00

Hi @KernelSmoker, thanks for this pull request. It currently conflicts with main (conflicting file(s): scripts/run_semantic_tests.py), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

Hi @KernelSmoker, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `scripts/run_semantic_tests.py`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
aslan2142 reviewed 2026-12-01 11:35:22 +00:00
aslan2142 left a comment
No description provided.
Conflicts with `main` in `scripts/run_semantic_tests.py`. The worker isolation change (`-I`) is still not on `main` (`scripts/run_semantic_tests.py:205,250`), so please rebase onto current `main` and trigger a fresh green CI run. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 17:21:28 +00:00

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.
Sign in to join this conversation.
No description provided.