Repository navigation
fix(libc): preserve writes during partial shared-memory collection - #3783
Merged
adriadam10 merged 3 commits intoOct 11, 2026
Merged
Conversation
This was referenced Oct 11, 2026
9 tasks done
jweidenh
force-pushed
the
codex/windows-partial-write-tracking
branch
from
October 11, 2026 20:18
6b433a1 to
3b32e54
Compare
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
Collaborator
|
Checked the Note for #3864: it rewrites the same loop in |
10 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
Preserve pending CPU writes when Windows collects only part of a shared direct-memory view. Shared views are 16 KiB, while
GuestMemorycollects and records CPU-write versions in 4 KiB pages. Collecting a prefix previously marked the entire view clean and advanced itsseengeneration, even though neighboring pages had not been reported. A laterUnchangedSinceCollectedcould therefore incorrectly report a changed neighboring page as unchanged; GPU label synchronization uses that result.Only mark the collected interval clean, advance
seenwhen a whole view is collected, and stop at already-clean interior intervals instead of reporting them again. The existing early return for a full output buffer and non-reset collection semantics are preserved.The regression maps direct memory twice on Windows to exercise the shared path, writes the last subpage, collects the first, and verifies that the last subpage is still observed as changed. It also checks independent alias observations, writes through either alias, repeated non-reset probes, previously cleared interior pages, limited output capacity and continuation. Both the normal and two-pass collectors are covered. The portable part runs on Linux; unavailable write watching follows the existing test skip convention.
PRs #637 and #2054 retain the defective shared-view path. This change is independent of their private direct-memory paths; the Windows fixture deliberately creates an alias so it stays relevant with either implementation.
Tested
Current head:
3b32e54ed90777c6dcdf6b7b5aa21f6cfb442bba, rebased onto0a8b1d32b12a6d6a3acd462787750b482bf78884. The only conflict was adjacent CMake registration; upstream sRGB and both partial-collection cases were preserved. Production and regression-test source are unchanged.Rebase validation on this exact head rebuilt the focused executables and patched runtime libraries. Windows 11 / RTX 5090 / NVIDIA 617.42 passed all seven cases again without skips (8.06 s total; slowest 2.75 s). Linux GCC 13.3 passed all four portable cases without skips (slowest 0.017 s), on the private self-hosted validation run.
Original regression validation: base
a11c8f7f70a0ed4e71504a89de69e8cdae687817, test-only baseline44bd7086aeba5e3c6b9f68b23c8f1a44083ac4db, fixed head6b433a19a89a845539646dc740adf054447b90f7. The unchanged negative controls were not rerun after rebase.partial collect lost a neighboring guest writein both normal and two-pass modes. Final head passes all 7/7 cases without skips or fatal output:agc_shared_write_partial_collect,agc_shared_write_partial_collect_two_pass,agc_shared_write,agc_write_tracking,agc_write_watch_coverage,agc_driver_unimported_label_order, andagc_driver_copied_writer_copy. Both Vulkan tests log selection of the RTX 5090 and reach their success markers. Total 1.16 s; every case below 0.48 s. The initial production-fix run also passed all seven tests (5.12 s total).libs: final head passes 4/4 portable cases (agc_shared_write_partial_collect,agc_shared_write,agc_write_tracking,agc_write_watch_coverage), without skips or fatal output, each below 0.012 s. Private run38156295437, workflow commit65edae1e06eb69cdb4a9925c6a54b3c09dffe838, pinned to the final source head above.This demonstrates the lost-write regression and related GPU memory-order/copy behavior. No retail-title reproduction or gameplay/FPS improvement is claimed.
Checklist
main; no other open PR implements the same fix