D3D12.X: size large BC texture addresses from the guest layout #929
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/935"
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 Gevroska on 2026-11-24T08:43:58Z.
The committed-texture address fallback can reject a large BC texture whose guest layout fits within the reservation limit. Preserve that layout size when the native resource is created so the fallback can reserve enough CPU address space.
What is in it
real.rsuses the supported guest layout when the legacy size estimate rejects a committed BC texture. The wide BC1 regression checks the reservation size and address reuse.Tested
scripts/test.ps1 --nocapturewith four test threads. Stock passed 2,594 tests, and the XG #44 texture readback and split-worker cache artifact test passed in both revisions. The split-worker test includes the upstream artifact assertions from #3213. The earlier XG #44 mismatch did not reproduce in the matched current suites.Libtest totals 2595 passed, 0 failed, 49 ignored, 0 filtered out
28 explicit runtime skip messages
SKIPPED gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole: no wave64
SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu: const_mask, wave64: no wave64
SKIPPED 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 wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 arithmetic, wave64: no wave64
SKIPPED 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 wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 compares, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu: mask_ff0_flbit, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu: f64, wave64: no wave64
SKIPPED 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 wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer carries, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 rounding, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 three-source, wave64: no wave64
SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
SKIPPED hle::d3d12x::bind::tests::two_pass_binds_set_the_shared_view_heap: no heap windows (opt-in: XCL_HEAP_WINDOWS=1)
SKIPPED 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 heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows
SKIPPED 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))
Regression run
Matched 150-second startup smokes used the same title and adapter, separate fresh DXIL caches and on-demand shader preparation (
XCL_PREPARE=0). No menu input was sent.Not tested
AI use
I reviewed and approved this PR update and its description before publication.
Imported from ivall/xcl. Originally posted by ettehn on 2026-11-24T08:53:48Z.
The two BC1 fixtures on
96a56e0pass on my RTX 5070 Ti Laptop. There is one more sizing case worth covering: a supported tiled layout can need more space than the legacy estimate even when that estimate fits under the 1 GiB cap. The current early return then discards the XG size. This appears to be a remaining limitation of the original sizing path.A local change compared the padded guest requirement with the legacy reservation before discarding the original description. It kept the legacy reservation when sufficient and used the recorded layout when more space was needed, with the same cap at reservation time. All four
console_format_query_testspassed on Windows, including an additional narrow BC array checked withVirtualQuery. This verifies the reserved CPU range; retail loading and texture upload were outside the test.OpenAI Codex (GPT-6.2 Astra) assisted with verification.
Imported from ivall/xcl. Originally posted by dcastell1 on 2026-11-24T08:56:57Z.
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on clean
main@beaa245(713 passed, 0 failed, 41 ignored on this box):One more passing test than main: sizing large BC texture addresses from the guest layout is covered and green.
Tree restored afterwards (md5 and a full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T10:37:43Z.
Linux / AMD RDNA3 datapoint.
Merged state: head
96a56e0onto main9aec53d, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 718 passed, 7 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows. large-BC-texture address sizing green.Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by Gevroska on 2026-11-24T16:56:52Z.
Thanks for testing this. The current fix covers the large-allocation fallback. Your example points to a separate early return that can discard a larger layout size below the cap. I’ll check that path with the narrow BC array before deciding whether to include it in this PR.
upstream-sync referenced this pull request2026-11-24 21:07:02 +00:00
Imported from ivall/xcl. Originally posted by thaqiart139-alt on 2026-11-24T22:48:59Z.
Test report for this PR's head
96a56e0, merged intomain689f2db(no conflicts), on AMD RDNA2 with native 64-lane waves and on a 32-lane NVIDIA card.Tested
XCL_ADAPTER.cargo test --workspace --no-fail-fast -- --test-threads=4:main689f2dbmain, from #1679's new fuzz tests, and both are already reported on #1679:fuzz_validate_and_gpu_0to_3(CreateComputePipelineState:0x8007000E)fuzz_validate_and_gpu_1(seed 540: res[833] = 0x7, CPU 0x6)gpu_console_committed_bc_addresses_cover_original_layout.SKIPPED tests (the same on
mainand with this PR)gpu::recomp::lower::tests:a_2d_or_3d_group_agrees_with_the_hlsl_path_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,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpugpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu, and the wave64 cases of itsf16/f32/f64/integer_programs_on_the_gpugpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwarelower_dxil's f16 arithmetic, f16 packed and f32 conversions: refused ("its #1426 semantics differ from the console's")heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode is off)gpu::dxil::geometry_tests::gpu_geometry_direct_records,emitted_ms_primitive_attribute_reaches_the_pixel_shader,emitted_ms_ps_draw_a_triangle,gpu_geometry_mode_es_gs_strip,gpu_geometry_mode_es_gs_strip_with_branches,gpu_mesh_mode_two_passeslower_dxil's f16 arithmetic, f16 packed and f32 conversions: refused, as aboveheap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)pso_measurement_compiles_an_exact_synthetic_record(Developer Mode is off)Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T09:17:14Z.
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!
Imported from ivall/xcl. Originally posted by xpatfussy69x on 2026-11-25T11:24:43Z.
Test report for head
96a56e0as pushed (not merged onto currentmain) – NVIDIA, wave32.Tested
.\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 685 passed, 0 failed, 41 ignoredgpu_console_committed_bc_addresses_cover_original_layoutran and passedXCL_SAMPLE_*data set (game-data tests not run)One stall, not reproduced. In an earlier full-suite run on this head, four
gpu::recomp::tests(gpu_typed_buffer_loads_and_stores,gpu_uma_import_check_at_init,gpu_valu_16_and_64_bit,gpu_wave32_and_wave64_src_vccz_execz) each ran for over 60 s and I stopped the run. I could not make it happen again:cargo test -p xcl --lib gpu::recomp::testspassed onmain568e7db(147 passed, 7 s) and on this head (114 passed, 5 s), and the full-suite run above passed. None of those tests touch this PR's code, so I read it as a one-off on my machine.Not tested
mainAI use
Imported from ivall/xcl. Originally posted by S1m0ne1997 on 2026-11-25T14:25:34Z.
Test report for
96a56e0ba7127fdb89c47f60bf8f987ec1c9b553(this PR's head), for #1607.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09)x86_64-pc-windows-msvc, debug.cargo build --workspace, thencargo test --workspace -- --test-threads=4at the head: 685 passed, 0 failed, 41 ignored.gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64).Regression run (retail title,
scripts/smoke.ps1 -Seconds 60, release;mainbuilt from the commit in its block, this PR from its head, no uncommitted changes)main:
this PR:
A first smoke run of this same head crashed: exit
0xc0000005,crashes: 2, no device removal, presents per 2 s (last 3) 57 58 59, frames not logged because the run did not reach its end, peak commit 9 746 MB. That run's block is not pasted because it was made with this branch's oldersmoke.ps1, which prints the game folder's name instead of its hash (#677). The second run, above, andmain's run were clean, so this is 1 crash in 2 runs of this head and 0 in 1 ofmain: maybe intermittent, maybe unrelated to this PR. I did not look into the crash.Not tested
AI use: Claude Code with Claude Opus 5.5 ran the build, the suite and the regression run and wrote this report at my request.
upstream-sync referenced this pull request2026-11-25 16:12:04 +00:00
Imported from ivall/xcl. Originally posted by Gevroska on 2026-11-26T01:22:54Z.
I reproduced the large BC1 texture reservation failure on Windows with an RTX 3080. I ran the same test on base
6d12f58aand local candidate7ceb0fbc. Both created the 16,384 × 16,384, four-layer BC1 resource and agreed on its 512 MiB layout. On the base, the CPU address reservation was zero and the test failed. On the candidate, the reservation was 512 MiB plus 64 KiB and the address stayed stable.I used Codex GPT-6.2 Sol for the first comparison. A separate GPT-6.2 Sol agent repeated both runs on the same adapter and reproduced the failure and pass, with zero skips. This covers the large-texture case. The separate below-cap case remains open.
I’ve carried the change onto
b49be183as local commitb82a8645. Validation of that revision is still in progress.I reviewed and approved this comment before posting.
Imported from ivall/xcl. Originally posted by Gevroska on 2026-11-26T08:45:42Z.
I finished validating local candidate
b82a8645against baseb49be183on a GeForce RTX 3080. The base failed to reserve a CPU address for the 16,384 × 16,384, four-layer BC1 texture. The candidate returned a stable reservation of 512 MiB plus 64 KiB.The standard Windows suite reported 1,436 passed, 0 failed and 47 ignored. I counted 27 structured skip messages and two additional debug-layer skip messages. Both matched 60-second startup runs exited cleanly with zero crashes or device removals: 1,423 frames on the base and 1,457 on the candidate. These runs cover startup. The separate below-cap case and gameplay impact remain unverified.
I used Codex GPT-6 Sol Daybreak for the initial integration and GPT-6.2 Sol for the current-base change, regression test and validation. A separate GPT-6.2 Sol agent independently reviewed the result.
I reviewed and approved this comment before posting.
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T00:04:03Z.
Independent desktop NVIDIA verification of PR #935 at head
b82a8645b5bb827c0a65abd98b19149c7f7c5425(1commit; exact parent & merge-base:b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted release tests & build (
b82a8645)cargo test --release -p xcl gpu_console_committed_wide_bc_addresses_cover_original_layout -- --nocapture(3 consecutive runs)1 passed; 0 failed; 0 ignored; 1336 filtered out× 3 (0.21s,0.20s,0.21s); live output on all 3 runs:NVIDIA GeForce RTX 4060: created 16384x16384x4 BC1, XG 0x20000000, D3D12 0x20000000, CPU reserve 0x20010000cargo test --release -p xcl hle::d3d12x::real:: -- --test-threads=1(3 consecutive runs)61 passed; 0 failed; 0 ignored; 1276 filtered out× 3 (2.10s,2.08s,2.08s,0skipped)cargo build --release -p xcl0,0new warnings)Live test output confirms that on desktop NVIDIA GeForce RTX 4060 (8 GB), the committed
16384x16384x4BC1_UNORMtexture (format 71) retains its0x20000000-byte XG console layout size and receives the padded0x20010000-byte CPU fallback reservation (GetGPUVirtualAddress of a committed 16384x16384 texture (format 71, flags 0x0): 0x20010000 bytes ...).Paired quiet 60 s retail smoke (
title: 29640639)Exact parent & merge-base (
b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, cached baseline on the same machine):PR #935 (
b82a8645b5bb827c0a65abd98b19149c7f7c5425):Runtime log observations (
xcl.log)9223log lines,0[ERROR]/ device-removal / panic lines.19510 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample14016 MB committed by the process; video memory 6115 MB local, 4682 MB non-local.0committed textureGetGPUVirtualAddressfallback reservations logged during the 60 s retail run ontitle: 29640639.Limits of coverage
BC1fallback sizing path (COMMITTED_BC_LAYOUT_SIZEprivate data ->0x20010000CPU reserve covering the0x20000000console layout) was directly exercised on the RTX 4060 viagpu_console_committed_wide_bc_addresses_cover_original_layout(3/3pass) andhle::d3d12x::real::(61/61× 3).title: 29640639did not hit the committed wide BC fallback path in 60 s, so the retail smoke confirms zero runtime regression on this title (frame-count delta vs. cached parent smoke reflects single-run startup variance, not this PR).AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T00:24:48Z.
Tested: Clean
b82a8645b5bb827c0a65abd98b19149c7f7c5425, Windows 11 build 26200.9974, Ryzen 7 3800X, Arc A770 driver 32.0.101.9175, Rust 1.100.0 MSVC debug.cargo test --locked -j 2 -p xcl --lib --no-runthen selected layout/format/size filters on the executable: 40 passed. WithXCL_ADAPTER=A770, the exactgpu_console_committed_wide_bc_addresses_cover_original_layoutandgpu_console_format_allocation_info_is_sanetests each passed. All runs had zero failures, ignores or skips. The wide BC1 case covered a 16,384×16,384 four-layer texture with a 512 MiB guest layout and checked a stable 512 MiB + 64 KiB CPU reservation.Not tested: Texture sampling, separate below-cap sizing, full workspace suite and retail smoke.
AI use: T3 Code / Codex (
gpt-6.2-sol) ran and reran the checks and wrote this report.Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T22:49:07Z.
I reproduced the separate below-cap sizing case on head
421d52b7a9f99a63943c5e06b79f698b51646313, RTX 5070 driver 616.92. I used an 8×8 BC1_UNORM texture, four mips, console layout 0x109. Only the array length differed between the controls.Both resources were created through the console committed-resource hook. I checked that neither had a placed title address, that repeated queries returned the same fallback address, and that VirtualQuery reported the reservation. The four-layer resource's legal 8-byte block is wholly outside that reservation. The fixture compared offsets and bounds without touching an unreserved address.
I set XCL_UMA_MB=64 and XCL_COHERENT_MB=64 to exercise the committed fallback under the existing 128 MiB coherent-headroom policy. With the normal larger coherent window the small resource went through placement instead. The supported guest layout is available for both inputs, but remember_committed_bc_layout_size returns early whenever the legacy estimate fits the cap. Considering the guest extent for that case as well would cover the missing slice. This measures CPU address coverage; the fallback does not upload CPU writes to the native texture.
AI use: OpenAI Codex adapted the stock wide-BC test, ran the native controls, and drafted this report.
Imported from ivall/xcl. Originally posted by Gevroska on 2026-11-29T01:42:15Z.
@andrewDoing, thanks for testing the published head (
421d52b7) and for including the one-layer control. Your four-layer result shows the remaining gap clearly: the last mip’s BC1 block starts at0x31000, beyond the0x20000CPU fallback reservation, even though the guest layout covers0x40000bytes.I scoped #935 to the wide-texture case where the legacy estimate exceeds the cap. Your example shows that an estimate can fit under the cap and still leave a valid guest offset outside the reservation. I’d keep the 8×8, four-mip, one-layer versus four-layer comparison as a regression test for a separate below-cap fix. Comparing the offset and reservation size also lets that test demonstrate the bug without touching unreserved memory.
GPT-6.2 Astra drafted this reply from your RTX 5070 measurements and the scope of #935.
I reviewed and approved this comment before posting.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-29T02:03:21Z.
For the separate below-cap fix, here is the bounds assertion from the 8×8 BC1 control in a form that can be added alongside the wide-texture regression. Use the same four-mip, 0x109 guest descriptor for both cases, with array length 1 or 4. Set XCL_UMA_MB=64 and XCL_COHERENT_MB=64 in the test process before creating the device. After console committed creation, require title_address to be absent, query the fallback address twice and check equality, then get the reservation's RegionSize via VirtualQuery at that base.
On
421d52b7the one-layer control passes and the four-layer case fails with 0x31008 > 0x20000. This assertion allows larger valid reservations and never forms or dereferences a pointer to the last block. The original native measurements are in the comparison above.AI-assisted regression note.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:31:41Z.
Triage (#1607) – head
421d52bNo open or merged PR makes the same change. main's
texture_memorystill sizes from the PC description and returns None above 1 GiB. The fix only applies to BC textures whose old estimate overflows: the XG layout size is kept as private data at creation. TheBuild and test (Windows, no GPU)check is red and its log has expired. Rerun it to see whether the failure comes from this PR.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.