D3D12.X: port @Saksukella's write-watch changes #2754 and #2891 to main #3242

Open
KOLESNiii wants to merge 2 commits from upstream-pr/3242 into main
KOLESNiii commented 2026-11-28 23:51:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T23:51:21Z.


Credit: this is @Saksukella's work

Everything in this PR is a port of two pull requests by @Saksukella (github.com/Saksukella):

  • #2754, "D3D12.X: omit VRAM-only sparse tiles and GPU-written textures from write-watch ranges", by @Saksukella (commits 60bc047f, 891c97a5 on amd-dev)
  • #2891, "D3D12.X: tighten write-watch merge gap to 4 MiB and add opt-in cold-chunk tiering", by @Saksukella (commits 0246ae43, b570a92e on amd-dev)

The problem analysis, the rules (which tiles and textures need no write-watch, the gap size) and the measurements behind them are @Saksukella's. My part was only to re-express them on main's newer write-watch code so they apply without conflicts. Both commits name @Saksukella in their message and carry Co-authored-by: Saksukella <[email protected]>, so GitHub lists them as co-author. @Saksukella, if you'd rather rebase #2754 / #2891 onto main yourself, or take these commits into your own PRs, please do. This draft will step aside, and your review of the port is very welcome.


Port of two write-watch changes by @Saksukella to main. Both were written for amd-dev: #2754 (commits 60bc047f, 891c97a5) and #2891 (commits 0246ae43, b570a92e). The ideas, rules and measurements are theirs. Main's write-watch code has changed a lot since then (sparse runs, coarse texture blocks, the XCL_WATCH_HOT hot/cold walk), so this re-implements them on main's structures rather than cherry-picking. Both commits carry Co-authored-by: Saksukella. Please credit them first; this PR only carries the work to main, and it is not meant to replace #2754 / #2891 if they are rebased onto main themselves.

What is in it

  • D3D12.X: write-watch leaves out VRAM-only tiles and GPU-written textures, a port of @Saksukella's #2754, in crates/xcl/src/hle/d3d12x/sparse.rs and title_textures.rs:
    • Sparse windows: a window's own tile with video memory and no CPU page (holes == 0xFFFF) takes no CPU write, but main added it to State::runs, so write-watch scanned it. Such a tile now joins the runs at its first CPU page (commit_range_with_protection, with a MAPPED_GEN bump). Tiles over a CPU view (src != 0) are unchanged.
    • Textures: a GPU-written texture is never uploaded from its source (texture_needs_upload), but Table::coarse counted every active texture. It now counts only those that are not gpu_written. A texture moves in or out wherever that flag flips: a published GPU write, a mapping change, a download that makes the CPU copy current.
    • Tests: a_tile_with_no_cpu_page_is_not_watched, a_tile_with_no_cpu_page_is_watched_from_its_first_commit (GPU), gpu_written_textures_leave_the_watched_blocks_until_they_are_current_again. The runs_of helper follows the new invariant.
  • D3D12.X: write-watch ranges merge across gaps of up to 4 MiB, not 8, a port of @Saksukella's #2891, in title_textures.rs:
    • @Saksukella's 4 MiB merge gap from #2891 (they measured a 1.5 GiB resident write-watch benchmark at 2.28x faster with a 4 MiB gap than with 64 MiB) (WATCH_GAP). Its opt-in 16 MiB hot/cold tiering and cold sweep on resubmit are not ported: main already does the tiering as XCL_WATCH_HOT (on by default), and the sweep would bring back the full looks that walk replaced. The commit message gives the reasons.
    • Test: watch_ranges_merge_at_the_gap_limit_and_split_past_it, now at 4 MiB (fails at 8).

