Scripts: stop shader precompile at a private commit budget #1756

Open
github-bot wants to merge 1 commit from github-bot/gh-1756 into main AGit
Owner

@⁠NemesisDawn on GitHub · 2026-11-24 20:17 UTC · original
NemesisDawn:fix/precompile-commit-budget → main · +141 −0 · 3 files · 1 commits · open

Add an opt-in Windows wrapper for offline shader precompilation. It samples the XCL process’s private commit every 100 ms and stops it at a user-set threshold. Completed cache files stay available for the next run. Part of #1657.

What is in it

  • scripts/precompile-budget.ps1 launches and monitors XCL. The README shows how to use it, and scripts/precompile-budget.tests.ps1 exercises it with a native test process.

Tested

  • At f86b011, scripts/precompile-budget.tests.ps1 passed on Windows PowerShell 5.1 and PowerShell 7.6.9. A normal child preserved its arguments and exit code. A child allocating memory stopped with exit code 4 at a 74 MiB sample with a 48 MiB budget, leaving a completed fixture cache file intact.

Not tested

  • Retail shader pack, real XCL cache reuse, and the full Cargo workspace suite on a GPU.

AI use

  • OpenAI Codex (GPT-6, exact variant unavailable) wrote the patch and regression tests, ran the focused checks, and drafted this description.
**@⁠NemesisDawn** on GitHub · 2026-11-24 20:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/1756) `NemesisDawn:fix/precompile-commit-budget` → `main` · +141 −0 · 3 files · 1 commits · open Add an opt-in Windows wrapper for offline shader precompilation. It samples the XCL process’s private commit every 100 ms and stops it at a user-set threshold. Completed cache files stay available for the next run. Part of #1657. **What is in it** - `scripts/precompile-budget.ps1` launches and monitors XCL. The README shows how to use it, and `scripts/precompile-budget.tests.ps1` exercises it with a native test process. **Tested** - At `f86b011`, `scripts/precompile-budget.tests.ps1` passed on Windows PowerShell 5.1 and PowerShell 7.6.9. A normal child preserved its arguments and exit code. A child allocating memory stopped with exit code 4 at a 74 MiB sample with a 48 MiB budget, leaving a completed fixture cache file intact. **Not tested** - Retail shader pack, real XCL cache reuse, and the full Cargo workspace suite on a GPU. **AI use** - OpenAI Codex (GPT-6, exact variant unavailable) wrote the patch and regression tests, ran the focused checks, and drafted this description.
Sample the offline XCL process and stop it at a user-set threshold.
Keep completed cache files for the next run.

Assisted-by: OpenAI Codex (GPT-6, exact variant unavailable)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:03:58 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 21:14 UTC · original

Tested exact head f86b011, script tests only, since this PR has no test report yet.

Tested

  • Windows 11 Home 26300, Python 3.14.3 with pytest 9.0.3, Windows PowerShell 5.1.26100.9818 (no PowerShell 7 here).
  • powershell.exe -NoProfile -File scripts/precompile-budget.tests.ps1 at the head: exit 0, Both precompile budget checks passed. (it prints the stop message: XCL precompile stopped at 74 MiB private commit (limit 48 MiB)).
  • The PR's test file against current main's script (266b845): not applicable: precompile-budget.ps1 is new in this PR, so main has nothing for the test to run.

Not tested

  • PowerShell 7, the CI workflow itself, a game (no runtime code changed).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 21:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/1756#issuecomment-7144668741) Tested exact head `f86b011`, script tests only, since this PR has no test report yet. **Tested** - Windows 11 Home 26300, Python 3.14.3 with pytest 9.0.3, Windows PowerShell 5.1.26100.9818 (no PowerShell 7 here). - `powershell.exe -NoProfile -File scripts/precompile-budget.tests.ps1` at the head: exit 0, `Both precompile budget checks passed.` (it prints the stop message: `XCL precompile stopped at 74 MiB private commit (limit 48 MiB)`). - The PR's test file against current main's script (`266b845`): not applicable: `precompile-budget.ps1` is new in this PR, so main has nothing for the test to run. **Not tested** - PowerShell 7, the CI workflow itself, a game (no runtime code changed). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 23:04 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 23:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/1756#issuecomment-7146986264) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
Author
Owner

@⁠anes66 on GitHub · 2026-11-25 15:18 UTC · original

Independent Windows 10 CPU-only check of exact head f86b01177dee524b4382232efb3f220b6bbd2841: the checked-in synthetic wrapper tests passed in Windows PowerShell and PowerShell 7.

