Repository navigation
fix(agc): compare host imports when device writes reach the write watch - #3226
Merged
oneandonlydean merged 1 commit intoOct 11, 2026
Merged
Conversation
The import probe only checked whether a GPU read of an imported range reports its pages as written. lavapipe runs command buffers on CPU threads, so its writes into an import go through the page tables and are collected as CPU stores. In agc_unit_shadow the whole publish's copy into the import is then collected as a CPU store over unit 3, and the next partial publish drops the slab's newer bytes as stale: "the partial publish did not copy exactly the partly covered unit". The probe now also fills the scratch range on the GPU and collects again. When the read or the fill reports pages as written, host and dma-buf imports are compared. lavapipe reports 0 of 4 pages after the read and 4 of 4 after the fill; NVIDIA reports 0 after the fill. The probe change is the first commit of boykopovar#1046.
This was referenced Oct 11, 2026
10 tasks done
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
agc_unit_shadow, registered by #2864, fails in the Linux job onmain:This is #1429. The failing check was already there; it never ran in CI before #2864 registered it. The cause is the one @popcoder565 and @Dextroid17 traced there. lavapipe runs command buffers on CPU threads, so its writes into a host import go through the page tables, and the write watch collects them as CPU stores. The import probe only checks a GPU read (0 of 4 pages on lavapipe), so imports stay watched. The whole publish's copy into the import is then collected as a CPU store over unit 3. The next partial publish finds the unit written since its retile and drops it without a copy.
This carries the probe change from #1046 (@aryanrawatispro-ship-it, closed with conflicts), rebased onto current
main. The probe also fills the scratch range on the GPU and collects again. When the read or the fill reports pages as written, imported ranges are compared. The dma-buf probe sharesrunImportProbe, so its decision takes the fill into account too.On lavapipe the startup line now reads:
There,
agc_unit_shadowreportshost imports are compared, not watched: unit shadows not tested, as it already does on devices that compare imports. On the RTX 4090 the fill reports 0 pages, imports stay watched and the shadow checks run.The rest of #1046 (registering the whole
agc_driver_recorder_testsbinary and the test changes that came with it) is not included.Tested
Linux (CachyOS, GCC 16, Release, CI's configure flags) on
main77bd928:mesa-vulkan-drivers25.2.8, the package the Linux job installs:agc_unit_shadowfails 5/5 onmainand passes with this change;ctest: 754/755. The one failure isagc_driver_image_packed16_load, fixed since by fix(agc): view 4_4_4_4 textures as B4G4R4A4, which every Vulkan device can sample #3208. With both changes, 755/755.agc_unit_shadowpasses 10/10 onmainand with this change;ctest: 754/755.agc_driver_dcc_keys_first_writefails the same way onmain(agc: #2699 undoes #2984 where host imports stay write-watched, so agc_driver_dcc_keys_first_write fails on main (NVIDIA); driver-independent test branch ready #3179).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Fixes #1429.