D3D12.X: track sampled texture resident and SRV-sampled texels #2720

Closed
O5-7 wants to merge 3 commits from upstream-pr/2730 into main
O5-7 commented 2026-11-26 09:06:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by O5-7 on 2026-11-26T09:06:47Z.


What is in it

  • Workstream 5 of #2688 (per-texel residency vs SRV-sampled accounting, pure measurement with zero behaviour changes).
  • Track TexelMeta (virtual texels, resident texels, and deduplicated per-(slice, mip) coverage across Texture1D/Texture2D/Texture3D/arrays/cubes, resolving res.GetDesc() and MipLevels == 0 full mip chains) on placed sampled textures in crates/xcl/src/hle/d3d12x/vram.rs, updated on placement, map_levels, unmap_superseded, remap_if_unmapped, forget_pages, and SRV creation (dev_create_srv_x in crates/xcl/src/hle/d3d12x/real.rs).
  • Emit a standalone texture residency: N sampled (M with SRV); texels X.XM resident / Y.YM srv-sampled / Z.ZM virtual (P% resident) line in XCL_ACTIVITY=1 right after memory: in crates/xcl/src/host.rs (keeping the memory: line untouched; texels live on their own line next to memory_report::Snapshot::parts as suggested on #2697).

Tested

  • hardware (GPU + driver, CPU), Rust version, release: NVIDIA GeForce RTX 5080 (driver 32.0.15.9579), AMD Ryzen 7 9700X, Windows 11 Pro 10.0.26100, rustc 1.100.0 (0ef1bc386 2026-11-09), release build (cargo build --release -p xcl).
  • cargo test -p xcl --lib vram::tests -- --nocapture on head 2e63cbcf: 24 passed, 0 failed, 1 ignored (churn_update_tile_mappings_timing), including 5 texel accounting unit tests (mip_texels_and_range_for_2d_array_3d_and_1d, srv_coverage_respects_most_detailed_mip_levels_min_lod_clamp_and_slices, texel_meta_unions_overlapping_srv_ranges_without_double_counting, texel_meta_tracks_array_slice_coverage_without_overcounting, texel_meta_resolves_implicit_zero_mip_levels_to_full_chain). (cargo test --workspace -- --test-threads=4: 1438 passed, 0 failed, 47 ignored on base PR commit 5c09fc39.)

Regression run

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1683 (PresentX 1683)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14252 MB
xcl-smoke v1
commit: fc5ec2f3168f9e203c9c6518740113e2edfcb897
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1675 (PresentX 1675)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13610 MB

Not tested

  • No other titles besides title hash 9cc6a39e were run, and #[ignore] hardware/oracle tests were skipped.
  • Non-placed committed textures do not populate TexelStats (by design: this accounts placed sampled textures in vram::PAGES).

AI use

  • Antigravity coding agent helped implement the texel accounting, per-slice / MipLevels=0 fixes, unit tests, and regression runs, reviewed and verified locally.
<!-- greyfinch-sync:ivall/xcl:issue:5507100111 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2730). Originally posted by [O5-7](https://github.com/O5-7) on 2026-11-26T09:06:47Z. --- **What is in it** - Workstream 5 of #2688 (per-texel residency vs SRV-sampled accounting, pure measurement with zero behaviour changes). - Track `TexelMeta` (virtual texels, resident texels, and deduplicated per-`(slice, mip)` coverage across `Texture1D`/`Texture2D`/`Texture3D`/arrays/cubes, resolving `res.GetDesc()` and `MipLevels == 0` full mip chains) on placed sampled textures in `crates/xcl/src/hle/d3d12x/vram.rs`, updated on placement, `map_levels`, `unmap_superseded`, `remap_if_unmapped`, `forget_pages`, and SRV creation (`dev_create_srv_x` in `crates/xcl/src/hle/d3d12x/real.rs`). - Emit a standalone `texture residency: N sampled (M with SRV); texels X.XM resident / Y.YM srv-sampled / Z.ZM virtual (P% resident)` line in `XCL_ACTIVITY=1` right after `memory:` in `crates/xcl/src/host.rs` (keeping the `memory:` line untouched; texels live on their own line next to `memory_report::Snapshot::parts` as suggested on #2697). **Tested** - hardware (GPU + driver, CPU), Rust version, release: NVIDIA GeForce RTX 5080 (driver 32.0.15.9579), AMD Ryzen 7 9700X, Windows 11 Pro 10.0.26100, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, release build (`cargo build --release -p xcl`). - `cargo test -p xcl --lib vram::tests -- --nocapture` on head `2e63cbcf`: 24 passed, 0 failed, 1 ignored (`churn_update_tile_mappings_timing`), including 5 texel accounting unit tests (`mip_texels_and_range_for_2d_array_3d_and_1d`, `srv_coverage_respects_most_detailed_mip_levels_min_lod_clamp_and_slices`, `texel_meta_unions_overlapping_srv_ranges_without_double_counting`, `texel_meta_tracks_array_slice_coverage_without_overcounting`, `texel_meta_resolves_implicit_zero_mip_levels_to_full_chain`). (`cargo test --workspace -- --test-threads=4`: 1438 passed, 0 failed, 47 ignored on base PR commit `5c09fc39`.) **Regression run** ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1683 (PresentX 1683) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14252 MB ``` ``` xcl-smoke v1 commit: fc5ec2f3168f9e203c9c6518740113e2edfcb897 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1675 (PresentX 1675) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13610 MB ``` **Not tested** - No other titles besides title hash `9cc6a39e` were run, and `#[ignore]` hardware/oracle tests were skipped. - Non-placed committed textures do not populate `TexelStats` (by design: this accounts placed sampled textures in `vram::PAGES`). **AI use** - Antigravity coding agent helped implement the texel accounting, per-slice / `MipLevels=0` fixes, unit tests, and regression runs, reviewed and verified locally.
luckyteagirl commented 2026-11-26 09:12:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T09:12:49Z.

Review: COMMENTED


On 5c09fc3, srv_mip_range extracts only mip fields from Texture1DArray, Texture2DArray, and TextureCubeArray SRVs. record_srv then deduplicates only by mip bit and mask_texels counts each selected mip using the resource's full DepthOrArraySize. For a 64×64 six-slice 2D array with an explicit mip-0 SRV exposing only slice 0, the new srv-sampled counter adds 24,576 texels rather than the 4,096 the view can sample. A second SRV exposing slice 1 adds zero because mip 0 is already marked. That makes the array/cube-array metric insensitive to slice coverage despite this PR claiming SRV-sampled texels.

Could the coverage union include array slices as well as mip levels, or label the current number as a whole-mip upper bound? A CPU fixture with one-slice, duplicate, and different-slice SRVs could assert increments of 4,096, 0, and 4,096 respectively. This is source review only; I did not run the fixture or a title.

<!-- greyfinch-sync:ivall/xcl:review:6071300926 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2730#pullrequestreview-6071300926). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T09:12:49Z. **Review:** COMMENTED --- On `5c09fc3`, `srv_mip_range` extracts only mip fields from `Texture1DArray`, `Texture2DArray`, and `TextureCubeArray` SRVs. `record_srv` then deduplicates only by mip bit and `mask_texels` counts each selected mip using the resource's full `DepthOrArraySize`. For a 64×64 six-slice 2D array with an explicit mip-0 SRV exposing only slice 0, the new `srv-sampled` counter adds 24,576 texels rather than the 4,096 the view can sample. A second SRV exposing slice 1 adds zero because mip 0 is already marked. That makes the array/cube-array metric insensitive to slice coverage despite this PR claiming SRV-sampled texels. Could the coverage union include array slices as well as mip levels, or label the current number as a whole-mip upper bound? A CPU fixture with one-slice, duplicate, and different-slice SRVs could assert increments of 4,096, 0, and 4,096 respectively. This is source review only; I did not run the fixture or a title.
luckyteagirl commented 2026-11-26 10:51:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T10:51:01Z.

Review: COMMENTED


On 5c09fc3924200753340b6900e664aea0faf2c48c, could the texel metadata use the created resource's resolved mip count when the input descriptor has MipLevels=0? D3D12 defines zero as requesting the maximum mip chain. place_on_pages creates the reserved resource, but then passes the original descriptor to TexelMeta::from_desc, where desc.MipLevels.max(1) treats zero as one level. For a supported 64×64 non-array sampled texture, a default full-resource SRV should cover seven levels / 5,461 texels; the new counters record only mip 0 / 4,096. This is separate from the array-slice coverage point already posted. Could metadata use res.GetDesc() (or expand the zero sentinel) and include an implicit-full-chain fixture? This is source and D3D12-contract review with arithmetic; I did not run the GPU fixture.

AI use: OpenAI Codex (GPT-6.2 Sol) found the mismatch; a second GPT-6.2 Sol agent and OpenAI Codex (GPT-6.2 Astra) independently checked the creation path and wrote this review.

<!-- greyfinch-sync:ivall/xcl:review:6072808502 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2730#pullrequestreview-6072808502). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T10:51:01Z. **Review:** COMMENTED --- On `5c09fc3924200753340b6900e664aea0faf2c48c`, could the texel metadata use the created resource's resolved mip count when the input descriptor has `MipLevels=0`? [D3D12 defines zero as requesting the maximum mip chain](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_resource_desc#miplevels). `place_on_pages` creates the reserved resource, but then passes the original descriptor to `TexelMeta::from_desc`, where `desc.MipLevels.max(1)` treats zero as one level. For a supported 64×64 non-array sampled texture, a default full-resource SRV should cover seven levels / 5,461 texels; the new counters record only mip 0 / 4,096. This is separate from the array-slice coverage point already posted. Could metadata use `res.GetDesc()` (or expand the zero sentinel) and include an implicit-full-chain fixture? This is source and D3D12-contract review with arithmetic; I did not run the GPU fixture. AI use: OpenAI Codex (GPT-6.2 Sol) found the mismatch; a second GPT-6.2 Sol agent and OpenAI Codex (GPT-6.2 Astra) independently checked the creation path and wrote this review.
O5-7 commented 2026-11-26 12:07:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by O5-7 on 2026-11-26T12:04:08Z.


@luckyteagirl Addressed both review points in 2e63cbcf:

  1. Tracked SRV coverage per (slice, mip) pair (srv_coverage + TexelMeta::srv_extra_slices for slices >= 1), handling Texture1DArray/Texture2DArray (FirstArraySlice + ArraySize) and TextureCubeArray (First2DArrayFace + NumCubes * 6) without overcounting unsampled slices. Added texel_meta_tracks_array_slice_coverage_without_overcounting asserting 4096, 0, 4096 increments on single-slice / duplicate / next-slice SRVs.
  2. Resolved MipLevels == 0 to the full mip chain via both res.GetDesc() in place_on_pages and resolved_mip_levels() in TexelMeta::from_desc. Added texel_meta_resolves_implicit_zero_mip_levels_to_full_chain (64x64 MipLevels: 0 -> 7 levels / 5461 texels).

Re-verified cargo test -p xcl --lib vram::tests (24 passed, 0 failed, 1 ignored) and 60 s smoke.ps1 on 2e63cbcf.

<!-- greyfinch-sync:ivall/xcl:comment:7191524959 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2730#issuecomment-7191524959). Originally posted by [O5-7](https://github.com/O5-7) on 2026-11-26T12:04:08Z. --- @luckyteagirl Addressed both review points in `2e63cbcf`: 1. Tracked SRV coverage per `(slice, mip)` pair (`srv_coverage` + `TexelMeta::srv_extra_slices` for slices `>= 1`), handling `Texture1DArray`/`Texture2DArray` (`FirstArraySlice` + `ArraySize`) and `TextureCubeArray` (`First2DArrayFace` + `NumCubes * 6`) without overcounting unsampled slices. Added `texel_meta_tracks_array_slice_coverage_without_overcounting` asserting `4096`, `0`, `4096` increments on single-slice / duplicate / next-slice SRVs. 2. Resolved `MipLevels == 0` to the full mip chain via both `res.GetDesc()` in `place_on_pages` and `resolved_mip_levels()` in `TexelMeta::from_desc`. Added `texel_meta_resolves_implicit_zero_mip_levels_to_full_chain` (`64x64` `MipLevels: 0` -> `7` levels / `5461` texels). Re-verified `cargo test -p xcl --lib vram::tests` (`24 passed, 0 failed, 1 ignored`) and 60 s `smoke.ps1` on `2e63cbcf`.
Prime1997 commented 2026-11-26 13:06:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-26T13:06:17Z.

Review: COMMENTED


Good within the reviewed scope; retain for integration. The resident-versus-SRV-covered texture accounting is worth keeping as preparation for memory diagnostics.

Clean PR head 2e63cbcf565d7309e10da2cddbec37c40e0eb990, based directly on current main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7.

Targeted result: 6 passed, 0 failed, 0 ignored, 0 skipped. Each exact filter ran in a fresh process:

  • hle::d3d12x::vram::tests::the_tiles_of_a_texture_are_grouped_by_its_levels
  • hle::d3d12x::vram::tests::mip_texels_and_range_for_2d_array_3d_and_1d
  • hle::d3d12x::vram::tests::srv_coverage_respects_most_detailed_mip_levels_min_lod_clamp_and_slices
  • hle::d3d12x::vram::tests::texel_meta_unions_overlapping_srv_ranges_without_double_counting
  • hle::d3d12x::vram::tests::texel_meta_tracks_array_slice_coverage_without_overcounting
  • hle::d3d12x::vram::tests::texel_meta_resolves_implicit_zero_mip_levels_to_full_chain

Build: cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>. Run: <test-exe> <each-exact-filter-above> --exact --test-threads=1 --nocapture. Private executable/target paths are placeholders. Windows 11 Pro 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug. These selected fixtures did not dispatch GPU work.

Not tested: Six CPU bookkeeping tests passed. SRV coverage means the union of created views, not texels actually read by shaders; no eviction or VRAM saving was demonstrated. No whole suite or retail smoke was run for this batch; this is not merge certification.

AI use: Codex (GPT-6) reviewed source, ran the selected tests and verified raw results. Optional temporary Discord for coordinating contributor work, testing and comparing results.

<!-- greyfinch-sync:ivall/xcl:review:6074636287 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2730#pullrequestreview-6074636287). Originally posted by [Prime1997](https://github.com/Prime1997) on 2026-11-26T13:06:17Z. **Review:** COMMENTED --- **Good within the reviewed scope; retain for integration.** The resident-versus-SRV-covered texture accounting is worth keeping as preparation for memory diagnostics. Clean PR head `2e63cbcf565d7309e10da2cddbec37c40e0eb990`, based directly on current main `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`. **Targeted result: 6 passed, 0 failed, 0 ignored, 0 skipped.** Each exact filter ran in a fresh process: - `hle::d3d12x::vram::tests::the_tiles_of_a_texture_are_grouped_by_its_levels` - `hle::d3d12x::vram::tests::mip_texels_and_range_for_2d_array_3d_and_1d` - `hle::d3d12x::vram::tests::srv_coverage_respects_most_detailed_mip_levels_min_lod_clamp_and_slices` - `hle::d3d12x::vram::tests::texel_meta_unions_overlapping_srv_ranges_without_double_counting` - `hle::d3d12x::vram::tests::texel_meta_tracks_array_slice_coverage_without_overcounting` - `hle::d3d12x::vram::tests::texel_meta_resolves_implicit_zero_mip_levels_to_full_chain` Build: `cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>`. Run: `<test-exe> <each-exact-filter-above> --exact --test-threads=1 --nocapture`. Private executable/target paths are placeholders. Windows 11 Pro 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug. These selected fixtures did not dispatch GPU work. **Not tested:** Six CPU bookkeeping tests passed. SRV coverage means the union of created views, not texels actually read by shaders; no eviction or VRAM saving was demonstrated. No whole suite or retail smoke was run for this batch; this is not merge certification. AI use: Codex (GPT-6) reviewed source, ran the selected tests and verified raw results. Optional temporary [Discord](https://discord.gg/gK3y7WRRY) for coordinating contributor work, testing and comparing results.
Prime1997 commented 2026-11-26 13:41:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-26T13:41:39Z.

Review: COMMENTED


Disposition correction: needs a label change; retain the accounting work. My earlier six passing CPU tests and their stated scope remain valid. However, the runtime label srv-sampled in host.rs overstates what this measures: vram.rs ORs coverage from SRVs created during the resource lifetime and retains that union until resource removal. It does not observe which mip levels shaders sampled, and replacing a view does not subtract its old coverage.

Please label the output as lifetime created-SRV coverage (or equivalent wording), reserving sampled terminology for actual usage evidence. The implementation and tests remain useful preparation; the naming change is needed before treating this as sampled-memory telemetry. No additional native test is needed to establish this source-level wording mismatch.

AI use: Codex (GPT-6) cross-checked the runtime label against its accounting call paths and earlier test evidence. Optional temporary Discord for coordinating contributor work, testing and comparing results.

<!-- greyfinch-sync:ivall/xcl:review:6075139471 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2730#pullrequestreview-6075139471). Originally posted by [Prime1997](https://github.com/Prime1997) on 2026-11-26T13:41:39Z. **Review:** COMMENTED --- **Disposition correction: needs a label change; retain the accounting work.** My earlier six passing CPU tests and their stated scope remain valid. However, the runtime label `srv-sampled` in `host.rs` overstates what this measures: `vram.rs` ORs coverage from SRVs created during the resource lifetime and retains that union until resource removal. It does not observe which mip levels shaders sampled, and replacing a view does not subtract its old coverage. Please label the output as lifetime created-SRV coverage (or equivalent wording), reserving sampled terminology for actual usage evidence. The implementation and tests remain useful preparation; the naming change is needed before treating this as sampled-memory telemetry. No additional native test is needed to establish this source-level wording mismatch. AI use: Codex (GPT-6) cross-checked the runtime label against its accounting call paths and earlier test evidence. Optional temporary [Discord](https://discord.gg/gK3y7WRRY) for coordinating contributor work, testing and comparing results.
Decodere commented 2026-11-26 14:03:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-26T13:10:32Z.


Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2730 at 2e63cbcf565d7309e10da2cddbec37c40e0eb990 (parent 5c09fc3924200753340b6900e664aea0faf2c48c; merge-base origin/main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). Measurements and targeted test results only; not a full source review.

Setup

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6 cores / 12 threads), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200
  • Toolchain / caches: rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2609.5, release builds, warm DXIL/pipeline caches, quiet machine (zero concurrent builds/tests during timed runs)
  • Workload: Retail workload title: 29640639 via scripts/smoke.ps1 -Seconds 60 (XCL_NETWORK=0 XCL_ACTIVITY=1, default flags, no input)

