darner-gpu: a released texture leaves no eviction record behind #609
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!609
Loading…
Reference in a new issue
No description provided.
Delete branch "qnjk/Darner:texres-released-eviction"
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
The problem on main: the texture-residency cache records why a texture was evicted by its title address (
crates/darner-gpu/src/resource/texres.rs), and nothing cleared that record when the texture went. Windows hands the same address out again, so the next texture mapped there started life already "evicted": charged to the eviction budget, skipped by the room line, and treated as a candidate for the tiny-copy path before it had been used once. The cache's own doc says an eviction is supposed to be a statement about a live texture that has not been used lately.This change tells the residency cache that the range is gone from
Drop for Resource(one call, three lines) and forgets every record of an address being released intexres. A record that is missed keeps today's behaviour, so the worst case is unchanged.How it was tested
845e093(one commit onc8258f9).cargo test --locked -p darner-gpu --lib -- texres— 22 passed, 0 failed.texres::tests::a_released_texture_leaves_no_record_behindrecords an eviction for an address, releases the resource, and asserts the record is gone; a second case asserts a record of a different address survives.cargo clippy --locked -p darner-gpu --all-targets -- -D warningspasses.cargo clippy --workspace --all-targets --locked -- -D warnings: passes.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passes.cargo test --workspace --locked: not run to completion here; the pre-existingdarner-gputest deadlock (#224) anddarner-shaderwaterfall fixture failure (#227) make the whole-workspace run non-green on this machine. The crate'stexrestests pass.Drop(if such a path exists) still leaves its record. The added cost at release was not measured.Checklist
main.main.docs/asset-policy.md(cargo xtask policy: 576 files ok).Checked for overlap
crates/darner-gpu/src/resource.rsis changed by 12 open pull requests (the release path itself is one of the most contended places in the tree); this change adds a single three-line call inDrop for Resourceand the rest is confined tocrates/darner-gpu/src/resource/texres.rs, which no open pull request touches. No open or closed issue mentions the residency eviction record.I exercised a release followed by publication of a prepared residency result at
845e093. The release cleared the record and fast marker before the publication step in both cases. The final state was:State.evictedrow restoredEVICTED_ATmarker restoredThe test-only reproducer extracts the existing publication statements into helpers and calls those helpers after the final release on synthetic textures. It fixes the order of the two operations explicitly. The exact test filter is
prepared_residency_updates_do_not_reinsert_released_texturesincargo test --locked --offline -p darner-gpu --lib.This looks like a second half of the same lifetime fix. Checking the live texture identity under
STATEbefore publishing would also cover results that finished preparing beforeDrop. Mode 3 needs that check at adoption publication as it sets the fast marker there.[pr-fix][memory] darner-gpu: a released texture leaves no eviction record behindto darner-gpu: a released texture leaves no eviction record behindTest needed — commit
845e0931; what to check:The problem on main: the texture-residency cache records why a texture was evicted by its title address (
crates/darner-gpu/src/resource/texres.rs), and nothing cleared that record when the texture went. Windows hands the same address out again, so the next texture mapped there started life already "evicted": charged to the eviction budget, skipped by the room line, and treated as a candidate for the tiny-copy path before it had been used once. The cache's own doc says an eviction is supposed to be a statement about a live texture that has not been used lately.This change tells the residency cache that the range is gone from
Drop for Resource(one call, three lines) and forgets every record of an address being released intexres. A record that is missed keeps today's behaviour, so the worst case is unchanged.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.