Merge main into amd-dev #3444

Merged
lucsoft merged 650 commits from upstream-pr/3444 into amd-dev 2026-11-30 21:25:21 +00:00
lucsoft commented 2026-11-29 18:02:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by lucsoft on 2026-11-29T18:02:09Z.


This PR merges main into amd-dev, so the two branches stop drifting apart, the same way #3203 did for nvidia-dev. amd-dev branched from main at 2c717a04 (2026-11-27) and has not taken main since. That is about 650 commits, including the nvidia-dev merge (#3203) and the fixes that came after it.

Please merge with a merge commit, not squash or rebase. That way git records that main is in amd-dev, and the next sync does not hit the same conflicts again.

What is in it

  • 4fedcbc8: a merge commit. Its parents are amd-dev 10582c42 (first parent) and main 24d21a41.

  • 5eb7f8fb: a second merge, of the current amd-dev head 36e16cf4 (73 commits newer than 10582c42), resolved by the same rules (below). git merge-tree --write-tree upstream/amd-dev HEAD returns this head's tree, so the PR merges into amd-dev without conflicts.

  • 3277acaf: a third merge, of amd-dev 6bab0c53 (11 commits newer than 36e16cf4: bake indices through the view heap's slots, XCL_FFX_RESET, black skipped Bink movies, BVH-builder binds, reflection fallback, XCL_TRACE_INDEXED, XCL_SKIP_CS, …). Four files conflicted:

    • title_textures.rs: main's Transition record is kept beside amd-dev's Kept / kept(); amd-dev's tuple Transition and LIST_NOTES are not taken, since main tracks list transitions its own way.
    • console_list.rs: both sides' locals are kept, and XCL_SKIP_CS goes in front of main's pso_user_sgprs_exact.
    • real.rs: indexed::note_made goes in before main's console_heap::write + vram::track_srv. main's lazy flag sits beside the BVH-builder image_only.
    • bind.rs:
      • uncover_indexed takes amd-dev's indexed::resources.
      • Bake detection keeps main's original pipeline for is_kept.
      • main's skip_untranslated_dispatch is followed by left_out::direct.
    • indexed.rs calls main's read_committed_into where amd-dev has copy_readable; both read with zeros for unreadable pages.
  • 069c29fe: late_release seals a held resource's batch without waiting for a busy queue lease (queue_submit::try_with). Fixes the three-thread deadlock through the D3D12 runtime's lock that raylitebull found on Windows; the path is main's (byte-identical files), not the merge's.

Three fixes on top of the third merge, found in retail runs on Linux (RX 7800 XT, RADV):

  • 859e8ad2 ambient: find the stand-in's passes and build its helpers under Wine. The stand-in lighting never applied on this merge. There was no captured … sky dome or applied line, so with XCL_RT_GATE=miss every missed ray brought sky light indoors: overexposure and sparkles. It had three causes:
    • Merge regression: main's split-chain ExecuteIndirect path returned before the ambient hook. The hook now runs there too.
    • Role lookup: roles were looked up by the resolved PC pipeline, which lazy and background builds replace. Roles are now noted at the title's CreatePipelineState and looked up by the bound pipeline or the console record.
    • Helper compiles: the helper programs went through D3DCompile, which is vkd3d-shader under Wine and refuses them. They now compile DXC first (dxc::compile_sm6_first), as do the depth-twin, present and mirror helpers. scatter's program stays on D3DCompile, because built with DXC it scattered writes to wrong places.
    • XCL_AMBIENT_DIAG=1 logs each lighting pass's path and role.
  • 2f3d1135 zero recycled page-pool tiles before a new texture uses them. This is a merge regression. amd-dev zeroed recycled pool tiles (XCL_ZERO_TARGET_PAGES, on by default); taking main's vram.rs dropped that. New render targets such as the probe light history then started with another image's bytes, which showed as a mosaic of other shots in the lighting.
    • It is now back on main's page pool, zeroed on the tile-mapping queue before the UpdateTileMappings. XCL_ZERO_TARGET_PAGES=0 turns it off.
    • In a run: 2 GiB of tiles zeroed by world+60 s, and the mosaic was gone.
  • e3fae4ed keep dispatch chain scratch until the GPU is done with it. The title's final Release of an allocator cleared its chain recordings even when alloc_pool still held the allocator because it was busy. A later submit then ran chains on freed scratch.
    • The world hangs on Linux are GPU read faults followed by a ring timeout, 2–4 min after world entry. A local address log puts several fault addresses in freed chain-scratch ranges.
    • Recordings now go only when the pool proves the allocator free. main has the same code (alloc_release).

How the conflicts were resolved:

A plain merge produced about 315 conflict hunks in 46 files. Most of them came from the same nvidia-dev line being integrated twice:

  • amd-dev merged nvidia-dev d1be8103 its own way.
  • main merged nvidia-dev through #3203.

Rules applied:

  1. Code both sides got from nvidia-dev: main's version is kept, because it is newer and has the follow-up fixes. Changes from amd-dev's own 49 commits are re-applied on top of it.
  2. amd-dev's own features are kept and wired:
    • Ambient, barrier groups, depth twins, format aliases, ps_masks, rt_leave_out. These files are byte-identical to amd-dev.
    • Indirect light (8942a5b9).
    • XCL_RT_GATE, with the BVH builder off by default.
    • The write-watch reductions (f2f02bd0, fe5260b6, 3bb095a0).
    • Texture-upload spares and the upload wait fix (1be2221e, 512b0bbc).
    • Early-exit-safe multi-wave s_barrier in direct DXIL (965cc655).
    • The DXIL shrink/compact series.
    • The XMemVirtualAlloc fixes (108cbafa, 23d0f365).
    • DirectStorage swizzle (081da4b9).
    • Pipeline library off by default on AMD (f33df5a7). This lives in main's own shaders/pipeline_library.rs, and XCL_PSO_LIBRARY=0/1 overrides it.
  3. Commits left out because main already has them: 21 in total. 17 match by subject. The other four are b958a344 (= 3cde0cc3), 60345c97, 61559df6 (main has 2fc61b64) and da910ccd (main has its own pipeline library, AMD driver-cache default and sampler keys).

Where main's behaviour was kept over amd-dev's:

Please check these if they matter to you:

  • alloc_pool: release_when_done, release_finished and take_excess_aside are dropped, because main has its own probe-based allocator retirement. pending_gpu_marks() is rewritten for main's fence structure.
  • sparse.rs: based on main. Dropped:
    • the CPU wait for tile mappings (XCL_SPARSE_CPU_WAIT_MS, the RX 9070 device-removal fix),
    • wait_pending_mappings,
    • the readback-queue retire fences.
  • vram.rs: based on main. Dropped: zero-fill of recycled tiles and deferred unmap batches. vram_small.rs is not wired in; on amd-dev it was on by default.
  • bind.rs, two-pass paths: main's record buffers and scale-args code. Dropped: XCL_TWO_PASS_SHARED, the 4-UAV scale-args root signature, and the UNKNOWN_RES fence tracking.
  • console_heap.rs, title_textures.rs, dispatch_chain.rs, the present compositor, DXIL live lanes: main's versions.
  • The SRV/UAV paths in real.rs: main's slot() lookups.
  • 82d5eea8 (preparation progress per variant): not ported, because it conflicted everywhere with main's reworked preparation UI.
  • Memory defaults: main's. XCL_TEXTURE_LEVEL_PAGES and XCL_SMALL_TEXTURES stay opt-in, and the upload buffers stay at 512 MB.

Second merge (36e16cf4), what needed more than a mechanical resolution:

  • 29 of the 73 commits are already in main in some form; main's version is kept (duplicate tests dropped).
  • Ported onto main's code: the direct wave32 graphics reductions (8c79f57e), quad-only PS reads beside main's EXEC fallback (45ed56c8), the page comparison after remap and GPU-written new textures in main's texture selection (02ceae64, 0b985d7e), the sparse range keeping (707123ad, static renamed RANGES_KEPT), the look stats (2a630fd2), urgent PSO workers on main's Build queue (4dea333d), the RAM floor after main's compile gates (927524e7), the --measure-* options (5ab4f647), the newer-forms selection (e35c3840; main's EXEC-select fold stays on for every program).
  • Left out: the XCL_ASYNC_SUBMIT submit thread (27f5f621, db556c26, b54c6d9b, 9f9a9bce, 077047a3; built on amd-dev's ExecuteCommandLists hook and alloc_pool, which the first merge replaced), the unlocked sparse CPU read (09536b89, eabf2de0; needs amd-dev's sparse landing), the shared deferred two-pass batch buffer (c7388f3d, 34e95e7b, 0bad17b7; needs the dropped XCL_TWO_PASS_SHARED tracking), 5c5ee83f (main already keeps XCL_DXIL_NO_OPT runs out of the cache). From 36e16cf4 the newer-forms defaults and XCL_DIRECT_COMPACT_MIN are taken, its huge-compile defaults (64 KiB, 2 at a time) are not: they would turn off main's AMD medium-compute gate.

