Skip to content

fix(agc): import committed spans of partially accessible windows - #6918

Merged
oneandonlydean merged 4594 commits into
boykopovar:mainfrom
Scramblrrrr:codex/partial-host-import-window-main
Nov 17, 2026
Merged

oneandonlydean merged 4594 commits into
boykopovar:mainfrom
Scramblrrrr:codex/partial-host-import-window-main

Conversation

@Scramblrrrr

@Scramblrrrr Scramblrrrr commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What

A GPU access wholly inside the committed part of a large registration can lose host import because its selected window also includes inaccessible pages. Main rejects the window; the regression reserves 128 MiB, commits 64 KiB and verifies a GPU fill of the committed prefix.

After the existing window selection and overlap growth, windowRun selects the aligned committed span that contains the entire requested access. It still refuses an access crossing a hole, an alignment that cannot cover the access, or narrowing that would cut an overlapping import. Whole-run callers and registrations no larger than the window keep their existing policy. No new exports, stubs, title checks or configuration switches.

Tested

Refreshed head 8b0d85f9a0e35a72b867d8346b814ffb2bd4ceb7, based on main d2608978dac8a5ea35433db80200219e80f85fc6. This preserves maintainer refresh 009618161a and all current-main tests.

Windows 11 Pro 26200, NVIDIA GeForce RTX 5070 Ti, NVIDIA 617.42 (Windows driver 32.0.16.1742), WinLibs GCC 15.2.0 r7, Release, SPIRV-Tools OFF:

  • agc_driver_graphics and agc_driver_host_import_windows, three consecutive runs on main and on this head: 6/6 pass per head, no skips.
  • Actual Khronos validation 1.4.363 is loaded: five instance-layer insertions per baseline run, six per candidate run. Every positive log has zero VUID/SYNC-HAZARD identifiers and no missing requested layer message.
  • Paired production-only negative: retain final fixtures and replace only GuestBufferMemory.cpp with pinned main. Both tests fail at their intended assertions: the committed access is refused, and the GPU cannot fill the committed prefix. Restore the exact positive source and rebuild only the provider: 2/2 pass. Source bytes are restored and both fixture executable SHA256 hashes remain unchanged. No validation errors in the negative or restored run.
  • Commands: serial ctest --test-dir build-depth-current -R '^agc_driver_(graphics|host_import_windows)$' -j1 -V, with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_GPU=NVIDIA VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, and VK_LAYER_PATH pointing to that layer.
  • Conventions and diff checks pass. This is a focused validation result, not a full-suite or title compatibility claim.

The outstanding query-path review is complete: importAllocation returns an existing covering import through findImport before it reaches windowRun. This change's commitment query is therefore on import selection/creation or reconciliation, not every stable reuse. The regression verifies reuse of the same narrowed buffer and rejects real holes; no title speedup is claimed and no query timing has been inferred from whole-test duration.

Independent evidence remains attributed to its original head:

  • domx4q, Linux/RTX 4090: head 009618161a merged into main e4caa07950, Arch Linux/GCC 16.2.1, NVIDIA 620.70.06, Khronos 1.4.363.1; both focused tests pass on baseline and change, no skips or VUIDs, actual layer insertion verified.
  • Earlier AMD/Windows 780M and Linux/lavapipe functional reports remain in this PR's conversation at head 955e7c3c7; those are not measurements of this refresh.

No 007 FPS gain or title unblock is claimed. Raw title code, captures and logs stay local. Related import-window work is coordinated in discussion #5714; this change addresses commitment within one registration, rather than joining registrations.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none confirmed; PPSA11386 investigation in 007 First Light (PPSA11386) #5714
  • GPUs tested: NVIDIA GeForce RTX 5070 Ti, NVIDIA 617.42, Windows 11 Pro 26200
  • AI-assisted: yes (Codex)

@Scramblrrrr

Copy link
Copy Markdown
Contributor Author

