Tests: guard unmapped placeholder read and release views in heap_probe #1734
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from ivall/xcl. Originally posted by kilvynsilveira-tech on 2026-11-24T20:08:30Z.
Fix 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.Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T21:17:05Z.
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
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T22:55:32Z.
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!
upstream-sync referenced this pull request2026-11-25 06:04:27 +00:00
upstream-sync referenced this pull request2026-11-26 13:04:54 +00:00
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T08:00:58Z.
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 Foniass on 2026-12-01T06:39:00Z.
Triage (#1607) – head
91d7cdaNo open or merged PR makes the same change; #1328 adds separate probes to
heap_probe.rsand does not touch these lines.The guard in
heaps_over_sections_in_a_placeholder(read chunk 1's first word only when it was mapped) and the view/placeholder cleanup are correct.placeholder_chunks_unmap_coalesce_and_release_cleanlyis not#[ignore], so it runs in CI, and it checks the Windows placeholder APIs on their own rather than the guarded probe code. The early return inview_heap_capacityis an unrelated change.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.