Targeted RTX 4060 release unit tests (2e63cbcf)

  • cargo test --release -p xcl --lib hle::d3d12x::vram:: -- --test-threads=4: 24 passed, 0 failed, 1 ignored (2.45 s, churn_update_tile_mappings_timing ignored, 0 skipped, exit 0), covering all 5 new texel/SRV-coverage tests (mip_texels_and_range_for_2d_array_3d_and_1d, srv_coverage_respects_most_detailed_mip_levels_min_lod_clamp_and_slices, texel_meta_resolves_implicit_zero_mip_levels_to_full_chain, texel_meta_tracks_array_slice_coverage_without_overcounting, and texel_meta_unions_overlapping_srv_ranges_without_double_counting).
  • cargo test --release -p xcl --lib hle::d3d12x::real:: -- --test-threads=4: 60 passed, 0 failed, 0 ignored (0.64 s, 0 skipped, exit 0).

Live 8 GB RTX 4060 texture residency: telemetry (XCL_ACTIVITY=1, 60 s)

  • Cadence & invariants: 29 legacy memory: lines paired with 28 texture residency: lines (4.0 s .. 58.0 s); 0/28 invariant violations (with_srv <= sampled, resident <= virtual, and srv-sampled <= virtual held on every sample; scripts/smoke.ps1 parsing unaffected).
  • Verbatim lines (first, mid, final):
