[PR #1391] vk_pipeline_check: cap Windows isolation job commit #1422

Open
opened 2026-11-26 20:21:12 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1391
Author: @WaltrBlackington
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: RT-PIPELINE-MEMORY-GUARD


📝 Commits (1)

  • cd4894b vk_pipeline_check: cap Windows isolation job commit (RT-PIPELINE-MEMORY-GUARD)

📊 Changes

8 files changed (+655 additions, -33 deletions)

View changed files

📝 docs/pipeline_check.md (+45 -1)
📝 runtime/CMakeLists.txt (+9 -0)
📝 runtime/test/check_vk_pipeline_cli.cmake (+55 -2)
➕ runtime/test/pipeline_child_job.h (+159 -0)
➕ runtime/test/pipeline_child_job_test.cpp (+249 -0)
➕ runtime/test/pipeline_isolation_retry.h (+47 -0)
📝 runtime/test/vk_pipeline_check.cpp (+77 -30)
📝 tests/test_vk_pipeline_check_isolate.py (+14 -0)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1391 **Author:** [@WaltrBlackington](https://github.com/WaltrBlackington) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `RT-PIPELINE-MEMORY-GUARD` --- ### 📝 Commits (1) - [`cd4894b`](https://github.com/ubiquitarianism/leonida/commit/cd4894b9875fe15e799f5771828974afe239099b) vk_pipeline_check: cap Windows isolation job commit (RT-PIPELINE-MEMORY-GUARD) ### 📊 Changes **8 files changed** (+655 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `docs/pipeline_check.md` (+45 -1) 📝 `runtime/CMakeLists.txt` (+9 -0) 📝 `runtime/test/check_vk_pipeline_cli.cmake` (+55 -2) ➕ `runtime/test/pipeline_child_job.h` (+159 -0) ➕ `runtime/test/pipeline_child_job_test.cpp` (+249 -0) ➕ `runtime/test/pipeline_isolation_retry.h` (+47 -0) 📝 `runtime/test/vk_pipeline_check.cpp` (+77 -30) 📝 `tests/test_vk_pipeline_check_isolate.py` (+14 -0) </details> ### 📄 Description Claimed in the coordination issue as: [RT-PIPELINE-MEMORY-GUARD](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140965495) 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1422
No description provided.