PortWatch runtime ports for AMD: memory, frame pacing, and benchmark tools #22

Closed
github-bot wants to merge 1 commit from github-bot/gh-22 into main AGit
Owner

@⁠SovietBearz0r on GitHub · 2026-12-03 05:06 UTC · original
SovietBearz0r:portwatch-amd-runtime → main · +2551 −130 · 20 files · 1 commits · closed without merging

Summary

  • Add pressure-aware trimming of idle shadow snapshots, an opt-in present-queue release threshold and sparse submission refresh ranges, and guarded partial reads for dirty mips of already-uploaded single-slice 2D textures. Expose prefilled mips on 2D array SRVs.
  • Add native Sony USB/Bluetooth input, gameplay-anchored controller recording and playback, an opt-in GPU copy-back consumer probe, and a card-buffer allocation probe.
  • Add optional 256 KiB indirect scratch allocation, descriptor aging with generation checks and a Wine-only residency-wait experiment. Use the existing PowerShell launcher with -PortWatch for the combined graphics trial. The native Windows default retains residency waits, and the launcher leaves frame pacing and renderer profile selection to the caller.

Scope

Standalone against upstream main at 40b5f9c. This PR uses the upstream descriptor lock and existing launcher, adapts sparse refresh to the new incremental planner, and keeps the existing mimalloc setting and card buffer pool. The AMD integration, upload diagnostics and VIctory-xmem Windows ports are reviewed separately in #14, #15 and #16.

Validation

  • Standalone branch: locked all-target/all-feature workspace check, PowerShell parse, and diff checks.
  • Combined diagnostic build: 28 focused tests, including the RX 9070 XT probe. In that probe 64 KiB, 128 KiB and 256 KiB allocations each accounted for 256 KiB per buffer.
  • Combined diagnostic build on Windows, RX 9070 XT, Series X at native 3840×2160 with a 60 FPS cap and the constants port disabled. Approximately 14 minutes, normal exit, no logged device removal. Median of 331 gameplay windows with at least 3,000 draws was 23.5 FPS. The scene-entry hitch was 1.33 s, and four later gameplay windows contained a frame longer than 250 ms. Peak process commit was 31.0 GiB. These figures are from the integration branch and do not establish a performance delta.
  • Descriptor aging retired zero entries in that run. Its stale lookup counter included ordinary released resources. The dirty-mip path recorded no activations. Those paths remain experimental, and -More can override each switch. Physical DualSense and Proton validation are pending.
  • The repository asset-policy check flagged two launcher images already tracked on main. This PR includes source and documentation only.

Sources

Adapted from Vesper, MiniVI #330, SlaktarnVI, Foxhound, Northstar-AMD, and VIctibard. AI-assisted port and tests.

