Memory: a whole coherent window in a title's first run (#284) #632

Open
github-bot wants to merge 2 commits from github-bot/gh-632 into main AGit
Owner

@⁠grahamster2 on GitHub · 2026-11-24 02:42 UTC · original
grahamster2:uma-first-run-window → main · +125 −18 · 3 files · 2 commits · open

On a title's first run there is no cache/uma_coherent.txt yet, so the coherent window was 512 MB and the title's GPU heaps went elsewhere for the whole run. #284 measured the retail title's menus at ~12 fps on the first run and 30 from the second, on an older main. This follows Kalmarv's plan in #284. On Windows, with no uma_coherent.txt and the 17 GB of commit free that a learned size already needs, the first run always gets one whole window (4095 MB). Under Wine the first run keeps 512 MB: xstraok's Proton runs (https://github.com/ivall/xcl/issues/284#issuecomment-7117584344) show the 4095 MB window leaving the retail title black, with 7 s of upload in its first 16 sparse submits, where 512 MB drew the menus. In every other case the window stays at 512 MB as today. The first run writes 0 to the file straight away, and what the title then asks for replaces it as before, so a title that asks for nothing is back to 512 MB from its second run. XCL_COHERENT_MB still decides the size when it is set. Learned sizes and XCL_COHERENT_MB are clamped to the per-layout cap (max_coherent_bytes), so on 8 and 16 window layouts they can exceed 4095 MB; on the default 4-window layout the cap is one window.

Part of #284. It fixes the first run on Windows. Under Wine the learned size (4095 MB for the retail title from its second run) is left as on main, and that is still the black-screen case in xstraok's data.

Rebase note: rebased onto main b49be18 (head 560240a). cargo test -p xcl --lib gives 1312 passed, 0 failed, 27 ignored on this head. The Regression run (xcl-smoke) blocks below are from the previous head (b6fe9a4 against main 0829441) and will be redone on this head before review. The workspace test counts and the retail-title smoke runs below are older still and also predate this rebase.

