vk_pipeline_check: cap Linux isolation worker address space (PIPELINE-LINUX-ISOLATE-AS-LIMIT) #1209

Closed
lixonik wants to merge 1 commit from upstream-pr/1209 into main
lixonik commented 2026-11-24 20:17:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-24T20:17:44Z.


Claimed in the coordination issue as PIPELINE-LINUX-ISOLATE-AS-LIMIT.

Refs #636.

What and why

An isolated Vulkan compiler process can still exhaust host memory. That happened in the Linux run reported in #636 even with --isolate enabled.

On Linux, vk_pipeline_check --isolate --isolate-address-space-mib N applies an opt-in RLIMIT_AS cap before each worker opens Vulkan. A stricter inherited limit is honored. The parent still runs with its inherited limit and uses the existing failure and bisection paths. The cap includes virtual mappings as well as allocated memory, so users can choose a budget appropriate for their driver.

Tested

  • Linux GCC build. A synthetic loader in the real isolation child observed a 64 MiB cap, accepted a 1 MiB mapping and received ENOMEM for an 80 MiB mapping. The same 80 MiB mapping worked with the option omitted. Tested both stricter inherited limits and a requested limit below the inherited one. A syscall trace confirmed that only the child set the limit.
  • Windows MSVC build. Both checker CTest tests and all 11 checker index tests passed. The Linux-only option exits with a usage error on Windows.
  • All 6,141 translator semantic tests and 16 documentation link tests passed. git diff --check and the game-data check passed.

GPUs tested: n/a (CPU-only synthetic checks).

AI-assisted.

Checklist

  • Based on current main.
  • One topic.
  • No game data, keys or decryption.
  • No translator rule change.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5479638893 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1209). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-24T20:17:44Z. --- Claimed in the coordination issue as [PIPELINE-LINUX-ISOLATE-AS-LIMIT](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143205150). Refs #636. ### What and why An isolated Vulkan compiler process can still exhaust host memory. That happened in the Linux run reported in #636 even with `--isolate` enabled. On Linux, `vk_pipeline_check --isolate --isolate-address-space-mib N` applies an opt-in `RLIMIT_AS` cap before each worker opens Vulkan. A stricter inherited limit is honored. The parent still runs with its inherited limit and uses the existing failure and bisection paths. The cap includes virtual mappings as well as allocated memory, so users can choose a budget appropriate for their driver. ### Tested - Linux GCC build. A synthetic loader in the real isolation child observed a 64 MiB cap, accepted a 1 MiB mapping and received ENOMEM for an 80 MiB mapping. The same 80 MiB mapping worked with the option omitted. Tested both stricter inherited limits and a requested limit below the inherited one. A syscall trace confirmed that only the child set the limit. - Windows MSVC build. Both checker CTest tests and all 11 checker index tests passed. The Linux-only option exits with a usage error on Windows. - All 6,141 translator semantic tests and 16 documentation link tests passed. `git diff --check` and the game-data check passed. GPUs tested: n/a (CPU-only synthetic checks). AI-assisted. ### Checklist - [x] Based on current `main`. - [x] One topic. - [x] No game data, keys or decryption. - [x] No translator rule change.
PierreEbele commented 2026-11-25 07:08:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T07:08:19Z.


Reviewed f6c9e7c1: built the tool on the PR and on main and ran the extended CLI battery (passes on the
PR build, fails on main at the new checks as it should), the old battery (passes - no regression) and
the 10 --isolate Python tests (OK on both builds on llvmpipe). Probe: the limit bites in the child
before libvulkan loads (1 MiB), stops setup cleanly at 64 MiB, a max value runs identically to no flag,
the parent classifies the limit-induced death as a setup failure rather than a MODULE CRASH, and a
stricter inherited limit wins with no setrlimit error. No findings.
AI-assisted review.

