Repository navigation
Memory: a whole coherent window in a title's first run (#284) - #632
grahamster2 wants to merge 2 commits into
Conversation
|
Hardware check of Tested
Regression run
PR ( Not tested
AI use
|
|
Test run of Tested
Review: Only a missing file ( Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
Test report: #632 under Wine (Linux, NVIDIA): the Wine branch on a first runThe PR's Wine branch ( Setup
Unit tests (under Wine, Runs
(These are the two first runs. Not tested
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. |
Adapt xcl-dev#632 (819a605) with exclusive profile creation. With unknown headroom the fallback stays at 512 MiB. Only automatic full-window attempts consume the marker. Eight coherent tests passed. Assisted-by: T3 Code (gpt-6.2-astra)
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
819a605 to
90bbaf5
Compare
|
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. |
|
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current |
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 xcl-dev#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.
…, tidy logs and docs
b6fe9a4 to
560240a
Compare
|
rebased onto main b49be18 (head 560240a)
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 |
On a title's first run there is no
cache/uma_coherent.txtyet, 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 oldermain. This follows Kalmarv's plan in #284. On Windows, with nouma_coherent.txtand 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 (#284 (comment)) 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_MBstill decides the size when it is set. Learned sizes andXCL_COHERENT_MBare 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 --libgives 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 withutil::under_wine()(ntdll'swine_get_version), as elsewhere in the code base. A newlearned_bytesreads 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)(withcoherent_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_needuses the same write helper. Both functions have unit tests.crates/xcl/tests/e2e.rs: the two runs of the test title setXCL_COHERENT_MB=512. Each starts from a new data folder, so without it they would now commit the whole window, which Kalmarv measured in First run of a title: the coherent window is 512 MB until uma_coherent.txt has been learned (menus at ~12 fps, then 30) #284 at +3.6 GB of commit and working set and about +1 s per run. With it they run as they do onmain.crates/xcl/src/hle/kernelx.rs: a comment on the window size now mentions the first run.Tested
cargo test --workspace -- --test-threads=4on 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 ofcargo test -p xcl --test e2eand 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)gpu::uma::tests::coherent_window_is_whole_in_the_first_run_then_what_the_title_asked_forcovers 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_runcovers a missing file, a missing file with no title, an unreadable file, a valid value, 0, garbage and an empty file.-Gameis a junction to the title's folder, so the blocks show a neutral title name). Each first run used a new emptyXCL_DATA_ROOT,XCL_COHERENT_MBwas unset, and no other XCL process was running during any of the runs:mainfirst 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 ….0 6 59 60 34 54 35 0 49 60 60 60 …, steady at 60 (30 fps) from 18 s on.0 13 50 60 37 54 22 34 60 60 ….mainvaries between runs: an earlier cleanmainfirst 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 everymainrun 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).main), so it is within the 125 % rule. Frames were 177 % ofmainin 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 % ofmain(1638 against 1631) and peak commit 103 % (15493 MB against 14975 MB).Regression run
main(0829441), data folder as it was, not emptied:This PR (b6fe9a4), same data folder state:
Not tested
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 thanmain, but the first-run gain is lost.uma_coherent.txtstill holds the largest total seen and never goes down. That is as onmain, and the 0 is written only on the first run.HANDOFF.mdline ~1798 says the window size comes from the last run; it now has a first-run exception (not edited here, per CONTRIBUTING)AI use