Repository navigation
fix(libs): flush pending GPU results before file writes - #6234
Merged
adriadam10 merged 1 commit intoOct 18, 2026
Merged
Conversation
11 tasks done
|
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.
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.
|
This was referenced Oct 15, 2026
11 tasks done
EagleBearerYS
added a commit
to EagleBearerYS/AnyPS5
that referenced
this pull request
Oct 15, 2026
…w-snapshot one The entry sat right below "Pending storage-image results", which boykopovar#6234 rewrites, so the two changes conflicted. Above "Draw input snapshots", two entries up, it merges cleanly with boykopovar#6234 and with main.
This was referenced Oct 15, 2026
This was referenced Oct 15, 2026
Closed
11 tasks done
EagleBearerYS
added a commit
to EagleBearerYS/AnyPS5
that referenced
this pull request
Oct 16, 2026
GuestArenaSetHostWriteObserver_nid_postfix becomes GuestArenaSetHostWriteHook_nid_no_patch, taking the address as std::uintptr_t, and the driver's GuestMemory::FlushBeforeHostWrite becomes PrepareHostWrite, so they read as one pair with the host read hook boykopovar#6234 adds (GuestArenaSetHostReadHook_nid_no_patch and PrepareHostRead). The setter is a helper that must not become a NID, so it takes the _nid_no_patch suffix. Behaviour is unchanged.
12 tasks done
Ondra97
force-pushed
the
codex/fix-file-write-gpu-coherence
branch
from
October 17, 2026 21:59
0f5651f to
9b89c92
Compare
12 tasks done
adriadam10
force-pushed
the
codex/fix-file-write-gpu-coherence
branch
from
October 18, 2026 23:00
9b89c92 to
a64d038
Compare
Open
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
Explicit-size file writes can return the full byte count while storing stale guest memory after a GPU storage-image write, even after a draining suspend and device-idle wait. I make the file-write paths prepare their source ranges before host I/O.
A small libc callback bridge invokes the existing AGC read guard and range-specific
FlushGpuWriteswithout reversing the libc/libkernel dependency direction. It covers kernel/POSIX scalar, positioned and vectored writes, AIO writes and libcfwrite. Preparation precedes positioned-transfer, shared-memory and nativeFILElocks.fwritechecks multiplication and address overflow before preparing its range.The GPU regression checks actual file contents through 12 API paths, interior source addresses, multiple iovecs, positioned offsets and element counts. Controls cover empty/invalid requests, an unrelated CPU source, retention of another pending image, guard refusal before file mutation, and ordinary writes after shutdown and hook reset.
The rebase preserves every added and removed line of the original patch and retains main's queue-zero late-interrupt test linkage. The merged append/vector/descriptor-lifetime changes remain intact. The current #6287 append-stream implementation changes stream opening rather than this source-preparation path; no prerequisite is required.
Direct guest CPU loads, other host readers, and freeing/reusing pending storage-image memory remain covered by the existing technical debt. No retail title is claimed as fixed.
Tested
Base:
c0a7468f6f666a46b1c3e2fb14bb651fed05afc5. Head:9b89c92a2e4a26b01cf5c21d4a071deb13e36da7. Release,BUILD_TESTING=ON.Windows (native host) — Windows 11 Pro 10.0.26300, AMD Ryzen 9 7900X, 32 GB RAM, NVIDIA GeForce RTX 4070 Ti SUPER, NVIDIA 617.42 / Windows driver 32.0.16.1742, WinLibs MinGW-w64 GCC 15.2.0 r7.
cmake --build build-pr6234 --parallel 4.agc_driver_storage_file_writereported zero incorrect bytes. GPU logs confirm the NVIDIA device. GPU runs usedANYPS5_REQUIRE_VULKAN=1,ANYPS5_GPU=NVIDIA GeForce RTX 4070 Ti SUPERandANYPS5_NO_SHADER_CACHE=1; the regression also setsAPS5_SUSPEND_DRAIN=1and has a 30 s timeout. Reproduce it withctest --test-dir build-pr6234 -V -R '^agc_driver_storage_file_write$'under those settings.Before / after, Windows (native host) — one run of the same scalar-write case, on the same machine and configuration, after a real PM4 compute dispatch and draining suspend. The source begins 13 bytes inside a 131,072-byte surface; the write transfers 131,035 bytes.
sceKernelWriteFor the negative control, all seven production files were restored byte-for-byte from the base and the regression selected only its
sceKernelWritecase. The control failed on the actual byte comparison. All seven production files and the complete 12-API fixture were then restored and SHA-256 checked before the final full build and passing suite. This demonstrates file-content correctness, not a performance or game-compatibility improvement.Linux (VirtualBox) — Ubuntu 24.04.5 LTS, kernel 7.0.0-38-generic, GCC 13.3.0, VirtualBox 7.2.20r175154 on the Windows host above, 4 vCPUs and 8 GiB RAM. Graphics: not exercised.
cmake --build build --parallel 3.agc_driver_storage_file_write_testsandagc_driver_queue_zero_late_interrupt_testscompiled; neither was executed in VirtualBox. SHA-256 matched all 16,037 transferred source/dependency files before the build.Linux graphics/Vulkan tests: NOT RUN — intentionally excluded from VirtualBox validation. Native/bare-metal Linux was not tested. Native Linux GPU validation: not tested. No retail title was run.
Conventions, main-sync, whitespace and test registration checks passed; all 954 test executables have CTest registrations. Full hosted Windows/Linux PR builds require collaborator dispatch under
CONTRIBUTING.md; no such run was triggered here.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)