vk_pipeline_check: cap Windows isolation job commit #1391

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

@⁠WaltrBlackington on GitHub · 2026-11-24 23:10 UTC · original
WaltrBlackington:RT-PIPELINE-MEMORY-GUARD → main · +655 −33 · 8 files · 1 commits · open

Claimed in the coordination issue as: RT-PIPELINE-MEMORY-GUARD

Related issue: #636

Potential overlap: #1209 proposes a complementary Linux address-space limit. This PR does not depend on it, but both changes may touch the same CLI and documentation sections.

What and why

Isolated shader compilation can consume enough host memory to make the machine unresponsive.

This PR adds --isolate --memory-limit-mib N, an opt-in Windows Job Object limit on committed memory for each isolated child attempt.

  • Starts the child suspended and assigns it to the Job Object before execution.
  • Stops with a launcher error if the requested protection cannot be established.
  • Reports the configured limit, peak job commit in bytes, raw child exit status when available, and observed job memory-limit events.
  • Preserves batch subdivision, cache results, compiler failure accounting, and existing behavior when the option is omitted.
  • Adds bounded synthetic regression tests and documentation.

Windows memory-limit notifications are best-effort. Without a notification, limit involvement remains unconfirmed.

The limit applies to job-accounted host commit, not physical RAM, GPU memory, or system-wide commit. Allocation denial does not necessarily terminate a child or prevent a compiler hang.

An abrupt parent exit between suspended process creation and job assignment can leave a suspended child. After assignment, closing the job terminates its remaining processes.

Usage

vk_pipeline_check <spirv-dir> cache.bin --isolate --memory-limit-mib 8192

This example sets an 8 GiB committed-memory limit for each isolated child job.

  • The limit is specified in MiB and must be a positive integer.
  • The option requires --isolate and is currently supported only on Windows.
  • The limit applies to every isolated child attempt, including retries after batch subdivision.
  • Both full pipeline checks and selected shader ranges can use the memory limit in isolation mode.
  • The memory guard is disabled by default. When --memory-limit-mib is omitted, existing behavior remains unchanged.

Choose a limit that leaves sufficient memory headroom for the parent process, operating system, and other applications.

Additional details are available in docs/pipeline_check.md.

Tested

Verified commit cd4894b9875fe15e799f5771828974afe239099b on upstream base 0f98d193c5eaac6495d48c273a5db7194aab30d6.

Environment: Windows 11 Pro x64, build 26200, MSVC 19.44.35230.0, Windows SDK 10.0.26100.0.

  • Native CMake/MSVC build: passed.
  • Direct MSVC build and CLI verification: passed.
  • Focused CTests: 7/7 passed (pipeline_child_job, pipeline_child_job_nested, vk_pipeline_check_cli, vk_pipeline_check_stack, large_module_gate, pipeline_summary, pipeline_cache_seed).
  • CTest registration checks: 5/5 passed.
  • Index regression tests: 11/11 passed.
  • Synthetic Vulkan isolation tests: 11/11 passed.
  • No-game-data and whitespace checks: passed.

All 34 focused regression tests passed.

With a 512 MiB limit, all five synthetic Vulkan pipelines compiled successfully across three protected child attempts.

Batch Peak job commit Exit status
[0, 2) 79,982,592 bytes 0
[2, 4) 79,806,464 bytes 0
[4, 5) 77,664,256 bytes 0

Native Job Object tests exercised synthetic allocation denial. The Vulkan tests verified successful compilation under the configured limit but did not reproduce the original NVIDIA compiler failure or establish its cause.

Linux, macOS, MinGW, and Wine were not tested.

GPUs tested: NVIDIA GeForce RTX 2080 Ti, NVIDIA driver 621.35, Windows 11 Pro x64.

AI-assisted: Yes — OpenAI ChatGPT (GPT-6.2) and Codex CLI.

Checklist

  • Based on the latest fetched main and rebased cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption, including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md — not applicable to this checker-only change.
