perf: lazy GPU readback on guarded title pages (VICTORY_LAZY_BACK, off) #574

Merged
LooperSalty merged 5 commits from upstream-pr/574 into main 2026-11-28 09:45:03 +00:00
LooperSalty commented 2026-11-28 01:16:02 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-28T01:16:02Z.


Summary

Port of the lazy copy-back of JMAN730/victory PR #802 (fever308, GPL-3.0) onto our Vice-Tay base. In game the submit thread spends 10-17 ms a frame copying back what the card wrote (21-47 MB, RTX 4070 SUPER, 1080p): with VICTORY_LAZY_BACK=1 (off by default) a page is copied back only when the title's CPU touches it (guarded pages), and unread page versions stay on the device.

  • b10d4b31 enumerate all aliases for deferred readback (uncapped section-view lookup)
  • 06744005 defer GPU readback to guarded title pages
  • 7c925c18 retain unread GPU-mapped page versions on the device

Source: JMAN730/victory PR #802, credited per commit (Co-authored-by: fever308).

Test plan

  • cargo test --release -p victory-gpu and -p victory-hle, with the switch off and on
  • cargo xtask policy
  • CI
  • In game A/B: copying back ms per frame and fps, switch off then on

🤖 Generated with Claude Code

<!-- greyfinch-sync:LooperSalty/AnyXboxX:issue:5535278488 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/574). Originally posted by [LooperSalty](https://github.com/LooperSalty) on 2026-11-28T01:16:02Z. --- ## Summary Port of the lazy copy-back of JMAN730/victory PR #802 (fever308, GPL-3.0) onto our Vice-Tay base. In game the submit thread spends 10-17 ms a frame copying back what the card wrote (21-47 MB, RTX 4070 SUPER, 1080p): with `VICTORY_LAZY_BACK=1` (off by default) a page is copied back only when the title's CPU touches it (guarded pages), and unread page versions stay on the device. - `b10d4b31` enumerate all aliases for deferred readback (uncapped section-view lookup) - `06744005` defer GPU readback to guarded title pages - `7c925c18` retain unread GPU-mapped page versions on the device Source: JMAN730/victory PR #802, credited per commit (`Co-authored-by: fever308`). ## Test plan - [x] `cargo test --release -p victory-gpu` and `-p victory-hle`, with the switch off and on - [x] `cargo xtask policy` - [ ] CI - [ ] In game A/B: `copying back` ms per frame and fps, switch off then on 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chatgpt-codex-connector[bot] commented 2026-11-28 01:16:10 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-28T01:16:10Z.


Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-28T01:16:06.283314Z
We couldn’t complete this review. Comment @codex review to try again.
3fa09cd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7231544452 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/574#issuecomment-7231544452). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-28T01:16:10Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"3fa09cd0e3ddb145b20abbe6adbef14bce803dbf","has_any_findings":true,"has_unresolved_findings":true,"status":"failed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ❌ Failed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ❌ **Failed** <relative-time datetime="2026-11-28T01:16:06.283314Z">2026-11-28T01:16:06.283314Z</relative-time><br/>We couldn’t complete this review. Comment `@codex review` to try again. | `3fa09cd` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
chatgpt-codex-connector[bot] commented 2026-11-28 01:16:13 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-28T01:16:13Z.


You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7231544963 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/574#issuecomment-7231544963). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-28T01:16:13Z. --- You have reached your Codex usage limits for code reviews. You can see your limits in the [Codex usage dashboard](https://chatgpt.com/codex/cloud/settings/usage). To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your [settings](https://chatgpt.com/settings/code-review).
akimfomin commented 2026-11-28 01:56:20 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by akimfomin on 2026-11-28T01:56:20Z.


I compared the observable-read contract with KLBF #59 and the Vulkan image case in shadPS4 #5434. Fourteen local CPU model sequences agreed with eager readback at each CPU observation, including replacing an unobserved GPU write and preserving a neighboring page through a partial CPU write. The model bypasses D3D12 and does not establish hardware behavior. A portable extension of your opt-in tests is to leave one page unread, observe its neighbor twice, then overwrite part of the first page. Require correct bytes and report each page transfer count separately from frame gains.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7232017968 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/574#issuecomment-7232017968). Originally posted by [akimfomin](https://github.com/akimfomin) on 2026-11-28T01:56:20Z. --- I compared the observable-read contract with [KLBF #59](https://github.com/PastiiJay/klbf-lab/pull/59) and the Vulkan image case in [shadPS4 #5434](https://github.com/shadps4-emu/shadPS4/pull/5434). Fourteen local CPU model sequences agreed with eager readback at each CPU observation, including replacing an unobserved GPU write and preserving a neighboring page through a partial CPU write. The model bypasses D3D12 and does not establish hardware behavior. A portable extension of your opt-in tests is to leave one page unread, observe its neighbor twice, then overwrite part of the first page. Require correct bytes and report each page transfer count separately from frame gains.
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
LooperSalty/AnyXboxX!574
No description provided.