Tested

  • Windows 10 Pro 19045, Ryzen 7 9800X3D, Windows PowerShell 5.1.19041.7844 and PowerShell 7.6.9. The two scripts were extracted with git archive; both extracted file hashes match the Git blobs at this commit. The fixture was compiled with the installed .NET Framework C# compiler.
  • powershell.exe -NoProfile -ExecutionPolicy Bypass -File <scripts/precompile-budget.tests.ps1> and the equivalent pwsh.exe command: both exit 0 and print Both precompile budget checks passed.
  • Each shell checks the fast child's exact arguments (including quotes, a trailing backslash and an empty argument) and exit code 23, then a synthetic 64 MiB allocation with a 48 MiB sampling threshold. Both observed 74 MiB at termination, returned budget exit code 4, and preserved the completed fixture cache entry.
  • The initial Windows PowerShell attempt without the process-scoped execution-policy argument was blocked as an unsigned script; no test ran in that attempt. The passing commands above use a test-process-only exception. No persistent execution policy or other system setting changed.

Not tested
Real XCL, a shader pack, cache reuse by XCL, a title, GPU execution, Cargo suite, cancellation/error cleanup paths or a hard memory ceiling. The 74 MiB sample with a 48 MiB threshold confirms the documented sampling overshoot; it is not a hard commit cap.

**@⁠anes66** on GitHub · 2026-11-25 15:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/1756#issuecomment-7166622259) Independent Windows 10 CPU-only check of exact head `f86b01177dee524b4382232efb3f220b6bbd2841`: the checked-in synthetic wrapper tests passed in Windows PowerShell and PowerShell 7. **Tested** - Windows 10 Pro 19045, Ryzen 7 9800X3D, Windows PowerShell 5.1.19041.7844 and PowerShell 7.6.9. The two scripts were extracted with `git archive`; both extracted file hashes match the Git blobs at this commit. The fixture was compiled with the installed .NET Framework C# compiler. - `powershell.exe -NoProfile -ExecutionPolicy Bypass -File <scripts/precompile-budget.tests.ps1>` and the equivalent `pwsh.exe` command: both exit 0 and print `Both precompile budget checks passed`. - Each shell checks the fast child's exact arguments (including quotes, a trailing backslash and an empty argument) and exit code 23, then a synthetic 64 MiB allocation with a 48 MiB sampling threshold. Both observed **74 MiB** at termination, returned budget exit code **4**, and preserved the completed fixture cache entry. - The initial Windows PowerShell attempt without the process-scoped execution-policy argument was blocked as an unsigned script; no test ran in that attempt. The passing commands above use a test-process-only exception. No persistent execution policy or other system setting changed. **Not tested** Real XCL, a shader pack, cache reuse by XCL, a title, GPU execution, Cargo suite, cancellation/error cleanup paths or a hard memory ceiling. The 74 MiB sample with a 48 MiB threshold confirms the documented sampling overshoot; it is not a hard commit cap.
Author
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-25 18:06 UTC · original · edited 2026-11-25 18:12 UTC

Tested cancellation at f86b01177dee524b4382232efb3f220b6bbd2841 on Windows 11 (26100.9711), using the unmodified wrapper and a small synthetic .NET child. The child wrote a completed cache sentinel and its PID, then slept for up to 15 seconds. I verified the live process's executable path before stopping the calling PowerShell pipeline.

Shell Pipeline stop and observed child exit Completed sentinel
Windows PowerShell 5.1.26100.9711 58 ms Original contents
PowerShell 7.6.9 28 ms Original contents

Both runspaces reported Stopped. In both shells the normal short-lived fixture returned its exit code 23, and the missing-input and missing-executable cases returned path errors before launching the child. This checked ordinary pipeline cancellation below a 256 MiB threshold. No live XCL process, shader pack, GPU, retail game, forced host termination or memory-pressure run. OpenAI Codex (GPT-6) ran these checks and wrote this report.

**@⁠RavenCurseBurg** on GitHub · 2026-11-25 18:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/1756#issuecomment-7170452621) · edited 2026-11-25 18:12 UTC Tested cancellation at `f86b01177dee524b4382232efb3f220b6bbd2841` on Windows 11 (26100.9711), using the unmodified wrapper and a small synthetic .NET child. The child wrote a completed cache sentinel and its PID, then slept for up to 15 seconds. I verified the live process's executable path before stopping the calling PowerShell pipeline. | Shell | Pipeline stop and observed child exit | Completed sentinel | | --- | --- | --- | | Windows PowerShell 5.1.26100.9711 | 58 ms | Original contents | | PowerShell 7.6.9 | 28 ms | Original contents | Both runspaces reported `Stopped`. In both shells the normal short-lived fixture returned its exit code 23, and the missing-input and missing-executable cases returned path errors before launching the child. This checked ordinary pipeline cancellation below a 256 MiB threshold. No live XCL process, shader pack, GPU, retail game, forced host termination or memory-pressure run. OpenAI Codex (GPT-6) ran these checks and wrote this report.
This pull request has changes conflicting with the target branch.
  • README.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1756/head:github-bot/gh-1756'
git switch 'github-bot/gh-1756'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1756'
git switch 'github-bot/gh-1756'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1756'
git switch 'github-bot/gh-1756'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1756'
git switch 'main'
git merge --squash 'github-bot/gh-1756'
git switch 'main'
git merge --ff-only 'github-bot/gh-1756'
git switch 'main'
git merge 'github-bot/gh-1756'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.