**@⁠SovietBearz0r** on GitHub · 2026-12-03 05:06 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/22) `SovietBearz0r:portwatch-amd-runtime` → `main` · +2551 −130 · 20 files · 1 commits · closed without merging ## Summary - Add pressure-aware trimming of idle shadow snapshots, an opt-in present-queue release threshold and sparse submission refresh ranges, and guarded partial reads for dirty mips of already-uploaded single-slice 2D textures. Expose prefilled mips on 2D array SRVs. - Add native Sony USB/Bluetooth input, gameplay-anchored controller recording and playback, an opt-in GPU copy-back consumer probe, and a card-buffer allocation probe. - Add optional 256 KiB indirect scratch allocation, descriptor aging with generation checks and a Wine-only residency-wait experiment. Use the existing PowerShell launcher with `-PortWatch` for the combined graphics trial. The native Windows default retains residency waits, and the launcher leaves frame pacing and renderer profile selection to the caller. ## Scope Standalone against upstream `main` at `40b5f9c`. This PR uses the upstream descriptor lock and existing launcher, adapts sparse refresh to the new incremental planner, and keeps the existing mimalloc setting and card buffer pool. The AMD integration, upload diagnostics and VIctory-xmem Windows ports are reviewed separately in #14, #15 and #16. ## Validation - Standalone branch: locked all-target/all-feature workspace check, PowerShell parse, and diff checks. - Combined diagnostic build: 28 focused tests, including the RX 9070 XT probe. In that probe 64 KiB, 128 KiB and 256 KiB allocations each accounted for 256 KiB per buffer. - Combined diagnostic build on Windows, RX 9070 XT, Series X at native 3840×2160 with a 60 FPS cap and the constants port disabled. Approximately 14 minutes, normal exit, no logged device removal. Median of 331 gameplay windows with at least 3,000 draws was 23.5 FPS. The scene-entry hitch was 1.33 s, and four later gameplay windows contained a frame longer than 250 ms. Peak process commit was 31.0 GiB. These figures are from the integration branch and do not establish a performance delta. - Descriptor aging retired zero entries in that run. Its stale lookup counter included ordinary released resources. The dirty-mip path recorded no activations. Those paths remain experimental, and `-More` can override each switch. Physical DualSense and Proton validation are pending. - The repository asset-policy check flagged two launcher images already tracked on `main`. This PR includes source and documentation only. ## Sources Adapted from [Vesper](https://github.com/monte-alt/vesper), [MiniVI #330](https://github.com/Androtim/MiniVI/pull/330), [SlaktarnVI](https://github.com/Slaktarn700/SlaktarnVI), [Foxhound](https://github.com/readmet3xt-lab/foxhound), [Northstar-AMD](https://github.com/Zetsukae/Northstar-AMD), and [VIctibard](https://github.com/saltdam36/VIctibard). AI-assisted port and tests.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 05:09:45 +00:00
github-bot force-pushed github-bot/gh-22 from 8e33803ca9 to cbe5cf4e30 2026-12-03 05:19:42 +00:00 Compare
Author
Owner

@⁠AC-Storm-YT on GitHub · 2026-12-03 22:03 UTC · original

