Linux experiments on top of SlaktarnVI: WC memory in VRAM (+3-6 fps), list cap 512, DirectStorage readers, guard work (results and branches) #15

Open
opened 2026-11-29 03:25:19 +00:00 by Fran-co-F · 1 comment
Fran-co-F commented 2026-11-29 03:25:19 +00:00 (Migrated from github.com)
Contributor

Imported from Slaktarn700/SlaktarnVI. Originally posted by Fran-co-F on 2026-11-29T03:25:19Z.


Thanks for SlaktarnVI. We spent a few days measuring on top of it and want to hand back what we found, good and bad. All of it is opt-in switches, off by default, on branches of a fork: Fran-co-F/SlaktarnVI (vram-wc, dstorage-workers). None of it is ready to merge as is (see "Known problems").

Setup: Ryzen 7 9800X3D, RX 9070 XT 16 GB, 31 GB RAM, CachyOS. Your S70 preset, with two differences: a self-built Wine 11.17 and a patched vkd3d-proton, both needed for F1. Same save for every run: the prison cell, plus 15-minute play sessions.

What helped

F1/F2: write-combined title memory in VRAM, in place (VICTORY_INPLACE=1 VICTORY_INPLACE_WC_ONLY=1 VICTORY_INPLACE_BLOCKS=1 VICTORY_VIEW_WC_VRAM=1, plus VKD3D_INPLACE_VRAM=1 on the vkd3d side)

  • Private memory with protect 0x400 (WC), and pure-WC view sections, get VRAM at the title's own addresses. Everything in a 32 MiB block moved to the card is placed in place.
  • A WC-only filter keeps anything the CPU reads in RAM.
static scene (prison) 15 min of play
fork as is 17.9 fps, copy-back 42 MB 16.2 fps
F1+F2 20.7 fps, copy-back 0 MB, copies 98 → 31 MB 19.9 fps (+2 to +6 in every draw bin)

The prologue cutscene goes from 19.9 to 28.7 fps.

VICTORY_LATE_WAIT_LISTS=512: the submit thread stops waiting for "lists in the air" (median 4 ms a frame, peaks up to 48 ms, down to 0), with 0 tables refused. Its work falls from about 21 to 13 ms in the static scene.

What did not help (so nobody repeats it)

  • DirectStorage workers: 48 instead of 16 (VICTORY_DSTORAGE_WORKERS, new) with VICTORY_DSTORAGE_STAGING_MB=128. Scene-cut hitches are pread latency (about 2 ms per 76 KB request, NVMe 20 % busy), not BCPack (≤1.5 workers) or staging. More synchronous readers did not clearly fix the worst windows. VICTORY_DSTORAGE_IO=overlapped|direct didn't either.
  • Guards:
    • VICTORY_PORT_GUARD=1: protect time ×4 under Wine's global virtual_mutex.
    • Coalescing VirtualProtect: blocks are isolated, 1.1-1.3 per call.
    • COPY_BESIDE/STORE_BESIDE/WRITE_SITES: about 2 ms off the submit thread, but wrong textures on screen in some combinations.
  • A prefetch of card-compare pieces for synchronous submissions (VICTORY_CARD_PREFETCH): it never triggers, because every submission with card copies is flown through the relay. The 2.3 extra waits a frame (about 10 ms) for 0.1-0.2 MB happen on the relay thread.

Known problems

  • With F1/F2: flicker in dark areas and on trees, and missing glyphs in menu text (e.g. "R i i i p t d" instead of full words). The fork as is under the same Wine looks stable.
  • In the 15-minute play session (F1+F2 + VICTORY_LATE_WAIT_LISTS=512 + 48 DirectStorage workers + 128 MiB staging, all at once), driving left textures and assets unloaded or badly loaded, and some flickered. The fork as is, driving the same way under the same Wine, did not show this. We did not isolate which switch causes it.
  • VICTORY_SKIP_VIEW_KERNEL=1 (skips GetWriteWatch calls that are refused anyway) also showed wrong textures once, so don't trust it either.
  • Needs our Wine and vkd3d-proton patches (placed maps for 64-bit). It does not work under stock Proton.

The real limit while playing

Fps tracks draws per frame (correlation −0.68): about 29 fps under 3,000 draws, 12 fps over 7,000. The street runs 6,000-14,000. Memory work moves a cost that is roughly fixed per frame, while draw translation grows. Details and the upstream discussion: Marvisak/VIctory#3703, #2586.

