RX 9070 XT + Ryzen 5 5600X: test notes (VICTORY_GPU_UPLOAD hangs, a DirectStorage read failure, a progression blocker) #211

Open
opened 2026-11-26 03:38:02 +00:00 by github-bot · 5 comments
Owner

@⁠lorddie on GitHub · 2026-11-25 23:35 UTC · original

Thanks for this fork; on my RX 9070 XT it is the best result so far. Notes from one evening of runs, in case they help. I have only release-build logs, so I have no breadcrumbs for the hangs.

Machine: RX 9070 XT 16 GB (Smart Access Memory on), Ryzen 5 5600X (6 cores), 32 GB RAM, Windows 11 26200, Series X profile, VICTORY_HAIR=1. Builds: 000ffdd4 and later 4f62c2a5.

1. VICTORY_GPU_UPLOAD=1: smoother, but the device hung twice. With it (gpu_upload=true in the log) the stutter went away: the worst frame went from 579 to 187 ms, and "on the GPU" went from about 21 to 2 ms per frame. But both runs with it on ended in 0x887A0006 (device hung): one after about 3.5 minutes in the world, one after about 25 minutes during the boat mission. Five runs without it, about 80 minutes in total, had no hang. With it on, the skin and tattoo noise on people also comes back: always without commit a208d61d from #139, now and then with it. I would keep it off by default.

2. DirectStorage: an uncompressed read straight into guarded title memory can fail. On myokex/victory-amd (070df42), twice at about 4 minutes in: dstorage: request failed: copying options=0x0 ... hr=0x800706f8 (ERROR_INVALID_USER_BUFFER), and about 0.25 s later the title stops on its fatal-error int3 at +0x22106e0 (called from +0x2219650). It looks like a guard set again while the kernel read is in flight. This fork has the same into_destination(... read_into ...) path for options == 0. I did not see the failure on this fork, because I patched it first. The patch reads into a buffer of ours and then copies, so the write goes through the guards like the title's own writes (fxceless/victory-fork reads into a separate buffer first in the same case):

let size = request.source_size as usize;
let mut data = vec![0u8; size];
read_into(request, &mut data).map_err(|hr| fail(hr, "reading"))?;
return into_destination(request, size, |out| {
    out.copy_from_slice(&data);
    Ok(size)
})
.map_err(|hr| fail(hr, "copying"));

3. A progression blocker with #139 combined with #56, #61, #62 and #63. On 000ffdd4 with those five merged, the pistol in the prison prologue is not drawn, and the "hold LT to aim" step never completes, so the story stops there. Plain 000ffdd4 and 4f62c2a5 pass it. I have not isolated which of them causes it. a208d61d on its own is fine.

4. Action scenes. On 000ffdd4, frames went from 6–7.7 fps to 0.5–2 fps when the action started. "copying back" went from about 15 ms to 120–220 ms per frame, and "preparing" from about 55 ms to 250–330 ms.

