Memory: separate Series S coherent window cache from Series X #1110

Open
github-bot wants to merge 1 commit from github-bot/gh-1110 into main AGit
Owner

@⁠xroneyaa on GitHub · 2026-11-24 11:42 UTC · original
xroneyaa:uma-coherent-series-s → main · +70 −20 · 1 files · 1 commits · open

When a title is switched from Series X (anaconda) to Series S (lockhart) in the same data folder, <data>\cache\uma_coherent.txt still holds Series X's larger coherent-heap measurement and note_coherent_need never lowers it. On an 8 GB VRAM + 16 GB RAM Windows host this keeps the coherent window pinned at 4095 MiB (increasing non-local GPU memory usage under WDDM) even when the Series S profile only needs ~3407 MiB. Giving Series S its own <data>\cache\uma_coherent_lockhart.txt lets each console profile size its coherent window independently. Part of #333.

What is in it

  • crates/xcl/src/gpu/uma.rs:
    • coherent_file_for(data_dir, series_s): selects uma_coherent_lockhart.txt when config().is_series_s() is true and keeps uma_coherent.txt for Series X.
    • coherent_hint_from(path, free) and record_coherent_need(path, bytes): helpers extracted from coherent_hint / note_coherent_need using saturating addition before clamping to MAX_SIZE.
    • Unit test series_s_coherent_cache_is_separate_from_series_x: verifies separate cache filenames, independent coherent window sizing (4,804,771,840 B -> MAX_SIZE for Series X vs 3,036,545,024 B -> 3,573,415,936 B for Series S), monotonicity within a file, and the NEEDS_FOR_COHERENT_HEAPS low-commit fallback.

