feat(agc): add an opt-in compute queue lane #13863

Open
Celegans12 wants to merge 4 commits from upstream-pr/13863 into main
Celegans12 commented 2026-10-31 10:08:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-31T10:08:08Z.


What

Stacked on #9289; please review the last commit only.

APS5_ASYNC_LANE=<hex ring> sends eligible compute to a spare compute-only queue, continuing #675 and adapting hritikutekar's async implementation. Queue planning, buffer sharing and command identity are per device; unsupported work stays on main.

  • Order shared data, copied writers, consumed labels and completions across lanes; prepare producers before waits and refuse submission, retirement and handle replacement while native commands are borrowed.
  • Restore periodic timeout reports, default lease submission and device-matched depth locking. Allocate the command registry only for an actual async queue.
  • Direct guards restore return edges normally; caught unwinds retain retryable edges. Existing dependency prefixes may submit, while fresh destination reentry is refused until restoration succeeds. Reconcile pending images on entry or return failure.
  • With APS5_GPU_CHECKPOINTS, async batches write no checkpoint marker, and a main-lane batch opened while one is open writes the sentinel and takes no submit snapshot. The ordered storage-refresh skip is off while the lane is active.

Keep #6188 separate and preserve #9898 lease/label ordering. #11587 needs both-lane retirement proof; #12764 shared scratch must refuse async. Narrow timestamp wrap and unsupported cross-ring progress remain debt.

Tested

Based on main 1adc0e2f4b plus #9289 (rebased 2026-11-17; main's new passGeneration bump, lease-write finish and stencil clear pass are kept, with the lane's opened-batch finish and command borrow on top). Windows 11 / MinGW-w64 GCC 15.2.0, Release with -DBUILD_TESTING=ON: 29 lane, async, storage-flush, ordered-flush, staged-copy, barrier, device-fault and runtime-switch cases passed three times on RTX 3080 Laptop / 621.14 with validation 1.4.363; the lane cases used a second queue. No VUIDs, hazards or skips. The 12 lane and async cases also passed with APS5_GPU_CHECKPOINTS=1 on the previous head (not yet rerun on this one). Two lane tests now pass the lease's write flag that main added to CountLeaseOutcome.

The seven agc_driver_lane_* failures on community CI were the VUID- output check matching VUID-VkDeviceCreateInfo-pNext-pNext, which validation 1.3.275 prints at device creation on main too; the lane tests now mute that one ID through VK_LAYER_MESSAGE_ID_FILTER. That layer was not available here. Not tested on this head: Linux, macOS, titles/FPS.

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
  • 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: #9289
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA RTX 3080 Laptop, 621.14, Windows 11
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5096574872 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13863). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-31T10:08:08Z. --- ### What Stacked on #9289; please review the last commit only. `APS5_ASYNC_LANE=<hex ring>` sends eligible compute to a spare compute-only queue, continuing #675 and adapting hritikutekar's async implementation. Queue planning, buffer sharing and command identity are per device; unsupported work stays on main. - Order shared data, copied writers, consumed labels and completions across lanes; prepare producers before waits and refuse submission, retirement and handle replacement while native commands are borrowed. - Restore periodic timeout reports, default lease submission and device-matched depth locking. Allocate the command registry only for an actual async queue. - Direct guards restore return edges normally; caught unwinds retain retryable edges. Existing dependency prefixes may submit, while fresh destination reentry is refused until restoration succeeds. Reconcile pending images on entry or return failure. - With `APS5_GPU_CHECKPOINTS`, async batches write no checkpoint marker, and a main-lane batch opened while one is open writes the sentinel and takes no submit snapshot. The ordered storage-refresh skip is off while the lane is active. Keep #6188 separate and preserve #9898 lease/label ordering. #11587 needs both-lane retirement proof; #12764 shared scratch must refuse async. Narrow timestamp wrap and unsupported cross-ring progress remain debt. ### Tested Based on `main` 1adc0e2f4b plus #9289 (rebased 2026-11-17; main's new `passGeneration` bump, lease-write finish and stencil clear pass are kept, with the lane's opened-batch finish and command borrow on top). Windows 11 / MinGW-w64 GCC 15.2.0, Release with `-DBUILD_TESTING=ON`: 29 lane, async, storage-flush, ordered-flush, staged-copy, barrier, device-fault and runtime-switch cases passed three times on RTX 3080 Laptop / 621.14 with validation 1.4.363; the lane cases used a second queue. No VUIDs, hazards or skips. The 12 lane and async cases also passed with `APS5_GPU_CHECKPOINTS=1` on the previous head (not yet rerun on this one). Two lane tests now pass the lease's write flag that main added to `CountLeaseOutcome`. The seven `agc_driver_lane_*` failures on community CI were the `VUID-` output check matching `VUID-VkDeviceCreateInfo-pNext-pNext`, which validation 1.3.275 prints at device creation on main too; the lane tests now mute that one ID through `VK_LAYER_MESSAGE_ID_FILTER`. That layer was not available here. Not tested on this head: Linux, macOS, titles/FPS. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #9289 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA RTX 3080 Laptop, 621.14, Windows 11 - [x] AI-assisted: yes
MarcZX10 commented 2026-11-17 23:36:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T23:36:02Z.

