Repository navigation
D3D12.X: page_owners counts the pages a lazy texture holds by level - #3309
grahamster2 wants to merge 1 commit into
Conversation
The activity line "sampled textures with pages by level hold N MB" summed Target::used, which a texture with lazy levels leaves empty: it holds its pages by group in Levels::group_tiles (map_levels). The line always said 0 MB. Count both (held_pages). Test: page_owners_counts_the_pages_a_texture_holds_by_level (fails before this change). Assisted-by: Claude Code (Claude Opus 5.5)
|
Checked the live
The two owner counts sum to 130 × 64 KiB (8.125 MiB) in every case. Unique backing was 4.0625, 4.625 and 8.125 MiB respectively; the diagnostic truncates to whole MiB. This explains why complete and partial sharing can print the same total. The registry showed zero idle pages throughout. Three tests passed with zero skips. These are XCL mapping identities and accounting, not a measurement of DXGI residency, title behavior or texture contents. AI disclosure: OpenAI Codex prepared and ran the fixture and drafted this report. |
Merge-check run and written with Claude Code (Claude Opus 5.5): a test merge onto the base above, the full suite, and a 60 s |
|
merge-check
|
|
merge-check AI-written and posted by Foniass without a human check of each point. |
The activity line "target pages by owner: … N sampled textures with pages by level hold M MB" summed
Target::used. A texture with lazy levels leaves that empty: it holds its pages by group inLevels::group_tiles(map_levels), so the line always said 0 MB for them. Now both are counted. This is a diagnostics-only change to the line added in #2896.No issue.
Seen in two runs of a retail title on this machine, on a development build (main plus other changes) with
XCL_TEXTURE_LEVEL_PAGES=1, which gives sampled textures pages by level. Without this fix (xcl.log):With it (same run setup, a later run):
What is in it
crates/xcl/src/hle/d3d12x/vram.rs:held_pages(&Target)countsused,used_extraand the level groups' pages;page_ownersuses it. Testpage_owners_counts_the_pages_a_texture_holds_by_levelfails without the change (checked by leaving out the level groups).Tested
cargo build --release -p xcl)494aa53dd1c45fb8f0487baa468ac1eec2eea909:cargo build --workspaceok;cargo test --workspace -- --test-threads=4: 2609 passed, 0 failed, 49 ignoredSKIPPEDlines on this adapter (no wave64 on NVIDIA, no heap windows, no D3D12 debug layer):SKIPPED gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole: no wave64SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_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::cross_lane_reads_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::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu: const_mask, wave64: 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 three-source, wave64: no wave64SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64SKIPPED gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu: f64, 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::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu: mask_ff0_flbit, 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 heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windowsSKIPPED hle::d3d12x::bind::tests::two_pass_binds_set_the_shared_view_heap: no heap windows (opt-in: XCL_HEAP_WINDOWS=1)SKIPPED the title under the debug layer (dred: false): no d3d12SDKLayers.dllSKIPPED the title under the debug layer (dred: true): no d3d12SDKLayers.dllSKIPPED 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
scripts/smoke.ps1 -Game <title folder> -Seconds 60 -StartupTimeoutSeconds 900withXCL_DEVICE_TYPE=lockhart XCL_PREPARE=0(Series S mode as in the contributor's runs; no startup shader preparation, so pipelines are built in game) (smoke.ps1 setsXCL_NETWORK=0); same retail title, same settings for both runs. Both stay on the title's first screens (about 660 draws per 2 s) for the 60 s.main:
this PR's head:
Not tested
XCL_TEXTURE_LEVEL_PAGES=1, so no texture there holds its pages by level and the value on the activity line is not exercised by them.page_owners()itself has no test (it reads the global page registry); the test coversheld_pages, the count it now sums.AI use