Skip to content

perf(gpu): compose quick descriptor sync with disjoint spans - #689

Merged
pragyaangaur merged 7 commits into
pragyaangaur:mainfrom
GDemay:codex/quick-sync-disjoint-integration
Nov 28, 2026
Merged

pragyaangaur merged 7 commits into
pragyaangaur:mainfrom
GDemay:codex/quick-sync-disjoint-integration

Conversation

@GDemay

@GDemay GDemay commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Integrate gdemontalivet's quick descriptor synchronization (#538) with disjoint bindless spans (#675). This companion branch can be incorporated into #538. Both switches remain opt-in and work together, including with fast census.

Resolve eligible SRV and constant-buffer data once per unique page record before taking the heap's descriptor lock. Keep the existing template and page-read batching, validate live records and view generations, and retry quick results whose shadow topology changed. Preserve ordered span endpoints and interior-edit hull generation behavior. Retire displaced arena slices with the GPU work that can still read them.

Performance

Apple M5, 24 GiB, macOS 27.0 (26A428), CrossOver Wine 11.0 via Rosetta, D3DMetal 4.0 beta 3, rustc 1.98.1, Windows gnullvm release. Upstream baseline 5b57b119c5a134e05a8990b7ea7d9247d85f49d9; measured candidate 578a18dfba33c418953075be8adfa0431e6aeb8a. Exact PR head 39ef2c0807d1aebe059dc5fa1a5ad29ad84dc569 adds test updates and formatting with the same production logic. A six-pair release confirmation on that head reduced the page median from 10.090 to 8.440 ms and the submission median from 23.625 to 20.834 ms.

Both lanes enable disjoint spans and use main's fast batched sync. The candidate enables quick sync. Medians below are from 12 interleaved fresh-process samples per lane after two discarded warm-ups. The lock, copy and RSS rows use a separate five-sample diagnostic run per lane.

Metric Before After Change
Complete synthetic submission, 23 dispatches 23.926 ms 20.445 ms −3.482 ms (−14.6%)
Heap sync phases in those submissions 10.617 ms 7.842 ms −2.775 ms (−26.1%)
Existing 1.5M-slot fast page benchmark 10.450 ms 8.500 ms −1.950 ms (−18.7%)
Heap mutex held over the page benchmark 7.310 ms 5.882 ms −1.428 ms (−19.5%)
Aggregate mutex wait, 46 uncontended acquisitions 2.4 µs 3.2 µs +0.8 µs, timer-sensitive
Descriptor creations and copied ranges, page benchmark 1,725 / 39,100 1,725 / 39,100 Same work, 46 batched calls
GPU output dwords checked, each submission sample 253 253 Same values
Peak process RSS, page benchmark 574.8 MiB 595.0 MiB +20.2 MiB (+3.5%)

Complete-submission ranges were 22.838–24.802 ms and 19.489–21.751 ms. Heap-sync ranges were 10.298–11.512 ms and 7.775–8.124 ms. Page-benchmark ranges were 10.34–10.67 ms and 8.41–8.90 ms. With quick sync off and disjoint spans on, the candidate's page median was 10.535 ms. With both switches off the separate six-pair control was 10.480 → 10.575 ms (+0.9%).

Submission timing includes preparation, queue execution and the completion fence. Pipeline initialization, list recording and readback assertions are outside that interval. Quick view data is page-local and the bindless map lives with its heap. Peak RSS includes Wine and the backend, so it does not isolate retained registry memory. These synthetic workloads do not establish in-game performance.

Verification

The D3DMetal acceptance fixture writes tracked title heap records as bytes, submits compute through the production heap sync, and checks the GPU outputs. It also checks that the quick path published resolved records when enabled. The exact PR head passed all eight fresh-process combinations of quick sync, disjoint spans and fast census, plus quick off/on with gated early sync, totaling 84 dispatches and 924 checked dwords. Fresh-process checks of the separate maps and views modes added 16 dispatches and 176 checked dwords. Coverage includes generation reuse, concurrent rewrites, raw/typed/structured/constant-buffer views, widened and aliased views, and texture and UAV fallbacks.

Run the strict fixture from a configured checkout.

WINEDLLOVERRIDES='d3d12,d3d12core,dxgi=b' \
  VICTORY_QUICK_SYNC=1 VICTORY_DISJOINT_SPANS=1 VICTORY_CENSUS_FAST=1 \
  VICTORY_RAW_STRUCTURED=1 VICTORY_SYNC_FAST=1 VICTORY_PLACED_AT_ONCE=0 \
  tools/macos/test-wine.sh --release --locked -p victory-gpu --lib \
  descriptor::host::sync_acceptance::watched_descriptor_records_reach_gpu_readback \
  -- --exact --ignored --nocapture --test-threads=1

Set each of the first three switches to 0 and 1 in fresh processes for the matrix. For early sync add VICTORY_FLIGHT1=1 VICTORY_SYNC_EARLY=1 VICTORY_PREP_AHEAD=0. Run bench_sync_slots_1_5m_fast_vs_legacy and use its fast result for page timing. Run bench_watched_descriptor_submissions with --ignored for submission timing. Build both release test binaries first, then alternate without compiling during sampling.

Exact-head local gates passed, including the native workspace (841 passed, 23 ignored), Windows-target Clippy with default and all features, the full Wine/D3DMetal workspace (705 passed and 31 ignored in the GPU unit suite), and the asset policy. The two ignored synthetic fixtures were run explicitly. The local DXGI probe did not enumerate a WARP adapter. Windows CI is the separate native Windows lane.

The exact head also passed the full GPU unit suite under Wine with quick sync, disjoint spans, and fast census enabled. The optional optimized GPU suite hit the same unrelated function-pointer identity assertion as optimized main, with quick sync both off and on. The required Wine workspace suite, the explicit optimized GPU readback fixture, and the optimized benchmarks passed.

Windows CI passed default Clippy, diagnostics Clippy, and workspace tests on the exact PR head.

@GDemay
GDemay marked this pull request as ready for review November 28, 2026 10:55
@pragyaangaur
pragyaangaur merged commit 75fa4b8 into pragyaangaur:main Nov 28, 2026
1 check passed
ZebeastSantaCruz83142069 added a commit to ZebeastSantaCruz83142069/VIctory-macOS831 that referenced this pull request Nov 28, 2026
Upstream took pragyaangaur#688, pragyaangaur#689, pragyaangaur#694-pragyaangaur#697, pragyaangaur#700, pragyaangaur#701 and new loader and HLE
switches overnight. Conflicts:

- bindless.rs: our slot vector, net range counting and timing stay;
  upstream's pragyaangaur#701 fix lives in CopySpans and merged cleanly; its heap
  walk cache (VICTORY_HEAP_WALK_CACHE) joins our uploads walk.
- host.rs: list steps timed upstream's way (refreshes and slots one in
  16); prep phases counted in nanoseconds, the flight trace's per-thread
  phases too; the frame report keeps our uploads-by-step line and gains
  upstream's evicting line.
- Our runs of table slots now ask VICTORY_SLOT_ONCE first, so upstream's
  switch reaches the batched path.
- run.rs: VICTORY_PROFILE and VICTORY_GUARD_LOOKUP both start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants