Place view memory above 4 GiB through renderer port 1 (VICTORY_PORT_HIGH, RDNA's PORT_BUFFERS idea) #389
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/TaynanGT--Vice-Tay!389
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-389"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@SmartIngenieriayDesarrollo on GitHub · 2026-11-27 23:26 UTC · original
SmartIngenieriayDesarrollo:port-high-above-4gib→main· +22 −2 · 1 files · 1 commits · openThis idea is XaviFortes'. VIctory-RDNA shipped it first as
VICTORY_PORT_BUFFERS(b2917b4, Nov 26). I wrote this before I found theirs. Vice-Tay doesn't have it yet, and it makes a real difference on modest PCs, so here it is for Vice-Tay's port, with my measurements.If your PC has a single memory stick, or a CPU that spends its frame copying title memory around, this is for you. Fast machines benefit too: every buffer placed in place is one the submitting thread never touches again.
Renderer port 1 (
VICTORY_PORT_CONSTANTS=1) only places title memory inside the 32-bit graphics heap. Above 4 GiB the title keeps its windows outside buffers and a good share of its buffers. Each one is a host copy that gets refreshed, uploaded and copied back at every submission that reads it.VICTORY_PORT_HIGHlets the port place that memory too, wherever it is one stretch of a section:VICTORY_PORT_HIGH=2: title buffers and windows above 4 GiB (the useful level);VICTORY_PORT_HIGH=1: windows only;0: unchanged.It is 22 lines in
crates/victory-gpu/src/port.rs, off by default.My PC is about the worst case for this layer: Ryzen 7 5700X3D, one DDR4-3200 module (single channel, ~25 GB/s), RX 7800 XT, Windows 11, Series S, first gameplay in Lucía's cell. On Vice-Tay
927da40plus a frame CSV patch:I haven't repeated an alternating A/B on current
main(0148258) yet. Level 1 alone gained nothing: the title maps its memory as about 88,000 views of 64 KiB, and none of its 815 windows (3.3 GB) is one stretch of a section.There is one difference from RDNA's version. Theirs keeps declaring GPU writes for these buffers (
Shadow::gpu_writes, a two-line change) so flight hazards stay tracked. This PR follows Vice-Tay's current rule for placed memory and adds no new waits. I saw nothing wrong in my runs, but if you'd rather have their hazard tracking, I'm happy to add it.Checks:
cargo clippy -p victory-gpu --all-targets --locked -- -D warningsis clean andcargo test -p victory-gpu --lib --lockedgives 527 passed, 0 failed (Windows 11, MSVC, the repo toolchain).cargo fmt --checkonly flags files this PR does not touch. Screenshots of the cell show no visual difference. I haven't done a full recorded review.— El_Santo
AI-assisted (Claude Code): measured on my machine, text drafted with Claude.
🤖 Generated with Claude Code
@chatgpt-codex-connector[bot] on GitHub · 2026-11-27 23:26 UTC · original · edited 2026-11-27 23:31 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
d7e5183ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-27 23:30 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
d7e5183b6bℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@ -106,3 +106,3 @@/// memory.pub(crate) fn wanted(at: u64, len: u64) -> bool {on() && at.checked_add(len).is_some_and(|end| end <= LOW && len > 0)on() && at.checked_add(len).is_some_and(|end| (end <= LOW || high()) && len > 0)@chatgpt-codex-connector[bot] on GitHub · 2026-11-27 23:30 UTC · original
With
VICTORY_PORT_CONSTANTS=1,VICTORY_PORT_HIGH=2, and asynchronous submissions enabled, newly placed shader-output buffers lose their flight hazard tracking.Shadow::gpu_writesreturns for placed memory before callingdefer_gpu_write(shadow.rs:4101–4107), sodeclared_writesandlate_blockedcannot detect those pending writes. A subsequent CPU fill, such as the constant-buffer fill recorded atdraw.rs:4257, can therefore snapshot stale or partially written bytes while the producing flight is still running; ordering the eventual GPU submissions does not protect that earlier CPU read. Retain write declarations for hazard tracking even when snapshots and copy-back are disabled.Useful? React with 👍 / 👎.
@ -118,0 +134,4 @@// Above 4 GiB: title buffers only at level 2.if !window && high_level() < 2 && start.saturating_add(len) > LOW {return None;}@chatgpt-codex-connector[bot] on GitHub · 2026-11-27 23:30 UTC · original
With
VICTORY_PORT_CONSTANTS=1andVICTORY_PORT_HIGH=2, a newly placed title buffer fails the!s.in_place()destination filter inHostList::place_copy(host/place.rs:399). Consequently,list::buffer_copyfalls back toStep::Copy, whichrun_deferredexecutes on the CPU before this submission's draws run. For a command sequence that copies A into B, draws from B, copies C into B, then draws from B again, both draws now read C instead of observing A followed by C. These high-buffer destinations previously supported GPU copies at their recorded positions. Support ordered GPU copies for placed destinations, or leave such buffers shadow-backed.Useful? React with 👍 / 👎.
@akimfomin on GitHub · 2026-11-28 00:26 UTC · original
PortBridge checked
d7e5183on current mainfe7c6e5and with the #379 alias-refresh head. Both are clean by Git. I kept XaviFortes’ original RDNA direction in the comparison. The useful decision for this PR is whether to validate window mode first and leave buffer mode for a separate run.A small synthetic regression would map an eligible window ending exactly at 4 GiB, one crossing it, and one ordinary buffer above it. Expect mode 0 to keep the old route, mode 1 to accept the eligible window only, and mode 2 to make the ordinary buffer eligible if the required section and resource conditions also hold. Write through a second alias before the read in each case. That checks the new address selection with the #379 interaction without measuring content-dependent FPS. PortBridge can capture independent results when a usable fixture and head are agreed.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.