WIP: Reduce texture queue work for held slots #539
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!539
Loading…
Reference in a new issue
No description provided.
Delete branch "holoslicer/Darner:perf/skip-inactive-texture-wakes"
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?
All 36 CPU queue snapshot comparisons agree. This remains a draft. The full workspace hit a worker-pool assertion, and a separate package-level run produced one wrong texture selection in the GPU readback test. Tested on Windows 11 x64 with an Intel Core i7-12700K. Gameplay, texture appearance, and frame rates were outside this comparison.
Contributor role (optional)
Fluxer ID
1577921940104949761.What it changes
The texture queue gathers eligible slots while holding a lock shared with descriptor writers. On main, the flat queue checks a hash map for future writes and the indexed queue visits held entries even when no shader feedback is available and the held census is off.
Choose the wake path once per snapshot. The index can skip its held map when neither feedback nor telemetry needs it. The flat queue records whether the current write is held in the entry flags, so it can check eligibility and count current holds in the same scan. Replacing a write or releasing a hold clears that bit. When feedback history exists, each wake still checks the latest completed sample. No configuration default changes.
How it was tested
Compared main
c8258f9withc7f3bb1. Synthetic writes filled a 32,768-slot queue. I measured the production snapshot function with reusable output vectors, using the same allowed logical processor. Four launches per revision in A/B/B/A/B/A/A/B order, seven timed batches of 64 snapshots per launch. Values are median microseconds per snapshot. The benchmark excludes GPU upload, descriptor allocation, lock contention and game frame time.All 36 before/after pairs produced the same census, ordered fresh/recheck slot versions, and checked metadata within each storage layout. The three feedback cases were marks off, marks on before buffer initialization, and a completed synthetic readback marking every eighth slot. Each was tested with the census both on and off and with zero, 4,096, or 24,576 held slots.
To reproduce the off case, append the module below to
crates/darner-gpu/src/descriptor/host.rson each revision, setDARNER_SAMPLED_MARKS=0, then runcargo test --locked -p darner-gpu --lib --config 'profile.test.package.darner-gpu.opt-level=2' offline_queue_snapshot_measurement -- --ignored --nocapture --test-threads=1. For the active feedback comparison I fed synthetic words to the ordinary readback history at frame 40 and checked the additional eligible slots and adjusted held census.Reproduction fixture using synthetic texture slots
On
c7f3bb1, both workspace Clippy configurations (all targets, default and all features, warnings denied) andcargo xtask policypassed. The first workspace run stopped at the worker-pool testnested_wide_each_scoped_handles_overflow_concurrency_and_panicswithowner panic did not unwind. I also found that assertion in a pre-existing workspace log from a different PR. This patch leavesshadow.rsbyte-identical to main. A complete retry in a fresh test directory usingcargo test --workspace --offline --locked --no-fail-fast --config 'profile.test.package.darner-shader.opt-level=3' -- --test-threads=1reported 3,520 passed, 1 failed and 121 ignored. The same worker test failed on the retry. The texture tests and exhaustive shader arithmetic oracle passed. In separate serial GPU-library runs using package-default features, official main had 1,805 passed and 0 failed, and this revision had 1,803 passed and 3 failed. With the workspace’srecordfeature on official main, 1,823 passed and 0 failed.The three failures in the first candidate package-default GPU run were the worker-pool assertion,
a_capped_draw_waits_once_then_drops, andstreamed_texture_written_through_an_alias_reaches_a_full_queue. In the last test, page 0 selected slot 2, showing 0/1,024 expected pixels, and the queue had 8,194 entries instead of 8,193. Both workspace runs passed that texture test. Repeating the entire package binary in a new process passed 1,805 tests, including the texture and pipeline cases, and failed only the worker assertion. Six fresh-process readbacks across main and the candidate had the expected 1,024/1,024 pixels on both pages. Five runs with the 55 neighboring texture-watch tests also passed. The cause of the larger suite’s mis-selection is unresolved.A private test-only trace recorded which remap range requeued slots 0–2. The individual test and two complete package runs returned the expected pixels on both pages. The trace showed exactly one target requeued on each remap, slots 0 then 1, and slot 2 kept its original generation. One instrumented suite passed all 1,806 tests, and the other passed 1,805 with one failure in
ask_once_delta_reask_direct_carves_refreshes_and_updates_page_epochs. There is still no trace of the failing selection. The instrumentation is outside this PR.Checklist
Checked for overlap
WIP: [pr-performance][rendering][memory] Skip held texture lookups when shader marks are offto WIP: [pr-performance][rendering][memory] Reduce texture queue work for held slotsI’m investigating the worker-pool assertion and the extra texture slot using deterministic schedules and synthetic journal writes. I’ll keep this PR in draft while testing and post the controls and observed outcomes here. #542 also reports a full-suite failure of the alias test on an app-only change, but its report does not identify which slot was selected.
Both previously intermittent failures now have deterministic reproductions on upstream main
c8258f9. I am keeping this PR in draft.c7f3bb1+0ea931e+aaf411c) passed the complete serialdarner-gpulibrary suite with therecordfeature, 1,826 passed and 81 ignored. A separate run with just the cursor fix passed both regressions and the ordinary GPU readback but faileda_capped_draw_waits_once_then_drops, which passed in a fresh process. The capped-draw timing test is separate from these two regressions.These results concern queue correctness and test scheduling. Gameplay frame times and FPS were outside this pass.
WIP: [pr-performance][rendering][memory] Reduce texture queue work for held slotsto WIP: Reduce texture queue work for held slotsView 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.