[    4.002][ 8612][INFO ] texture residency: 23 sampled (23 with SRV); texels 0.0M resident / 1.9M srv-sampled / 1.9M virtual (1% resident)
[   32.026][ 8612][INFO ] texture residency: 527 sampled (521 with SRV); texels 307.8M resident / 316.8M srv-sampled / 316.9M virtual (97% resident)
[   58.037][ 8612][INFO ] texture residency: 527 sampled (521 with SRV); texels 307.8M resident / 316.8M srv-sampled / 316.9M virtual (97% resident)
  • Quiet 60 s retail smoke ran cleanly (exit: 0x0, 1597 frames shown, 60 60 60 steady-state presents per 2 s, 0 device removals, 0 crashes, 14021 MB peak commit vs origin/main b49be183's 14018 MB / 1518 frames).

Paired 60 s RTX 4060 smoke (b49be183 vs 2e63cbcf)

Merge-base origin/main (b49be183):

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1518 (PresentX 1518)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14018 MB

PR #2730 head (2e63cbcf):

xcl-smoke v1
commit: 2e63cbcf565d7309e10da2cddbec37c40e0eb990
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1597 (PresentX 1597)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14021 MB

Limits of coverage

  • Full workspace test suite was not re-run on 2e63cbcf (only targeted hle::d3d12x::vram:: and hle::d3d12x::real:: release tests plus paired quiet 60 s smoke).
  • The 60 s no-input menu/intro smoke stayed at 97% texel residency (527 sampled textures); extended world-load mip-eviction / lower-residency regimes were not exercised here.
  • Single discrete NVIDIA 8 GB GPU (RTX 4060) on native Windows 11; no AMD, Intel, or Wine/Linux run on this host.

AI use

Ran the targeted release unit tests, paired quiet 60 s smoke runs, and xcl.log invariant checks with assistance from Google Antigravity (Gemini 4 Neon); all test counts, verbatim log lines, and smoke blocks were taken directly from cargo test, xcl.log, and scripts/smoke.ps1 outputs.

<!-- greyfinch-sync:ivall/xcl:comment:7192976942 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2730#issuecomment-7192976942). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-26T13:10:32Z. --- **Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2730 at `2e63cbcf565d7309e10da2cddbec37c40e0eb990`** (parent `5c09fc3924200753340b6900e664aea0faf2c48c`; merge-base `origin/main` `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`). Measurements and targeted test results only; not a full source review. ### Setup - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6 cores / 12 threads), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` - **Toolchain / caches:** `rustc 1.100.0 (0ef1bc386 2026-11-09)`, DXC `1.9.2609.5`, release builds, warm DXIL/pipeline caches, quiet machine (zero concurrent builds/tests during timed runs) - **Workload:** Retail workload `title: 29640639` via `scripts/smoke.ps1 -Seconds 60` (`XCL_NETWORK=0 XCL_ACTIVITY=1`, default flags, no input) ### Targeted RTX 4060 release unit tests (`2e63cbcf`) - `cargo test --release -p xcl --lib hle::d3d12x::vram:: -- --test-threads=4`: **24 passed, 0 failed, 1 ignored** (`2.45 s`, `churn_update_tile_mappings_timing` ignored, `0` skipped, exit `0`), covering all 5 new texel/SRV-coverage tests (`mip_texels_and_range_for_2d_array_3d_and_1d`, `srv_coverage_respects_most_detailed_mip_levels_min_lod_clamp_and_slices`, `texel_meta_resolves_implicit_zero_mip_levels_to_full_chain`, `texel_meta_tracks_array_slice_coverage_without_overcounting`, and `texel_meta_unions_overlapping_srv_ranges_without_double_counting`). - `cargo test --release -p xcl --lib hle::d3d12x::real:: -- --test-threads=4`: **60 passed, 0 failed, 0 ignored** (`0.64 s`, `0` skipped, exit `0`). ### Live 8 GB RTX 4060 `texture residency:` telemetry (`XCL_ACTIVITY=1`, 60 s) - **Cadence & invariants:** `29` legacy `memory:` lines paired with `28` `texture residency:` lines (`4.0 s .. 58.0 s`); **`0/28` invariant violations** (`with_srv <= sampled`, `resident <= virtual`, and `srv-sampled <= virtual` held on every sample; `scripts/smoke.ps1` parsing unaffected). - **Verbatim lines (first, mid, final):** ```text [ 4.002][ 8612][INFO ] texture residency: 23 sampled (23 with SRV); texels 0.0M resident / 1.9M srv-sampled / 1.9M virtual (1% resident) [ 32.026][ 8612][INFO ] texture residency: 527 sampled (521 with SRV); texels 307.8M resident / 316.8M srv-sampled / 316.9M virtual (97% resident) [ 58.037][ 8612][INFO ] texture residency: 527 sampled (521 with SRV); texels 307.8M resident / 316.8M srv-sampled / 316.9M virtual (97% resident) ``` - Quiet 60 s retail smoke ran cleanly (`exit: 0x0`, `1597` frames shown, `60 60 60` steady-state presents per 2 s, `0` device removals, `0` crashes, `14021 MB` peak commit vs `origin/main` `b49be183`'s `14018 MB` / `1518` frames). ### Paired 60 s RTX 4060 smoke (`b49be183` vs `2e63cbcf`) Merge-base `origin/main` (`b49be183`): ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1518 (PresentX 1518) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14018 MB ``` PR #2730 head (`2e63cbcf`): ``` xcl-smoke v1 commit: 2e63cbcf565d7309e10da2cddbec37c40e0eb990 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1597 (PresentX 1597) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14021 MB ``` ### Limits of coverage - Full workspace test suite was not re-run on `2e63cbcf` (only targeted `hle::d3d12x::vram::` and `hle::d3d12x::real::` release tests plus paired quiet 60 s smoke). - The 60 s no-input menu/intro smoke stayed at `97%` texel residency (`527` sampled textures); extended world-load mip-eviction / lower-residency regimes were not exercised here. - Single discrete NVIDIA 8 GB GPU (`RTX 4060`) on native Windows 11; no AMD, Intel, or Wine/Linux run on this host. ### AI use Ran the targeted release unit tests, paired quiet 60 s smoke runs, and `xcl.log` invariant checks with assistance from Google Antigravity (Gemini 4 Neon); all test counts, verbatim log lines, and smoke blocks were taken directly from `cargo test`, `xcl.log`, and `scripts/smoke.ps1` outputs.
nnonno91 commented 2026-11-26 16:06:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by nnonno91 on 2026-11-26T16:06:25Z.


Native D3D12 array-texture accounting on RTX 5090 and Radeon iGPU. On clean head 2e63cbcf565d7309e10da2cddbec37c40e0eb990, hle::d3d12x::vram::tests passed 24, failed 0, and ignored the one timing benchmark.

I added a local test-only fixture that selects a DXGI adapter and places a 64×64 RGBA8, three-slice 2D array through vram::place_pages with MipLevels=0. On both adapters GetDesc() reported seven mips and the accounting started with 16,383 resident texels. Views went through dev_create_srv_x and the normal console heap.

Operation SRV-addressable texels
No view 0
Mips 0–1, slices 0–1 10,240
Add mips 1–3, slices 1–2 11,904
Add a duplicate of the second view 11,904
Add an implicit full-resource view 16,383

The native unmap and remap changed the resident count from 16,383 to 0 and back, with SRV coverage held at 16,383. Dropping the resource returned all five global counters to zero after synchronizing the mapping queue.

Three fresh passes on each of two explicit adapters with no skips. RTX 5090 (617.42) and Ryzen 7 9800X3D Radeon iGPU (32.0.21042.62), Windows 11 26200, 32 GB RAM, debug Rust 1.100.0, XCL_HEAP_WINDOWS=1. The added fixture exercises descriptor coverage and mapped-resource lifetime. Gameplay and shader sampling frequency were outside the check.

AI use — Codex ran the stock suite, wrote the local fixture, and checked the native-adapter results.

<!-- greyfinch-sync:ivall/xcl:comment:7197189477 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2730#issuecomment-7197189477). Originally posted by [nnonno91](https://github.com/nnonno91) on 2026-11-26T16:06:25Z. --- **Native D3D12 array-texture accounting on RTX 5090 and Radeon iGPU.** On clean head `2e63cbcf565d7309e10da2cddbec37c40e0eb990`, `hle::d3d12x::vram::tests` passed 24, failed 0, and ignored the one timing benchmark. I added a local test-only fixture that selects a DXGI adapter and places a 64×64 RGBA8, three-slice 2D array through `vram::place_pages` with `MipLevels=0`. On both adapters `GetDesc()` reported seven mips and the accounting started with 16,383 resident texels. Views went through `dev_create_srv_x` and the normal console heap. | Operation | SRV-addressable texels | | --- | ---: | | No view | 0 | | Mips 0–1, slices 0–1 | 10,240 | | Add mips 1–3, slices 1–2 | 11,904 | | Add a duplicate of the second view | 11,904 | | Add an implicit full-resource view | 16,383 | The native unmap and remap changed the resident count from 16,383 to 0 and back, with SRV coverage held at 16,383. Dropping the resource returned all five global counters to zero after synchronizing the mapping queue. Three fresh passes on each of two explicit adapters with no skips. RTX 5090 (617.42) and Ryzen 7 9800X3D Radeon iGPU (32.0.21042.62), Windows 11 26200, 32 GB RAM, debug Rust 1.100.0, `XCL_HEAP_WINDOWS=1`. The added fixture exercises descriptor coverage and mapped-resource lifetime. Gameplay and shader sampling frequency were outside the check. AI use — Codex ran the stock suite, wrote the local fixture, and checked the native-adapter results.
O5-7 commented 2026-11-27 12:25:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by O5-7 on 2026-11-27T12:25:02Z.


@Prime1997 Good catch — renamed srv_sampled_texels to srv_covered_texels in TexelStats/TexelMeta and changed the XCL_ACTIVITY label from srv-sampled to created-srv, with updated doc comments clarifying it tracks the cumulative lifetime union of created SRVs for live placed sampled textures rather than shader-observed sampling (updated in fc5ec2f3).

<!-- greyfinch-sync:ivall/xcl:comment:7218217810 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2730#issuecomment-7218217810). Originally posted by [O5-7](https://github.com/O5-7) on 2026-11-27T12:25:02Z. --- @Prime1997 Good catch — renamed srv_sampled_texels to srv_covered_texels in TexelStats/TexelMeta and changed the XCL_ACTIVITY label from srv-sampled to created-srv, with updated doc comments clarifying it tracks the cumulative lifetime union of created SRVs for live placed sampled textures rather than shader-observed sampling (updated in fc5ec2f3).

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2720
No description provided.