D3D12.X: gate 128-256 KiB compute driver compiles in MEDIUM_COMPILES #2726

Open
github-bot wants to merge 1 commit from github-bot/gh-2726 into amd-dev AGit
Owner

@⁠Saksukella on GitHub · 2026-11-26 08:59 UTC · original
Saksukella:fix/gate-medium-compute-pso → amd-dev · +71 −6 · 1 files · 1 commits · open

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs:
    • Add MEDIUM_COMPUTE_DRIVER_COMPILE = 128 << 10 (128 KiB) and driver_compile_gate_bytes(compute, big_compute_limit) so medium-sized (128–256 KiB) translated compute PSOs enter the MEDIUM_COMPILES concurrency gate instead of compiling ungated across all worker threads on AMD's driver (amdxc64).
    • Keep graphics PSOs and small (< 128 KiB) compute PSOs ungated, keep >= 256 KiB compute PSOs on MEDIUM_COMPILES and >= 1 MiB on GIANT_COMPILES (unchanged), and keep title-thread binds ungated (driver_compile_identified only gates background worker compiles).
    • Add GLOBAL_SLOTS_TEST_LOCK and unit tests medium_compute_driver_compiles_gate_at_128_kib and graphics_driver_compiles_ignore_128_kib_compute_gate.
  • Target branch: amd-dev (where MEDIUM_COMPILES and driver_compile_identified live).

Tested

  • Hardware: AMD Radeon RX 9070 XT (driver 32.0.32029.2010), 24-thread x86_64 CPU, 32 GB RAM, Windows; rustc 1.100.0 (0ef1bc386 2026-11-09); debug (tests) and release (xcl.exe).
  • cargo test -p xcl --lib hle::d3d12x::real::tests::big_compile_tests: 14 passed, 1 failed (0.30s; both new tests and small_and_title_thread_compiles_bypass_the_gate passed; the single failure giant_driver_compiles_have_their_own_lane is pre-existing on amd-dev b5c0275f because parse_rt_skip_hashes parses "bad" as hex 0xbad).

Regression run

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: AMD Radeon RX 9070 XT
title: b8db18c2
seconds: 60
exit: 0x0
frames shown: 1624 (PresentX 1624)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 19700 MB
xcl-smoke v1
commit: d7a34bb3201a0692ca648e3aa33723e683210f82
gpu: AMD Radeon RX 9070 XT
title: b8db18c2
seconds: 60
exit: 0x0
frames shown: 1675 (PresentX 1675)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15680 MB

Not tested

  • NVIDIA and Intel GPU adapters (tested on AMD Radeon RX 9070 XT only).

AI use

  • Antigravity + Gemini (web-server-mcp agent team): assisted with profiling 179–217 KiB compute PSO driver-compile stalls, designing the 128 KiB MEDIUM_COMPILES gate, authoring unit tests, and running local tests and smoke verification. All diffs and measurements were verified locally on hardware.
**@⁠Saksukella** on GitHub · 2026-11-26 08:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/2726) `Saksukella:fix/gate-medium-compute-pso` → `amd-dev` · +71 −6 · 1 files · 1 commits · open **What is in it** - `crates/xcl/src/hle/d3d12x/real.rs`: - Add `MEDIUM_COMPUTE_DRIVER_COMPILE = 128 << 10` (128 KiB) and `driver_compile_gate_bytes(compute, big_compute_limit)` so medium-sized (`128–256 KiB`) translated compute PSOs enter the `MEDIUM_COMPILES` concurrency gate instead of compiling ungated across all worker threads on AMD's driver (`amdxc64`). - Keep graphics PSOs and small (`< 128 KiB`) compute PSOs ungated, keep `>= 256 KiB` compute PSOs on `MEDIUM_COMPILES` and `>= 1 MiB` on `GIANT_COMPILES` (unchanged), and keep title-thread binds ungated (`driver_compile_identified` only gates background worker compiles). - Add `GLOBAL_SLOTS_TEST_LOCK` and unit tests `medium_compute_driver_compiles_gate_at_128_kib` and `graphics_driver_compiles_ignore_128_kib_compute_gate`. - Target branch: `amd-dev` (where `MEDIUM_COMPILES` and `driver_compile_identified` live). **Tested** - Hardware: AMD Radeon RX 9070 XT (driver `32.0.32029.2010`), 24-thread x86_64 CPU, 32 GB RAM, Windows; `rustc 1.100.0 (0ef1bc386 2026-11-09)`; debug (tests) and release (`xcl.exe`). - `cargo test -p xcl --lib hle::d3d12x::real::tests::big_compile_tests`: 14 passed, 1 failed (`0.30s`; both new tests and `small_and_title_thread_compiles_bypass_the_gate` passed; the single failure `giant_driver_compiles_have_their_own_lane` is pre-existing on `amd-dev` `b5c0275f` because `parse_rt_skip_hashes` parses `"bad"` as hex `0xbad`). **Regression run** ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: AMD Radeon RX 9070 XT title: b8db18c2 seconds: 60 exit: 0x0 frames shown: 1624 (PresentX 1624) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 19700 MB ``` ``` xcl-smoke v1 commit: d7a34bb3201a0692ca648e3aa33723e683210f82 gpu: AMD Radeon RX 9070 XT title: b8db18c2 seconds: 60 exit: 0x0 frames shown: 1675 (PresentX 1675) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15680 MB ``` **Not tested** - NVIDIA and Intel GPU adapters (tested on AMD Radeon RX 9070 XT only). **AI use** - Antigravity + Gemini (`web-server-mcp` agent team): assisted with profiling `179–217 KiB` compute PSO driver-compile stalls, designing the `128 KiB` `MEDIUM_COMPILES` gate, authoring unit tests, and running local tests and smoke verification. All diffs and measurements were verified locally on hardware.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:04:36 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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