run_semantic_tests: refuse the repository's tests folder, name tests/semantic (SEMANTIC-RUNNER-WRONG-FOLDER) #1442

Closed
leonida/mandy
Anonymous78e wants to merge 0 commits from scripts/semantic-runner-wrong-folder into main

Pull request closed

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

Anonymous78e commented 2026-11-25 00:18:49 +00:00

Claimed in the coordination issue as: SEMANTIC-RUNNER-WRONG-FOLDER (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148344085)

What and why

@GTAVIB4GTAVI's finding: python -I scripts/run_semantic_tests.py tests (the parent folder instead of tests/semantic) puts the whole tests/ tree through unittest. It reports 42 failed files, and 36 of them are not real failures. 30 are files CI hands to pytest (PYTEST_FILE_MARKERS in ci.yml), which cannot import under python -I. 6 are script-style files with a __main__ block and no TestCase. The runner's usage lines name tests/semantic, so this is a trap rather than a supported path.

The runner now stops with a usage error (exit 2) when the directory is this repository's tests folder under any spelling (os.path.samefile). The message names the semantic subfolder and .github/workflows/ci.yml:

run_semantic_tests.py: error: tests is the repository's tests folder; the translator suite is its semantic subfolder (tests\semantic). The other files in tests/ run under pytest or as scripts in CI (.github/workflows/ci.yml), not through this runner

Every documented call (README, AGENTS.md, CONTRIBUTING.md, docs/linux.md) and the CI call (ci.yml:194) passes tests/semantic and is unchanged; any other folder, such as the throwaway suites the runner's own tests build, is unaffected. Separate from #1051, which changes how failures are reported.

Tested

Windows 11 Pro 26H2, CPython 3.13.15, on main 1154976d4:

  • python -I tests/test_run_semantic_tests.py: 23 tests OK, including the new test_the_repository_tests_folder_is_refused_before_running_anything (exit 2, -j 1 and -j 2, nothing run, and tests/semantic is not refused).
  • python -I scripts/run_semantic_tests.py tests -j 4: the usage error above, immediately.
  • python -I scripts/run_semantic_tests.py tests/semantic -p test_exec_computed.py: 1 file, 2 tests, 0 failed.
  • python -I tests/test_ci_registration.py: OK. python -m compileall -q and scripts/check_no_game_data.py on both files: clean.

GPUs tested: n/a

AI-assisted: yes (Claude Code, Claude Opus 5.5)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • 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. (n/a: no translator change)

🤖 Generated with Claude Code

https://claude.ai/code/session_014sDZDAAcsauTL6d8ie67Qo

Claimed in the coordination issue as: SEMANTIC-RUNNER-WRONG-FOLDER (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148344085) ### What and why @GTAVIB4GTAVI's [finding](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7147793888): `python -I scripts/run_semantic_tests.py tests` (the parent folder instead of `tests/semantic`) puts the whole `tests/` tree through unittest. It reports 42 failed files, and 36 of them are not real failures. 30 are files CI hands to pytest (`PYTEST_FILE_MARKERS` in `ci.yml`), which cannot import under `python -I`. 6 are script-style files with a `__main__` block and no `TestCase`. The runner's usage lines name `tests/semantic`, so this is a trap rather than a supported path. The runner now stops with a usage error (exit 2) when the directory is this repository's `tests` folder under any spelling (`os.path.samefile`). The message names the semantic subfolder and `.github/workflows/ci.yml`: ``` run_semantic_tests.py: error: tests is the repository's tests folder; the translator suite is its semantic subfolder (tests\semantic). The other files in tests/ run under pytest or as scripts in CI (.github/workflows/ci.yml), not through this runner ``` Every documented call (README, AGENTS.md, CONTRIBUTING.md, docs/linux.md) and the CI call (`ci.yml:194`) passes `tests/semantic` and is unchanged; any other folder, such as the throwaway suites the runner's own tests build, is unaffected. Separate from #1051, which changes how failures are reported. ### Tested Windows 11 Pro 26H2, CPython 3.13.15, on `main` 1154976d4: - `python -I tests/test_run_semantic_tests.py`: 23 tests OK, including the new `test_the_repository_tests_folder_is_refused_before_running_anything` (exit 2, `-j 1` and `-j 2`, nothing run, and `tests/semantic` is not refused). - `python -I scripts/run_semantic_tests.py tests -j 4`: the usage error above, immediately. - `python -I scripts/run_semantic_tests.py tests/semantic -p test_exec_computed.py`: 1 file, 2 tests, 0 failed. - `python -I tests/test_ci_registration.py`: OK. `python -m compileall -q` and `scripts/check_no_game_data.py` on both files: clean. GPUs tested: n/a AI-assisted: yes (Claude Code, Claude Opus 5.5) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014sDZDAAcsauTL6d8ie67Qo
PierreEbele commented 2026-11-25 15:29:08 +00:00