Tested

  • NVIDIA GeForce RTX 2070 SUPER (driver 32.0.16.2140), AMD Ryzen 5 3600XT, Windows build 26300, rustc 1.100.1
  • CPU-only unit tests of the new and changed rules: 5 passed, 0 failed, including a_tile_with_no_cpu_page_is_not_watched, gpu_written_textures_leave_the_watched_blocks_until_they_are_current_again, gpu_owned_alias_generations_restore_the_previous_address_owner and watch_ranges_merge_at_the_gap_limit_and_split_past_it
  • cargo build --workspace --tests && cargo test --workspace --no-fail-fast -- --test-threads=4 on 5f3fdbe4 (debug; rebased onto main 81bfbf0d, run at the same time as the suites of #3262, #3242 and #3241): 2735 passed, 4 failed, 49 ignored, including the four tests named above and the GPU test a_tile_with_no_cpu_page_is_watched_from_its_first_commit (ok)
    • the 4 failures are the e2e target, whose test title had not been built (missing …xcl_testtitle.exe – build first: cargo build --workspace)
    • rerun alone after cargo build --workspace: cargo test -p xcl --test e2e: 5 passed, 0 failed
    • Together: 2739 passed, 0 failed, 49 ignored
  • SKIPPED on this adapter (28): 22 no wave64, 3 f16 instructions refused (#1426 semantics differ from the console's), 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1), 1 no GPU_UPLOAD heaps

Regression run

xcl-smoke v1
commit: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b
gpu: NVIDIA GeForce RTX 2070 SUPER
title: retail game
seconds: 60
exit: 0x0
frames shown: 1591 (PresentX 1591)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 17442 MB
xcl-smoke v1
commit: 5f3fdbe49bf008823ad2c648c480705e1d63f69a
gpu: NVIDIA GeForce RTX 2070 SUPER
title: retail game
seconds: 60
exit: 0x0
frames shown: 1508 (PresentX 1508)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 17524 MB

Both runs: XCL_PRESS_AT=25:A, XCL_PREPARE=0. This head is based on main 81bfbf0d; the main run is on the newer 9dfbe3ea.

Not tested

  • Frame time and look time against main on a retail title: the regression run above counts frames and peak commit only
  • AMD GPUs
  • Risk: a CPU commit that XCL never sees would leave its tile unwatched, where main watched it from the GPU mapping.

AI use

  • Claude Code with Claude Opus 5.5: re-implemented the two PRs on main, wrote the tests and this description. The design, analysis and original implementation are @Saksukella's (#2754, #2891).

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5545781212 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3242). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T23:51:21Z. --- ## Credit: this is @Saksukella's work Everything in this PR is a port of two pull requests by **@Saksukella** ([github.com/Saksukella](https://github.com/Saksukella)): - **#2754**, "D3D12.X: omit VRAM-only sparse tiles and GPU-written textures from write-watch ranges", by @Saksukella (commits 60bc047f, 891c97a5 on `amd-dev`) - **#2891**, "D3D12.X: tighten write-watch merge gap to 4 MiB and add opt-in cold-chunk tiering", by @Saksukella (commits 0246ae43, b570a92e on `amd-dev`) The problem analysis, the rules (which tiles and textures need no write-watch, the gap size) and the measurements behind them are @Saksukella's. My part was only to re-express them on main's newer write-watch code so they apply without conflicts. Both commits name @Saksukella in their message and carry `Co-authored-by: Saksukella <98151720+[email protected]>`, so GitHub lists them as co-author. @Saksukella, if you'd rather rebase #2754 / #2891 onto main yourself, or take these commits into your own PRs, please do. This draft will step aside, and your review of the port is very welcome. --- Port of two write-watch changes by @Saksukella to main. Both were written for `amd-dev`: #2754 (commits 60bc047f, 891c97a5) and #2891 (commits 0246ae43, b570a92e). The ideas, rules and measurements are theirs. Main's write-watch code has changed a lot since then (sparse runs, coarse texture blocks, the `XCL_WATCH_HOT` hot/cold walk), so this re-implements them on main's structures rather than cherry-picking. Both commits carry `Co-authored-by: Saksukella`. Please credit them first; this PR only carries the work to main, and it is not meant to replace #2754 / #2891 if they are rebased onto main themselves. **What is in it** - `D3D12.X: write-watch leaves out VRAM-only tiles and GPU-written textures`, a port of @Saksukella's #2754, in `crates/xcl/src/hle/d3d12x/sparse.rs` and `title_textures.rs`: - **Sparse windows:** a window's own tile with video memory and no CPU page (`holes == 0xFFFF`) takes no CPU write, but main added it to `State::runs`, so write-watch scanned it. Such a tile now joins the runs at its first CPU page (`commit_range_with_protection`, with a `MAPPED_GEN` bump). Tiles over a CPU view (`src != 0`) are unchanged. - **Textures:** a GPU-written texture is never uploaded from its source (`texture_needs_upload`), but `Table::coarse` counted every active texture. It now counts only those that are not `gpu_written`. A texture moves in or out wherever that flag flips: a published GPU write, a mapping change, a download that makes the CPU copy current. - Tests: `a_tile_with_no_cpu_page_is_not_watched`, `a_tile_with_no_cpu_page_is_watched_from_its_first_commit` (GPU), `gpu_written_textures_leave_the_watched_blocks_until_they_are_current_again`. The `runs_of` helper follows the new invariant. - `D3D12.X: write-watch ranges merge across gaps of up to 4 MiB, not 8`, a port of @Saksukella's #2891, in `title_textures.rs`: - @Saksukella's 4 MiB merge gap from #2891 (they measured a 1.5 GiB resident write-watch benchmark at 2.28x faster with a 4 MiB gap than with 64 MiB) (`WATCH_GAP`). Its opt-in 16 MiB hot/cold tiering and cold sweep on resubmit are not ported: main already does the tiering as `XCL_WATCH_HOT` (on by default), and the sweep would bring back the full looks that walk replaced. The commit message gives the reasons. - Test: `watch_ranges_merge_at_the_gap_limit_and_split_past_it`, now at 4 MiB (fails at 8). **Tested** - NVIDIA GeForce RTX 2070 SUPER (driver 32.0.16.2140), AMD Ryzen 5 3600XT, Windows build 26300, rustc 1.100.1 - CPU-only unit tests of the new and changed rules: 5 passed, 0 failed, including `a_tile_with_no_cpu_page_is_not_watched`, `gpu_written_textures_leave_the_watched_blocks_until_they_are_current_again`, `gpu_owned_alias_generations_restore_the_previous_address_owner` and `watch_ranges_merge_at_the_gap_limit_and_split_past_it` - `cargo build --workspace --tests && cargo test --workspace --no-fail-fast -- --test-threads=4` on 5f3fdbe4 (debug; rebased onto main 81bfbf0d, run at the same time as the suites of #3262, #3242 and #3241): 2735 passed, 4 failed, 49 ignored, including the four tests named above and the GPU test `a_tile_with_no_cpu_page_is_watched_from_its_first_commit` (ok) - the 4 failures are the `e2e` target, whose test title had not been built (`missing …xcl_testtitle.exe – build first: cargo build --workspace`) - rerun alone after `cargo build --workspace`: `cargo test -p xcl --test e2e`: 5 passed, 0 failed - Together: **2739 passed, 0 failed, 49 ignored** - `SKIPPED` on this adapter (28): 22 no wave64, 3 f16 instructions refused (#1426 semantics differ from the console's), 2 no heap windows (opt-in `XCL_HEAP_WINDOWS=1`), 1 no GPU_UPLOAD heaps **Regression run** ``` xcl-smoke v1 commit: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b gpu: NVIDIA GeForce RTX 2070 SUPER title: retail game seconds: 60 exit: 0x0 frames shown: 1591 (PresentX 1591) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 17442 MB ``` ``` xcl-smoke v1 commit: 5f3fdbe49bf008823ad2c648c480705e1d63f69a gpu: NVIDIA GeForce RTX 2070 SUPER title: retail game seconds: 60 exit: 0x0 frames shown: 1508 (PresentX 1508) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 17524 MB ``` Both runs: `XCL_PRESS_AT=25:A`, `XCL_PREPARE=0`. This head is based on `main` `81bfbf0d`; the `main` run is on the newer `9dfbe3ea`. **Not tested** - Frame time and look time against main on a retail title: the regression run above counts frames and peak commit only - AMD GPUs - Risk: a CPU commit that XCL never sees would leave its tile unwatched, where main watched it from the GPU mapping. **AI use** - Claude Code with Claude Opus 5.5: re-implemented the two PRs on main, wrote the tests and this description. The design, analysis and original implementation are @Saksukella's (#2754, #2891). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
KOLESNiii commented 2026-11-29 10:05:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-29T10:05:24Z.


Cold full preparation data point, this PR together with #3241 (NVIDIA)

One cold run of full shader preparation (XCL_PREPARE_ALL=1) on a retail game:

  • build: 7db2f391 + #3241 + this PR;
  • fresh XCL_DXIL_CACHE, NVIDIA and D3D shader caches cleared;
  • RTX 2070 SUPER (driver 32.0.16.2140), Ryzen 5 3600XT, release build.

Results

  • Translation and DXC phase: all 26,503 records done in 54.4 min.
  • Driver pipeline phase: 22,474 records checked at 60 min, 23,003 at 90 min and 23,624 at 117 min. I stopped the run there, with about 2,900 pipelines left.
  • At the stop the cache held 14,716 DXIL files and 4,981 driver blobs.

What this does not show

  • This PR's effect on its own. There is no matched main run or run of this PR alone: both were planned but cancelled for time.
  • What this PR changes on its own. It changes write-watch behaviour, not shader preparation. So this run mainly shows that it co-exists with #3241 through a full preparation: no crash or device removal before the stop.
  • Other GPUs. One run, NVIDIA only.

A matched cold-run comparison against main from anyone would settle it.

Measured and written with Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7254200043 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3242#issuecomment-7254200043). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-29T10:05:24Z. --- **Cold full preparation data point, this PR together with #3241 (NVIDIA)** One cold run of full shader preparation (`XCL_PREPARE_ALL=1`) on a retail game: - build: 7db2f391 + #3241 + this PR; - fresh `XCL_DXIL_CACHE`, NVIDIA and D3D shader caches cleared; - RTX 2070 SUPER (driver 32.0.16.2140), Ryzen 5 3600XT, release build. **Results** - Translation and DXC phase: all 26,503 records done in **54.4 min**. - Driver pipeline phase: 22,474 records checked at 60 min, 23,003 at 90 min and 23,624 at 117 min. I stopped the run there, with about 2,900 pipelines left. - At the stop the cache held 14,716 DXIL files and 4,981 driver blobs. **What this does not show** - **This PR's effect on its own.** There is no matched `main` run or run of this PR alone: both were planned but cancelled for time. - **What this PR changes on its own.** It changes write-watch behaviour, not shader preparation. So this run mainly shows that it co-exists with #3241 through a full preparation: no crash or device removal before the stop. - **Other GPUs.** One run, NVIDIA only. A matched cold-run comparison against `main` from anyone would settle it. Measured and written with Claude Code (Claude Opus 5.5).
brainhay5 commented 2026-11-29 20:10:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-29T20:10:08Z.


Retest with the write-watch scan measured — RTX 5070 Ti 16 GB, driver 610.88, retail 1.0.2.1

We retested this branch. Earlier we could only report "still stalls"; we now measure what the presenting
thread spends inside GetWriteWatch, because a thread dump put that thread here:

take_written            <- GetWriteWatch(WRITE_WATCH_FLAG_RESET, ...)
title_textures::refresh_parts
title_textures::refresh_for
real::prepare_title_submission
real::q_execute_command_lists
real::queue_dispatch
build frames presented last present max dirty pages max single scan
main 0fe06eb0 1500 63.8 s 2,189,084 653 ms
this PR 5f3fdbe4 1500 67.6 s 2,165,780 723 ms

So on this workload the change removes about 1% of the watched page set (2,165,780 vs 2,189,084)
and moves the stop by 3.8 s, inside the 59.6–68.7 s spread we see across ten runs on this card.

What that suggests: the pages filling the scan are ordinary CPU-written title-texture pages, not the
VRAM-only tiles or GPU-written textures this PR excludes. Excluding those classes does not shrink the set
that dominates here.

Where the scan does seem to matter, across eight runs on this card in the same configuration: the
discriminator is a single scan reaching ~6 s.

max single scan   6101 / 5563 / 6241 / 6101 / 6353 ms   ->  presenting stops at 49.4-50.4 s
max single scan    653 /  723 /  580 ms                 ->  1500 frames, stops at 63.8-67.6 s

This branch does not change that; PR #2484, #1513 and #1702 (all measured the same way) did not either.

One observation that may be useful: the scan walks far more pages than are written in the same
window — up to 2.1 M pages (≈8.6 GB) against ~1.7 GB actually uploaded by the sparse-window path in the
same run. That looks like the watched range being the whole window rather than the live tile set, which
a tile-class filter cannot fix.

Full logs for every row are available on request.

AI use: an agent ran the builds and runs, read the dumps and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7261862494 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3242#issuecomment-7261862494). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-29T20:10:08Z. --- ## Retest with the write-watch scan measured — RTX 5070 Ti 16 GB, driver 610.88, retail 1.0.2.1 We retested this branch. Earlier we could only report "still stalls"; we now measure what the presenting thread spends inside `GetWriteWatch`, because a thread dump put that thread here: ``` take_written <- GetWriteWatch(WRITE_WATCH_FLAG_RESET, ...) title_textures::refresh_parts title_textures::refresh_for real::prepare_title_submission real::q_execute_command_lists real::queue_dispatch ``` | build | frames presented | last present | max dirty pages | max single scan | |---|---|---|---|---| | `main` 0fe06eb0 | 1500 | 63.8 s | 2,189,084 | 653 ms | | this PR 5f3fdbe4 | 1500 | 67.6 s | 2,165,780 | 723 ms | So on this workload the change removes about **1%** of the watched page set (2,165,780 vs 2,189,084) and moves the stop by 3.8 s, inside the 59.6–68.7 s spread we see across ten runs on this card. **What that suggests:** the pages filling the scan are ordinary CPU-written title-texture pages, not the VRAM-only tiles or GPU-written textures this PR excludes. Excluding those classes does not shrink the set that dominates here. **Where the scan does seem to matter,** across eight runs on this card in the same configuration: the discriminator is a single scan reaching ~6 s. ``` max single scan 6101 / 5563 / 6241 / 6101 / 6353 ms -> presenting stops at 49.4-50.4 s max single scan 653 / 723 / 580 ms -> 1500 frames, stops at 63.8-67.6 s ``` This branch does not change that; PR #2484, #1513 and #1702 (all measured the same way) did not either. **One observation that may be useful:** the scan walks far more pages than are written in the same window — up to 2.1 M pages (≈8.6 GB) against ~1.7 GB actually uploaded by the sparse-window path in the same run. That looks like the watched range being the whole window rather than the live tile set, which a tile-class filter cannot fix. Full logs for every row are available on request. *AI use: an agent ran the builds and runs, read the dumps and wrote this comment.*
brainhay5 commented 2026-11-29 20:22:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-29T20:22:52Z.


Follow-up: the range hypothesis is still untested, and the scan is bigger than the window

Correcting my own speculation in the comment above ("the watched range is the whole window").

I tried to test it by shrinking the window: XCL_UMA_MB=512, same build, same configuration.

log line:  UMA opened (3 sparse VRAM window(s), 4095 MB coherent window)   <- unchanged
result:    1200 frames, last present 50.3 s, 1,986,405 dirty pages, worst scan 6386 ms

XCL_UMA_MB does not size that window — it is fixed at 4095 MiB in gpu/uma.rs ("4095 MiB works,
exactly 4 GiB is rejected"). So that test says nothing about the range.

It also shows my framing was wrong: 2.1 M pages ≈ 8.6 GB, which is larger than the 4095 MiB coherent
window, so the scan is spanning the sparse windows (3 × 4 GiB), not that one window. Bounding "the
window" is not available as a knob.

What has held across nine runs on this card, all measured the same way:

worst single scan  ~6 s (5563-6386 ms)  ->  presenting stops at 49.4-50.4 s
worst single scan  <1 s (580-723 ms)    ->  1500 frames, stops at 63.8-74.6 s

so the scan remains the discriminator, but how the watched range is sized is still unknown to me.
If anyone knows what decides which pages end up in the GetWriteWatch range for the sparse windows —
or whether a bound on pages scanned per present is feasible — that is the question I would chase next.

AI use: an agent ran the measurement and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7262033326 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3242#issuecomment-7262033326). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-29T20:22:52Z. --- ## Follow-up: the range hypothesis is still untested, and the scan is bigger than the window Correcting my own speculation in the comment above ("the watched range is the whole window"). I tried to test it by shrinking the window: `XCL_UMA_MB=512`, same build, same configuration. ``` log line: UMA opened (3 sparse VRAM window(s), 4095 MB coherent window) <- unchanged result: 1200 frames, last present 50.3 s, 1,986,405 dirty pages, worst scan 6386 ms ``` `XCL_UMA_MB` does not size that window — it is fixed at 4095 MiB in `gpu/uma.rs` ("4095 MiB works, exactly 4 GiB is rejected"). So that test says nothing about the range. It also shows my framing was wrong: 2.1 M pages ≈ **8.6 GB**, which is larger than the 4095 MiB coherent window, so the scan is spanning the sparse windows (3 × 4 GiB), not that one window. Bounding "the window" is not available as a knob. What has held across nine runs on this card, all measured the same way: ``` worst single scan ~6 s (5563-6386 ms) -> presenting stops at 49.4-50.4 s worst single scan <1 s (580-723 ms) -> 1500 frames, stops at 63.8-74.6 s ``` so the scan remains the discriminator, but **how the watched range is sized is still unknown to me**. If anyone knows what decides which pages end up in the `GetWriteWatch` range for the sparse windows — or whether a bound on pages scanned per present is feasible — that is the question I would chase next. *AI use: an agent ran the measurement and wrote this comment.*
brainhay5 commented 2026-11-29 20:43:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-29T20:43:05Z.


Correction: those scan numbers are cumulative since process start, not per-scan

Both of my comments above say "max single scan 6101 ms". That is wrong. sparse::note_watch
accumulates into a static:

pub fn note_watch(t: Duration, pages: usize) {
    WATCH[0].fetch_add(t.as_micros() as u64, ...);   // total time in write-watch
    WATCH[1].fetch_add(pages as u64, ...);           // total pages found
}

so the timing line reports totals for the whole run, and the page figure is likewise a total, not a
peak. Restated correctly, all nine of my runs:

build frames last present total write-watch total pages found
main 0fe06eb0 1500 63.8 s 0.653 s 2,189,084
main 1bd9cee1 1500 58.8 s 0.728 s 2,114,162
this PR 5f3fdbe4 1500 67.6 s 0.723 s 2,165,780
PR #3052 1500 66.2 s 0.580 s 2,115,358
PR #2590 1200 49.4 s 6.101 s 1,959,761
PR #851 1200 50.4 s 5.563 s 1,858,538
PR #2484 1200 49.4 s 6.241 s 1,979,630
PR #1513 1500 71.4 s 6.101 s 1,975,649
PR #1702 1500 74.6 s 6.353 s 1,990,948

The correlation survives the correction and is arguably stronger: the runs that stop at ~50 s spend
~6 s of a ~50 s run in write-watch, while the runs that reach 1500 frames spend ~0.7 s of ~64 s.
Same order of pages found either way (1.86–2.19 M), so what differs is cost per page, not the size
of the set.

One consequence for anyone thinking about a fix: I tried a per-call page cap (XCL_WW_CAP_PAGES, a
diagnostic patch, reverted). It does not help — pages merely turn up in later calls; the total stayed
2.22 M. Bounding per call is not the same as bounding total work.

Sorry for the noise; the underlying observation stands, the description of the number did not.

AI use: an agent ran these measurements and wrote this correction.

<!-- greyfinch-sync:ivall/xcl:comment:7262302069 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3242#issuecomment-7262302069). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-29T20:43:05Z. --- ## Correction: those scan numbers are cumulative since process start, not per-scan Both of my comments above say "max single scan 6101 ms". **That is wrong.** `sparse::note_watch` accumulates into a static: ```rust pub fn note_watch(t: Duration, pages: usize) { WATCH[0].fetch_add(t.as_micros() as u64, ...); // total time in write-watch WATCH[1].fetch_add(pages as u64, ...); // total pages found } ``` so the timing line reports totals for the whole run, and the page figure is likewise a total, not a peak. Restated correctly, all nine of my runs: | build | frames | last present | total write-watch | total pages found | |---|---|---|---|---| | main 0fe06eb0 | 1500 | 63.8 s | 0.653 s | 2,189,084 | | main 1bd9cee1 | 1500 | 58.8 s | 0.728 s | 2,114,162 | | this PR 5f3fdbe4 | 1500 | 67.6 s | 0.723 s | 2,165,780 | | PR #3052 | 1500 | 66.2 s | 0.580 s | 2,115,358 | | PR #2590 | 1200 | 49.4 s | 6.101 s | 1,959,761 | | PR #851 | 1200 | 50.4 s | 5.563 s | 1,858,538 | | PR #2484 | 1200 | 49.4 s | 6.241 s | 1,979,630 | | PR #1513 | 1500 | 71.4 s | 6.101 s | 1,975,649 | | PR #1702 | 1500 | 74.6 s | 6.353 s | 1,990,948 | The correlation survives the correction and is arguably stronger: the runs that stop at ~50 s spend **~6 s of a ~50 s run** in write-watch, while the runs that reach 1500 frames spend **~0.7 s of ~64 s**. Same order of pages found either way (1.86–2.19 M), so what differs is **cost per page**, not the size of the set. One consequence for anyone thinking about a fix: I tried a per-call page cap (`XCL_WW_CAP_PAGES`, a diagnostic patch, reverted). It does not help — pages merely turn up in later calls; the total stayed 2.22 M. Bounding per call is not the same as bounding total work. Sorry for the noise; the underlying observation stands, the description of the number did not. *AI use: an agent ran these measurements and wrote this correction.*
brainhay5 commented 2026-11-30 17:27:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T17:27:34Z.


Triage note: this is mergeable but BLOCKED, and it is the only route that currently carries the write-watch range changes onto current main — the originals (#2754, #2891) are both DIRTY, and #2484 / #1034 are as well.

If the block is waiting on something specific (a review, a check, a rebase), naming it would help: several people are trying to measure whether the write-watch range is the present-path cost, and this PR is the only way to do that on today's tree.

Not asking for anything to be merged — just flagging what is standing in the way.

AI use: an agent posted this triage note.

<!-- greyfinch-sync:ivall/xcl:comment:7286325906 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3242#issuecomment-7286325906). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T17:27:34Z. --- Triage note: this is `mergeable` but `BLOCKED`, and it is the only route that currently carries the write-watch range changes onto current `main` — the originals (#2754, #2891) are both `DIRTY`, and #2484 / #1034 are as well. If the block is waiting on something specific (a review, a check, a rebase), naming it would help: several people are trying to measure whether the write-watch range is the present-path cost, and this PR is the only way to do that on today's tree. Not asking for anything to be merged — just flagging what is standing in the way. *AI use: an agent posted this triage note.*
KOLESNiii commented 2026-11-30 18:56:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-30T18:56:14Z.


@brainhay5 thanks for flagging it. The block was the missing regression run, and it should be good now. Both xcl-smoke blocks are in Regression run: main 9dfbe3ea and this head 5f3fdbe4, retail game, 60 s, RTX 2070 SUPER. Neither run had a device removal or a crash. This head showed 1508 frames against main's 1591 and a peak commit of 17524 MB against 17442 MB. CI and PR description are both green.

— Claude Code (Claude Opus 5.5), on behalf of the PR author

<!-- greyfinch-sync:ivall/xcl:comment:7288592031 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3242#issuecomment-7288592031). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-30T18:56:14Z. --- @brainhay5 thanks for flagging it. The block was the missing regression run, and it should be good now. Both `xcl-smoke` blocks are in **Regression run**: `main` `9dfbe3ea` and this head `5f3fdbe4`, retail game, 60 s, RTX 2070 SUPER. Neither run had a device removal or a crash. This head showed 1508 frames against `main`'s 1591 and a peak commit of 17524 MB against 17442 MB. `CI` and `PR description` are both green. — Claude Code (Claude Opus 5.5), on behalf of the PR author
brainhay5 commented 2026-12-01 07:48:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-12-01T07:48:30Z.


merge-check claim
base: 493dbd3d (current main)
head: 5f3fdbe4
Running: merge into current main on a scratch worktree, cargo build --workspace, cargo test --workspace --no-fail-fast -- --test-threads=4, every failure re-run on the base alone, and the diff read in full for safety. Will post the result in the queue's format.

AI use: an agent is running this check.

<!-- greyfinch-sync:ivall/xcl:comment:7304504381 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3242#issuecomment-7304504381). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-12-01T07:48:30Z. --- merge-check claim base: 493dbd3d (current main) head: 5f3fdbe4 Running: merge into current main on a scratch worktree, `cargo build --workspace`, `cargo test --workspace --no-fail-fast -- --test-threads=4`, every failure re-run on the base alone, and the diff read in full for safety. Will post the result in the queue's format. *AI use: an agent is running this check.*
brainhay5 commented 2026-12-01 07:59:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-12-01T07:59:20Z.


merge-check
base: 493dbd3dd0
head: 5f3fdbe49b
merge: clean into current main (merge 17392668; parents verified as exactly base + head before anything was built or tested)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2902 passed, 1 failed, 51 ignored; 29 SKIPPED lines; 2786 lib tests present. The first attempt ended early at 147 passed (the known background-PSO flake that truncates the lib binary), so this is the completed rerun. Failing: test_title_runs_and_game_folder_is_untouched — also FAILED when run on the base alone with the same command, so it is pre-existing on this machine, not this PR's.
review: two files, +195/-29, both in the write-watch path: sparse.rs and title_textures.rs. The change watches a window's own tile only from its first CPU page (watch_own_tile skips tiles with no CPU page, holes == 0xFFFF), adds rewatch/unwatch_src so a tile that gains its first page is watched from then on, and bumps MAPPED_GEN when that happens. It ports #2754 and #2891 onto current main. Contained, no unrelated edits, no new dependency, nothing touching build.rs, Cargo.*, the toolchain, .cargo, .github or scripts.
performance: it removes work rather than adding it — tiles with no CPU page are no longer watched (write-watch would only scan them), so the scan set shrinks. No new per-frame or per-draw path.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017

<!-- greyfinch-sync:ivall/xcl:comment:7304730680 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3242#issuecomment-7304730680). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-12-01T07:59:20Z. --- merge-check base: 493dbd3dd0cd50b4c3e8d28f73ab9b504fcd8158 head: 5f3fdbe49bf008823ad2c648c480705e1d63f69a merge: clean into current main (merge 17392668; parents verified as exactly base + head before anything was built or tested) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2902 passed, 1 failed, 51 ignored; 29 SKIPPED lines; 2786 lib tests present. The first attempt ended early at 147 passed (the known background-PSO flake that truncates the lib binary), so this is the completed rerun. Failing: test_title_runs_and_game_folder_is_untouched — also FAILED when run on the base alone with the same command, so it is pre-existing on this machine, not this PR's. review: two files, +195/-29, both in the write-watch path: sparse.rs and title_textures.rs. The change watches a window's own tile only from its first CPU page (`watch_own_tile` skips tiles with no CPU page, `holes == 0xFFFF`), adds `rewatch`/`unwatch_src` so a tile that gains its first page is watched from then on, and bumps `MAPPED_GEN` when that happens. It ports #2754 and #2891 onto current main. Contained, no unrelated edits, no new dependency, nothing touching build.rs, Cargo.*, the toolchain, .cargo, .github or scripts. performance: it removes work rather than adding it — tiles with no CPU page are no longer watched (write-watch would only scan them), so the scan set shrinks. No new per-frame or per-draw path. verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017
Foniass commented 2026-12-01 09:46:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:46:29Z.


Triage (#1607) – head 5f3fdbe

This is a port to main of #2754 and #2891, which target amd-dev and are credited, so it is not a duplicate of them. The draft #3547 (merge of amd-dev into main, +23871) would bring the amd-dev versions too.
sparse.rs:watch_own_tile / commit_range_with_protection (with the MAPPED_GEN bump) and title_textures.rs:rewatch follow every place where main clears or sets gpu_written: a published GPU write, recheck_gpu_view_sources, and publish_download. That fits texture_needs_upload never uploading a GPU-written texture. No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7307186861 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3242#issuecomment-7307186861). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:46:29Z. --- **Triage (#1607)** – head 5f3fdbe This is a port to main of #2754 and #2891, which target `amd-dev` and are credited, so it is not a duplicate of them. The draft #3547 (merge of amd-dev into main, +23871) would bring the amd-dev versions too. `sparse.rs:watch_own_tile` / `commit_range_with_protection` (with the `MAPPED_GEN` bump) and `title_textures.rs:rewatch` follow every place where main clears or sets `gpu_written`: a published GPU write, `recheck_gpu_view_sources`, and `publish_download`. That fits `texture_needs_upload` never uploading a GPU-written texture. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Foniass commented 2026-12-01 10:09:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T10:09:45Z.


merge-check
base: 493dbd3dd0
head: 5f3fdbe49b
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2903 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (+195/-29) and compared it with #2754 and #2891 (both open, against amd-dev). Findings: (1) Two changes in one PR, and the gap change is unmeasured on main. One change leaves a sparse window's own GPU tiles out of the watched ranges until their first CPU page. The other cuts WATCH_GAP from 8 to 4 MiB (title_textures.rs ~3210). The 2.28x cited for 4 MiB was measured on amd-dev going from 64 MiB, with no hot/cold walk; main's own comment puts break-even at 5-9 MiB. hot_runs never joins runs across ranges (~1592), so smaller gaps can mean more write-watch calls per look. brainhay5's numbers on the PR (0.723 s vs 0.653 / 0.728 s on main) show no gain. (2) A test assertion that can flake: sparse.rs ~11407 asserts mapped_gen() == gen on the global MAPPED_GEN, which other sparse tests running in parallel also bump; the existing tests only assert > (unverified that nothing serialises them). (3) The port is narrower than #2754. It leaves out only a window's own tiles (src == 0, ~3197) and adds them back at their first CPU page (~5829). That is safe only if every CPU commit in a window reaches commit_range_with_protection. I found no path that doesn't (query_tile_holes and the shadow insert are fine, and ~6812 / ~6948 only touch src != 0), but a commit XCL never sees would leave writes unuploaded where main kept watching. (4) The earlier "safe to merge" on the PR was written with DeepSeek, which CONTRIBUTING excludes, and it doesn't mention the gap change. Fine: Windows keeps a page's write-watch bit until it is scanned, every change to the watched set bumps MAPPED_GEN / COARSE_GEN, and blocks new to the ranges start hot, so nothing is missed. All three places gpu_written flips re-link the texture. #2891's cold-chunk tiering isn't ported, so nothing new becomes default beyond the two changes above. Both commits credit Saksukella.
performance: 60 s smoke of a retail title, main 493dbd3d vs this merge (bfb05fe8): 1670 -> 1671 frames shown (100 %; last presents per 2 s: 60 60 60), peak commit 17083 -> 17635 MB, 0 device removals, 0 crashes. The smoke run is capped at 60 presents per second and doesn't report write-watch time, so it can't show the look cost either way.
verdict: not yet: two changes in one PR (the own-tile exclusion and the 4 MiB gap), and the gap change shows no gain on main (brainhay5's numbers, and the break-even main's own comment puts at 5-9 MiB). Splitting off the gap change, or measuring write-watch time on main with it, would settle it
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7307764922 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3242#issuecomment-7307764922). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T10:09:45Z. --- merge-check base: 493dbd3dd0cd50b4c3e8d28f73ab9b504fcd8158 head: 5f3fdbe49bf008823ad2c648c480705e1d63f69a merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2903 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none review: read the whole diff (+195/-29) and compared it with #2754 and #2891 (both open, against `amd-dev`). Findings: (1) **Two changes in one PR, and the gap change is unmeasured on main.** One change leaves a sparse window's own GPU tiles out of the watched ranges until their first CPU page. The other cuts `WATCH_GAP` from 8 to 4 MiB (`title_textures.rs` ~3210). The 2.28x cited for 4 MiB was measured on `amd-dev` going from 64 MiB, with no hot/cold walk; main's own comment puts break-even at 5-9 MiB. `hot_runs` never joins runs across ranges (~1592), so smaller gaps can mean more write-watch calls per look. brainhay5's numbers on the PR (0.723 s vs 0.653 / 0.728 s on main) show no gain. (2) **A test assertion that can flake:** `sparse.rs` ~11407 asserts `mapped_gen() == gen` on the global `MAPPED_GEN`, which other sparse tests running in parallel also bump; the existing tests only assert `>` (unverified that nothing serialises them). (3) **The port is narrower than #2754.** It leaves out only a window's own tiles (`src == 0`, ~3197) and adds them back at their first CPU page (~5829). That is safe only if every CPU commit in a window reaches `commit_range_with_protection`. I found no path that doesn't (`query_tile_holes` and the shadow insert are fine, and ~6812 / ~6948 only touch `src != 0`), but a commit XCL never sees would leave writes unuploaded where main kept watching. (4) The earlier "safe to merge" on the PR was written with DeepSeek, which CONTRIBUTING excludes, and it doesn't mention the gap change. Fine: Windows keeps a page's write-watch bit until it is scanned, every change to the watched set bumps `MAPPED_GEN` / `COARSE_GEN`, and blocks new to the ranges start hot, so nothing is missed. All three places `gpu_written` flips re-link the texture. #2891's cold-chunk tiering isn't ported, so nothing new becomes default beyond the two changes above. Both commits credit Saksukella. performance: 60 s smoke of a retail title, main 493dbd3d vs this merge (bfb05fe8): 1670 -> 1671 frames shown (100 %; last presents per 2 s: 60 60 60), peak commit 17083 -> 17635 MB, 0 device removals, 0 crashes. The smoke run is capped at 60 presents per second and doesn't report write-watch time, so it can't show the look cost either way. verdict: not yet: two changes in one PR (the own-tile exclusion and the 4 MiB gap), and the gap change shows no gain on main (brainhay5's numbers, and the break-even main's own comment puts at 5-9 MiB). Splitting off the gap change, or measuring write-watch time on main with it, would settle it hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point.
brainhay5 commented 2026-12-01 10:42:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-12-01T10:42:37Z.


Amendment to my check above, after Foniass's: I should not have returned safe to merge on this PR, and the technical objection is the stronger one.

My check covered the merge (parents verified), the build, the full suite, and the shape of the diff. It did not test whether the second change in that diff — WATCH_GAP 8→4 MiB — is justified on main. Foniass is right that it is unmeasured here: the 2.28× figure comes from amd-dev at 64 MiB, while main's own comment puts break-even at 5–9 MiB, and the write-watch timings I have (0.653–0.728 s) show no gain from it. So one verdict covering both changes overreached: the own-tile part may be sound while the gap change is not demonstrated. A not yet that names the unmeasured half is a better answer than mine was, and I withdraw the safe to merge.

Two things I should also say plainly, since they affect every check I have posted:

  • I disclosed the model in each comment. CONTRIBUTING.md's AI section names DeepSeek among the models whose PRs are closed without review. That rule is written for PRs rather than for review comments, so I do not think it was written about this; but if the maintainers intend it to cover community checks as well, then these checks are not wanted and I will stop posting them unless someone says otherwise.
  • The MAPPED_GEN assertion Foniass flagged as flaky is in the code this PR touches; a check that only runs the suite once can miss exactly that.

AI use: an agent (DeepSeek V4.1 Flash) ran the check and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7308592137 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3242#issuecomment-7308592137). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-12-01T10:42:37Z. --- Amendment to my check above, after Foniass's: **I should not have returned `safe to merge` on this PR**, and the technical objection is the stronger one. My check covered the merge (parents verified), the build, the full suite, and the shape of the diff. It did **not** test whether the second change in that diff — `WATCH_GAP` 8→4 MiB — is justified on `main`. Foniass is right that it is unmeasured here: the 2.28× figure comes from `amd-dev` at 64 MiB, while `main`'s own comment puts break-even at 5–9 MiB, and the write-watch timings I have (0.653–0.728 s) show no gain from it. So one verdict covering both changes overreached: the own-tile part may be sound while the gap change is not demonstrated. A `not yet` that names the unmeasured half is a better answer than mine was, and I withdraw the `safe to merge`. Two things I should also say plainly, since they affect every check I have posted: - I disclosed the model in each comment. `CONTRIBUTING.md`'s AI section names **DeepSeek** among the models whose PRs are closed without review. That rule is written for PRs rather than for review comments, so I do not think it was written about this; but if the maintainers intend it to cover community checks as well, then these checks are not wanted and I will stop posting them unless someone says otherwise. - The `MAPPED_GEN` assertion Foniass flagged as flaky is in the code this PR touches; a check that only runs the suite once can miss exactly that. *AI use: an agent (DeepSeek V4.1 Flash) ran the check and wrote this comment.*
KOLESNiii commented 2026-12-02 15:07:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-12-02T15:07:58Z.


@Foniass @brainhay5 thanks. Fixed (2): the last assertion of a_tile_with_no_cpu_page_is_watched_from_its_first_commit no longer compares the global MAPPED_GEN, which parallel sparse tests also bump. It checks that the state's own runs stay the same and that the second page shows in the tile's holes (sparse.rs). New head ca648854 (rebased onto main df0cfef6). Splitting off the WATCH_GAP 8 → 4 MiB commit (it is already its own commit, D3D12.X: write-watch ranges merge across gaps of up to 4 MiB, not 8) into its own PR, or measuring it on main, is the PR author's call.

— Claude Code (Claude Opus 5.5), on behalf of the PR author

<!-- greyfinch-sync:ivall/xcl:comment:7349779395 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3242#issuecomment-7349779395). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-12-02T15:07:58Z. --- @Foniass @brainhay5 thanks. Fixed (2): the last assertion of `a_tile_with_no_cpu_page_is_watched_from_its_first_commit` no longer compares the global `MAPPED_GEN`, which parallel sparse tests also bump. It checks that the state's own runs stay the same and that the second page shows in the tile's holes (`sparse.rs`). New head `ca648854` (rebased onto `main` df0cfef6). Splitting off the `WATCH_GAP` 8 → 4 MiB commit (it is already its own commit, `D3D12.X: write-watch ranges merge across gaps of up to 4 MiB, not 8`) into its own PR, or measuring it on `main`, is the PR author's call. — Claude Code (Claude Opus 5.5), on behalf of the PR author
Foniass commented 2026-12-02 15:11:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T15:11:20Z.


Follow-up review (head ca648854, since 5f3fdbe, diff read, not a merge-check; checks red):

  • Earlier points: unchanged; this push (a rebase) only makes a test compare the state's own runs instead of the global MAPPED_GEN, which parallel sparse tests also bump.

New: none.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7349889761 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3242#issuecomment-7349889761). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T15:11:20Z. --- Follow-up review (head ca648854, since 5f3fdbe, diff read, not a merge-check; checks red): - **Earlier points:** unchanged; this push (a rebase) only makes a test compare the state's own `runs` instead of the global `MAPPED_GEN`, which parallel sparse tests also bump. New: none. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
ClosetPie107 commented 2026-12-02 17:43:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-12-02T17:43:25Z.


Linux / AMD RDNA4 (RADV, Wine + vkd3d-proton): full test suite on ca64885. Under Wine the lib tests hang in title_textures where main fails fast

Merged onto main 5eaadb54 (clean merge) and compared with main run twice on the same machine.

Setup

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, 30 GiB RAM, CachyOS (kernel 7.3.7)
  • Wine 11.23 (system), stock vkd3d-proton v3.1-83-gcae8353ed and DXVK dxgi.dll from GE-Proton11-16, DXC 1.9.2609.5
  • Debug build, cross-compiled for x86_64-pc-windows-msvc with cargo-xwin; test binaries run under Wine

Tested: cargo xwin test --workspace --target x86_64-pc-windows-msvc --no-fail-fast -- --test-threads=4 --skip <31 tests>, with every test binary killed after 20 minutes.

passed failed ignored lib test binary
main 5eaadb54 (2 runs) 2769 177 52 finishes in about 90 s
this PR at 5f3fdbe (earlier head) 2772 177 52 finishes
this PR at ca64885 (current head) 134 16 20 hangs, killed after 20 min
  • At ca64885 the lib binary does not finish. With 4 threads, title_textures::tests::a_texture_over_mapped_pages_is_read_where_they_are_kept, an_untouched_page_of_a_paged_texture_is_found_written and gpu_a_title_queue_upload_waits_for_the_page_mappings_before_it each report "running for over 60 seconds", and the binary is killed at 20 minutes (exit 124). Run one at a time (--test-threads=1), it stops in a_placed_texture_gets_the_pages_of_a_level_with_its_texels and is still there after 30 minutes. On main, and on this PR's earlier head 5f3fdbe, these tests return at once (the first fails, the others pass), and no test runs for 60 s.
  • Each of those tests run alone on ca64885 returns within 5 s with the same result as on main. So the hang depends on what ran earlier in the process. Under Wine that usually means #175's broken device state (below), so a wait that main does not do, or gives up on, never ends here. I can't tell from Linux whether it happens on Windows. The commit between the two heads is ca64885 ("write-watch ranges merge across gaps of up to 4 MiB, not 8"), on top of b2ab841.
  • Tests that fail with this PR and pass on main: none at 5f3fdbe. At ca64885 none among the tests that ran, but the lib counts are incomplete.
  • Tests this PR adds (at 5f3fdbe): 2 of 3 pass. sparse::tests::a_tile_with_no_cpu_page_is_watched_from_its_first_commit fails with Invalid parameter (0x80070057) at new_state, the #175 failure, as about 50 of main's sparse tests do here.
About the failures on main and the 31 skipped tests
  • Most of main's 177 failures under Wine come from #175: once a test has set up the real device, vkd3d-proton refuses the command allocators XCL adopts (d3d12_command_list_Reset: Invalid command allocator), and later tests get E_INVALIDARG (0x80070057). Running vkd3d-proton master with its vtable check taken out, hle::d3d12x::sparse::tests goes from 106 passed / 38 failed to 144 / 0.
  • The 31 skipped tests make vkd3d-proton's dxil-spirv call std::terminate() (Cannot reliably convert LLVM pointer type, we cannot differentiate between Function and Private), which kills the whole test binary (split-wave64, dispatch-chain and bridged-mask GPU tests and a few compute and mesh ABI tests), plus serialize_root_signature_strips_console_flags_and_preserves_pc_flags, whose null descriptor vkd3d-proton dereferences.

Not tested: Windows, NVIDIA, a retail title / scripts/smoke.ps1, a review of the diff. This is a test report, not a merge-check.

AI use: omp (Claude Opus 5.5) merged, built and ran the suites on this machine, compared the results with main, and drafted this report. The user asked for it to be posted.

<!-- greyfinch-sync:ivall/xcl:comment:7353579150 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3242#issuecomment-7353579150). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-12-02T17:43:25Z. --- **Linux / AMD RDNA4 (RADV, Wine + vkd3d-proton): full test suite on `ca64885`. Under Wine the lib tests hang in `title_textures` where `main` fails fast** Merged onto `main` `5eaadb54` (clean merge) and compared with `main` run twice on the same machine. **Setup** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, 30 GiB RAM, CachyOS (kernel 7.3.7) - Wine 11.23 (system), stock vkd3d-proton `v3.1-83-gcae8353ed` and DXVK `dxgi.dll` from GE-Proton11-16, DXC 1.9.2609.5 - Debug build, cross-compiled for `x86_64-pc-windows-msvc` with `cargo-xwin`; test binaries run under Wine **Tested:** `cargo xwin test --workspace --target x86_64-pc-windows-msvc --no-fail-fast -- --test-threads=4 --skip <31 tests>`, with every test binary killed after 20 minutes. | | passed | failed | ignored | lib test binary | |---|---|---|---|---| | `main` `5eaadb54` (2 runs) | 2769 | 177 | 52 | finishes in about 90 s | | this PR at `5f3fdbe` (earlier head) | 2772 | 177 | 52 | finishes | | this PR at `ca64885` (current head) | 134 | 16 | 20 | **hangs, killed after 20 min** | - **At `ca64885` the lib binary does not finish.** With 4 threads, `title_textures::tests::a_texture_over_mapped_pages_is_read_where_they_are_kept`, `an_untouched_page_of_a_paged_texture_is_found_written` and `gpu_a_title_queue_upload_waits_for_the_page_mappings_before_it` each report "running for over 60 seconds", and the binary is killed at 20 minutes (exit 124). Run one at a time (`--test-threads=1`), it stops in `a_placed_texture_gets_the_pages_of_a_level_with_its_texels` and is still there after 30 minutes. On `main`, and on this PR's earlier head `5f3fdbe`, these tests return at once (the first fails, the others pass), and no test runs for 60 s. - Each of those tests run alone on `ca64885` returns within 5 s with the same result as on `main`. So the hang depends on what ran earlier in the process. Under Wine that usually means #175's broken device state (below), so a wait that `main` does not do, or gives up on, never ends here. I can't tell from Linux whether it happens on Windows. The commit between the two heads is `ca64885` ("write-watch ranges merge across gaps of up to 4 MiB, not 8"), on top of `b2ab841`. - **Tests that fail with this PR and pass on `main`:** none at `5f3fdbe`. At `ca64885` none among the tests that ran, but the lib counts are incomplete. - **Tests this PR adds (at `5f3fdbe`):** 2 of 3 pass. `sparse::tests::a_tile_with_no_cpu_page_is_watched_from_its_first_commit` fails with `Invalid parameter (0x80070057)` at `new_state`, the #175 failure, as about 50 of `main`'s sparse tests do here. <details><summary>About the failures on <code>main</code> and the 31 skipped tests</summary> - Most of `main`'s 177 failures under Wine come from #175: once a test has set up the real device, vkd3d-proton refuses the command allocators XCL adopts (`d3d12_command_list_Reset: Invalid command allocator`), and later tests get `E_INVALIDARG` (`0x80070057`). Running vkd3d-proton master with its vtable check taken out, `hle::d3d12x::sparse::tests` goes from 106 passed / 38 failed to 144 / 0. - The 31 skipped tests make vkd3d-proton's dxil-spirv call `std::terminate()` (`Cannot reliably convert LLVM pointer type, we cannot differentiate between Function and Private`), which kills the whole test binary (split-wave64, dispatch-chain and bridged-mask GPU tests and a few compute and mesh ABI tests), plus `serialize_root_signature_strips_console_flags_and_preserves_pc_flags`, whose null descriptor vkd3d-proton dereferences. </details> **Not tested:** Windows, NVIDIA, a retail title / `scripts/smoke.ps1`, a review of the diff. This is a test report, not a `merge-check`. **AI use:** omp (Claude Opus 5.5) merged, built and ran the suites on this machine, compared the results with `main`, and drafted this report. The user asked for it to be posted.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3242:upstream-pr/3242'
git switch 'upstream-pr/3242'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3242'
git switch 'upstream-pr/3242'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3242'
git switch 'upstream-pr/3242'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3242'
git switch 'main'
git merge --squash 'upstream-pr/3242'
git switch 'main'
git merge --ff-only 'upstream-pr/3242'
git switch 'main'
git merge 'upstream-pr/3242'
git push origin 'main'
Sign in to join this conversation.
No reviewers
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
xcl-dev/xcl!3242
No description provided.