Recommendation: Merge

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7155529115 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1209#issuecomment-7155529115). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T07:08:19Z. --- Reviewed f6c9e7c1: built the tool on the PR and on main and ran the extended CLI battery (passes on the PR build, fails on main at the new checks as it should), the old battery (passes - no regression) and the 10 `--isolate` Python tests (OK on both builds on llvmpipe). Probe: the limit bites in the child before libvulkan loads (1 MiB), stops setup cleanly at 64 MiB, a max value runs identically to no flag, the parent classifies the limit-induced death as a setup failure rather than a MODULE CRASH, and a stricter inherited limit wins with no setrlimit error. No findings. AI-assisted review. **Recommendation:** Merge
merzleckeier commented 2026-11-28 21:08:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-28T21:08:42Z.


Physical NVIDIA cross-check for f6c9e7c1 merged locally into main at aa918e5d9. CachyOS 7.3.6-3, RTX 4070 SUPER, NVIDIA 620.73.04. I used one SPIR-V-validated no-op compute shader, the NVIDIA ICD and vk_pipeline_check <fixture-dir> --jobs 1 --isolate --isolate-batch 1.

  • The no-limit run created one pipeline with zero failures on both builds. Running the PR with --isolate-address-space-mib 1048576 produced identical result counts and exit 0.
  • With --isolate-address-space-mib 64, the base returned 2 for the unknown option. The PR returned 1 with a child process failed during setup (exit status 1) and no MODULE CRASH or shader failures.
  • CTest vk_pipeline_check_cli passed on the merged build.

Synthetic shader only. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7245803852 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1209#issuecomment-7245803852). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-11-28T21:08:42Z. --- Physical NVIDIA cross-check for `f6c9e7c1` merged locally into `main` at `aa918e5d9`. CachyOS 7.3.6-3, RTX 4070 SUPER, NVIDIA 620.73.04. I used one SPIR-V-validated no-op compute shader, the NVIDIA ICD and `vk_pipeline_check <fixture-dir> --jobs 1 --isolate --isolate-batch 1`. - The no-limit run created one pipeline with zero failures on both builds. Running the PR with `--isolate-address-space-mib 1048576` produced identical result counts and exit `0`. - With `--isolate-address-space-mib 64`, the base returned `2` for the unknown option. The PR returned `1` with `a child process failed during setup (exit status 1)` and no `MODULE CRASH` or shader failures. - CTest `vk_pipeline_check_cli` passed on the merged build. Synthetic shader only. AI-assisted.
OreoFR commented 2026-11-28 21:47:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:47:42Z.


Verified by OreoFR

  • Base: main c1ecf04ed + PR head f6c9e7c1b; green run in a merge package of 12 PRs, no new ctest failure vs main
  • Test: ctest -R ^vk_pipeline_check_cli$
  • Red on main: failure ("unknown option --isolate-address-space-mib" instead of the expected usage error)
  • Green with the PR: OK
  • Verdict: READY (the address-space limit itself is Linux-only, not exercised here)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246277825 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1209#issuecomment-7246277825). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:47:42Z. --- **Verified by OreoFR** - Base: main `c1ecf04ed` + PR head `f6c9e7c1b`; green run in a merge package of 12 PRs, no new ctest failure vs main - Test: `ctest -R ^vk_pipeline_check_cli$` - Red on main: failure ("unknown option --isolate-address-space-mib" instead of the expected usage error) - Green with the PR: OK - Verdict: READY (the address-space limit itself is Linux-only, not exercised here) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
zmasi commented 2026-11-29 01:25:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T01:25:49Z.


Windows 11 + MSVC 19.44 Verification — PASS (f6c9e7c1ba)

