D3D12.X: render targets on one physical page share its video memory #1173
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1182"
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?
Imported from ivall/xcl. Originally posted by 3L1A5-1 on 2026-11-24T12:54:23Z.
A retail game (retail title) maps one physical page under render targets at two addresses at once – aliasing targets that are never live together, which the console allows. kernelx keeps a page at one address (
map_pagesmoves it), andvram::Pageskeyed video memory by title address, so each alias got pages of its own. In the game's first 40 s, 422 render targets (2.1 GB) had their pages mapped under 276 other render targets (1.85 GB), and the game kept using both sets (barriers and views after the move). The duplicate cost 1.85 GB of video memory, and what the GPU wrote through one alias never showed in the other.A GPU-owned texture's owned pages are now keyed by the physical page mapped at their address, else by the address as before. Sampled textures keep address keys. Part of #320 (8 GB cards) and #345.
What is in it
crates/xcl/src/hle/kernelx.rs:physical_pages(va, n): the physical page mapped away at each 64 KiB page (read-only,AWAYonly).crates/xcl/src/hle/d3d12x/vram.rs:page_key(PHYS_KEY | pagefor a page with a physical page, else the address),physical_pages_under(GPU-owned only, asked beforePAGESis taken: kernelx takesAWAYand neverPAGES),bindtakes the physical pages and both its loops (counting the missing tiles, then taking them) usepage_key,Target.gpu_ownedsoremap_if_unmappedkeys the same way (it asks the physical pages withPAGESreleased, then takes it again);tiles_unaccounted_for(test only).crates/xcl/src/hle/d3d12x/title_textures.rs: GPU testrender_targets_on_one_physical_page_share_its_video_memory.Tested
stable-x86_64-pc-windows-msvc; tests debug, smoke release.main68a284a(d165e20; conflicts only with 3ea5edc's lazy level pages invram.rs:bindis now a wrapper overbind_range, both take the physical pages and both loops usepage_key;map_levelspasses none, since lazy levels are for sampled textures, which keep address keys;remap_if_unmappedkeeps main's early return for lazy-level targets after takingPAGESagain). Before that onto1a0bbe3(after #1747 changedPages::bindandplace_on_pageslocking, and #1985 addedcanonical_vabeforeplace_on_pagesasks the physical pages; they are still asked beforePAGESis taken). My first rebase (efedeea) left #1747's new counting loop inbindon address keys: a tile leaked, orbindaborted, when the two keys differed (found by @pvfreis, @veyn-sudo, @thehollowedone). Fixed since5fa6950.cargo test --workspace --no-fail-fast -- --test-threads=4ond165e20: 1290 passed, 1 failed, 46 ignored. The failure,gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier(left: 3, right: 1), fails the same way onmain68a284awithout this change.d165e20: withbind_range's counting loop on address keys, the new test aborts on the fresh-tile iterator (0xC0000409).gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware, fourlower::testsand the wave64 cases of thelower_dxilprograms), the per-lane form refused for some f16/f32 cases,heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(needs Developer Mode)page_keyreturning the address) it fails:left: 131072, right: 65536. With onlybind's counting loop on address keys, it aborts atvram.rs:601(0xC0000409), and without that case it fails withleft: 2, right: 0(tiles lost). It skips below resource heap tier 2, wherevram::placekeeps no target on pages (Intel Arc, @JJAutoCompare), and takes its locks poison-tolerantly (@thiagocalile).main67a3735vs this change on it):mainended at 178–215 s withCreateHeaprefused (0x8007000e) or a device removal at ~13.9 GB local video memory; with this change two runs had no0x8007000eand ended at 245 / 268 s in the title's null write at+0x23cf683(#846). One run each, not a measurement of #846.Regression run
Not tested
MapTitlePhysicalPages).MapTitlePhysicalPages(NULL, …)):kernelx::physical_pagesreports only pages mapped away, so a target at the home stays keyed by its address and an alias elsewhere gets a page of its own, as onmain(@Filip722 found this and has a fix on top of this PR).AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by towiice on 2026-11-24T13:05:24Z.
Review: COMMENTED
Tested:
01b62ad4), toolchainstable-x86_64-pc-windows-gnullvm(llvm-mingw 23.1.6), debug build.cargo test -p xcl --lib hle::d3d12x::vram -- --test-threads=1: 9 passed, 0 failed.cargo test -p xcl --lib hle::d3d12x::title_textures -- --test-threads=1: 14 passed, 0 failed (3.50 s), including the newrender_targets_on_one_physical_page_share_its_video_memoryandplaced_title_textures_share_vram_and_preserve_pixels.Verified cleanly on 4 GB VRAM Turing hardware with zero regressions.
Not tested: full workspace suite, release builds, retail titles (
smoke.ps1).Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T13:12:41Z.
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.
cargo test -p xcl --lib render_target: 2 passed, 0 failed — includes the newrender_targets_on_one_physical_page_share_its_video_memory.cargo test -p xcl --lib vram: 10 passed, 1 failed on the first run —gpu_sparse_vram_descriptors_buffers_and_xmem, the known flaky test from #343; it passed on immediate rerun and is unrelated to this change.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-24T13:43:18Z.
Ran the new test and the
title_texturesmodule at0cf6d08:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
render_targets_on_one_physical_page_share_its_video_memorypasses on this GPU and the rest of the module is unaffected. This adds a Blackwell part with driver 32.0.16.2124 on Windows 11 build 26200 to the author's RTX 2060 SUPER run.Not tested: retail titles, RDNA2/RDNA4 and Intel GPUs, Wine, release profile.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified.
Imported from ivall/xcl. Originally posted by bjarngard on 2026-11-24T13:47:58Z.
Test report for head
0cf6d08(AMD)Tested
XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored, no SKIPPEDrender_targets_on_one_physical_page_share_its_video_memorypassed when run alone on the AMD adapterNot tested: retail titles (no smoke run), RDNA3/RDNA4.
AI use: the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.
Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T14:21:21Z.
A regression run under Wine on Linux, on a retail title.
Tested
x86_64-pc-windows-gnu.0cf6d08as it is (merge base47efa2e) andmain47efa2e, no uncommitted changes. Retail title 1.0.2.1,scripts/linux/smoke.sh(#257) for 60 s, no input. Twelve runs in a row,mainfirst and last, other PRs in between.Regression run
main (first run):
this PR:
The last
mainrun: 1425 frames,exit: 0x0, no device removal, no crash. Under Wine,peak commitreads 0 MB, so these blocks do not check memory.Not tested
AI use
Imported from ivall/xcl. Originally posted by Rodriguerra on 2026-11-24T15:54:56Z.
Confirmed on NVIDIA GeForce RTX 3060 12 GB (Windows 11 26200, driver
32.0.16.1088) on a retail title:target pagesdropped from 7,514 MB -> 5,403 MB (-2,111 MB saved before world entry).Imported from ivall/xcl. Originally posted by grahamster2 on 2026-11-24T16:25:38Z.
Test report on the retail title, on a 10 GB card. #1182 and #1248 were tested together, in one build. The savings below are for both combined, not split between them.
Builds
main037aecd+ #902 + #751, release.0cf6d08) and #1248 (7877001). Both merged without conflicts.Setup: RTX 3080 10 GB (driver 610.88), Ryzen 5 7600X, 32 GB RAM, Windows 11 26200. Settings:
XCL_NETWORK=0,XCL_PSO_PRELOAD=0,XCL_PSO_WAIT_MS=50. A pressed at 14, 17, 21, 25 and 31 s. Warm DXIL and driver blob caches. One run each. Both runs were stopped at about 100 s by my free-RAM guard (under 0.5 GB of RAM available).Tested
From the
XCL_ACTIVITYmemory line. RAM available isGlobalMemoryStatusExullAvailPhys.XCL_DXC_THREADS=3) and preload on, so this comparison is loose.Not tested
Test report written with Claude Code (Claude Opus 5.5) from my own runs; the extra logging is local only.
Imported from ivall/xcl. Originally posted by madaraXor on 2026-11-24T19:40:33Z.
Retail title on a 12 GB RDNA2 card: local video memory stays under the card with this PR (and #1248)
Setup: AMD Radeon RX 6700 XT 12 GB (RDNA2), driver 32.0.21045.29003, Ryzen 5 5600X, 16 GB RAM, Windows 10 Pro 22H2 (19045.6466), Agility SDK 1.620.2, Rust 1.90.0, release. Retail title 1.0.2.1,
device_type = "lockhart",XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_PRELOAD=0 XCL_PSO_WAIT_MS=50 XCL_DXC_THREADS=3, the sameXCL_PRESS_ATsequence into the story start in both runs.Two runs of the same tree,
main930e8b4+ #684 + #615 + #495 + #1291 + #1288 + #1315/#1316 and a localeh.rschange, without and with this PR's head0cf6d08efand #1248's head787700174merged (I did not run them apart, so the split between the two is not known). FromXCL_ACTIVITY:Without them local video memory went past the card (13.6 GB at 650 s, the card has 12.2 GB) and that run ended at 658 s in
amdxc64.dll(a null read while the driver compiled compute pipelines). With them it peaked at 10.9–12.1 GB in this run and four later ones (same PRs, later local changes), under the card's memory. The sparse pools did not change (4.4–4.8 GB in both).Not tested: the two PRs apart; NVIDIA; whether anything renders differently (the title is still on its loading screen at that point here).
AI use: Claude Code, Claude Opus 5.5 ran the builds and runs on my PC and wrote this report. Counts, times and sizes only.
Imported from ivall/xcl. Originally posted by thiagocalile on 2026-11-25T00:49:26Z.
Tested commit
efedeeacc69838e6702e1127b6ebf55097b44437on an AMD Radeon RX 6600 (8 GB VRAM, RDNA2, native 64-lane waves) with targeted/workspace tests and a 60 sscripts/smoke.ps1regression run (comparing againstmain62265d3).Tested
32.0.21045.29003;XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.8.2502.11.XCL_ADAPTER=radeon cargo test -p xcl --lib vram::tests -- --test-threads=4: 10 passed, 0 failed, 1 ignored (38.74s).XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 971 passed, 5 failed, 45 ignored (91.43s).mainfailures (#1028),render_targets_on_one_physical_page_share_its_video_memoryhitting the sameVRAM_TEST_LOCKpoison cascade in the workspace run (it passed in targetedvram::tests: 10/0), plusgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(known AMD Windows driver32.0.21045.29003miscompile).SKIPPED(not counted as coverage):gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's));gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's));gpu::recomp::lower_dxil::tests::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));gpu::recomp::lower_dxil::tests::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));gpu::recomp::lower_dxil::tests::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));gpu::recomp::lower_dxil::tests::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;shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): O aplicativo solicitou uma operação que depende de um componente SDK que está ausente ou é incompatível. (0x887A002D)(plus D3D12 debug-layer tests skip becaused3d12SDKLayers.dllis not installed).Regression run (
scripts/smoke.ps1, 60 s, release build,XCL_ADAPTER=radeon)Base (
main62265d3):PR (
efedeea):Not tested
AI use
scripts/smoke.ps1runs on my RX 6600 and drafted this report; I checked the output before posting.Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-25T01:27:01Z.
Review: COMMENTED
Review of
efedeeamerged ontomain656c0e8(clean on8f5fca5, same lines).CONFIRMED (run):
Pages::bindcounts missing tiles by address, then takes them bypage_key.vram.rs:568looks upfirst + i * PAGE; :593 usespage_key(..), :601fresh_iter.next().unwrap()(same lines at the head and merged).mainuses the address in both (read). With a page mapped away the keys differ. It came with the rebase onto #1747:0cf6d08took tiles one at a time (take_tile), so the reports on0cf6d08don't cover it; the two posted 60 s smokes ofefedeeashow no crash.(pools, accounted): before (1024, 1023) after (2048, 947), 1 tile each. (1 was already lost before the loop, so the first assert fires; with the line below none is lost, before or after.)The other:
map(), a sampled texture ata,place(a, &rt). Both:Exit 0xC0000409.
Our three tests pass with:
cargo test --workspace --locked --offline --no-fail-fast -- --test-threads=4, debug, RTX 3060, one run each, passed / failed / ignored:main1061 / 1 / 45; merged 1062 / 1 / 45; plus our tests 1062 / 4 / 47; plus the line 1065 / 1 / 47. The shared failure is the e2e title test. The PR's test passes in our three merged runs. Tests on request.Not tested: a retail title (does it reach the abort?), AMD, our tests on
main.Review by Claude Code (Claude Opus 5.5), checked with Claude Fable 5.2; each point checked by a person before posting.
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T01:21:34Z.
Empirical test report for PR #1182 on Intel Arc A770 (
STOR-WINLAB).efedeeacc69838e6702e1127b6ebf55097b44437origin/main:5796cc467d80e3dac5d7d231ec34f1b0bebce169git merge-tree --write-tree origin/main HEAD): clean (exit0, tree4eca6b8f6f8724f0c37c8949ba819632681c8949)PR-specific finding (Resource Heap Tier 1 / Intel Arc A770)
The new test
hle::d3d12x::title_textures::tests::render_targets_on_one_physical_page_share_its_video_memoryfails on Intel Arc A770:crates\xcl\src\hle\d3d12x\title_textures.rs:1691:17: expected a vram::Pages target at 0x...vram::place()(crates/xcl/src/hle/d3d12x/vram.rs:902-905, 934) returnsNonewhen!tier2(dev)(D3D12_FEATURE_DATA_D3D12_OPTIONS::ResourceHeapTier < 2), socreate_placed_resource_xfalls back to a committed resource +title_textures::register(observed log:xcl: D3D12.X: a small render target at ... (2 planes) is kept in step with the title's memory – a glyph cache the CPU fills). Unlikeplaced_title_textures_share_vram_and_preserve_pixels(title_textures.rs:1751) andd32s8_targets_take_their_own_size_of_video_memory(vram.rs:1260), the new test's guard (title_textures.rs:1674-1678) checksopts.TiledResourcesTier.0 < D3D12_TILED_RESOURCES_TIER_2.0but omitsopts.ResourceHeapTier.0 < 2.xcl --lib: Because the test panics while holdingVRAM_TEST_LOCKandtitle_textures::TEST_LOCK, both mutexes are poisoned and cause two other tests in the same binary to fail withPoisonError:hle::d3d12x::title_textures::tests::transitions_apply_when_their_list_is_submitted(title_textures.rs:1471:39)hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memory(vram.rs:1247:49)Both pass when run without the poisoned lock (note
d32s8_targets_take_their_own_size_of_video_memoryreturns early onResourceHeapTier < 2).Tested
XCL_ADAPTER=A770), driver32.0.101.9175(2026-11-04)10.0.26200.9974rustc 1.100.0 (0ef1bc386 2026-11-09)/cargo 1.100.0 (3acc79c0c 2026-11-05), debug (dev/test) profiledxcompiler.dll: 1.9(5512-01b62ad4)(1.9.2609.5) - 1.9.2609.5 (01b62ad47)cargo test --workspace --no-run: passed (exit0)cargo build --workspace: passed (exit0)cargo test -p xcl --lib hle::d3d12x::title_textures -- --test-threads=4 --show-output: 13 passed, 1 failed, 0 ignored (1SKIPPED:placed_title_textures_share_vram_and_preserve_pixels: tiled tier < 2; failed:render_targets_on_one_physical_page_share_its_video_memory)cargo test -p xcl --lib hle::d3d12x::vram -- --test-threads=4 --show-output: 10 passed, 0 failed, 1 ignored (churn_update_tile_mappings_timingignored;d32s8_targets_take_their_own_size_of_video_memoryreturns early silently onResourceHeapTier < 2)cargo test -p xcl --lib hle::kernelx -- --test-threads=4 --show-output: 35 passed, 0 failed, 1 ignored (scatter_timingignored)cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output: 948 passed, 28 failed, 45 ignored across all 20 workspace test targets (skipped GPU tests below are not counted as coverage):xcl --lib: 900 passed, 27 failed, 25 ignoredhle::d3d12x::title_textures::tests::render_targets_on_one_physical_page_share_its_video_memory, plus lock-poisoning cascades inhle::d3d12x::title_textures::tests::transitions_apply_when_their_list_is_submittedandhle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memorygpu::*failures: 20CreateComputePipelineState: The parameter is incorrect. (0x80070057)(gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0,1,2,3},gpu::dxil::ops_tests::{doubles_match_cpu,groupshared_barrier_and_atomics_run},gpu::dxil::round_tests::{gpu_direct_f32_round_modes_dynamic_and_denormals,gpu_direct_f32_round_modes_static},gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu,gpu::recomp::tests::{gpu_clamp_and_omod_per_instruction,gpu_f64_class_compare,gpu_f64_compares_with_nan,gpu_f64_literal_high_word,gpu_f64_math_random,gpu_f64_roots,gpu_f64_rounding_and_conversions,gpu_float_compares_random,gpu_frexp_f64_exp_and_mant,gpu_ldexp_f64,gpu_rndne_f64}) and 4 shader-semantics mismatches (gpu::recomp::tests::{gpu_nonfused_mad_and_mac_prevent_fma_contraction,gpu_ps_image_sample_offset_implicit_lod_between_mips,gpu_valu_16_and_64_bit,gpu_wave64_ps_whole_wave_reductions})tests/e2e.rs: 2 passed, 1 failed, 0 ignored — unrelated Arc A770 baseline failure intest_title_runs_and_game_folder_is_untouched([FAIL] D3D12.X: dynamic depth bias via RSSetDepthBiasX (#94): top-right [0, 0, 255, 255] (expected green: RSSetDepthBiasX(-1000.5) passes depth test))bcpack_parity,console_dlls_e2e,console_shaders,disasm_e2e,gpu_compute_e2e,gpu_pso_e2e,heap_probe,low_va,pls_quota,predication_e2e,rpf_e2e,shaders_e2e,sparse_reinit,texture_states,xg_oracle,xclbin,xcl-testtitlebin, doc-tests): 46 passed, 0 failed, 20 ignoredSKIPPEDGPU tests (25SKIPPEDlines across 15 tests — not counted as coverage):SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu: no wave64SKIPPED gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu: no wave64SKIPPED gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu: no wave64SKIPPED gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu: no wave64SKIPPED gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu: no wave64SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64: no wave64SKIPPED gpu::recomp::lower_dxil::tests::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))SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64: no wave64SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 arithmetic, wave64: no wave64SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 compares, wave64: no wave64SKIPPED gpu::recomp::lower_dxil::tests::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))SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64: no wave64SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 rounding, wave64: no wave64SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 three-source, wave64: no wave64SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer arithmetic, wave64: no wave64SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer carries, wave64: no wave64SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64SKIPPED shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)SKIPPED placed_title_textures_share_vram_and_preserve_pixels: tiled tier < 2SKIPPED test_title_draws_with_a_root_signature_under_the_debug_layer: no d3d12SDKLayers.dllSKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windowsSKIPPED uploads_start_from_each_subresources_state: no D3D12 debug layer (The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D))Not tested
vram::place()/vram::Pagesexercises the shared physical-page video-memory path implemented in this PR.no d3d12SDKLayers.dll/0x887A002D).scripts/smoke.ps1regression run.AI use
efedeeacc69838e6702e1127b6ebf55097b44437), ran the build, targeted tests, and full workspace test suite on Intel Arc A770, diagnosed the Resource Heap Tier 1 failure and mutex-poisoning cascade, and wrote and posted this report.Imported from ivall/xcl. Originally posted by iggyvilla on 2026-11-25T01:35:22Z.
Test report for #1182 (tested at head
0cf6d08; the PR head has since moved toefedeea, not retested) on RDNA2, a retail title.Measured by an agent (omp, DeepSeek V4.1 Flash); I (Claude Code, Claude Sonnet 5.5) re-read the run logs, checked
the numbers below against them and wrote this. Measurement only, no code change; the test suite was not run.
retail title
7952987A(not included here).origin/mainb7aa9f3+ #889 (e1d3b9d) + #1288 (95299f4) as control, and the same plus this PR.A 300 s scripted walk (
XCL_PRESS_ATgamepad presses) from a save past first-run setup,XCL_ACTIVITY=1 XCL_DXC_THREADS=4 XCL_NETWORK=0.One run each. Both walks reached the loading art
(screenshots checked), neither drew the world.
video memory 6,343 -> 4,487 MB. At the world load: peak pages 9,728 -> 7,806 MB, peak local
15,057 -> 13,202 MB. This reproduces the PR's claim on this card.
process commit is the same (37,601 vs 37,551 MB).
0x8007000eappears in neither log, so the PR's"CreateHeap OOM instead of +0x23cf683" difference cannot be seen on this walk.
1 GB/s from ~280 s (34 GB -> 71 GB by 308 s) that XCL's page/pool counters do not show. The runs of this
PR did not climb, but that climb is not caused by this PR: it also happens without it.
Not tested
confirms nor clears it.
d3d12x/vram.rs, no combined tree built).AI use: an agent (omp, DeepSeek V4.1 Flash) ran and measured; Claude Code, Claude Sonnet 5.5 verified and wrote this report.
Imported from ivall/xcl. Originally posted by veyn-sudo on 2026-11-25T01:56:24Z.
On
efedeea,bindcounts the tiles it needs by address and then looks the pages up bypage_key. Since #1747 the tiles are taken from the pool up front, so the two don't match:fresh_iter.next().unwrap()would panic.Test: in
render_targets_on_one_physical_page_share_its_video_memory, placing atbagain and dropping it must leave the pool's spare tiles unchanged. Without a fix it fails in the first round (1021 instead of 1022). It passes withpage_keyin both loops andreturn_tilesfor the rest offresh. I only read the panic case in the code.With that fix, one run each on a retail title at 154 s: target pages 5,681 → 3,832 MB, local video memory 10,288 → 8,534 MB.
Tested: RTX 2070 SUPER (driver 617.14), Windows 11 26300, debug for the test, release for the title; ported onto a local tree with other changes, so not your branch as it is. Full suite there, before I added the check above: 1175 passed, 0 failed, 46 ignored.
AI use: Claude Code (Claude Opus 5.5) found this, wrote and ran the test, and wrote this.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T05:39:43Z.
I reproduced both tile-counting cases on efedeeac, following veyn-sudo’s review.
fresh_iter.next().unwrap()panic inPages::bind. The first target still held the virtual-address entry while the second needed a new physical-page entry.I tested a local correction that uses the same
page_key(first + i * PAGE, phys.get(i).copied().flatten())lookup to count and consume tiles, then returnsfresh_iter.as_slice()to the pool before mapping. Both focused cases passed and thevram::testsgroup had 10 passed, 0 failed, 1 ignored and zero runtime skips. I extendedrender_targets_on_one_physical_page_share_its_video_memoryfor the focused cases and ran each in a fresh process.Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug. Synthetic placement and allocator coverage. GPU pixel readback, retail and the workspace suite are outside this report. AI use: OpenAI Codex (GPT-6) wrote the test changes and local correction, ran the comparison, and drafted this report.
GPU pixel follow-up. I added
physical_render_target_alias_preserves_gpu_pixelsto exercise GPU writes. Two 128×128 RGBA8 render targets shared one title physical page. I cleared one target after an aliasing barrier, returned both aliases toCOMMONbefore switching, then read through the other target. All 16,384 pixels carried the new color. All 16,384 pixels in a third target on a different page retained its original color. The fixture passed twice on the publishedefedeeacruntime and twice with the local allocator correction, with zero D3D12 error or corruption messages, device removals or skips. Same Windows and GPU setup as above. Codex wrote and ran this synthetic readback fixture.Recheck on 5fa6950. On the same Windows and RTX 3080 Ti setup,
cargo test --offline --locked -p xcl --lib render_targets_on_one_physical_page_share_its_video_memory -j 3 -- --nocapture --test-threads=1passed 1/1 on the clean PR, with zero ignores or runtime skips. I then applied only the synthetic readback fixture above. The exact fixture passed 1/1, with 16,384/16,384 expected pixels through the alias and 16,384/16,384 in the separate-page control. Graphics Tools reported zero D3D12 errors. This recheck covers distinct virtual addresses sharing the same physical page, with explicit aliasing barriers. Home-address identity and retail behavior were outside this recheck. Codex (GPT-6.2 Sol) ran both tests and drafted this update.Imported from ivall/xcl. Originally posted by Filip722 on 2026-11-25T06:14:37Z.
I reproduced a second render-target alias case on an RTX 5060 Laptop GPU. If the first target uses the home address returned by
MapTitlePhysicalPages(NULL, …), a second target at a chosen address for that physical page reads stale pixels. Both targets remained alive during this test.efedeea+ test fixtureThe cherry-pickable fix and tests are directly on this PR's head. They track explicitly mapped homes, preserve the existing owner when another page occupies the address, and clear the recorded identity on unmap or free. The GPU test uses fenced aliasing barriers in COMMON and reads both textures back. The separate spare-tile accounting change discussed above is independent.
Bazzite 44.20261011.0, Intel Core 7 240H, RTX 5060 Laptop 8 GB, NVIDIA 615.78.08, Proton Experimental 11.0-20261112, vkd3d-proton 3.1.0 (
4522cc1a8b1347f+). Cross-built with Rust 1.98.1 usingcargo xwin test --release --locked --target x86_64-pc-windows-msvc -p xcl --lib --no-run. Under Proton I ran each Windows test by exact name with--test-threads=1 --nocapture. Both new tests failed on the test-only control5763f5a. Ond3887f2the GPU readback and mapping lifecycle tests passed, as did the existing tile-sharing test and seven adjacent kernel mapping tests. No reported skips. These measurements establish the synthetic pixel result. Retail use of this particular mapping sequence remains unverified.I also ran one offline Series X comparison per build with independent copies of the same prefix and shader caches. At frames 20, 116 and 212 the native present-source readbacks were black in both builds (0 of 518,400 sampled pixels above black per readback). The fixed build also sampled black at frames 308 and 404. All 15 control and 19 patched window captures were black. The external host-memory guard ended the runs at 6,068 and 5,994 MiB available, respectively. This pair did not verify a visible retail improvement.
OpenAI Codex (GPT-6.2-Sol, high) wrote the patch and tests, ran them on this laptop, and prepared this report.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T06:32:34Z.
Independent native Windows GPU check of d3887f26. Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug.
Tested
cargo test --offline --locked -p xcl --lib render_target_at_physical_page_home_inherits_texels_after_move -j 3 -- --exact hle::d3d12x::title_textures::tests::render_target_at_physical_page_home_inherits_texels_after_move --nocapture --test-threads=1passed 1/1. Both alias directions matched 16,384/16,384 pixels. Direct writes and the independent texture matched 16,384/16,384 each. The fixture printed RTX 3080 Ti.kernelx.rsrestored from PR head efedeeac, the same fixture failed 0/1. Both alias directions matched 0/16,384 pixels. Direct writes and the independent texture still matched 16,384/16,384 each.hle::kernelx::tests::mapped_home_page_identity_follows_moves_and_partial_freespassed 1/1 on the candidate.Combined follow-up
I applied the tile-counting correction described earlier to
d3887f26in a disposable checkout. On the same RTX 3080 Ti, the home mapping lifecycle test and bidirectional GPU pixel test passed 1/1 each. The extendedrender_targets_on_one_physical_page_share_its_video_memorytest also passed 1/1 in each of two fresh processes, first withXCL_TEST_REKEY_RTunset and then set to1. The repeated physical alias retained the same spare tile count, and the address-to-physical-key transition completed without the allocation panic. All four focused runs had zero failures, ignores, or runtime skips. This combined check is synthetic and does not replace a full suite or title regression run.Not tested
Workspace suite, retail title, AMD, or D3D12 debug-layer validation. The separate tile-counting issue in
Pages::bindremains.AI use
Codex (GPT-6, exact variant unavailable) ran the tests and drafted this report.
Imported from ivall/xcl. Originally posted by 3L1A5-1 on 2026-11-25T07:24:49Z.
Thanks, everyone. Pushed
5fa6950, rebased onto the samemain689f2db:bindcounting by address (@pvfreis, @veyn-sudo, @thehollowedone): confirmed. It came in with my rebase onto #1747: I moved the loop that takes the tiles topage_keyand missed the new loop that counts them first. Both loops now usepage_key. With that, the count matches what the second loop takes, so nothing is left over infresh, and I left out returning the remainder. The PR's test now also checks that no pool tile is lost (vram::tiles_unaccounted_for) and places a target before a page is mapped at its address, then a second one after. With the counting loop back on address keys it aborts atvram.rs:601(0xC0000409), and without that case it fails with 2 tiles lost.vram::placekeeps no target on pages there.VRAM_TEST_LOCKandTEST_LOCKpoison-tolerantly now. Other tests intitle_textures.rsstillunwrap()them (e.g.gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes,placed_title_textures_share_vram_and_preserve_pixels, andtransitions_apply_when_their_list_is_submittedforTEST_LOCK); I left those alone here.0cf6d08, before the rebase, so it doesn't cover the counting bug.physical_pagesonly knows pages mapped away, so a target at the home stays address-keyed. That is whatmaindoes for every alias, so this PR leaves the case as it was rather than breaking it. Your fix adds bookkeeping in kernelx and its own tests (+274/−55), and it already has @thehollowedone's native check. Would you opend3887f2as a PR stacked on this one? It would be reviewed on its own, keep this PR under the size limit, and stay your change. I put the case under Not tested in the description.Full suite on
5fa6950: 976 passed, 0 failed, 45 ignored. Smoke of5fa6950is in the description: 1373 frames vs 1432 onmain, peak commit 13 255 vs 15 592 MB, no crash.AI use: Claude Code (Claude Opus 5.5) wrote the fix, the tests and this reply.
Imported from ivall/xcl. Originally posted by Filip722 on 2026-11-25T07:54:07Z.
Opened #2177 on top of your updated
5fa6950. The top commit is244aa780. All ten focused tests passed on the RTX 5060 Laptop, including your updated tile-counting case. Both directions of the home-address test again matched all 16,384 texels. The PR includes the two retail smoke blocks and the workspace results under Proton.OpenAI Codex (GPT-6.2-Sol, high) prepared the stack and ran the checks.
Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-25T15:18:49Z.
Both points of our review are fixed at
de4d1f6(read, not rerun):bindcounts (vram.rs:708) and takes (:732) with the samepage_key, the line our three tests passed with onefedeea. A page is at one address inAWAYand both loops use onephyssnapshot, so I also see nothing left over infresh.Read by Claude Code (Claude Opus 5.5), checked with Claude Fable 5.2; each point checked by a person before posting.
Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-25T15:34:51Z.
RTX 4060 Laptop / stock vkd3d-proton validation of the change and regression from
de4d1f676146ac58b4c11037bed9d0c1b5789d0c, including a Series S title trial.This is a mixed local integration based on
06c9f5505f63f10c5ec49ef932d75b2c28177324, including #867/#1395, #1069, #1916, #615 and #495. This PR's code and test were ported into that tree; #2177 was not included. Not a clean-head comparison or a competing implementation.Environment: RTX 4060 Laptop 8 GiB, NVIDIA 590.48.01, i7-13620H, 16 GiB RAM; Linux 6.17.0-40-generic, Wine 11.0, stock/assert-enabled vkd3d-proton 3.2.0 (
2576c0b4adfae4a), DXVK 3.1.1-209. Rust 1.98.1, Windows MSVC cross-target.Focused verification
cargo +1.98.1 test -p xcl --lib --target x86_64-pc-windows-msvc <filter> -- --test-threads=1 --nocapture, through Wine, withXCL_REQUIRE_GPU=mesh XCL_DEFER_PRIVATE_HOME_TILES=1:render_targets_on_one_physical_page_share_its_video_memory: passed, including shared-page accounting, the unmapped-address-to-physical-key case and no lost pool tiles.placed_title_textures_share_vram_and_preserve_pixels: passed. Its 512 unreleased 1 MiB textures over 16 MiB retained 16 MiB of pages; pixel checks passed.Two unique tests, two passes, no test skips. The logs identify the actual NVIDIA adapter despite the configured DXGI vendor spoof. Release build passed.
Bounded retail 1.0.2.1 runs
Same local stack before/after this PR,
lockhart,XCL_COHERENT_MB=3408 XCL_ACTIVITY=1 XCL_PSO_PRELOAD=0 XCL_DEFER_PRIVATE_HOME_TILES=1 XCL_FRAME_DUMP=300 XCL_PRESS_A_AT=40,55. The second run received additional manual confirmations through first-run setup.These end-of-run measurements are not matched gameplay phases. The later run visibly reached Navigation Experience, UI Text Size, Subtitles and Brightness setup. It reported 7,922 presents and 29.9 fps over the last 300, but these were menus, not gameplay. No unhandled title exception was recorded. Shutdown logged GPU fences still pending after 10 s; the guard subsequently timed out querying NVIDIA telemetry. Thus exit code 0 is not a clean-shutdown or stability claim. Offline XStore errors and command-list resubmission warnings also remained.
Not tested: native Windows, AMD, clean PR head, full suite, home-address aliasing (#2177), world gameplay or 15-minute/30fps acceptance. Free disk stayed above 13.49 GiB. No proprietary assets or screenshots attached.
AI assistance: omp / openai-codex/gpt-6-astra performed the integration, commands, measurements and report. Credit for the fix and regression remains with this PR's authors.
Imported from ivall/xcl. Originally posted by crastinator on 2026-11-25T16:13:00Z.
Review: COMMENTED
RDNA2 under Wine: render targets sharing physical pages saves about 1.9 GB from the menus on, but the world load still fills a 12 GB card.
mainStacked with #2306 (
XCL_TEXTURE_LEVEL_PAGES=1) and #1916, the same load stays at 5.8 GB local (2379 MB of pages at 60 s), against #2306 alone at 8.3 GB. I merged #2306 on top by hand (both changePages::bind; I passedphysthrough #2306'sbind_range, with&[]frommap_levels, because lazy levels are only for sampled textures andphysonly for GPU-owned ones). Headde4d1f6.Tested (head
de4d1f6, merged ontomain06c9f55, no conflicts unless noted)53aac418from #775), DXVK v3.1.1-97dxgiXCL_COHERENT_MB=512(the 4095 MB learned window is ~1 fps here, #284),XCL_ACTIVITY=1memory:line; "card full" means sysfsmem_info_vram_usedreached 11.5 GB, where my guard stops the run (a full card has crashed the compositor here before).Not tested
cargo testunder Wine: these were title runs only.AI use
Imported from ivall/xcl. Originally posted by thiagocalile on 2026-11-25T18:49:20Z.
Independent test and smoke report for head
d165e20874993caf41ee33877626a4d101b2f641on an AMD Radeon RX 6600 (8 GB VRAM, RDNA2, native wave64).Tested
32.0.21045.29003,XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.8.2502.11.XCL_ADAPTER=radeon cargo test --no-fail-fast -p xcl --lib -- vram --test-threads=4: 18 passed, 0 failed, 1 ignored (0skipped).Regression run (
scripts/smoke.ps1, release builds,XCL_ADAPTER=radeon)main(50a9fde):PR
#1182(d165e20):Not tested: NVIDIA/Intel GPUs, Linux/Wine, or world load past the 60 s smoke window.
AI use: Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting.
Imported from ivall/xcl. Originally posted by dhillonjagdeep650-boop on 2026-11-26T01:27:30Z.
A question from a retail run: with this PR the missing world behind the intro is solid blue instead of black or grey. Three runs with it, one without, so an observation and not a bisection.
Setup: RTX 3080 Ti 12 GB (driver 617.42), Windows 11 Pro 26300.9974, release,
main2898511+ #2404 (5ca9c23, one local barrier).XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_COHERENT_MB=512 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PSO_WAIT_MS=50, scripted A. The world itself is not drawn in any of the four; overlay, credits and subtitles are.d165e20)0xfffb0000, RGBA8) from about frame 1150 to the endThe memory it saves is large here. The blue may be nothing (contents of a target nobody drew to, now from another tile). Is that expected, or a target that should keep its clear? The affected GPU tests of
vramand the physical-page ones pass here one at a time (25 of 25).Not tested: this PR alone on
main; whether a drawn world is affected.AI use: Claude Code with Claude Opus 5.5 ran the scripts unattended, looked at local frame dumps and wrote this.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T03:52:50Z.
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-28T09:34:04Z.
The physical-page sharing repair is adapted on our NVIDIA integration branch: 9178849e supplies live physical identities and 8048a6fe uses them in the native texture-page allocator. Credit to @3L1A5-1 for this PR and @Filip722 for the home-mapping follow-up #2177.
Current NVIDIA code already keeps explicit console aliases in
Away.title, including addresses whose CPU bytes moved elsewhere. The identity API reuses that index, filters released IDs and checks it before taking the texture-page lock. Both allocation counting and binding use the physical key. Repeated physical IDs inside one placement reserve one fresh tile while retaining every reference. Sampled texture levels keep their existing address-based keys.The activity line counts duplicate address backing avoided by these physical keys; multiple views at the same address are excluded. That counter is not a measured DXGI saving. The original allocation-accounting fixture is retained, but does not itself establish pixel inheritance across arbitrary formats/states.
Compilation:
cargo build --locked --release -p xcl --target-dir <isolated-target>completed on integrated commit04722e9a71d22e2e23cbbeb859161246023adea4(exit 0, 229.969 seconds, 8 compiler warnings). This is compilation evidence only.Interactive follow-up on the combined NVIDIA candidate
An RTX 3060 Ti (8 GiB) run of the same clean integration head
04722e9a71d22e2e23cbbeb859161246023adea4ended after 3,266 seconds with D3D12 device removal0x887A0005; 1,060 read-only monitor samples were recorded. Peak logged process commitment was 25,311 MiB and local DXGI usage 9,218 MiB, with a maximum 2,002 MiB overrun of its contemporaneous budget. Immediately before removal, a two-second interval recorded 1,703 draws and 7,023 dispatches with no new presents. DRED state was UNKNOWN and breadcrumbs were unavailable. Budget pressure coincided with failure; the exact GPU fault and causal contribution of any individual patch are not established.The physical-alias counter reported 1,006 MiB of duplicate address backing avoided; this is allocator accounting, not an isolated measured DXGI reduction. At least 2,048 earlier-run driver blobs were successfully reused. Three matched cached creations took 135–147 ms versus 16,672–31,259 ms previously uncached. These narrow observations do not make the combined candidate gameplay-validated. No unit/GPU test batch or matched main/head smoke comparison was run for this revision, and this report is not an approval to merge the integration or evidence that this individual PR caused the failure.
AI use: Codex (GPT-6), adaptation and source review.
An optional temporary Discord is available to coordinate contributor work, help test and compare results.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:01:16Z.
Triage (#1607) – head
d165e20Not on main: main's
vram.rsstill keysPages::pagesby address only (bind_range). #2177 carries this commit and is stacked on this PR; #2492 (macOS host) and #1248 (4 KiB slots for tiny textures) change different things. The line overlap with #3099/#3111/#3112/#3335/#3361 comes from their amd-dev base, not the same change.Limitation seen in the diff:
kernelx::physical_pagesreturns None for a page at its home, so a target placed over a home-mapped page stays keyed by address and does not share with a later alias (what #2177's second commit adds).map_levelspasses&[], so lazy-level textures keep address keys. The branch conflicts with main.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.