D3D12.X: a command list is forgotten after the runtime frees it, so a new list at its address can lose its state #2690

Open
opened 2026-11-26 06:34:38 +00:00 by github-bot · 0 comments
Owner

@⁠SergeAx on GitHub · 2026-11-26 06:26 UTC · original

real::cl_release (hle/d3d12x/real.rs) drops what XCL keeps by a PC command list's address (list_x::on_release with alloc_pool::forget_list, bind::forget, dred::forget_list) only after the runtime's final Release has freed the list. A list made on another thread in between can get the same address and lose its own entries: its bind state (pipeline, allocator, unified-memory blocks), its allocator and last submit in alloc_pool, and its DRED marks.

title_list::release does the same with a longer window (#1453 removes that one), and so does pso_release for pipelines (#2422).

Found on

  • NVIDIA GeForce RTX 5080, driver 621.14; Windows 10 22H2 (19045.6466), Agility SDK 1.620.2; main b49be183, debug

Measured

  • A test whose fake list's runtime Release gives its address to a new list at once (bind::reset, alloc_pool::created_on) fails on main: after cl_release the new list has no bind state and no allocator.
  • The lib test binary run as --test-threads=4 hle::d3d12x::list_x, the builds alternating run by run: list_x::tests::a_dispatch_with_a_pipeline_still_building_waits_at_the_submit (#42) failed in 13 of 200 runs on main, 6 of 200 with cl_release forgetting first, 0 of 400 with #1453, and 0 of 400 with both. Most of it is the longer window of title_list::release: with #1453 alone it did not fail in 400 runs, so this window has not been seen to fail a test on its own.
  • list_x::tests::a_reset_while_the_last_submit_runs_records_on_another_pc_list (#42) is not explained by it: it failed in a full-suite run with cl_release forgetting first (Reset #139 recorded on the PC list still on the GPU).

Plan
As in res_release and #2422: on the last reference (AddRef says 2), cl_release forgets the list before the runtime's final Release. When two last-but-one releases happen at once, both miss being the last, and the list is forgotten after its release, as before. That test becomes the regression test.

AI use: found with Claude Code (Claude Opus 5.5), which ran the measurements above and wrote this issue.

**@⁠SergeAx** on GitHub · 2026-11-26 06:26 UTC · [original](https://github.com/xcl-dev/xcl/issues/2690) `real::cl_release` (`hle/d3d12x/real.rs`) drops what XCL keeps by a PC command list's address (`list_x::on_release` with `alloc_pool::forget_list`, `bind::forget`, `dred::forget_list`) only after the runtime's final `Release` has freed the list. A list made on another thread in between can get the same address and lose its own entries: its bind state (pipeline, allocator, unified-memory blocks), its allocator and last submit in `alloc_pool`, and its DRED marks. `title_list::release` does the same with a longer window (#1453 removes that one), and so does `pso_release` for pipelines (#2422). **Found on** - NVIDIA GeForce RTX 5080, driver 621.14; Windows 10 22H2 (19045.6466), Agility SDK 1.620.2; `main` `b49be183`, debug **Measured** - A test whose fake list's runtime `Release` gives its address to a new list at once (`bind::reset`, `alloc_pool::created_on`) fails on `main`: after `cl_release` the new list has no bind state and no allocator. - The lib test binary run as `--test-threads=4 hle::d3d12x::list_x`, the builds alternating run by run: `list_x::tests::a_dispatch_with_a_pipeline_still_building_waits_at_the_submit` (#42) failed in 13 of 200 runs on `main`, 6 of 200 with `cl_release` forgetting first, 0 of 400 with #1453, and 0 of 400 with both. Most of it is the longer window of `title_list::release`: with #1453 alone it did not fail in 400 runs, so this window has not been seen to fail a test on its own. - `list_x::tests::a_reset_while_the_last_submit_runs_records_on_another_pc_list` (#42) is not explained by it: it failed in a full-suite run with `cl_release` forgetting first (Reset #139 recorded on the PC list still on the GPU). **Plan** As in `res_release` and #2422: on the last reference (`AddRef` says 2), `cl_release` forgets the list before the runtime's final `Release`. When two last-but-one releases happen at once, both miss being the last, and the list is forgotten after its release, as before. That test becomes the regression test. AI use: found with Claude Code (Claude Opus 5.5), which ran the measurements above and wrote this issue.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:34:38 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.