Tests: guard unmapped placeholder read and release views in heap_probe #1744
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1744
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1744"
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?
@kilvynsilveira-tech on GitHub · 2026-11-24 20:08 UTC · original
kilvynsilveira-tech:tests/fix-heap-probe-cleanup-and-guards→main· +67 −4 · 1 files · 1 commits · openFix three bugs in
crates/xcl/tests/heap_probe.rsand add a non-ignored CPU regression test for placeholder unmapping, coalescing, and release:heaps_over_sections_in_a_placeholder,*((base + 11 * chunk) as *const u32)ran unconditionally after the loop even if chunk 1 skipped (MapViewOfFile3orOpenExistingHeapFromFileMappingfailure), dereferencing an unmappedPAGE_NOACCESSplaceholder (0xc0000005). Guard the read on chunk 1 having mapped, assert its first word (1 << 28), and unmap + coalesce +VirtualFreethe 256 MiB placeholder reservation on exit (and on early-continue error paths).heaps_over_partly_committed_sections, failingCreatePlacedResourceskippedUnmapViewOfFile(view)andCloseHandle(h), leaking up to 4 GiB of virtual address space and a file-mapping handle.view_heap_capacity, return early whenD3D12CreateDevicefails instead of panicking on.unwrap(), matching the other three probes in the file.What is in it
crates/xcl/tests/heap_probe.rs:viewand closehonCreatePlacedResourcefailure inheaps_over_partly_committed_sections.CreateFileMappingW, clean up views/handles onMapViewOfFile3/OpenExistingHeapFromFileMappingfailure, guard chunk 1's read onchunk1_mapped, and unmap (MEM_PRESERVE_PLACEHOLDER) + coalesce (MEM_COALESCE_PLACEHOLDERS) + release (VirtualFree(..., 0, MEM_RELEASE)) the placeholder reservation inheaps_over_sections_in_a_placeholder.D3D12CreateDeviceerror inview_heap_capacity.placeholder_chunks_unmap_coalesce_and_release_cleanlyverifying that a skipped split chunk remainsMEM_RESERVE/PAGE_NOACCESSand thatUnmapViewOfFileEx+MEM_COALESCE_PLACEHOLDERSreleases the full reservation.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), DXCdxcompiler 1.8.2502.11(dxil 1.8.2502.11), debug build.cargo test -p xcl --test heap_probe -- --nocaptureon91d7cda: 1 passed, 0 failed, 4 ignored.cargo test -p xcl --test heap_probe -- --ignored --nocaptureon91d7cda(RX 580): 4 passed, 0 failed, 0 ignored (all four D3D12 probes ran and released their views, handles, and 256 MiB placeholder reservation cleanly).cargo test --workspace --no-fail-fast -- --test-threads=4on91d7cda: 858 passed, 1 failed, 42 ignored (242 SKIPPED SM 6.6 GPU tests on RX 580; the 1 failure is pre-existing onmainingpu_raw_window_view_reaches_its_top, addressed separately in #1736).Regression run
crates/xcl/tests/heap_probe.rs.Not tested
D3D12CreateDevicesucceeds on RX 580).AI use
heap_probe.rs, wrote the fix, regression test, and PR description, and ran the test suites on RX 580 under the user's direction.@futurepro62 on GitHub · 2026-11-24 21:17 UTC · original · edited 2026-11-24 21:39 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
91d7cda(on its base9039900).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip pso_measurement_compiles_an_exact_synthetic_record: 858 passed, 0 failed, 42 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.placeholder_chunks_unmap_coalesce_and_release_cleanly.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 859 passed, 0 failed, 42 ignored. SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipon NVIDIA. Both fail on main7f7e768too, not because of this PR: underXCL_REQUIRE_GPU=mesh,runner::skip_testturns their skips into failures.heap_window_out_of_memory_falls_back_to_the_switch_formskips whenXCL_HEAP_WINDOWSis unset (#1651), andshaders::tests::pso_measurement_compiles_an_exact_synthetic_recordskips because Developer Mode is off on this PC (it cannot disable the driver cache). The AMD run does not setXCL_REQUIRE_GPU, so there both just print SKIPPED.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 22:55 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
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.