**@⁠lorddie** on GitHub · 2026-11-25 23:35 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/211) Thanks for this fork; on my RX 9070 XT it is the best result so far. Notes from one evening of runs, in case they help. I have only release-build logs, so I have no breadcrumbs for the hangs. **Machine:** RX 9070 XT 16 GB (Smart Access Memory on), Ryzen 5 5600X (6 cores), 32 GB RAM, Windows 11 26200, Series X profile, `VICTORY_HAIR=1`. Builds: `000ffdd4` and later `4f62c2a5`. **1. `VICTORY_GPU_UPLOAD=1`: smoother, but the device hung twice.** With it (`gpu_upload=true` in the log) the stutter went away: the worst frame went from 579 to 187 ms, and "on the GPU" went from about 21 to 2 ms per frame. But both runs with it on ended in `0x887A0006` (device hung): one after about 3.5 minutes in the world, one after about 25 minutes during the boat mission. Five runs without it, about 80 minutes in total, had no hang. With it on, the skin and tattoo noise on people also comes back: always without commit `a208d61d` from #139, now and then with it. I would keep it off by default. **2. DirectStorage: an uncompressed read straight into guarded title memory can fail.** On myokex/victory-amd (`070df42`), twice at about 4 minutes in: `dstorage: request failed: copying options=0x0 ... hr=0x800706f8` (ERROR_INVALID_USER_BUFFER), and about 0.25 s later the title stops on its fatal-error `int3` at `+0x22106e0` (called from `+0x2219650`). It looks like a guard set again while the kernel read is in flight. This fork has the same `into_destination(... read_into ...)` path for `options == 0`. I did not see the failure on this fork, because I patched it first. The patch reads into a buffer of ours and then copies, so the write goes through the guards like the title's own writes (fxceless/victory-fork reads into a separate buffer first in the same case): ```rust let size = request.source_size as usize; let mut data = vec![0u8; size]; read_into(request, &mut data).map_err(|hr| fail(hr, "reading"))?; return into_destination(request, size, |out| { out.copy_from_slice(&data); Ok(size) }) .map_err(|hr| fail(hr, "copying")); ``` **3. A progression blocker with #139 combined with #56, #61, #62 and #63.** On `000ffdd4` with those five merged, the pistol in the prison prologue is not drawn, and the "hold LT to aim" step never completes, so the story stops there. Plain `000ffdd4` and `4f62c2a5` pass it. I have not isolated which of them causes it. `a208d61d` on its own is fine. **4. Action scenes.** On `000ffdd4`, frames went from 6–7.7 fps to 0.5–2 fps when the action started. "copying back" went from about 15 ms to 120–220 ms per frame, and "preparing" from about 55 ms to 250–330 ms.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:38:02 +00:00
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 19:51 UTC · original

Checked point 2 on this fork at 4f62c2a, natively, without the game (RX 7900 XT, Windows 11 26300). The same window exists here, through the fast path of guard() in watch.rs.

  • An uncompressed request goes through into_destination (dstorage.rs:822-828). That calls kernel_will_write (dstorage.rs:964), then a synchronous ReadFile into the title's address (read_into, dstorage.rs:925-949).
  • kernel_will_write (watch::writing, watch.rs:709-717) opens the blocks and pins them for 2 s.
  • Only the slow path of guard() honours the pin (watch.rs:475). The fast path (watch.rs:429-450) runs when the first block of the checked range is still guarded. It does not look at pins. Any open block in the range goes back to PAGE_READONLY through protect(), including a pinned block that the kernel is still reading into.
  • This fast path came in 2bfe95a. The pins came a day later in 579a8d9, which changed only the slow path. The fast path also never prunes pins (pruning is only at watch.rs:463-466).

Local unit test (not pushed): I guarded two blocks of a pagefile view with guard(). Then I called writing() into the second block, guard() again on the same range (this takes the fast path), then ReadFile into the second block.

  • On 4f62c2a the second block is read-only again, and ReadFile fails with 998 (ERROR_NOACCESS, 0x800703e6). It failed in every run.
  • With the read in the first block, the check takes the slow path and the read succeeds.
  • I also tried a small change: prune pins in the fast path and skip pinned blocks there, the same as the slow path. With it, the new test passes, and so do the 7 existing watch:: tests (3 runs, interleaved with base runs).

What I could not confirm:

  • I got 998, not 0x800706f8. A ReadFile into a read-only view gave 998 in every case I tried: buffered and unbuffered, 64 KiB to 16 MiB, the whole range or only its last 64 KiB read-only. PAGE_GUARD gives 0x80000001, and the guard code in watch.rs does not use it. So I cannot say the myokex failure is this exact race.
  • No game run, so I have not seen this failure on this fork in play.

The same window applies to the title's own ReadFile and fread, which also call kernel_will_write (files.rs:530, 538).

