D3D12.X: gate 128-256 KiB compute driver compiles in MEDIUM_COMPILES #2726
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2726
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2726"
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?
@Saksukella on GitHub · 2026-11-26 08:59 UTC · original
Saksukella:fix/gate-medium-compute-pso→amd-dev· +169 −6 · 1 files · 3 commits · openWhat is in it
crates/xcl/src/hle/d3d12x/real.rs:MEDIUM_COMPUTE_DRIVER_COMPILE = 128 << 10(128 KiB) anddriver_compile_gate_bytes(kind: &str, huge_bytes: usize)so medium-sized (128..512 KiB) translated compute PSOs ("compute"/"compute retry") enter theMEDIUM_COMPILESconcurrency gate instead of compiling ungated across all worker threads on AMD's driver (amdxc64), and updatefinish_two_passto use the same compute gate threshold.256..512 KiBthreshold, keep small (< 128 KiB) compute PSOs ungated, preserveBIG_COMPILES(512..900 KiB) andGIANT_COMPILES(>= 900 KiB), and keep title-thread binds ungated (driver_compile_identifiedonly gates background worker compiles).gate_driver_compile_with_thresholdtaking explicithuge_threshold,commit_free, andwantedpredicates somedium_compute_worker_compiles_are_gated_in_medium_laneis deterministic regardless ofXCL_HUGE_PSO_BYTESor host free commit memory, and guardMEDIUM_COMPILESslot cleanup on drop.GLOBAL_SLOTS_TEST_LOCKand unit testsmedium_compute_gate_threshold_applies_only_to_computeandmedium_compute_worker_compiles_are_gated_in_medium_lane.amd-dev(whereMEDIUM_COMPILESanddriver_compile_identifiedlive).Tested
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::big_compile_tests: both new tests (medium_compute_gate_threshold_applies_only_to_compute,medium_compute_worker_compiles_are_gated_in_medium_lane) andsmall_and_title_thread_compiles_bypass_the_gatepassed (the single failuregiant_driver_compiles_have_their_own_laneis pre-existing onamd-devb5c0275fbecauseparse_rt_skip_hashesparses"bad"as hex0xbad).Regression run
Not tested
AI use
179–217 KiBcompute PSO driver-compile stalls, designing the128 KiBMEDIUM_COMPILESgate, authoring deterministic unit tests, and running local tests and smoke verification. All diffs and measurements were verified locally on hardware.@emirduran707 on GitHub · 2026-11-26 09:47 UTC · original
Independent AMD RDNA4 (native wave64) verification of exact PR head
d7a34bb3201a0692ca648e3aa33723e683210f82(base: amd-dev) on Windows 11 Pro 26300 (AMD Radeon RX 9060 XT 16 GB, driver32.0.31044.16, Ryzen 5 5600, Rust 1.100.0 MSVC, DXC1.9.2602.17).Tested
cargo build --workspace(debug): passed (0errors).cargo test --workspace --no-fail-fast -- --test-threads=4:1658 passed, 14 failed, 47 ignored(5 SKIPPED: 4f16_programs_on_the_gpuper-lane forms refused by host adapter/driver, 1pso_measurement_compiles_an_exact_synthetic_recordWindows Developer Mode off).hle::d3d12x::real::big_compile_tests::medium_compute_gate_threshold_applies_only_to_computehle::d3d12x::real::big_compile_tests::medium_compute_worker_compiles_are_gated_in_medium_laneamd-devbase (#2738on the same base reproduces the exact same 14 failures on this machine).cargo build --release -p xcl+ 60 s retail-title smoke test (scripts/smoke.ps1, offline):Not tested
AI use
@luckyteagirl on GitHub · 2026-11-26 09:59 UTC · original · reviewed
On
d7a34bb, the newmedium_compute_worker_compiles_are_gated_in_medium_lanetest can hang under a supported setting: run it withXCL_HUGE_PSO_BYTES=65536. Itssmall_csworker uses 131071 bytes, but the effective compute gate becomesmin(65536, 131072) = 65536, so that worker waits forMEDIUM_COMPILES. The test already holds every medium slot and callssmall_cs.join()beforedrop(held), making the join and release wait on each other indefinitely. The default-threshold AMD test report does not exercise this case.Could the fixture inject a fixed threshold independent of the process environment, and use a bounded completion channel so an unexpected wait fails without blocking the test indefinitely? Please ensure held slots are released before joining workers on every failure path. This is exact-head source review; I did not run a deliberately hanging test process.
@Saksukella on GitHub · 2026-11-26 11:33 UTC · original
Good catch @luckyteagirl — fixed in
71f30c6f. Extractedgate_driver_compile_with_threshold(compute, bytes, huge_threshold)somedium_compute_worker_compiles_are_gated_in_medium_laneinjects a fixed 256 KiB threshold independent ofXCL_HUGE_PSO_BYTES, uses boundedrecv_timeoutchecks, and always releases held slots before joining workers on every path. Verifiedbig_compile_testspasses under both default env andXCL_HUGE_PSO_BYTES=65536, plus 60s RX 9070 XT smoke (1672 frames, 15066 MB, 0 removals, 0 crashes).@Prime1997 on GitHub · 2026-11-26 12:40 UTC · original · reviewed
Needs changes in the regression fixture; keep the compute-gate change. On head
71f30c6fe84fe22cbc8b87d5056c09e99612d56a, the fixed threshold and release-before-join address the earlier environment-dependent deadlock. A separate wait condition remains:medium_compute_worker_compiles_are_gated_in_medium_lanestill uses the real commit-headroom predicate throughgate_driver_compile_with_threshold. Its named 180 KiB worker has no pending pipeline, sobuild_is_wanted()stays false. With available system commit persistently below 3 GiB, the gate continues waiting even after the held slots are released. The two-second receive timeout is followed by an unconditional join, so the test cannot reach its failure assertion while that condition persists.Please inject a controlled commit/wanted predicate for this fixture and ensure cleanup makes the worker exit before joining, including after a receive timeout. This is exact-head source review only: no low-memory stress, deliberately hanging process, build, GPU or title test was run for this finding. It does not establish a defect in the intended runtime throttling policy.
AI use: Codex (GPT-6) checked the current source and discussion and drafted this review. Optional temporary Discord for coordinating contributor work, testing and comparing results.
@Saksukella on GitHub · 2026-11-26 13:42 UTC · original
Good catch @Prime1997 — fixed in \6034426. \gate_driver_compile_with_threshold\ now takes explicit \commit_free\ and \wanted\ predicates (defaulting to \ig_compile_commit_free(big_compile_headroom(bytes))\ and \pso_async::build_is_wanted\ in \driver_compile_identified), and \medium_compute_worker_compiles_are_gated_in_medium_lane\ injects deterministic predicates plus a drop-based \Cleanup\ guard so the test never stalls on hosts with < 3 GiB free commit headroom. Re-verified with unit tests and a fresh 60s RX 9070 XT smoke (\1482\ frames, \
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.