<!-- greyfinch-sync:Slaktarn700/SlaktarnVI:issue:6674341874 --> Imported from [Slaktarn700/SlaktarnVI](https://github.com/Slaktarn700/SlaktarnVI/issues/15). Originally posted by [Fran-co-F](https://github.com/Fran-co-F) on 2026-11-29T03:25:19Z. --- Thanks for SlaktarnVI. We spent a few days measuring on top of it and want to hand back what we found, good and bad. All of it is opt-in switches, off by default, on branches of a fork: [Fran-co-F/SlaktarnVI](https://github.com/Fran-co-F/SlaktarnVI) (`vram-wc`, `dstorage-workers`). None of it is ready to merge as is (see "Known problems"). **Setup:** Ryzen 7 9800X3D, RX 9070 XT 16 GB, 31 GB RAM, CachyOS. Your S70 preset, with two differences: a self-built Wine 11.17 and a patched vkd3d-proton, both needed for F1. Same save for every run: the prison cell, plus 15-minute play sessions. ## What helped **F1/F2: write-combined title memory in VRAM, in place** (`VICTORY_INPLACE=1 VICTORY_INPLACE_WC_ONLY=1 VICTORY_INPLACE_BLOCKS=1 VICTORY_VIEW_WC_VRAM=1`, plus `VKD3D_INPLACE_VRAM=1` on the vkd3d side) - Private memory with protect `0x400` (WC), and pure-WC view sections, get VRAM at the title's own addresses. Everything in a 32 MiB block moved to the card is placed in place. - A WC-only filter keeps anything the CPU reads in RAM. | | static scene (prison) | 15 min of play | |---|---|---| | fork as is | 17.9 fps, copy-back 42 MB | 16.2 fps | | F1+F2 | 20.7 fps, copy-back **0 MB**, copies 98 → 31 MB | 19.9 fps (+2 to +6 in every draw bin) | The prologue cutscene goes from 19.9 to 28.7 fps. **`VICTORY_LATE_WAIT_LISTS=512`:** the submit thread stops waiting for "lists in the air" (median 4 ms a frame, peaks up to 48 ms, down to 0), with 0 tables refused. Its work falls from about 21 to 13 ms in the static scene. ## What did not help (so nobody repeats it) - **DirectStorage workers:** 48 instead of 16 (`VICTORY_DSTORAGE_WORKERS`, new) with `VICTORY_DSTORAGE_STAGING_MB=128`. Scene-cut hitches are `pread` latency (about 2 ms per 76 KB request, NVMe 20 % busy), not BCPack (≤1.5 workers) or staging. More synchronous readers did not clearly fix the worst windows. `VICTORY_DSTORAGE_IO=overlapped|direct` didn't either. - **Guards:** - `VICTORY_PORT_GUARD=1`: protect time ×4 under Wine's global `virtual_mutex`. - Coalescing `VirtualProtect`: blocks are isolated, 1.1-1.3 per call. - `COPY_BESIDE`/`STORE_BESIDE`/`WRITE_SITES`: about 2 ms off the submit thread, but wrong textures on screen in some combinations. - **A prefetch of card-compare pieces for synchronous submissions** (`VICTORY_CARD_PREFETCH`): it never triggers, because every submission with card copies is flown through the relay. The 2.3 extra waits a frame (about 10 ms) for 0.1-0.2 MB happen on the relay thread. ## Known problems - With F1/F2: flicker in dark areas and on trees, and missing glyphs in menu text (e.g. "R i i i p t d" instead of full words). The fork as is under the same Wine looks stable. - In the 15-minute play session (F1+F2 + `VICTORY_LATE_WAIT_LISTS=512` + 48 DirectStorage workers + 128 MiB staging, all at once), driving left textures and assets unloaded or badly loaded, and some flickered. The fork as is, driving the same way under the same Wine, did not show this. We did not isolate which switch causes it. - `VICTORY_SKIP_VIEW_KERNEL=1` (skips GetWriteWatch calls that are refused anyway) also showed wrong textures once, so don't trust it either. - Needs our Wine and vkd3d-proton patches (placed maps for 64-bit). It does not work under stock Proton. ## The real limit while playing Fps tracks draws per frame (correlation −0.68): about 29 fps under 3,000 draws, 12 fps over 7,000. The street runs 6,000-14,000. Memory work moves a cost that is roughly fixed per frame, while draw translation grows. Details and the upstream discussion: Marvisak/VIctory#3703, #2586.
Slaktarn700 commented 2026-11-29 11:17:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Slaktarn700/SlaktarnVI. Originally posted by Slaktarn700 on 2026-11-29T11:17:40Z.


Thank you for measuring this so carefully and for listing what did not help. I checked VICTORY_LATE_WAIT_LISTS in my own logs instead of trying it: no lists were in the air there, so it has nothing to win on my PC. I will not merge the in-place WC work yet because of the flicker and missing glyphs you describe and because it needs a patched Wine and vkd3d-proton. If you find out which switch causes the missing textures, please post it here.

<!-- greyfinch-sync:Slaktarn700/SlaktarnVI:comment:7255012574 --> Imported from [Slaktarn700/SlaktarnVI](https://github.com/Slaktarn700/SlaktarnVI/issues/15#issuecomment-7255012574). Originally posted by [Slaktarn700](https://github.com/Slaktarn700) on 2026-11-29T11:17:40Z. --- Thank you for measuring this so carefully and for listing what did not help. I checked `VICTORY_LATE_WAIT_LISTS` in my own logs instead of trying it: no lists were in the air there, so it has nothing to win on my PC. I will not merge the in-place WC work yet because of the flicker and missing glyphs you describe and because it needs a patched Wine and vkd3d-proton. If you find out which switch causes the missing textures, please post it here.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Slaktarn700/SlaktarnVI#15
No description provided.