Point 1, from the code only: VICTORY_GPU_UPLOAD=1 also needs GPUUploadHeapSupported (host.rs:402-412). It changes only upload_buffer(). That uses the GPU upload heap while VRAM use plus the new buffer stays under 85% of the budget, and otherwise the normal upload heap (host.rs:3423-3456). It has been off by default since a049b48.

From reading only: the rx9070xt branch (81ebb7b) does not seem to have this window. into_destination holds a kernel_writing guard across the read (dstorage.rs:1595-1600). While it is held, guard() leaves that range's blocks open (left_alone, watch.rs:1730). There is a test for this case: a_refresh_leaves_open_what_the_kernel_is_writing (watch.rs:2858). I did not build or run that branch.

I have the test and the change as a local patch if they are useful.

**@⁠adrianmjim** on GitHub · 2026-11-26 19:51 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/211#issuecomment-7202028141) Checked point 2 on this fork at 4f62c2a, natively, without the game (RX 7900 XT, Windows 11 26300). The same window exists here, through the fast path of `guard()` in watch.rs. - An uncompressed request goes through `into_destination` (dstorage.rs:822-828). That calls `kernel_will_write` (dstorage.rs:964), then a synchronous `ReadFile` into the title's address (`read_into`, dstorage.rs:925-949). - `kernel_will_write` (`watch::writing`, watch.rs:709-717) opens the blocks and pins them for 2 s. - Only the slow path of `guard()` honours the pin (watch.rs:475). The fast path (watch.rs:429-450) runs when the first block of the checked range is still guarded. It does not look at pins. Any open block in the range goes back to `PAGE_READONLY` through `protect()`, including a pinned block that the kernel is still reading into. - This fast path came in 2bfe95a. The pins came a day later in 579a8d9, which changed only the slow path. The fast path also never prunes `pins` (pruning is only at watch.rs:463-466). Local unit test (not pushed): I guarded two blocks of a pagefile view with `guard()`. Then I called `writing()` into the second block, `guard()` again on the same range (this takes the fast path), then `ReadFile` into the second block. - On 4f62c2a the second block is read-only again, and `ReadFile` fails with 998 (ERROR_NOACCESS, 0x800703e6). It failed in every run. - With the read in the first block, the check takes the slow path and the read succeeds. - I also tried a small change: prune pins in the fast path and skip pinned blocks there, the same as the slow path. With it, the new test passes, and so do the 7 existing `watch::` tests (3 runs, interleaved with base runs). What I could not confirm: - I got 998, not 0x800706f8. A `ReadFile` into a read-only view gave 998 in every case I tried: buffered and unbuffered, 64 KiB to 16 MiB, the whole range or only its last 64 KiB read-only. `PAGE_GUARD` gives 0x80000001, and the guard code in watch.rs does not use it. So I cannot say the myokex failure is this exact race. - No game run, so I have not seen this failure on this fork in play. The same window applies to the title's own `ReadFile` and `fread`, which also call `kernel_will_write` (files.rs:530, 538). Point 1, from the code only: `VICTORY_GPU_UPLOAD=1` also needs `GPUUploadHeapSupported` (host.rs:402-412). It changes only `upload_buffer()`. That uses the GPU upload heap while VRAM use plus the new buffer stays under 85% of the budget, and otherwise the normal upload heap (host.rs:3423-3456). It has been off by default since a049b48. From reading only: the `rx9070xt` branch (81ebb7b) does not seem to have this window. `into_destination` holds a `kernel_writing` guard across the read (dstorage.rs:1595-1600). While it is held, `guard()` leaves that range's blocks open (`left_alone`, watch.rs:1730). There is a test for this case: `a_refresh_leaves_open_what_the_kernel_is_writing` (watch.rs:2858). I did not build or run that branch. I have the test and the change as a local patch if they are useful.
Author
Owner

@⁠lorddie on GitHub · 2026-11-26 20:04 UTC · original

