descriptor: advance RemapQueue::published when HostHeap::new takes its cursor #563
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!563
Loading…
Reference in a new issue
No description provided.
Delete branch "groster17800/Darner:pr/remap-published-on-new-heap"
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?
Refs #389
Contributor role (optional)
What it changes
The problem on main:
watch::tests::streamed_texture_written_through_an_alias_reaches_a_full_queuefails intermittently in parallelcargo test -p darner-gpu --lib --lockedruns and deterministically incargo test -p darner-gpu --lib --locked -- --test-threads=1onofficial/main(c8258f9) whenevertest_view_heapallocates at virtual addresses recently unmapped and freed by earlierwatch::tests(drop_views).HostHeap::newinitializedremap_cursortoREMAPPED.latestwithout advancingREMAPPED.published. Even ifrefresh_remappedruns before any new entry arrives, it returns early onif remapped.latest == *cursor, leavingREMAPPED.publishedbehindremap_cursor. When a subsequentRemapQueue::recordoverlaps the tail unpublished entry (or triggers full-queue unpublished compaction),RemapQueue::recordmerges the new write into that pre-heap range and overwrites itssequencewithself.latest(> remap_cursor).RemapQueue::snapshot(cursor)then returns a span that existed before the heap was created, causingHostHeap::refresh_remappedto mark unrelated placed texture slots due (causing redundant texture re-reads, not missed updates).This adds
RemapQueue::cursor(&mut self) -> u64, which setsself.published = self.latestwhenHostHeap::newtakes its initial cursor, plus a unit test (new_heap_cursor_seals_prior_unpublished_ranges_against_coalescing) covering both back-entry coalescing and full-queue compaction withoutVirtualAllocor a D3D12 device. Advancingpublishedpreserves snapshots for older heaps becauseRemapQueue::snapshotpartitions solely by*sequence <= cursor.How it was tested
149c5f4onpr/remap-published-on-new-heap(based onofficial/mainc8258f9).cargo test -p darner-gpu --lib --locked descriptor::host::tests::new_heap_cursor_seals_prior_unpublished_ranges_against_coalescing -- --nocapture:ok. 1 passed; 0 failed; 0 ignored; 1886 filtered out(0.00s)cargo test -p darner-gpu --lib --locked descriptor::host::tests::remap_history:ok. 5 passed; 0 failed; 0 ignored; 1882 filtered out(0.11s)cargo test -p darner-gpu --lib --locked watch::tests:: -- --test-threads=1:ok. 55 passed; 0 failed; 0 ignored; 1832 filtered out(1.33s; includesstreamed_texture_written_through_an_alias_reaches_a_full_queue)HostHeapinstances).149c5f4):cargo clippy --workspace --all-targets --locked -- -D warnings): passed (exit 0,74.2s)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings): passed (exit 0,57.3s)cargo xtask policy):asset policy: 576 files ok(exit 0)cargo test --workspace --locked): not run standalone on149c5f4; see the targeteddarner-gpuruns above (fulldarner-gpu --lib10x parallel + serial and--workspace -- --skip oracle64::legacy_mul_forms_are_exactwere run with PR 2 cherry-picked onto149c5f4atc52c07a).watch::tests::;RemapQueue::cursorunit test is hardware-independent.cargo testwas not run standalone on149c5f4withoutpr/gate3-watch-locks.Checklist
main.docs/asset-policy.md.Checked for overlap
🤖 Generated with Claude Code
Code review & local test verification on
149c5f4(Windows 11, Rust--locked):RemapQueue::cursor()updatesself.published = self.latestwhenHostHeap::newinitializesremap_cursor, sealing prior unpublished remap entries so later overlapping writes orREMAP_LIMITcompaction cannot advance their sequence numbers past the new heap's starting cursor.cargo test --locked -p darner-gpu descriptor::host::tests -- --skip oracle64: 94 passed, 0 failed (1ignored), includingnew_heap_cursor_seals_prior_unpublished_ranges_against_coalescing.cargo clippy --locked --all-targets -- -D warnings: 0 warnings.Tested merged onto
c8258f95(release), head149c5f4b. RTX 3090 24 GB, driver 621.24, i5-10600K, 32 GB, Windows 11.One unattended run, 60 s in the world: exit code 0, no device removed, no new kind of WARN or ERROR line compared with
main.Note: #547 and #563 seem to make the same fix (the remap cursor is published when
HostHeap::newsets it up). I tested both and saw no difference between them in this run. Only one of them is probably needed.AI-assisted testing (Claude Code, Claude Opus 5.5); results and text reviewed by me.
[pr-fix][memory] descriptor: advance RemapQueue::published when HostHeap::new takes its cursorto descriptor: advance RemapQueue::published when HostHeap::new takes its cursorView 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.