Repository navigation
Conversation
|
Tested
No game data used. |
|
Tested in game on an RX 7800 XT (Windows 11 26200, 31.6 GB). Build: In the world (opening cutscene) frame time went from about 0.8–1.1 s without this PR to about 6 s. Copies grew from about 300–450 MB per frame to about 23 GB per frame: The world picture stays black (only the intro card and subtitles show), as without this PR. So on this title the extra copies seem to come from the refreshes the PR triggers for directly indexed SRV slots, about 25k slots a frame, not from the direct-SRV copy itself, which is only 12 MB. No device loss in about 3 minutes; I stopped the run. |
|
Thanks for the detailed A/B and conflict notes, @gw1337x. I’m tracing the gap between the 12.21 MB attributed to direct SRV refresh and the 23 GB of aggregate copying. Could you share the integration branch or exact commit SHAs for the two builds, along with the diagnostics flags you used? That will let me compare the actual conflict resolutions and counter definitions against the standalone PR. If you have the logs for both builds, the adjoining copies-per-frame line and the top copied-from ranges would also help separate deferred copies from conventional shadow refreshes. |
…ctly indexed SRVs) into the integration Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
…t copy's elements a raw view) into the integration The SRV's coherency range (PR Marvisak#185) is computed before the view is rewritten; the 16-byte raw-start check stays on the in-element path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
|
@gw1337x I pushed Could you repeat the opening cutscene A/B with |
Shader PRs 136, 163, 164, 160, 176, 193, 177, 180, 138, 139, 145, 154, 156, 157, 162, 166, 168, 169, 179, 200, 226 and 25. Marvisak#193's runtime stride table is combined with the runtime PRs: - descriptor/host.rs keeps Marvisak#135's retire-on-keep, dynamic pool and sampler cap, Marvisak#185's Slots (made + directly indexed SRVs) and Marvisak#206's raw fallback for structured views off their host copy's elements. The stride table still holds the title view's element stride: a raw view made by Marvisak#206 starts at the same byte (raw_window never rounds), so the shader's index * stride + offset reads the same bytes. - Slots Marvisak#193 did not know about now write their stride: a directly indexed SRV (Marvisak#185) when its record changes, and make_null_kind's typed null views (0). - draw.rs keeps bind() returning whether it bound (with the stride table root SRV set inside it) and the bounded indirect argument copy. - pipeline/host.rs keeps the per-stage subobject stream; the stride table root parameter merges cleanly. - depth_bounds_test's HostShader gains stride_table: false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
|
In-game numbers from NVIDIA with
So on this card, at AI-assisted (Claude Code). |
|
@ChruutvoLuzi Thanks for running this comparison and sharing the direct SRV counters. The current head still has a scalability regression. Your data shows that descriptor enumeration and the subsequent range refreshes need investigation. The time until device removal increased, and the completed frame count was comparable. Could you share the full copy and |
|
A/B on NVIDIA, as asked, plus what removed most of the remaining cost on this title. Setup: RTX 2070 SUPER (driver 596.49), Ryzen 7 5700X, 48 GB, Windows 11 26100. Diagnostics build (
On this title
The measured build also write-watched the title's own With these, Tests: all of Existing assertions changed, and why:
Not measured here: AMD/WARP, Linux/Wine. The GPU device hang on this title (DXGI_ERROR_DEVICE_HUNG a few minutes into the world) happens with and without this PR. AI-assisted (Claude Code); I reviewed and ran it as described above. Diff against
|
|
@EricPlayZ Thanks for the controlled NVIDIA comparison and for posting the implementation. Your partial-page, split-allocation, and reserved-hole findings give us concrete cases to test against the draft. I’ll credit your findings and any code we bring in. Could you share a fork branch or commit for the posted diff and the exact commit stack used for the run with #202? That would let me verify the patch and measure the changes separately. I’m checking partial commits within a 64 KiB tile, transitions from populated memory to holes, and pending GPU writes on AMD, NVIDIA, and WARP before integrating. |
|
Branches on my fork:
What
The The runs were NVIDIA only. I have not tested partial commits inside a 64 KiB tile or populated-to-hole transitions beyond the unit tests listed above (a hole committed later; a remap marking pages written). |
|
AMD + Windows 10 data point for @EricPlayZ's diff, as the comment above asked ("Not measured here: AMD"). Short version: the write-watch cost went down as described, but frames did not get faster here, and the copy volume the frame line reports went up. One run, with caveats below. Setup: Windows 10 22H2 19045.7846, RX 9070 XT (driver 32.0.32015.7029), Ryzen 9 9900X. Base Steady world frames, from the runtime's
So the change does what it says for write-watching (about 12× more queries, each far cheaper, about half the time), but here the bytes copied per frame grew 5–10× and the frame got slower. My guess, not checked: the whole-page rounding ( Caveats: one run each, and the two runs were at different moments (the summary I compared shows 202 submissions per frame in the base run, 22.7 in this one), so this is a direction, not a measurement. I didn't run without the diff (#185 + #202 alone), so I can't separate the diff's effect from #185's. Happy to run that A/B, or with a diagnostics switch you'd like, on this machine. No game data used. AI-assisted (Claude Code); I played the runs, and the logs were read with the model. |
Cache stable descriptor ranges and narrow refreshes to shader-proven slots while retaining the unrestricted dynamic fallback. Keep watched subranges current without widening ordinary reads or crossing pending GPU writes. Adapt EricPlayZ's reservation splitting and hole-handling correction. Preserve live watch coverage on partially committed pages and invalidate old generations on supported guest allocation and remap operations. Co-authored-by: EricPlayZ <EricPlayZ@users.noreply.github.com>
|
Thanks, @EricPlayZ, for isolating the three refresh costs and sharing both branches. I kept your original commit intact on a local test branch. The draft revision On the matched AMD fragmented fixture, @EricPlayZ @ChruutvoLuzi @GamingRipperDoc, could one of you please run another controlled in-game A/B with |
|
@aycow Queued: a matched warm-cache Proton A/B on my RX 9070 XT, same stack, scene and frame window, toggling only |
The CPU may change constants inside a broad UAV declaration during submission preparation. Refresh them before GPU execution and keep an accurate copyback baseline. Reported-by: Kevin Pratap Sidhu <pratapkevin8@gmail.com> Reference: KevinPratap@7a03753
|
The synchronous branch now snapshots UAV-declared ranges after conventional and direct SRV preparation in f173d36. Credit to @KevinPratap for isolating the failure in #1322. In the recorded→submit test, the CBV/direct SRV readback changed from 11/13 to 43/43. It still returned the GPU write of 77 and preserved a later CPU write of 61. The focused case plus the coherency and shadow suites passed with full GBV on AMD Radeon Graphics, RTX 5070 Laptop and WARP. Both workspace Clippy configurations passed. @pablogonz12 thanks for the public refs. I compared f9a8032 with 02a59cc and 20ff80e. Your corrected composition avoids bridging the distant requests while sharing observations across copies. This branch retains exact requested byte intervals; it does not import the #393 integration merge. The queued warm Proton A/B against 20ff80e remains useful for the sparse-range change. Please identify f173d36 separately if you also A/B the UAV correction. No title performance result is established here. |
A page only partly inside a requested range was copied in part and never marked as copied, so every later range in the same page copied it again. With many small, unaligned ranges in the same pages (directly indexed SRVs in Marvisak#185, close to a million per world frame) this came to about 11 GB of copies per frame. Widen each range to its first and last pages' bounds (within the buffer) when no pending range overlaps what that adds, so the page is marked and copied again only after the title writes to it. Next to a pending range the old behaviour stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I checked the latest #595 7465030 against f173d36. The current #185 keeps the submission lock through direct refresh, the UAV snapshot, fence wait, and copyback. Individual slot locks are released after descriptor metadata is collected, so retaining the backing Arc does not freeze the native slot or the bytes a queued reader will see. The fix needs to select the latest generation at submission, retain that native slot and protect the refreshed backing span through the fence. Any blocking path needs to drop the shader-heap registry lock before waiting so lease retirement can make progress. No branch or draft change. The matched warm-cache preparation comparison and async ownership remain the two separate checks. AI-assisted using Codex. |
|
Not run yet: the matched warm-cache A/B you describe (only |
Keep the requested union through pending and completed preparation. Leave dirty gaps for later readers and retain one inline range for the common case. Reproduces the copy amplification reported by pablogonz12 on Marvisak#185 (Marvisak#185 (comment)) and carries forward the range behavior from 20ff80e on the current unified journal.
Adapted from Aydan (aycow) in Marvisak/VIctory#1818. Thanks to pablogonz12 for the original reproduction in Marvisak/VIctory#185.
Keep the union of overlapping and adjacent refresh ranges per shadow. Cover range normalization with CPU unit tests and preserve the WARP readback regression. Adapted from Aydan (aycow) in Marvisak/VIctory#1818. Thanks to pablogonz12 for the original reproduction in Marvisak/VIctory#185.
Keep the union of overlapping and adjacent refresh ranges per shadow. Cover range normalization with CPU unit tests and preserve the WARP readback regression. Adapted from Aydan (aycow) in Marvisak/VIctory#1818. Thanks to pablogonz12 for the original reproduction in Marvisak/VIctory#185.
Part of #32 (VIwork port). Adapted from Aydan (aycow) in Marvisak/VIctory#1818. Thanks to pablogonz12 for the original reproduction in Marvisak/VIctory#185. (cherry picked from commit 0d22b3808d0e5413dd845c771de5d6977cfbdc20) (cherry picked from commit 3cd984de3a3d6fc31e983e8120f941f5d6ad3565)
Keep the union of overlapping and adjacent refresh ranges per shadow. Cover range normalization with CPU unit tests and preserve the WARP readback regression. Adapted from Aydan (aycow) in Marvisak/VIctory#1818. Thanks to pablogonz12 for the original reproduction in Marvisak/VIctory#185.
Adapted from Aydan (aycow) in Marvisak/VIctory#1818. Thanks to pablogonz12 for the original reproduction in Marvisak/VIctory#185. (cherry picked from commit 0d22b3808d0e5413dd845c771de5d6977cfbdc20)
Status
The prior draft head
a6367baintegrated desplmfao's Wine fix and cross-shadow batching, preserving original commits9e94c21and9131c10. The same-reservation fallback check and PR description also credit desp's per-allocation and never-committed handling from #515 that informed481fb1a.Cross-shadow batching
The combined tree passed 16 selected tests each on AMD Radeon Graphics, NVIDIA RTX 5070 Laptop and WARP with Agility SDK 1.620.2, the D3D12 debug layer and full GPU-based validation. Separate deterministic checks passed with batching both enabled and disabled. They cover older journal readers on overlapping shadows, pending GPU writes and copyback, reservation recommit, and observing a post-sample write in the next refresh.
On desplmfao's Proton workload, write-watch time was 776 ms on
1efd438, 662 ms after the Wine fix, and 22 ms with both changes. Frame time stayed within run-to-run spread. In separate AMD Windows synthetic runs, host preparation per 80 submissions was 3.061 → 1.344 ms for dense views, 3.205 → 4.119 ms for sparse views that fit one shared span, and 3.313 → 3.581 ms for gapped views that fell back. Exact-head title validation and a matched Linux preparation breakdown remain open. Synthetic methodology and profiling branch · Review testsA later matched warm-cache RTX 5080 Proton run toggled only shared spans on the same binary. Sharing reduced write-watch queries from 111,891 to 3,650 and watch time from 684 to 23.1 ms per world frame. Direct-SRV preparation was 2,391 → 2,052 ms and submission preparation was 2,439 → 2,350 ms. Frame time was 2,800 → 2,700 ms, alongside about 10% fewer direct ranges, so the run leaves overall frame-time impact unresolved. The contributor is profiling reservation lookups separately. Matched Proton report
The subsequent reservation-cache draft attributes roughly 1.8–2.3 s per sampled Proton world frame to reservation queries. Its locked per-pass cache produced a small preparation difference in the short runs. The cross-frame version still needs an ownership proof for commit state. An independent synthetic review observed a cached zero committed count after a native commit and before its mapping notification, while a fresh query saw 65,536 committed bytes. The draft remains separate. A separate diagnostics-only fixture tested the contributor's mapped-view hint without caching commitment or bypassing per-shadow refresh. For two learned mapped views and one private reservation, native Windows reservation queries fell from three to one. A same-address remap and an injected stale hint both preserved the refreshed bytes. There is no Proton timing result for this hint. Reproduction and coordination
Independent in-game A/B on
1efd438The testers held their respective stacks, settings and inputs fixed across
53e36e7plus #202 compatibility and1efd438. These results compare revisions of this PR.The AMD baseline contributed one comparable steady window. The NVIDIA run had one sample per build and differed in submissions per frame. Both reports still ended in device removal. GamingRipperDoc independently ran 78 Windows 10 tests with app-local Agility enabled, including the two binding regressions, and 77 with it disabled. AMD and Windows 10 report · NVIDIA report
On the fork PR's RTX 5080 Proton stack, the Wine fix reduced watch calls from 147,000 to 116,000 per frame. Its 2.9 to 2.6 s frame interval was within run spread. The combined revision passed the synthetic direct-SRV suite on AMD Radeon Graphics, RTX 5070 Laptop and WARP with Agility SDK 1.620.2 and full GPU-based validation, plus the Windows private/mapped-reservation classification tests. Exact-head title and Wine retests remain open. Wine test and measured stack
Earlier implementation and synthetic results
EricPlayZ identified three amplification mechanisms in the NVIDIA run and supplied the original implementation. His clean commit was kept with its original authorship on the local test branch, and the draft revision credits him as co-author. The two linked branches were compared against
c6bf7df. The measured stack was used to verify the configuration, including PR #202 and its local allocation, shader, and title changes. Performance report · Clean commit · Measured stackChanges in
53e36e7VirtualAllocorVirtualFreecalls change the backing pages. The allocation wrappers preserve flags andLastError.Synthetic performance
AMD, 320 submissions with four lists each. The stable heap contains 8,192 live descriptors and 1,024 merged ranges per submission over 128 MiB of title memory. It models 2,621,440 slot visits, 327,680 range visits, and 21.46 GB of logical direct requests. The fixture checks the shader result, pending GPU copybacks, committed data, and hole contents.
c6bf7dfc6bf7df+ #2020dd303b0dd303b+ #202Fully mapped baseline and clean-patch times are medians of three. Fragmented and revised timings are single samples. Fragmented preparation fell from 17.392 s at
c6bf7dfto 3.307 s in the revision. Repeated zero fills fell from 9.87 GB to zero. Composing the latest revision with #202 in a scratch worktree produced identical bytes and outputs and took 4.163 s in one fragmented sample. #202 substantially accelerated the original sparse fallback. PR #202Once the heap cache was warm, unrestricted indexing did zero repeated slot enumeration or sorting in this fixture. A separate fixed-slot control visited 320 slots across 320 submissions and filled 20.97 MB. The unrestricted mapped case still fills 10.42 GB where ordinary CPU memory has no dirty signal. Fragmented ranges still require 545,280 instrumented write-watch queries in the instrumented fixture, 327,040 failed bulk-read attempts, and mapping checks. The in-game cost of those paths remains to be measured.
Correctness and validation
19when the title wrote500to a committed 4 KiB island following a reserved prefix within a 64 KiB tracking page. The revised regressions exercise this layout and verify that a clean watched refresh retains live bytes without recopying holes.Exallocation APIs and deferredMEM_RESETdiscards are outside the guest notification path. PR #261PR #393's conventional batching and mapped guard fast path are complementary. PR #420 tracks selections for rebuilt root descriptor tables. This revision's completeness proof concerns emitted resource-heap handles. Both upstream patches and the measured title stack remain separate. PR #393 · PR #420
The next in-game comparison should hold the integration stack, title scene, and timing options fixed. Please include completed frames before any device removal, submission and heap counts, direct requested and filled bytes, and the top refreshed ranges.
AI-assisted with OpenAI Codex.
Earlier results through c6bf7df
Reproduction
VIctory schedules shadow-buffer refreshes for known vertex, index, root, and conventional table bindings. A shader can select a directly indexed heap slot without going through those paths. In a synthetic Shader Model 6.6 test on upstream
35b054e, the real VIctory descriptor and shadow path returned13after the title CPU changed its value to500. The patched path returned500with the same recorded list and descriptor. A separate fixed-index test covers the first use of a descriptor that has never gone through a conventional table.Implementation
Validation
cargo test --workspacecargo clippy --workspace --all-targetscargo fmt --all -- --checkcargo xtask policyandgit diff --checkDXC-compiled synthetic tests ran on AMD Radeon Graphics, NVIDIA GeForce RTX 5070 Laptop GPU, and Microsoft WARP. Each adapter reported Shader Model 6.6 and passed all five functional regressions. AMD also passed all five without diagnostics and ran the benchmark. A temporary local adapter selection forced the NVIDIA device. See the performance follow-up for the current debug-layer and GPU-based validation results.
Synthetic AMD benchmark
64 submissions with a one-million-slot heap, 1,024 populated overlapping SRV slots over 32 shadows, and one CPU-dirtied 64 KiB page per submission.
35b054eThe patched run visits 1,024 slots and merges them to 32 ranges per submission. A follow-up clean submission copies zero bytes. For 1,024 populated slots, the estimated metadata and peak snapshot payload total about 72 KiB, before tree and allocator overhead. This is a payload estimate rather than a process memory measurement.
Performance follow-up
The follow-up is
c6bf7df. On83963c5, the 12.21 MB attributed to direct SRVs is already included in the 23,025.1 MB aggregate. The aggregate also includes conventional shadow fills and requested lengths for deferred CPU copies and upload fills. The aggregate measures software-accounted logical bytes. Snapshots contribute to overall submission preparation, while texture operations and post-fence copyback have separate counters. Contributor A/B reportAn end-to-end AMD test confirmed one way a small direct refresh can produce substantial conventional traffic. The direct SRV read four bytes from an ordinary private reservation adjacent to a 16 MiB write-watched reservation. Both views used the same native shadow. The failed write-watch probe previously disabled tracking for the entire shadow, so later clean conventional ranges copied in full. The correction keeps the fallback local to the affected pages and preserves the fast path when an initially unclassified shadow fits in a single committed private region. It retains dirty-page tracking, pending GPU writes and the existing copyback behavior. Diagnostics now report conventional requested and filled bytes, allocation and watch activity, snapshots, copyback, and descriptor materialization. The top conventional ranges include failed probes for the same shadow.
The larger AMD fixture uses a 262,144-slot heap, 24,576 populated slots over 192 shadows, four lists per submission, and 1,920 dispatches per 12-submission sample. It revisits 294,912 slots and 221,184 merged ranges per sample. The mixed clean/dirty samples filled 145.9/147.2 MB on both builds, with 84.6/85.4 MB conventional and 61.3/61.8 MB direct. Preparation measured 390.8/394.0 ms before and 380.3/370.2 ms after in single samples. Clean all-watched submissions filled zero bytes. All-unwatched samples filled 291.9 MB on both builds. The warmed control with direct refresh scheduling omitted filled 84.6/85.4 MB and retained stale direct data after a CPU write. Both builds allocated 24 MiB of native shadows during setup. Timed native shadow allocations were zero.
AMD Radeon Graphics, NVIDIA RTX 5070 Laptop GPU, and WARP each passed the five original correctness tests and the new mixed-reservation regression with the D3D12 debug layer and GPU-based validation with resource-state tracking active. We used an app-local Microsoft Agility SDK 1.620.2 test build. The allocation, watched-range, and benchmark measurements above are synthetic. With
VICTORY_PC_DXCset, runcargo test -p victory-gpu --features diagnostics directly_indexed_srv_unwatched_range_preserves_watched_refreshes -- --nocapture --test-threads=1for the focused case. SetVICTORY_COH_MIXED_BENCH=1and filter todirectly_indexed_srv_mixed_heap_benchmarkfor the larger fixture.The reviewed diffs cover post-fence copyback (#124), profiling (#130), draw admission and resource retirement (#135), and null texture UAVs (#205). We reproduced the three conflict locations with #135. The correction's standalone branch merges cleanly with #124. The contributor's resolved integration and its detailed logs are still needed to measure how much of the 23 GB came from this mechanism. The broader benchmark retains direct scan and unwatched-range traffic.
Scope
Directly indexed UAV write detection and copyback, direct CBVs, and coherency between distinct native shadow resources for aliased title memory remain separate work. The patch reuses existing buffer dirty tracking and leaves native resource-state handoffs to producers. The GPU ordering test uses an explicit copy-to-SRV transition. Existing workspace coverage exercises physical-page remapping, while the new GPU fixtures cover ordinary and write-watched allocations. Title behavior and any connection to issue #71 remain unverified.
AI-assisted with OpenAI Codex.
Current main integration and preparation
68c8f20preserves desplmfao's exact4740e19merge from fork #4 ontoffe310e. The subsequent change names an existing worklist type for strict Clippy. Both workspace Clippy configurations passed. On the contributor merge, AMD, NVIDIA, and WARP each passed eight focused shader readbacks with full GPU-based validation, a coherency bookkeeping check, and the binding/runtime checks. The later fork-tip shader handle typing change has its own scope.Native Windows, AMD Radeon Graphics: five alternating fresh processes per allocation mode, debug build with validation off, 12 submissions and 1,920 dispatches per phase. Each phase visited 221,184 direct ranges. All readbacks matched.
Clean direct-SRV timing includes building the range cache. The dirty phase reuses it. This comparison changes allocation types on the same commit and preserves the shared-span setting.
On the contributor's stock Wine server, the separate earlier lookup measurement was 2.3 s to 0.9 s with the view cache. On the patched Wine server, the cache comparison measured 46 to 26 ms per world frame in reservation queries. The two patched runs had 584 and 2,270 median draws per frame, so frame-time and cross-server comparisons are unresolved. The rebase keeps the existing live checks and leaves the fork #3 cache separate. Contributor Wine measurements
Disjoint conventional refreshes
20ff80ecredits pablogonz12's report and keeps exact disjoint ranges through readiness and refresh. Only overlapping or touching requests for the same native shadow coalesce. Larger grouped write-watch observations can still be shared. The unrequested dirty gap stays available for a later reader.The 174 MiB synthetic sparse case copied 182,452,224 bytes on
68c8f20and 131,072 bytes on20ff80e. On native Windows AMD, five alternating optimized runs with validation off put median CPU preparation at 19.387 and 0.038 ms, respectively. GetWriteWatch calls were one and two. Dense access copied 174 MiB with one query on both paths, with medians of 20.037 and 20.414 ms. AMD, NVIDIA and WARP passed full GPU-based validation for this fixture and the existing overlapping-shadow, pending-write, remap and partial-reservation cases. Both strict workspace Clippy configurations passed.The contributor's exact
02a59ccand integration tip are still requested for source comparison. ReportCPU updates inside UAV-declared ranges
The synchronous branch snapshots UAV backing after conventional and direct SRV refreshes finish. The synthetic regression covers title data written after recording, a real GPU write, and a separate late CPU write. CBV and direct SRV values recovered from 11/13 to 43/43. Values 77 and 61 survived GPU copyback and the later CPU write. The focused case, coherency suite and shadow suite passed on AMD Radeon Graphics, NVIDIA RTX 5070 Laptop GPU and WARP with full GPU-based validation. Workspace Clippy passed with default and all features.
Credit to Kevin Pratap Sidhu for the original investigation and synchronous main fix. Earlier in-flight reads/writes require separate fence ownership in #595. Matched Proton and title material retesting are pending.