Skip to content

D3D12.X: size large BC texture addresses from the guest layout - #935

Open
Gevroska wants to merge 1 commit into
xcl-dev:mainfrom
Gevroska:xcl-local/committed-bc-texture-size
Open

Gevroska wants to merge 1 commit into
xcl-dev:mainfrom
Gevroska:xcl-local/committed-bc-texture-size

Conversation

@Gevroska

@Gevroska Gevroska commented Nov 24, 2026 •

Copy link
Copy Markdown

The committed-texture fallback can reject a large BC texture even when its console layout fits within the reservation limit. Keep the console layout size with the resource when the legacy estimate fails. Use that size when the title asks for the fallback address.

What is in it

  • D3D12.X preserves the supported committed BC layout size and uses it for the lazy CPU reservation when the legacy estimate rejects the texture.
  • The D3D12.X regression exercises a 16,384 × 16,384 × 4 BC1 texture through the committed resource and address handlers. Main returns no reservation. The candidate returns a stable 512 MiB plus 64 KiB reservation.

Tested

  • Windows 11 25H2, Ryzen 7 5700X, GeForce RTX 3080, driver 616.92, rustc 1.100.0 x64 MSVC and DXC 1.9.2609.5.
  • Ran scripts/test.ps1 --nocapture with the physical RTX 3080 selected. The wide BC1 test reached the real D3D12 adapter. Two synthetic title debug-layer cases also emitted skip messages outside the structured skip summary.

Libtest totals 1436 passed, 0 failed, 47 ignored, 0 filtered out
27 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::f32_programs_on_the_gpu: f32 arithmetic, 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::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::f64_programs_on_the_gpu: f64, 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::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu: mask_ff0_flbit, 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 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

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 3080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1423 (PresentX 1423)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14002 MB
xcl-smoke v1
commit: b82a8645b5bb827c0a65abd98b19149c7f7c5425
gpu: NVIDIA GeForce RTX 3080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1457 (PresentX 1457)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13966 MB

Not tested

  • AMD hardware, native wave64 cases, D3D12 debug-layer cases, driver-cache control requiring Windows Developer Mode and optional sample-backed tests.
  • Texture contents and game-side use of the wide fallback. The focused test checks the CPU address reservation. The title smoke checks startup.

AI use

  • Codex GPT-6 Sol Daybreak integrated the supported wide runtime change. Codex GPT-6.2 Sol carried it to current main, added the regression, ran verification and independently reviewed the change in a separate agent session.
  • Codex GPT-6.2 Astra wrote the public validation comment.

@ettehn

ettehn commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

The two BC1 fixtures on 96a56e0 pass 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_tests passed on Windows, including an additional narrow BC array checked with VirtualQuery. This verifies the reserved CPU range; retail loading and texture upload were outside the test.

OpenAI Codex (GPT-6.2 Astra) assisted with verification.

@dcastell1

Copy link
Copy Markdown

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):

patch -p1 < this PR            # clean, no fuzz
cargo test --workspace -- --test-threads=4
714 passed; 0 failed; 41 ignored   (exit 0)

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.

@SlopTart

Copy link
Copy Markdown

Linux / AMD RDNA3 datapoint.

Merged state: head 96a56e0 onto main 9aec53d, 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.

@Gevroska

Copy link
Copy Markdown
Author

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.

@thaqiart139-alt

Copy link
Copy Markdown

Test report for this PR's head 96a56e0, merged into main 689f2db (no conflicts), on AMD RDNA2 with native 64-lane waves and on a 32-lane NVIDIA card.

Tested

  • GPUs: AMD Radeon(TM) Graphics, the RDNA2 iGPU of a Ryzen 7 7800X3D (native wave64, driver 32.0.21045.29003), and NVIDIA GeForce RTX 5070 (driver 32.0.16.2101), chosen with XCL_ADAPTER.
  • System: 32 GB, Windows 11 Home build 26300, Rust 1.100.0, debug, DXC 1.9.2602.17.
  • cargo test --workspace --no-fail-fast -- --test-threads=4:
