tests, docs: optional per-file fragments for test registration, checks and experiment notes #2647

Merged
tedin7 merged 6 commits from upstream-pr/2655 into main 2026-11-26 06:06:58 +00:00
tedin7 commented 2026-11-26 00:41:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:41:11Z.


Part of #1149

What this unblocks: fewer merge conflicts. 46 of 92 open PRs conflict with main; the three shared files cause most of it: CMakeLists.txt (26 PRs), docs/experiments.md (23 PRs) and .github/workflows/windows.yml (12 PRs). 14 PRs conflict only in these files.

This only ADDS optional places. Nothing existing moves, so no open PR gets a new conflict.

  • CMakeLists.txt: one block (before the slow-test costs) that includes every tests/cmake/*.cmake, sorted, with CONFIGURE_DEPENDS. See tests/cmake/README.md.
  • docs/experiments/: new notes go in docs/experiments/<topic>.md; docs/experiments.md keeps the older ones. tests/docs_links_check.py already checks every tracked Markdown file, so the new folder is covered.
  • windows.yml + tools/run_checks_parallel.py: new option --from-dir DIR and helpers read_check_files / merge_checks. The python-linux step reads tests/checks/python-linux/*.txt; the pixel-binary step reads tests/checks/pixel-binary/*.txt (script plus arguments per line). The brief's windows/linux split does not match the file: the Windows jobs run CTest, so CMake fragments cover them. A missing directory, a script that does not exist, bad quoting or a duplicate command listed in the files fails loudly. A command also present in the inline list runs once.
  • The new reader test tests/run_checks_fragments_check.py is itself registered through tests/checks/python-linux/run_checks_fragments.txt.
  • AGENTS.md, CONTRIBUTING.md and docs/non-windows-hosts.md name the new places.

This is a repo-layout choice and needs a maintainer decision (see the comment below). Nothing existing moves.

Win2025 (exact head 9b51402f): x2w_pipe.py win2025 2655 --py-checks tests/run_checks_fragments_check.py --keep-release -> run_checks_fragments_check ok, rc=0 (see the updated receipt comment). The PR adds no CMake add_test.

Verification (Linux):

  • python3 -B tests/run_checks_fragments_check.py -> run_checks_fragments_check ok
  • python3 -B tests/run_checks_parallel_check.py -> run_checks_parallel_check: ok
  • python3 -B tests/run_checks_parallel_cli_check.py -> 7 tests, OK
  • python3 -B tests/docs_links_check.py -> Checked 23 Markdown files and 515 links.; with a broken link added to docs/experiments/README.md it fails on docs/experiments/README.md:11, so the folder is scanned.
  • Check lists: inline entries before and after are the same (pixel-binary 107, python-linux 169). The pixel-binary step body run with the new runner calls resolves 107 checks (no file adds one). --from-dir tests/checks/python-linux -> all 1 checks passed.
  • git diff --check clean.
  • CMake: a full cmake --preset configure is not possible on Linux (it stops at find_program(DXC_EXECUTABLE), line 1646, before the new block). So the exact block lines were copied into a small project with the same add_test wrapper header: ctest -N -> 1 test; with a throwaway tests/cmake/zz_probe.cmake -> 2 tests; file removed and reconfigured -> 1 test. The glob and CONFIGURE_DEPENDS work.

Stage-2 is needed: this touches CI and CMake, so it needs a Win2025 WARP dev and release run (full configure, ctest -N count identical to main).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6616831058 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2655). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T00:41:11Z. --- Part of #1149 What this unblocks: fewer merge conflicts. 46 of 92 open PRs conflict with `main`; the three shared files cause most of it: `CMakeLists.txt` (26 PRs), `docs/experiments.md` (23 PRs) and `.github/workflows/windows.yml` (12 PRs). 14 PRs conflict only in these files. This only ADDS optional places. Nothing existing moves, so no open PR gets a new conflict. - `CMakeLists.txt`: one block (before the slow-test costs) that includes every `tests/cmake/*.cmake`, sorted, with `CONFIGURE_DEPENDS`. See `tests/cmake/README.md`. - `docs/experiments/`: new notes go in `docs/experiments/<topic>.md`; `docs/experiments.md` keeps the older ones. `tests/docs_links_check.py` already checks every tracked Markdown file, so the new folder is covered. - `windows.yml` + `tools/run_checks_parallel.py`: new option `--from-dir DIR` and helpers `read_check_files` / `merge_checks`. The `python-linux` step reads `tests/checks/python-linux/*.txt`; the `pixel-binary` step reads `tests/checks/pixel-binary/*.txt` (script plus arguments per line). The brief's windows/linux split does not match the file: the Windows jobs run CTest, so CMake fragments cover them. A missing directory, a script that does not exist, bad quoting or a duplicate command listed in the files fails loudly. A command also present in the inline list runs once. - The new reader test `tests/run_checks_fragments_check.py` is itself registered through `tests/checks/python-linux/run_checks_fragments.txt`. - AGENTS.md, CONTRIBUTING.md and docs/non-windows-hosts.md name the new places. This is a repo-layout choice and needs a maintainer decision (see the comment below). Nothing existing moves. Win2025 (exact head 9b51402f): `x2w_pipe.py win2025 2655 --py-checks tests/run_checks_fragments_check.py --keep-release` -> `run_checks_fragments_check ok`, rc=0 (see the updated receipt comment). The PR adds no CMake `add_test`. Verification (Linux): - `python3 -B tests/run_checks_fragments_check.py` -> `run_checks_fragments_check ok` - `python3 -B tests/run_checks_parallel_check.py` -> `run_checks_parallel_check: ok` - `python3 -B tests/run_checks_parallel_cli_check.py` -> 7 tests, OK - `python3 -B tests/docs_links_check.py` -> `Checked 23 Markdown files and 515 links.`; with a broken link added to `docs/experiments/README.md` it fails on `docs/experiments/README.md:11`, so the folder is scanned. - Check lists: inline entries before and after are the same (pixel-binary 107, python-linux 169). The pixel-binary step body run with the new runner calls resolves 107 checks (no file adds one). `--from-dir tests/checks/python-linux` -> `all 1 checks passed`. - `git diff --check` clean. - CMake: a full `cmake --preset` configure is not possible on Linux (it stops at `find_program(DXC_EXECUTABLE)`, line 1646, before the new block). So the exact block lines were copied into a small project with the same `add_test` wrapper header: `ctest -N` -> 1 test; with a throwaway `tests/cmake/zz_probe.cmake` -> 2 tests; file removed and reconfigured -> 1 test. The glob and `CONFIGURE_DEPENDS` work. Stage-2 is needed: this touches CI and CMake, so it needs a Win2025 WARP dev and release run (full configure, `ctest -N` count identical to `main`). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 01:02:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:41:17Z.


@R0Y00 @MasterDomino: do you want this layout? It adds optional per-file places (tests/cmake/*.cmake, tests/checks/<job>/*.txt, docs/experiments/<topic>.md) so new tests, checks and notes stop editing the same lines of CMakeLists.txt, windows.yml and docs/experiments.md. Nothing existing moves, so no open PR gets a new conflict. If you prefer another shape (or none), say so and I will change or close it. It stays Draft until a Win2025 run and your answer.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179013134 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2655#issuecomment-7179013134). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T00:41:17Z. --- @R0Y00 @MasterDomino: do you want this layout? It adds optional per-file places (`tests/cmake/*.cmake`, `tests/checks/<job>/*.txt`, `docs/experiments/<topic>.md`) so new tests, checks and notes stop editing the same lines of `CMakeLists.txt`, `windows.yml` and `docs/experiments.md`. Nothing existing moves, so no open PR gets a new conflict. If you prefer another shape (or none), say so and I will change or close it. It stays Draft until a Win2025 run and your answer. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-26 05:02:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T04:19:02Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 019e1c053b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068493156 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2655#pullrequestreview-6068493156). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T04:19:02Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `019e1c053b` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
tedin7 commented 2026-11-26 05:02:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:33:45Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068589729 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2655#pullrequestreview-6068589729). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:33:45Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-26 05:02:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:33:47Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068589909 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2655#pullrequestreview-6068589909). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:33:47Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-26 05:02:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:08:24Z.


Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 019e1c053bc4b7e74cadd88597f97ce7d0a84d58:

  • Windows Python checks: tests/run_checks_parallel_check.py ok (1.4s), tests/run_checks_fragments_check.py ok (2.2s), tests/docs_links_check.py ok (1.6s)
  • Wall: 20.1s
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182329060 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2655#issuecomment-7182329060). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:08:24Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `019e1c053bc4b7e74cadd88597f97ce7d0a84d58`: - **Windows Python checks**: `tests/run_checks_parallel_check.py` ok (`1.4s`), `tests/run_checks_fragments_check.py` ok (`2.2s`), `tests/docs_links_check.py` ok (`1.6s`) - Wall: `20.1s`
tedin7 commented 2026-11-26 05:02:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:08:25Z.


@R0Y00 @MasterDomino: #2655 is now Ready for review.

What changed since the question above: the listed-check splitter keeps Windows backslashes (it failed on Win2025 before), and main is merged in. Head 019e1c05.

Verification:

  • python3 tests/run_checks_fragments_check.py ok
  • Independent pre-review: PASS on this head
  • CI on 019e1c05: Linux checks, gfx1013 fixtures and Windows build all pass
  • Win2025 WARP dev + release PASS on 019e1c053bc4b7e74cadd88597f97ce7d0a84d58, with run_checks_parallel_check.py, run_checks_fragments_check.py and docs_links_check.py (receipt in the comment above)

If you prefer another layout, say so and I will change it.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182329423 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2655#issuecomment-7182329423). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:08:25Z. --- @R0Y00 @MasterDomino: #2655 is now Ready for review. What changed since the question above: the listed-check splitter keeps Windows backslashes (it failed on Win2025 before), and main is merged in. Head `019e1c05`. Verification: - `python3 tests/run_checks_fragments_check.py` ok - Independent pre-review: PASS on this head - CI on `019e1c05`: Linux checks, gfx1013 fixtures and Windows build all pass - Win2025 WARP dev + release PASS on `019e1c053bc4b7e74cadd88597f97ce7d0a84d58`, with `run_checks_parallel_check.py`, `run_checks_fragments_check.py` and `docs_links_check.py` (receipt in the comment above) If you prefer another layout, say so and I will change it. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-26 05:02:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T04:08:34Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T04:19:04.820702Z 019e1c0 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182331566 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2655#issuecomment-7182331566). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T04:08:34Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"019e1c053bc4b7e74cadd88597f97ce7d0a84d58","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-26T04:19:04.820702Z">2026-11-26T04:19:04.820702Z</relative-time> | `019e1c0` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
chatgpt-codex-connector[bot commented 2026-11-26 05:02:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T04:19:02Z.

Code review location: tools/run_checks_parallel.py; line 56

@@ -37,6 +42,67 @@ def _validate_script_path(raw_path: str) -> str:
     return raw_path
 
 
+def split_command(line, windows=None):
+    """Split a listed line like a shell would, but keep backslashes in Windows paths.
+
+    POSIX splitting treats a backslash as an escape and would turn `C:\\x2w\\a.py` into
+    `C:x2wa.py`. On Windows the line is split without escapes and matching quotes are removed.
+    """
+    if windows is None:
+        windows = os.name == "nt"
+    if not windows:
+        return shlex.split(line)
+    return [word[1:-1] if len(word) >= 2 and word[0] == word[-1] and word[0] in "\"'" else word
+            for word in shlex.split(line, posix=False)]

P2 Badge Preserve quoted option values in Windows commands

For a local Windows run, a fragment argument such as --llvm="C:\Program Files\LLVM\libLLVM.dll" is split at the space and retains literal quote characters, because non-POSIX shlex does not group quoted segments inside a token. This affects existing argument consumers: tests/compute_mimg_float_store_check.py --help documents --llvm LIBLLVM, but run_one() passes the malformed tokens directly to Python, so its parser rejects the extra argument instead of receiving one library path. Use tokenization that handles quoted segments within words while retaining Windows backslashes, and cover this case in the regression test.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4703841899 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2655#discussion_r4703841899). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T04:19:02Z. **Code review location:** `tools/run_checks_parallel.py`; line 56 ~~~~diff @@ -37,6 +42,67 @@ def _validate_script_path(raw_path: str) -> str: return raw_path +def split_command(line, windows=None): + """Split a listed line like a shell would, but keep backslashes in Windows paths. + + POSIX splitting treats a backslash as an escape and would turn `C:\\x2w\\a.py` into + `C:x2wa.py`. On Windows the line is split without escapes and matching quotes are removed. + """ + if windows is None: + windows = os.name == "nt" + if not windows: + return shlex.split(line) + return [word[1:-1] if len(word) >= 2 and word[0] == word[-1] and word[0] in "\"'" else word + for word in shlex.split(line, posix=False)] ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Preserve quoted option values in Windows commands** For a local Windows run, a fragment argument such as `--llvm="C:\Program Files\LLVM\libLLVM.dll"` is split at the space and retains literal quote characters, because non-POSIX `shlex` does not group quoted segments inside a token. This affects existing argument consumers: `tests/compute_mimg_float_store_check.py --help` documents `--llvm LIBLLVM`, but `run_one()` passes the malformed tokens directly to Python, so its parser rejects the extra argument instead of receiving one library path. Use tokenization that handles quoted segments within words while retaining Windows backslashes, and cover this case in the regression test. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot commented 2026-11-26 05:02:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T04:19:02Z.

Code review location: tests/run_checks_fragments_check.py; line 31

@@ -0,0 +1,92 @@
+"""The parallel check runner also runs the checks listed in a directory of text files."""
+import os
+import runpy
+import subprocess
+import sys
+import tempfile
+
+ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+RUNNER = os.path.join(ROOT, "tools", "run_checks_parallel.py")
+
+
+def run(*args):
+    return subprocess.run([sys.executable, "-B", RUNNER, "-j", "2", *args],
+                          stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
+
+
+def write(path, text):
+    with open(path, "w", encoding="utf-8") as handle:
+        handle.write(text)
+
+
+with tempfile.TemporaryDirectory() as tmp:
+    echo = os.path.join(tmp, "echo.py")
+    write(echo, "import sys\nprint('echo ran', *sys.argv[1:])\n")
+    lists = os.path.join(tmp, "lists")
+    os.mkdir(lists)
+
+    # Files are read in name order; comments, blank lines and README files are ignored; a line may
+    # carry arguments; a command also given on the command line runs once.
+    write(os.path.join(lists, "b.txt"), f"# note\n\n{echo} second\n")
+    write(os.path.join(lists, "a.txt"), f"{echo} first\n{echo}\n")

P2 Badge Quote temporary script paths in the generated manifests

When TMPDIR or TEMP points to an existing directory containing spaces, these manifests contain an unquoted absolute script path. read_check_files() consequently treats only the path's first portion as the script name and rejects it before any fixture command runs. I reproduced this by running the new check with a space-containing TMPDIR: it fails at the first success assertion with script path does not exist. The newly registered check therefore produces a false suite failure on those host configurations. Quote the script paths in all generated manifests, including the failure and duplicate cases.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4703841904 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2655#discussion_r4703841904). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T04:19:02Z. **Code review location:** `tests/run_checks_fragments_check.py`; line 31 ~~~~diff @@ -0,0 +1,92 @@ +"""The parallel check runner also runs the checks listed in a directory of text files.""" +import os +import runpy +import subprocess +import sys +import tempfile + +ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +RUNNER = os.path.join(ROOT, "tools", "run_checks_parallel.py") + + +def run(*args): + return subprocess.run([sys.executable, "-B", RUNNER, "-j", "2", *args], + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True) + + +def write(path, text): + with open(path, "w", encoding="utf-8") as handle: + handle.write(text) + + +with tempfile.TemporaryDirectory() as tmp: + echo = os.path.join(tmp, "echo.py") + write(echo, "import sys\nprint('echo ran', *sys.argv[1:])\n") + lists = os.path.join(tmp, "lists") + os.mkdir(lists) + + # Files are read in name order; comments, blank lines and README files are ignored; a line may + # carry arguments; a command also given on the command line runs once. + write(os.path.join(lists, "b.txt"), f"# note\n\n{echo} second\n") + write(os.path.join(lists, "a.txt"), f"{echo} first\n{echo}\n") ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Quote temporary script paths in the generated manifests** When `TMPDIR` or `TEMP` points to an existing directory containing spaces, these manifests contain an unquoted absolute script path. `read_check_files()` consequently treats only the path's first portion as the script name and rejects it before any fixture command runs. I reproduced this by running the new check with a space-containing `TMPDIR`: it fails at the first success assertion with `script path does not exist`. The newly registered check therefore produces a false suite failure on those host configurations. Quote the script paths in all generated manifests, including the failure and duplicate cases. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
tedin7 commented 2026-11-26 05:02:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:33:45Z.

Code review location: tools/run_checks_parallel.py; line 56

@@ -37,6 +42,67 @@ def _validate_script_path(raw_path: str) -> str:
     return raw_path
 
 
+def split_command(line, windows=None):
+    """Split a listed line like a shell would, but keep backslashes in Windows paths.
+
+    POSIX splitting treats a backslash as an escape and would turn `C:\\x2w\\a.py` into
+    `C:x2wa.py`. On Windows the line is split without escapes and matching quotes are removed.
+    """
+    if windows is None:
+        windows = os.name == "nt"
+    if not windows:
+        return shlex.split(line)
+    return [word[1:-1] if len(word) >= 2 and word[0] == word[-1] and word[0] in "\"'" else word
+            for word in shlex.split(line, posix=False)]

Confirmed and fixed in 9b51402f. On Windows, split_command now uses a small tokenizer: quotes group text inside a word (so --llvm="C:\Program Files\LLVM\x.dll" is one argument without quote characters) and backslashes are kept. POSIX still uses shlex.split. tests/run_checks_fragments_check.py covers both cases. It fails on the old code and passes now.

Commands run: python3 -B tests/run_checks_fragments_check.py; python3 tools/run_checks_parallel.py -j 4 tests/run_checks_fragments_check.py; git diff --check.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4703923201 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2655#discussion_r4703923201). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:33:45Z. **Code review location:** `tools/run_checks_parallel.py`; line 56 ~~~~diff @@ -37,6 +42,67 @@ def _validate_script_path(raw_path: str) -> str: return raw_path +def split_command(line, windows=None): + """Split a listed line like a shell would, but keep backslashes in Windows paths. + + POSIX splitting treats a backslash as an escape and would turn `C:\\x2w\\a.py` into + `C:x2wa.py`. On Windows the line is split without escapes and matching quotes are removed. + """ + if windows is None: + windows = os.name == "nt" + if not windows: + return shlex.split(line) + return [word[1:-1] if len(word) >= 2 and word[0] == word[-1] and word[0] in "\"'" else word + for word in shlex.split(line, posix=False)] ~~~~ --- Confirmed and fixed in 9b51402f. On Windows, `split_command` now uses a small tokenizer: quotes group text inside a word (so `--llvm="C:\Program Files\LLVM\x.dll"` is one argument without quote characters) and backslashes are kept. POSIX still uses `shlex.split`. `tests/run_checks_fragments_check.py` covers both cases. It fails on the old code and passes now. Commands run: `python3 -B tests/run_checks_fragments_check.py`; `python3 tools/run_checks_parallel.py -j 4 tests/run_checks_fragments_check.py`; `git diff --check`. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 05:02:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:33:47Z.

Code review location: tests/run_checks_fragments_check.py; line 31

@@ -0,0 +1,92 @@
+"""The parallel check runner also runs the checks listed in a directory of text files."""
+import os
+import runpy
+import subprocess
+import sys
+import tempfile
+
+ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+RUNNER = os.path.join(ROOT, "tools", "run_checks_parallel.py")
+
+
+def run(*args):
+    return subprocess.run([sys.executable, "-B", RUNNER, "-j", "2", *args],
+                          stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
+
+
+def write(path, text):
+    with open(path, "w", encoding="utf-8") as handle:
+        handle.write(text)
+
+
+with tempfile.TemporaryDirectory() as tmp:
+    echo = os.path.join(tmp, "echo.py")
+    write(echo, "import sys\nprint('echo ran', *sys.argv[1:])\n")
+    lists = os.path.join(tmp, "lists")
+    os.mkdir(lists)
+
+    # Files are read in name order; comments, blank lines and README files are ignored; a line may
+    # carry arguments; a command also given on the command line runs once.
+    write(os.path.join(lists, "b.txt"), f"# note\n\n{echo} second\n")
+    write(os.path.join(lists, "a.txt"), f"{echo} first\n{echo}\n")

Confirmed and fixed in 9b51402f. Every script path in the generated manifests (success, failure, missing, duplicate and two-file cases) is now quoted. The check also runs in a temp directory whose name contains a space, so it fails if a path is left unquoted. It fails without the quoting and passes now.

Commands run: python3 -B tests/run_checks_fragments_check.py; python3 tools/run_checks_parallel.py -j 4 tests/run_checks_fragments_check.py; git diff --check.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4703923353 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2655#discussion_r4703923353). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:33:47Z. **Code review location:** `tests/run_checks_fragments_check.py`; line 31 ~~~~diff @@ -0,0 +1,92 @@ +"""The parallel check runner also runs the checks listed in a directory of text files.""" +import os +import runpy +import subprocess +import sys +import tempfile + +ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +RUNNER = os.path.join(ROOT, "tools", "run_checks_parallel.py") + + +def run(*args): + return subprocess.run([sys.executable, "-B", RUNNER, "-j", "2", *args], + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True) + + +def write(path, text): + with open(path, "w", encoding="utf-8") as handle: + handle.write(text) + + +with tempfile.TemporaryDirectory() as tmp: + echo = os.path.join(tmp, "echo.py") + write(echo, "import sys\nprint('echo ran', *sys.argv[1:])\n") + lists = os.path.join(tmp, "lists") + os.mkdir(lists) + + # Files are read in name order; comments, blank lines and README files are ignored; a line may + # carry arguments; a command also given on the command line runs once. + write(os.path.join(lists, "b.txt"), f"# note\n\n{echo} second\n") + write(os.path.join(lists, "a.txt"), f"{echo} first\n{echo}\n") ~~~~ --- Confirmed and fixed in 9b51402f. Every script path in the generated manifests (success, failure, missing, duplicate and two-file cases) is now quoted. The check also runs in a temp directory whose name contains a space, so it fails if a path is left unquoted. It fails without the quoting and passes now. Commands run: `python3 -B tests/run_checks_fragments_check.py`; `python3 tools/run_checks_parallel.py -j 4 tests/run_checks_fragments_check.py`; `git diff --check`. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 06:02:08 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T05:43:51Z.


Updated Win2025 receipt: the earlier one built the targets but did not run this PR's tests. This one runs them by name.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 9b51402f9d0c5a3a6ec98dbb5210f6e863b0aba1:

  • Command: x2w_pipe.py win2025 2655 --py-checks tests/run_checks_fragments_check.py --keep-release (default slot pool)
  • The PR adds no CMake add_test. Its only check is the one listed in tests/checks/python-linux/run_checks_fragments.txt, so it is run by name.
  • Windows Python checks: tests/run_checks_fragments_check.py ok (rc=0, 1.5s)
  • No C++ build or ctest is involved (the CMake change is a fragment glob include only), so dev and release run the same Python check.
  • Wall: 11.8s

@MasterDomino ready for review/merge on this head.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7183753250 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2655#issuecomment-7183753250). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T05:43:51Z. --- Updated Win2025 receipt: the earlier one built the targets but did not run this PR's tests. This one runs them by name. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `9b51402f9d0c5a3a6ec98dbb5210f6e863b0aba1`: - Command: `x2w_pipe.py win2025 2655 --py-checks tests/run_checks_fragments_check.py --keep-release` (default slot pool) - The PR adds no CMake `add_test`. Its only check is the one listed in `tests/checks/python-linux/run_checks_fragments.txt`, so it is run by name. - **Windows Python checks**: `tests/run_checks_fragments_check.py` ok (`rc=0`, `1.5s`) - No C++ build or ctest is involved (the CMake change is a fragment glob include only), so dev and release run the same Python check. - Wall: `11.8s` @MasterDomino ready for review/merge on this head. AI-assisted; commands listed were executed locally.
R0Y00 commented 2026-11-26 06:04:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T06:04:27Z.

Review: APPROVED


Reviewed the additive registration and unchanged inline lists. On Windows with main 5f27d8cf combined, the fragment parser, existing parallel runner, docs and bidi checks passed. An inline/listed duplicate ran once via the CLI. A temporary CMake fragment registered a test through an ordinary release configure, and CTest listed and ran it. The temporary probe was removed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6069273274 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2655#pullrequestreview-6069273274). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T06:04:27Z. **Review:** APPROVED --- Reviewed the additive registration and unchanged inline lists. On Windows with main 5f27d8cf combined, the fragment parser, existing parallel runner, docs and bidi checks passed. An inline/listed duplicate ran once via the CLI. A temporary CMake fragment registered a test through an ordinary release configure, and CTest listed and ran it. The temporary probe was removed.
upstream-sync closed this pull request 2026-11-26 07:00:13 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2647
No description provided.