GPU: alias copies before a list's first touch go to its prelude, once per source write (VICTORY_ALIAS_ONCE=1) #1015
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/fxceless--victory-fork!1015
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1015"
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?
@shawshanker18 on GitHub · 2026-11-25 16:18 UTC · original
shawshanker18:alias-copies-once→main· +200 −2 · 2 files · 2 commits · openWhat
VICTORY_ALIAS_ONCE=1(off by default). The title writes R9G9B9E5 targets as R32_UINT and reads them through views placed in the same memory (crate::texture::alias). Every host list that read such a view copied the texture again through a buffer, even when nothing had written the source since the last copy.With the switch:
Assumption: only these copies write the placed texture's host copy (aliased views are never uploaded from title memory, see
crate::draw::readable).Measured
RTX 4050 Laptop (6 GB), Ryzen 7 7735HS, Series X, lit world, on
9376fd6plus the window, 1080p display mode, copy-queue fetch and rehash-runs switches:VICTORY_ALIAS_ONCE=1Before the switch the timing run showed 78 alias copies a frame (26-31 ms of the card's time). With it: 26 made and 20 left out a frame in preludes, the rest inline. The picture looked the same (lit prison yard, same lighting in recordings with and without).
Checks
main(3973179): cherry-picks cleanly, builds (--profile diag --features diagnostics).cargo test -p victory-gpu --lib: 175 passed, 1 failed (indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields), which fails the same way on unmodified3973179.cargo clippyreports only lints in files this PR does not touch (also onmain).No game data.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 16:23 UTC · original
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
eb0d648ℹ️ 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.
@Proudnoob4 on GitHub · 2026-11-25 17:39 UTC · original
Tested in-game on Windows 10 Pro (22H2), Intel i5-13600K (6P+8E), RTX 4080 16 GB (driver 621.01, Series X profile), 420 s run in the prison cell scene (
ca8829f+ #1014 + #1015 + #1016 + #1029 + #1032 stacked, compared against our 600 s465b94frun with the same base switches VICTORY_ASYNC_SUBMIT=1 VICTORY_QUEUE2=1 VICTORY_COPY_PLAIN=1 VICTORY_INDIRECT_WINDOW=1 VICTORY_JOIN_PARTS=1 VICTORY_BACK_OWN_VIEW=1 VICTORY_INDIRECT_GATHER=1 plus VICTORY_RELAY=2 VICTORY_LATE_WAIT=3 VICTORY_GROUP_SYNC=2 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024).VICTORY_ALIAS_ONCE=1 tail steady state in the cell scene:
AI-assisted (Gemini 4 Hydrogen).
@shawshanker18 on GitHub · 2026-11-25 19:21 UTC · original
Rebased onto
d510ee4(the conflict was inHostList::prelude; the gather records and the alias copies now both run there), and the Codex finding is fixed. Each alias mark now holds weak references to its source and placed host copies. While a mark lives, the allocation behind its address can't be freed and handed to a new copy, so a new pair can't inherit an old pair's mark. Marks of copies that are gone are swept once there are more than 4,096.cargo test -p victory-gpu --lib: 181 passed. The one failure,warp_budget_saturates_without_wraparound_and_preserves_draw_fields, fails the same way onmain.@Proudnoob4 thanks for the in-game run on the 4080: the 26 made / 20 left out per frame matches what I measured on a 4050.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 16:23 UTC · original
On
crates/victory-gpu/src/host.rsline 6367 (outdated):When
VICTORY_ALIAS_ONCE=1and aliased textures are churned, these process-global marks are never removed (texture::forgetonly evictsTHROUGH). If a new source and placed texture reuse the old addresses, the oldcopiedtimestamp can satisfylast_write < at, causing the new pair's first copy to be skipped and its view to contain stale or undefined contents. Retire marks with their resources or include a non-reused generation in the key.Useful? React with 👍 / 👎.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.