Tested

  • GPU: NVIDIA GeForce RTX 3060 Ti (8024 MiB VRAM, driver 32.0.16.1088, 32-lane waves); CPU: 12th Gen Intel Core i5-12400F; 15.9 GB RAM; Windows 11 Pro Build 22631; Rust 1.100.0 (0ef1bc386 2026-11-09); DXC 1.8.2502.11.
  • .\scripts\test.ps1 (cargo test --workspace -- --test-threads=4, debug): 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware), including gpu::uma::tests::series_s_coherent_cache_is_separate_from_series_x.
  • cargo test -p xcl series_s_coherent_cache_is_separate_from_series_x: passed 3 consecutive runs (0 failed).
  • Release build (cargo build --release -p xcl): succeeded cleanly.
  • Measured Series X vs Series S coherent needs on this 8 GB VRAM + 16 GB RAM host in retail diagnostic runs: Series X asked for 4,804,771,840 B (4095 MiB coherent window; non-local peaked at 4685 MB when reused on lockhart), while a fresh lockhart run asked for 3,036,545,024 B (3407 MiB window with XCL's 512 MB headroom; non-local peaked at 3997 MB under XCL_COHERENT_MB=3200).

Regression run
main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 3060 Ti
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1487 (PresentX 1488)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 10404 MB

PR:

xcl-smoke v1
commit: 2c4bcb5d60907274c274d187f80fbdcacef74c4e
gpu: NVIDIA GeForce RTX 3060 Ti
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1517 (PresentX 1518)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 10401 MB

Not tested

  • AMD / Intel GPUs and Linux / Wine + vkd3d-proton.
  • Full retail Series S gameplay past 300 s world loading.

AI use

  • Antigravity (Google DeepMind; exact model identifier not exposed in environment) wrote the code, unit test, and PR description; all tests and smoke runs were executed locally on the host RTX 3060 Ti.
**@⁠xroneyaa** on GitHub · 2026-11-24 11:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/1110) `xroneyaa:uma-coherent-series-s` → `main` · +70 −20 · 1 files · 1 commits · open When a title is switched from Series X (`anaconda`) to Series S (`lockhart`) in the same data folder, `<data>\cache\uma_coherent.txt` still holds Series X's larger coherent-heap measurement and `note_coherent_need` never lowers it. On an 8 GB VRAM + 16 GB RAM Windows host this keeps the coherent window pinned at 4095 MiB (increasing non-local GPU memory usage under WDDM) even when the Series S profile only needs ~3407 MiB. Giving Series S its own `<data>\cache\uma_coherent_lockhart.txt` lets each console profile size its coherent window independently. Part of #333. **What is in it** - `crates/xcl/src/gpu/uma.rs`: - `coherent_file_for(data_dir, series_s)`: selects `uma_coherent_lockhart.txt` when `config().is_series_s()` is true and keeps `uma_coherent.txt` for Series X. - `coherent_hint_from(path, free)` and `record_coherent_need(path, bytes)`: helpers extracted from `coherent_hint` / `note_coherent_need` using saturating addition before clamping to `MAX_SIZE`. - Unit test `series_s_coherent_cache_is_separate_from_series_x`: verifies separate cache filenames, independent coherent window sizing (`4,804,771,840` B -> `MAX_SIZE` for Series X vs `3,036,545,024` B -> `3,573,415,936` B for Series S), monotonicity within a file, and the `NEEDS_FOR_COHERENT_HEAPS` low-commit fallback. **Tested** - GPU: NVIDIA GeForce RTX 3060 Ti (8024 MiB VRAM, driver `32.0.16.1088`, 32-lane waves); CPU: 12th Gen Intel Core i5-12400F; 15.9 GB RAM; Windows 11 Pro Build 22631; Rust `1.100.0 (0ef1bc386 2026-11-09)`; DXC `1.8.2502.11`. - `.\scripts\test.ps1` (`cargo test --workspace -- --test-threads=4`, debug): **742 passed, 0 failed, 41 ignored** (`SKIPPED` GPU tests: `2 (no wave64)`: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`), including `gpu::uma::tests::series_s_coherent_cache_is_separate_from_series_x`. - `cargo test -p xcl series_s_coherent_cache_is_separate_from_series_x`: passed 3 consecutive runs (0 failed). - Release build (`cargo build --release -p xcl`): succeeded cleanly. - Measured Series X vs Series S coherent needs on this 8 GB VRAM + 16 GB RAM host in retail diagnostic runs: Series X asked for `4,804,771,840` B (`4095` MiB coherent window; `non-local` peaked at `4685` MB when reused on `lockhart`), while a fresh `lockhart` run asked for `3,036,545,024` B (`3407` MiB window with XCL's `512` MB headroom; `non-local` peaked at `3997` MB under `XCL_COHERENT_MB=3200`). **Regression run** main: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 3060 Ti title: retail-title seconds: 60 exit: 0x0 frames shown: 1487 (PresentX 1488) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 10404 MB ``` PR: ``` xcl-smoke v1 commit: 2c4bcb5d60907274c274d187f80fbdcacef74c4e gpu: NVIDIA GeForce RTX 3060 Ti title: retail-title seconds: 60 exit: 0x0 frames shown: 1517 (PresentX 1518) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 10401 MB ``` **Not tested** - AMD / Intel GPUs and Linux / Wine + vkd3d-proton. - Full retail Series S gameplay past 300 s world loading. **AI use** - Antigravity (Google DeepMind; exact model identifier not exposed in environment) wrote the code, unit test, and PR description; all tests and smoke runs were executed locally on the host RTX 3060 Ti.
Series X's larger coherent-heap measurement in uma_coherent.txt stays permanently pinned when switching a title to device_type = lockhart because note_coherent_need is monotonic; separating uma_coherent_lockhart.txt lets Series S size its own window without inflating non-local GPU memory on 8 GB GPUs. Part of #333.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:43:45 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 14:17 UTC · original · edited 2026-11-24 14:31 UTC

Full-suite run, since this PR has no test report yet. Tested exact head 2c4bcb5 (on its base 47efa2e).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: series_s_coherent_cache_is_separate_from_series_x.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored, no skips.
  • My first Radeon run of this head failed one timing check, origin_events_issue_tokens_and_flips_have_statistics ("4 origins at 60 Hz took 18 ms"), while other GPU jobs ran on the machine; the rerun above is clean.

Not tested

  • A release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 14:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/1110#issuecomment-7134127854) · edited 2026-11-24 14:31 UTC Full-suite run, since this PR has no test report yet. Tested exact head `2c4bcb5` (on its base `47efa2e`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **742 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `series_s_coherent_cache_is_separate_from_series_x`. - Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **742 passed, 0 failed, 41 ignored**, no skips. - My first Radeon run of this head failed one timing check, `origin_events_issue_tokens_and_flips_have_statistics` ("4 origins at 60 Hz took 18 ms"), while other GPU jobs ran on the machine; the rerun above is clean. **Not tested** - A release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-25 06:59 UTC · original

Independent Windows check of exact PR head 2c4bcb5d60907274c274d187f80fbdcacef74c4e.

Tested

  • Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M driver 30.0.13002.13003; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5; debug tests.
  • XCL_REQUIRE_GPU=0, XCL_DIRECT_DXIL=0; cargo test --locked -p xcl --lib -j 2 gpu::uma::tests -- --test-threads=1 --show-output: 8 passed, 0 failed, 0 ignored, 0 SKIPPED. This includes series_s_coherent_cache_is_separate_from_series_x, which exercises distinct cache paths and coherent-window calculations. These tests did not create a D3D12 device; the GPU identifies the host, not GPU coverage.

I did not run the full GPU workspace suite, change the host between Series X and Series S profiles, or run a paired title smoke for this PR. The test validates cache selection and calculations, not a live game's coherent allocation behavior.

AI-assisted checkout, testing, log verification, and report drafting with OpenAI Codex (GPT-6). No game data was used.

**@⁠luckyteagirl** on GitHub · 2026-11-25 06:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/1110#issuecomment-7155370023) Independent Windows check of exact PR head `2c4bcb5d60907274c274d187f80fbdcacef74c4e`. **Tested** - Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M driver `30.0.13002.13003`; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5; debug tests. - `XCL_REQUIRE_GPU=0`, `XCL_DIRECT_DXIL=0`; `cargo test --locked -p xcl --lib -j 2 gpu::uma::tests -- --test-threads=1 --show-output`: **8 passed, 0 failed, 0 ignored, 0 SKIPPED**. This includes `series_s_coherent_cache_is_separate_from_series_x`, which exercises distinct cache paths and coherent-window calculations. These tests did not create a D3D12 device; the GPU identifies the host, not GPU coverage. I did not run the full GPU workspace suite, change the host between Series X and Series S profiles, or run a paired title smoke for this PR. The test validates cache selection and calculations, not a live game's coherent allocation behavior. AI-assisted checkout, testing, log verification, and report drafting with OpenAI Codex (GPT-6). No game data was used.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 08:21 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 08:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/1110#issuecomment-7156933804) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/gpu/uma.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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