**@⁠WaltrBlackington** on GitHub · 2026-11-24 23:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1391) `WaltrBlackington:RT-PIPELINE-MEMORY-GUARD` → `main` · +655 −33 · 8 files · 1 commits · open Claimed in the coordination issue as: [RT-PIPELINE-MEMORY-GUARD](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) Related issue: #636 Potential overlap: #1209 proposes a complementary Linux address-space limit. This PR does not depend on it, but both changes may touch the same CLI and documentation sections. ### What and why Isolated shader compilation can consume enough host memory to make the machine unresponsive. This PR adds `--isolate --memory-limit-mib N`, an opt-in Windows Job Object limit on committed memory for each isolated child attempt. - Starts the child suspended and assigns it to the Job Object before execution. - Stops with a launcher error if the requested protection cannot be established. - Reports the configured limit, peak job commit in bytes, raw child exit status when available, and observed job memory-limit events. - Preserves batch subdivision, cache results, compiler failure accounting, and existing behavior when the option is omitted. - Adds bounded synthetic regression tests and documentation. Windows memory-limit notifications are best-effort. Without a notification, limit involvement remains unconfirmed. The limit applies to job-accounted host commit, not physical RAM, GPU memory, or system-wide commit. Allocation denial does not necessarily terminate a child or prevent a compiler hang. An abrupt parent exit between suspended process creation and job assignment can leave a suspended child. After assignment, closing the job terminates its remaining processes. ### Usage ```sh vk_pipeline_check <spirv-dir> cache.bin --isolate --memory-limit-mib 8192 ``` This example sets an 8 GiB committed-memory limit for each isolated child job. - The limit is specified in MiB and must be a positive integer. - The option requires `--isolate` and is currently supported only on Windows. - The limit applies to every isolated child attempt, including retries after batch subdivision. - Both full pipeline checks and selected shader ranges can use the memory limit in isolation mode. - The memory guard is disabled by default. When `--memory-limit-mib` is omitted, existing behavior remains unchanged. Choose a limit that leaves sufficient memory headroom for the parent process, operating system, and other applications. Additional details are available in `docs/pipeline_check.md`. ### Tested Verified commit `cd4894b9875fe15e799f5771828974afe239099b` on upstream base `0f98d193c5eaac6495d48c273a5db7194aab30d6`. Environment: Windows 11 Pro x64, build 26200, MSVC 19.44.35230.0, Windows SDK 10.0.26100.0. - Native CMake/MSVC build: passed. - Direct MSVC build and CLI verification: passed. - Focused CTests: 7/7 passed (`pipeline_child_job`, `pipeline_child_job_nested`, `vk_pipeline_check_cli`, `vk_pipeline_check_stack`, `large_module_gate`, `pipeline_summary`, `pipeline_cache_seed`). - CTest registration checks: 5/5 passed. - Index regression tests: 11/11 passed. - Synthetic Vulkan isolation tests: 11/11 passed. - No-game-data and whitespace checks: passed. All 34 focused regression tests passed. With a 512 MiB limit, all five synthetic Vulkan pipelines compiled successfully across three protected child attempts. | Batch | Peak job commit | Exit status | |---|---:|---:| | [0, 2) | 79,982,592 bytes | 0 | | [2, 4) | 79,806,464 bytes | 0 | | [4, 5) | 77,664,256 bytes | 0 | Native Job Object tests exercised synthetic allocation denial. The Vulkan tests verified successful compilation under the configured limit but did not reproduce the original NVIDIA compiler failure or establish its cause. Linux, macOS, MinGW, and Wine were not tested. GPUs tested: NVIDIA GeForce RTX 2080 Ti, NVIDIA driver 621.35, Windows 11 Pro x64. AI-assisted: Yes — OpenAI ChatGPT (GPT-6.2) and Codex CLI. ### Checklist - [x] Based on the latest fetched `main` and rebased cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption, including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md` — not applicable to this checker-only change.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:49:46 +00:00
This pull request has changes conflicting with the target branch.
  • runtime/test/vk_pipeline_check.cpp
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/1391/head:github-bot/gh-1391'
git switch 'github-bot/gh-1391'

Merge

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