Review: COMMENTED


Reviewed — no blocking findings

The prepared diff and targeted source review did not establish a concrete defect, but the review is incomplete because several changed files were excluded and the test suite was not run.

What I ran

  • Inspected head a6fe48dcd1f19e5ce01d66534d294b7bc2efec0a using the pinned repo_read.py reader.
  • Read the PR description, commit list, manifest, diff, and selected source and test regions. No commands or tests were run.

Results

Check Result Note
Prepared diff inspection passed Targeted paths and hunks reviewed
Test suite not run No execution environment used
Full changed-file review not run Four changed files were excluded

Findings

Blocking

None verified.

Non-blocking

None.

Not verified

This was not a complete review. The manifest marks four files as excluded because they exceed the review-folder limit: VulkanDevice.cpp, GuestBufferMemory.cpp, Recorder.cpp, and tests/Recorder.cpp. Their targeted regions were read through the reader, but their full changed contents were not reviewed. Other included changed files were not all read. No tests were run, and author-reported test results were not independently verified.

To get this to a good state

Nothing is required. The optional point is to complete review of the remaining changed files and run the relevant checks before relying on this review as a full approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5948457365 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13863#pullrequestreview-5948457365). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T23:36:02Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The prepared diff and targeted source review did not establish a concrete defect, but the review is incomplete because several changed files were excluded and the test suite was not run. ## What I ran - Inspected head `a6fe48dcd1f19e5ce01d66534d294b7bc2efec0a` using the pinned `repo_read.py` reader. - Read the PR description, commit list, manifest, diff, and selected source and test regions. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Prepared diff inspection | passed | Targeted paths and hunks reviewed | | Test suite | not run | No execution environment used | | Full changed-file review | not run | Four changed files were excluded | ## Findings ### Blocking None verified. ### Non-blocking None. ## Not verified This was not a complete review. The manifest marks four files as excluded because they exceed the review-folder limit: `VulkanDevice.cpp`, `GuestBufferMemory.cpp`, `Recorder.cpp`, and `tests/Recorder.cpp`. Their targeted regions were read through the reader, but their full changed contents were not reviewed. Other included changed files were not all read. No tests were run, and author-reported test results were not independently verified. ## To get this to a good state Nothing is required. The optional point is to complete review of the remaining changed files and run the relevant checks before relying on this review as a full approval.
ligmaSec commented 2026-12-03 22:50:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:50:05Z.

Review: COMMENTED


The trial merge onto c1601e56d5 conflicts in device submission, recorder, storage, and runtime switches. Keep both the main-lane fallback on a device with no eligible queue and a real second-queue execution. The tests for copied writers and labels should cover cross-lane handoff, since a lavapipe run on one queue can only verify the fallback. My review is source-based.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6180014541 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13863#pullrequestreview-6180014541). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T22:50:05Z. **Review:** COMMENTED --- The trial merge onto `c1601e56d5` conflicts in device submission, recorder, storage, and runtime switches. Keep both the main-lane fallback on a device with no eligible queue and a real second-queue execution. The tests for copied writers and labels should cover cross-lane handoff, since a lavapipe run on one queue can only verify the fallback. My review is source-based. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/13863:upstream-pr/13863'
git switch 'upstream-pr/13863'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/13863'
git switch 'upstream-pr/13863'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/13863'
git switch 'upstream-pr/13863'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/13863'
git switch 'main'
git merge --squash 'upstream-pr/13863'
git switch 'main'
git merge --ff-only 'upstream-pr/13863'
git switch 'main'
git merge 'upstream-pr/13863'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!13863
No description provided.