Skip to content

GPU: arm bindless heap UAV ranges before marked copy-back - #3

Draft
Naruto334692 wants to merge 20 commits into
mainfrom
gpu/arm-bindless-uav-copyback-ranges
Draft

Naruto334692 wants to merge 20 commits into
mainfrom
gpu/arm-bindless-uav-copyback-ranges

Conversation

@Naruto334692

@Naruto334692 Naruto334692 commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Problem

Viewed::ranges() already distinguishes shader-resource and unordered-access buffer hulls, but Step::Heap refreshed both kinds identically. Unlike ordinary table/root UAVs, heap-indexed UAV ranges did not get a matching Shadow::writing(...) declaration. copy_back_marks() could therefore see a marked page while its tracker had not saved the title's pre-write bytes; copy_back_marked() then takes its documented unarmed-page shortcut and keeps the title bytes, losing overlapping GPU writes.

Change

  • Preserve the UAV flag from Viewed::ranges() through the bindless refresh callback.
  • For heap UAV hulls, call Shadow::writing before the GPU submission.
  • Use marked-page snapshots only when the actual translated pipeline supplies the VIctory write-mark table (p.marks.is_some()) and the shadow has a bitmap. A native/uninstrumented or mixed pipeline epoch uses the byte-snapshot fallback instead.
  • Aggregate write use and mark-table availability only within each refresh epoch. A later CPU/title-memory barrier cannot retroactively turn an earlier read-only heap use into a writer.
  • Keep the UAV write journal on its owning Step::Heap, not in a submission-wide map, so one command list's missed result cannot affect another list's copy-back.
  • Deduplicate heap/copy/range declarations with a hash set rather than repeated linear scans.
  • Keep SRV ranges refresh-only.

Regression coverage

  • bindless::tests::refresh_reports_buffer_view_access_kind checks SRV/UAV classification survives range merging.
  • host::batch::heap_write_usage_accumulates_only_within_refresh_epoch checks write aggregation, barrier separation, mark-table availability and per-step journal isolation.
  • bindless::tests::heap_views_are_current and heap_views_follow_writes_through_another_mapping use an uninstrumented native shader with a 128-DWORD UAV. A deferred CPU write to DWORD 100 (outside the shader's first-64-DWORD write span but inside the same tracked 64-KiB page) must survive in both host shadow and title memory; this exercises snapshot fallback rather than assuming a shader mark table exists.
  • Existing shadow::tests::marked_pages_go_back_by_the_bytes_the_gpu_changed covers the marked-page merge path.

Validation status

Windows GitHub Actions run 45597515546 passed on head 0c61426405acf34f03450508a06960add2940e5a:

  • Clippy: success.
  • Clippy with diagnostics/all features: success.
  • cargo test --workspace --locked: success; all reported test suites passed with 0 failures (some tests are intentionally ignored/filtered).

The workflow ran on the current fork main base, which matches upstream Marvisak/VIctory main at 940d32f69b22265690a0b5a15d6ded572ba33baf at the time of verification. This is CI validation only; no real GTA VI run or FPS improvement is claimed.

No game files, title binaries, shader packs or proprietary assets are included.

Combined integration check

This GPU correctness change was also combined with PR #1's unchanged-copy fast path and armed-range optimization in integration PR #4. Windows CI run 45600710813 passed both workspace Clippy passes and cargo test --workspace --locked with 0 failures. This is CI validation only; no real GTA VI hardware run or FPS improvement is claimed.

Copy link
Copy Markdown
Owner Author

Integration validation (Windows)

The combined tree with the unchanged-copy fast path and bindless heap UAV copy-back passed GitHub Actions run 45600710813 on commit 3d77d15e854d720c467aab308a8158b7bf2530b0.

  • cargo clippy --workspace --all-targets --locked -- -D warnings: passed.
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed.
  • cargo test --workspace --locked: passed; every reported suite had 0 failures, including repository_passes_policy.

This verifies the two PR changes together on the Windows CI runner. It is not a real GTA VI hardware run and does not establish an FPS gain.

Copy link
Copy Markdown
Owner Author

Synthetic WARP A/B result

The benchmark control run 45603378829 (PR #3 without PR #1) measured median preparing 306.2 ms and copy-back 162.1 ms. The combined PR #1 + PR #3 run 45602186239 measured 79.3 ms preparing and 146.4 ms copy-back.

That is about 74% lower synthetic CPU preparing time and 9.7% lower copy-back in these runs. Both used the same WARP benchmark/workload on Windows hosted runner jobs, not the same physical machine. This does not show game FPS or discrete-GPU performance; the absolute values should not be compared to title frame time.

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