Repository navigation
Conversation
… rect lists A home in a sparse window is only reserved until its page is used there and gives its memory back while the page is mapped elsewhere: the retail game's 5.7 GB of pages were committed twice, with video-memory tiles (28.7 GB of commit, now 16-17 GB). chad.dll (XDsp) connects and takes commands; the newer list layout's #139 is Reset; console rect lists are drawn as triangles; a stream without a topology type is TRIANGLE. XCL_TRACE_MEM=n logs the first n allocations.
|
The concurrency test can fail even when the gate admits every worker correctly. It computes I checked a short schedule against the thresholds in Could the admission loop take a test-only memory sampler so all workers in this test see a fixed budget? That would let the test assert the exact cap and leave a live-memory run as a smoke check. I verified the admission arithmetic with a deterministic schedule on macOS. I did not run the Windows concurrency test. AI-assisted review. |
…de after a minute `wait_for_memory` (xcl-dev#113) let a compile start with 6 GB of commit left plus 1 GB per compile already running. The available commit already excludes what the running compiles use, so that counted them twice: on a desktop with 8.1 GB of commit free (a browser and chat open) about three compiles ran and the other workers polled. - `may_start`: in at once while commit covers 6 GB + 300 MB per running compile (their growth still to come; a typical retail compile peaks at 0.1-0.3 GB per xcl-dev#113's measurements); with less, one at a time. - After a minute's wait a compile still goes in when commit is short, but one per minute; before, every waiting worker went in at once - when commit was shortest. - The running count only rises from the value the decision saw (compare and swap), so workers deciding on the same reading cannot all go in. - Waiters wake when a compile ends (condition variable) instead of polling every 50 ms. Minecraft Preview's 716 programs, 4 memory windows, 15 threads (default), Ryzen 7 5700X, 8.1 GB of commit free, main and this interleaved, 3 runs each: 12.7-15.2 s -> 6.35-6.71 s wall (5.3-5.6 s with no gate at all); DXIL digest identical. Tests: `gate_tests` (the rule, short commit / one escape per interval, 32 threads never exceeding what the commit allows); `cargo test --workspace --release` green on an RTX 3090 with the Agility SDK (0 GPU skips). Driver PSO compiles are still not gated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ignored test for measuring compile changes: every program of a folder of console containers (`XCL_BENCH_DIR`) translated as a title does (`XCL_BENCH_WINDOWS`, `XCL_BENCH_SPLIT`) or saved HLSL (`XCL_BENCH_HLSL=1`), compiled on `XCL_BENCH_THREADS` threads with `XCL_DXC_ARGS`. Prints translate time, HLSL and DXIL digests (an HLSL change that keeps the DXIL shows the same DXIL digest), DXC wall / per-program times, cost per KB and peak commit; `XCL_BENCH_TIMES=<file>` writes each program's time, `XCL_BENCH_SLICE=k/n` splits a folder across processes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5d84b26 to
03e2efe
Compare
…ed commit The test computed its limit from one `GlobalMemoryStatusEx` reading while the gate reads the commit again at every decision: memory another process freed mid-test let the gate rightly admit more than the test allowed (review on xcl-dev#139). It also ignored a failed reading, and other tests' compiles share the real gate's count. The gate is now a `Gate` (running count, lock with the last escape, wake-up) and `admit(gate, commit)` takes the commit reading; `wait_for_memory` is `admit(&GATE, available_commit)`. The test gives a gate of its own a fixed commit with room for exactly three and asserts that three run at once (the first ones in wait until the cap is full) and never four. A gate that lets one more in fails it (peak 4); 30 runs of `gate_tests` in a row pass. A second test sends 32 workers through the real gate and checks they all finish. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks – you're right, the test could fail on a correct gate: its limit came from one reading while the gate re-reads commit per decision, and other tests' compiles share the real gate's count too. Fixed in 03e2efe: the gate is now a |
|
Measured on a machine with little commit: Ryzen 5 1600 (6C/12T), 16 GB RAM, 20.7 GB commit limit, GTX 1650, Windows 11 26300, DXC from SDK 10.0.26100, 11 DXC threads, debug build. Synthetic bench, no game data: 200 different compute shaders through
So about 14 % less here. These shaders are small and alike, so this says little about memory growth of big programs. The 4
|
|
AI-assisted review (Claude Code). Windows 11 (10.0.26200), Ryzen 9 9950X (32 threads), Rust 1.99.0 MSVC, debug build, Windows SDK DXC 1.7.2308. Synthetic programs only, no game files, no GPU. Tested The PR's Method: real concurrent DXC compiles through the gate, against a fixed commit budget.
One compile alone grows private commit by 160 MB for a 2000-round program (987 KB of HLSL) and by 460 MB for 4000 rounds (1.9 MB). A probe of 8000 rounds (3.8 MB, 65 s) grew 1.5 GB.
* In S3 the budget is below floor + one compile, so any running compile puts the commit under 6 GB. That is the "one at a time" case working as intended. What this shows:
Accounting finding: 300 MB per running compile is too little for bigger programs, and compiles that start together aren't counted at all.
A cheap improvement: scale the reservation with the source, e.g. reserve per compile by HLSL size, since growth here went roughly with size: 160 MB at 1 MB, 460 MB at 1.9 MB, 1.5 GB at 3.8 MB. Or keep the per-compile reservation until the compile ends instead of only counting it. Even in S2 the PR stays better than the base, whose stampede reached 2.9 GB. Not tested:
|
|
Linux / Wine / GNU run of Setup: Ubuntu 24.04, cross-built for
All four new Not covered: the rebased PR; a run with little commit (this machine isn't short of it); AI-assisted test report (Claude); tests run locally as stated. |
… behind ff59ccd wrote XCL's PC slots into vkd3d-proton's own allocator table, which ends after the PC's 9 methods. A console title calls past them (upstream's log names allocator xcl-dev#9, a logging stub answered 0 on Windows): found with a retail title under Wine, whose call landed on the zeros after vkd3d-proton 3.1's table (its slots 9-11 are 0, another table follows) and executed address 0 about 29 s in. The fence's way (07bccd7) instead: under Wine CreateCommandAllocator does not adopt the runtime's allocator; it returns an object of XCL's (alloc_x::wrap) with the console length - the PC methods call the runtime allocator's through its own table (bundle allocators have another), QueryInterface gives the wrapper back for the allocator itself, AddRef / Release are the runtime allocator's count, Release and Reset keep alloc_release / alloc_reset's bookkeeping on the wrapper (list_x::on_allocator_release, console_list::allocator_reset), and xcl-dev#9 on are the same "ID3D12CommandAllocator::#N (not on PC)" stubs as on Windows. Every allocator XCL keeps (list_x, console_list, bind) is the pointer its caller has, the wrapper; only where an allocator goes to the runtime is it unwrapped (alloc_x::for_runtime): the device's CreateCommandList (also console CreateCommandList / CreateCommandListX), a list's Reset on the PC path (cl_reset, also console_list's Reset) and the console's (list_x::reset_x: xcl-dev#10, xcl-dev#139, the DMA list) and KickoffX's Reset. These are the places vkd3d-proton 3.1 takes an allocator back (d3d12_command_list_Reset, d3d12_bundle_Reset, and CreateCommandList through Reset). Allocators are no longer patched in place. The pair is made before CreateCommandAllocator returns, so no caller ever has the runtime's allocator. On Windows nothing changes: CreateCommandAllocator takes the new path only under util::under_wine(), and for_runtime passes the allocator as it is there. Test: alloc_x::tests::a_wrapped_allocator_forwards_to_the_runtime_allocator (no GPU). Wine 11.22, vkd3d-proton 3.1 release DLLs, RX 7900 XTX RADV: it, bind's create_list_reset_and_clear_state_track_initial_pso_on_d3d12, gpu_sparse_vram_descriptors_buffers_and_xmem, title_textures' gpu_mirror_upload_... and placed_title_textures_..., both gpu_compute_e2e tests, list_x's reset_commits_state_..., fence_x's and the in-place test pass, each in its own process, with no "Invalid command allocator." in any log; the whole suite gives the same results as before the change (no pass -> fail; the same four failures) and the e2e test title the same 49 checks passed and one failed (its window is not cloaked under Wine). The retail title was not run again. Not run on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… behind ff59ccd wrote XCL's PC slots into vkd3d-proton's own allocator table, which ends after the PC's 9 methods. A console title calls past them (upstream's log names allocator xcl-dev#9, a logging stub answered 0 on Windows): found with a retail title under Wine, whose call landed on the zeros after vkd3d-proton 3.1's table (its slots 9-11 are 0, another table follows) and executed address 0 about 29 s in. The fence's way (07bccd7) instead: under Wine CreateCommandAllocator does not adopt the runtime's allocator; it returns an object of XCL's (alloc_x::wrap) with the console length - the PC methods call the runtime allocator's through its own table (bundle allocators have another), QueryInterface gives the wrapper back for the allocator itself, AddRef / Release are the runtime allocator's count, Release and Reset keep alloc_release / alloc_reset's bookkeeping on the wrapper (list_x::on_allocator_release, console_list::allocator_reset), and xcl-dev#9 on are the same "ID3D12CommandAllocator::#N (not on PC)" stubs as on Windows. Every allocator XCL keeps (list_x, console_list, bind) is the pointer its caller has, the wrapper; only where an allocator goes to the runtime is it unwrapped (alloc_x::for_runtime): the device's CreateCommandList (also console CreateCommandList / CreateCommandListX), a list's Reset on the PC path (cl_reset, also console_list's Reset) and the console's (list_x::reset_x: xcl-dev#10, xcl-dev#139, the DMA list) and KickoffX's Reset. These are the places vkd3d-proton 3.1 takes an allocator back (d3d12_command_list_Reset, d3d12_bundle_Reset, and CreateCommandList through Reset). Allocators are no longer patched in place. The pair is made before CreateCommandAllocator returns, so no caller ever has the runtime's allocator. On Windows nothing changes: CreateCommandAllocator takes the new path only under util::under_wine(), and for_runtime passes the allocator as it is there. Test: alloc_x::tests::a_wrapped_allocator_forwards_to_the_runtime_allocator (no GPU). Wine 11.22, vkd3d-proton 3.1 release DLLs, RX 7900 XTX RADV: it, bind's create_list_reset_and_clear_state_track_initial_pso_on_d3d12, gpu_sparse_vram_descriptors_buffers_and_xmem, title_textures' gpu_mirror_upload_... and placed_title_textures_..., both gpu_compute_e2e tests, list_x's reset_commits_state_..., fence_x's and the in-place test pass, each in its own process, with no "Invalid command allocator." in any log; the whole suite gives the same results as before the change (no pass -> fail; the same four failures) and the e2e test title the same 49 checks passed and one failed (its window is not cloaked under Wine). The retail title was not run again. Not run on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… behind ff59ccd wrote XCL's PC slots into vkd3d-proton's own allocator table, which ends after the PC's 9 methods. A console title calls past them (upstream's log names allocator xcl-dev#9, a logging stub answered 0 on Windows): found with a retail title under Wine, whose call landed on the zeros after vkd3d-proton 3.1's table (its slots 9-11 are 0, another table follows) and executed address 0 about 29 s in. The fence's way (07bccd7) instead: under Wine CreateCommandAllocator does not adopt the runtime's allocator; it returns an object of XCL's (alloc_x::wrap) with the console length - the PC methods call the runtime allocator's through its own table (bundle allocators have another), QueryInterface gives the wrapper back for the allocator itself, AddRef / Release are the runtime allocator's count, Release and Reset keep alloc_release / alloc_reset's bookkeeping on the wrapper (list_x::on_allocator_release, console_list::allocator_reset), and xcl-dev#9 on are the same "ID3D12CommandAllocator::#N (not on PC)" stubs as on Windows. Every allocator XCL keeps (list_x, console_list, bind) is the pointer its caller has, the wrapper; only where an allocator goes to the runtime is it unwrapped (alloc_x::for_runtime): the device's CreateCommandList (also console CreateCommandList / CreateCommandListX), a list's Reset on the PC path (cl_reset, also console_list's Reset) and the console's (list_x::reset_x: xcl-dev#10, xcl-dev#139, the DMA list) and KickoffX's Reset. These are the places vkd3d-proton 3.1 takes an allocator back (d3d12_command_list_Reset, d3d12_bundle_Reset, and CreateCommandList through Reset). Allocators are no longer patched in place. The pair is made before CreateCommandAllocator returns, so no caller ever has the runtime's allocator. On Windows nothing changes: CreateCommandAllocator takes the new path only under util::under_wine(), and for_runtime passes the allocator as it is there. Test: alloc_x::tests::a_wrapped_allocator_forwards_to_the_runtime_allocator (no GPU). Wine 11.22, vkd3d-proton 3.1 release DLLs, RX 7900 XTX RADV: it, bind's create_list_reset_and_clear_state_track_initial_pso_on_d3d12, gpu_sparse_vram_descriptors_buffers_and_xmem, title_textures' gpu_mirror_upload_... and placed_title_textures_..., both gpu_compute_e2e tests, list_x's reset_commits_state_..., fence_x's and the in-place test pass, each in its own process, with no "Invalid command allocator." in any log; the whole suite gives the same results as before the change (no pass -> fail; the same four failures) and the e2e test title the same 49 checks passed and one failed (its window is not cloaked under Wine). The retail title was not run again. Not run on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… behind ff59ccd wrote XCL's PC slots into vkd3d-proton's own allocator table, which ends after the PC's 9 methods. A console title calls past them (upstream's log names allocator xcl-dev#9, a logging stub answered 0 on Windows): found with a retail title under Wine, whose call landed on the zeros after vkd3d-proton 3.1's table (its slots 9-11 are 0, another table follows) and executed address 0 about 29 s in. The fence's way (07bccd7) instead: under Wine CreateCommandAllocator does not adopt the runtime's allocator; it returns an object of XCL's (alloc_x::wrap) with the console length - the PC methods call the runtime allocator's through its own table (bundle allocators have another), QueryInterface gives the wrapper back for the allocator itself, AddRef / Release are the runtime allocator's count, Release and Reset keep alloc_release / alloc_reset's bookkeeping on the wrapper (list_x::on_allocator_release, console_list::allocator_reset), and xcl-dev#9 on are the same "ID3D12CommandAllocator::#N (not on PC)" stubs as on Windows. Every allocator XCL keeps (list_x, console_list, bind) is the pointer its caller has, the wrapper; only where an allocator goes to the runtime is it unwrapped (alloc_x::for_runtime): the device's CreateCommandList (also console CreateCommandList / CreateCommandListX), a list's Reset on the PC path (cl_reset, also console_list's Reset) and the console's (list_x::reset_x: xcl-dev#10, xcl-dev#139, the DMA list) and KickoffX's Reset. These are the places vkd3d-proton 3.1 takes an allocator back (d3d12_command_list_Reset, d3d12_bundle_Reset, and CreateCommandList through Reset). Allocators are no longer patched in place. The pair is made before CreateCommandAllocator returns, so no caller ever has the runtime's allocator. On Windows nothing changes: CreateCommandAllocator takes the new path only under util::under_wine(), and for_runtime passes the allocator as it is there. Test: alloc_x::tests::a_wrapped_allocator_forwards_to_the_runtime_allocator (no GPU). Wine 11.22, vkd3d-proton 3.1 release DLLs, RX 7900 XTX RADV: it, bind's create_list_reset_and_clear_state_track_initial_pso_on_d3d12, gpu_sparse_vram_descriptors_buffers_and_xmem, title_textures' gpu_mirror_upload_... and placed_title_textures_..., both gpu_compute_e2e tests, list_x's reset_commits_state_..., fence_x's and the in-place test pass, each in its own process, with no "Invalid command allocator." in any log; the whole suite gives the same results as before the change (no pass -> fail; the same four failures) and the e2e test title the same 49 checks passed and one failed (its window is not cloaked under Wine). The retail title was not run again. Not run on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… behind ff59ccd wrote XCL's PC slots into vkd3d-proton's own allocator table, which ends after the PC's 9 methods. A console title calls past them (upstream's log names allocator xcl-dev#9, a logging stub answered 0 on Windows): found with a retail title under Wine, whose call landed on the zeros after vkd3d-proton 3.1's table (its slots 9-11 are 0, another table follows) and executed address 0 about 29 s in. The fence's way (07bccd7) instead: under Wine CreateCommandAllocator does not adopt the runtime's allocator; it returns an object of XCL's (alloc_x::wrap) with the console length - the PC methods call the runtime allocator's through its own table (bundle allocators have another), QueryInterface gives the wrapper back for the allocator itself, AddRef / Release are the runtime allocator's count, Release and Reset keep alloc_release / alloc_reset's bookkeeping on the wrapper (list_x::on_allocator_release, console_list::allocator_reset), and xcl-dev#9 on are the same "ID3D12CommandAllocator::#N (not on PC)" stubs as on Windows. Every allocator XCL keeps (list_x, console_list, bind) is the pointer its caller has, the wrapper; only where an allocator goes to the runtime is it unwrapped (alloc_x::for_runtime): the device's CreateCommandList (also console CreateCommandList / CreateCommandListX), a list's Reset on the PC path (cl_reset, also console_list's Reset) and the console's (list_x::reset_x: xcl-dev#10, xcl-dev#139, the DMA list) and KickoffX's Reset. These are the places vkd3d-proton 3.1 takes an allocator back (d3d12_command_list_Reset, d3d12_bundle_Reset, and CreateCommandList through Reset). Allocators are no longer patched in place. The pair is made before CreateCommandAllocator returns, so no caller ever has the runtime's allocator. On Windows nothing changes: CreateCommandAllocator takes the new path only under util::under_wine(), and for_runtime passes the allocator as it is there. Test: alloc_x::tests::a_wrapped_allocator_forwards_to_the_runtime_allocator (no GPU). Wine 11.22, vkd3d-proton 3.1 release DLLs, RX 7900 XTX RADV: it, bind's create_list_reset_and_clear_state_track_initial_pso_on_d3d12, gpu_sparse_vram_descriptors_buffers_and_xmem, title_textures' gpu_mirror_upload_... and placed_title_textures_..., both gpu_compute_e2e tests, list_x's reset_commits_state_..., fence_x's and the in-place test pass, each in its own process, with no "Invalid command allocator." in any log; the whole suite gives the same results as before the change (no pass -> fail; the same four failures) and the e2e test title the same 49 checks passed and one failed (its window is not cloaked under Wine). The retail title was not run again. Not run on Windows. On upstream 1ec4c98 the allocator also goes to the runtime as its own where xcl-dev#797's mid-list split resets a spare list or makes a new one (`create_raw_pc_command_list`) and where `title_list`'s Reset calls a list that is not adopted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eset On the newer console command-list layout (real::QUEUE_SHIFTED), titles reset pooled lists through slot ivall#139 Reset(allocator, initial_pso, flags), which real.rs routes to list_x::reset_x. title_list's wrapper vtable only overrode slots 0, 1, 2, 9, and 10, leaving slot ivall#139 as a raw forwarder to F_BACKING. Once a mid-list Wait64 split switched F_BACKING to a continuation segment, ivall#139 reset only that continuation segment and never ran title_list::reset: F_PRIMARY stayed bound to the previous recording/allocator, F_BACKING was never restored to F_PRIMARY, and extra_active kept accumulating split segments across frames. On pre-ivall#897 main that caused D3D12 device removal (0x887a0001 / debug-layer id 541) as soon as the old allocator was reused; even with ivall#897/ivall#907 allocator pooling, stale primary/prior segments continue to be resubmitted and extra_active grows until MAX_EXTRA_SEGMENTS. The wrapper's ivall#139 is now a guard::make_layout_split of its own: a title on the newer layout goes to a four-argument adapter that runs wrapper reset, while a title on the older layout and the runtime take the generated forwarder. The forwarder's tail jump keeps the caller's return address and arguments, which the backing list's own layout guard at ivall#139 needs to tell a title from the runtime; calling the backing slot from Rust would hide it and send an older-layout title to the PC method. Tests: one covers the forwarder and the newer-layout reset on fake lists; one calls the slot from a caller in a registered mapped image, with the backing slot behind a layout guard as real.rs installs it and a test-local layout flag (flag clear: the older handler with the title's arguments; flag set: the primary is reset and the split segment reclaimed). Co-Authored-By: Antigravity <noreply@google.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Closing as a stale, conflicting pre-template PR (touching |
… behind ff59ccd wrote XCL's PC slots into vkd3d-proton's own allocator table, which ends after the PC's 9 methods. A console title calls past them (upstream's log names allocator xcl-dev#9, a logging stub answered 0 on Windows): found with a retail title under Wine, whose call landed on the zeros after vkd3d-proton 3.1's table (its slots 9-11 are 0, another table follows) and executed address 0 about 29 s in. The fence's way (07bccd7) instead: under Wine CreateCommandAllocator does not adopt the runtime's allocator; it returns an object of XCL's (alloc_x::wrap) with the console length - the PC methods call the runtime allocator's through its own table (bundle allocators have another), QueryInterface gives the wrapper back for the allocator itself, AddRef / Release are the runtime allocator's count, Release and Reset keep alloc_release / alloc_reset's bookkeeping on the wrapper (list_x::on_allocator_release, console_list::allocator_reset), and xcl-dev#9 on are the same "ID3D12CommandAllocator::#N (not on PC)" stubs as on Windows. Every allocator XCL keeps (list_x, console_list, bind) is the pointer its caller has, the wrapper; only where an allocator goes to the runtime is it unwrapped (alloc_x::for_runtime): the device's CreateCommandList (also console CreateCommandList / CreateCommandListX), a list's Reset on the PC path (cl_reset, also console_list's Reset) and the console's (list_x::reset_x: xcl-dev#10, xcl-dev#139, the DMA list) and KickoffX's Reset. These are the places vkd3d-proton 3.1 takes an allocator back (d3d12_command_list_Reset, d3d12_bundle_Reset, and CreateCommandList through Reset). Allocators are no longer patched in place. The pair is made before CreateCommandAllocator returns, so no caller ever has the runtime's allocator. On Windows nothing changes: CreateCommandAllocator takes the new path only under util::under_wine(), and for_runtime passes the allocator as it is there. Test: alloc_x::tests::a_wrapped_allocator_forwards_to_the_runtime_allocator (no GPU). Wine 11.22, vkd3d-proton 3.1 release DLLs, RX 7900 XTX RADV: it, bind's create_list_reset_and_clear_state_track_initial_pso_on_d3d12, gpu_sparse_vram_descriptors_buffers_and_xmem, title_textures' gpu_mirror_upload_... and placed_title_textures_..., both gpu_compute_e2e tests, list_x's reset_commits_state_..., fence_x's and the in-place test pass, each in its own process, with no "Invalid command allocator." in any log; the whole suite gives the same results as before the change (no pass -> fail; the same four failures) and the e2e test title the same 49 checks passed and one failed (its window is not cloaked under Wine). The retail title was not run again. Not run on Windows. On upstream 1ec4c98 the allocator also goes to the runtime as its own where xcl-dev#797's mid-list split resets a spare list or makes a new one (`create_raw_pc_command_list`) and where `title_list`'s Reset calls a list that is not adopted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… behind ff59ccd wrote XCL's PC slots into vkd3d-proton's own allocator table, which ends after the PC's 9 methods. A console title calls past them (upstream's log names allocator xcl-dev#9, a logging stub answered 0 on Windows): found with a retail title under Wine, whose call landed on the zeros after vkd3d-proton 3.1's table (its slots 9-11 are 0, another table follows) and executed address 0 about 29 s in. The fence's way (07bccd7) instead: under Wine CreateCommandAllocator does not adopt the runtime's allocator; it returns an object of XCL's (alloc_x::wrap) with the console length - the PC methods call the runtime allocator's through its own table (bundle allocators have another), QueryInterface gives the wrapper back for the allocator itself, AddRef / Release are the runtime allocator's count, Release and Reset keep alloc_release / alloc_reset's bookkeeping on the wrapper (list_x::on_allocator_release, console_list::allocator_reset), and xcl-dev#9 on are the same "ID3D12CommandAllocator::#N (not on PC)" stubs as on Windows. Every allocator XCL keeps (list_x, console_list, bind) is the pointer its caller has, the wrapper; only where an allocator goes to the runtime is it unwrapped (alloc_x::for_runtime): the device's CreateCommandList (also console CreateCommandList / CreateCommandListX), a list's Reset on the PC path (cl_reset, also console_list's Reset) and the console's (list_x::reset_x: xcl-dev#10, xcl-dev#139, the DMA list) and KickoffX's Reset. These are the places vkd3d-proton 3.1 takes an allocator back (d3d12_command_list_Reset, d3d12_bundle_Reset, and CreateCommandList through Reset). Allocators are no longer patched in place. The pair is made before CreateCommandAllocator returns, so no caller ever has the runtime's allocator. On Windows nothing changes: CreateCommandAllocator takes the new path only under util::under_wine(), and for_runtime passes the allocator as it is there. Test: alloc_x::tests::a_wrapped_allocator_forwards_to_the_runtime_allocator (no GPU). Wine 11.22, vkd3d-proton 3.1 release DLLs, RX 7900 XTX RADV: it, bind's create_list_reset_and_clear_state_track_initial_pso_on_d3d12, gpu_sparse_vram_descriptors_buffers_and_xmem, title_textures' gpu_mirror_upload_... and placed_title_textures_..., both gpu_compute_e2e tests, list_x's reset_commits_state_..., fence_x's and the in-place test pass, each in its own process, with no "Invalid command allocator." in any log; the whole suite gives the same results as before the change (no pass -> fail; the same four failures) and the e2e test title the same 49 checks passed and one failed (its window is not cloaked under Wine). The retail title was not run again. Not run on Windows. On upstream 1ec4c98 the allocator also goes to the runtime as its own where xcl-dev#797's mid-list split resets a spare list or makes a new one (`create_raw_pc_command_list`) and where `title_list`'s Reset calls a list that is not adopted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A list split at a recorded memory wait records on in a second PC list; the console object's Reset (xcl-dev#10) resets the first one and makes the others spares. The newer layout's Reset (xcl-dev#139, how a retail title resets the lists of its pool) was forwarded to the active PC list like any other slot: it reset the last segment only, the recording went on there, and the object kept its segments. Every later ExecuteCommandLists of that list ran the first PC list again, with the first part of the recording it had been split in: its draws and dispatches on memory the title used for other things since, and its Write64 values after newer ones. xcl-dev#139 is now the object's Reset when the title's runtime has the newer layouts (looked at in each call, as the list's other moved slots are). What run 13 shows of it: an ExecuteCommandLists of 10 lists with two lists without one mark since they last ran (not even Close), each followed by a list made later; the GPU stood 30 s between the lists before the first of them. And one cell's Write64 of 0x50f submitted on q4 after 0x510, then on q3 after 0x511. Test: hle::d3d12x::title_list::tests::the_newer_layouts_reset_resets_the_primary_list_and_ends_the_split Assisted-by: omp (anthropic/claude-mythos-5-2)
…:reset On the newer console command-list layout (real::QUEUE_SHIFTED), titles reset pooled lists through slot xcl-dev#139 Reset(allocator, initial_pso, flags), which real.rs routes to list_x::reset_x. title_list's wrapper vtable only overrode slots 0, 1, 2, 9, and 10, leaving slot xcl-dev#139 as a raw forwarder to F_BACKING. Once a mid-list Wait64 split switched F_BACKING to a continuation segment, xcl-dev#139 reset only that continuation segment and never ran title_list::reset: F_PRIMARY stayed bound to the previous recording/allocator, F_BACKING was never restored to F_PRIMARY, and extra_active kept accumulating split segments across frames. On pre-xcl-dev#897 main that caused D3D12 device removal (0x887a0001 / debug-layer id 541) as soon as the old allocator was reused; even with xcl-dev#897/xcl-dev#907 allocator pooling, stale primary/prior segments continue to be resubmitted and extra_active grows until MAX_EXTRA_SEGMENTS. The wrapper's xcl-dev#139 is now a guard::make_layout_split of its own: a title on the newer layout goes to a four-argument adapter that runs wrapper reset, while a title on the older layout and the runtime take the generated forwarder. The forwarder's tail jump keeps the caller's return address and arguments, which the backing list's own layout guard at xcl-dev#139 needs to tell a title from the runtime; calling the backing slot from Rust would hide it and send an older-layout title to the PC method. Tests: one covers the forwarder and the newer-layout reset on fake lists; one calls the slot from a caller in a registered mapped image, with the backing slot behind a layout guard as real.rs installs it and a test-local layout flag (flag clear: the older handler with the title's arguments; flag set: the primary is reset and the split segment reclaimed). Co-Authored-By: Antigravity <noreply@google.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit b3a969b)
A console lets a title Reset a command list and submit the new recording on the same queue while the GPU still runs the previous one. The PC does not let a list be submitted again before its last execution is done (debug layer id 553, "the command queue fence has not advanced past previous executions of the command list"); on NVIDIA the device is removed about 12 s later. The retail title's world load does it (#1452): note_resubmits logs "a new recording, the same queue", 8 lists at once. A title's list is a title_list wrapper whose PC lists already change (mid-list split segments, a spare pool per list), so the fix uses that: at the title's Reset, when alloc_pool says the primary PC list's last submit has not completed, the new recording goes onto a spare whose submits are done (or a new PC list), reset like the primary would be (reset_pc), and push_segments submits it in the primary's place (SegmentBook::first). The next Reset after the GPU is done records on the primary again and the stand-in goes back to the spares. pop_spare now skips spares still on the GPU, so split segments do not hit the same error. No CPU wait. When the primary is not in flight nothing changes. The retail title does not Reset through the wrapper's #10: its runtime has the newer console list layout, whose Reset is #139 (allocator, NULL, 0). The wrapper's #139 is a thunk to the active PC list (F_BACKING), and there NEWER_LIST_SLOTS's layout split runs the #10 handler, reset_x, on that PC list. So the wrapper's Reset, and its in-flight check, never ran (measured: the stand-in 0 times, 64+ resubmits, each list last reset in reset_x and still the wrapper's active PC list). reset_x now hands a Reset of a PC list a wrapper records on to the wrapper's Reset; the PC list's own Reset is reset_pc, which the wrapper and the stand-in call. This also resets a split list from its primary on #139, not from its last segment. Test: a list reset and submitted three times while a queue Wait holds the first submit records on three different PC lists and note_resubmits sees none, then on the primary again once the GPU is done; once with the wrapper's #10 and once with reset_x on the active PC list, as #139 does. Without the stand-in the second submit is the primary and the test fails; without the hand-over in reset_x the #139 round fails the same way. Part of #1452. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…:reset (upstream PR xcl-dev#929) Cherry-picked from xcl-dev/xcl PR xcl-dev#929. On the newer console command-list layout titles reset pooled lists through slot xcl-dev#139; the wrapper left v[139] as a raw forwarder, so after a mid-list Wait64 split the primary list was never reset and stale segments got resubmitted (freeze ~30 s in the world). Applied cleanly.
The memory gate from #113 throttles DXC hard on a normal desktop. With 8.1 GB of commit free, Minecraft Preview's 716 programs took 12.7–15.2 s on the default 15 threads; with this change, 6.35–6.71 s. The DXIL is identical.
What was wrong
wait_for_memorylet a compile start while the system had 6 GB of commit left plus 1 GB for every compile already running.Changes (
crates/xcl/src/gpu/recomp/dxc.rs)may_start: a compile goes in at once while commit covers 6 GB plus 300 MB per running compile. The 300 MB covers their growth still to come; Faster shader compiles: one window switch per four dwords, every core, --precompile builds the cache titles use #113 measured a typical retail compile's peak at 0.1–0.3 GB. With less, compiles go one at a time.HANDOFF.md: the two places that describe the gate are updated.The second commit adds
dxc_bench_folder, an ignored test that times DXC for a folder of console shaders and prints HLSL and DXIL digests. It's how the numbers below were measured; drop it if you'd rather not have it.Numbers
Ryzen 7 5700X (8 cores / 16 threads), RTX 3090, DXC 1.9.2602, Minecraft Preview's 716 programs, 4 memory windows, default 15 threads. Free commit was 8.1 GB before every run. Both builds use the same benchmark, run interleaved, 3 runs each:
main(484dd57)mainand with this PR.Checked
cargo test --workspace --release --no-fail-faston an RTX 3090 with the Agility SDK 1.616.1: everything passes, 0 GPU skips.gate_testscovers the rule, short commit (one at a time, one escape per interval) and 32 threads through the real gate never exceeding what the commit allows.dxc.rs.mainhits the same way (being looked into separately).Not covered
xcl-psoworkers are still not memory-gated.🤖 Generated with Claude Code