A CPU copy of a title buffer finds the card copies that hold it by their range #543
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!543
Loading…
Reference in a new issue
No description provided.
Delete branch "EmberReD/Darner:perf/card-copies-by-range"
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?
Contributor role (optional)
What it changes
Batch::flush_copy),shadow::send_copiedcallscarded_copies(), which upgrades every copy in the card's memory (about 4,000 here) into a newVec, and then reads each copy'sstartandlento find the few that overlap the copied bytes. Each of those reads is a different heap object, so the loop mostly waits on memory. In a 30 s profile of downtown play,flush_copywas 12% of the submitting thread's samples (3,281 of 27,358): 1,587 in the collect ofcarded_copiesand 1,636 in the loop itself.What this does:
CARDEDkeeps each copy's title range beside its weak pointer:Vec<(u64, u64, Weak<Shadow>)>, filled incarded(a copy'sstartandlennever change after it is made).send_copiedscans that array under the lock and upgrades only the copies whose range overlaps the copied bytes. What it does with them is unchanged.CARDED(carded_copies,release_idle_mirrors,card_stats,idle_cpu_mirrors) read the weak pointer from the tuple; they behave as before.How it was tested
b668002(one commit on mainc8258f9). In the game: the same change on a build of mainf3840d7with other open performance pull requests merged,shadow.rsaround the change being the same as onc8258f9.flush_copywent from 3,281 samples of the submitting thread's 27,358 to 203 of 29,288.b668002(Windows 10 22H2): gate 1 and gate 2 clean. Gate 3 only for the changed crate,cargo test --locked -p darner-gpu --lib -- shadow:: host::: every test that makes a D3D12 host stops the process with code 3 ("this PC's Direct3D 12 cannot run the translated shaders: they need Shader Model 6.6"; Windows 10's built-in D3D12 in a test process), so those tests don't run here, with or without this change. The other crates don't depend on this file and were not run.DARNER_ASK_FAST=1, which does not touch this path.Checklist
main.docs/asset-policy.md.Checked for overlap
shadow.rs, none of themsend_copied,carded_copiesorCARDED.🤖 Generated with Claude Code
[pr-performance][memory] A CPU copy of a title buffer finds the card copies that hold it by their rangeto A CPU copy of a title buffer finds the card copies that hold it by their rangeTest needed — commit
b668002e; what to check:Batch::flush_copy),shadow::send_copiedcallscarded_copies(), which upgrades every copy in the card's memory (about 4,000 here) into a newVec, and then reads each copy'sstartandlento find the few that overlap the copied bytes. Each of those reads is a different heap object, so the loop mostly waits on memory. In a 30 s profile of downtown play,flush_copywas 12% of the submitting thread's samples (3,281 of 27,358): 1,587 in the collect ofcarded_copiesand 1,636 in the loop itself.What this does:
CARDEDkeeps each copy's title range beside its weak pointer:Vec<(u64, u64, Weak<Shadow>)>, filled incarded(a copy'sstartandlennever change after it is made).send_copiedscans that array under the lock and upgrades only the copies whose range overlaps the copied bytes. What it does with them is unchanged.CARDED(carded_copies,release_idle_mirrors,card_stats,idle_cpu_mirrors) read the weak pointer from the tuple; they behave as before.Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.
Reply
testingto take this run; it's free again after 24 h with no results.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.