Title diagnostic qualification before a user-requested pause: the original dominant12.5MiB copied span was misclassified by an experimental sampler checking only its first4bytes. It crosses2MiB registrations, so it is not title evidence for this single-registration fix. Corrected findings: #5714 (comment) . This PR's clean-main synthetic negative/positive and real Vulkan fill remain valid independently (7/7 restored, two new fixtures fail with only production restored to main).

This fix was included in title integrationc70803a19 with #5372 plus an opt-in16MiB window. That combined stack renders the offline menu at1.80194FPS, but no isolated benefit is attributed to this PR. Still draft; Linux and commitment-query-cost review remain pending. No new runs will start until the user resumes. AI-assisted: Codex.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 5372 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6412 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 9289 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 9852 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 10442 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
core/libs/prx/libSceAgcDriver/tests/execution/HostImportWindows.cpp
PR 10443 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 12157 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 12944 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 13148 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 15296 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 15570 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 15621 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 16831 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 18173 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 20315 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp

@SleglJan

Copy link
Copy Markdown
Contributor

Linux cross-test of 955e7c3 on main 93e54ce. Setup: Arch Linux container, GCC 16.2.1, lavapipe (Mesa 26.2.4, LLVM 23.1.1), Release, BUILD_TESTING=ON. Test command: ctest -R 'host_import|driver_graphics|bda', 10 tests.

  • This head: 9 pass, 1 skipped (agc_host_import_sparse).
  • Same tests with only GuestBufferMemory.cpp taken from main: 2 fail, both at the new cases.
    • agc_driver_graphics fails with a committed access was refused because its import window includes uncommitted pages.
    • agc_driver_host_import_windows fails with host import windows: cannot fill the committed prefix.
    • The other 8 pass or skip as with this head.
  • userfaultfd is not permitted in this container, so the write watch falls back to comparing guest memory (logged by both failing tests in the second run; passing tests print no output).

Not run: a hardware GPU, the full suite, any title.

AI-assisted: yes (Claude Code)

@keravyn-ops

Copy link
Copy Markdown
Contributor

AMD / Windows run of this PR at 955e7c3: Radeon 780M (RDNA 3, 0x15bf), AMD driver 25.10.20.01 (32.0.21020.1007), Windows 11 Home 10.0.26100, WinLibs GCC 15.2.0 r7, Release.

  • agc_driver_host_import_windows: pass (host import windows tests passed, 0.44 s)
  • agc_driver_graphics: pass (5.14 s)

AI-assisted: yes (runs made on the device above).

@Scramblrrrr

Copy link
Copy Markdown
Contributor Author

Thanks @SleglJan and @keravyn-ops for the independent Linux red/green and AMD Windows runs. I have recorded both in the PR description. The Linux comparison isolates the intended production failure at both new assertions, with the container write-watch limitation retained; the AMD run covers actual host imports on Windows. This remains draft pending the import-query cost review. Our current 007 integration passes its selected host-import/graphics controls, but no isolated title FPS benefit is claimed for this fix. AI-assisted: Codex.

@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 18, 2026
@github-actions github-actions Bot removed the unblocks title Names a title ID on the Unblocks line label Oct 20, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 21, 2026
@Scramblrrrr

Copy link
Copy Markdown
Contributor Author

Refreshed onto main d6eafa5, head028169644. New Windows paired proof on b36dea0 (same AGC sources/fixtures; separate SystemService-only addition): both import/graphics fixtures pass, both fail with only GuestBufferMemory.cpp restored to main, both pass after exact positive restoration. Fixture EXE hashes unchanged; real Khronos1.4.363 layer loaded, no VUID/missing-layer errors in the positive controls. Body records exact setup, the current-main resident-mapping test retained alongside our prefix test, and the outstanding query-cost review. Prior AMD/Linux reports remain attributed to their tested heads. Draft/no FPS claim unchanged. AI-assisted: Codex.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 22, 2026
oneandonlydean and others added 12 commits November 17, 2026 16:08
…GetAttribute-copyout