Tested 5ccd6e4 + this PR (+ PR #9 & #11) on Ryzen 7 9800X3D + RX 9070 XT 16 GB + 32 GB RAM (+ 32–48 GB pagefile), Windows 11, Series X profile.

Performance and VRAM behavior are great (hitting 35–50 real fps), and while investigating remaining 1-frame terrain/foliage flickers using VICTORY_FLASH_WATCH=1 and flashrec, I ran a controlled bisect across switches — sharing the results here since Issues are disabled on this repo:

Controlled VICTORY_FLASH_WATCH=1 Results (RX 9070 XT)

Run / Overrides Frames Checked Flagged (w/ Veg) Terrain/Veg 0-Work Hits Still Reproduces?
Default (Fast + Stream + SoftPages) 44,361 3,774 (25) Multiple (13 pipelines zeroed on f41376) Yes
VICTORY_INDIRECT_BATCH=0; VICTORY_INDIRECT_WINDOW=0 37,219 575 (7) 11 (816 → 0 → 581, 587 → 0 → 582) Yes
VICTORY_PRECISE_BARRIERS=0 55,212 5,478 (21) 30 (414 → 0 → 334, 190 → 0 → 192) Yes
VICTORY_RELAY_COPY=0 29,360 2,539 (25) 18 (394 → 0 → 395, 275 → 0 → 275) Yes
SAFE SETTINGS (all fast/streaming opts off) 32,986 1,719 (10) 8 (1413 → 0 → 1412, 864 → 0 → 860) Yes

Key Takeaways

  • Even in SAFE SETTINGS, terrain (MS_VS_TransformTerrainNormalTint) and foliage (MS_VS_PropFoliageDeferred, VS_OctaVsplitWind) still drop to 0 for 1 frame (record 0 1 1 in copy 34).
  • On the bad frames, culling compute passes (CS_BatchCullMeshlets_Prev, CS_BatchCullPreSkinnedMeshlets*) run at 100%–103%, lists has 0 let go of unsubmitted, and records refused by budgets is 0 (0, 0).
  • flashrec diff.txt on the same build shows HZB depth pyramid jumps (10–48 tiles jumped, max delta 92–125) on every flashing frame.
  • This rules out INDIRECT_BATCH, INDIRECT_WINDOW, PRECISE_BARRIERS, RELAY_COPY, SOFT_PAGES, THIN, JOIN_PARTS, and UPLOAD_AHEAD, pointing toward the core HZB / culling / indirect sync path.
Log excerpts (Safe Settings & Default)

Safe Settings:

flash watch:   mesh MS_VS_TransformTerrainNormalTint df4b2c7798c14c90 + pixel PS_DeferredTexturedStdNC d9fcb8a4425fc59b kind 10: work 1413 / 0 / 1412, executions 98 / 98 / 98, empty 47 / 98 / 47
flash watch:   mesh MS_VS_TransformTerrainNormalTint a6a6702e5c2a8ba9 + pixel PS_DeferredTexturedStdNC 43fc2af1f70920f1 kind 10: work 356 / 0 / 354, executions 42 / 42 / 42, empty 17 / 42 / 17
flash watch:   mesh MS_VS_TransformTerrainNormalTint df4b2c7798c14c90 + pixel PS_DeferredTexturedStdNC d9fcb8a4425fc59b kind 10: work 864 / 0 / 860, executions 82 / 84 / 84, empty 43 / 84 / 45

Default (frame 41376):

flash watch:   [all] kind 2 868 / 868 / 868 (100 %) compute CS_BatchCullPreSkinnedMeshlets_Prev 0452fc2d2e2fc4c3
flash watch:   [all] kind 2 831 / 853 / 858 (103 %) compute CS_BatchCullMeshlets_Prev fc5e66f8f873d3bb
flash watch: frame 41376: 13 pipelines ran far less work than in the frames before and after (2 vegetation); lists 55 (0 let go of unsubmitted), executions not read 0, records refused by budgets 0 (0, 0)
flash watch:   vertex VS_OctaVsplitWind 4e35b816f2f91d68 + pixel PS_OctaVsplit 659fe9cae59dbd88 kind 1: work 36864 / 0 / 36864, executions 54 / 54 / 54, empty 15 / 54 / 15
flash watch:   mesh MS_VS_TransformTerrainNormalTint a6a6702e5c2a8ba9 + pixel PS_DeferredTexturedStdNC 43fc2af1f70920f1 kind 10: work 1854 / 0 / 1869, executions 77 / 77 / 77, empty 15 / 77 / 15
flash watch:   [veg] mesh MS_VS_PropFoliageDeferred adc5c689b0552cc2 + pixel PS_PropFoliageDeferredTo_GBuffer 64ea0f3428db6a24 kind 10: work 294 / 0 / 297, executions 51 / 51 / 51, empty 28 / 51 / 28

Happy to run any targeted A/B test or share flashrec diff.txt if useful!

**@⁠AC-Storm-YT** on GitHub · 2026-12-03 22:03 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/22#issuecomment-7393669189) Tested `5ccd6e4` + this PR (+ PR #9 & #11) on **Ryzen 7 9800X3D + RX 9070 XT 16 GB + 32 GB RAM (+ 32–48 GB pagefile)**, Windows 11, Series X profile. Performance and VRAM behavior are great (hitting 35–50 real fps), and while investigating remaining 1-frame terrain/foliage flickers using `VICTORY_FLASH_WATCH=1` and `flashrec`, I ran a controlled bisect across switches — sharing the results here since Issues are disabled on this repo: ### Controlled `VICTORY_FLASH_WATCH=1` Results (RX 9070 XT) | Run / Overrides | Frames Checked | Flagged (w/ Veg) | Terrain/Veg 0-Work Hits | Still Reproduces? | |---|---:|---:|---:|---| | Default (`Fast + Stream + SoftPages`) | 44,361 | 3,774 (25) | Multiple (13 pipelines zeroed on f41376) | Yes | | `VICTORY_INDIRECT_BATCH=0; VICTORY_INDIRECT_WINDOW=0` | 37,219 | 575 (7) | 11 (`816 → 0 → 581`, `587 → 0 → 582`) | Yes | | `VICTORY_PRECISE_BARRIERS=0` | 55,212 | 5,478 (21) | 30 (`414 → 0 → 334`, `190 → 0 → 192`) | Yes | | `VICTORY_RELAY_COPY=0` | 29,360 | 2,539 (25) | 18 (`394 → 0 → 395`, `275 → 0 → 275`) | Yes | | **`SAFE SETTINGS`** *(all fast/streaming opts off)* | 32,986 | 1,719 (10) | **8 (`1413 → 0 → 1412`, `864 → 0 → 860`)** | **Yes** | ### Key Takeaways - Even in **`SAFE SETTINGS`**, terrain (`MS_VS_TransformTerrainNormalTint`) and foliage (`MS_VS_PropFoliageDeferred`, `VS_OctaVsplitWind`) still drop to `0` for 1 frame (`record 0 1 1` in `copy 34`). - On the bad frames, culling compute passes (`CS_BatchCullMeshlets_Prev`, `CS_BatchCullPreSkinnedMeshlets*`) run at **100%–103%**, `lists` has `0 let go of unsubmitted`, and `records refused by budgets` is `0 (0, 0)`. - `flashrec` `diff.txt` on the same build shows HZB depth pyramid jumps (`10–48` tiles jumped, max delta `92–125`) on every flashing frame. - This rules out `INDIRECT_BATCH`, `INDIRECT_WINDOW`, `PRECISE_BARRIERS`, `RELAY_COPY`, `SOFT_PAGES`, `THIN`, `JOIN_PARTS`, and `UPLOAD_AHEAD`, pointing toward the core HZB / culling / indirect sync path. <details> <summary>Log excerpts (Safe Settings & Default)</summary> **Safe Settings:** ```text flash watch: mesh MS_VS_TransformTerrainNormalTint df4b2c7798c14c90 + pixel PS_DeferredTexturedStdNC d9fcb8a4425fc59b kind 10: work 1413 / 0 / 1412, executions 98 / 98 / 98, empty 47 / 98 / 47 flash watch: mesh MS_VS_TransformTerrainNormalTint a6a6702e5c2a8ba9 + pixel PS_DeferredTexturedStdNC 43fc2af1f70920f1 kind 10: work 356 / 0 / 354, executions 42 / 42 / 42, empty 17 / 42 / 17 flash watch: mesh MS_VS_TransformTerrainNormalTint df4b2c7798c14c90 + pixel PS_DeferredTexturedStdNC d9fcb8a4425fc59b kind 10: work 864 / 0 / 860, executions 82 / 84 / 84, empty 43 / 84 / 45 ``` **Default (frame 41376):** ```text flash watch: [all] kind 2 868 / 868 / 868 (100 %) compute CS_BatchCullPreSkinnedMeshlets_Prev 0452fc2d2e2fc4c3 flash watch: [all] kind 2 831 / 853 / 858 (103 %) compute CS_BatchCullMeshlets_Prev fc5e66f8f873d3bb flash watch: frame 41376: 13 pipelines ran far less work than in the frames before and after (2 vegetation); lists 55 (0 let go of unsubmitted), executions not read 0, records refused by budgets 0 (0, 0) flash watch: vertex VS_OctaVsplitWind 4e35b816f2f91d68 + pixel PS_OctaVsplit 659fe9cae59dbd88 kind 1: work 36864 / 0 / 36864, executions 54 / 54 / 54, empty 15 / 54 / 15 flash watch: mesh MS_VS_TransformTerrainNormalTint a6a6702e5c2a8ba9 + pixel PS_DeferredTexturedStdNC 43fc2af1f70920f1 kind 10: work 1854 / 0 / 1869, executions 77 / 77 / 77, empty 15 / 77 / 15 flash watch: [veg] mesh MS_VS_PropFoliageDeferred adc5c689b0552cc2 + pixel PS_PropFoliageDeferredTo_GBuffer 64ea0f3428db6a24 kind 10: work 294 / 0 / 297, executions 51 / 51 / 51, empty 28 / 51 / 28 ``` </details> Happy to run any targeted A/B test or share `flashrec` `diff.txt` if useful!
Author
Owner

@⁠ReTerryDavis on GitHub · 2026-12-04 02:02 UTC · original

Closing because this combines too many unrelated experimental ports and env vars into one commit that conflicts with recent main refactors and includes unvalidated paths. Please submit individual, tested PRs for standalone features (like native Sony HID input) against current main.

**@⁠ReTerryDavis** on GitHub · 2026-12-04 02:02 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/22#issuecomment-7398501468) Closing because this combines too many unrelated experimental ports and env vars into one commit that conflicts with recent `main` refactors and includes unvalidated paths. Please submit individual, tested PRs for standalone features (like native Sony HID input) against current `main`.
github-bot closed this pull request 2026-12-04 05:45:58 +00:00

Pull request closed

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