Skip to content

GPU: reuse indirect argument windows and coalesce card compares - #889

Closed
Demon12377 wants to merge 7 commits into
fxceless:mainfrom
Demon12377:perf/gpu-hot-path-validated
Closed

Demon12377 wants to merge 7 commits into
fxceless:mainfrom
Demon12377:perf/gpu-hot-path-validated

Conversation

@Demon12377

@Demon12377 Demon12377 commented Nov 25, 2026 •

Copy link
Copy Markdown

Superseded by #1001. The new proposal contains all of this PR's validated changes and repaired card hash, plus opt-in indirect-prefix batching and its GPU validation/measurement tests. Closing this duplicate proposal preserves one review target.

Interleaved indirect draws currently replace the last clamped window, and CARD_COMPARE hashes each 64 KiB piece on one lane. This retains up to eight indirect windows in disjoint scratch slices and hashes a piece with a coalesced 64-thread group.

The branch includes current main 0b0074e. Its frame log, card meter, driver-watch fallback, plain-copy path and rehash A/B mode are preserved.

Changes:

  • Add aligned scratch offsets and allocation epochs; keep replaced resources alive until reset and invalidate windows after scratch replacement/wrap.
  • Increase the window limit to 128 records. Widen only when two complete padded records fit; a short final record uses its original command-signature stride.
  • Avalanche and permute the right hash-reduction branch to prevent paired sign-bit writes cancelling. A new WARP test covers one zero page and 128 seeded pages, plus compare-and-store mode; it fails on the former shader and passes after the fix.
  • Batch upload transitions and reuse compare/fetch bindings, including the new upstream card-meter instrumentation. The new hash values differ from the serial hash, but the same shader produces and compares them.
  • Use stack buffers and reusable descriptor-table vectors; pool staging buffers up to 64 MiB within the existing 256 MiB total cap.
  • Add mapping-guarded x64 reads behind VICTORY_FAST_COPY=1, with checked VEH installation and clean failure for access violations, guard-page exceptions and in-page errors. The separate upstream VICTORY_COPY_PLAIN path remains available.
  • Preserve opt-in rollout defaults and disable windows when upstream driver-watch trips.
  • Keep the budget test's saturation/source/padding checks while accepting either GPU-group scheduling order, following Indirect test: the two groups charge the budget in either order (the test failed 5 runs in 6) #849.
  • Remove/gate unused diagnostic items and fix the sorting and new is_multiple_of lint so both Clippy configurations pass.

Validation on the synchronized tree, Windows/Rust 1.98.1, synthetic data:

  • cargo clippy --workspace --all-targets --locked -- -D warnings: passes.
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passes.
  • cargo xtask policy: 179 files pass.
  • Diagnostics victory-gpu: 191 passed, 6 ignored, 1 excluded, with WARP and D3D12 debug enabled on the current synchronized tree.
  • Earlier victory-hle validation: 98 unit tests and one integration test passed before the latest upstream affinity changes; current workspace Clippy also checks those changes.
  • Published branch tree is identical to the locally tested merge; upstream 0b0074e is an ancestor.

The excluded depth_bounds_pipeline_loads_and_filters_draws test has an inherited E_INVALIDARG failure at root-signature creation on this machine. The full workspace suite was not rerun for this sync: its GPU shader tests require Shader Model 6.6, unavailable here. No scene/visual/FPS benchmark was performed, so the PR remains a draft.

The former 6.0 -> 8.9 FPS upstream window comparison was withdrawn in 0b0074e because draw counts differed. This PR claims no game/FPS improvement.

Related overlapping proposals: #71, #154 and #867. AI-assisted code and review; validation ran locally. No game files or derived fixtures are included.

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.

1 participant