Tests changed:

Removed, because they test code that was dropped above:

  • title_textures::a_sampled_shadowed_texture_is_active_again
  • alloc_pool::excess_idle_aside_allocators_are_reclaimed_while_title_and_busy_ones_stay
  • the vram_small test module

Changed:

  • early_depth: false added to the older PsInterface literals.
  • main's robustness tests that expected multi-wave barriers to fall back to HLSL now expect amd-dev's direct safe barrier.

Tested

  • cargo build --release -p xcl and cargo build --release -p xcl --tests succeed on all three merge commits. These are cross builds to x86_64-pc-windows-gnu on Linux.

  • On 3277acaf, the unit tests of the modules the third merge touched were run under Wine 11.21, with XCL_DXC_DIR pointing at DXC 1.9.2609:

    • all pass: indexed (4), bvh_spare (4), ffx (3), title_textures (70 passed, 1 ignored), console_list (12), left_out (9).
    • Two d3d12x::bind tests fail: gpu_two_pass_indirect_commands_keep_their_own_records and prepared_initial_pipeline_commits_only_after_create_or_reset_success. They fail the same way on the previous head 069c29fe, because the Wine test prefix has no real D3D12 device; the merge did not cause them.
    • The rest of the suite was not run.
  • Retail title on Linux: Wine 11.21 staging, vkd3d-proton 3.1 with a newer dxil-spirv, RX 7800 XT (RDNA3), RADV. Several runs with this tree plus a few local patches (mimalloc, a pixel-shader loop cap, #794, #1244, #681), using XCL_RT_GATE=miss XCL_AMBIENT=sky and the default coherent window:

    • The title reaches the world at 12–16 fps with ambient lighting active.
    • No GPU hang and no device removal.
    • The 0xc0000005 read at 0x400016000 (xg::copy_from into a GPU heap routed to the sparse windows) does not occur. It happened on amd-dev without main's fixes in every run we made, including with #3369.
    • About 20 s after world entry, the title's own watchdog still fires: game+0x23cf683 writes to 0x0, as in #846. The title waits on a bottom-of-pipe word while XCL has no pending fence, queue wait or Wait64 cell.
  • On e3fae4ed the release build and --tests build succeed, and the first new commit builds on its own. Unit tests under Wine:

    • pass: ambient 18, alloc_pool 28 (including the new a_final_release_retains_a_busy_allocator_and_not_a_free_one), depth_uav 21.
    • vram: 72 passed, 1 failed. d32s8_targets_take_their_own_size_of_video_memory fails the same way on 3277acaf.
    • dispatch_chain: 25 passed, 2 failed, both in the test helper slot_of ("adopted class"). One of them, failed_binding_keeps_indirect_commands_until_allocator_reset, fails the same way without the fix. The other is the new GPU test a_released_allocator_keeps_its_chains_until_the_gpu_is_done, which needs the same test setup fixed, so it proves nothing yet.
  • In the title:

    • The stand-in and zero-fill commits ran in several runs on a local stack: stand-in applied, no mosaic.
    • The chain fix has not run in the title yet.

Regression run

No xcl-smoke blocks yet: scripts/smoke.ps1 has not been run on this head or on main. These runs were on Linux/Wine outside the script (see Tested). Like #3203, the file list also trips the binary-file check: the GitHub files API returns no patch for these large merged files, so they are reported as binary.

Not tested

  • Windows and NVIDIA.
  • Most of the test suite (only the modules above were run, under Wine).
  • This exact tree in the title (only with the local patches listed above).
  • The amd-dev-specific stability fixes that were dropped in favour of main (above), on the GPUs they were made for.

AI use

Claude Code (Claude Opus 5.5) did the conflict resolution, with sub-agents doing the commit-by-commit resolution, and wrote this description, at my request and under my review.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5553526506 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3444). Originally posted by [lucsoft](https://github.com/lucsoft) on 2026-11-29T18:02:09Z. --- This PR merges `main` into `amd-dev`, so the two branches stop drifting apart, the same way #3203 did for `nvidia-dev`. `amd-dev` branched from `main` at `2c717a04` (2026-11-27) and has not taken `main` since. That is about 650 commits, including the `nvidia-dev` merge (#3203) and the fixes that came after it. **Please merge with a merge commit, not squash or rebase.** That way git records that `main` is in `amd-dev`, and the next sync does not hit the same conflicts again. **What is in it** - `4fedcbc8`: a merge commit. Its parents are `amd-dev` `10582c42` (first parent) and `main` `24d21a41`. - `5eb7f8fb`: a second merge, of the current `amd-dev` head `36e16cf4` (73 commits newer than `10582c42`), resolved by the same rules (below). `git merge-tree --write-tree upstream/amd-dev HEAD` returns this head's tree, so the PR merges into `amd-dev` without conflicts. - `3277acaf`: a third merge, of `amd-dev` `6bab0c53` (11 commits newer than `36e16cf4`: bake indices through the view heap's slots, `XCL_FFX_RESET`, black skipped Bink movies, BVH-builder binds, reflection fallback, `XCL_TRACE_INDEXED`, `XCL_SKIP_CS`, …). Four files conflicted: - `title_textures.rs`: `main`'s `Transition` record is kept beside `amd-dev`'s `Kept` / `kept()`; `amd-dev`'s tuple `Transition` and `LIST_NOTES` are not taken, since `main` tracks list transitions its own way. - `console_list.rs`: both sides' locals are kept, and `XCL_SKIP_CS` goes in front of `main`'s `pso_user_sgprs_exact`. - `real.rs`: `indexed::note_made` goes in before `main`'s `console_heap::write` + `vram::track_srv`. `main`'s lazy flag sits beside the BVH-builder `image_only`. - `bind.rs`: - `uncover_indexed` takes `amd-dev`'s `indexed::resources`. - Bake detection keeps `main`'s `original` pipeline for `is_kept`. - `main`'s `skip_untranslated_dispatch` is followed by `left_out::direct`. - `indexed.rs` calls `main`'s `read_committed_into` where `amd-dev` has `copy_readable`; both read with zeros for unreadable pages. - `069c29fe`: `late_release` seals a held resource's batch without waiting for a busy queue lease (`queue_submit::try_with`). Fixes the three-thread deadlock through the D3D12 runtime's lock that raylitebull found on Windows; the path is `main`'s (byte-identical files), not the merge's. Three fixes on top of the third merge, found in retail runs on Linux (RX 7800 XT, RADV): - `859e8ad2` **ambient: find the stand-in's passes and build its helpers under Wine.** The stand-in lighting never applied on this merge. There was no `captured … sky dome` or `applied` line, so with `XCL_RT_GATE=miss` every missed ray brought sky light indoors: overexposure and sparkles. It had three causes: - **Merge regression:** `main`'s split-chain ExecuteIndirect path returned before the ambient hook. The hook now runs there too. - **Role lookup:** roles were looked up by the resolved PC pipeline, which lazy and background builds replace. Roles are now noted at the title's `CreatePipelineState` and looked up by the bound pipeline or the console record. - **Helper compiles:** the helper programs went through `D3DCompile`, which is vkd3d-shader under Wine and refuses them. They now compile DXC first (`dxc::compile_sm6_first`), as do the depth-twin, present and mirror helpers. `scatter`'s program stays on `D3DCompile`, because built with DXC it scattered writes to wrong places. - `XCL_AMBIENT_DIAG=1` logs each lighting pass's path and role. - `2f3d1135` **zero recycled page-pool tiles before a new texture uses them.** This is a merge regression. `amd-dev` zeroed recycled pool tiles (`XCL_ZERO_TARGET_PAGES`, on by default); taking `main`'s `vram.rs` dropped that. New render targets such as the probe light history then started with another image's bytes, which showed as a mosaic of other shots in the lighting. - It is now back on `main`'s page pool, zeroed on the tile-mapping queue before the `UpdateTileMappings`. `XCL_ZERO_TARGET_PAGES=0` turns it off. - In a run: 2 GiB of tiles zeroed by world+60 s, and the mosaic was gone. - `e3fae4ed` **keep dispatch chain scratch until the GPU is done with it.** The title's final `Release` of an allocator cleared its chain recordings even when `alloc_pool` still held the allocator because it was busy. A later submit then ran chains on freed scratch. - The world hangs on Linux are GPU read faults followed by a ring timeout, 2–4 min after world entry. A local address log puts several fault addresses in freed chain-scratch ranges. - Recordings now go only when the pool proves the allocator free. `main` has the same code (`alloc_release`). How the conflicts were resolved: A plain merge produced about 315 conflict hunks in 46 files. Most of them came from the same `nvidia-dev` line being integrated twice: - `amd-dev` merged `nvidia-dev` `d1be8103` its own way. - `main` merged `nvidia-dev` through #3203. Rules applied: 1. **Code both sides got from `nvidia-dev`:** `main`'s version is kept, because it is newer and has the follow-up fixes. Changes from `amd-dev`'s own 49 commits are re-applied on top of it. 2. **`amd-dev`'s own features are kept and wired:** - Ambient, barrier groups, depth twins, format aliases, `ps_masks`, `rt_leave_out`. These files are byte-identical to `amd-dev`. - Indirect light (`8942a5b9`). - `XCL_RT_GATE`, with the BVH builder off by default. - The write-watch reductions (`f2f02bd0`, `fe5260b6`, `3bb095a0`). - Texture-upload spares and the upload wait fix (`1be2221e`, `512b0bbc`). - Early-exit-safe multi-wave `s_barrier` in direct DXIL (`965cc655`). - The DXIL shrink/compact series. - The XMemVirtualAlloc fixes (`108cbafa`, `23d0f365`). - DirectStorage swizzle (`081da4b9`). - Pipeline library off by default on AMD (`f33df5a7`). This lives in `main`'s own `shaders/pipeline_library.rs`, and `XCL_PSO_LIBRARY=0/1` overrides it. 3. **Commits left out because `main` already has them:** 21 in total. 17 match by subject. The other four are `b958a344` (= `3cde0cc3`), `60345c97`, `61559df6` (`main` has `2fc61b64`) and `da910ccd` (`main` has its own pipeline library, AMD driver-cache default and sampler keys). Where `main`'s behaviour was kept over `amd-dev`'s: Please check these if they matter to you: - **`alloc_pool`:** `release_when_done`, `release_finished` and `take_excess_aside` are dropped, because `main` has its own probe-based allocator retirement. `pending_gpu_marks()` is rewritten for `main`'s fence structure. - **`sparse.rs`:** based on `main`. Dropped: - the CPU wait for tile mappings (`XCL_SPARSE_CPU_WAIT_MS`, the RX 9070 device-removal fix), - `wait_pending_mappings`, - the readback-queue retire fences. - **`vram.rs`:** based on `main`. Dropped: zero-fill of recycled tiles and deferred unmap batches. `vram_small.rs` is not wired in; on `amd-dev` it was on by default. - **`bind.rs`, two-pass paths:** `main`'s record buffers and scale-args code. Dropped: `XCL_TWO_PASS_SHARED`, the 4-UAV scale-args root signature, and the `UNKNOWN_RES` fence tracking. - **`console_heap.rs`, `title_textures.rs`, `dispatch_chain.rs`, the present compositor, DXIL live lanes:** `main`'s versions. - **The SRV/UAV paths in `real.rs`:** `main`'s `slot()` lookups. - **`82d5eea8` (preparation progress per variant):** not ported, because it conflicted everywhere with `main`'s reworked preparation UI. - **Memory defaults:** `main`'s. `XCL_TEXTURE_LEVEL_PAGES` and `XCL_SMALL_TEXTURES` stay opt-in, and the upload buffers stay at 512 MB. Second merge (`36e16cf4`), what needed more than a mechanical resolution: - 29 of the 73 commits are already in `main` in some form; `main`'s version is kept (duplicate tests dropped). - Ported onto `main`'s code: the direct wave32 graphics reductions (8c79f57e), quad-only PS reads beside `main`'s EXEC fallback (45ed56c8), the page comparison after remap and GPU-written new textures in `main`'s texture selection (02ceae64, 0b985d7e), the sparse range keeping (707123ad, static renamed `RANGES_KEPT`), the look stats (2a630fd2), urgent PSO workers on `main`'s `Build` queue (4dea333d), the RAM floor after `main`'s compile gates (927524e7), the `--measure-*` options (5ab4f647), the newer-forms selection (e35c3840; `main`'s EXEC-select fold stays on for every program). - Left out: the `XCL_ASYNC_SUBMIT` submit thread (27f5f621, db556c26, b54c6d9b, 9f9a9bce, 077047a3; built on `amd-dev`'s ExecuteCommandLists hook and alloc_pool, which the first merge replaced), the unlocked sparse CPU read (09536b89, eabf2de0; needs `amd-dev`'s sparse landing), the shared deferred two-pass batch buffer (c7388f3d, 34e95e7b, 0bad17b7; needs the dropped `XCL_TWO_PASS_SHARED` tracking), 5c5ee83f (`main` already keeps `XCL_DXIL_NO_OPT` runs out of the cache). From 36e16cf4 the newer-forms defaults and `XCL_DIRECT_COMPACT_MIN` are taken, its huge-compile defaults (64 KiB, 2 at a time) are not: they would turn off `main`'s AMD medium-compute gate. Tests changed: Removed, because they test code that was dropped above: - `title_textures::a_sampled_shadowed_texture_is_active_again` - `alloc_pool::excess_idle_aside_allocators_are_reclaimed_while_title_and_busy_ones_stay` - the `vram_small` test module Changed: - `early_depth: false` added to the older `PsInterface` literals. - `main`'s robustness tests that expected multi-wave barriers to fall back to HLSL now expect `amd-dev`'s direct safe barrier. **Tested** - `cargo build --release -p xcl` and `cargo build --release -p xcl --tests` succeed on all three merge commits. These are cross builds to `x86_64-pc-windows-gnu` on Linux. - On `3277acaf`, the unit tests of the modules the third merge touched were run under Wine 11.21, with `XCL_DXC_DIR` pointing at DXC 1.9.2609: - all pass: `indexed` (4), `bvh_spare` (4), `ffx` (3), `title_textures` (70 passed, 1 ignored), `console_list` (12), `left_out` (9). - Two `d3d12x::bind` tests fail: `gpu_two_pass_indirect_commands_keep_their_own_records` and `prepared_initial_pipeline_commits_only_after_create_or_reset_success`. They fail the same way on the previous head `069c29fe`, because the Wine test prefix has no real D3D12 device; the merge did not cause them. - The rest of the suite was not run. - Retail title on Linux: Wine 11.21 staging, vkd3d-proton 3.1 with a newer dxil-spirv, RX 7800 XT (RDNA3), RADV. Several runs with this tree plus a few local patches (mimalloc, a pixel-shader loop cap, #794, #1244, #681), using `XCL_RT_GATE=miss XCL_AMBIENT=sky` and the default coherent window: - The title reaches the world at 12–16 fps with ambient lighting active. - No GPU hang and no device removal. - The `0xc0000005` read at `0x400016000` (`xg::copy_from` into a GPU heap routed to the sparse windows) does not occur. It happened on `amd-dev` without `main`'s fixes in every run we made, including with #3369. - About 20 s after world entry, the title's own watchdog still fires: `game+0x23cf683` writes to `0x0`, as in #846. The title waits on a bottom-of-pipe word while XCL has no pending fence, queue wait or `Wait64` cell. - On `e3fae4ed` the release build and `--tests` build succeed, and the first new commit builds on its own. Unit tests under Wine: - pass: `ambient` 18, `alloc_pool` 28 (including the new `a_final_release_retains_a_busy_allocator_and_not_a_free_one`), `depth_uav` 21. - `vram`: 72 passed, 1 failed. `d32s8_targets_take_their_own_size_of_video_memory` fails the same way on `3277acaf`. - `dispatch_chain`: 25 passed, 2 failed, both in the test helper `slot_of` ("adopted class"). One of them, `failed_binding_keeps_indirect_commands_until_allocator_reset`, fails the same way without the fix. The other is the new GPU test `a_released_allocator_keeps_its_chains_until_the_gpu_is_done`, which needs the same test setup fixed, so it proves nothing yet. - In the title: - The stand-in and zero-fill commits ran in several runs on a local stack: stand-in applied, no mosaic. - The chain fix has **not** run in the title yet. **Regression run** No `xcl-smoke` blocks yet: `scripts/smoke.ps1` has not been run on this head or on `main`. These runs were on Linux/Wine outside the script (see **Tested**). Like #3203, the file list also trips the binary-file check: the GitHub files API returns no patch for these large merged files, so they are reported as binary. **Not tested** - Windows and NVIDIA. - Most of the test suite (only the modules above were run, under Wine). - This exact tree in the title (only with the local patches listed above). - The `amd-dev`-specific stability fixes that were dropped in favour of `main` (above), on the GPUs they were made for. **AI use** Claude Code (Claude Opus 5.5) did the conflict resolution, with sub-agents doing the commit-by-commit resolution, and wrote this description, at my request and under my review. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
raylitebull commented 2026-11-29 19:27:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-29T19:27:04Z.


Tested 4fedcbc8 as-is on Windows 11, RX 9070 XT, release build, on a retail title.

  • With preparation on (XCL_PREPARE_WORKERS=2): preparation finished (compute check ~780 s and 604 graphics pipelines in ~1020 s on a cold driver cache). The title then froze ~8 s after starting: 0 presents, 0 submits until killed. No device removal.
  • With your settings (XCL_RT_GATE=miss XCL_AMBIENT=sky, defaults otherwise) and XCL_PREPARE=0: loading screens at 30 fps, in-game pipeline builds, then from ~310 s 0 presents and 0 submits to the end of the 600 s run. Never reached the world. No device removal, peak commit 21.8 GB.
  • The same title reaches the world on current amd-dev on this PC in ~70 s.

Thread stacks of the frozen process show a three-thread deadlock through the D3D12 runtime's lock:

  1. Queue thread: real::q_execute_command_lists → queue_submit::with (holds the submit lease) → SubmissionChunk::submit_effects → sparse::readback_after_execute_with → ID3D12CommandAllocator::Reset → waits on an SRW lock inside D3D12Core.
  2. List reset: title_list::reset → list_x::reset_pc → alloc_pool::reset_list → inside D3D12Core, the runtime releases a resource → real::res_release → late_release::hold (takes HELD) → drain_known → queue_submit::with → Lease::enter waits for (1)'s lease.
  3. A title thread: real::res_release → late_release::hold waits for HELD held by (2).

vkd3d-proton doesn't have D3D12Core's lock, which would explain why this doesn't show on Linux. Two possible fixes: don't take the submit lease from a release hook that can run inside a runtime call (defer drain_known, or skip sealing when the lease is busy), or don't call into D3D12 (allocator Reset) while holding the lease. I haven't checked whether plain main hits this on Windows too.

The PR head has moved to 5eb7f8fb since; I have not tested that commit.

<!-- greyfinch-sync:ivall/xcl:comment:7261289536 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3444#issuecomment-7261289536). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-29T19:27:04Z. --- Tested 4fedcbc8 as-is on Windows 11, RX 9070 XT, release build, on a retail title. - With preparation on (`XCL_PREPARE_WORKERS=2`): preparation finished (compute check ~780 s and 604 graphics pipelines in ~1020 s on a cold driver cache). The title then froze ~8 s after starting: 0 presents, 0 submits until killed. No device removal. - With your settings (`XCL_RT_GATE=miss XCL_AMBIENT=sky`, defaults otherwise) and `XCL_PREPARE=0`: loading screens at 30 fps, in-game pipeline builds, then from ~310 s 0 presents and 0 submits to the end of the 600 s run. Never reached the world. No device removal, peak commit 21.8 GB. - The same title reaches the world on current amd-dev on this PC in ~70 s. Thread stacks of the frozen process show a three-thread deadlock through the D3D12 runtime's lock: 1. Queue thread: `real::q_execute_command_lists` → `queue_submit::with` (holds the submit lease) → `SubmissionChunk::submit_effects` → `sparse::readback_after_execute_with` → `ID3D12CommandAllocator::Reset` → waits on an SRW lock inside D3D12Core. 2. List reset: `title_list::reset` → `list_x::reset_pc` → `alloc_pool::reset_list` → inside D3D12Core, the runtime releases a resource → `real::res_release` → `late_release::hold` (takes `HELD`) → `drain_known` → `queue_submit::with` → `Lease::enter` waits for (1)'s lease. 3. A title thread: `real::res_release` → `late_release::hold` waits for `HELD` held by (2). vkd3d-proton doesn't have D3D12Core's lock, which would explain why this doesn't show on Linux. Two possible fixes: don't take the submit lease from a release hook that can run inside a runtime call (defer `drain_known`, or skip sealing when the lease is busy), or don't call into D3D12 (allocator `Reset`) while holding the lease. I haven't checked whether plain `main` hits this on Windows too. The PR head has moved to 5eb7f8fb since; I have not tested that commit.
lucsoft commented 2026-11-29 19:32:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by lucsoft on 2026-11-29T19:32:35Z.


Thanks for testing this on Windows and for the stacks – that pinned it down.

The deadlock isn't from the merge: late_release.rs, queue_submit.rs and sparse::readback_after_execute_with are byte-identical to main here, so main should hit the same three-thread wait on Windows. amd-dev doesn't have #2959's submit lease, which is why it doesn't show there.

The cycle closes in late_release::Held::drain: it signals each queue's fence under HELD through native_queue_signal, which waits for the queue's lease. I pushed 069c29fe (your first option): sealing takes the lease only when it is free (queue_submit::try_with, native_queue_try_signal). If another thread has the queue's turn, the batch stays open, and the next drain closes it – the late-release thread drains every TICK. HELD is never held while waiting for a lease now, so a Release from inside a runtime call no longer waits for the queue thread. There's a unit test for try_with (no wait for another thread's turn, re-entrant on the owner).

Tested only on Linux (Wine + vkd3d-proton, RX 7800 XT), where the deadlock can't happen: builds, tests build. I can't run Windows here – could you try the new head when you have a moment? If it's easier to review on its own, I can open it as a separate PR against main as well, since main has the same path.

<!-- greyfinch-sync:ivall/xcl:comment:7261362077 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3444#issuecomment-7261362077). Originally posted by [lucsoft](https://github.com/lucsoft) on 2026-11-29T19:32:35Z. --- Thanks for testing this on Windows and for the stacks – that pinned it down. The deadlock isn't from the merge: `late_release.rs`, `queue_submit.rs` and `sparse::readback_after_execute_with` are byte-identical to `main` here, so `main` should hit the same three-thread wait on Windows. `amd-dev` doesn't have #2959's submit lease, which is why it doesn't show there. The cycle closes in `late_release::Held::drain`: it signals each queue's fence under `HELD` through `native_queue_signal`, which waits for the queue's lease. I pushed `069c29fe` (your first option): sealing takes the lease only when it is free (`queue_submit::try_with`, `native_queue_try_signal`). If another thread has the queue's turn, the batch stays open, and the next drain closes it – the late-release thread drains every `TICK`. `HELD` is never held while waiting for a lease now, so a `Release` from inside a runtime call no longer waits for the queue thread. There's a unit test for `try_with` (no wait for another thread's turn, re-entrant on the owner). Tested only on Linux (Wine + vkd3d-proton, RX 7800 XT), where the deadlock can't happen: builds, tests build. I can't run Windows here – could you try the new head when you have a moment? If it's easier to review on its own, I can open it as a separate PR against `main` as well, since `main` has the same path.
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!3444
No description provided.