tooling: run dxc_cache_check on Windows with a .cmd fake compiler #2795

Merged
RenzoWit35 merged 1 commit from upstream-pr/2803 into main 2026-11-26 11:09:16 +00:00
RenzoWit35 commented 2026-11-26 11:00:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RenzoWit35 on 2026-11-26T11:00:19Z.


Change

tests/dxc_cache_check.py wrote its fake compiler fakedxc as a #!/usr/bin/env python3 script and ran it through tools/dxc_cache.py run_dxc. On Windows that fails with OSError: [WinError 193], so this pure-Python check could not run locally on Windows.

On os.name == "nt" the check now writes the fake script as fakedxc_impl.py and a fakedxc.cmd wrapper (@"<sys.executable>" "<script>" %*) and uses the wrapper as the compiler. The POSIX path is unchanged (same file name, shebang and execute bit). The tool is unchanged: run_dxc passes a list argv to subprocess.run, and the cache key uses the compiler path, size and mtime, so the .cmd file is fingerprinted like the script. Every hit/miss assertion runs on both platforms; nothing is skipped.

Verification

Windows, Python from out/pe-env:

  • Before (the check from origin/main): python -B tests/dxc_cache_check.py ends in OSError: [WinError 193] (message shown in Dutch locale: "%1 is geen geldige Win32-toepassing").
  • After: python -B tests/dxc_cache_check.py prints dxc_cache_check: ok.
  • After: python -B tools/run_checks_parallel.py tests/dxc_cache_check.py prints all 1 checks passed.
  • Negative control on Windows: a scratch copy of tools/dxc_cache.py whose cache lookup always misses (the loaded entry is discarded), run with the new check from a scratch directory, fails with dxc_cache_check: identical compile ran 2 real calls, expected 1. The tracked tools/dxc_cache.py was not edited.

Evidence and follow-up

Not run on Linux or macOS here. The POSIX branch is the previous code unchanged. The Windows run takes about 25 seconds because every fake compile starts cmd and Python.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6625186860 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2803). Originally posted by [RenzoWit35](https://github.com/RenzoWit35) on 2026-11-26T11:00:19Z. --- ## Change `tests/dxc_cache_check.py` wrote its fake compiler `fakedxc` as a `#!/usr/bin/env python3` script and ran it through `tools/dxc_cache.py` `run_dxc`. On Windows that fails with `OSError: [WinError 193]`, so this pure-Python check could not run locally on Windows. On `os.name == "nt"` the check now writes the fake script as `fakedxc_impl.py` and a `fakedxc.cmd` wrapper (`@"<sys.executable>" "<script>" %*`) and uses the wrapper as the compiler. The POSIX path is unchanged (same file name, shebang and execute bit). The tool is unchanged: `run_dxc` passes a list argv to `subprocess.run`, and the cache key uses the compiler path, size and mtime, so the `.cmd` file is fingerprinted like the script. Every hit/miss assertion runs on both platforms; nothing is skipped. ## Verification Windows, Python from `out/pe-env`: - Before (the check from `origin/main`): `python -B tests/dxc_cache_check.py` ends in `OSError: [WinError 193]` (message shown in Dutch locale: "%1 is geen geldige Win32-toepassing"). - After: `python -B tests/dxc_cache_check.py` prints `dxc_cache_check: ok`. - After: `python -B tools/run_checks_parallel.py tests/dxc_cache_check.py` prints `all 1 checks passed`. - Negative control on Windows: a scratch copy of `tools/dxc_cache.py` whose cache lookup always misses (the loaded entry is discarded), run with the new check from a scratch directory, fails with `dxc_cache_check: identical compile ran 2 real calls, expected 1`. The tracked `tools/dxc_cache.py` was not edited. ## Evidence and follow-up Not run on Linux or macOS here. The POSIX branch is the previous code unchanged. The Windows run takes about 25 seconds because every fake compile starts cmd and Python. AI-assisted.
upstream-sync closed this pull request 2026-11-26 12:04:43 +00:00
tedin7 commented 2026-11-26 12:04:44 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Review of head 1feeae46 (comment only).

Checked against origin/main:

  • Only tests/dxc_cache_check.py changes. The POSIX branch is identical to before (same file name, shebang, execute bit). On Windows the fake compiler is a .cmd wrapper that runs fakedxc_impl.py with sys.executable; %%* correctly yields %*, so all arguments reach the script.
  • tools/dxc_cache.py is untouched; the cache key uses compiler path, size and mtime, so the .cmd is fingerprinted the same way. Every hit/miss assertion runs on both platforms, nothing is skipped.
  • No other open or merged PR touches this check.

Commands run locally (Linux):

  • python3 -B tests/dxc_cache_check.py: dxc_cache_check: ok
  • git diff --check origin/main...HEAD: clean

The Windows run follows in a receipt.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6073074728 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2803#pullrequestreview-6073074728). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T11:08:55Z. **Review:** COMMENTED --- Review of head 1feeae46 (comment only). Checked against origin/main: - Only `tests/dxc_cache_check.py` changes. The POSIX branch is identical to before (same file name, shebang, execute bit). On Windows the fake compiler is a `.cmd` wrapper that runs `fakedxc_impl.py` with `sys.executable`; `%%*` correctly yields `%*`, so all arguments reach the script. - `tools/dxc_cache.py` is untouched; the cache key uses compiler path, size and mtime, so the `.cmd` is fingerprinted the same way. Every hit/miss assertion runs on both platforms, nothing is skipped. - No other open or merged PR touches this check. Commands run locally (Linux): - `python3 -B tests/dxc_cache_check.py`: `dxc_cache_check: ok` - `git diff --check origin/main...HEAD`: clean The Windows run follows in a receipt. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 12:04:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:09:12Z.


Win2025 WARP receipt for head 1feeae46.

real-GPU run not available (RunPod stopped); not a shader change.

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

  • Windows Python checks: tests/dxc_cache_check.py ok (1.6s)
  • Wall: 6.6s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7190342795 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2803#issuecomment-7190342795). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T11:09:12Z. --- Win2025 WARP receipt for head 1feeae46. real-GPU run not available (RunPod stopped); not a shader change. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `1feeae46757d0092a25ec1a979e1b016f2c164d5`: - **Windows Python checks**: `tests/dxc_cache_check.py` ok (`1.6s`) - Wall: `6.6s` AI-assisted; commands listed were executed locally.
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!2795
No description provided.