xcl run: xcl nvprofile puts xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2580

Open
afpruivo wants to merge 1 commit from upstream-pr/2590 into main
afpruivo commented 2026-11-26 00:47:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by afpruivo on 2026-11-26T00:47:06Z.


NVIDIA's D3D12 driver reserves 512 MB of VA for the machine code of the pipelines in use and removes the device (0x887a0005) when a submission needs more (#2403). Setting 0x001ABC0F in a driver profile raises that reserve; NVIDIA's own profiles use 1 or 2 GiB for big titles. This adds xcl nvprofile, which writes that one setting for xcl.exe through NVAPI, so users don't have to find it in Profile Inspector. Part of #2403. The measurements are in my comment there.

It is opt-in and changes nothing at run time: nothing happens unless the user runs the command. It moves the wall and does not replace using less code (#2526, #1901, #2496).

What is in it

  • crates/xcl/src/gpu/nvprofile.rs (new): nvapi64.dll through nvapi_QueryInterface, NvAPI_DRS_*. install puts the exe into a profile of its own, XCL (xcl-dev), holding only this setting, so remove deletes exactly that. status reads what the driver will use. Before install reuses a profile of that name or remove deletes it, both check that it holds nothing but xcl.exe and this setting (NvAPI_DRS_GetProfileInfo, NvAPI_DRS_EnumApplications), and refuse otherwise, so a same-name profile someone else made is left alone. Tests: the NVAPI struct sizes, the command line, the ownership rule.
  • crates/xcl/src/main.rs: the xcl nvprofile [status | install [--mb N] | remove] subcommand and its help text. --mb takes 512 to 4095 (4096 MB would not fit in the setting's u32), default 1024.
  • README.md: one line in the command list.

Writing needs an elevated prompt once: without it NvAPI_DRS_SetSetting returns -137 (NVAPI_INVALID_USER_PRIVILEGE) and nothing is saved, and the command says so. Later unelevated runs get the larger heap, because the driver matches the profile by exe name. Reading needs no elevation.

Tested

  • RTX 3090 24 GB, NVIDIA 621.40, i5-13600K, Windows 11 26300, Rust 1.100.1 (MSVC), debug for the suite, release for the runs.

  • At a00530ea (rebased on main c53e9696), debug, with Windows' own D3D12 (XCL_D3D12_DIR set to an empty folder: with the Agility SDK 1.620 the lib test binary stops on this machine, #3488): cargo test --workspace --no-fail-fast -- --test-threads=4: 3008 passed, 0 failed, 52 ignored; 26 SKIPPED (22 no wave64, 2 no xgameruntime.dll, 2 no heap windows).

  • Review fix (thehollowedone, 12-01): a shader heap the profile only inherits (GetSetting reports a settingLocation other than the current profile) no longer counts as the profile's own setting, so such a profile is not taken for XCL's. Unit test: locations 1 and 2 refused, 0 accepted.

  • At ffc7e0ac (rebased on main 53e85fb1, conflict in main.rs only: both match arms kept), release: cargo test --workspace --release --no-fail-fast -- --test-threads=4: 2795 passed, 3 failed, 49 ignored; 30 SKIPPED (no wave64, no debug layer, heap windows off, per-lane f16/f32 forms refused). The failures are not from this PR, and fail the same way on main 53e85fb1 alone: hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline (every run, standin.rs:459) and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (3 of 3 runs on main, at gpu_two_pass_cache_e2e.rs:472 / :584; it passed once on each tree).

  • Earlier, at 2f131757 (on main 6089122a), debug: 1469 passed, 0 failed, 47 ignored; 28 SKIPPED.

  • Before the rebase, at 75b72d2f (on main b49be18): cargo build --release --workspace + cargo test --release --workspace -- --test-threads=4: 1439 passed, 0 failed, 47 ignored; 28 SKIPPED (no wave64 and the like on this adapter). At 004fa0f6, debug: 1438 passed, 0 failed, 47 ignored.

  • Review fix (profile ownership): owned is unit-tested (only_a_profile_xcl_could_have_made_is_changed: a same-name profile with another app, an extra setting, or a predefined profile is refused; what install leaves is accepted). Read-only against the real driver with a temporary local test: the profile install made here read as 1 application (xcl.exe) and 1 setting, accepted for xcl.exe and refused when only other.exe was expected; nothing was saved.

  • Review fixes: --mb 4096 is refused (it wrapped to a 0-byte heap); only NVAPI's not-found codes (-160, -163, -166, checked against nvapi_lite_common.h) read as "no profile", any other status (e.g. NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS, -182) is an error in status, remove and install. Unit tests for both; the DRS calls themselves are not mocked.

  • 28 SKIPPED lines: the wave64 tests (no wave64 on this adapter), per-lane f16/f32 forms refused, and the const-mask case.

  • The new tests: gpu::nvprofile::tests::struct_sizes_match_nvapi, the_command_line_is_checked: pass.

  • xcl nvprofile unelevated: shows the default 512 MB for xcl.exe. xcl nvprofile install unelevated: refused with the elevation message, exit 1, nothing written.

  • The same module, from #2403's shader_code_limit.rs with its own exe put into the profile (elevated install, then an unelevated run): removal at 262 pipelines / 448 MB without the profile, 519 / 888 MB at 1 GiB, 1,028 / 1,760 MB at 2 GiB. Reading NVIDIA's own Fortnite profile gives 0x80000000, as Profile Inspector shows.

  • Retail 1.0.2.1 in the world, with and without the profile written by this (same binary 4bf94d0, one copy named xcl-noprofile.exe so the driver gives it no profile, back to back from the same caches; XCL_DIRECT_DXIL=1 XCL_DRED=1, 480 s, A pressed by script). Compute pipelines precompiled with --used-only using #2551's precompiler, so no compute pipeline was built cold at the world start:

    pair no profile (512 MB) xcl nvprofile install --mb 1024
    1 removed 28 s into the world (0x887a0005 at 102.5 s, DRED page fault at VA 0x0 with no allocations, then 0x80000003) not removed in 480 s
    2 (re-precompiled) removed 3 s into the world (87.9 s, the same signature), 0 cold builds in flight (148 compute pipelines from blobs) not removed in 480 s, exit 0x0

    With the profile the title showed the first in-world output on this machine: world audio and on-screen text. But frames were very slow (about 70 in the 400 s after the world start), with green flashes and 17 compute + 8 graphics pipelines still built cold. So this shows the device staying alive, not a playable world. The shader code in use was not counted in these runs.

  • On nvidia-dev af2cecc4 + #2551 (RTX 3090, same cache state), 1 GiB was not enough: the device was removed in 2 of 2 runs at --mb 1024 (341 s, 199.6 s) and in 0 of 2 at --mb 2048 (480 s each); details. @Anon64 saw the same on that tree on an RTX 3060, so --mb 2048 may be the better choice on nvidia-dev.

Regression run

main:

xcl-smoke v1
commit: c53e96960265a82477a9c98677afb0402e98d486
gpu: NVIDIA GeForce RTX 3090
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1573 (PresentX 1573)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15794 MB

this PR:

xcl-smoke v1
commit: a00530ea2ad679b882b8ea3a3317235ede88d3c4
gpu: NVIDIA GeForce RTX 3090
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1580 (PresentX 1580)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16953 MB

The code here is not called at run time.

Not tested

  • install and remove refusing a real same-name profile made by someone else (none was created in the driver); the DRS calls are not mocked.
  • xcl nvprofile install and remove through xcl.exe itself, elevated. The same functions were tested elevated through the test above.
  • More than two retail pairs, and a count of the shader code in use in them.
  • A heap above 2 GiB: 4095 MB is only the largest value that fits, no run used it.
  • Whether code placed past 512 MB of the heap runs correctly. The limit test only dispatches each program once.
  • Other NVIDIA drivers. Machines without NVIDIA: there the command should fail with "no nvapi64.dll", which I could not check here.

AI use

  • Claude Code (Claude Opus 5.5) wrote the module, the subcommand and the tests, ran the suite, the limit tests and the smoke pair on my PC, and wrote this. I ran the elevated profile writes myself. The rebase onto c53e9696, the settingLocation fix and this update were made and posted by Claude Code while I was away, under the standing approval I gave it for this session.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5501833556 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590). Originally posted by [afpruivo](https://github.com/afpruivo) on 2026-11-26T00:47:06Z. --- NVIDIA's D3D12 driver reserves 512 MB of VA for the machine code of the pipelines in use and removes the device (`0x887a0005`) when a submission needs more (#2403). Setting `0x001ABC0F` in a driver profile raises that reserve; NVIDIA's own profiles use 1 or 2 GiB for big titles. This adds `xcl nvprofile`, which writes that one setting for `xcl.exe` through NVAPI, so users don't have to find it in Profile Inspector. Part of #2403. The measurements are in [my comment there](https://github.com/xcl-dev/xcl/issues/2403#issuecomment-7178898718). It is opt-in and changes nothing at run time: nothing happens unless the user runs the command. It moves the wall and does not replace using less code (#2526, #1901, #2496). **What is in it** - `crates/xcl/src/gpu/nvprofile.rs` (new): `nvapi64.dll` through `nvapi_QueryInterface`, `NvAPI_DRS_*`. `install` puts the exe into a profile of its own, `XCL (xcl-dev)`, holding only this setting, so `remove` deletes exactly that. `status` reads what the driver will use. Before `install` reuses a profile of that name or `remove` deletes it, both check that it holds nothing but `xcl.exe` and this setting (`NvAPI_DRS_GetProfileInfo`, `NvAPI_DRS_EnumApplications`), and refuse otherwise, so a same-name profile someone else made is left alone. Tests: the NVAPI struct sizes, the command line, the ownership rule. - `crates/xcl/src/main.rs`: the `xcl nvprofile [status | install [--mb N] | remove]` subcommand and its help text. `--mb` takes 512 to 4095 (4096 MB would not fit in the setting's u32), default 1024. - `README.md`: one line in the command list. Writing needs an elevated prompt once: without it `NvAPI_DRS_SetSetting` returns `-137` (`NVAPI_INVALID_USER_PRIVILEGE`) and nothing is saved, and the command says so. Later unelevated runs get the larger heap, because the driver matches the profile by exe name. Reading needs no elevation. **Tested** - RTX 3090 24 GB, NVIDIA 621.40, i5-13600K, Windows 11 26300, Rust 1.100.1 (MSVC), debug for the suite, release for the runs. - At `a00530ea` (rebased on `main` `c53e9696`), debug, with Windows' own D3D12 (`XCL_D3D12_DIR` set to an empty folder: with the Agility SDK 1.620 the lib test binary stops on this machine, #3488): `cargo test --workspace --no-fail-fast -- --test-threads=4`: 3008 passed, 0 failed, 52 ignored; 26 SKIPPED (22 no wave64, 2 no xgameruntime.dll, 2 no heap windows). - Review fix (thehollowedone, 12-01): a shader heap the profile only inherits (`GetSetting` reports a `settingLocation` other than the current profile) no longer counts as the profile's own setting, so such a profile is not taken for XCL's. Unit test: locations 1 and 2 refused, 0 accepted. - At `ffc7e0ac` (rebased on `main` `53e85fb1`, conflict in `main.rs` only: both match arms kept), release: `cargo test --workspace --release --no-fail-fast -- --test-threads=4`: 2795 passed, 3 failed, 49 ignored; 30 SKIPPED (no wave64, no debug layer, heap windows off, per-lane f16/f32 forms refused). The failures are not from this PR, and fail the same way on `main` `53e85fb1` alone: `hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline` (every run, `standin.rs:459`) and `two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs` (3 of 3 runs on `main`, at `gpu_two_pass_cache_e2e.rs:472` / `:584`; it passed once on each tree). - Earlier, at `2f131757` (on `main` `6089122a`), debug: 1469 passed, 0 failed, 47 ignored; 28 SKIPPED. - Before the rebase, at `75b72d2f` (on `main` `b49be18`): `cargo build --release --workspace` + `cargo test --release --workspace -- --test-threads=4`: 1439 passed, 0 failed, 47 ignored; 28 SKIPPED (no wave64 and the like on this adapter). At `004fa0f6`, debug: 1438 passed, 0 failed, 47 ignored. - Review fix (profile ownership): `owned` is unit-tested (`only_a_profile_xcl_could_have_made_is_changed`: a same-name profile with another app, an extra setting, or a predefined profile is refused; what `install` leaves is accepted). Read-only against the real driver with a temporary local test: the profile `install` made here read as 1 application (`xcl.exe`) and 1 setting, accepted for `xcl.exe` and refused when only `other.exe` was expected; nothing was saved. - Review fixes: `--mb 4096` is refused (it wrapped to a 0-byte heap); only NVAPI's not-found codes (-160, -163, -166, checked against `nvapi_lite_common.h`) read as "no profile", any other status (e.g. `NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS`, -182) is an error in `status`, `remove` and `install`. Unit tests for both; the DRS calls themselves are not mocked. - 28 `SKIPPED` lines: the wave64 tests (no wave64 on this adapter), per-lane f16/f32 forms refused, and the const-mask case. - The new tests: `gpu::nvprofile::tests::struct_sizes_match_nvapi`, `the_command_line_is_checked`: pass. - `xcl nvprofile` unelevated: shows the default 512 MB for `xcl.exe`. `xcl nvprofile install` unelevated: refused with the elevation message, exit 1, nothing written. - The same module, from #2403's `shader_code_limit.rs` with its own exe put into the profile (elevated install, then an unelevated run): removal at 262 pipelines / 448 MB without the profile, 519 / 888 MB at 1 GiB, 1,028 / 1,760 MB at 2 GiB. Reading NVIDIA's own Fortnite profile gives `0x80000000`, as Profile Inspector shows. - **Retail 1.0.2.1 in the world, with and without the profile written by this** (same binary `4bf94d0`, one copy named `xcl-noprofile.exe` so the driver gives it no profile, back to back from the same caches; `XCL_DIRECT_DXIL=1 XCL_DRED=1`, 480 s, A pressed by script). Compute pipelines precompiled with `--used-only` using #2551's precompiler, so no compute pipeline was built cold at the world start: | pair | no profile (512 MB) | `xcl nvprofile install --mb 1024` | |---|---|---| | 1 | removed 28 s into the world (`0x887a0005` at 102.5 s, DRED page fault at VA 0x0 with no allocations, then `0x80000003`) | not removed in 480 s | | 2 (re-precompiled) | removed 3 s into the world (87.9 s, the same signature), 0 cold builds in flight (148 compute pipelines from blobs) | not removed in 480 s, exit 0x0 | With the profile the title showed the first in-world output on this machine: world audio and on-screen text. But frames were very slow (about 70 in the 400 s after the world start), with green flashes and 17 compute + 8 graphics pipelines still built cold. So this shows the device staying alive, not a playable world. The shader code in use was not counted in these runs. - On `nvidia-dev` `af2cecc4` + #2551 (RTX 3090, same cache state), 1 GiB was not enough: the device was removed in 2 of 2 runs at `--mb 1024` (341 s, 199.6 s) and in 0 of 2 at `--mb 2048` (480 s each); [details](https://github.com/xcl-dev/xcl/issues/2403#issuecomment-7191394937). @Anon64 saw the same on that tree on an RTX 3060, so `--mb 2048` may be the better choice on `nvidia-dev`. **Regression run** main: ``` xcl-smoke v1 commit: c53e96960265a82477a9c98677afb0402e98d486 gpu: NVIDIA GeForce RTX 3090 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1573 (PresentX 1573) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15794 MB ``` this PR: ``` xcl-smoke v1 commit: a00530ea2ad679b882b8ea3a3317235ede88d3c4 gpu: NVIDIA GeForce RTX 3090 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1580 (PresentX 1580) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16953 MB ``` The code here is not called at run time. **Not tested** - `install` and `remove` refusing a real same-name profile made by someone else (none was created in the driver); the DRS calls are not mocked. - `xcl nvprofile install` and `remove` through `xcl.exe` itself, elevated. The same functions were tested elevated through the test above. - More than two retail pairs, and a count of the shader code in use in them. - A heap above 2 GiB: 4095 MB is only the largest value that fits, no run used it. - Whether code placed past 512 MB of the heap runs correctly. The limit test only dispatches each program once. - Other NVIDIA drivers. Machines without NVIDIA: there the command should fail with "no nvapi64.dll", which I could not check here. **AI use** - Claude Code (Claude Opus 5.5) wrote the module, the subcommand and the tests, ran the suite, the limit tests and the smoke pair on my PC, and wrote this. I ran the elevated profile writes myself. The rebase onto `c53e9696`, the `settingLocation` fix and this update were made and posted by Claude Code while I was away, under the standing approval I gave it for this session. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
DavidM1911 commented 2026-11-26 02:08:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T01:09:47Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, 26 ignored.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7179495957 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7179495957). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T01:09:47Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 26 ignored. Thanks! — Devin
GXLD-N commented 2026-11-26 03:06:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by GXLD-N on 2026-11-26T02:36:40Z.


Tested on an RTX 4070 Ti SUPER (Ada, 16 GB): xcl nvprofile install raises the shader-code limit from 446 MB to 885 MB, the same as the RTX 3090 in #2403.

Setup

  • RTX 4070 Ti SUPER 16 GB, driver 32.0.16.1088, Ryzen 7 7800X3D, 32 GB RAM, Windows 11 26300, Rust 1.100.0, DXC 1.8.2502.11.
  • This PR's head 4bf94d0, release build for the runs, debug for the suite.

Suite

  • cargo test --workspace -- --test-threads=4: 1431 passed, 0 failed, 48 ignored, 26 SKIPPED (24 "no wave64", 1 "no heap windows", 1 Developer Mode for the driver cache). The 48 ignored include #2403's shader_code_limit.rs, which I added locally for the runs below and is not in the PR. Both gpu::nvprofile tests pass.

The command

  • xcl nvprofile status before: xcl.exe: the driver's default shader heap (512 MB on D3D12).
  • xcl nvprofile install from an elevated prompt: xcl.exe is in the profile "XCL (xcl-dev)", then xcl.exe: shader heap 1024 MB.
  • xcl nvprofile status afterwards from a normal prompt: xcl.exe: shader heap 1024 MB. Reading needs no elevation, as the description says.

The limit (#2403's shader_code_limit.rs, unchanged, MODE=keep COUNT=600 STMTS=3000 THREADS=5)

removed at driver blobs
default (no profile) 261 pipelines 446 MB
install (1024 MB) 517 pipelines 885 MB

Both ended in 0x887a0005. The profile matches by executable name and only puts xcl.exe in it, so for the second row I copied the test binary to a folder of its own as xcl.exe and ran that copy. The first row is the binary under its own name. 885 MB is within 3 MB of the RTX 3090's 888 MB at 1 GiB in #2403, so the setting scales the same way on Ada.

Not tested

  • remove (I left the profile installed), --mb other than the default, and a second install over an existing profile.
  • The retail title with the profile: no world run here yet.
  • Other drivers, and AMD / Intel (the command should fail cleanly without nvapi64.dll; not checked).

Tested and written with Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7180961070 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7180961070). Originally posted by [GXLD-N](https://github.com/GXLD-N) on 2026-11-26T02:36:40Z. --- **Tested on an RTX 4070 Ti SUPER (Ada, 16 GB): `xcl nvprofile install` raises the shader-code limit from 446 MB to 885 MB, the same as the RTX 3090 in #2403.** **Setup** - RTX 4070 Ti SUPER 16 GB, driver 32.0.16.1088, Ryzen 7 7800X3D, 32 GB RAM, Windows 11 26300, Rust 1.100.0, DXC 1.8.2502.11. - This PR's head `4bf94d0`, release build for the runs, debug for the suite. **Suite** - `cargo test --workspace -- --test-threads=4`: 1431 passed, 0 failed, 48 ignored, 26 `SKIPPED` (24 "no wave64", 1 "no heap windows", 1 Developer Mode for the driver cache). The 48 ignored include #2403's `shader_code_limit.rs`, which I added locally for the runs below and is not in the PR. Both `gpu::nvprofile` tests pass. **The command** - `xcl nvprofile status` before: `xcl.exe: the driver's default shader heap (512 MB on D3D12)`. - `xcl nvprofile install` from an elevated prompt: `xcl.exe is in the profile "XCL (xcl-dev)"`, then `xcl.exe: shader heap 1024 MB`. - `xcl nvprofile status` afterwards from a normal prompt: `xcl.exe: shader heap 1024 MB`. Reading needs no elevation, as the description says. **The limit** (#2403's `shader_code_limit.rs`, unchanged, `MODE=keep COUNT=600 STMTS=3000 THREADS=5`) | | removed at | driver blobs | |---|---:|---:| | default (no profile) | 261 pipelines | 446 MB | | `install` (1024 MB) | 517 pipelines | 885 MB | Both ended in `0x887a0005`. The profile matches by executable name and only puts `xcl.exe` in it, so for the second row I copied the test binary to a folder of its own as `xcl.exe` and ran that copy. The first row is the binary under its own name. 885 MB is within 3 MB of the RTX 3090's 888 MB at 1 GiB in #2403, so the setting scales the same way on Ada. **Not tested** - `remove` (I left the profile installed), `--mb` other than the default, and a second install over an existing profile. - The retail title with the profile: no world run here yet. - Other drivers, and AMD / Intel (the command should fail cleanly without `nvapi64.dll`; not checked). *Tested and written with Claude Code (Claude Opus 5.5).*
pvfreis commented 2026-11-26 03:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-26T03:01:37Z.


By reading only, not run, at 4bf94d07: xcl nvprofile install --mb 4096 asks the driver for a shader heap of 0 bytes.

  • parse accepts 512–4096 (nvprofile.rs:264), then (mb as u32) << 20 (:267) is 2^32 for 4096, which does not fit in a u32: the result is 0, in debug and release (<< only checks the shift amount).
  • install's only check of the value, the 64 KiB one (:185), passes 0, so 0 is what goes to NvAPI_DRS_SetSetting (:217-218).
  • Making 4095 the top of the range, or computing in u64 and refusing what does not fit in the u32 setting, would fix it. The test goes no higher than 2048 (:321).

AI use: Claude Code (Claude Opus 5.5) found this; Claude Fable 5.2 rechecked it; checked by a person before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7181328961 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7181328961). Originally posted by [pvfreis](https://github.com/pvfreis) on 2026-11-26T03:01:37Z. --- By reading only, not run, at `4bf94d07`: **`xcl nvprofile install --mb 4096` asks the driver for a shader heap of 0 bytes.** - `parse` accepts 512–4096 (`nvprofile.rs:264`), then `(mb as u32) << 20` (`:267`) is 2^32 for 4096, which does not fit in a `u32`: the result is 0, in debug and release (`<<` only checks the shift amount). - `install`'s only check of the value, the 64 KiB one (`:185`), passes 0, so 0 is what goes to `NvAPI_DRS_SetSetting` (`:217-218`). - Making 4095 the top of the range, or computing in `u64` and refusing what does not fit in the `u32` setting, would fix it. The test goes no higher than 2048 (`:321`). **AI use:** Claude Code (Claude Opus 5.5) found this; Claude Fable 5.2 rechecked it; checked by a person before posting.
luckyteagirl commented 2026-11-26 06:31:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T06:31:25Z.

Review: COMMENTED


remove() treats every non-NVAPI_OK result from FindProfileByName as “no XCL profile,” so a miscellaneous NVAPI failure can produce a successful exit even when the profile still exists. NVIDIA documents distinct NVAPI_PROFILE_NOT_FOUND and NVAPI_ERROR results for this call. The same error-as-absence pattern in status() makes an ambiguous basename match or a setting-read failure print the driver's default shader heap rather than an error. Could only the explicit profile/application/setting not-found codes map to None/false, with the other statuses propagated through check()? Mocking the DRS calls to return not-found versus NVAPI_ERROR (and ambiguous executable path for status) would verify the CLI exit and message without changing a real driver profile.

This is an exact-head source review of 4bf94d07c280c0adb9b00c2699b6972e64fed22d. I did not invoke NVAPI or modify driver settings. AI-assisted review with Codex.

<!-- greyfinch-sync:ivall/xcl:review:6069526237 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#pullrequestreview-6069526237). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T06:31:25Z. **Review:** COMMENTED --- `remove()` treats every non-`NVAPI_OK` result from `FindProfileByName` as “no XCL profile,” so a miscellaneous NVAPI failure can produce a successful exit even when the profile still exists. [NVIDIA documents](https://docs.nvidia.com/nvapi/group__drsapi.html) distinct `NVAPI_PROFILE_NOT_FOUND` and `NVAPI_ERROR` results for this call. The same error-as-absence pattern in `status()` makes an ambiguous basename match or a setting-read failure print the driver's default shader heap rather than an error. Could only the explicit profile/application/setting not-found codes map to `None`/`false`, with the other statuses propagated through `check()`? Mocking the DRS calls to return not-found versus `NVAPI_ERROR` (and ambiguous executable path for `status`) would verify the CLI exit and message without changing a real driver profile. This is an exact-head source review of `4bf94d07c280c0adb9b00c2699b6972e64fed22d`. I did not invoke NVAPI or modify driver settings. AI-assisted review with Codex.
Anon64 commented 2026-11-26 07:03:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-26T06:27:28Z.


Tested 4bf94d0 on an RTX 3060 12 GB (NVIDIA 581.80, i9-14900KF, Windows 11 26200), release build: xcl nvprofile install stopped the retail title's device removal.

  • xcl nvprofile status before: xcl.exe: the driver's default shader heap (512 MB on D3D12). install --mb 1024 from an elevated prompt, then unelevated status: xcl.exe: shader heap 1024 MB.
  • With the default heap, the title lost the device (0x887a0005) at 81.6–84.4 s in 5 of 5 runs. With the profile, it ran to 274.8 s with no removal and reached its world, as described on #2403.
  • The runtime for those runs was nvidia-dev c044dc6. The profile matches it because the launcher starts the title's host from xcl.exe, with only the command line naming the title's exe.
  • One local change in my build: install was given the title's exe name as a second entry next to xcl.exe, in case the driver matched on that. It turned out not to be needed for the reason above, and I did not test install without it.

Update, --mb 2048: on nvidia-dev af2cecc4 with its shader preparation on (it builds the graphics and compute pipelines earlier runs used before the title starts), 1024 MB was not enough: the title lost the device (0x887a0005, empty DRED, video memory only ~270 MB over its budget) about 125 s in, with 3,569 pipelines built (675 of 256 KB or more). With install --mb 2048 (status: xcl.exe: shader heap 2048 MB) the same run built 3,934 (752 of 256 KB or more) with no removal and ended about 258 s in on the title's own watchdog while it waited for compute pipelines. One run each. So the more pipelines a run makes resident, the bigger the heap it needs; 1024 may be too small as a default once preparation is on.

Not tested: remove, --mb other than 1024 and 2048, the suite on this commit, AMD (the command should say there is no NVAPI).

AI use: Claude Code (Claude Opus 5.5) built it, ran the commands and the runs, and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7184447776 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7184447776). Originally posted by [Anon64](https://github.com/Anon64) on 2026-11-26T06:27:28Z. --- **Tested `4bf94d0` on an RTX 3060 12 GB (NVIDIA 581.80, i9-14900KF, Windows 11 26200), release build: `xcl nvprofile install` stopped the retail title's device removal.** - `xcl nvprofile status` before: `xcl.exe: the driver's default shader heap (512 MB on D3D12)`. `install --mb 1024` from an elevated prompt, then unelevated `status`: `xcl.exe: shader heap 1024 MB`. - With the default heap, the title lost the device (`0x887a0005`) at 81.6–84.4 s in 5 of 5 runs. With the profile, it ran to 274.8 s with no removal and reached its world, as described on #2403. - The runtime for those runs was `nvidia-dev` `c044dc6`. The profile matches it because the launcher starts the title's host from `xcl.exe`, with only the command line naming the title's exe. - One local change in my build: `install` was given the title's exe name as a second entry next to `xcl.exe`, in case the driver matched on that. It turned out not to be needed for the reason above, and I did not test `install` without it. **Update, `--mb 2048`:** on `nvidia-dev` `af2cecc4` with its shader preparation on (it builds the graphics and compute pipelines earlier runs used before the title starts), 1024 MB was not enough: the title lost the device (`0x887a0005`, empty DRED, video memory only ~270 MB over its budget) about 125 s in, with 3,569 pipelines built (675 of 256 KB or more). With `install --mb 2048` (`status`: `xcl.exe: shader heap 2048 MB`) the same run built 3,934 (752 of 256 KB or more) with no removal and ended about 258 s in on the title's own watchdog while it waited for compute pipelines. One run each. So the more pipelines a run makes resident, the bigger the heap it needs; 1024 may be too small as a default once preparation is on. **Not tested:** `remove`, `--mb` other than 1024 and 2048, the suite on this commit, AMD (the command should say there is no NVAPI). AI use: Claude Code (Claude Opus 5.5) built it, ran the commands and the runs, and wrote this report.
Raul-Paiva commented 2026-11-26 08:04:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Raul-Paiva on 2026-11-26T07:41:44Z.


Tested 4bf94d0 on an RTX 3070 Laptop 8 GB: with xcl nvprofile install --mb 1024 the retail title's 0x887a0005 at world start is gone (removed at 281 s instead of 117 s). Behind it, though, the title is almost stopped from about 120 s, and the run ended in a TDR.

Setup:

  • RTX 3070 Laptop 8 GB, driver 621.24, i7-11800H, 32 GB RAM, Windows 10 19045, release build.
  • TdrDelay = 10 (set for an earlier test, see #505).
  • Tree: main b49be18 + this PR + #684, #751, #2385, #2097 d98d2d4, #2404 97a70a7, #2422, #2427 + #2428 c6e5af8, #2496 2e8ff6b, #2551, plus local diagnostics: a compute skip switch and Nsight Aftermath hooks. The skip list was empty in the 1 GiB run and in the default runs, except one default run noted below.
  • XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_WINDOW_NO_CARRY=1 XCL_DRED=1, A pressed every 5 s, 600 s.
  • Compute precompiled with --precompile --only cs --pipelines for this tree.

What I checked:

  • xcl nvprofile unelevated: the default 512 MB.
  • xcl nvprofile install --mb 1024 in an elevated prompt (run by the tester), then xcl nvprofile unelevated: shader heap 1024 MB.

Results:

same build, same caches default (512 MB) 1 GiB profile
runs 1 (and 3 on the tree before, with #2404 551a75e) 1
world start (first #101) 105 s 102 s
presents per minute, 0–60 / 60–120 / 120–180 / 180–240 / 240–300 s 1 103 / 614 / 0 1 163 / 547 / 8 / 10 / 4
removed 116.7 s, 0x887a0005 (118.8 and 131.7 s in the others, and 124.8 s in one with 3 large compute programs left out by the skip switch), no 4101 event 280.9 s, 0x887a0006, with a Windows 4101 event and two nvlddmkm 153
  • So on this card the world-start removal was this limit, as for the 3060 and 4070 Ti SUPER above.
  • The run with the profile is not a working world:
    • From 120 s the title presents 4–10 frames per minute.
    • From 165 s, 164 GPU queue.Wait … did not complete within 5000 ms – released on CPU warnings appear.
    • At 281 s a submission ran over the 10 s TdrDelay.
    • DRED at that point: a compute list stopped at 6 851 of 15 360 operations, around 5 15 0 >5 15 0, on a pipeline logged as "a stand-in, or not translated".
  • The same near-stop from 120 s and the same queue-wait warnings show on an older tree with the default heap, where the device was not removed (main 6d12f58 + #2404 5ca9c23 and others, see #505). So that part is not caused by the profile; the profile only lets this tree reach it.
  • Peak memory with the profile: 13.2 GB local video memory, 33.4 GB committed by the process.

Not tested: more than one run with the profile; --mb 2048; xcl nvprofile remove; TdrDelay unset with the profile; a count of the shader code in use.

AI use: Claude Code (Claude Opus 5.5) built the tree, ran the runs, read the logs, DRED and the event log, and wrote this. The elevated install was run by the tester.

Edit: two more runs with the 1 GiB profile, same build and settings, skip list empty.

run presents per minute, 0–60 / 60–120 / 120–180 / 180–240 s last present end peak commit
1 (above) 1 163 / 547 / 8 / 10 270 s removed 280.9 s, 0x887a0006, 4101 event 33.4 GB
2 1 073 / 763 / 7 / 0 164.6 s process gone at ~171 s: Windows "virtual memory low" (2004 event: xcl.exe 36.1 GB), no XCL error 36.1 GB
3 (page file raised to 32 GB, commit limit ~63 GB) 1 104 / 736 / 8 / 4 198.2 s removed 221.5 s, 0x887a0006, 4101 event 34.6 GB
  • The profile keeps the device alive past the world start in 3 of 3 runs:
    • no 0x887a0005 in any of them;
    • every default-heap run on this build or the one before it was removed at 117 – 132 s.
  • What ends the runs is different:
    • two were a TDR with TdrDelay = 10;
    • one ran out of commit on a 32 GB machine with the default page file.
  • The world never runs: from ~114 s it presents about one frame every 6 – 8 s while it still records 300 – 2 600 dispatches per 2 s. The GPU queue-wait warnings (5 s) come before each TDR.
  • DRED differs between the two TDRs:
    • one stopped on a stand-in pipeline at 6 851 / 15 360 operations;
    • the other on a translated compute program at 53 / 4 671.
  • For other 8 GB / 32 GB machines: with the profile, the process can commit more than 32 GB here, so a default page file can end the run before anything else.

Correction: the local compute skip switch I listed under the tree had a side effect, even with an empty list. On every dispatch ExecuteIndirect it resolved the pipeline with pso_async::resolve_wait before the empty-list check, so a pending compute pipeline was waited for instead of put off to the submit. All runs above have that, on both sides of the comparison.

One more run without it:

  • Tree: this build + #2598, #2633, #2611 (conflict in device_x.rs, both sides kept) and #2691 (conflict in real.rs's tests, both kept), fresh precompile. The skip switch was off, with no env var.
  • Settings: the 1 GiB profile, same settings as above.
  • cargo test --workspace --release -- --test-threads=4: 1 476 passed, 0 failed, 48 ignored, 24 SKIPPED.
  • Presents per minute: 807 / 903 / 8 / 4. Last present at 200.6 s.
  • Removed at 216.0 s, 0x887a0006, with a 4101 event. DRED shows a compute list at 25 of 63 operations.
  • No queue-wait warnings this time. Peak commit 32.1 GB.

So the world-start stall and the TDR after it do not come from that switch.

<!-- greyfinch-sync:ivall/xcl:comment:7185733717 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7185733717). Originally posted by [Raul-Paiva](https://github.com/Raul-Paiva) on 2026-11-26T07:41:44Z. --- **Tested `4bf94d0` on an RTX 3070 Laptop 8 GB: with `xcl nvprofile install --mb 1024` the retail title's `0x887a0005` at world start is gone (removed at 281 s instead of 117 s). Behind it, though, the title is almost stopped from about 120 s, and the run ended in a TDR.** **Setup:** - RTX 3070 Laptop 8 GB, driver 621.24, i7-11800H, 32 GB RAM, Windows 10 19045, release build. - `TdrDelay` = 10 (set for an earlier test, see #505). - Tree: `main` `b49be18` + this PR + #684, #751, #2385, #2097 `d98d2d4`, #2404 `97a70a7`, #2422, #2427 + #2428 `c6e5af8`, #2496 `2e8ff6b`, #2551, plus local diagnostics: a compute skip switch and Nsight Aftermath hooks. **The skip list was empty in the 1 GiB run and in the default runs, except one default run noted below**. - `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_WINDOW_NO_CARRY=1 XCL_DRED=1`, A pressed every 5 s, 600 s. - Compute precompiled with `--precompile --only cs --pipelines` for this tree. **What I checked:** - `xcl nvprofile` unelevated: the default 512 MB. - `xcl nvprofile install --mb 1024` in an elevated prompt (run by the tester), then `xcl nvprofile` unelevated: `shader heap 1024 MB`. **Results:** | same build, same caches | default (512 MB) | 1 GiB profile | |---|---|---| | runs | 1 (and 3 on the tree before, with #2404 `551a75e`) | 1 | | world start (first `#101`) | 105 s | 102 s | | presents per minute, 0–60 / 60–120 / 120–180 / 180–240 / 240–300 s | 1 103 / 614 / 0 | 1 163 / 547 / 8 / 10 / 4 | | removed | **116.7 s, `0x887a0005`** (118.8 and 131.7 s in the others, and 124.8 s in one with 3 large compute programs left out by the skip switch), no 4101 event | **280.9 s, `0x887a0006`**, with a Windows 4101 event and two `nvlddmkm` 153 | - So on this card the world-start removal was this limit, as for the 3060 and 4070 Ti SUPER above. - **The run with the profile is not a working world:** - From 120 s the title presents 4–10 frames per minute. - From 165 s, 164 `GPU queue.Wait … did not complete within 5000 ms – released on CPU` warnings appear. - At 281 s a submission ran over the 10 s `TdrDelay`. - DRED at that point: a compute list stopped at 6 851 of 15 360 operations, around `5 15 0 >5 15 0`, on a pipeline logged as "a stand-in, or not translated". - The same near-stop from 120 s and the same queue-wait warnings show on an older tree with the default heap, where the device was not removed (`main` `6d12f58` + #2404 `5ca9c23` and others, see #505). So that part is not caused by the profile; the profile only lets this tree reach it. - Peak memory with the profile: 13.2 GB local video memory, 33.4 GB committed by the process. **Not tested:** more than one run with the profile; `--mb 2048`; `xcl nvprofile remove`; `TdrDelay` unset with the profile; a count of the shader code in use. **AI use:** Claude Code (Claude Opus 5.5) built the tree, ran the runs, read the logs, DRED and the event log, and wrote this. The elevated `install` was run by the tester. **Edit: two more runs with the 1 GiB profile, same build and settings, skip list empty.** | run | presents per minute, 0–60 / 60–120 / 120–180 / 180–240 s | last present | end | peak commit | |---|---|---|---|---| | 1 (above) | 1 163 / 547 / 8 / 10 | 270 s | removed 280.9 s, `0x887a0006`, 4101 event | 33.4 GB | | 2 | 1 073 / 763 / 7 / 0 | 164.6 s | process gone at ~171 s: Windows "virtual memory low" (2004 event: `xcl.exe` 36.1 GB), no XCL error | 36.1 GB | | 3 (page file raised to 32 GB, commit limit ~63 GB) | 1 104 / 736 / 8 / 4 | 198.2 s | removed 221.5 s, `0x887a0006`, 4101 event | 34.6 GB | - **The profile keeps the device alive past the world start in 3 of 3 runs:** - no `0x887a0005` in any of them; - every default-heap run on this build or the one before it was removed at 117 – 132 s. - **What ends the runs is different:** - two were a TDR with `TdrDelay` = 10; - one ran out of commit on a 32 GB machine with the default page file. - **The world never runs:** from ~114 s it presents about one frame every 6 – 8 s while it still records 300 – 2 600 dispatches per 2 s. The GPU queue-wait warnings (5 s) come before each TDR. - **DRED differs between the two TDRs:** - one stopped on a stand-in pipeline at 6 851 / 15 360 operations; - the other on a translated compute program at 53 / 4 671. - **For other 8 GB / 32 GB machines:** with the profile, the process can commit more than 32 GB here, so a default page file can end the run before anything else. **Correction:** the local compute skip switch I listed under the tree had a side effect, even with an empty list. On every dispatch `ExecuteIndirect` it resolved the pipeline with `pso_async::resolve_wait` before the empty-list check, so a pending compute pipeline was waited for instead of put off to the submit. All runs above have that, on both sides of the comparison. **One more run without it:** - Tree: this build + #2598, #2633, #2611 (conflict in `device_x.rs`, both sides kept) and #2691 (conflict in `real.rs`'s tests, both kept), fresh precompile. The skip switch was off, with no env var. - Settings: the 1 GiB profile, same settings as above. - `cargo test --workspace --release -- --test-threads=4`: 1 476 passed, 0 failed, 48 ignored, 24 SKIPPED. - Presents per minute: 807 / 903 / 8 / 4. Last present at 200.6 s. - **Removed at 216.0 s, `0x887a0006`**, with a 4101 event. DRED shows a compute list at 25 of 63 operations. - No queue-wait warnings this time. Peak commit 32.1 GB. So the world-start stall and the TDR after it do not come from that switch.
afpruivo commented 2026-11-26 09:07:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by afpruivo on 2026-11-26T08:50:09Z.


Thanks @pvfreis, confirmed: 4096 << 20 wraps to 0 in a u32. The range is now 512–4095, with a test that 4096 is refused (004fa0f6).

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7187078642 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7187078642). Originally posted by [afpruivo](https://github.com/afpruivo) on 2026-11-26T08:50:09Z. --- Thanks @pvfreis, confirmed: `4096 << 20` wraps to 0 in a u32. The range is now 512–4095, with a test that 4096 is refused (004fa0f6). AI use: Claude Code (Claude Opus 5.5).
afpruivo commented 2026-11-26 09:07:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by afpruivo on 2026-11-26T08:50:11Z.


Thanks @luckyteagirl, confirmed against nvapi.h. A new found() treats only NVAPI's three not-found codes (-160, -163, -166) as absent. Anything else, including NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS (-182), is now an error in status, remove and install. The mapping has a unit test; the full DRS calls are not mocked (004fa0f6).

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7187079125 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7187079125). Originally posted by [afpruivo](https://github.com/afpruivo) on 2026-11-26T08:50:11Z. --- Thanks @luckyteagirl, confirmed against `nvapi.h`. A new `found()` treats only NVAPI's three not-found codes (-160, -163, -166) as absent. Anything else, including `NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS` (-182), is now an error in `status`, `remove` and `install`. The mapping has a unit test; the full DRS calls are not mocked (004fa0f6). AI use: Claude Code (Claude Opus 5.5).
thehollowedone commented 2026-11-26 11:05:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T10:24:21Z.


Independent Windows/NVIDIA check of #2590 head 004fa0f on current main b49be18.

Windows 11 build 26300, RTX 3080 Ti (12 GB, driver 621.35), rustc 1.99.1 MSVC. A clean exact-head checkout was used.

  • cargo build --offline --locked --workspace: passed.
  • cargo test --offline --locked -p xcl --lib gpu::nvprofile -- --nocapture --test-threads=1: 3 passed, 0 failed, 0 ignored. This includes the 4096 MB limit and unexpected-NVAPI-status cases.
  • target\debug\xcl.exe nvprofile status: exit 0, reports the driver's default 512 MB shader heap. A repeat after testing reported the same value.
  • target\debug\xcl.exe nvprofile install --mb 4096: rejected at argument parsing with exit 2 (expected 512 - 4095); this did not attempt a driver write.
  • cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --quiet: 1,438 passed, 0 failed, 47 ignored across 37 test executables. The output printed 25 GPU SKIPPED notices; those paths are not GPU coverage.

Not tested here: elevated install/remove, a profile change, a shader-heap limit probe, or a retail title run. These results verify the current head's build, tests, read-only status and input rejection on this adapter; they do not measure a larger heap or device-removal improvement.

AI use: Codex (GPT-6.2 Sol) ran the commands and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7189321837 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7189321837). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-26T10:24:21Z. --- Independent Windows/NVIDIA check of [#2590 head `004fa0f`](https://github.com/xcl-dev/xcl/commit/004fa0f61f9c9cf1d881386adbf00877d5d0571f) on current [`main` `b49be18`](https://github.com/xcl-dev/xcl/commit/b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). Windows 11 build 26300, RTX 3080 Ti (12 GB, driver 621.35), rustc 1.99.1 MSVC. A clean exact-head checkout was used. - `cargo build --offline --locked --workspace`: passed. - `cargo test --offline --locked -p xcl --lib gpu::nvprofile -- --nocapture --test-threads=1`: 3 passed, 0 failed, 0 ignored. This includes the 4096 MB limit and unexpected-NVAPI-status cases. - `target\debug\xcl.exe nvprofile status`: exit 0, reports the driver's default 512 MB shader heap. A repeat after testing reported the same value. - `target\debug\xcl.exe nvprofile install --mb 4096`: rejected at argument parsing with exit 2 (`expected 512 - 4095`); this did not attempt a driver write. - `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --quiet`: 1,438 passed, 0 failed, 47 ignored across 37 test executables. The output printed 25 GPU `SKIPPED` notices; those paths are not GPU coverage. Not tested here: elevated `install`/`remove`, a profile change, a shader-heap limit probe, or a retail title run. These results verify the current head's build, tests, read-only status and input rejection on this adapter; they do not measure a larger heap or device-removal improvement. AI use: Codex (GPT-6.2 Sol) ran the commands and drafted this report.
thehollowedone commented 2026-11-26 11:05:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T10:34:38Z.


One profile-ownership case remains on head 004fa0f. remove() looks up XCL (xcl-dev) by name, then deletes that entire profile and saves without checking its applications or settings. If a user already has a profile with that name containing other.exe or another setting, remove can discard those entries even when xcl.exe was never associated with it. install() can reuse the same profile, add xcl.exe, and change its shader setting for the other members. NVIDIA's DRS API documents profile-wide deletion/reset and persistent SaveSettings.

Could both commands refuse to alter an existing profile until XCL has verified it owns that profile and its contents? For example, mark XCL's application record at creation, then require a user-defined profile with only the expected marked application and profile-local shader setting before reuse or deletion. A focused DRS mock can supply a same-name profile with an unrelated app/setting, and one XCL-created profile later customized by the user; both install and remove should return an error without calling SaveSettings. This avoids changing a real driver profile to test the collision.

This is a source/API review; I did not create or change an NVIDIA profile to reproduce it. AI use: Codex (GPT-6.2 Astra) independently checked the NVAPI behavior; Codex (GPT-6.2 Sol) reviewed the code and drafted this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7189549068 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7189549068). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-26T10:34:38Z. --- One profile-ownership case remains on [head `004fa0f`](https://github.com/xcl-dev/xcl/commit/004fa0f61f9c9cf1d881386adbf00877d5d0571f). [`remove()`](https://github.com/xcl-dev/xcl/blob/004fa0f61f9c9cf1d881386adbf00877d5d0571f/crates/xcl/src/gpu/nvprofile.rs#L243-L255) looks up `XCL (xcl-dev)` by name, then deletes that entire profile and saves without checking its applications or settings. If a user already has a profile with that name containing `other.exe` or another setting, `remove` can discard those entries even when `xcl.exe` was never associated with it. [`install()`](https://github.com/xcl-dev/xcl/blob/004fa0f61f9c9cf1d881386adbf00877d5d0571f/crates/xcl/src/gpu/nvprofile.rs#L197-L239) can reuse the same profile, add `xcl.exe`, and change its shader setting for the other members. NVIDIA's [DRS API](https://docs.nvidia.com/nvapi/group__drsapi.html) documents profile-wide deletion/reset and persistent `SaveSettings`. Could both commands refuse to alter an existing profile until XCL has verified it owns that profile and its contents? For example, mark XCL's application record at creation, then require a user-defined profile with only the expected marked application and profile-local shader setting before reuse or deletion. A focused DRS mock can supply a same-name profile with an unrelated app/setting, and one XCL-created profile later customized by the user; both `install` and `remove` should return an error without calling `SaveSettings`. This avoids changing a real driver profile to test the collision. This is a source/API review; I did not create or change an NVIDIA profile to reproduce it. AI use: Codex (GPT-6.2 Astra) independently checked the NVAPI behavior; Codex (GPT-6.2 Sol) reviewed the code and drafted this comment.
afpruivo commented 2026-11-26 19:39:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by afpruivo on 2026-11-26T19:39:44Z.


@thehollowedone thanks, agreed: remove deleted whatever profile had that name, and install would add xcl.exe to it and change its heap for the others. Fixed in 75b72d2f; the smoke block in the description is rerun at that head.

  • Before install reuses the profile and before remove deletes it, check_owned reads it (NvAPI_DRS_GetProfileInfo, NvAPI_DRS_EnumApplications, IDs from NVIDIA/nvapi nvapi_interface.h). It goes ahead only when the profile is not predefined, holds no application but xcl.exe, and has no setting other than the shader heap (or none, after an interrupted install). Otherwise both return an error naming what is in it, before any SetSetting or SaveSettings.
  • I did not add a marker on XCL's application record: a profile that holds only xcl.exe and that one setting has nothing of anyone else's in it to lose, so it is treated as XCL's.
  • The decision is a plain function, owned, with a unit test (only_a_profile_xcl_could_have_made_is_changed): your two cases (a same-name profile with another app, and one XCL made that the user later added a setting or an app to) are refused, NVIDIA's own profiles are refused, and what install leaves is accepted. I did not write a DRS mock; the NVAPI calls themselves are not covered by a test.

Tested (RTX 3090 24 GB, 621.40, Windows 11 26300, release):

  • cargo test --release --workspace -- --test-threads=4: 1,439 passed, 0 failed, 47 ignored, with the GPU tests' SKIPPED notices in the passed count.
  • Against the real driver, read only (a temporary local test, not committed): on the profile install made here, check_owned read 1 application (xcl.exe) and 1 setting and accepted it for xcl.exe, and refused it when told the only expected app is other.exe. Nothing was saved.

Not tested: install and remove refusing a real same-name profile that someone else made (I did not create one in the driver); elevated remove after this change.

AI use: Claude Code (Claude Opus 5.5) wrote the change and the test, checked the NVAPI IDs and signatures against NVIDIA's headers, ran the tests, and drafted this. Checked by me before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7201828692 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7201828692). Originally posted by [afpruivo](https://github.com/afpruivo) on 2026-11-26T19:39:44Z. --- @thehollowedone thanks, agreed: `remove` deleted whatever profile had that name, and `install` would add `xcl.exe` to it and change its heap for the others. Fixed in [`75b72d2f`](https://github.com/xcl-dev/xcl/commit/75b72d2f3881ff604ec25560daf43eb066078ed1); the smoke block in the description is rerun at that head. - Before `install` reuses the profile and before `remove` deletes it, `check_owned` reads it (`NvAPI_DRS_GetProfileInfo`, `NvAPI_DRS_EnumApplications`, IDs from NVIDIA/nvapi `nvapi_interface.h`). It goes ahead only when the profile is not predefined, holds no application but `xcl.exe`, and has no setting other than the shader heap (or none, after an interrupted install). Otherwise both return an error naming what is in it, before any `SetSetting` or `SaveSettings`. - I did not add a marker on XCL's application record: a profile that holds only `xcl.exe` and that one setting has nothing of anyone else's in it to lose, so it is treated as XCL's. - The decision is a plain function, `owned`, with a unit test (`only_a_profile_xcl_could_have_made_is_changed`): your two cases (a same-name profile with another app, and one XCL made that the user later added a setting or an app to) are refused, NVIDIA's own profiles are refused, and what `install` leaves is accepted. I did not write a DRS mock; the NVAPI calls themselves are not covered by a test. **Tested** (RTX 3090 24 GB, 621.40, Windows 11 26300, release): - `cargo test --release --workspace -- --test-threads=4`: 1,439 passed, 0 failed, 47 ignored, with the GPU tests' `SKIPPED` notices in the passed count. - Against the real driver, read only (a temporary local test, not committed): on the profile `install` made here, `check_owned` read 1 application (`xcl.exe`) and 1 setting and accepted it for `xcl.exe`, and refused it when told the only expected app is `other.exe`. Nothing was saved. **Not tested:** `install` and `remove` refusing a real same-name profile that someone else made (I did not create one in the driver); elevated `remove` after this change. **AI use:** Claude Code (Claude Opus 5.5) wrote the change and the test, checked the NVAPI IDs and signatures against NVIDIA's headers, ran the tests, and drafted this. Checked by me before posting.
pvfreis commented 2026-11-26 21:24:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-26T21:24:30Z.


Follow-up, by reading only at 75b72d2f: addressed. parse now accepts --mb 512–4095 (nvprofile.rs:324) and the test asserts that 4096 is refused (:383), so --mb can no longer wrap the shader-heap setting to 0.

AI use: Claude Code (Claude Opus 5.5) checked the new head and wrote this; Claude Fable 5.2 rechecked it; checked by a person before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7203696901 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7203696901). Originally posted by [pvfreis](https://github.com/pvfreis) on 2026-11-26T21:24:30Z. --- Follow-up, by reading only at `75b72d2f`: addressed. `parse` now accepts `--mb` 512–4095 (`nvprofile.rs:324`) and the test asserts that 4096 is refused (`:383`), so `--mb` can no longer wrap the shader-heap setting to 0. AI use: Claude Code (Claude Opus 5.5) checked the new head and wrote this; Claude Fable 5.2 rechecked it; checked by a person before posting.
SergeAx commented 2026-11-27 20:50:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SergeAx on 2026-11-27T20:50:57Z.


Tested 2f131757 on an RTX 5080: install --mb 2048 works, and it stops the device removals of #1452 on this card.

Setup: RTX 5080 16 GB, driver 621.14, Ryzen 5 3500X, Windows 10 22H2, release build.

Results:

  • cargo test --release -p xcl --lib nvprofile: 4 passed, 0 failed.
  • xcl nvprofile status before install: xcl.exe: the driver's default shader heap (512 MB on D3D12).
  • xcl nvprofile install --mb 2048 in an elevated prompt printed:
    • xcl.exe is in the profile "XCL (xcl-dev)"
    • xcl.exe: shader heap 2048 MB
  • status from a normal prompt then read 2048 MB, before and after the title runs.
  • Effect: 7 unattended 240 s runs of a tree that lost the device in 6 of 7 runs at 512 MB, with no removal (details on #2929).
    • The runs used an xcl.exe from a different worktree than the one that ran the install; the profile holds only the file name.
  • Code check: I read nvprofile.rs against NVIDIA's public headers (nvapi.h, nvapi_interface.h, nvapi_lite_common.h from the R620 SDK). All 14 function IDs, the four status codes and the three struct layouts match. That includes NVDRS_SETTING_V1, whose NvU64 union members sit under #pragma pack(push, 4), so 12,324 bytes is right.

Not tested:

  • remove.
  • install without elevation.
  • Other --mb values.
  • Other drivers or GPUs.

AI use: Claude Code (Claude Opus 5.5) built the PR, checked the code against the headers, ran the tests and the title runs, and wrote this; I ran the elevated install.

<!-- greyfinch-sync:ivall/xcl:comment:7227898272 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7227898272). Originally posted by [SergeAx](https://github.com/SergeAx) on 2026-11-27T20:50:57Z. --- **Tested `2f131757` on an RTX 5080: `install --mb 2048` works, and it stops the device removals of #1452 on this card.** **Setup:** RTX 5080 16 GB, driver 621.14, Ryzen 5 3500X, Windows 10 22H2, release build. **Results:** - `cargo test --release -p xcl --lib nvprofile`: 4 passed, 0 failed. - `xcl nvprofile status` before install: `xcl.exe: the driver's default shader heap (512 MB on D3D12)`. - `xcl nvprofile install --mb 2048` in an elevated prompt printed: - `xcl.exe is in the profile "XCL (xcl-dev)"` - `xcl.exe: shader heap 2048 MB` - `status` from a normal prompt then read 2048 MB, before and after the title runs. - **Effect:** 7 unattended 240 s runs of a tree that lost the device in 6 of 7 runs at 512 MB, with no removal ([details on #2929](https://github.com/xcl-dev/xcl/pull/2929#issuecomment-7227895347)). - The runs used an `xcl.exe` from a different worktree than the one that ran the install; the profile holds only the file name. - **Code check:** I read `nvprofile.rs` against NVIDIA's public headers (`nvapi.h`, `nvapi_interface.h`, `nvapi_lite_common.h` from the R620 SDK). All 14 function IDs, the four status codes and the three struct layouts match. That includes `NVDRS_SETTING_V1`, whose `NvU64` union members sit under `#pragma pack(push, 4)`, so 12,324 bytes is right. **Not tested:** - `remove`. - `install` without elevation. - Other `--mb` values. - Other drivers or GPUs. AI use: Claude Code (Claude Opus 5.5) built the PR, checked the code against the headers, ran the tests and the title runs, and wrote this; I ran the elevated install.
thehollowedone commented 2026-11-28 23:58:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T23:58:09Z.


Independent Windows/NVIDIA check of #2590 head 2f131757 on an RTX 3080 Ti (driver 621.35), Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 MSVC. The checkout had no source changes.

  • cargo build --offline --locked -j 4 --workspace: passed.
  • cargo test --offline --locked -j 4 -p xcl --lib gpu::nvprofile -- --test-threads=1 --nocapture: 4 passed, 0 failed, 0 ignored. This includes the profile-ownership and NVAPI-status tests added after my earlier report.
  • target\debug\xcl.exe nvprofile status: exit 0, read the driver's default 512 MB shader heap. nvprofile install --mb 4096 was rejected by argument parsing (exit 2, expected 512–4095), before a driver write.
  • cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 --quiet, with XCL_DXIL_CACHE set to a fresh writable local directory: 1,469 passed, 0 failed, 47 ignored across 38 test result lines. The 25 SKIPPED notices are included in Cargo's passing count and do not count as GPU coverage.

Correction to my earlier suite result: with this sandbox's unwritable default DXIL-cache path, the suite had one failure in console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk (cached_only console_mesh hit: "DXIL not compiled yet"). The same test failed on untouched main 227d2cb, then passed on main when XCL_DXIL_CACHE pointed to the writable directory. The complete PR suite also passed with that setting. The test compiles a mesh pass-through before probing its disk cache; it needs a writable cache path for that probe.

I did not install or remove a driver profile, measure the larger shader heap, or run a title on this head. These checks cover the profile tests, read-only command behavior, and workspace suite on this adapter. AI use: Codex (GPT-6.2 Sol) ran the commands and wrote this report; Codex (GPT-6.2 Astra) independently traced the cache-test failure.

Current-main integration follow-up (29 Nov): I merged the unchanged head 2f131757 into a temporary checkout of main b10cc4c6. The merge and git diff --cached --check were clean. With an isolated Cargo target and writable DXIL cache, cargo build --offline --locked -j 4 --workspace passed. The workspace suite, excluding the three UMA remap tests listed below, reported 2,608 passed, 0 failed, 49 ignored across 41 test-result lines. Its 26 SKIPPED notices (21 no wave64, 3 refused per-lane forms, 2 no heap windows) are included in the passing count; all four nvprofile tests ran and passed.

The unfiltered isolated suite did not complete: the library process exited while remaking a coherent UMA window after a failed Windows remap of segment 2. An unfiltered library run on clean main passed 2,468/0/29 once on this machine, so I cannot classify the merged run's stop as baseline-equivalent. The scoped passing run is additional integration coverage, not full-suite clearance or a merge-ready verdict. I did not run a title or write a driver profile in this follow-up.

Exact scoped test command

cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 --skip hle::d3d12x::uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom --skip hle::d3d12x::uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment --skip hle::d3d12x::uma_driver::tests::failed_restore_stops_before_importing_an_unbacked_window

AI use for this follow-up: Codex (GPT-6.2 Sol) ran the integration build and tests, read the diff, and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7247782244 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7247782244). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-28T23:58:09Z. --- Independent Windows/NVIDIA check of [#2590 head `2f131757`](https://github.com/xcl-dev/xcl/commit/2f1317576957b29cde27e30eb9a90c8f65314b75) on an RTX 3080 Ti (driver 621.35), Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 MSVC. The checkout had no source changes. - `cargo build --offline --locked -j 4 --workspace`: passed. - `cargo test --offline --locked -j 4 -p xcl --lib gpu::nvprofile -- --test-threads=1 --nocapture`: **4 passed, 0 failed, 0 ignored**. This includes the profile-ownership and NVAPI-status tests added after my earlier report. - `target\debug\xcl.exe nvprofile status`: exit 0, read the driver's default 512 MB shader heap. `nvprofile install --mb 4096` was rejected by argument parsing (exit 2, expected 512–4095), before a driver write. - `cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 --quiet`, with `XCL_DXIL_CACHE` set to a fresh writable local directory: **1,469 passed, 0 failed, 47 ignored** across 38 test result lines. The 25 `SKIPPED` notices are included in Cargo's passing count and do not count as GPU coverage. **Correction to my earlier suite result:** with this sandbox's unwritable default DXIL-cache path, the suite had one failure in `console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk` (`cached_only console_mesh hit: "DXIL not compiled yet"`). The same test failed on untouched [`main` `227d2cb`](https://github.com/xcl-dev/xcl/commit/227d2cb388f103268dac7635ea720eb3e5352d4e), then passed on main when `XCL_DXIL_CACHE` pointed to the writable directory. The complete PR suite also passed with that setting. The test compiles a mesh pass-through before probing its disk cache; it needs a writable cache path for that probe. I did not install or remove a driver profile, measure the larger shader heap, or run a title on this head. These checks cover the profile tests, read-only command behavior, and workspace suite on this adapter. AI use: Codex (GPT-6.2 Sol) ran the commands and wrote this report; Codex (GPT-6.2 Astra) independently traced the cache-test failure. **Current-main integration follow-up (29 Nov):** I merged the unchanged [head `2f131757`](https://github.com/xcl-dev/xcl/commit/2f1317576957b29cde27e30eb9a90c8f65314b75) into a temporary checkout of [main `b10cc4c6`](https://github.com/xcl-dev/xcl/commit/b10cc4c6766adc947c2054ada4a2af98be15108d). The merge and `git diff --cached --check` were clean. With an isolated Cargo target and writable DXIL cache, `cargo build --offline --locked -j 4 --workspace` passed. The workspace suite, excluding the three UMA remap tests listed below, reported **2,608 passed, 0 failed, 49 ignored** across 41 test-result lines. Its 26 `SKIPPED` notices (21 no wave64, 3 refused per-lane forms, 2 no heap windows) are included in the passing count; all four `nvprofile` tests ran and passed. The unfiltered isolated suite did **not** complete: the library process exited while remaking a coherent UMA window after a failed Windows remap of segment 2. An unfiltered library run on clean `main` passed **2,468/0/29** once on this machine, so I cannot classify the merged run's stop as baseline-equivalent. The scoped passing run is additional integration coverage, not full-suite clearance or a merge-ready verdict. I did not run a title or write a driver profile in this follow-up. <details><summary>Exact scoped test command</summary> `cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 --skip hle::d3d12x::uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom --skip hle::d3d12x::uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment --skip hle::d3d12x::uma_driver::tests::failed_restore_stops_before_importing_an_unbacked_window` </details> AI use for this follow-up: Codex (GPT-6.2 Sol) ran the integration build and tests, read the diff, and wrote this report.
minimalhipster990 commented 2026-11-29 19:36:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by minimalhipster990 on 2026-11-29T19:36:58Z.


RTX 4090 24 GB: with install --mb 2048 the retail title ran 600 s in the world in 3 of 3 runs, no device removal. With the default 512 MB heap, the same tree and save gave 0 of 9: 8 removals (0x887a0005, DRED state 0) at 114–437 s and one silent stall. This adds a 24 GB Ada card to the 4080 / 5080 / 5090 results in #2403, and rules out system commit as the cause here.

Setup

  • RTX 4090 24 GB, NVIDIA 621.40, 32 GB RAM, Windows 11 build 26300, system-managed page file, Rust 1.99.1.
  • This PR's head 2f131757, release: cargo test --release --locked -p xcl --lib nvprofile -- --test-threads=1: 4 passed, 0 failed.
  • xcl nvprofile status before: xcl.exe: the driver's default shader heap (512 MB on D3D12). The command xcl nvprofile install --mb 2048 was run once from an elevated prompt. status after: xcl.exe: shader heap 2048 MB.
  • The title runs used another build named xcl.exe (the profile matches by exe name): main 7a649b0e + #3318 f5496479 + #3344 0f0cc342, release, local merge 966f035b. The setup and the 600 s replay are as in my #3344 comment: Series X profile, the same save and inputs, a verified copy of the same warm XCL cache, XCL_GFX_PSO_WAIT_MS=50 XCL_CS_PSO_WAIT_MS=200 XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_COHERENT_HEAPS=sparse XCL_TEXTURE_LEVEL_PAGES=1 XCL_COHERENT_MB=3990 XCL_TWO_PASS_MB=3072.

Results. "World" means the first 2 s interval with 10,000 or more draws.

shader heap extra settings runs end
512 MB – 2 removed at 268.0 s (world not reached) and 437.0 s (world at 310.3 s, no submits after 364.7 s)
512 MB XCL_DRED=pagefault 1 world at 113.3 s, then no submits, draws or I/O from 117.4 s to 600 s, with no removal and no warning
512 MB XCL_DRED=pagefault, XCL_THREAD_DUMP_AT 4 removed at 114.1–131.3 s
512 MB as above + XCL_COHERENT_MB=1024 2 removed at 117.7 and 120.1 s
2048 MB – 2 600 s, exit 0: world at 189.0 / 211.2 s, then 1.4 / 2.6 presents/s to the end
2048 MB XCL_DRED=pagefault, XCL_THREAD_DUMP_AT 1 600 s, exit 0: world at 182.9 s, then 2.8 presents/s to the end
  • Every removal with DRED on reported state 0: no page fault and no breadcrumbs. The system log had no TDR (Display 4101) and no low-memory event (2004).
  • The 2 GiB runs drew the world to the end: about 4,900 draws per present and 2,680–3,257 frames in all.

System commit is not the cause.

  • Every removal I logged today (18 runs, several trees) came with 1.0–5.4 GB of system commit left, so it looked like commit at first.
  • With the coherent window cut from 3,990 to 1,024 MB (the title put at most 108 MB in it), 5.0–5.2 GB were left, and the device was still removed at the same moment.
  • With the 2 GiB heap, system commit was under 1 GB from its limit for 41–62 samples per run (down to 289 MB), and no run was removed.

Not tested: 1024 MB or other sizes, remove (the profile is still installed), and runs interleaved in time: the 512 MB runs came first, the 2 GiB runs after them.

AI use: Claude Code (Claude Opus 5.5) built the trees, ran the tests, status and the replays, and wrote this report. The person running these tests ran install themselves from an elevated prompt.

<!-- greyfinch-sync:ivall/xcl:comment:7261419827 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7261419827). Originally posted by [minimalhipster990](https://github.com/minimalhipster990) on 2026-11-29T19:36:58Z. --- **RTX 4090 24 GB: with `install --mb 2048` the retail title ran 600 s in the world in 3 of 3 runs, no device removal. With the default 512 MB heap, the same tree and save gave 0 of 9: 8 removals (`0x887a0005`, DRED state 0) at 114–437 s and one silent stall.** This adds a 24 GB Ada card to the 4080 / 5080 / 5090 results in #2403, and rules out system commit as the cause here. **Setup** - RTX 4090 24 GB, NVIDIA 621.40, 32 GB RAM, Windows 11 build 26300, system-managed page file, Rust 1.99.1. - This PR's head `2f131757`, release: `cargo test --release --locked -p xcl --lib nvprofile -- --test-threads=1`: 4 passed, 0 failed. - `xcl nvprofile status` before: `xcl.exe: the driver's default shader heap (512 MB on D3D12)`. The command `xcl nvprofile install --mb 2048` was run once from an elevated prompt. `status` after: `xcl.exe: shader heap 2048 MB`. - The title runs used another build named `xcl.exe` (the profile matches by exe name): `main` `7a649b0e` + #3318 `f5496479` + #3344 `0f0cc342`, release, local merge `966f035b`. The setup and the 600 s replay are as in my [#3344 comment](https://github.com/xcl-dev/xcl/pull/3344#issuecomment-7259556837): Series X profile, the same save and inputs, a verified copy of the same warm XCL cache, `XCL_GFX_PSO_WAIT_MS=50 XCL_CS_PSO_WAIT_MS=200 XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_COHERENT_HEAPS=sparse XCL_TEXTURE_LEVEL_PAGES=1 XCL_COHERENT_MB=3990 XCL_TWO_PASS_MB=3072`. **Results.** "World" means the first 2 s interval with 10,000 or more draws. | shader heap | extra settings | runs | end | |---|---|---|---| | 512 MB | – | 2 | removed at 268.0 s (world not reached) and 437.0 s (world at 310.3 s, no submits after 364.7 s) | | 512 MB | `XCL_DRED=pagefault` | 1 | world at 113.3 s, then no submits, draws or I/O from 117.4 s to 600 s, with no removal and no warning | | 512 MB | `XCL_DRED=pagefault`, `XCL_THREAD_DUMP_AT` | 4 | removed at 114.1–131.3 s | | 512 MB | as above + `XCL_COHERENT_MB=1024` | 2 | removed at 117.7 and 120.1 s | | **2048 MB** | – | 2 | **600 s, exit 0**: world at 189.0 / 211.2 s, then 1.4 / 2.6 presents/s to the end | | **2048 MB** | `XCL_DRED=pagefault`, `XCL_THREAD_DUMP_AT` | 1 | **600 s, exit 0**: world at 182.9 s, then 2.8 presents/s to the end | - Every removal with DRED on reported state 0: no page fault and no breadcrumbs. The system log had no TDR (Display 4101) and no low-memory event (2004). - The 2 GiB runs drew the world to the end: about 4,900 draws per present and 2,680–3,257 frames in all. **System commit is not the cause.** - Every removal I logged today (18 runs, several trees) came with 1.0–5.4 GB of system commit left, so it looked like commit at first. - With the coherent window cut from 3,990 to 1,024 MB (the title put at most 108 MB in it), 5.0–5.2 GB were left, and the device was still removed at the same moment. - With the 2 GiB heap, system commit was under 1 GB from its limit for 41–62 samples per run (down to 289 MB), and no run was removed. **Not tested:** 1024 MB or other sizes, `remove` (the profile is still installed), and runs interleaved in time: the 512 MB runs came first, the 2 GiB runs after them. AI use: Claude Code (Claude Opus 5.5) built the trees, ran the tests, `status` and the replays, and wrote this report. The person running these tests ran `install` themselves from an elevated prompt.
afpruivo commented 2026-11-30 03:21:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by afpruivo on 2026-11-30T03:21:03Z.


World runs of the rebased head ffc7e0ac (on main 53e85fb1), with and without the profile this writes, on the retail title.

Setup: RTX 3090 24 GB, NVIDIA 621.40, i5-13600K, Windows 11 26300, release. One binary, copied twice: xcl.exe (in the profile, xcl nvprofile status: 2048 MB) and xcl-noprofile.exe (no profile, the driver's 512 MB). XCL_DIRECT_DXIL=1 XCL_NETWORK=0 XCL_UMA_DRIVER=mixed:1536:1792 XCL_TEXTURE_LEVEL_PAGES=1 XCL_DRED=1, scripted presses, 1500 s each. A first pair warmed the caches (neither reached the world: cold world-entry compiles after the 54 new main commits); the pair below ran back to back from those caches.

profile, 2048 MB no profile, 512 MB
reached the world (> 20,000 draws per 2 s) yes, at 591 s no
in the world 391 of the 2 s samples, to the end of the 1500 s –
device removal none at 172.8 s, 0x887a0005
frames shown 5,758 –
in the world (16 frames at 1200 s) 225 ms per frame (GPU span 224 ms) –

The removal looks like every no-profile one before it: "Dispatch with a translated pipeline skipped: whole compute pipeline (0x887a0005)", DRED device state 0, "page fault at GPU VA 0x0; allocations there: []", no list in flight. It came while the title was creating its whole-form compute pipelines on the way into the world.

One pair, so it adds to the earlier numbers here rather than standing on its own.

Not tested: more pairs on this head; --mb 1024; AMD (the command does nothing there).

AI use: Claude Code (Claude Opus 5.5) ran the runs, read the logs and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7267813638 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7267813638). Originally posted by [afpruivo](https://github.com/afpruivo) on 2026-11-30T03:21:03Z. --- World runs of the rebased head `ffc7e0ac` (on `main` `53e85fb1`), with and without the profile this writes, on the retail title. **Setup:** RTX 3090 24 GB, NVIDIA 621.40, i5-13600K, Windows 11 26300, release. One binary, copied twice: `xcl.exe` (in the profile, `xcl nvprofile status`: 2048 MB) and `xcl-noprofile.exe` (no profile, the driver's 512 MB). `XCL_DIRECT_DXIL=1 XCL_NETWORK=0 XCL_UMA_DRIVER=mixed:1536:1792 XCL_TEXTURE_LEVEL_PAGES=1 XCL_DRED=1`, scripted presses, 1500 s each. A first pair warmed the caches (neither reached the world: cold world-entry compiles after the 54 new `main` commits); the pair below ran back to back from those caches. | | profile, 2048 MB | no profile, 512 MB | |---|---|---| | reached the world (> 20,000 draws per 2 s) | yes, at 591 s | no | | in the world | 391 of the 2 s samples, to the end of the 1500 s | – | | device removal | none | at 172.8 s, `0x887a0005` | | frames shown | 5,758 | – | | in the world (16 frames at 1200 s) | 225 ms per frame (GPU span 224 ms) | – | The removal looks like every no-profile one before it: "Dispatch with a translated pipeline skipped: whole compute pipeline (0x887a0005)", DRED device state 0, "page fault at GPU VA 0x0; allocations there: []", no list in flight. It came while the title was creating its whole-form compute pipelines on the way into the world. One pair, so it adds to the earlier numbers here rather than standing on its own. **Not tested:** more pairs on this head; `--mb 1024`; AMD (the command does nothing there). AI use: Claude Code (Claude Opus 5.5) ran the runs, read the logs and wrote this.
AAsobu commented 2026-12-01 00:14:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by AAsobu on 2026-12-01T00:14:11Z.


merge-check
base: d0832e614f
head: ffc7e0acb9
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2894 passed, 0 failed, 51 ignored; SKIPPED: 28 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer / d3d12SDKLayers.dll, 1 no GPU_UPLOAD heaps); failing: none. The 4 gpu::nvprofile::tests pass.
review: none. Read the whole diff (+422/-0: gpu/nvprofile.rs, gpu/mod.rs, main.rs, README.md). status only reads (CreateSession, LoadSettings, FindApplicationByName, GetSetting; no SaveSettings); install and remove write only to the profile named XCL (xcl-dev) and refuse one that holds other applications or settings. The NVAPI interface ids used match the public NVAPI ones I know (Initialize, DRS CreateSession / DestroySession / LoadSettings / SaveSettings / FindApplicationByName / GetSetting). Nothing runs unless the command is used.
performance: the command changes nothing at run time by itself. What the profile does on this machine, retail title, release builds named xcl.exe, same settings each time (XCL_PREPARE=0 XCL_DIRECT_DXIL=1 XCL_DXC_THREADS=4 XCL_NETWORK=0 XCL_DRED=1 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=1000 XCL_TEXTURE_LEVEL_PAGES=1 XCL_HUGE_PSO_CONCURRENCY=4 XCL_HUGE_PSO_WANTED_CONCURRENCY=4, scripted start prompt, no input):

  • Before: xcl nvprofile status (this PR's head, debug) printed "xcl.exe: the driver's default shader heap (512 MB on D3D12)". In that state 13 of 13 runs that reached the world (main abec7ce9 to 86e86fcb and PRs on it) lost the device, at 143-816 s from start (in the 8 of them where I timed world entry, 5-50 s after it): 0x887a0005, DRED "page fault at GPU VA 0x0; allocations there: []", "no breadcrumbs" — the signature of #3277.
  • xcl nvprofile install --mb 1024 from an elevated prompt, then status (unelevated): "xcl.exe: shader heap 1024 MB".
  • After: 4 of 4 runs of 420 s (main ff0c364b twice, main + #3528 twice) stayed in the world ~220-270 s to the end with no removal; frames kept coming at about one per 2 s (GPU-bound).
  • Longer runs, main ff0c364b, one run each, played until 1800 s or the removal: with 1024 MB the device was lost at 1622 s, ~24 min after world entry at 155 s, with the same DRED output as above (920 new driver blobs that run); after xcl nvprofile install --mb 2048 (status: "shader heap 2048 MB") the run stayed in the world from 139 s to the 1800 s limit, ~28 min, with no removal. Frames held at about 1.2 presents per 2 s from 300 s to the end in both runs. So on this title the removal came ~24 min into the world with 1024 MB, and not within ~28 min with 2048 MB (one run each).
  • Not measured: the shader code in use at the removals.
    update (2026-12-01, same head ffc7e0ac): thehollowedone's follow-up is right on the source: check_owned takes has_heap from GetSetting finding the heap setting and never looks at its location, so a profile named XCL (xcl-dev) holding xcl.exe, one unrelated setting of its own and an inherited heap value passes owned (settings == 1 && has_heap), and remove would delete that unrelated setting with it. I missed it. It needs such a same-name profile to exist already, which install never makes, and I did not reproduce it; I read it as a small guard to add (their local_heap sketch), not a blocker, so my verdict stays. My in-world results with the profile at 2048 MB are unchanged.
    verdict: safe to merge
    hardware / tool and model: NVIDIA GeForce RTX 3090 24 GB (driver 621.24, wave32 only), Intel Core i5-10600K, 32 GB, Windows 11 Home build 26300, rustc 1.100.0 / Claude Code (Claude Opus 5.5), results checked by me
<!-- greyfinch-sync:ivall/xcl:comment:7296093108 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7296093108). Originally posted by [AAsobu](https://github.com/AAsobu) on 2026-12-01T00:14:11Z. --- merge-check base: d0832e614fa7d6ae027bb4feb27ccb9121f54a8f head: ffc7e0acb931a9d90cdac960ce5f38949ad2f470 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2894 passed, 0 failed, 51 ignored; SKIPPED: 28 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer / d3d12SDKLayers.dll, 1 no GPU_UPLOAD heaps); failing: none. The 4 `gpu::nvprofile::tests` pass. review: none. Read the whole diff (+422/-0: `gpu/nvprofile.rs`, `gpu/mod.rs`, `main.rs`, `README.md`). `status` only reads (CreateSession, LoadSettings, FindApplicationByName, GetSetting; no SaveSettings); `install` and `remove` write only to the profile named `XCL (xcl-dev)` and refuse one that holds other applications or settings. The NVAPI interface ids used match the public NVAPI ones I know (Initialize, DRS CreateSession / DestroySession / LoadSettings / SaveSettings / FindApplicationByName / GetSetting). Nothing runs unless the command is used. performance: the command changes nothing at run time by itself. What the profile does on this machine, retail title, release builds named `xcl.exe`, same settings each time (`XCL_PREPARE=0 XCL_DIRECT_DXIL=1 XCL_DXC_THREADS=4 XCL_NETWORK=0 XCL_DRED=1 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=1000 XCL_TEXTURE_LEVEL_PAGES=1 XCL_HUGE_PSO_CONCURRENCY=4 XCL_HUGE_PSO_WANTED_CONCURRENCY=4`, scripted start prompt, no input): - Before: `xcl nvprofile status` (this PR's head, debug) printed "xcl.exe: the driver's default shader heap (512 MB on D3D12)". In that state 13 of 13 runs that reached the world (`main` `abec7ce9` to `86e86fcb` and PRs on it) lost the device, at 143-816 s from start (in the 8 of them where I timed world entry, 5-50 s after it): 0x887a0005, DRED "page fault at GPU VA 0x0; allocations there: []", "no breadcrumbs" — the signature of #3277. - `xcl nvprofile install --mb 1024` from an elevated prompt, then `status` (unelevated): "xcl.exe: shader heap 1024 MB". - After: 4 of 4 runs of 420 s (`main` `ff0c364b` twice, `main` + #3528 twice) stayed in the world ~220-270 s to the end with no removal; frames kept coming at about one per 2 s (GPU-bound). - Longer runs, `main` `ff0c364b`, one run each, played until 1800 s or the removal: with 1024 MB the device was lost at 1622 s, ~24 min after world entry at 155 s, with the same DRED output as above (920 new driver blobs that run); after `xcl nvprofile install --mb 2048` (`status`: "shader heap 2048 MB") the run stayed in the world from 139 s to the 1800 s limit, ~28 min, with no removal. Frames held at about 1.2 presents per 2 s from 300 s to the end in both runs. So on this title the removal came ~24 min into the world with 1024 MB, and not within ~28 min with 2048 MB (one run each). - Not measured: the shader code in use at the removals. update (2026-12-01, same head `ffc7e0ac`): thehollowedone's follow-up is right on the source: `check_owned` takes `has_heap` from `GetSetting` finding the heap setting and never looks at its `location`, so a profile named `XCL (xcl-dev)` holding `xcl.exe`, one unrelated setting of its own and an inherited heap value passes `owned` (`settings == 1 && has_heap`), and `remove` would delete that unrelated setting with it. I missed it. It needs such a same-name profile to exist already, which `install` never makes, and I did not reproduce it; I read it as a small guard to add (their `local_heap` sketch), not a blocker, so my verdict stays. My in-world results with the profile at 2048 MB are unchanged. verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 3090 24 GB (driver 621.24, wave32 only), Intel Core i5-10600K, 32 GB, Windows 11 Home build 26300, rustc 1.100.0 / Claude Code (Claude Opus 5.5), results checked by me
jsalzy commented 2026-12-01 02:11:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jsalzy on 2026-12-01T02:11:49Z.


merge-check claim
head: ffc7e0acb9

<!-- greyfinch-sync:ivall/xcl:comment:7298347371 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7298347371). Originally posted by [jsalzy](https://github.com/jsalzy) on 2026-12-01T02:11:49Z. --- merge-check claim head: ffc7e0acb931a9d90cdac960ce5f38949ad2f470
jsalzy commented 2026-12-01 02:12:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jsalzy on 2026-12-01T02:12:43Z.


merge-check
base: d0832e6
head: ffc7e0a
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2894 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64 on this GPU; 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1); 1 driver cache cannot be disabled without Windows Developer Mode); failing: none
review: whole diff read (+422/-0: gpu/nvprofile.rs, gpu/mod.rs, main.rs, README.md). Opt-in: nothing changes at run time, and nvapi64.dll is loaded only by the xcl nvprofile subcommand. install writes the one DWORD setting 0x001ABC0F into a profile of its own and refuses a same-name profile that holds other applications or settings (owned, unit-tested); remove deletes only that profile; NVAPI codes other than not-found are errors, not "absent". The four nvprofile tests pass. Tried on this PC's real driver: from an elevated prompt, xcl nvprofile install --mb 2048 succeeded and xcl nvprofile status reports a 2048 MB shader heap for xcl.exe. A note for users: the profile matches the file name only, so a renamed binary keeps the 512 MB default (as #3277 found); the help text could say so. No duplicate: the other NVAPI PR (#1849) writes a different, temporary setting for PSO timing; #1607 lists this PR only as one where a test report helps.
performance: not measured; nothing changes at run time unless the command is run.
verdict: safe to merge
hardware / tool and model: RTX 4070 SUPER 12 GB (621.24 / 32.0.16.2124), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 25H2 26200.9974, Rust 1.100.0, debug / Claude app (Claude Opus 5.5): merge, build, suite and the nvprofile install/status on this PC; diff review by Claude Opus 5.5.

<!-- greyfinch-sync:ivall/xcl:comment:7298364105 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7298364105). Originally posted by [jsalzy](https://github.com/jsalzy) on 2026-12-01T02:12:43Z. --- merge-check base: d0832e6 head: ffc7e0a merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2894 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64 on this GPU; 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1); 1 driver cache cannot be disabled without Windows Developer Mode); failing: none review: whole diff read (+422/-0: gpu/nvprofile.rs, gpu/mod.rs, main.rs, README.md). Opt-in: nothing changes at run time, and nvapi64.dll is loaded only by the `xcl nvprofile` subcommand. install writes the one DWORD setting 0x001ABC0F into a profile of its own and refuses a same-name profile that holds other applications or settings (owned, unit-tested); remove deletes only that profile; NVAPI codes other than not-found are errors, not "absent". The four nvprofile tests pass. Tried on this PC's real driver: from an elevated prompt, `xcl nvprofile install --mb 2048` succeeded and `xcl nvprofile status` reports a 2048 MB shader heap for xcl.exe. A note for users: the profile matches the file name only, so a renamed binary keeps the 512 MB default (as #3277 found); the help text could say so. No duplicate: the other NVAPI PR (#1849) writes a different, temporary setting for PSO timing; #1607 lists this PR only as one where a test report helps. performance: not measured; nothing changes at run time unless the command is run. verdict: safe to merge hardware / tool and model: RTX 4070 SUPER 12 GB (621.24 / 32.0.16.2124), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 25H2 26200.9974, Rust 1.100.0, debug / Claude app (Claude Opus 5.5): merge, build, suite and the nvprofile install/status on this PC; diff review by Claude Opus 5.5.
brainhay5 commented 2026-12-01 02:28:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-12-01T02:28:04Z.


A title test on a 5070 Ti, which is a card this PR did not have: the profile removes the device removal we were hitting at world load on unmodified main.

Setup

  • RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088), Ryzen 7 5800X3D, 64 GB, Windows 11 22631.
  • This PR's head ffc7e0ac merged onto main d0832e61 (merge 0f453fd9, parents checked), cargo build --release -p xcl ok — built only to get xcl nvprofile.
  • status before: xcl.exe: the driver's default shader heap (512 MB on D3D12).
  • install --mb 2048 from an elevated shell: xcl.exe is in the profile "XCL (xcl-dev)", shader heap 2048 MB; status after agrees.
  • The title ran on the unmodified main binary, not on this PR's build — D:\Tools\xcl\target\release\xcl.exe at d0832e61, with XCL_PREPARE=0 XCL_NETWORK=0 XCL_RUN_SECONDS=330 and nothing else tuned. So the only thing that differed between the two runs below is the driver profile. It also applied to that copy, which is a second xcl.exe in a different directory — the name matching works as you describe.

Before the profile — ten runs today, all the same way

  • Device removed (0x887a0005) at frames 1432-1600, wall time 49.3-83.9 s. The frame is fixed; the time is not.
  • 1 Hz nvidia-smi trace: idle (2-9 %, 405-1,567 MHz, ~45 W) until 81 s, then 60→100 % for about 7 s at 3,007 MHz and 15,014-15,883 of 16,303 MB of video memory, and the removal lands inside that burst.
  • nvlddmkm Event ID 153, Error occurred on GPUID: a00, in the second of the removal.
  • Recorded-last at the loss: 3,501 ExecuteIndirect (DispatchMesh) / DispatchMesh "in two passes" calls across 12 programs, inside 1,301 pipelines.

With --mb 2048 — same binary, same settings

1,597 frames shown, 1,598 PresentX calls
330 s, ended by XCL_RUN_SECONDS, 1,597 frames shown
0 removals, 0 × 0x887a0005                       (before: removal at frames 1432-1600)
1500 frames at 187.9 s, 2.3 fps over the last 300 frames
42 "slow driver compile" lines, e.g. compute PSO 94,824 B DXIL, 2,890 ms

So the removal at world load on this card was the 512 MB shader-code heap, exactly as this PR describes, and 2 GiB was enough to get past it. It is not playable at that point — ~2.3 fps while 42 pipelines still build cold — which matches your 3090 result (device alive, not playable), but it is the first time this card has stayed alive through the world load instead of being removed about 80 s in.

One caveat on picking the size: I did not measure the code bytes here, only that 1,301 pipelines were recorded at the loss, so I cannot say whether 1 GiB would have been enough on this card. I went straight to 2048 MB on your nvidia-dev note, and it held.

AI use: an agent ran the builds, read the traces and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7298645089 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7298645089). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-12-01T02:28:04Z. --- A title test on a 5070 Ti, which is a card this PR did not have: the profile removes the device removal we were hitting at world load on unmodified `main`. **Setup** - RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088), Ryzen 7 5800X3D, 64 GB, Windows 11 22631. - This PR's head `ffc7e0ac` merged onto `main` `d0832e61` (merge `0f453fd9`, parents checked), `cargo build --release -p xcl` ok — built only to get `xcl nvprofile`. - `status` before: `xcl.exe: the driver's default shader heap (512 MB on D3D12)`. - `install --mb 2048` from an elevated shell: `xcl.exe is in the profile "XCL (xcl-dev)"`, `shader heap 2048 MB`; `status` after agrees. - **The title ran on the unmodified `main` binary, not on this PR's build** — `D:\Tools\xcl\target\release\xcl.exe` at `d0832e61`, with `XCL_PREPARE=0 XCL_NETWORK=0 XCL_RUN_SECONDS=330` and nothing else tuned. So the only thing that differed between the two runs below is the driver profile. It also applied to that copy, which is a second `xcl.exe` in a different directory — the name matching works as you describe. **Before the profile — ten runs today, all the same way** - Device removed (`0x887a0005`) at frames **1432-1600**, wall time 49.3-83.9 s. The frame is fixed; the time is not. - 1 Hz `nvidia-smi` trace: idle (2-9 %, 405-1,567 MHz, ~45 W) until 81 s, then 60→100 % for about 7 s at 3,007 MHz and 15,014-15,883 of 16,303 MB of video memory, and the removal lands inside that burst. - `nvlddmkm` Event ID 153, `Error occurred on GPUID: a00`, in the second of the removal. - Recorded-last at the loss: 3,501 `ExecuteIndirect (DispatchMesh)` / `DispatchMesh` "in two passes" calls across 12 programs, inside 1,301 pipelines. **With `--mb 2048` — same binary, same settings** ``` 1,597 frames shown, 1,598 PresentX calls 330 s, ended by XCL_RUN_SECONDS, 1,597 frames shown 0 removals, 0 × 0x887a0005 (before: removal at frames 1432-1600) 1500 frames at 187.9 s, 2.3 fps over the last 300 frames 42 "slow driver compile" lines, e.g. compute PSO 94,824 B DXIL, 2,890 ms ``` So the removal at world load on this card was the 512 MB shader-code heap, exactly as this PR describes, and 2 GiB was enough to get past it. It is not playable at that point — ~2.3 fps while 42 pipelines still build cold — which matches your 3090 result (device alive, not playable), but it is the first time this card has stayed alive through the world load instead of being removed about 80 s in. One caveat on picking the size: I did not measure the code bytes here, only that 1,301 pipelines were recorded at the loss, so I cannot say whether 1 GiB would have been enough on this card. I went straight to 2048 MB on your `nvidia-dev` note, and it held. *AI use: an agent ran the builds, read the traces and wrote this comment.*
thehollowedone commented 2026-12-01 05:03:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T05:03:18Z.


Follow-up to my earlier ownership review on current head ffc7e0ac: check_owned checks that GetSetting found the shader-heap ID, but does not inspect Setting.location. NVAPI documents that field as the source of the effective value, including inherited global/base values.

If a same-name profile contains xcl.exe and one unrelated local setting, while the heap setting is inherited, num_settings == 1 and GetSetting can both be true. The ownership guard then accepts the profile; remove deletes the unrelated setting with it. install can likewise reuse that profile. This is a source/API-contract case, not a reproduced driver-profile mutation.

Please treat the heap as this profile's setting only when GetSetting succeeds and settingLocation == NVDRS_CURRENT_PROFILE_LOCATION. Keep the current interrupted-install case (num_settings == 0) allowed. A focused regression should reject one unrelated local setting plus an inherited heap and accept a locally stored heap; it can pass the returned location into the pure ownership helper without writing a real profile.

Candidate guard and regression sketch
diff --git a/crates/xcl/src/gpu/nvprofile.rs b/crates/xcl/src/gpu/nvprofile.rs
@@
 const UNICODE_LEN: usize = 2048;
+// NVDRS_SETTING_LOCATION, in nvapi.h enum order.
+const CURRENT_PROFILE_LOCATION: u32 = 0;
+
+fn local_heap(found: bool, location: u32) -> bool {
+    found && location == CURRENT_PROFILE_LOCATION
+}
@@ unsafe fn check_owned(api: &Api, s: Handle, profile: Handle, exes: &[&str]) -> Result<(), String> {
-    let has_heap = found("GetSetting", (api.get_setting)(s, profile, SHADER_HEAP_VA, &mut *set))?;
+    let heap_found = found("GetSetting", (api.get_setting)(s, profile, SHADER_HEAP_VA, &mut *set))?;
+    let has_heap = local_heap(heap_found, set.location);
     if owned(p.is_predefined != 0, &apps, p.num_settings, has_heap, exes) {
@@ fn only_a_profile_xcl_could_have_made_is_changed() {
         assert!(owned(false, &apps(&["xcl.exe"]), 1, true, x));
+        // GetSetting can find an inherited heap while the one local setting is unrelated.
+        assert!(!owned(false, &apps(&["xcl.exe"]), 1, local_heap(true, 1), x));
+        assert!(owned(false, &apps(&["xcl.exe"]), 1, local_heap(true, 0), x));

I did not run builds, tests, or profile writes in this source review.

AI use: OpenAI Codex (GPT-6.2 Astra) identified the inherited-setting case; OpenAI Codex (GPT-6.2 Sol) checked the PR source and NVIDIA API documentation and drafted this note.

<!-- greyfinch-sync:ivall/xcl:comment:7301375026 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7301375026). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-12-01T05:03:18Z. --- Follow-up to my [earlier ownership review](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7189549068) on current head [`ffc7e0ac`](https://github.com/xcl-dev/xcl/commit/ffc7e0acb931a9d90cdac960ce5f38949ad2f470): [`check_owned`](https://github.com/xcl-dev/xcl/blob/ffc7e0acb931a9d90cdac960ce5f38949ad2f470/crates/xcl/src/gpu/nvprofile.rs#L177-L211) checks that `GetSetting` found the shader-heap ID, but does not inspect `Setting.location`. [NVAPI documents that field](https://docs.nvidia.com/nvapi/struct___n_v_d_r_s___s_e_t_t_i_n_g___v1.html) as the source of the effective value, including inherited global/base values. If a same-name profile contains `xcl.exe` and one *unrelated local* setting, while the heap setting is inherited, `num_settings == 1` and `GetSetting` can both be true. The ownership guard then accepts the profile; [`remove`](https://github.com/xcl-dev/xcl/blob/ffc7e0acb931a9d90cdac960ce5f38949ad2f470/crates/xcl/src/gpu/nvprofile.rs#L285-L299) deletes the unrelated setting with it. `install` can likewise reuse that profile. This is a source/API-contract case, not a reproduced driver-profile mutation. Please treat the heap as this profile's setting only when `GetSetting` succeeds **and** `settingLocation == NVDRS_CURRENT_PROFILE_LOCATION`. Keep the current interrupted-install case (`num_settings == 0`) allowed. A focused regression should reject one unrelated local setting plus an inherited heap and accept a locally stored heap; it can pass the returned location into the pure ownership helper without writing a real profile. <details> <summary>Candidate guard and regression sketch</summary> ```diff diff --git a/crates/xcl/src/gpu/nvprofile.rs b/crates/xcl/src/gpu/nvprofile.rs @@ const UNICODE_LEN: usize = 2048; +// NVDRS_SETTING_LOCATION, in nvapi.h enum order. +const CURRENT_PROFILE_LOCATION: u32 = 0; + +fn local_heap(found: bool, location: u32) -> bool { + found && location == CURRENT_PROFILE_LOCATION +} @@ unsafe fn check_owned(api: &Api, s: Handle, profile: Handle, exes: &[&str]) -> Result<(), String> { - let has_heap = found("GetSetting", (api.get_setting)(s, profile, SHADER_HEAP_VA, &mut *set))?; + let heap_found = found("GetSetting", (api.get_setting)(s, profile, SHADER_HEAP_VA, &mut *set))?; + let has_heap = local_heap(heap_found, set.location); if owned(p.is_predefined != 0, &apps, p.num_settings, has_heap, exes) { @@ fn only_a_profile_xcl_could_have_made_is_changed() { assert!(owned(false, &apps(&["xcl.exe"]), 1, true, x)); + // GetSetting can find an inherited heap while the one local setting is unrelated. + assert!(!owned(false, &apps(&["xcl.exe"]), 1, local_heap(true, 1), x)); + assert!(owned(false, &apps(&["xcl.exe"]), 1, local_heap(true, 0), x)); ``` </details> I did not run builds, tests, or profile writes in this source review. AI use: OpenAI Codex (GPT-6.2 Astra) identified the inherited-setting case; OpenAI Codex (GPT-6.2 Sol) checked the PR source and NVIDIA API documentation and drafted this note.
Foniass commented 2026-12-01 08:25:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:25:48Z.


Triage (#1607) – head ffc7e0a

No open or merged PR adds an NVIDIA driver-profile tool: nothing else touches NVAPI DRS or setting 0x001ABC0F. The other PRs that mention #2403 (#2469, #2496, #2526, #2641) change other code.
The parts of gpu/nvprofile.rs checked against nvapi.h look correct: the struct layouts and versions, the QueryInterface IDs, and the use of only the not-found codes as "absent". install and remove refuse a same-name profile with foreign apps or settings.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7305305602 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7305305602). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:25:48Z. --- **Triage (#1607)** – head ffc7e0a No open or merged PR adds an NVIDIA driver-profile tool: nothing else touches NVAPI DRS or setting 0x001ABC0F. The other PRs that mention #2403 (#2469, #2496, #2526, #2641) change other code. The parts of gpu/nvprofile.rs checked against nvapi.h look correct: the struct layouts and versions, the QueryInterface IDs, and the use of only the not-found codes as "absent". `install` and `remove` refuse a same-name profile with foreign apps or settings. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
afpruivo commented 2026-12-02 23:29:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by afpruivo on 2026-12-02T23:29:11Z.


@thehollowedone thank you, right: GetSetting also returns a setting the profile inherits (from the global or a predefined profile), so a same-name profile with no settings of its own read as holding the shader heap. Fixed in the one commit, now a00530ea (rebased onto main c53e9696, force-pushed; description updated): check_owned counts the heap as the profile's own only when settingLocation is NVDRS_CURRENT_PROFILE_LOCATION (0). Unit test: locations 1 and 2 are refused, 0 accepted.

@brainhay5 thank you for the 5070 Ti run.

Tested on a00530ea: cargo test --workspace --no-fail-fast -- --test-threads=4 3008 passed, 0 failed, 52 ignored, 26 SKIPPED; smoke pair against main c53e9696 in the description (1580 vs 1573 frames, no removals or crashes).

AI use: Claude Code (Claude Opus 5.5) made the fix, ran the tests and wrote this while I was away; posted with my standing approval for this session.

<!-- greyfinch-sync:ivall/xcl:comment:7362059106 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7362059106). Originally posted by [afpruivo](https://github.com/afpruivo) on 2026-12-02T23:29:11Z. --- @thehollowedone thank you, right: `GetSetting` also returns a setting the profile inherits (from the global or a predefined profile), so a same-name profile with no settings of its own read as holding the shader heap. Fixed in the one commit, now `a00530ea` (rebased onto `main` `c53e9696`, force-pushed; description updated): `check_owned` counts the heap as the profile's own only when `settingLocation` is `NVDRS_CURRENT_PROFILE_LOCATION` (0). Unit test: locations 1 and 2 are refused, 0 accepted. @brainhay5 thank you for the 5070 Ti run. Tested on `a00530ea`: `cargo test --workspace --no-fail-fast -- --test-threads=4` 3008 passed, 0 failed, 52 ignored, 26 SKIPPED; smoke pair against `main` `c53e9696` in the description (1580 vs 1573 frames, no removals or crashes). AI use: Claude Code (Claude Opus 5.5) made the fix, ran the tests and wrote this while I was away; posted with my standing approval for this session.
Foniass commented 2026-12-02 23:34:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T23:34:36Z.


Follow-up review of a00530ea, since ffc7e0a (code reading only, not a merge-check) · no new findings

In short: Since the triage note on ffc7e0a, install and remove treat the profile as XCL's only when its shader heap is stored in the profile itself. A heap inherited from the global or base profile (settingLocation other than 0) no longer counts as the profile's one setting. A test covers both cases. The rest of the commit is unchanged, and nothing blocks it.

Checked and fine
  • Setting (nvprofile.rs ~55) follows NVDRS_SETTING: version, name, id, type, then settingLocation. NVDRS_CURRENT_PROFILE_LOCATION is 0, with global 1, base 2, default 3.
  • local_heap(found, location) is true only when GetSetting found the heap and it is stored in the profile itself. When the setting is not found, location is not read.
  • owned now gets local_heap(..), so a same-name profile whose only "setting" is an inherited heap is refused, as one with foreign settings already was. The test covers locations 1 and 2 (refused) and 0 (owned).
  • The earlier triage points (struct layouts and versions, QueryInterface IDs, only the not-found codes counted as absent, foreign apps or settings refused) are unchanged.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7362172252 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2590#issuecomment-7362172252). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T23:34:36Z. --- **Follow-up review** of `a00530ea`, since `ffc7e0a` (code reading only, not a merge-check) · no new findings **In short:** Since the triage note on `ffc7e0a`, `install` and `remove` treat the profile as XCL's only when its shader heap is stored in the profile itself. A heap inherited from the global or base profile (`settingLocation` other than 0) no longer counts as the profile's one setting. A test covers both cases. The rest of the commit is unchanged, and nothing blocks it. <details><summary>Checked and fine</summary> - `Setting` (`nvprofile.rs` ~55) follows `NVDRS_SETTING`: version, name, id, type, then `settingLocation`. `NVDRS_CURRENT_PROFILE_LOCATION` is 0, with global 1, base 2, default 3. - `local_heap(found, location)` is true only when `GetSetting` found the heap and it is stored in the profile itself. When the setting is not found, `location` is not read. - `owned` now gets `local_heap(..)`, so a same-name profile whose only "setting" is an inherited heap is refused, as one with foreign settings already was. The test covers locations 1 and 2 (refused) and 0 (owned). - The earlier triage points (struct layouts and versions, QueryInterface IDs, only the not-found codes counted as absent, foreign apps or settings refused) are unchanged. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2590:upstream-pr/2590'
git switch 'upstream-pr/2590'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2590'
git switch 'upstream-pr/2590'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2590'
git switch 'upstream-pr/2590'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2590'
git switch 'main'
git merge --squash 'upstream-pr/2590'
git switch 'main'
git merge --ff-only 'upstream-pr/2590'
git switch 'main'
git merge 'upstream-pr/2590'
git push origin 'main'
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
xcl-dev/xcl!2580
No description provided.