D3D12.X: read the late-release setting at adoption, not at first release #1779
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1789"
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 vakaobr on 2026-11-24T20:44:47Z.
On a Mac (CrossOver, D3DMetal), D3DMetal releases the resources of an executed command list from a native thread of its own, which has no Wine TEB. The first
Releasethere callslate_release::enabled(), whoseOnceLockreadsXCL_LATE_RELEASEfrom the environment for the first time, and that read never returns on that thread. This reads the setting inreal::adopt, on the Wine thread that creates the object, so theOnceLockis set before the host's thread can reach it. Nothing changes on Windows: the same value is read once, only earlier.Part of #258. It is the first commit of the series Ahmet-Dedeler reviewed in https://github.com/xcl-dev/xcl/issues/258#issuecomment-7137896678; the rest (deferring a
Releasethat arrives on a host thread) stays a separate PR, since no test here needs it yet (https://github.com/xcl-dev/xcl/issues/258#issuecomment-7143690405).What is in it
crates/xcl/src/hle/d3d12x/late_release.rs:init(), which forces the one-time read.crates/xcl/src/hle/d3d12x/real.rs:adoptcalls it for every adopted object.Tested
x86_64-pc-windows-gnu(mingw-w64 GCC 16.2.0), debug, DXC 1.9.2609. Each test in its own process (<test exe> --exact <test> --test-threads=1 --nocapture, 90 to 120 s timeout).console_wave64_compute_through_the_pso_hook_dispatch_and_read_back(tests/gpu_compute_e2e.rs) andhle::d3d12x::title_textures::tests::gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes:main85e3826+ #553 + Ahmet-Dedeler'sddf3be7(which fix the other hangs in these two tests on this host): both time out, the first 2 of 2.main85e3826alone, with and without this commit: no run passes; each times out or ends without a result, on the hangs #553 andddf3be7fix.late_releaseunit tests (a_held_resource_goes_when_the_queue_is_past_its_batch,without_queues_a_batch_goes_at_once): pass.Regression run
This changes runtime files, so it needs an
xcl-smokepair from someone with a title; I have none.Not tested
XCL_LATE_RELEASEearlier.AI use
Imported from ivall/xcl. Originally posted by eizispark on 2026-11-24T21:04:45Z.
Hardware test report — commit
2e85970Verified
2e85970aa5f53c8617985b380e4f35920e6d041c(clean merge withmainea683a0): pass.Tested
32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 x64 (stable-x86_64-pc-windows-msvc,rustc 1.100.0 (0ef1bc386 2026-11-09)), debug tests + release smokecargo test --workspace --no-fail-fast -- --test-threads=4:875 passed, 0 failed, 42 ignored(2 skipped:shaders::tests::pso_measurement_compiles_an_exact_synthetic_record— Windows Developer Mode required (0x887A002D);heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows)hle::d3d12x::late_release::tests(a_held_resource_goes_when_the_queue_is_past_its_batch,without_queues_a_batch_goes_at_once),hle::d3d12x::title_textures::tests::gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes,console_wave64_compute_through_the_pso_hook_dispatch_and_read_back, and both native RDNA4 wave64 GPU tests (gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware) passed cleanly on Windows 11 MSVCRegression run (
scripts/smoke.ps1, 60 s, warm shader/driver cache)main(85e38262ff94aecd75d6f83fa8156a8b7697bd13):PR (
2e85970aa5f53c8617985b380e4f35920e6d041c):Not tested
XCL_D3D12_DEBUG=1retail run, gameplay past the menusAI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T23:41:50Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored.Thanks!
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T03:20:43Z.
PR #1789 compatibility verification on STOR-WINLAB
Tested commit
2e85970aa5f53c8617985b380e4f35920e6d041c. The diff initializes the cachedXCL_LATE_RELEASEvalue during D3D12.X object adoption, before the release hook can read it.Tested
DoublePrecisionFloatShaderOps=0, andd3d12SDKLayers.dllabsent. Rust 1.100.0, DXC and DXIL 1.9.2609.5, unoptimized builds with debug info disabled.cargo build --workspaceandcargo test --workspace --no-runsucceeded.cargo test -p xcl late_release -- --nocapturereturned 2 passed, 0 failed, 0 ignored, 0 skips. The existing tests verified that a held resource drains after the queue passes its fence and that a batch drains immediately when there are no queues. Both also passed in the workspace run.cargo test --workspace --no-fail-fast -- --test-threads=4ran once under the shared Arc lock and returned exit code 101. Across 20 libtest summaries, including doctests, the totals were 857 passed, 18 failed, 42 ignored. The log contains 4SKIPPEDlines. Those skipped paths supply no coverage even where libtest reports the enclosing test as passed.Failures and skips
CreateComputePipelineStateerror0x80070057, including FP64 tests. Four reported assertion mismatches in fused F32 overflow, implicit texture LOD, F16 high-half preservation, and pixel-shader wave reductions.RSSetDepthBiasX(-1000.5)left the top-right pixel blue when the test expected green.Not tested
Wine/D3DMetal and the native release thread without a Wine TEB, a main-branch baseline, retail-title smoke runs, sample-dependent paths, and other GPU vendors. This run establishes Windows behavior for the tested head. A baseline would be needed to attribute the suite failures to the PR.
AI use
T3 Code / Codex (
gpt-6.2-sol,reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity,gemini-4-neon) verified counts againstpr1789-suite.logand published this report.Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:58:37Z.
Review: COMMENTED
No confirmed source defect found. Initializing late-release configuration on the Wine adoption thread preserves Windows behavior and addresses the D3DMetal host-thread situation. Merge readiness needs evidence reconciliation: independent reports show a clean suite/smoke, but the visible PR-description check fails. Residual validation includes no automated host-thread-without-TEB or D3DMetal integration regression, plus no NVIDIA/Intel Windows smoke.
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:40:05Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:47:35Z.
Triage (#1607) – head
a0087f2Not on main:
late_release::enabled()is still first read inres_release. #2445 and #2498 are stacked on this PR. #2445's bottom commit (9ac7d636) is this same change rebased, and #2498 is on top of #2445. They are not duplicates of it.No problems found in the diff. The failing check is
PR description;Build and testis green.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.