Index texture remap ranges only when an unpublished burst fills the queue #3730
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3730
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3730"
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?
@selebate on GitHub · 2026-11-30 05:19 UTC · original
selebate:codex/remap-small-batch→main· +89 −33 · 1 files · 1 commits · closed without mergingWhat it changes
Texture remaps are recorded while holding a shared mutex. When the history is full, the existing queue can drain, sort and rebuild its entire unpublished suffix for each new write. This is expensive when writes revisit distant intervals in a large batch.
Keep the deque and its adjacent-tail shortcut for ordinary writes. When a full queue contains unpublished ranges, coalesce that suffix once and index it by address. Subsequent writes merge just the touching neighbors. A snapshot publishes the burst, clears the index, and lets each descriptor heap advance its own cursor. Evicting a range still signals a full rescan to readers that missed it.
This is one commit on NVIDIA main
41adb551. The original multi-reader queue and its full-queue compaction came from #2607. The change touches onlycrates/victory-gpu/src/descriptor/host.rsand includes a synthetic regression test.How it was tested
CPU queue microbenchmarks. AMD Ryzen 9 9950X3D. Times are median milliseconds across nine rounds. The variant order rotates between rounds. “Always indexed” is an earlier local implementation applied independently to the same official source. It is included as a comparison point.
The small disjoint case took 6.9% longer than main in this run. The saturated-extension timing covers the write loop. The four batched timings include snapshots. Other build work was active during this local benchmark.
In game. Windows, RTX 5090 (driver 621.40), Series X, 3840×2160 output, DLSS Quality from 2560×1440, ray tracing and both frame generators off. All three executables used the official
playentry point with the same 48 upstream preset values and the same frozen save. Each executable warmed its own shader cache and native pipeline library from the same guest inputs. All three built 2,558/2,558 recorded host pipelines, with zero scheduled on reopen. The first full-content scan reported 196 unsupported shader translations on each build. The reopen scan of the scene's shader input reported zero.One pass per build. The window starts with the first legible “NINE MONTHS AGO” and ends with the first legible “PROLOGUE” after the restaurant. Foreground captures were taken about 1.5 seconds apart. Times use complete application-present intervals from the renderer CSV, checked against its nanosecond samples. P99 uses inclusive interpolation.
The renderer recorded 924, 858 and 873 remap writes per frame respectively in the sampled part of the scene. Parallel merge wall time averaged 2.69, 0.99 and 1.01 ms per frame. This timer includes work outside the queue. Windows returned
E_OUTOFMEMORYfor additional host pipelines created during all three runs. Available system commit fell below 450 MiB in every measured window. The candidate's longest frame increased. The scene measurements include these effects and carry more uncertainty than the isolated queue timings.Correctness. The added test exercises promotion at capacity, two readers observing the same burst, eviction, and returning to deque-only operation after a snapshot. An independent byte-coverage model also checked two readers over 4,096,000 operations per variant at eight capacities including zero.
cargo test --locked -p victory-gpu --lib remap_historypassed all three queue tests.victory-gpurun reported 922 passed, 1 failed, and 60 ignored. The failure wasshader_cache::tests::every_switch_of_the_translator_is_in_the_key, which reports that the translator no longer readsVICTORY_SCALAR_SPLITS. The same test failed on clean41adb551with the identical assertion.cargo xtask policy --staged. Full-tree policy checks on both revisions flag the same existing hexadecimal sequence incrates/victory-loader/src/heap_sites/frame_users.rs.Checked for overlap
RemapQueue, remap/texture withBTreeMap, and requeuing remapped textures. This builds on merged #2607. Open #3551 changes when drawn textures get requeued after a grace period.@dyshay on GitHub · 2026-11-30 05:49 UTC · original
Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch
janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with--profile diag --features diagnostics, and the CPU tests of the touched crates pass. A run on an RTX 4090 is queued (Series S with ray tracing, DLSS Quality). Frame times will follow here.@Dukestar69 on GitHub · 2026-11-30 06:07 UTC · original · approved these changes
Tested locally merged onto
main(41adb551).crates/victory-gpu/src/descriptor/host.rs.cargo test -p victory-gpu --lib descriptor::host::tests::passed (73 passed; 0 failed; 1 ignored, including the newremap_history_indexes_only_a_saturated_bursttest) with 0 new warnings.Clean lazy indexing for
RemapQueuesaturated bursts. LGTM.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@Freeman022026 on GitHub · 2026-11-30 13:53 UTC · original
Tested on v2026.11.29.05 (
41adb551) on the same machine (Ryzen 7 7800X3D, RTX 4090 24 GB, driver 621.14, 64 GB RAM, Windows 11, Series X profile, 2560x1440, DLSS Performance, 2x Frame Generation, RT off).In a 47-minute stock
.05run,RemapQueuefilled at 47 seconds and logged 4.05 million evictions in 12 minutes. In dense scenes (55k or more translated list calls per frame, 111 seconds), medianopening or noting guardswas 14.47 ms (max 40.9 ms),merging what was fetchedwas 7.05 ms,copying backwas 17.9 ms, and median dense frame time was 56.6 ms (17.7 base fps).In an 81-minute run with this PR applied (same 55k+ call bracket, 337 seconds), median
opening or noting guardsdropped to 1.37 ms (a 10.6x reduction) andmerging what was fetcheddropped to 2.93 ms. That build also had #2175, #3798, and the four #3809 switches enabled, withcopying backat 13.5 ms and median dense frame time at 51.0 ms (19.6 base fps). Theremap_historyunit tests pass.RemapQueue::recordburst compaction) causes 15–25× regression inopening or noting guardsand severe frame-time stutters #3666@trustno1-coder on GitHub · 2026-12-01 18:49 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed