Shaders: keep xcl shaders out of EcoQoS execution-speed throttling #2767
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2777"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-26T11:55:40Z.
xcl shaders(--recomp,--precompile) is long CPU-bound work the user waits on, but Windows 11 puts it under EcoQoS when its console is not in the foreground, and on a hybrid CPU that keeps its threads on the E-cores. This opts the process out of execution-speed throttling at the start ofshaders::run, with the sameSetProcessInformation(ProcessPowerThrottling)callkernelx::fine_timer(#300) already makes for timer resolution. If Windows refuses, it prints a warning and goes on as before.What is in it
crates/xcl/src/shaders.rs:full_speed(), called at the start ofrun, and a unit test that reads the state back withGetProcessInformation(it fails without the call:ControlMaskreads back as 0).Tested
RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF (8 P-cores / 16 logical, 16 E-cores), Windows 11 26200, stable Rust, debug for the tests, release for the runs.
cargo test --workspace -- --test-threads=4: 1436 passed, 0 failed, 47 ignored; 26SKIPPED(no wave64, no dxil.dll).xcl shaders <retail shader pack> --recompstarted from a background shell, average use per logical CPU over 50 s (\Processor(*)\% Processor Time, 2 s samples), release builds of main and of this head:b49be18e59d1d1The whole
xcl shaders <retail shader pack> --recomp(26,698 programs), same background shell, wall-clock time, runs alternated main / PR / main / PR: main 195.4 s, 193.0 s; this PR 143.4 s, 143.4 s (26 % less).Regression run
xcl rundoes not reach the changed code, so this is only a regression check.Not tested
--precompile(DXC and driver compiles; only--recompwas timed), a run started from a foreground window, AMD and Intel GPUs, CPUs without E-cores (the call should change nothing there), Windows 10.nvidia-dev, which also runxcl shadersand would get this when it is merged there.AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-26T13:06:11Z.
Review: COMMENTED
Good within the reviewed scope; retain for integration. This draft has a useful, narrowly scoped change: it disables execution-speed EcoQoS throttling for the shader command process.
PR head
e59d1d11043b4620aaa961d93580bf1171f2ae2fintegrated locally with current mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. The detached worktree remains at main with the combined changes staged, treeed8cd9ab3bdcd5975bdab074e4e683e7f6346dd4; it is an uncommitted integration candidate, not a clean PR-head run. Source patch SHA-256374d930a3c5c9ed3e40170d33c82a65135712a743aa01c1488f84281e3ee6fb2.Targeted result: 1 passed, 0 failed, 0 ignored, 0 skipped. Each exact filter ran in a fresh process:
shaders::tests::full_speed_turns_execution_speed_throttling_offBuild:
cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>. Run:<test-exe> <each-exact-filter-above> --exact --test-threads=1 --nocapture. Private executable/target paths are placeholders. Windows 11 Pro 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug. These selected fixtures did not dispatch GPU work.Not tested: The process power-state fixture passed. It does not establish faster compilation, different scheduling priority or system-wide power changes. No whole suite or retail smoke was run for this batch; this is not merge certification.
AI use: Codex (GPT-6) reviewed source, ran the selected tests and verified raw results. Optional temporary Discord for coordinating contributor work, testing and comparing results.
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-27T09:10:21Z.
@Prime1997 thanks for the run. On the point under Not tested: the description has the compile-time numbers from a hybrid CPU (i9-14900KF, 8 P + 16 E), where this matters. The full
xcl shaders --recompof a retail pack (26,698 programs) started from a background shell took 195.4 s / 193.0 s on main and 143.4 s / 143.4 s with this PR (runs alternated), and the P-cores went from 9.3 % to 76.8 % average use. An i5-10400 has no E-cores, so I would expect little or no difference there: EcoQoS mostly moves the work to E-cores. The PR is out of draft now; it merges cleanly with currentmain.AI use: Claude Code (Claude Opus 5.5) wrote this reply from the measurements in the description.
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-27T09:41:30Z.
Rerun on current
main(623d02e4, and9da51938= that plus this PR), same machine as in the description (i9-14900KF, 8 P + 16 E). The 26 % saving does not reproduce today: Windows is not throttlingmainnow either, so there is nothing for the PR to undo.xcl shaders <retail shader pack> --recomp, release, runs in A-B-B-A order:During a
mainrun the P-cores now average 57 % (E-cores 72 %), against 9.3 % / 98.7 % in the description's measurement. So it isn't the power plan, and I found no change onmainsinceb49be183that touches the process's priority or QoS. My best guess is Windows' own foreground/background heuristic: the original runs started while the window that launched them was in the background, and today's did not. I can't reproduce that condition reliably, so I'm not claiming more than this. The PR is still the documented way to opt out (SetProcessInformation(ProcessPowerThrottling), askernelxalready does for the timer), and it costs nothing when Windows does not throttle. But on this evidence the saving shows only when Windows decides to throttle the process, not on every run. The unit test passes on the merge with currentmain(1 passed, 0 failed).AI use: Claude Code (Claude Opus 5.5) ran the timings and wrote this comment.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:56:33Z.
Triage (#1607) – head
e59d1d1No open or merged PR does this for
xcl shaders. Closed #2589 putPROCESS_POWER_THROTTLING_EXECUTION_SPEEDintokernelx::fine_timerforxcl run, and main does not have it. TheSetProcessInformationcall matches the existingfine_timercall, and the test reads the state back withGetProcessInformation. Note that the runtime's own shader-preparation workers (pipeline_worker_command,--graphics-recordsworkers) also runshaders::run, so they opt out too. That looks intended, but the description could say so. The branch conflicts with main.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.