perf(gpu): batch independent card maintenance jobs #358

Closed
github-bot wants to merge 2 commits from github-bot/gh-358 into main AGit
Owner

@⁠krofty on GitHub · 2026-11-27 21:22 UTC · original
perf/gpu-maintenance-batches → main · +1545 −14 · 3 files · 2 commits · closed without merging

The card-maintenance path launches a compute dispatch per declared rehash or comparison span. The working RTX 3070 runtime records roughly 300 rehash and 424 comparison launches per frame. This change submits independent pieces through immutable GPU job tables and bounded descriptor arrays, reducing launches while retaining the existing hash algorithm and dirty-result protocol.

VICTORY_MAINTENANCE_BATCHES=1 enables batching; the default remains the legacy kernel. Capability checks, full shader-footprint validation, output-slot checks and writable-piece conflict detection retain the original path when batching cannot represent a phase safely. Original declared ranges and relay flag-union/readback fanout are preserved. Native dispatch and fallback counters expose what actually batches.

Job uploads, descriptor heaps, resources and pipelines remain pinned through a covering native fence. Unknown completion quarantines storage. Both paths submit the checker in a separate ExecuteCommandLists call after all producers, establishing COPY/UAV ordering and buffer state decay rather than relying on an appended list in the producer call.

Refs #335. Files: host.rs and host/maintenance.rs; asset-free regressions in host/maintenance_tests.rs.

Validation completed:

  • cargo check -p victory-gpu with and without diagnostics.
  • Eight planner/source regressions, including descriptor/group capacity splits, skew/tails, duplicate writers and exact legacy hash-body preservation.
  • Ignored native fixture passed with the D3D12 debug layer on Microsoft Basic Render Driver and NVIDIA GeForce RTX 3070. It compares full hashes and flags across COPY/UAV producers submitted without an intervening CPU wait, modes 0/1/2, output holes, short/skewed buffers, and queued immutable-storage protection behind a pending fence.
  • New modules pass rustfmt; git diff --check passes. Existing unrelated compiler warnings remain.

The first same-build fixed-world pair completed without a crash. Native maintenance launches fell from roughly 650–675 to 59–60 per frame, with one comparison phase falling back. This did not improve frame rate: last three host-meter intervals were 48.2/50.9/51.3 ms off and 57.3/50.6/51.2 ms on. Both pictures retain the expected geometry. Batching remains off; this is not a demonstrated FPS optimization or a 30 FPS result.

A follow-up also isolates opening diagnostic timestamp lists in their own Execute call, so they complete before producer lists begin; serial timing retains the prefix exactly once. Four call-boundary regressions and the WARP/RTX fixtures pass. This timing correction was added after the reported pair; its earlier GPU brackets cannot establish an exact execution saving. PresentMon observation returned no CSV, so no completed-frame distribution is available.

Draft retained for review, not promoted on performance. Writable hash-piece conflicts currently fall back for the entire phase. PR remains open and unmerged.

**@⁠krofty** on GitHub · 2026-11-27 21:22 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/358) `perf/gpu-maintenance-batches` → `main` · +1545 −14 · 3 files · 2 commits · closed without merging The card-maintenance path launches a compute dispatch per declared rehash or comparison span. The working RTX 3070 runtime records roughly 300 rehash and 424 comparison launches per frame. This change submits independent pieces through immutable GPU job tables and bounded descriptor arrays, reducing launches while retaining the existing hash algorithm and dirty-result protocol. VICTORY_MAINTENANCE_BATCHES=1 enables batching; the default remains the legacy kernel. Capability checks, full shader-footprint validation, output-slot checks and writable-piece conflict detection retain the original path when batching cannot represent a phase safely. Original declared ranges and relay flag-union/readback fanout are preserved. Native dispatch and fallback counters expose what actually batches. Job uploads, descriptor heaps, resources and pipelines remain pinned through a covering native fence. Unknown completion quarantines storage. Both paths submit the checker in a separate ExecuteCommandLists call after all producers, establishing COPY/UAV ordering and buffer state decay rather than relying on an appended list in the producer call. Refs #335. Files: host.rs and host/maintenance.rs; asset-free regressions in host/maintenance_tests.rs. Validation completed: - cargo check -p victory-gpu with and without diagnostics. - Eight planner/source regressions, including descriptor/group capacity splits, skew/tails, duplicate writers and exact legacy hash-body preservation. - Ignored native fixture passed with the D3D12 debug layer on Microsoft Basic Render Driver and NVIDIA GeForce RTX 3070. It compares full hashes and flags across COPY/UAV producers submitted without an intervening CPU wait, modes 0/1/2, output holes, short/skewed buffers, and queued immutable-storage protection behind a pending fence. - New modules pass rustfmt; git diff --check passes. Existing unrelated compiler warnings remain. The first same-build fixed-world pair completed without a crash. Native maintenance launches fell from roughly 650–675 to 59–60 per frame, with one comparison phase falling back. This did not improve frame rate: last three host-meter intervals were 48.2/50.9/51.3 ms off and 57.3/50.6/51.2 ms on. Both pictures retain the expected geometry. Batching remains off; this is not a demonstrated FPS optimization or a 30 FPS result. A follow-up also isolates opening diagnostic timestamp lists in their own Execute call, so they complete before producer lists begin; serial timing retains the prefix exactly once. Four call-boundary regressions and the WARP/RTX fixtures pass. This timing correction was added after the reported pair; its earlier GPU brackets cannot establish an exact execution saving. PresentMon observation returned no CSV, so no completed-frame distribution is available. Draft retained for review, not promoted on performance. Writable hash-piece conflicts currently fall back for the entire phase. PR remains open and unmerged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 21:23:11 +00:00
github-bot closed this pull request 2026-11-28 01:24:27 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.