Reviewed a5459a61: the translator-suite runner now refuses the repository's tests folder (any spelling, isdir + samefile) with a usage error naming tests/semantic and CI's pytest/scripts split, before running anything. Ran python -I tests/test_run_semantic_tests.py on the PR tree (23 tests OK) and the same file over main's code (only the new test fails there: main runs the whole tests tree until the test's 15 s limit); probed both trees: the PR exits 2 with the refusal, main reports a CI-pytest file as "FAILED ... NO TESTS RAN". tests/semantic and throwaway suites behave identically on both. No findings; no game data touched.
AI-assisted review.
Recommendation: Merge

Reviewed a5459a61: the translator-suite runner now refuses the repository's tests folder (any spelling, isdir + samefile) with a usage error naming tests/semantic and CI's pytest/scripts split, before running anything. Ran `python -I tests/test_run_semantic_tests.py` on the PR tree (23 tests OK) and the same file over main's code (only the new test fails there: main runs the whole tests tree until the test's 15 s limit); probed both trees: the PR exits 2 with the refusal, main reports a CI-pytest file as "FAILED ... NO TESTS RAN". tests/semantic and throwaway suites behave identically on both. No findings; no game data touched. AI-assisted review. **Recommendation:** Merge
zmasi commented 2026-11-28 22:21:54 +00:00

#1442 | head a5459a6136d6cdeb31eb1109c9f5a6aee68c7e30 (merged cleanly with main c7753ed98a) | python -I tests/test_run_semantic_tests.py -v + Windows NTFS spelling probes (tests, TESTS, tests\, .\tests, Tests/.) | red on main: scripts/run_semantic_tests.py tests -p test_amd_swizzle.py entered tests/ instead of refusing it and failed (exit code 1, ImportError / AttributeError importing a pytest module under unittest, in both -j 1 and -j 2 modes) | green on PR+main: 34 ran, OK (skipped=1) (test_run_semantic_tests.py) + all 5 Windows NTFS spellings refused upfront with exit code 2 naming the semantic subfolder | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes

Audited a5459a6136 (scripts/run_semantic_tests.py and tests/test_run_semantic_tests.py) on Windows 11, confirming is_repo_tests(directory) (os.path.isdir(directory) and os.path.samefile(directory, REPO_TESTS)) executes before test_modules(directory, a.pattern), cleanly refusing case-variant (TESTS), trailing-backslash (tests\), and relative (.\tests, Tests/.) NTFS spellings of tests/ while allowing tests/semantic. Also verified tests/test_ci_registration.py, tests/test_text_write_line_endings.py, and scripts/check_no_game_data.py.

#1442 | head a5459a6136d6cdeb31eb1109c9f5a6aee68c7e30 (merged cleanly with main c7753ed98a) | `python -I tests/test_run_semantic_tests.py -v` + Windows NTFS spelling probes (`tests`, `TESTS`, `tests\`, `.\tests`, `Tests/.`) | red on main: `scripts/run_semantic_tests.py tests -p test_amd_swizzle.py` entered `tests/` instead of refusing it and failed (`exit code 1`, `ImportError` / `AttributeError` importing a pytest module under `unittest`, in both `-j 1` and `-j 2` modes) | green on PR+main: `34 ran, OK (skipped=1)` (`test_run_semantic_tests.py`) + all 5 Windows NTFS spellings refused upfront with `exit code 2` naming the `semantic` subfolder | Windows 11 (`10.0.26200.9974`), Python 3.12.10 | AI-assisted: yes Audited `a5459a6136` (`scripts/run_semantic_tests.py` and `tests/test_run_semantic_tests.py`) on Windows 11, confirming `is_repo_tests(directory)` (`os.path.isdir(directory) and os.path.samefile(directory, REPO_TESTS)`) executes before `test_modules(directory, a.pattern)`, cleanly refusing case-variant (`TESTS`), trailing-backslash (`tests\`), and relative (`.\tests`, `Tests/.`) NTFS spellings of `tests/` while allowing `tests/semantic`. Also verified `tests/test_ci_registration.py`, `tests/test_text_write_line_endings.py`, and `scripts/check_no_game_data.py`.
enlight3d commented 2026-11-29 00:45:06 +00:00