What is in it

  • crates/xcl/src/gpu/uma.rs: the sizing is now a pure function, coherent_size(learned: Option<usize>, free: usize, env_mb: Option<usize>, wine: bool, cap: usize). Wine is detected with util::under_wine() (ntdll's wine_get_version), as elsewhere in the code base. A new learned_bytes reads the file: only a missing file in a title's run counts as a first run. A file that cannot be read or parsed counts as 0, so it can't give a whole window on every run. Without a boot record (unit tests) there is no first run. coherent_hint_for(windows) (with coherent_hint() as the 4-window wrapper) writes 0 on a first run and logs the size it chose, and the 4-window fallback after a failed 8/16-window reservation reuses that hint cut to its own cap (for_layout) instead of reading the 0 back. note_coherent_need uses the same write helper. Both functions have unit tests.
  • crates/xcl/tests/e2e.rs: the two runs of the test title set XCL_COHERENT_MB=512. Each starts from a new data folder, so without it they would now commit the whole window, which Kalmarv measured in #284 at +3.6 GB of commit and working set and about +1 s per run. With it they run as they do on main.
  • crates/xcl/src/hle/kernelx.rs: a comment on the window size now mentions the first run.

Tested

  • Lib tests on the current head: see the rebase note above. The test counts further down were measured on 819a605 before the rebases.
  • NVIDIA GeForce RTX 3080 10 GB (driver 610.88), AMD Ryzen 5 7600X, 32 GB RAM, Windows 11 build 26200, rustc 1.94.0; tests on a debug build, smoke runs on release builds
  • cargo test --workspace -- --test-threads=4 on 819a605 (before the rebase): 686 passed, 0 failed, 41 ignored. An earlier full run on an older base had one failure, e2e::test_title_runs_and_game_folder_is_untouched ("the test title did not run to the end", with the 512 MB window), while another process was using the GPU. Two reruns of cargo test -p xcl --test e2e and every full run since have passed.
  • SKIPPED: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64)
  • new unit tests:
    • gpu::uma::tests::coherent_window_is_whole_in_the_first_run_then_what_the_title_asked_for covers no file with enough commit and with too little, learned 0, learned 1 GB with enough and with too little commit, learned 4.8 GB (capped), and the override. Under Wine it covers no file, too little commit, a learned value and the override.
    • gpu::uma::tests::only_a_missing_coherent_file_is_a_first_run covers a missing file, a missing file with no title, an unreadable file, a valid value, 0, garbage and an empty file.
  • the retail title, 60 s smoke runs, measured on 819a605 and main 9ce2070 before the rebase (-Game is a junction to the title's folder, so the blocks show a neutral title name). Each first run used a new empty XCL_DATA_ROOT, XCL_COHERENT_MB was unset, and no other XCL process was running during any of the runs:
    • main first run: 512 MB window, 879 frames. Presents per 2 s: 0 25 29 61 20 1 1 1 40 41 48 43 37 48 36 10 33 11 11 13 33 51 ….
    • This PR, first run: 4095 MB window ("the title's first run: a 4095 MB coherent window" in the log), 1556 frames. Presents per 2 s: 0 6 59 60 34 54 35 0 49 60 60 60 …, steady at 60 (30 fps) from 18 s on.
    • This PR, second run: learned 4.8 GB, capped at 4095 MB, 1590 frames. Presents per 2 s: 0 13 50 60 37 54 22 34 60 60 ….
    • main varies between runs: an earlier clean main first run of the same commit gave 1278 frames and 15606 MB of peak commit, and two earlier clean runs of this PR (first run, then learned) gave 1587 and 1602 frames. In every main run the stretch from about 8 s on has long drops (1 to 21 presents per 2 s, i.e. 0.5 to 10 fps). With the whole window there is one dip at about 12 to 16 s and then a steady 30 fps. I have not checked what is on screen during that stretch (it may be the intro video).
  • peak commit is lower with the whole window (14651 MB vs 15609 MB, 94 % of main), so it is within the 125 % rule. Frames were 177 % of main in the first-run pair above and 124 % in the earlier pair. In the regression run below, made on b6fe9a4 against main 0829441 without emptying the data folder, frames are 100 % of main (1638 against 1631) and peak commit 103 % (15493 MB against 14975 MB).

Regression run
main (0829441), data folder as it was, not emptied:

xcl-smoke v1
commit: 082944135cd2b96288470a595861fa608eee08dc
gpu: NVIDIA GeForce RTX 3080
title: xcl-title
seconds: 60
exit: 0x0
frames shown: 1631 (PresentX 1631)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14975 MB

This PR (b6fe9a4), same data folder state:

xcl-smoke v1
commit: b6fe9a4a4e7bce7c562f857c9ea268a5017d6b5f
gpu: NVIDIA GeForce RTX 3080
title: xcl-title
seconds: 60
exit: 0x0
frames shown: 1638 (PresentX 1638)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15493 MB

Not tested

  • Wine / Proton: the gate is covered by the unit test only. It applies to all of Wine, including NVIDIA under Wine, which nobody has measured, and learned sizes under Wine are unchanged
  • AMD and Intel GPUs, and machines with less than 17 GB of commit free (that path still gives 512 MB; it is covered only by the unit test)
  • a 16 GB RAM machine with a large page file: 17 GB of free commit is not 17 GB of free RAM, and there a first run's resident 4 GB window may cost more than it gains
  • titles other than the retail title and the test title
  • run-to-run variance beyond the two pairs above
  • a first run that crashes after the window is made but before its first PAGE_GRAPHICS_* commit leaves 0 in the file, so the second run gets 512 MB and only the third gets the learned size. That is no worse than main, but the first-run gain is lost.
  • uma_coherent.txt still holds the largest total seen and never goes down. That is as on main, and the 0 is written only on the first run.
  • HANDOFF.md line ~1798 says the window size comes from the last run; it now has a first-run exception (not edited here, per CONTRIBUTING)

AI use

  • Claude Code with Claude Opus 5.5: wrote the change and tests, ran the tests and smoke runs
**@⁠grahamster2** on GitHub · 2026-11-24 02:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/632) `grahamster2:uma-first-run-window` → `main` · +125 −18 · 3 files · 2 commits · open On a title's first run there is no `cache/uma_coherent.txt` yet, so the coherent window was 512 MB and the title's GPU heaps went elsewhere for the whole run. #284 measured the retail title's menus at ~12 fps on the first run and 30 from the second, on an older `main`. This follows Kalmarv's plan in #284. On Windows, with no `uma_coherent.txt` and the 17 GB of commit free that a learned size already needs, the first run always gets one whole window (4095 MB). Under Wine the first run keeps 512 MB: xstraok's Proton runs (https://github.com/ivall/xcl/issues/284#issuecomment-7117584344) show the 4095 MB window leaving the retail title black, with 7 s of upload in its first 16 sparse submits, where 512 MB drew the menus. In every other case the window stays at 512 MB as today. The first run writes 0 to the file straight away, and what the title then asks for replaces it as before, so a title that asks for nothing is back to 512 MB from its second run. `XCL_COHERENT_MB` still decides the size when it is set. Learned sizes and `XCL_COHERENT_MB` are clamped to the per-layout cap (`max_coherent_bytes`), so on 8 and 16 window layouts they can exceed 4095 MB; on the default 4-window layout the cap is one window. Part of #284. It fixes the first run on Windows. Under Wine the learned size (4095 MB for the retail title from its second run) is left as on `main`, and that is still the black-screen case in xstraok's data. **Rebase note:** rebased onto main b49be18 (head 560240a). `cargo test -p xcl --lib` gives 1312 passed, 0 failed, 27 ignored on this head. The Regression run (xcl-smoke) blocks below are from the previous head (b6fe9a4 against main 0829441) and will be redone on this head before review. The workspace test counts and the retail-title smoke runs below are older still and also predate this rebase. **What is in it** - `crates/xcl/src/gpu/uma.rs`: the sizing is now a pure function, `coherent_size(learned: Option<usize>, free: usize, env_mb: Option<usize>, wine: bool, cap: usize)`. Wine is detected with `util::under_wine()` (ntdll's `wine_get_version`), as elsewhere in the code base. A new `learned_bytes` reads the file: only a *missing* file in a title's run counts as a first run. A file that cannot be read or parsed counts as 0, so it can't give a whole window on every run. Without a boot record (unit tests) there is no first run. `coherent_hint_for(windows)` (with `coherent_hint()` as the 4-window wrapper) writes 0 on a first run and logs the size it chose, and the 4-window fallback after a failed 8/16-window reservation reuses that hint cut to its own cap (`for_layout`) instead of reading the 0 back. `note_coherent_need` uses the same write helper. Both functions have unit tests. - `crates/xcl/tests/e2e.rs`: the two runs of the test title set `XCL_COHERENT_MB=512`. Each starts from a new data folder, so without it they would now commit the whole window, which Kalmarv measured in #284 at +3.6 GB of commit and working set and about +1 s per run. With it they run as they do on `main`. - `crates/xcl/src/hle/kernelx.rs`: a comment on the window size now mentions the first run. **Tested** - Lib tests on the current head: see the rebase note above. The test counts further down were measured on 819a605 before the rebases. - NVIDIA GeForce RTX 3080 10 GB (driver 610.88), AMD Ryzen 5 7600X, 32 GB RAM, Windows 11 build 26200, rustc 1.94.0; tests on a debug build, smoke runs on release builds - `cargo test --workspace -- --test-threads=4` on 819a605 (before the rebase): 686 passed, 0 failed, 41 ignored. An earlier full run on an older base had one failure, `e2e::test_title_runs_and_game_folder_is_untouched` ("the test title did not run to the end", with the 512 MB window), while another process was using the GPU. Two reruns of `cargo test -p xcl --test e2e` and every full run since have passed. - `SKIPPED`: `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64), `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` (no wave64) - new unit tests: - `gpu::uma::tests::coherent_window_is_whole_in_the_first_run_then_what_the_title_asked_for` covers no file with enough commit and with too little, learned 0, learned 1 GB with enough and with too little commit, learned 4.8 GB (capped), and the override. Under Wine it covers no file, too little commit, a learned value and the override. - `gpu::uma::tests::only_a_missing_coherent_file_is_a_first_run` covers a missing file, a missing file with no title, an unreadable file, a valid value, 0, garbage and an empty file. - the retail title, 60 s smoke runs, measured on 819a605 and main 9ce2070 before the rebase (`-Game` is a junction to the title's folder, so the blocks show a neutral title name). Each first run used a new empty `XCL_DATA_ROOT`, `XCL_COHERENT_MB` was unset, and no other XCL process was running during any of the runs: - `main` first run: 512 MB window, 879 frames. Presents per 2 s: `0 25 29 61 20 1 1 1 40 41 48 43 37 48 36 10 33 11 11 13 33 51 …`. - This PR, first run: 4095 MB window ("the title's first run: a 4095 MB coherent window" in the log), 1556 frames. Presents per 2 s: `0 6 59 60 34 54 35 0 49 60 60 60 …`, steady at 60 (30 fps) from 18 s on. - This PR, second run: learned 4.8 GB, capped at 4095 MB, 1590 frames. Presents per 2 s: `0 13 50 60 37 54 22 34 60 60 …`. - `main` varies between runs: an earlier clean `main` first run of the same commit gave 1278 frames and 15606 MB of peak commit, and two earlier clean runs of this PR (first run, then learned) gave 1587 and 1602 frames. In every `main` run the stretch from about 8 s on has long drops (1 to 21 presents per 2 s, i.e. 0.5 to 10 fps). With the whole window there is one dip at about 12 to 16 s and then a steady 30 fps. I have not checked what is on screen during that stretch (it may be the intro video). - peak commit is *lower* with the whole window (14651 MB vs 15609 MB, 94 % of `main`), so it is within the 125 % rule. Frames were 177 % of `main` in the first-run pair above and 124 % in the earlier pair. In the regression run below, made on b6fe9a4 against main 0829441 without emptying the data folder, frames are 100 % of `main` (1638 against 1631) and peak commit 103 % (15493 MB against 14975 MB). **Regression run** `main` (0829441), data folder as it was, not emptied: ``` xcl-smoke v1 commit: 082944135cd2b96288470a595861fa608eee08dc gpu: NVIDIA GeForce RTX 3080 title: xcl-title seconds: 60 exit: 0x0 frames shown: 1631 (PresentX 1631) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14975 MB ``` This PR (b6fe9a4), same data folder state: ``` xcl-smoke v1 commit: b6fe9a4a4e7bce7c562f857c9ea268a5017d6b5f gpu: NVIDIA GeForce RTX 3080 title: xcl-title seconds: 60 exit: 0x0 frames shown: 1638 (PresentX 1638) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15493 MB ``` **Not tested** - Wine / Proton: the gate is covered by the unit test only. It applies to all of Wine, including NVIDIA under Wine, which nobody has measured, and learned sizes under Wine are unchanged - AMD and Intel GPUs, and machines with less than 17 GB of commit free (that path still gives 512 MB; it is covered only by the unit test) - a 16 GB RAM machine with a large page file: 17 GB of free commit is not 17 GB of free RAM, and there a first run's resident 4 GB window may cost more than it gains - titles other than the retail title and the test title - run-to-run variance beyond the two pairs above - a first run that crashes after the window is made but before its first `PAGE_GRAPHICS_*` commit leaves 0 in the file, so the second run gets 512 MB and only the third gets the learned size. That is no worse than `main`, but the first-run gain is lost. - `uma_coherent.txt` still holds the largest total seen and never goes down. That is as on `main`, and the 0 is written only on the first run. - `HANDOFF.md` line ~1798 says the window size comes from the last run; it now has a first-run exception (not edited here, per CONTRIBUTING) **AI use** - Claude Code with Claude Opus 5.5: wrote the change and tests, ran the tests and smoke runs
The coherent window is sized from what the title asked for in its last
run (cache/uma_coherent.txt), so a title's first run got 512 MB and its
GPU heaps went elsewhere for the whole run: the retail title's menus ran at ~12 fps
in the first run and 30 from the second (RTX 3080, Windows, measured on

With no uma_coherent.txt (and the 17 GB of commit free that a learned
size needs already) the window is now a whole one, 4095 MB, on Windows.
Under Wine the first run keeps 512 MB: there a 4095 MB window left the retail title
black, with 7 s of upload in its first 16 sparse submits, where 512 MB
drew its menus (Proton, vkd3d-proton, RADV; measured on #284). The first
run writes 0 to the file at once and what the title asks for replaces it
as before, so a title that asks for nothing has 512 MB again from its
second run instead of keeping the whole window. A file that exists but
cannot be read counts as 0, not as a first run; without a title (unit
tests) nothing changes. XCL_COHERENT_MB still chooses the size; the e2e
runs of the test title set it to 512, since each starts from a new data
folder and would otherwise commit 3.6 GB they do not use.

The sizing is a pure function, coherent_size, with unit tests.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:27:52 +00:00
Author
Owner

@⁠eizispark on GitHub · 2026-11-24 02:51 UTC · original

Hardware check of 819a6057d92b5d4654ea059b2cefc0b68e1c2051 (verified clean merge with main 18c105a): pass.

Tested

  • Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profile
  • cargo test --workspace -- --test-threads=4: 686 passed, 0 failed, 41 ignored (GPU tests skipped on this adapter: none)
  • gpu::uma::tests (coherent_window_is_whole_in_the_first_run_then_what_the_title_asked_for, only_a_missing_coherent_file_is_a_first_run) and e2e: passed; fresh empty data directory smoke run below selected the 4095 MB first-run coherent window as expected

Regression run
Both runs below used a fresh empty data directory (first run, no prior uma_coherent.txt, XCL_COHERENT_MB unset):

main (9ce2070):

xcl-smoke v1
commit: 9ce2070eccf436d7bd38601c90407da447df34f3
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1213 (PresentX 1213)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15615 MB

PR (819a605):

xcl-smoke v1
commit: 819a6057d92b5d4654ea059b2cefc0b68e1c2051
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1645 (PresentX 1645)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14880 MB

Not tested

  • wave32-only GPUs (NVIDIA / Intel); Wine / Proton; machines under 17 GB free commit; gameplay past the menus

AI use

  • Antigravity (Gemini 4 Carbon) ran the build, test suite, and scripts/smoke.ps1 harness on this machine and formatted this report.
**@⁠eizispark** on GitHub · 2026-11-24 02:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/632#issuecomment-7120548955) Hardware check of `819a6057d92b5d4654ea059b2cefc0b68e1c2051` (verified clean merge with `main` `18c105a`): **pass**. **Tested** - Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, release + test profile - `cargo test --workspace -- --test-threads=4`: `686 passed, 0 failed, 41 ignored` (GPU tests skipped on this adapter: `none`) - `gpu::uma::tests` (`coherent_window_is_whole_in_the_first_run_then_what_the_title_asked_for`, `only_a_missing_coherent_file_is_a_first_run`) and `e2e`: passed; fresh empty data directory smoke run below selected the 4095 MB first-run coherent window as expected **Regression run** Both runs below used a fresh empty data directory (first run, no prior `uma_coherent.txt`, `XCL_COHERENT_MB` unset): `main` (`9ce2070`): ``` xcl-smoke v1 commit: 9ce2070eccf436d7bd38601c90407da447df34f3 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1213 (PresentX 1213) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15615 MB ``` PR (`819a605`): ``` xcl-smoke v1 commit: 819a6057d92b5d4654ea059b2cefc0b68e1c2051 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1645 (PresentX 1645) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14880 MB ``` **Not tested** - wave32-only GPUs (NVIDIA / Intel); Wine / Proton; machines under 17 GB free commit; gameplay past the menus **AI use** - Antigravity (Gemini 4 Carbon) ran the build, test suite, and `scripts/smoke.ps1` harness on this machine and formatted this report.
Author
Owner

@⁠MesshM on GitHub · 2026-11-24 02:55 UTC · original

Test run of 819a6057d92b5d4654ea059b2cefc0b68e1c2051 on AMD RDNA4; the PR was tested on NVIDIA only. I merged it onto current main 18c105a locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 691 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 651 passed, 0 failed, 21 ignored
  • 0 SKIPPED; coherent_window_is_whole_in_the_first_run_then_what_the_title_asked_for and only_a_missing_coherent_file_is_a_first_run pass.

Review: Only a missing file (NotFound, with a title) counts as a first run; an unreadable or unparsable file counts as 0, and without a title nothing is learned or written, so unit tests do not touch uma_coherent.txt. Writing 0 at once means a first run that crashes before it learns anything leaves the second run at 512 MB, as today. Under Wine the first run stays at 512 MB, per the Proton results in #284. I found nothing to change.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

**@⁠MesshM** on GitHub · 2026-11-24 02:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/632#issuecomment-7120600435) Test run of `819a6057d92b5d4654ea059b2cefc0b68e1c2051` on AMD RDNA4; the PR was tested on NVIDIA only. I merged it onto current `main` `18c105a` locally (clean merge) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **691 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 651 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; `coherent_window_is_whole_in_the_first_run_then_what_the_title_asked_for` and `only_a_missing_coherent_file_is_a_first_run` pass. **Review:** Only a missing file (`NotFound`, with a title) counts as a first run; an unreadable or unparsable file counts as 0, and without a title nothing is learned or written, so unit tests do not touch `uma_coherent.txt`. Writing 0 at once means a first run that crashes before it learns anything leaves the second run at 512 MB, as today. Under Wine the first run stays at 512 MB, per the Proton results in #284. I found nothing to change. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-24 03:42 UTC · original

Test report: #632 under Wine (Linux, NVIDIA): the Wine branch on a first run

The PR's Wine branch (coherent_size(…, wine = true)) had only been covered by its unit tests; the other reports are Windows runs. On Linux it does what the description says: a first run under Wine keeps 512 MB. The unit tests pass under Wine and there is no regression in the game runs.

Setup

  • CachyOS, kernel 7.3.3-1-cachyos, Intel i5-10400F, 16 GB RAM, NVIDIA GeForce RTX 3060 12 GB, driver 620.70.06
  • Proton Experimental experimental-11.0-20261112 (wine-11.0), vkd3d-proton v3.1 + the patch from #257, DXVK from Proton, DXC 1.9.2609, DXVK_CONFIG="dxgi.hideNvidiaGpu = False"
  • Rust 1.100.0, x86_64-pc-windows-gnu (mingw-w64-gcc 16.2.0); release builds for the runs, debug for the tests
  • Commits: this PR's head 819a605 and its base main 9ce2070
  • GTA VI 1.0.2.1, 60 s runs with scripts/linux/smoke.sh from #257 (XCL_NETWORK=0, XCL_COHERENT_MB unset). Each build got a new empty XCL_DATA_ROOT (no uma_coherent.txt before its first run), then a second run in the same folder.

Unit tests (under Wine, --test-threads=1, filter gpu::uma::tests): 9 passed, 0 failed. That includes coherent_window_is_whole_in_the_first_run_then_what_the_title_asked_for and only_a_missing_coherent_file_is_a_first_run.

Runs

build, run log window frames removals / crashes
9ce2070, 1st (no first-run line) 512 MB 1015 0 / 0
819a605, 1st UMA: the title's first run under Wine: the coherent window stays at 512 MB 512 MB 1039 0 / 0
819a605, 2nd UMA: 13328 MB of commit free, under 17408 MB: the title's GPU heaps stay outside unified memory … 512 MB 1024 0 / 0
9ce2070, 2nd UMA: 13491 MB of commit free, under 17408 MB: … 512 MB 1036 0 / 0
  • After the first run, cache/uma_coherent.txt holds 4804771840 on both builds (the title asked for 3934 MB → "a window of up to 4095 MB from the next run").
  • On this 16 GB machine the second run stays at 512 MB on both builds anyway, because only ~13.3 GB of commit is free under Wine, below the 17 GB the learned size needs. So the "learned 4095 MB under Wine leaves the title black" case from #284 can't come up here, and I could not check it either way.
  • The PR's first run also logs the commit warning before the Wine line, so a reader sees both reasons on a small machine.
xcl-smoke v1
commit: 9ce2070eccf436d7bd38601c90407da447df34f3
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1015 (PresentX 1015)
presents per 2 s (last 3): 46 42 45
device removals: 0
crashes: 0
peak commit: 0 MB
xcl-smoke v1
commit: 819a6057d92b5d4654ea059b2cefc0b68e1c2051
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1039 (PresentX 1039)
presents per 2 s (last 3): 43 44 60
device removals: 0
crashes: 0
peak commit: 0 MB

(These are the two first runs. peak commit: 0 MB is XCL reading 0 MB committed under Wine, see #257, so the 125 % commit comparison says nothing here.)

Not tested

  • The rest of the suite on this branch; Windows (covered by the other reports); a machine with more than 17 GB of commit free under Wine (the learned-size path under Wine); the picture (black under Wine on both builds, #175)

AI use: Claude Code (Claude Opus 5.5) built both commits, ran everything above on the machine above and wrote this report. The blocks and log lines are pasted from those runs. The account owner asked for test reports to be posted while they were away and has not reviewed this one.

**@⁠JoaoPauluu** on GitHub · 2026-11-24 03:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/632#issuecomment-7121345715) ### Test report: #632 under Wine (Linux, NVIDIA): the Wine branch on a first run The PR's Wine branch (`coherent_size(…, wine = true)`) had only been covered by its unit tests; the other reports are Windows runs. On Linux it does what the description says: a first run under Wine keeps 512 MB. The unit tests pass under Wine and there is no regression in the game runs. **Setup** - CachyOS, kernel 7.3.3-1-cachyos, Intel i5-10400F, **16 GB RAM**, NVIDIA GeForce RTX 3060 12 GB, driver 620.70.06 - Proton Experimental `experimental-11.0-20261112` (wine-11.0), vkd3d-proton v3.1 + the patch from #257, DXVK from Proton, DXC 1.9.2609, `DXVK_CONFIG="dxgi.hideNvidiaGpu = False"` - Rust 1.100.0, `x86_64-pc-windows-gnu` (mingw-w64-gcc 16.2.0); release builds for the runs, debug for the tests - Commits: this PR's head `819a605` and its base `main` `9ce2070` - GTA VI 1.0.2.1, 60 s runs with `scripts/linux/smoke.sh` from #257 (`XCL_NETWORK=0`, `XCL_COHERENT_MB` unset). Each build got a new empty `XCL_DATA_ROOT` (no `uma_coherent.txt` before its first run), then a second run in the same folder. **Unit tests** (under Wine, `--test-threads=1`, filter `gpu::uma::tests`): 9 passed, 0 failed. That includes `coherent_window_is_whole_in_the_first_run_then_what_the_title_asked_for` and `only_a_missing_coherent_file_is_a_first_run`. **Runs** | build, run | log | window | frames | removals / crashes | |---|---|---|---|---| | `9ce2070`, 1st | (no first-run line) | 512 MB | 1015 | 0 / 0 | | `819a605`, 1st | `UMA: the title's first run under Wine: the coherent window stays at 512 MB` | 512 MB | 1039 | 0 / 0 | | `819a605`, 2nd | `UMA: 13328 MB of commit free, under 17408 MB: the title's GPU heaps stay outside unified memory …` | 512 MB | 1024 | 0 / 0 | | `9ce2070`, 2nd | `UMA: 13491 MB of commit free, under 17408 MB: …` | 512 MB | 1036 | 0 / 0 | - After the first run, `cache/uma_coherent.txt` holds `4804771840` on both builds (the title asked for 3934 MB → "a window of up to 4095 MB from the next run"). - On this 16 GB machine the second run stays at 512 MB on both builds anyway, because only ~13.3 GB of commit is free under Wine, below the 17 GB the learned size needs. So the "learned 4095 MB under Wine leaves the title black" case from #284 can't come up here, and I could not check it either way. - The PR's first run also logs the commit warning before the Wine line, so a reader sees both reasons on a small machine. ``` xcl-smoke v1 commit: 9ce2070eccf436d7bd38601c90407da447df34f3 gpu: NVIDIA GeForce RTX 3060 title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1015 (PresentX 1015) presents per 2 s (last 3): 46 42 45 device removals: 0 crashes: 0 peak commit: 0 MB ``` ``` xcl-smoke v1 commit: 819a6057d92b5d4654ea059b2cefc0b68e1c2051 gpu: NVIDIA GeForce RTX 3060 title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1039 (PresentX 1039) presents per 2 s (last 3): 43 44 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` (These are the two first runs. `peak commit: 0 MB` is XCL reading 0 MB committed under Wine, see #257, so the 125 % commit comparison says nothing here.) **Not tested** - The rest of the suite on this branch; Windows (covered by the other reports); a machine with more than 17 GB of commit free under Wine (the learned-size path under Wine); the picture (black under Wine on both builds, #175) **AI use:** Claude Code (Claude Opus 5.5) built both commits, ran everything above on the machine above and wrote this report. The blocks and log lines are pasted from those runs. The account owner asked for test reports to be posted while they were away and has not reviewed this one.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-24 10:39 UTC · original

Code/CI review only (not independently runtime-tested by me): clean merge with both checks green (Build and test + PR description). Cleanly allocates a full coherent UMA window on a title's first run (#284). Recommend merging, @⁠ivall.

**@⁠raylitebull** on GitHub · 2026-11-24 10:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/632#issuecomment-7129080203) Code/CI review only (not independently runtime-tested by me): clean merge with both checks green (`Build and test` + `PR description`). Cleanly allocates a full coherent UMA window on a title's first run (#284). Recommend merging, @⁠ivall.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 12:43 UTC · original

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-25 12:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/632#issuecomment-7162774607) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
Author
Owner

@⁠grahamster2 on GitHub · 2026-11-25 12:51 UTC · original · edited 2026-11-25 12:53 UTC

Rebased onto main 1a0bbe3 (new head 90bbaf5).

One conflict, in crates/xcl/src/gpu/uma.rs (the coherent window sizing). Main had turned coherent_hint into coherent_hint_for(windows) with a per-layout cap. I kept that function and moved the PR's first-run logic into it: coherent_size now takes the cap, so the override and a learned size are clamped to the layout's cap instead of one window, and the first run still gets one whole window. coherent_hint() stays as the 4-window wrapper, and the note_coherent_need log line uses the layout cap. I added three test lines for the larger cap.

cargo test -p xcl --lib: 1183 passed, 0 failed, 26 ignored. Not run against the retail title.

Follow-up commit b6fe9a4: the 4-window fallback after a failed 8/16-window reservation keeps a first run's whole window, plus log and doc fixes. Lib tests: 1184 passed, 0 failed.

**@⁠grahamster2** on GitHub · 2026-11-25 12:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/632#issuecomment-7162943078) · edited 2026-11-25 12:53 UTC Rebased onto main 1a0bbe3 (new head 90bbaf5). One conflict, in crates/xcl/src/gpu/uma.rs (the coherent window sizing). Main had turned coherent_hint into coherent_hint_for(windows) with a per-layout cap. I kept that function and moved the PR's first-run logic into it: coherent_size now takes the cap, so the override and a learned size are clamped to the layout's cap instead of one window, and the first run still gets one whole window. coherent_hint() stays as the 4-window wrapper, and the note_coherent_need log line uses the layout cap. I added three test lines for the larger cap. cargo test -p xcl --lib: 1183 passed, 0 failed, 26 ignored. Not run against the retail title. Follow-up commit b6fe9a4: the 4-window fallback after a failed 8/16-window reservation keeps a first run's whole window, plus log and doc fixes. Lib tests: 1184 passed, 0 failed.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 03:00 UTC · original

Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current main on the new head — needs another rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-26 03:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/632#issuecomment-7181310150) Re-verification on RTX 3060 Ti (Windows 11): still a **merge conflict with current `main`** on the new head — needs another rebase before it can be tested.
github-bot force-pushed github-bot/gh-632 from b6fe9a4a4e to 560240a3b1 2026-11-26 11:15:11 +00:00 Compare
Author
Owner

@⁠grahamster2 on GitHub · 2026-11-26 09:07 UTC · original

rebased onto main b49be18 (head 560240a)

  • crates/xcl/tests/e2e.rs: main now builds the debug-layer test command with an optional DRED env var; kept that and added the PR's XCL_COHERENT_MB=512 to it.

cargo test -p xcl --lib: 1312 passed, 0 failed, 27 ignored. The e2e test target compiles (cargo check); it was not run.

smoke rerun pending

**@⁠grahamster2** on GitHub · 2026-11-26 09:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/632#issuecomment-7187451686) rebased onto main b49be18 (head 560240a) - crates/xcl/tests/e2e.rs: main now builds the debug-layer test command with an optional DRED env var; kept that and added the PR's XCL_COHERENT_MB=512 to it. cargo test -p xcl --lib: 1312 passed, 0 failed, 27 ignored. The e2e test target compiles (cargo check); it was not run. smoke rerun pending
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/632/head:github-bot/gh-632'
git switch 'github-bot/gh-632'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-632'
git switch 'github-bot/gh-632'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-632'
git switch 'github-bot/gh-632'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-632'
git switch 'main'
git merge --squash 'github-bot/gh-632'
git switch 'main'
git merge --ff-only 'github-bot/gh-632'
git switch 'main'
git merge 'github-bot/gh-632'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.