D3D12.X: allocator #9 takes the title's command-memory callback #1109
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1109
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1109"
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?
@wilu222 on GitHub · 2026-11-24 11:41 UTC · original
wilu222:d3d12x-allocator-memory-callback→main· +47 −1 · 2 files · 1 commits · openID3D12CommandAllocator#9 registers the title's command-memory callback. XCL answers it with S_OK and does not call the callback, instead of the generic "not on PC" stub. This is the one-slot PR with evidence asked for when #228 was closed. Part of #1067, which lists #9 (~14 000 calls) among its unimplemented functions.Evidence (retail 1.0.2.1,
game_scarlett_master.exeat 0x140000000)title+0x1884fe: after taking an allocator from its pool (alock cmpxchgloop), the title calls[vtbl+0x48]withrdx=title+0x555df10andr8= a pointer into one of its objects. It does not read the return value (raxis overwritten next).title+0x555df10is code, not a GUID:callback(…, a4, a5, a6, a7). It allocatesa4bytes with alignmenta5(a byte count if ≥ 16, otherwise log2) from the title's own allocator for the contexta7. It stores the block as the context's current one, releases the previous one, and returns it.a1–a3anda6are unused. So the console runtime asks the title for command memory through this callback.title+0x555df10) and the same context. The third and fourth argument registers held leftovers, so the method takes two arguments.What is in it
D3D12.X: allocator #9 takes the title's command-memory callback:alloc_memory_callback_xat console slot 9 of command allocators (crates/xcl/src/hle/d3d12x/real.rs) and on the null device (crates/xcl/src/hle/d3d12x/null.rs), with a unit test in each. Both tests fail without the slot entries.Tested
main6567c5f(conflict only innull.rs's test module, wheremainadded a test next to ours; both kept).cargo test --workspace --no-fail-fast -- --test-threads=4on head590d470: 995 passed, 4 failed, 45 ignored. The 4 failures aregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0–_3:CreateComputePipelineStatereturns E_OUTOFMEMORY (0x8007000E) for seeds 70, 545, 1019 and 1507 on this adapter. They fail the same way, at the same seeds, onmain6567c5f(cargo test -p xcl --lib fuzz_validate_and_gpu: 0 passed, 4 failed), and they do not reach the code this PR changes.list_x,title_textures,vram::d32s8_targets…). The rerun above had none of those 6.heap_window_out_of_memory_falls_back_to_the_switch_form("no heap windows");pso_measurement_compiles_an_exact_synthetic_record("cannot disable the driver cache (Windows Developer Mode is required)").cargo test -p xcl --lib allocator_9: 2 passed; with the two slot entries removed, both fail.D3D12.X: allocator #9 – the title registers a command-memory callback (0x14555df10, …)once, and noID3D12CommandAllocator::#9stub.Regression run
main:
PR:
Not tested
context+0x12798) is used only by the callback at that offset. The same memory is also reachable at offset0x18of a larger title object, and I did not check every access there. With the callback never called (as before this PR), the title ran normally in the runs above.HANDOFF.md(near line 1754) lists allocator #9 among the stubs. After this PR it is answered, so that line is out of date.AI use
@thehollowedone on GitHub · 2026-11-24 13:30 UTC · original
Independent live allocator check on
47efa2eand5c88525. Windows 11 build 26300, RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, Rust 1.99.1 MSVC, release.The bundled synthetic title called slot 9 on the actual allocator's vtable twice before recording its stock triangle, then once after GPU fence completion and an allocator reset. All calls returned
S_OKand the sentinel callback count stayed zero on both builds. Main logged the generic allocator slot 9 stub. The PR logged the named callback registration and no slot 9 stub. Both passed the stock triangle pixel and occlusion readbacks and exited with zero title failures.I built with
cargo build --offline --locked --release --workspaceand ranxcl run <test-title> -- --hellowithXCL_D3D12_DEBUG=1. The full test title logged the same debug-layer errors on both builds (93 ×3, 1046 ×1, 538 ×1). Synthetic title only. Retail and gameplay were outside the check.AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the scratch check and drafted this report.
@celian-hamon on GitHub · 2026-11-24 13:34 UTC · original
lgtm
@futurepro62 on GitHub · 2026-11-24 14:17 UTC · original · edited 2026-11-24 14:30 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
5c88525(on its base47efa2e).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 743 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.allocator_9_is_the_memory_callback_slot,allocator_9_accepts_the_callback_without_calling_it.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 743 passed, 0 failed, 41 ignored, no skips.list_xfailures (E_OUTOFMEMORY, then a suspended device) while other GPU jobs ran on the machine; the rerun above is clean, and those 3 tests pass 3 of 3 runs on their own on both this head andmain930e8b4.Not tested
AI use
@Royalflamejlh on GitHub · 2026-11-24 15:17 UTC · original
Linux (Wine + vkd3d-proton) + NVIDIA test of
5c88525onmain930e8b4+ #684, 2 runs of 140 s each way of a retail title: the 2,328 and 2,323 stub calls toID3D12CommandAllocator::#9were gone with it, the registration was logged once, and the runs were otherwise the same.Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging (Wayland driver), vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch,
VKD3D_CONFIG=ignore_shared_fence. RTX 4070 12 GB (driver 615.71.09, 32-lane waves), Ryzen 9 9950X3D, 64 GB RAM. Release, cross-compiled tox86_64-pc-windows-gnu(rustc 1.98.0), DXC 1.9.2609.5,XCL_NETWORK=0,XCL_PSO_PRELOAD=0. Retail title 1.0.2.1, the first-run screens completed once and no story progress, one A press at 44.8 s throughXCL_PRESS_AT.5c88525merged ontomain930e8b4+ #684 (e56dbc3) without conflicts; #684 is there becausemainalone faults incopy_frombefore this point.Tested
cargo test --release -p xcl --lib allocator_9under Wine, on the merge: 2 passed, 0 failed.930e8b4+ #684, run 1 / 25c88525, run 1 / 2ID3D12CommandAllocator::#9d3d12_xs.dllslotsgame+0x23cf683Both runs with it logged this once, at 3.5 s:
The image is loaded at
0x8f50000here, so that callback isgame+0x555df10, the function the description names.The presents stop and the watchdog fires 2 to 3 s earlier in the runs with it. Runs of the same tree differ by that much here (a run of
930e8b4+ #684 + #1288 stopped presenting at 100.4 s), so I read it as run-to-run difference, not as an effect of this change.Read
real.rs:1040(alloc_memory_callback_x) does what the description says: it logs the first call, keeps nothing and answersS_OK.real.rs:955puts it on slot 9 andnull.rs:155gives the null device the same handler.alloc_set_allocation_callback_x) and keeps each allocator's callback in a map that nothing reads. The two merge together without a textual conflict, but only one handler is needed; this is the smaller one.Not tested: past 140 s; the preload of #690 on; the rest of the test suite; AMD and Intel.
AI use: Claude Code (Claude Fable 5.2) read the diff, built the trees, ran the tests and the four runs with
XCL_PRESS_AT, compared the logs and wrote this report.@DavidM1911 on GitHub · 2026-11-25 08:21 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
github-bot referenced this pull request2026-11-26 06:18:31 +00:00
@itsSio on GitHub · 2026-11-26 04:22 UTC · original
Independent dual-PC NVIDIA full-workspace test report on clean head
590d470c7ae2f0f680b4bf05251ec9732ecb3a09.Tested
32.0.16.1088), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200,rustc 1.97.0(stable-x86_64-pc-windows-msvc), DXC1.9.2609.5, debug build (XCL_ADAPTER=NVIDIA)cargo build --workspace: exit 0cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 999 passed, 0 failed, 45 ignored (null::tests::allocator_9_is_the_memory_callback_slotandreal::alloc_memory_callback_tests::allocator_9_accepts_the_callback_without_calling_itpass)SKIPPED: 24 (wave64-only GPU tests,#1426wave32 f16/cvt refusals,heap_window_out_of_memory_falls_back_to_the_switch_form,pso_measurement_compiles_an_exact_synthetic_record)32.0.16.1088), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200,rustc 1.99.1(stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC1.8.2502.11, debug build (XCL_ADAPTER=NVIDIA)cargo build --workspace: exit 0cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 999 passed, 0 failed, 45 ignored (bothallocator_9tests pass)SKIPPED: 26 (same 24 as Machine 1 plus 2 requiringd3d12SDKLayers.dll)Not tested
scripts/smoke.ps1runs--release)AI use
Ran via Samaritan:
@futurepro62 on GitHub · 2026-11-26 08:52 UTC · original
NVIDIA and AMD full-suite run, to go with the reports above by itsSio, since none of them covers AMD. Tested exact head
590d470c(on its base6567c5f).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 988 passed, 0 failed, 43 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.allocator_9_is_the_memory_callback_slot,allocator_9_accepts_the_callback_without_calling_it.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 998 passed, 0 failed, 45 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on mainb49be183too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests,const_and_null_mask_operands_agree_with_hlsl_on_the_gpuandmask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
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.