Tests: heap probes for aliased buffers and timestamp queries #1318
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1328"
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 vakaobr on 2026-11-24T14:48:39Z.
Part of #258. Two probes from Ahmet-Dedeler's
c70bf8athat 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 inheap_probe.rs, they are#[ignore]probes that print what the host does; run them with--ignored.Based on Ahmet-Dedeler's
c70bf8aonmac-on-main-wip("Unified memory without OpenExistingHeapFromAddress: the committed window gets a copy in video memory"), which he handed over in https://github.com/ivall/xcl/issues/258#issuecomment-7134093997. Rebased ontomain930e8b4and 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) andtimestamp_query_resolved_into_committed_and_reserved_buffers.Tested
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).a146528,--ignored: both pass. The aliasing probe printstruefor placed and for reserved buffers; the timestamp probe prints a frequency of 60 and a resolved value of0x0(D3DMetal's timestamps, see #996).cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 43 ignored on both; with--ignoredall 6 probes in the file pass, the aliasing probe printingtruefor both cases and the timestamp probe a frequency of 1 GHz and non-zero timestamps (@futurepro62, https://github.com/ivall/xcl/pull/1328#issuecomment-7135279215).Regression run
Test-only change in
crates/xcl/tests/: noxcl-smokeblocks.Not tested
AI use
c70bf8a. Claude Code with Claude Opus 5.5 reviewed them, ran them on this machine and wrote this description.Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:59:29Z.
Full-suite run, since this PR has no test report yet. Tested exact head
a146528(on its base930e8b4).Tested
cargo build --workspace, thenXCL_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.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 43 ignored, no skips.#[ignore], so I ran them explicitly withcargo 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.heap_probe.rscreates its device withD3D12CreateDevice(None, ...), soXCL_ADAPTER=radeondoes not reach them (a run with it printed the same adapter-specific values).Not tested
AI use
Imported from ivall/xcl. Originally posted by WASDeKeys on 2026-11-24T15:05:00Z.
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?
Imported from ivall/xcl. Originally posted by vakaobr on 2026-11-24T15:09:00Z.
@WASDeKeys:
scripts/pr_check.pyasks for the smoke pair only when the PR changes a runtime file: a path undercrates/xcl/src/that neither contains/testsnor ends intests.rs. This PR only touchescrates/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 testsinside, say,present.rs), the check treats it as runtime: either move the test into the module'stests.rsorcrates/xcl/tests/if it fits there, or get a smoke pair (#957 got one from mikebuckets171 in #258). Thetest-onlylabel 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.
Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T15:09:49Z.
The probes on Linux with vkd3d-proton (NVIDIA), next to the D3DMetal and Windows runs.
Tested
x86_64-pc-windows-gnu.a146528as it is (based on930e8b4), no uncommitted changes. The test binary runs under Wine, each probe in its own process (--exact <test> --ignored --nocapture --test-threads=1).heap_probe.rspass.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 buffer0x18eb03b650604400, into a reserved buffer0x18eb03b650620000. So here the timestamps are real, nanosecond values, unlike D3DMetal's0x0(#996).--ignoredthe six are reportedignored, as intended. I did not run the probes onmain.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T15:14:33Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 708 passed, 0 failed, 21 ignored.Thanks!
Imported from ivall/xcl. Originally posted by WASDeKeys on 2026-11-24T15:16:28Z.
@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
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T08:00:32Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by vakaobr on 2026-11-30T13:21:59Z.
Still waiting for a maintainer. Test-only heap probes, ignored by default; it merges cleanly with
main.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:27:07Z.
Triage (#1607) – head
a146528The only other branch that adds these two probes (
buffers_over_the_same_video_memory_alias,timestamp_query_resolved_into_committed_and_reserved_buffers) is #980, and #980 is closed. Main'sheap_probe.rsdoes not have them. They follow the file's existing#[ignore]probe style and only change test code. No problems found in the diff.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by grathepic on 2026-12-02T23:07:20Z.
merge-check
base:
078358a058head:
a146528e21merge: clean (
git diff --check origin/main..HEADclean)build:
cargo +1.98.1-x86_64-pc-windows-msvc build --offline --locked --workspace-> oktests:
cargo +1.98.1-x86_64-pc-windows-msvc test --offline --locked --workspace --no-fail-fast -- --test-threads=4(withXCL_DXC_DIR=C:\VulkanSDK\1.4.363.0\Bin,XCL_SAMPLE_*unset) -> 3006 passed, 0 failed, 54 ignored across 44 harnesses (6 ignored inheap_probe.rs); SKIPPED: 27 notices (22no wave64, 2no heap windows, 1no GPU_UPLOAD heaps, 1no dxil.dll, 1cannot disable the driver cache (Windows Developer Mode required)); failing: none. Explicit probe runcargo +1.98.1-x86_64-pc-windows-msvc test --offline --locked -p xcl --test heap_probe -- --ignored --nocapture --test-threads=1-> 6 passed, 0 failed, 0 ignored:buffers_over_the_same_video_memory_aliasprintedtruefor both placed-buffer aliasing and two reserved buffers mapped to one pool tile;timestamp_query_resolved_into_committed_and_reserved_buffersprintedtimestamp frequency: Ok(1000000000)and non-zero resolved timestamps for both committed (0x18ed9220dd2d5400) and reserved (0x18ed9220dd4a2000) buffers.title run: none (Tier 0 test-only diff in
crates/xcl/tests/heap_probe.rs,#[ignore]manual probes)review: Full single-commit diff read (
+126/-0,crates/xcl/tests/heap_probe.rs). Both probes follow the file's#[ignore]diagnostic pattern; queue ordering (UpdateTileMappings->gpu_copy,ResolveQueryData->gpu_copy), D3D12 buffer implicit state promotion/decay, and command list/allocator lifetimes acrossgpu_copy's fence wait are sound. Non-blocking note: these two probes predate#2881and callD3D12CreateDevice(None, D3D_FEATURE_LEVEL_12_0, ...)directly instead ofmain'sprobe_device(), so they do not yet honorXCL_ADAPTER, print the adapter/LUID banner, or callskip_teston device failure (a small follow-up if desired). Untested: AMD/Intel GPUs and multi-GPUXCL_ADAPTERselection.performance: none (
#[ignore]integration probes only; no runtime path changed)verdict: safe to merge (clean merge, full workspace suite passes with 0 failures on NVIDIA RTX 3080, all 6
--ignoredprobes pass with expected aliasing and timestamp outputs, and diff is strictly test-only)hardware / tool and model: NVIDIA GeForce RTX 3080 (driver 32.0.16.2140), AMD Ryzen 7 5800X3D, Windows 11 (10.0.26300.0), Rust 1.98.1-x86_64-pc-windows-msvc, DXC 1.9.0.5512 (VulkanSDK, no dxil.dll) / Antigravity, Gemini 4 Neon
Imported from ivall/xcl. Originally posted by Pipodi on 2026-12-03T00:52:35Z.
merge-check
base:
078358a058head:
a146528e21merge: clean (
git merge --no-ffonto078358a0, merge cfc4ba6e; crates/xcl/tests/heap_probe.rs +126)build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3006 passed, 0 failed, 54 ignored; failing: none (SKIPPED 25: 22 no wave64, 2 no heap windows, 1 cannot disable the driver cache). The two new probes are
#[ignore](52 ignored on main, 54 here). Run explicitly,cargo test -p xcl --test heap_probe -- --ignored --nocapture --test-threads=1-> 6 passed, 0 failed:buffers_over_the_same_video_memory_aliasprintedtruefor the placed buffers and for the two reserved buffers on one pool tile;timestamp_query_resolved_into_committed_and_reserved_buffersprinted frequency 1000000000 and non-zero timestamps in the committed and in the reserved buffer.title run: none (test-only change in crates/xcl/tests, no file under crates/xcl/src)
review: read the whole diff. No blocking findings. 1) Minor, agreeing with the first check: the two new probes open their device with
D3D12CreateDevice(None, ...)and return silently on failure, where the file's other probes now go throughprobe_device()(honoursXCL_ADAPTER, prints the adapter, callsskip_test); on a multi-adapter machine they may probe a different GPU than the rest of the file, and a missing device passes without a SKIPPED line. 2) The probes print their results and assert nothing, like the rest of the file, so they document behaviour rather than guard it; fine for#[ignore]probes. 3) Checked the D3D12 use: buffers in COMMON are implicitly promoted to COPY_DEST/COPY_SOURCE and decay betweenExecuteCommandLists, the tile mappings are queued before the copies on the same queue, the timestamp list's allocator outlives its execution (dropped aftergpu_copy's fence on the same queue), and the read-back offset (u64 index 2) matches the resolve at offset + 16. The aliased placed buffers are used in separate submissions with a fence wait between them, so no aliasing barrier is needed for buffers.performance: none (
#[ignore]probes in an integration test; nothing in the runtime changes)verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4090 24 GB, driver 621.40; Intel Core i9-13900K, 32 GB; Windows 11 build 26300; rustc 1.100.0, debug; Claude Code, Claude Opus 5.5
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.