main 689f2db with this PR
RTX 5070 971 passed, 4 failed, 45 ignored 972 passed, 4 failed, 45 ignored
Radeon iGPU 974 passed, 1 failed, 45 ignored 975 passed, 1 failed, 45 ignored
SKIPPED tests (the same on main and with this PR)
  • RTX 5070:
    • no wave64:
      • 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_gpu
      • gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu, and the wave64 cases of its f16 / f32 / f64 / integer_programs_on_the_gpu
      • gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware
    • the wave32 per-lane cases of lower_dxil's f16 arithmetic, f16 packed and f32 conversions: refused ("its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #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)
  • Radeon iGPU:
    • no mesh shaders: 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_passes
    • the wave32 and wave64 per-lane cases of lower_dxil's f16 arithmetic, f16 packed and f32 conversions: refused, as above
    • heap_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

  • a title run (whether a title takes this fallback), Intel, Windows 10; other GPUs; Linux / Wine.

AI use

  • Claude Code (Claude Opus 5.5) ran the builds and tests and wrote this report.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

@xpatfussy69x

Copy link
Copy Markdown

Test report for head 96a56e0 as pushed (not merged onto current main) – NVIDIA, wave32.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.2124; AMD Ryzen 5 7500F; Windows NT 10.0.26300; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.2609.5
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 685 passed, 0 failed, 41 ignored
  • SKIPPED GPU tests on this adapter: 2 (no wave64)
  • this PR's GPU test gpu_console_committed_bc_addresses_cover_original_layout ran and passed
  • no XCL_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::tests passed on main 568e7db (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

  • AMD / native wave64; release build; a smoke run on a title (use of the fallback by the retail title); the head merged onto current main

AI use

  • Claude (Claude Opus 5.5) wrote the scripts that ran the tests on my PC, read the logs and wrote and posted this report with my approval; the runs are mine.

@S1m0ne1997

Copy link
Copy Markdown

Test report for 96a56e0ba7127fdb89c47f60bf8f987ec1c9b553 (this PR's head), for #1607.

Tested

  • NVIDIA GeForce RTX 4090 24 GB (driver 621.40), AMD Ryzen 9 9950X3D, 47 GB RAM, Windows 11 Home 10.0.26300, rustc 1.100.0 (0ef1bc386 2026-11-09) x86_64-pc-windows-msvc, debug.
  • cargo build --workspace, then cargo test --workspace -- --test-threads=4 at the head: 685 passed, 0 failed, 41 ignored.
  • SKIPPED (2): 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; main built from the commit in its block, this PR from its head, no uncommitted changes)

main:

xcl-smoke v1
commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324
gpu: NVIDIA GeForce RTX 4090
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1599 (PresentX 1599)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16384 MB

this PR:

xcl-smoke v1
commit: 96a56e0ba7127fdb89c47f60bf8f987ec1c9b553
gpu: NVIDIA GeForce RTX 4090
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1587 (PresentX 1587)
presents per 2 s (last 3): 60 54 35
device removals: 0
crashes: 0
peak commit: 17922 MB

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 older smoke.ps1, which prints the game folder's name instead of its hash (#677). The second run, above, and main's run were clean, so this is 1 crash in 2 runs of this head and 0 in 1 of main: maybe intermittent, maybe unrelated to this PR. I did not look into the crash.

Not tested

  • AMD, other NVIDIA cards and drivers, Linux. I did not review the diff; this report is the build, the suite and the regression run only.

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.

Keep the supported committed BC layout size when the legacy reservation rejects the texture. Cover the native wide BC1 fallback with the fixture that failed before and passed after on the RTX 3080.

Assisted-by: Codex (GPT-6 Sol Daybreak and GPT-6.2 Sol)
@Gevroska

Copy link
Copy Markdown
Author

I reproduced the large BC1 texture reservation failure on Windows with an RTX 3080. I ran the same test on base 6d12f58a and local candidate 7ceb0fbc. 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 b49be183 as local commit b82a8645. Validation of that revision is still in progress.

I reviewed and approved this comment before posting.

@Gevroska

Copy link
Copy Markdown
Author

I finished validating local candidate b82a8645 against base b49be183 on 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.

@Gevroska
Gevroska force-pushed the xcl-local/committed-bc-texture-size branch from 96a56e0 to b82a864 Compare November 26, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants