host_gpu: read ahead on sequential write faults #1150
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1150
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1150/head"
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?
@abokhalill on GitHub · 2026-10-07 16:10 UTC · original
abokhalill:fault-ahead→main· +121 −1 · 5 files · 1 commits · closed without mergingGuest code usually fills buffers front to back, so writing a tracked buffer takes one fault per 4 KB page (#1081).
This PR reads ahead the way file readahead does: a fault on the page right after the same thread's previous fault also releases the next pages, doubling up to 16 pages. Pages the GPU owns still take their own fault.
MemoryTracker, N threads writing 64 KB buffers front to back, per frame:Together with #1149 on Windows, 6 threads: 4.09ms -> 0.47ms
@coderabbitai[bot] on GitHub · 2026-10-07 16:16 UTC · original
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
742c4ad8-4ccc-42b2-9525-f1d9c427c7ed📥 Commits
Reviewing files that changed from the base of the PR and between
d2413fc2eband9e0329b7af.📒 Files selected for processing (5)
src/graphics/host_gpu/memoryTracker.hsrc/graphics/host_gpu/renderer/cache/bufferCache.cppsrc/graphics/host_gpu/renderer/cache/bufferCache.hsrc/graphics/host_gpu/renderer/renderContext.cpptests/MemoryTrackerTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.
📝 Walkthrough
Walkthrough
The memory tracker now expands CPU ownership releases for sequential write faults, up to a 16-page window. Mapped write faults in the render context use the new BufferCache invalidation method. New tests cover sequential readahead, out-of-order faults, uploads, and GPU-owned pages.
Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Feature
Merge Risk: ⚪ Minimal · up to
9e032The change speeds up sequential CPU writes to GPU-tracked buffers by releasing protection on several pages per fault. Textures that share those pages stay protected, so their cached data is still invalidated correctly. Pages released ahead but never written cause only an extra upload of unchanged data. No merge-blocking risk was found.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.Pull request closed