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

Closed
opened 2026-11-26 06:26:53 +00:00 by SergeAx · 1 comment
SergeAx commented 2026-11-26 06:26:53 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by SergeAx on 2026-11-26T06:26:53Z.


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.

<!-- greyfinch-sync:ivall/xcl:issue:6620902992 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2690). Originally posted by [SergeAx](https://github.com/SergeAx) on 2026-11-26T06:26:53Z. --- `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 commented 2026-11-28 06:41:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by SergeAx on 2026-11-28T06:41:06Z.


Fixed on main by 309e3557, the change from #2691, which came in with #2959's stack.

<!-- greyfinch-sync:ivall/xcl:comment:7235453415 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2690#issuecomment-7235453415). Originally posted by [SergeAx](https://github.com/SergeAx) on 2026-11-28T06:41:06Z. --- Fixed on `main` by [`309e3557`](https://github.com/xcl-dev/xcl/commit/309e35572a5a522b33e5fd7ca3d0e8e3e661b90b), the change from #2691, which came in with #2959's stack.
Sign in to join this conversation.
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#2680
No description provided.