Repository navigation
fix(agc): prefer imported prefixes before sparse heap mirrors - #8762
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the import-before-sparse-mirror reorder and the Linux regression fixture. The existing host-import and GPU-copy selection remains intact; the fallback now runs only after those paths, while the fixture checks read-only imported-prefix reuse, over-prefix rejection, writable fallback behavior, and cleanup. The reported focused validation runs and successful eligibility/convention checks are consistent with this narrow change.
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
@JJenkx thanks, the reorder reads right for the aligned case your fixture covers. One path I'd like pinned before merge: now that the sparse mirror comes after the import paths, a sparse-run region whose import offset is not bindable in place ( Could you either add a case to |
|
Windows run of 53b73b5 merged onto Built |
…fix without reading the tail Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@oneandonlydean thanks, pinned in bcc3657 (test only, no source change). The GPU-copy fallback cannot take a sparse-run region: a sparse run requires
Linux 7.2.9, GCC 16.2.1, Release. This suite runs on the mock Vulkan device, so the validation layer does not load (no VUIDs to compare). |
|
@JJenkx thanks, that settles it: with |
What
A read-only buffer descriptor that extends past the committed prefix of a registered heap can bind a heap mirror before checking the host import that already covers that prefix. An address-based build then uses the import and releases the mirror. Alternating the two paths can recreate the same mirror repeatedly.
Try the existing import resolution and GPU-copy paths before the sparse heap mirror fallback. Keep the existing write-overlap, committed-range and descriptor-cut checks. A writable overhanging descriptor still falls back to a mirror; a view starting beyond an imported prefix is still rejected.
The regression fixture alternates descriptor and address-based builds over an imported 64 KiB prefix with an inaccessible tail, checks that no mirror is rebuilt or copied, rejects a view past the prefix, and verifies CPU/GPU stores through the writable fallback.
Overlap review:
tools/pr_overlap.pyreported no directly comparable overlap, but listed 22 stale/conflicting PRs for manual review. Their AGC diffs were inspected; none moves this sparse mirror fallback after import selection. #7647 changes mirror storage/allocation and keeps the original selection order; it is independent of this change. No dependency on the separate persistent heap-shadow experiment.Tested
Linux / Arch Linux, AMD Radeon RX 6650 XT, RADV Mesa 26.2.4-arch1.1. Based on main
5b59fbc5539b6c6db7a26972f6069f1c6cc179ac; candidate53b73b5dae17ab7005c93e766a3dc66fa2e10310.libs,agc_driver_graphics_tests, andagc_driver_bda_device_tests.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_DRIVER_FILES=/usr/share/vulkan/icd.d/radeon_icd.json ctest --test-dir build-full -R '^agc_driver_(graphics|bda_device)$' -V.100% tests passed out of 2; zeroVUID-messages; no missing validation layer.100% tests passed out of 2; zeroVUID-messages; no missing validation layer;Sparse imported heap tests passedexecuted.the sparse descriptor did not bind its imported prefix, then passed after it. The standalone candidate above also passes on current main.bcc36571bf(test only):sparseImportedHeapTestsbinds a read-only descriptor at a misaligned offset (base + 16,minStorageBufferOffsetAlignment256, active recorder) that extends past the committed 64 KiB prefix into aPROT_NONEpage. It must not bind the import, and its view and copied bytes stay within the committed prefix.agc_driver_graphicspasses onbcc36571bf; withregion.sparseremoved fromgpuCopyEligible(the reviewer's GPU-copy scenario) the case segfaults on the uncommitted tail. Sparse-run regions cannot take the GPU-copy or staging path because both require!region.sparse. This suite runs on the mock Vulkan device, so no validation layer is involved.python3 tools/check_conventions.py --base origin/main: passed.The new fixture is Linux-only. Independent Windows testing by @ycbuzi used candidate
53b73b5daemerged onto mainb77bd58806(merge6301d6bb2a), Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release withBUILD_TESTING=ON, and an NVIDIA GeForce RTX 4070 SUPER, driver 616.92 (ANYPS5_GPU=4070). They builtlibSceAgcDriverandagc_driver_graphics_tests; all 27 cases registered on Windows passed both repeats withctest --repeat until-fail:2. This covers existing Windows cases; the Linux-only sparse-prefix fixture and a title were not run. No Windows validation-layer or VUID result was reported. No title frame-rate, loading-time, or crash-fix claim is made; Echoes of the End is still under investigation.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)