Thanks for digging into this. A data point from tonight: about two hours of play on this card, one hour on avatarmanz/VIctory-7900XTX at a9400a6d and the rest on Belobug's rx9070xt branch at cd8dfc06 (Series S and Series X, the boat mission included), with no DirectStorage failure in any log (no 0x800706f8, no 998). That fits your reading of rx9070xt. I haven't gone back to 4f62c2a, where I saw it, so I can't confirm the fast-path race in play, but if you open a pull request with your test and change, I'll run it there.

**@⁠lorddie** on GitHub · 2026-11-26 20:04 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/211#issuecomment-7202268421) Thanks for digging into this. A data point from tonight: about two hours of play on this card, one hour on avatarmanz/VIctory-7900XTX at `a9400a6d` and the rest on Belobug's `rx9070xt` branch at `cd8dfc06` (Series S and Series X, the boat mission included), with no DirectStorage failure in any log (no `0x800706f8`, no 998). That fits your reading of `rx9070xt`. I haven't gone back to `4f62c2a`, where I saw it, so I can't confirm the fast-path race in play, but if you open a pull request with your test and change, I'll run it there.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 20:10 UTC · original

@⁠lorddie thanks for the play data. The change already exists as a pull request: #60 (romainhedouin) makes guard()'s fast path honour the pins, the same way the slow path does, and adds a ReadFile test. I've just run it on Windows (results there):

  • its test fails without the change and passes with it;
  • the watch:: and victory-gpu tests pass.

So #60 on 4f62c2a is the one to try. #237 is a different approach to the same symptom (it retries a rejected DirectStorage read through a staging buffer), if you want to compare.

**@⁠adrianmjim** on GitHub · 2026-11-26 20:10 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/211#issuecomment-7202383862) @⁠lorddie thanks for the play data. The change already exists as a pull request: #60 (romainhedouin) makes `guard()`'s fast path honour the pins, the same way the slow path does, and adds a `ReadFile` test. I've just run it on Windows (results there): - its test fails without the change and passes with it; - the `watch::` and `victory-gpu` tests pass. So #60 on `4f62c2a` is the one to try. #237 is a different approach to the same symptom (it retries a rejected DirectStorage read through a staging buffer), if you want to compare.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 21:47 UTC · original

On #237, for comparing the two: as measured there (#237), #237 restages a read only on 1784 (0x800706f8, protection changed while the read is in flight). The race #60 fixes gives 998 (the block already read-only before the read starts), and the #211 reproduction still fails with 998 on #237, 3 of 3. So #237 does not cover this case, and #60 is still the fix for it.

**@⁠adrianmjim** on GitHub · 2026-11-26 21:47 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/211#issuecomment-7204055507) On #237, for comparing the two: as measured there (https://git.gtahub.st/github/Belobug--VIctory-Belobug-AMD/pulls/237), #237 restages a read only on 1784 (`0x800706f8`, protection changed while the read is in flight). The race #60 fixes gives 998 (the block already read-only before the read starts), and the #211 reproduction still fails with 998 on #237, 3 of 3. So #237 does not cover this case, and #60 is still the fix for it.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 22:24 UTC · original

@⁠lorddie an update: #60 is closed. The maintainer's line is now a-publier/rx9070xt, and that line has no time-based pins: kernel writes are scoped (kernel_writing) and every path that makes a block read-only again checks left_alone, the fast path included. So the race is only on main, which fits your two hours on rx9070xt without a single 998 or 0x800706f8. Unless it shows up again on that line, there is nothing left to test here.

**@⁠adrianmjim** on GitHub · 2026-11-26 22:24 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/211#issuecomment-7204654778) @⁠lorddie an update: #60 is closed. The maintainer's line is now `a-publier`/`rx9070xt`, and that line has no time-based pins: kernel writes are scoped (`kernel_writing`) and every path that makes a block read-only again checks `left_alone`, the fast path included. So the race is only on `main`, which fits your two hours on `rx9070xt` without a single 998 or `0x800706f8`. Unless it shows up again on that line, there is nothing left to test here.
This discussion has been locked. Commenting is limited to contributors.
No description provided.