Verified f6c9e7c1ba (PIPELINE-LINUX-ISOLATE-AS-LIMIT) merged onto origin/main (5825b02ff8 / 53b77df14f, 0 conflicts, including a clean 3-way merge alongside #1514 across vk_pipeline_check.cpp, check_vk_pipeline_cli.cmake, and docs/pipeline_check.md) on native Windows 11 (10.0.26200.9974) with MSVC 19.44.35228.

Checks Run

  • MSVC /W4 compilation: runtime/test/vk_pipeline_check.cpp compiled cleanly on Windows x64 (/std:c++20 /O2 /MD /EHsc /W4 /permissive- /utf-8).
  • Red -> Green CLI validation (check_vk_pipeline_cli.cmake + Windows --isolate guard):
    • Red (origin/main vk_pipeline_check.exe): cmake -P runtime/test/check_vk_pipeline_cli.cmake failed (rc=1, --isolate-address-space-mib unrecognized).
    • Green (#1209 + origin/main vk_pipeline_check.exe):
      • cmake -P runtime/test/check_vk_pipeline_cli.cmake: rc=0 (rejects missing argument, 0, -1, 17592186044416 uint64_t MiB-to-bytes overflow, and --isolate-address-space-mib 64 without --isolate with "--isolate-address-space-mib requires --isolate").
      • Windows platform guard (vk_pipeline_check <dir> --isolate --isolate-address-space-mib 64): exited 2 before opening Vulkan or spawning children with "--isolate-address-space-mib is supported only on Linux".
  • Documentation & registration suites: tests/test_docs_table_rows.py, tests/test_docs_encoding.py, tests/test_ctest_registration.py, and tests/test_ci_registration.py all passed (rc=0), and tests/test_docs_cli_flags.py reported 0 issues on --isolate-address-space-mib.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248776880 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1209#issuecomment-7248776880). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T01:25:49Z. --- ## Windows 11 + MSVC `19.44` Verification — PASS (`f6c9e7c1ba`) Verified `f6c9e7c1ba` (`PIPELINE-LINUX-ISOLATE-AS-LIMIT`) merged onto `origin/main` (`5825b02ff8` / `53b77df14f`, `0` conflicts, including a clean 3-way merge alongside `#1514` across `vk_pipeline_check.cpp`, `check_vk_pipeline_cli.cmake`, and `docs/pipeline_check.md`) on native Windows 11 (`10.0.26200.9974`) with MSVC `19.44.35228`. ### Checks Run - **MSVC `/W4` compilation**: `runtime/test/vk_pipeline_check.cpp` compiled cleanly on Windows x64 (`/std:c++20 /O2 /MD /EHsc /W4 /permissive- /utf-8`). - **Red -> Green CLI validation (`check_vk_pipeline_cli.cmake` + Windows `--isolate` guard)**: - **Red (`origin/main` `vk_pipeline_check.exe`)**: `cmake -P runtime/test/check_vk_pipeline_cli.cmake` failed (`rc=1`, `--isolate-address-space-mib` unrecognized). - **Green (`#1209 + origin/main` `vk_pipeline_check.exe`)**: - `cmake -P runtime/test/check_vk_pipeline_cli.cmake`: **`rc=0`** (rejects missing argument, `0`, `-1`, `17592186044416` `uint64_t` MiB-to-bytes overflow, and `--isolate-address-space-mib 64` without `--isolate` with `"--isolate-address-space-mib requires --isolate"`). - Windows platform guard (`vk_pipeline_check <dir> --isolate --isolate-address-space-mib 64`): exited **`2`** before opening Vulkan or spawning children with `"--isolate-address-space-mib is supported only on Linux"`. - **Documentation & registration suites**: `tests/test_docs_table_rows.py`, `tests/test_docs_encoding.py`, `tests/test_ctest_registration.py`, and `tests/test_ci_registration.py` all passed (`rc=0`), and `tests/test_docs_cli_flags.py` reported `0` issues on `--isolate-address-space-mib`. AI-assisted.
aslan2142 commented 2026-12-01 17:22:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T17:22:20Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7319192939 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1209#issuecomment-7319192939). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T17:22:20Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

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
ProjectLeonida/mandy!1209
No description provided.