Skip to content

Tests: heap probes for aliased buffers and timestamp queries - #1328

Open
vakaobr wants to merge 1 commit into
xcl-dev:mainfrom
vakaobr:tests/heap-probes
Open

vakaobr wants to merge 1 commit into
xcl-dev:mainfrom
vakaobr:tests/heap-probes

Conversation

@vakaobr

@vakaobr vakaobr commented Nov 24, 2026 •

Copy link
Copy Markdown

Part of #258. Two probes from Ahmet-Dedeler's c70bf8a that check what the unified memory copy path relies on: that buffers placed over the same video memory see each other's writes, and how timestamp queries resolve into committed and reserved buffers. Like the other tests in heap_probe.rs, they are #[ignore] probes that print what the host does; run them with --ignored.

Based on Ahmet-Dedeler's c70bf8a on mac-on-main-wip ("Unified memory without OpenExistingHeapFromAddress: the committed window gets a copy in video memory"), which he handed over in #258 (comment). Rebased onto main 930e8b4 and split into four PRs.

What is in it

  • crates/xcl/tests/heap_probe.rs: buffers_over_the_same_video_memory_alias (placed buffers over one heap, and reserved buffers whose tiles map to one pool tile) and timestamp_query_resolved_into_committed_and_reserved_buffers.

Tested

  • MacBook Pro M5 Pro (20-core GPU), 48 GB, macOS 27.2.1, CrossOver 26.3.0.39832 with D3DMetal 3.0 ("AMD Compatibility Mode"), Rosetta 2. Rust 1.100.0, x86_64-pc-windows-gnu (mingw-w64 GCC 16.2.0), debug, DXC 1.9.2609. Each test in its own process (<test exe> --exact <test> --test-threads=1 --nocapture).
  • Head a146528, --ignored: both pass. The aliasing probe prints true for placed and for reserved buffers; the timestamp probe prints a frequency of 60 and a resolved value of 0x0 (D3DMetal's timestamps, see D3D12.X: timestamps are the CPU's clock on a host without GPU timestamps #996).
  • Independent run at this head: NVIDIA RTX 5070 Ti and the AMD Radeon iGPU of a Ryzen 9800X3D (RDNA2), Windows 11, debug, cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 43 ignored on both; with --ignored all 6 probes in the file pass, the aliasing probe printing true for both cases and the timestamp probe a frequency of 1 GHz and non-zero timestamps (@futurepro62, Tests: heap probes for aliased buffers and timestamp queries #1328 (comment)).

Regression run

Test-only change in crates/xcl/tests/: no xcl-smoke blocks.

Not tested

  • Windows by me (see the independent run above).

AI use

  • Claude Code with Claude Opus 4.6 ported the probes from c70bf8a. Claude Code with Claude Opus 5.5 reviewed them, ran them on this machine and wrote this description.

Two new #[ignore] integration tests that validate what the UMA copy
path relies on:

- buffers_over_the_same_video_memory_alias: two placed buffers over
  one default heap see each other's writes, and two reserved buffers
  whose tile maps to the same pool tile do too. Console buffers in the
  committed window's copy, and title buffers in a sparse window, depend
  on this aliasing.

- timestamp_query_resolved_into_committed_and_reserved_buffers: a
  timestamp query resolved into a committed buffer and into a tile of a
  reserved one both produce a value.

Based on Ahmet-Dedeler's c70bf8a on mac-on-main-wip.

Co-authored-by: Ahmet Dedeler <105894172+Ahmet-Dedeler@users.noreply.github.com>
Assisted-by: Claude Code (Claude Opus 4.6 ported it; Claude Opus 5.5 reviewed it)
@futurepro62

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head a146528 (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 43 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 43 ignored, no skips.
  • The two new probes are #[ignore], so I ran them explicitly with cargo test -p xcl --test heap_probe -- --ignored --nocapture --test-threads=1 (all 6 probes in the file: 6 passed). buffers_over_the_same_video_memory_alias: "placed buffers over each other in one heap: written through the whole one, read through the part: true" and "two reserved buffers on one pool tile: written through the window, read through the other: true". timestamp_query_resolved_into_committed_and_reserved_buffers: frequency 1000000000, a non-zero timestamp resolved into both the committed and the reserved buffer.
  • The probes run on the NVIDIA card only: heap_probe.rs creates its device with D3D12CreateDevice(None, ...), so XCL_ADAPTER=radeon does not reach them (a run with it printed the same adapter-specific values).

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

@WASDeKeys

Copy link
Copy Markdown

im trying to run a test only pr too, but my pr is getting flagged on the smoke check thing. How did you pass the checks without smoke test?

@vakaobr

vakaobr commented Nov 24, 2026

Copy link
Copy Markdown
Author

@WASDeKeys: scripts/pr_check.py asks for the smoke pair only when the PR changes a runtime file: a path under crates/xcl/src/ that neither contains /tests nor ends in tests.rs. This PR only touches crates/xcl/tests/heap_probe.rs, so the check passes without one. If your test-only change sits in a runtime file (a #[cfg(test)] mod tests inside, say, present.rs), the check treats it as runtime: either move the test into the module's tests.rs or crates/xcl/tests/ if it fits there, or get a smoke pair (#957 got one from mikebuckets171 in #258). The test-only label that CONTRIBUTING mentions would waive it, but it doesn't exist in the repo yet.

AI use: Claude Code, Claude Opus 5.5 drafted this reply.

@JoaoPauluu

Copy link
Copy Markdown

The probes on Linux with vkd3d-proton (NVIDIA), next to the D3DMetal and Windows runs.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. a146528 as it is (based on 930e8b4), no uncommitted changes. The test binary runs under Wine, each probe in its own process (--exact <test> --ignored --nocapture --test-threads=1).
  • All 6 probes in heap_probe.rs pass.
  • buffers_over_the_same_video_memory_alias: placed buffers over each other in one heap: written through the whole one, read through the part: true, two reserved buffers on one pool tile: written through the window, read through the other: true.
  • timestamp_query_resolved_into_committed_and_reserved_buffers: timestamp frequency: Ok(1000000000), resolved into a committed buffer 0x18eb03b650604400, into a reserved buffer 0x18eb03b650620000. So here the timestamps are real, nanosecond values, unlike D3DMetal's 0x0 (D3D12.X: timestamps are the CPU's clock on a host without GPU timestamps #996).
  • Without --ignored the six are reported ignored, as intended. I did not run the probes on main.

Not tested

  • the rest of the suite on this head; native Windows; AMD.

AI use

  • Claude Code (Claude Opus 5.5) built the commits, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

  • cargo test -p xcl --lib: 708 passed, 0 failed, 21 ignored.

Thanks!

@WASDeKeys

Copy link
Copy Markdown

@WASDeKeys: scripts/pr_check.py asks for the smoke pair only when the PR changes a runtime file: a path under crates/xcl/src/ that neither contains /tests nor ends in tests.rs. This PR only touches crates/xcl/tests/heap_probe.rs, so the check passes without one. If your test-only change sits in a runtime file (a #[cfg(test)] mod tests inside, say, present.rs), the check treats it as runtime: either move the test into the module's tests.rs or crates/xcl/tests/ if it fits there, or get a smoke pair (#957 got one from mikebuckets171 in #258). The test-only label that CONTRIBUTING mentions would waive it, but it doesn't exist in the repo yet.

AI use: Claude Code, Claude Opus 5.5 drafted this reply.

@vakaobr so if my pr changes in vram.rs, and it is a runtime file, but only a test chage, theres no way to get the pr approved

@ivall ivall added the off-goal Does not bear on the current goal (world loading); waits until it is reached label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants