build,hle,docs: bound parallel DXC builds, support LARP_LICENSES, and auto-set NVIDIA shader heap #531

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

@⁠ZerefDragnee1l on GitHub · 2026-12-06 01:56 UTC · original
ZerefDragnee1l:build/bounded-parallel-dxc-addons-and-auto-nvprofile → main · +196 −20 · 7 files · 1 commits · open

Splits the remaining build, subrender guard, and docs improvements out of #408 onto current main, addresses @⁠vanya890's build-memory feedback (#249), and adds opt-in offline add-on licensing + automatic Windows NVIDIA shader heap configuration.

Summary

  • Bounded parallel DXC builds (apps/larp/build.rs, Cargo.toml):
    • Compiles pending replacement HLSL shaders across a bounded worker pool defaulting to min(available_parallelism, 4) (overridable via LARP_DXC_JOBS, clamped 1..=16).
    • Partitions heavy shaders (> 150 KiB, including 191ecaed66eea3b1.compute.hlsl from #249) to compile serially outside the worker pool so multiple large dxc invocations never stack peak host RAM concurrently.
    • Sets codegen-units = 1 in [profile.release] (keeping lto = "thin" and diagnostics compatibility).
  • Subrender safety guard (apps/larp/src/subrender.rs): Guards dirty_words row length and bounds before indexing.
  • Offline add-on license toggle (crates/larp-hle/src/modules/xstore.rs):
    • Defaults to not owned (unchanged) unless LARP_LICENSES is set (all, *, or comma/semicolon/whitespace-separated Store IDs, case-insensitive; e.g. granting Ultimate Edition Upgrade & Vice City Pack offline).
    • Adds unit test larps_licenses_env_controls_durable_ownership.
  • Automatic Windows NVIDIA shader heap (apps/larp/src/nvprofile.rs, apps/larp/src/run.rs):
    • Best-effort silent startup helper ensure_default_heap_silent() ensures 0x001ABC0F is at least 1024 MiB on native Windows when NVIDIA DRS is present (skipping writes if already >= 1024 MiB, quietly ignoring permission/no-NVIDIA conditions, and opt-out via LARP_NO_AUTO_NVPROFILE=1).
  • Documentation (docs/environment-variables.md): Documents --card-budget, LARP_ALIAS_SHARE, LARP_CORES, LARP_DSTORAGE_CACHE_GB, LARP_RT_WHOLE, LARP_SHADER_OPT, LARP_SKIP_PIPELINES, LARP_DXC_JOBS, LARP_LICENSES, and LARP_NO_AUTO_NVPROFILE.

Related: #249, #421

Verification

  • git diff --check -> clean
  • cargo check -p larp -> exited 0
  • cargo test -p larp-hle --lib xstore -> 1 passed; 0 failed; 0 ignored; 81 filtered out (larps_licenses_env_controls_durable_ownership).
**@⁠ZerefDragnee1l** on GitHub · 2026-12-06 01:56 UTC · [original](https://github.com/gamingwithhomie/larp/pull/531) `ZerefDragnee1l:build/bounded-parallel-dxc-addons-and-auto-nvprofile` → `main` · +196 −20 · 7 files · 1 commits · open Splits the remaining build, subrender guard, and docs improvements out of #408 onto current `main`, addresses @⁠vanya890's build-memory feedback (#249), and adds opt-in offline add-on licensing + automatic Windows NVIDIA shader heap configuration. ### Summary - **Bounded parallel DXC builds (`apps/larp/build.rs`, `Cargo.toml`)**: - Compiles pending replacement HLSL shaders across a bounded worker pool defaulting to `min(available_parallelism, 4)` (overridable via `LARP_DXC_JOBS`, clamped `1..=16`). - Partitions heavy shaders (`> 150 KiB`, including `191ecaed66eea3b1.compute.hlsl` from #249) to compile **serially** outside the worker pool so multiple large `dxc` invocations never stack peak host RAM concurrently. - Sets `codegen-units = 1` in `[profile.release]` (keeping `lto = "thin"` and diagnostics compatibility). - **Subrender safety guard (`apps/larp/src/subrender.rs`)**: Guards `dirty_words` row length and bounds before indexing. - **Offline add-on license toggle (`crates/larp-hle/src/modules/xstore.rs`)**: - Defaults to not owned (unchanged) unless `LARP_LICENSES` is set (`all`, `*`, or comma/semicolon/whitespace-separated Store IDs, case-insensitive; e.g. granting Ultimate Edition Upgrade & Vice City Pack offline). - Adds unit test `larps_licenses_env_controls_durable_ownership`. - **Automatic Windows NVIDIA shader heap (`apps/larp/src/nvprofile.rs`, `apps/larp/src/run.rs`)**: - Best-effort silent startup helper `ensure_default_heap_silent()` ensures `0x001ABC0F` is at least `1024 MiB` on native Windows when NVIDIA DRS is present (skipping writes if already `>= 1024 MiB`, quietly ignoring permission/no-NVIDIA conditions, and opt-out via `LARP_NO_AUTO_NVPROFILE=1`). - **Documentation (`docs/environment-variables.md`)**: Documents `--card-budget`, `LARP_ALIAS_SHARE`, `LARP_CORES`, `LARP_DSTORAGE_CACHE_GB`, `LARP_RT_WHOLE`, `LARP_SHADER_OPT`, `LARP_SKIP_PIPELINES`, `LARP_DXC_JOBS`, `LARP_LICENSES`, and `LARP_NO_AUTO_NVPROFILE`. Related: #249, #421 ### Verification - `git diff --check` -> clean - `cargo check -p larp` -> exited 0 - `cargo test -p larp-hle --lib xstore` -> `1 passed; 0 failed; 0 ignored; 81 filtered out` (`larps_licenses_env_controls_durable_ownership`).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-06 02:01:34 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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