RUN: test_the_repository_tests_folder_is_refused_before_running_anything (red/green)

Tested heads:

  • PR head: a5459a6136d6cdeb31eb1109c9f5a6aee68c7e30
  • PR base (merge-base with main): b4b7756e8c64e7ae8b310288d543db0e428c0796 (main is 3768 commits ahead of it)
  • main: 1bc055e6c2dedaa0de23ec79d8c4007c1dff1fb3. A trial merge of the PR into main has no conflicts (git merge-tree); main's scripts/run_semantic_tests.py has no repo-tests check, so the fix is not already there.

Machine: Windows 11 Pro 10.0.26300, CPython 3.13.12, RTX 3090 24 GB, NVIDIA driver 621.40 (GPU not used by this test).

Command (from the repository root, only this one test):
python -I tests/test_run_semantic_tests.py RunnerTest.test_the_repository_tests_folder_is_refused_before_running_anything -v

RED (PR head with scripts/run_semantic_tests.py put back to the PR base version, test file from the PR): FAILED, Ran 1 test, errors=3, 239.5 s.

  • jobs=1 and jobs=2: the runner does not stop with a usage error; it starts running the tests tree and the test's 15 s subprocess timeout expires (subprocess.TimeoutExpired), instead of exit code 2.
  • the last assertion errors with AttributeError (no is_repo_tests in the old runner).

GREEN (PR head): OK, Ran 1 test in 0.47 s.
GREEN (PR merged into main 1bc055e6c, tree e8369c96c, no conflicts): OK, Ran 1 test in 0.19 s.

Not run: the red against main's own runner (it would run the whole tests tree for about the same 4 minutes); the rest of the suite.

RUN: test_the_repository_tests_folder_is_refused_before_running_anything (red/green) Tested heads: - PR head: a5459a6136d6cdeb31eb1109c9f5a6aee68c7e30 - PR base (merge-base with main): b4b7756e8c64e7ae8b310288d543db0e428c0796 (main is 3768 commits ahead of it) - main: 1bc055e6c2dedaa0de23ec79d8c4007c1dff1fb3. A trial merge of the PR into main has no conflicts (git merge-tree); main's scripts/run_semantic_tests.py has no repo-tests check, so the fix is not already there. Machine: Windows 11 Pro 10.0.26300, CPython 3.13.12, RTX 3090 24 GB, NVIDIA driver 621.40 (GPU not used by this test). Command (from the repository root, only this one test): python -I tests/test_run_semantic_tests.py RunnerTest.test_the_repository_tests_folder_is_refused_before_running_anything -v RED (PR head with scripts/run_semantic_tests.py put back to the PR base version, test file from the PR): FAILED, Ran 1 test, errors=3, 239.5 s. - jobs=1 and jobs=2: the runner does not stop with a usage error; it starts running the tests tree and the test's 15 s subprocess timeout expires (subprocess.TimeoutExpired), instead of exit code 2. - the last assertion errors with AttributeError (no is_repo_tests in the old runner). GREEN (PR head): OK, Ran 1 test in 0.47 s. GREEN (PR merged into main 1bc055e6c, tree e8369c96c, no conflicts): OK, Ran 1 test in 0.19 s. Not run: the red against main's own runner (it would run the whole tests tree for about the same 4 minutes); the rest of the suite.
TheGeogeo commented 2026-11-29 14:17:39 +00:00

Needs rebase: conflicts with main 3535eb5c4 in tests/test_run_semantic_tests.py. The last main change to those lines is 53bc0e3a8 (2026-11-27, "Cover early exits and masked unittest failures"). Not in main yet (git cherry: 1 commit(s) not there), and no duplicate found among the open pull requests.

AI-assisted (Claude Code).

Needs rebase: conflicts with `main` `3535eb5c4` in `tests/test_run_semantic_tests.py`. The last `main` change to those lines is `53bc0e3a8` (2026-11-27, "Cover early exits and masked unittest failures"). Not in `main` yet (`git cherry`: 1 commit(s) not there), and no duplicate found among the open pull requests. AI-assisted (Claude Code).
aslan2142 reviewed 2026-12-01 11:54:09 +00:00
aslan2142 left a comment
No description provided.
Reviewed against current `main`: refusing the repository's `tests/` root in `scripts/run_semantic_tests.py` looks good, but this branch conflicts with `main` in `tests/test_run_semantic_tests.py` and has no green CI run. Please rebase onto current `main` so CI runs cleanly. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 17:23:36 +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.