fix(libSceFont): safely copy out glyph attribute in sceFontGlyphGetAttribute
…epends-on-answer-line

fix(tools): read the Depends on answer from its own line in check_conventions
…-mastering-lifecycle

test(libSceAudioOut): pin the measured mastering flag lifecycle
…-opaque-handle

fix(libkernel): read the module image through dlinfo and never own the program's own handle
…t-path-20261109

perf(shader): guard NaN repair regions using certified inputs
…oykopovar#17738)

* perf(agc): reuse unchanged colour and depth attachments across draws
* fix(agc): key repeated attachments on multisample claim releases
* fix(agc): remember colour attachments only with proved metadata
* test(agc): keep a target without DCC independent of a resident image's keys
* fix(agc): keep the attachment target memo in a host thread slot
* test(agc): unwatch the baseline fixture's memory itself before arming
* test(agc): keep the target memo tests to what Vulkan and the host guarantee
* perf(agc): skip the target memo bookkeeping when the memo is off
* perf(agc): remember the depth overlap of a repeated color target
* test(agc): cover the cached depth overlap of the target memo and bench its hit path
* test(agc): expect a watched direct upload to release the saved guest copy
* perf(agc): count target memo outcomes across threads behind a profile switch
* perf(agc): make APS5_NO_TARGET_MEMO a runtime switch the A/B can flip
* test(agc): follow the epoch-proof gate in the target memo test
* test(agc): gate the memo hit and rebuild checks on the memo serving
* fix(agc): refresh the stencil baseline on a repeated stencil write
* fix(agc): compare every color target field in the memo identity
* test(agc): flush pending results before the residency scenario clears the cache
* test(agc): gate the CMASK repeat checks on the guest write tracker
* test(agc): back the recorded-clear and padding CMASKs with direct memory
* test(agc): map the recorded-clear and padding CMASKs over 2 MiB
* test(agc): drop the two code comments in TargetStateMemo.cpp
* test(agc): pin the order of the pass attachment and target memos

Co-authored-by: Dean Galvin <dean.galvin@live.com>
Co-authored-by: Claude <noreply@anthropic.com>
…ering point (boykopovar#17786)

* perf(agc): share collect walks between threads after the caller's ordering point
* test(agc): pin a CPU store after the submission's ordering point
* perf(agc): raise the ordering point without a new collect epoch
…r-lateness

fix(libkernel): arm Windows timed waits early by the timer's measured lateness
…kgroup-memory-barriers

fix(libSceAgcDriver): fix divergent device atomic barrier on AMD
…nputs-in-place

perf(agc): bind small, rarely read draw inputs in place where they are copied
@Scramblrrrr

Copy link
Copy Markdown
Contributor Author

Thanks @oneandonlydean for the November refresh and @domx4q for the independent Linux/NVIDIA validation. I preserved that history and refreshed onto pinned main d260897 at 8b0d85f9a0e35a72b867d8346b814ffb2bd4ceb7.

Fresh Windows / RTX 5070 Ti 617.42: both focused tests pass three consecutive times on main and on the change (6/6 per head, no skips), with actual Khronos 1.4.363 layer insertion and zero VUID/SYNC-HAZARD identifiers. With final fixtures unchanged and only the production file replaced by main, both intended regressions fail. Exact source restoration and provider rebuild gives 2/2 pass; fixture EXE hashes unchanged. Conventions pass. Current description records all heads, conditions and the independent results with attribution.

The query-path concern is addressed by the current fast path: an existing covering import returns from findImport before windowRun and its new query. This is an import-selection cost, not a query on every stable reuse. No numeric query-cost or title FPS benefit is claimed. I am marking this correctness fix ready for review; no title unblock is claimed. AI-assisted: Codex.

@Scramblrrrr
Scramblrrrr marked this pull request as ready for review November 17, 2026 03:48
@oneandonlydean
oneandonlydean merged commit 6a52b45 into boykopovar:main Nov 17, 2026
23 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.