D3D12.X: streamed textures read through their pages are rechecked there #3725

Open
Lakanya wants to merge 1 commit from upstream-pr/3725 into main
Lakanya commented 2026-12-02 20:16:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Lakanya on 2026-12-02T20:16:28Z.


Textures read through physical pages mapped under a GPU view (CopyPageMappingsBatchX, Entry::paged) were skipped in seed_stream_recheck and pruned in recheck_streamed_unwatched_at. When the title moves a physical page, its texels are kept away from the view's address, and texels written there after the initial zeroed upload without a write the dirty path saw were never re-uploaded.

Paged textures are now seeded and rechecked on the milestone schedule through their resolved page table (sample_fingerprint_in), sampling three 128-byte probes per 64 KiB page (up to 256 evenly spaced pages, at most 96 KiB read) so late-arriving interior pages are caught. Entries with no mapped pages leave the schedule until a new mapping arrives.

Updated after review (head 8a16e245, squashed):

  • A partial upload of a paged texture makes no entry without a baseline, and at most 32 paged textures are fingerprinted per frame (up to 3 MiB read); the others stay due for the next frames.
  • A paged texture whose fingerprint changed is no longer queued whole: the recheck returns its range and refresh adds its pages to the look's dirty pages, so texture_upload::changed compares them with what was sent (known) and uploads only the pages that differ. A partial upload leaves the baseline of the last whole upload, so before this a paged texture whose writes had all been sent went up whole again at its next milestone (fromthemoonx's merge-check: 111.5 MiB / 99 whole uploads against 12.5 MiB / 0 on main in a 400-frame scratch test; AAsobu: about +0.5 GB of video memory in a retail world).

What is in it

  • d3d12x::title_textures: sample_fingerprint_in per-64 KiB page probing through PageMap, seeding (whole uploads only) and milestone recheck for Entry::paged textures in seed_stream_recheck and recheck_streamed_unwatched_at, with PAGED_CHECKS_PER_FRAME (32) paged checks per frame at most; a changed paged texture's pages go to the look's dirty pages (refresh) instead of a whole upload.
  • Unit tests: stream_recheck_catches_a_late_write_under_a_paged_texture (the changed texture's range is returned for the dirty pages, not queued whole), a_paged_texture_whose_writes_were_sent_is_not_uploaded_whole_at_its_milestones, a_paged_fingerprint_sees_a_late_page_inside_the_texture, paged_rechecks_keep_to_the_frame_budget, and a paged case in stream_recheck_partial_upload_without_an_entry_queues_a_whole_upload. The paged tests take TEST_LOCK whether or not an earlier test poisoned it.

Regression run
(both made with scripts/smoke.ps1 run on a hidden desktop, CreateDesktopW, so that no window shows)

xcl-smoke v1
commit: 0c725d5da298b90797993b568e30e6ff6b16e8b6
gpu: NVIDIA GeForce RTX 5070 Laptop GPU
title: 861a59ab
seconds: 60
exit: 0x0
frames shown: 1657 (PresentX 1658)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 15357 MB
xcl-smoke v1
commit: 8a16e245b1b3b922418b79f86fbfd7176b729033
gpu: NVIDIA GeForce RTX 5070 Laptop GPU
title: 861a59ab
seconds: 60
exit: 0x0
frames shown: 1653 (PresentX 1653)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 15880 MB

Tested

  • Hardware: NVIDIA GeForce RTX 5070 Laptop GPU (7891 MiB VRAM), Windows 11 x64, debug test build.
  • cargo test -p xcl --lib -- paged stream_recheck --test-threads=1 on 8a16e245: 8 passed. a_paged_texture_whose_writes_were_sent_is_not_uploaded_whole_at_its_milestones and stream_recheck_catches_a_late_write_under_a_paged_texture fail when a changed paged texture is queued whole (the previous behaviour); paged_rechecks_keep_to_the_frame_budget fails without the budget, and the paged case of the partial-upload test without the partial-upload rule.
  • cargo test -p xcl --lib -- hle::d3d12x::title_textures:: --test-threads=8, twice: 68 passed, 1 failed, 1 ignored each time. The one failure is placed_title_textures_share_vram_and_preserve_pixels ("row 3: new placement readback"), which fails the same way in parallel runs on main on this machine (817eb1fc) and passes alone; all paged tests pass.
  • cargo build --workspace then cargo test --workspace --no-fail-fast -- --test-threads=4 on 8a16e245: the xcl lib test process exits with 0x80004005 partway ("sparse upload preparation still failed after bounded retries", the stop #3488 reports on an AMD iGPU; main does the same); remaining binaries: 152 passed, 0 failed, 20 ignored.
  • xcl lib tests run one module group at a time (cargo test -p xcl --lib -- <module>:: --test-threads=4, 199 groups, all 2,888 tests): 2,852 passed, 4 failed, 32 ignored. Failed: placed_title_textures_share_vram_and_preserve_pixels and three pre-existing stream_recheck_* tests through the TEST_LOCK it poisons; they fail the same way on 817eb1fc and pass alone.
  • SKIPPED: 22 wave64 tests (no wave64), 2 heap-window tests (no heap windows), 1 driver-cache test (Developer Mode not enabled).
  • Retail title (C:\gta6), on a local stack (the first version of this change, before the partial-upload rule, the per-frame budget and the dirty-page routing, on top of other local commits over an older main, not this commit alone): 64–4,096 paged textures re-queued per run (none before); the look before submits took the same share of time (26 %). That count may include whole uploads this version no longer makes.

Not tested

  • AMD / RDNA GPUs, wave64.
  • A retail world on this commit: the video memory AAsobu measured (+0.5 GB) and the upload traffic fromthemoonx measured are not re-measured after the dirty-page routing (the 60 s smoke run does not reach the world); frame time at milestone frames during world load.
  • macOS / Linux (not built / not tested).

AI use

  • Claude Code, Claude Opus 5.5: implementation, unit tests, and initial retail-title measurements.
  • Antigravity, Gemini 4 Carbon: standalone rebase adaptation and compile verification onto 817eb1fc.
  • Claude Code, Claude Opus 5.5: review changes (including the dirty-page routing fromthemoonx proposed) and their tests, full test suite, scripts/smoke.ps1 regression runs, and PR preparation.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5613964454 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3725). Originally posted by [Lakanya](https://github.com/Lakanya) on 2026-12-02T20:16:28Z. --- Textures read through physical pages mapped under a GPU view (`CopyPageMappingsBatchX`, `Entry::paged`) were skipped in `seed_stream_recheck` and pruned in `recheck_streamed_unwatched_at`. When the title moves a physical page, its texels are kept away from the view's address, and texels written there after the initial zeroed upload without a write the dirty path saw were never re-uploaded. Paged textures are now seeded and rechecked on the milestone schedule through their resolved page table (`sample_fingerprint_in`), sampling three 128-byte probes per 64 KiB page (up to 256 evenly spaced pages, at most 96 KiB read) so late-arriving interior pages are caught. Entries with no mapped pages leave the schedule until a new mapping arrives. Updated after review (head `8a16e245`, squashed): - A partial upload of a paged texture makes no entry without a baseline, and at most 32 paged textures are fingerprinted per frame (up to 3 MiB read); the others stay due for the next frames. - A paged texture whose fingerprint changed is no longer queued whole: the recheck returns its range and `refresh` adds its pages to the look's dirty pages, so `texture_upload::changed` compares them with what was sent (`known`) and uploads only the pages that differ. A partial upload leaves the baseline of the last whole upload, so before this a paged texture whose writes had all been sent went up whole again at its next milestone (fromthemoonx's merge-check: 111.5 MiB / 99 whole uploads against 12.5 MiB / 0 on main in a 400-frame scratch test; AAsobu: about +0.5 GB of video memory in a retail world). **What is in it** - `d3d12x::title_textures`: `sample_fingerprint_in` per-64 KiB page probing through `PageMap`, seeding (whole uploads only) and milestone recheck for `Entry::paged` textures in `seed_stream_recheck` and `recheck_streamed_unwatched_at`, with `PAGED_CHECKS_PER_FRAME` (32) paged checks per frame at most; a changed paged texture's pages go to the look's dirty pages (`refresh`) instead of a whole upload. - Unit tests: `stream_recheck_catches_a_late_write_under_a_paged_texture` (the changed texture's range is returned for the dirty pages, not queued whole), `a_paged_texture_whose_writes_were_sent_is_not_uploaded_whole_at_its_milestones`, `a_paged_fingerprint_sees_a_late_page_inside_the_texture`, `paged_rechecks_keep_to_the_frame_budget`, and a paged case in `stream_recheck_partial_upload_without_an_entry_queues_a_whole_upload`. The paged tests take `TEST_LOCK` whether or not an earlier test poisoned it. **Regression run** (both made with `scripts/smoke.ps1` run on a hidden desktop, `CreateDesktopW`, so that no window shows) ``` xcl-smoke v1 commit: 0c725d5da298b90797993b568e30e6ff6b16e8b6 gpu: NVIDIA GeForce RTX 5070 Laptop GPU title: 861a59ab seconds: 60 exit: 0x0 frames shown: 1657 (PresentX 1658) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 15357 MB ``` ``` xcl-smoke v1 commit: 8a16e245b1b3b922418b79f86fbfd7176b729033 gpu: NVIDIA GeForce RTX 5070 Laptop GPU title: 861a59ab seconds: 60 exit: 0x0 frames shown: 1653 (PresentX 1653) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 15880 MB ``` **Tested** - Hardware: NVIDIA GeForce RTX 5070 Laptop GPU (7891 MiB VRAM), Windows 11 x64, debug test build. - `cargo test -p xcl --lib -- paged stream_recheck --test-threads=1` on `8a16e245`: 8 passed. `a_paged_texture_whose_writes_were_sent_is_not_uploaded_whole_at_its_milestones` and `stream_recheck_catches_a_late_write_under_a_paged_texture` fail when a changed paged texture is queued whole (the previous behaviour); `paged_rechecks_keep_to_the_frame_budget` fails without the budget, and the paged case of the partial-upload test without the partial-upload rule. - `cargo test -p xcl --lib -- hle::d3d12x::title_textures:: --test-threads=8`, twice: 68 passed, 1 failed, 1 ignored each time. The one failure is `placed_title_textures_share_vram_and_preserve_pixels` ("row 3: new placement readback"), which fails the same way in parallel runs on main on this machine (`817eb1fc`) and passes alone; all paged tests pass. - `cargo build --workspace` then `cargo test --workspace --no-fail-fast -- --test-threads=4` on `8a16e245`: the `xcl` lib test process exits with `0x80004005` partway ("sparse upload preparation still failed after bounded retries", the stop #3488 reports on an AMD iGPU; main does the same); remaining binaries: 152 passed, 0 failed, 20 ignored. - `xcl` lib tests run one module group at a time (`cargo test -p xcl --lib -- <module>:: --test-threads=4`, 199 groups, all 2,888 tests): 2,852 passed, 4 failed, 32 ignored. Failed: `placed_title_textures_share_vram_and_preserve_pixels` and three pre-existing `stream_recheck_*` tests through the `TEST_LOCK` it poisons; they fail the same way on `817eb1fc` and pass alone. - SKIPPED: 22 wave64 tests (no wave64), 2 heap-window tests (no heap windows), 1 driver-cache test (Developer Mode not enabled). - Retail title (`C:\gta6`), on a local stack (the first version of this change, before the partial-upload rule, the per-frame budget and the dirty-page routing, on top of other local commits over an older main, not this commit alone): 64–4,096 paged textures re-queued per run (none before); the look before submits took the same share of time (26 %). That count may include whole uploads this version no longer makes. **Not tested** - AMD / RDNA GPUs, wave64. - A retail world on this commit: the video memory AAsobu measured (+0.5 GB) and the upload traffic fromthemoonx measured are not re-measured after the dirty-page routing (the 60 s smoke run does not reach the world); frame time at milestone frames during world load. - macOS / Linux (not built / not tested). **AI use** - Claude Code, Claude Opus 5.5: implementation, unit tests, and initial retail-title measurements. - Antigravity, Gemini 4 Carbon: standalone rebase adaptation and compile verification onto `817eb1fc`. - Claude Code, Claude Opus 5.5: review changes (including the dirty-page routing fromthemoonx proposed) and their tests, full test suite, `scripts/smoke.ps1` regression runs, and PR preparation. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Foniass commented 2026-12-02 20:47:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T20:47:37Z.


Review of 85b53380 (code reading only, not a merge-check) · 2 medium, 1 nit

In short: The PR keeps textures read through their pages (Entry::paged) on the stream-recheck schedule and fingerprints them through their page table. Before, they were skipped at seeding and pruned at the first milestone. The logic and both tests match the description. The change does schedule every paged texture, including those whose pages are write-watched, and its per-check cost on the default path is unmeasured; the 60 s smoke run does not reach that path.

Medium

  1. Paged textures are scheduled even when their pages are write-watched.

    • In seed_stream_recheck (title_textures.rs ~2425), the range_is_fully_watched skip now applies only when d.pages.is_none(). In recheck_streamed_unwatched_at (~2491), e.paged never prunes.
    • Writes at a page's kept place already reach the GPU view through the dirty path (mirrors::views_of_written, ~2075), so a watched paged texture gains nothing from the schedule.
    • Each partial upload of a paged texture now goes through unsent (~2434) and gets a last_fp: None entry. The first milestone always queues a whole upload for such an entry, so a streaming texture gets an extra whole upload 4 frames after each partial one.
    • For the same reason, the "64-4,096 re-queued per run" figure cannot tell missed writes from these re-uploads.

    Fix: skip a paged texture when every place its PageMap resolves to is watched, or at least add no None-baseline entries for paged partial uploads.

  2. The per-check cost has no bound and was not measured on this commit.

    • sample_fingerprint_in (~2396-2400) makes three reads per 64 KiB page, up to 768 per texture. Each read of a page kept elsewhere is one ReadProcessMemory call.
    • Each due paged texture also costs a page_map → mirrors::resolve at every milestone (~2525).
    • There is no per-frame budget, and textures seeded by one large load-time submit all come due in the same frame.

    Please measure frame time at milestone frames during world load on this commit, or cap the paged checks per frame.

Nit

  1. Wrong references in a comment and the doc.
    • The comment at ~2423 and the description say a moved page is kept "at a home no write watch sees, cpu_writes". d3d12x::cpu_writes is the bottom-of-pipe write worker and has nothing to do with page homes.
    • The doc of sample_fingerprint_in (~2376) says "the same slices", but the function uses its own 128-byte probes per page.
Checked and fine
  • The arithmetic in sample_fingerprint_in: probe and step are never 0, the offsets stay inside [start, end), and nothing overflows at realistic sizes.
  • Seed and recheck fingerprint the same address: for a paged entry e.src == e.va.
  • The recheck calls page_map after TEXTURES is dropped, so there is no new lock-order edge.
  • An entry with no mapped pages left is dropped from STREAM_RECHECK and seeded again by the next whole upload.
  • stream_recheck_catches_a_late_write_under_a_paged_texture fails without the change and cleans up its tables. The second test's write falls outside the old start, mid and end slices.
  • Size (131+/10-), scope and the description outline meet the rules. XCL_TEXTURE_STREAM_RECHECK=0 still turns the recheck off.
  • Not a duplicate: #3617 also changes the stream recheck, for textures that are not paged and behind a switch. It touches the same code and will probably conflict.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7358324736 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3725#issuecomment-7358324736). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T20:47:37Z. --- **Review** of `85b53380` (code reading only, not a merge-check) · 2 medium, 1 nit **In short:** The PR keeps textures read through their pages (`Entry::paged`) on the stream-recheck schedule and fingerprints them through their page table. Before, they were skipped at seeding and pruned at the first milestone. The logic and both tests match the description. The change does schedule every paged texture, including those whose pages are write-watched, and its per-check cost on the default path is unmeasured; the 60 s smoke run does not reach that path. #### Medium 1. **Paged textures are scheduled even when their pages are write-watched.** - In `seed_stream_recheck` (`title_textures.rs` ~2425), the `range_is_fully_watched` skip now applies only when `d.pages.is_none()`. In `recheck_streamed_unwatched_at` (~2491), `e.paged` never prunes. - Writes at a page's kept place already reach the GPU view through the dirty path (`mirrors::views_of_written`, ~2075), so a watched paged texture gains nothing from the schedule. - Each partial upload of a paged texture now goes through `unsent` (~2434) and gets a `last_fp: None` entry. The first milestone always queues a whole upload for such an entry, so a streaming texture gets an extra whole upload 4 frames after each partial one. - For the same reason, the "64-4,096 re-queued per run" figure cannot tell missed writes from these re-uploads. Fix: skip a paged texture when every place its `PageMap` resolves to is watched, or at least add no `None`-baseline entries for paged partial uploads. 2. **The per-check cost has no bound and was not measured on this commit.** - `sample_fingerprint_in` (~2396-2400) makes three reads per 64 KiB page, up to 768 per texture. Each read of a page kept elsewhere is one `ReadProcessMemory` call. - Each due paged texture also costs a `page_map` → `mirrors::resolve` at every milestone (~2525). - There is no per-frame budget, and textures seeded by one large load-time submit all come due in the same frame. Please measure frame time at milestone frames during world load on this commit, or cap the paged checks per frame. #### Nit 3. **Wrong references in a comment and the doc.** - The comment at ~2423 and the description say a moved page is kept "at a home no write watch sees, `cpu_writes`". `d3d12x::cpu_writes` is the bottom-of-pipe write worker and has nothing to do with page homes. - The doc of `sample_fingerprint_in` (~2376) says "the same slices", but the function uses its own 128-byte probes per page. <details><summary>Checked and fine</summary> - The arithmetic in `sample_fingerprint_in`: `probe` and `step` are never 0, the offsets stay inside `[start, end)`, and nothing overflows at realistic sizes. - Seed and recheck fingerprint the same address: for a paged entry `e.src == e.va`. - The recheck calls `page_map` after `TEXTURES` is dropped, so there is no new lock-order edge. - An entry with no mapped pages left is dropped from `STREAM_RECHECK` and seeded again by the next whole upload. - `stream_recheck_catches_a_late_write_under_a_paged_texture` fails without the change and cleans up its tables. The second test's write falls outside the old start, mid and end slices. - Size (131+/10-), scope and the description outline meet the rules. `XCL_TEXTURE_STREAM_RECHECK=0` still turns the recheck off. - Not a duplicate: #3617 also changes the stream recheck, for textures that are not paged and behind a switch. It touches the same code and will probably conflict. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
Lakanya commented 2026-12-02 21:02:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Lakanya on 2026-12-02T21:02:04Z.


Thanks, @Foniass. Checked against 85b53380, and addressed in 91304b35 (squashed, description updated):

  1. Medium, confirmed: a partial upload of a paged texture went through unsent and got a last_fp: None entry, so a streaming texture got a whole upload 4 frames after each partial one. Paged textures now get no entry from a partial upload; their schedule starts at whole uploads. The paged case added to stream_recheck_partial_upload_without_an_entry_queues_a_whole_upload fails without it. I did not add the "every resolved place is watched" skip: a texture that keeps no entry from partial uploads only rechecks after whole uploads, which is the case the change is for.
  2. Medium, agreed: at most PAGED_CHECKS_PER_FRAME (32) paged textures are fingerprinted per frame (up to 3 MiB read); the others stay due and are checked in the next frames, since a checked one leaves the due set until its next milestone. paged_rechecks_keep_to_the_frame_budget checks 33 due textures: 32, then 33. Frame time at milestone frames during world load is still not measured on this commit (listed under Not tested).
  3. Nit, right: the cpu_writes reference is gone from the comment, the commit message and the description, and the doc of sample_fingerprint_in now describes its own probes.

The retail count (64–4,096 re-queued) came from the first version and may include the whole uploads of point 1; the description now says so.

AI use: Claude Code, Claude Opus 5.5 (checked the points, wrote the changes, tests and this reply; tests and smoke run on an RTX 5070 Laptop GPU).

<!-- greyfinch-sync:ivall/xcl:comment:7358692418 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3725#issuecomment-7358692418). Originally posted by [Lakanya](https://github.com/Lakanya) on 2026-12-02T21:02:04Z. --- Thanks, @Foniass. Checked against `85b53380`, and addressed in `91304b35` (squashed, description updated): 1. Medium, confirmed: a partial upload of a paged texture went through `unsent` and got a `last_fp: None` entry, so a streaming texture got a whole upload 4 frames after each partial one. Paged textures now get no entry from a partial upload; their schedule starts at whole uploads. The paged case added to `stream_recheck_partial_upload_without_an_entry_queues_a_whole_upload` fails without it. I did not add the "every resolved place is watched" skip: a texture that keeps no entry from partial uploads only rechecks after whole uploads, which is the case the change is for. 2. Medium, agreed: at most `PAGED_CHECKS_PER_FRAME` (32) paged textures are fingerprinted per frame (up to 3 MiB read); the others stay due and are checked in the next frames, since a checked one leaves the due set until its next milestone. `paged_rechecks_keep_to_the_frame_budget` checks 33 due textures: 32, then 33. Frame time at milestone frames during world load is still not measured on this commit (listed under **Not tested**). 3. Nit, right: the `cpu_writes` reference is gone from the comment, the commit message and the description, and the doc of `sample_fingerprint_in` now describes its own probes. The retail count (64–4,096 re-queued) came from the first version and may include the whole uploads of point 1; the description now says so. AI use: Claude Code, Claude Opus 5.5 (checked the points, wrote the changes, tests and this reply; tests and smoke run on an RTX 5070 Laptop GPU).
Foniass commented 2026-12-02 21:12:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T21:12:40Z.


Follow-up review of 91304b35, since 85b53380 (code reading only, not a merge-check; Build and test (Windows, no GPU) red) · 1 medium

In short: Since 85b53380 the PR is squashed into one commit with three changes:

  • a partial upload of a paged texture no longer creates an entry without a baseline;
  • paged checks are capped at PAGED_CHECKS_PER_FRAME (32) per frame, with a test;
  • the comment and doc wording is corrected.

That fixes all three earlier points. The one new problem is that the budget test uses a view size another test already uses, so the two can pair with each other's views when they run at the same time.

Medium

  1. The new budget test reuses a view size from a kernelx test.

    • paged_rechecks_keep_to_the_frame_budget (title_textures.rs ~6793) calls paged_views(199 * PAGE, n), and gpu_view_pages_record_the_physical_page_mapped_into_them (kernelx.rs ~4558) uses 199 * PAGE for its cpu_view.
    • mirrors::reserved pairs a GPU view with the newest unpaired CPU view of the same size (unpaired_cpu, kernelx.rs ~200). That is why both helpers' docs ask for a size no other test uses. The two tests share no lock.
    • On parallel test threads, either GPU view can pair with the other test's CPU view, and one of the two tests fails at random.

    Fix: use a size no other test passes to mirrors::reserved / cpu_view / paged_views.

Checked and fine
  • Earlier finding fixed: partial uploads of paged textures no longer create last_fp: None entries, so no whole upload follows 4 frames later (seed_stream_recheck ~2439). The paged case added to stream_recheck_partial_upload_without_an_entry_queues_a_whole_upload covers it. Write-watched paged textures are still scheduled, but now under the per-frame cap.
  • Earlier finding fixed: paged checks are capped at 32 per frame, about 3 MiB read (~2501). Textures over the budget stay due, because the due test is >= against the milestone (~2481). The test checks 32 textures, then the 33rd one frame later.
  • Earlier finding fixed: the comment at ~2426 and the doc of sample_fingerprint_in (~2376) no longer name cpu_writes or "the same slices", and the description no longer does either.
  • The description now says the retail re-queue figure predates these changes, and that frame time at milestone frames was not measured.
  • The cap applies only to paged entries, and pending paged entries use no budget.
  • 190+/12- in one file. #3617 touches the same recheck code for non-paged textures and will probably conflict.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7358952353 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3725#issuecomment-7358952353). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T21:12:40Z. --- **Follow-up review** of `91304b35`, since `85b53380` (code reading only, not a merge-check; `Build and test (Windows, no GPU)` red) · 1 medium **In short:** Since `85b53380` the PR is squashed into one commit with three changes: - a partial upload of a paged texture no longer creates an entry without a baseline; - paged checks are capped at `PAGED_CHECKS_PER_FRAME` (32) per frame, with a test; - the comment and doc wording is corrected. That fixes all three earlier points. The one new problem is that the budget test uses a view size another test already uses, so the two can pair with each other's views when they run at the same time. #### Medium 1. **The new budget test reuses a view size from a `kernelx` test.** - `paged_rechecks_keep_to_the_frame_budget` (`title_textures.rs` ~6793) calls `paged_views(199 * PAGE, n)`, and `gpu_view_pages_record_the_physical_page_mapped_into_them` (`kernelx.rs` ~4558) uses `199 * PAGE` for its `cpu_view`. - `mirrors::reserved` pairs a GPU view with the newest unpaired CPU view of the same size (`unpaired_cpu`, `kernelx.rs` ~200). That is why both helpers' docs ask for a size no other test uses. The two tests share no lock. - On parallel test threads, either GPU view can pair with the other test's CPU view, and one of the two tests fails at random. Fix: use a size no other test passes to `mirrors::reserved` / `cpu_view` / `paged_views`. <details><summary>Checked and fine</summary> - Earlier finding fixed: partial uploads of paged textures no longer create `last_fp: None` entries, so no whole upload follows 4 frames later (`seed_stream_recheck` ~2439). The paged case added to `stream_recheck_partial_upload_without_an_entry_queues_a_whole_upload` covers it. Write-watched paged textures are still scheduled, but now under the per-frame cap. - Earlier finding fixed: paged checks are capped at 32 per frame, about 3 MiB read (~2501). Textures over the budget stay due, because the due test is `>=` against the milestone (~2481). The test checks 32 textures, then the 33rd one frame later. - Earlier finding fixed: the comment at ~2426 and the doc of `sample_fingerprint_in` (~2376) no longer name `cpu_writes` or "the same slices", and the description no longer does either. - The description now says the retail re-queue figure predates these changes, and that frame time at milestone frames was not measured. - The cap applies only to paged entries, and pending paged entries use no budget. - 190+/12- in one file. #3617 touches the same recheck code for non-paged textures and will probably conflict. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
Foniass commented 2026-12-02 21:35:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T21:35:50Z.


Follow-up review of 7a59f45e, since 91304b35 (code reading only, not a merge-check) · 1 medium

In short: This push only changes the commit's author; the code is the same as at 91304b35 (git range-diff). The test point from my last review is still open.

Medium

  1. The budget test reuses a view size from a kernelx test (still open). paged_rechecks_keep_to_the_frame_budget (title_textures.rs ~6793) uses paged_views(199 * PAGE, n), the size gpu_view_pages_record_the_physical_page_mapped_into_them (kernelx.rs ~4558) uses for its cpu_view. mirrors::reserved pairs views by size, and the two tests share no lock, so on parallel test threads one can pair with the other's view and fail at random. Use a size no other test uses.
Checked and fine
  • No code change since the last review; the fixes listed there (no baseline-less entries for paged partial uploads, the per-frame cap, the corrected comments) still hold.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7359505703 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3725#issuecomment-7359505703). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T21:35:50Z. --- **Follow-up review** of `7a59f45e`, since `91304b35` (code reading only, not a merge-check) · 1 medium **In short:** This push only changes the commit's author; the code is the same as at `91304b35` (`git range-diff`). The test point from my last review is still open. #### Medium 1. **The budget test reuses a view size from a `kernelx` test (still open).** `paged_rechecks_keep_to_the_frame_budget` (`title_textures.rs` ~6793) uses `paged_views(199 * PAGE, n)`, the size `gpu_view_pages_record_the_physical_page_mapped_into_them` (`kernelx.rs` ~4558) uses for its `cpu_view`. `mirrors::reserved` pairs views by size, and the two tests share no lock, so on parallel test threads one can pair with the other's view and fail at random. Use a size no other test uses. <details><summary>Checked and fine</summary> - No code change since the last review; the fixes listed there (no baseline-less entries for paged partial uploads, the per-frame cap, the corrected comments) still hold. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
Lakanya commented 2026-12-02 22:00:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Lakanya on 2026-12-02T22:00:29Z.


Thanks, @Foniass, right: kernelx.rs uses 199 * PAGE for gpu_view_pages_record_the_physical_page_mapped_into_them. In ad7c0a89 the budget test uses 233 * PAGE, which no other test passes to paged_views / cpu_view / mirrors::reserved (checked with git grep over crates/xcl/src and crates/xcl/tests). hle::kernelx:: and hle::d3d12x::title_textures:: run together on 4 threads: 136 passed, 0 failed, 2 ignored. The regression blocks are rerun on the new head (description updated).

AI use: Claude Code, Claude Opus 5.5 (the change, the runs and this reply).

<!-- greyfinch-sync:ivall/xcl:comment:7360092309 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3725#issuecomment-7360092309). Originally posted by [Lakanya](https://github.com/Lakanya) on 2026-12-02T22:00:29Z. --- Thanks, @Foniass, right: `kernelx.rs` uses `199 * PAGE` for `gpu_view_pages_record_the_physical_page_mapped_into_them`. In `ad7c0a89` the budget test uses `233 * PAGE`, which no other test passes to `paged_views` / `cpu_view` / `mirrors::reserved` (checked with `git grep` over `crates/xcl/src` and `crates/xcl/tests`). `hle::kernelx::` and `hle::d3d12x::title_textures::` run together on 4 threads: 136 passed, 0 failed, 2 ignored. The regression blocks are rerun on the new head (description updated). AI use: Claude Code, Claude Opus 5.5 (the change, the runs and this reply).
Foniass commented 2026-12-02 22:01:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T22:01:13Z.


Follow-up review of ad7c0a89, since 7a59f45e (code reading only, not a merge-check) · no new findings

In short: This push fixes the test point from my last review. paged_rechecks_keep_to_the_frame_budget now uses views of 233 * PAGE, which no other test uses, so it can no longer pair with kernelx's views. Nothing else changed, and nothing blocks it.

Checked and fine
  • Earlier finding fixed: the budget test reused 199 * PAGE from gpu_view_pages_record_the_physical_page_mapped_into_them. 233 * PAGE appears nowhere else in the crate's tests. The other paged_views sizes (179, 181, 191, 193, 197) are unchanged and also unique.
  • The earlier fixes (no baseline-less entries for paged partial uploads, the 32-per-frame cap, the corrected comments) are unchanged.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7360109732 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3725#issuecomment-7360109732). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T22:01:13Z. --- **Follow-up review** of `ad7c0a89`, since `7a59f45e` (code reading only, not a merge-check) · no new findings **In short:** This push fixes the test point from my last review. `paged_rechecks_keep_to_the_frame_budget` now uses views of `233 * PAGE`, which no other test uses, so it can no longer pair with `kernelx`'s views. Nothing else changed, and nothing blocks it. <details><summary>Checked and fine</summary> - Earlier finding fixed: the budget test reused `199 * PAGE` from `gpu_view_pages_record_the_physical_page_mapped_into_them`. `233 * PAGE` appears nowhere else in the crate's tests. The other `paged_views` sizes (179, 181, 191, 193, 197) are unchanged and also unique. - The earlier fixes (no baseline-less entries for paged partial uploads, the 32-per-frame cap, the corrected comments) are unchanged. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
fromthemoonx commented 2026-12-03 05:43:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-03T05:43:55Z.


merge-check
base: a815de932c
head: 8a16e245b1
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3022 passed, 0 failed, 56 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same list as on main 395405e4; failing: none
review: rerun on the new head; the old report is folded below. Read the whole diff (1 file, +266 -27). My point 1 is fixed, and I found no new problem.

  1. The same scratch test as before: a 1 MiB paged texture on a real device, going through refresh. Same numbers in 3 of 3 runs. The main side is the binary from the last check; title_textures.rs and texture_upload.rs have not changed on main since.
case main old head this head
a write the watch does not report never arrives arrives arrives
one 4 KiB page written each frame, 400 frames 12.5 MiB, 0 whole 111.5 MiB, 99 whole 12.5 MiB, 0 whole
the same page written every 30th frame, 400 frames 0.9 MiB, 0 whole 13.9 MiB, 13 whole 0.9 MiB, 0 whole
  1. The pages found by the recheck join the dirty pages after the last early return of refresh that could drop them, so moving the baseline at that point loses no write.
  2. The paged and stream_recheck tests passed 30 of 30 runs. The title_textures module at 8 threads passed 8 of 8 on this head and 8 of 8 on main 0c725d5d, so placed_title_textures_share_vram_and_preserve_pixels did not fail here.
  3. Foniass's nit about the log line (it also counts textures whose pages were only compared) is right, and does not block.
  4. Not tested: a retail title (none on this machine), AMD. AAsobu's +0.5 GB of video memory in a retail world was measured on the old head. The whole uploads that may explain it are gone in my test, but nobody has measured the world again.
    performance: upload traffic equals main's in the test above. The cost of the fingerprints was not measured; it is capped at 32 textures a frame.
    verdict: safe to merge
    hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
Old report, on ad7c0a89 (not yet)

merge-check
base: 395405e4c0
head: ad7c0a8971
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3015 passed, 0 failed, 56 ignored (base: 3012 passed, 0 failed, 56 ignored); SKIPPED: 25, the same as base (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none
review: read the whole diff (1 file, +190 -12). The fix works, but it also uploads whole textures again when nothing was missed.

  1. Medium: a paged texture whose writes are seen goes up whole again at the next milestone. A partial upload leaves the baseline of the last whole upload in place. At the next milestone the fingerprint differs because of the bytes that partial upload already sent, so the texture is queued whole and its schedule starts again. Main does not do this, because it keeps paged textures out of the schedule.
    Measured with a scratch test: a 1 MiB paged texture on a real device, going through refresh, with the frame number set by the test. Same numbers in 3 of 3 runs:
case main this PR this PR + the change below
a write the watch does not report (I reset the watch after it) never arrives arrives arrives
one 4 KiB page written each frame, new bytes every other frame, 400 frames 12.5 MiB, 0 whole 111.5 MiB, 99 whole 12.5 MiB, 0 whole
the same page written every 30th frame, 400 frames 0.9 MiB, 0 whole 13.9 MiB, 13 whole 0.9 MiB, 0 whole

A change that fixes it: when a paged texture's fingerprint differs, do not set pending. Add its 4 KiB pages to this look's dirty pages instead. texture_upload::changed then compares them with what was last sent (known) and sends only what differs. I ran only the scratch test above with it, and stream_recheck_catches_a_late_write_under_a_paged_texture asserts pending, so it would need a change.
2) GPU-written paged textures are safe: the recheck drops them from the schedule, and checks again before it queues one.
3) title_textures tests at 8 threads: no failure in 4 runs (base: 4). The tests with paged in their name: no failure in 20 runs.
4) Not tested: a retail title (none on this machine), AMD. So I do not know how often a title writes paged textures this way.
performance: more upload traffic by default for paged textures that are written after their first upload, see 1). The cost of the fingerprints themselves was not measured; it is capped at 32 textures a frame.
verdict: not yet: whole re-uploads of paged textures whose writes were already sent (point 1)
hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)

<!-- greyfinch-sync:ivall/xcl:comment:7369051701 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3725#issuecomment-7369051701). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-12-03T05:43:55Z. --- merge-check base: a815de932c4dc8da3b383ca44f4b094aa406fec9 head: 8a16e245b1b3b922418b79f86fbfd7176b729033 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3022 passed, 0 failed, 56 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same list as on main 395405e4; failing: none review: rerun on the new head; the old report is folded below. Read the whole diff (1 file, +266 -27). My point 1 is fixed, and I found no new problem. 1) The same scratch test as before: a 1 MiB paged texture on a real device, going through `refresh`. Same numbers in 3 of 3 runs. The main side is the binary from the last check; `title_textures.rs` and `texture_upload.rs` have not changed on main since. | case | main | old head | this head | |---|---|---|---| | a write the watch does not report | never arrives | arrives | arrives | | one 4 KiB page written each frame, 400 frames | 12.5 MiB, 0 whole | 111.5 MiB, 99 whole | 12.5 MiB, 0 whole | | the same page written every 30th frame, 400 frames | 0.9 MiB, 0 whole | 13.9 MiB, 13 whole | 0.9 MiB, 0 whole | 2) The pages found by the recheck join the dirty pages after the last early return of `refresh` that could drop them, so moving the baseline at that point loses no write. 3) The `paged` and `stream_recheck` tests passed 30 of 30 runs. The `title_textures` module at 8 threads passed 8 of 8 on this head and 8 of 8 on main `0c725d5d`, so `placed_title_textures_share_vram_and_preserve_pixels` did not fail here. 4) Foniass's nit about the log line (it also counts textures whose pages were only compared) is right, and does not block. 5) Not tested: a retail title (none on this machine), AMD. AAsobu's +0.5 GB of video memory in a retail world was measured on the old head. The whole uploads that may explain it are gone in my test, but nobody has measured the world again. performance: upload traffic equals main's in the test above. The cost of the fingerprints was not measured; it is capped at 32 textures a frame. verdict: safe to merge hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5) <details><summary>Old report, on ad7c0a89 (not yet)</summary> > merge-check > base: 395405e4c0ed814afde0610a724dc96a3af329de > head: ad7c0a897110adad4fa038f7051f6020c8f018ef > merge: clean > build: cargo build --workspace -> ok > tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3015 passed, 0 failed, 56 ignored (base: 3012 passed, 0 failed, 56 ignored); SKIPPED: 25, the same as base (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none > review: read the whole diff (1 file, +190 -12). The fix works, but it also uploads whole textures again when nothing was missed. > 1) **Medium: a paged texture whose writes are seen goes up whole again at the next milestone.** A partial upload leaves the baseline of the last whole upload in place. At the next milestone the fingerprint differs because of the bytes that partial upload already sent, so the texture is queued whole and its schedule starts again. Main does not do this, because it keeps paged textures out of the schedule. > Measured with a scratch test: a 1 MiB paged texture on a real device, going through `refresh`, with the frame number set by the test. Same numbers in 3 of 3 runs: > > | case | main | this PR | this PR + the change below | > |---|---|---|---| > | a write the watch does not report (I reset the watch after it) | never arrives | arrives | arrives | > | one 4 KiB page written each frame, new bytes every other frame, 400 frames | 12.5 MiB, 0 whole | **111.5 MiB, 99 whole** | 12.5 MiB, 0 whole | > | the same page written every 30th frame, 400 frames | 0.9 MiB, 0 whole | **13.9 MiB, 13 whole** | 0.9 MiB, 0 whole | > > A change that fixes it: when a paged texture's fingerprint differs, do not set `pending`. Add its 4 KiB pages to this look's dirty pages instead. `texture_upload::changed` then compares them with what was last sent (`known`) and sends only what differs. I ran only the scratch test above with it, and `stream_recheck_catches_a_late_write_under_a_paged_texture` asserts `pending`, so it would need a change. > 2) GPU-written paged textures are safe: the recheck drops them from the schedule, and checks again before it queues one. > 3) `title_textures` tests at 8 threads: no failure in 4 runs (base: 4). The tests with `paged` in their name: no failure in 20 runs. > 4) Not tested: a retail title (none on this machine), AMD. So I do not know how often a title writes paged textures this way. > performance: more upload traffic by default for paged textures that are written after their first upload, see 1). The cost of the fingerprints themselves was not measured; it is capped at 32 textures a frame. > verdict: not yet: whole re-uploads of paged textures whose writes were already sent (point 1) > hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5) > </details>
AAsobu commented 2026-12-03 10:09:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by AAsobu on 2026-12-03T10:09:38Z.


merge-check
base: 16c2fd082a
head: ad7c0a8971
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3015 passed, 0 failed, 56 ignored; SKIPPED: 28 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps, 3 no D3D12 debug layer); failing: none
review: read the whole diff (+190/-12, title_textures.rs); no findings of our own. In-world A/B on a retail title (360 s runs, 3 valid per arm, warmed caches): presents per 2 s equal (median 3.86 main / 3.88 PR), peak commit +~140 MB (within run-to-run noise here, sd ~650 MB), VRAM +~0.5 GB (PR 16467-16497 MB, above every main run 15807-16221 MB). This fits the whole re-uploads fromthemoonx measured, at a moderate cost in a real world load. One PR run hit the device removal main 16c2fd08 already shows (0x887a0006, page fault at VA 0x0, same pipeline signature); it is not from this PR, and a repeat run was clean. Not checked: whether the picture changes (no frame captures), AMD.
performance: frames unchanged; ~0.5 GB more VRAM by default, measured (3 vs 3 runs).
verdict: safe to merge (frames and commit unchanged here; the ~0.5 GB VRAM it adds in a real world load is the cost to weigh against the fix)
hardware / tool and model: RTX 3090 24 GB (driver 621.24), i5-10600K, 32 GB, Windows 11 26300 / Claude Code (Claude Opus 5.5)

<!-- greyfinch-sync:ivall/xcl:comment:7374823915 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3725#issuecomment-7374823915). Originally posted by [AAsobu](https://github.com/AAsobu) on 2026-12-03T10:09:38Z. --- merge-check base: 16c2fd082ae2e96967a2ab553bc2e1032e491f70 head: ad7c0a897110adad4fa038f7051f6020c8f018ef merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3015 passed, 0 failed, 56 ignored; SKIPPED: 28 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps, 3 no D3D12 debug layer); failing: none review: read the whole diff (+190/-12, title_textures.rs); no findings of our own. In-world A/B on a retail title (360 s runs, 3 valid per arm, warmed caches): presents per 2 s equal (median 3.86 main / 3.88 PR), peak commit +~140 MB (within run-to-run noise here, sd ~650 MB), VRAM +~0.5 GB (PR 16467-16497 MB, above every main run 15807-16221 MB). This fits the whole re-uploads fromthemoonx measured, at a moderate cost in a real world load. One PR run hit the device removal main 16c2fd08 already shows (0x887a0006, page fault at VA 0x0, same pipeline signature); it is not from this PR, and a repeat run was clean. Not checked: whether the picture changes (no frame captures), AMD. performance: frames unchanged; ~0.5 GB more VRAM by default, measured (3 vs 3 runs). verdict: safe to merge (frames and commit unchanged here; the ~0.5 GB VRAM it adds in a real world load is the cost to weigh against the fix) hardware / tool and model: RTX 3090 24 GB (driver 621.24), i5-10600K, 32 GB, Windows 11 26300 / Claude Code (Claude Opus 5.5)
Lakanya commented 2026-12-03 11:48:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Lakanya on 2026-12-03T11:48:09Z.


Thanks, @fromthemoonx and @AAsobu. Point 1 is fixed in 8a16e245 (squashed, description updated), along the lines fromthemoonx proposed:

  • A paged texture whose fingerprint changed is no longer queued whole. recheck_streamed_unwatched returns its range instead of setting pending, and refresh adds its pages to the look's dirty pages (DIRTY_BUF, page-aligned, sorted and deduplicated), so texture_upload::changed compares them with what was last sent (known) and uploads only the pages that differ. The range goes back through the return value, with no new global. The baseline moves to the new fingerprint, so the next milestone finds nothing unless something changed again.
  • stream_recheck_catches_a_late_write_under_a_paged_texture now checks that the late write's range is returned for the dirty pages and that the texture is not made pending. The new a_paged_texture_whose_writes_were_sent_is_not_uploaded_whole_at_its_milestones covers a page written and already sent by a partial upload: the first milestone hands its pages to the dirty-page comparison, never a whole upload; the next milestone finds nothing; a write that was never sent is still found at the milestone after it. Both fail when the changed texture is queued whole (the previous head's behaviour).
  • title_textures at 8 threads, twice: 68 passed, 1 failed, 1 ignored. The failure is placed_title_textures_share_vram_and_preserve_pixels, which fails the same way in parallel on main on this machine (RTX 5070 Laptop) and passes alone; every paged test passes. The paged tests now take TEST_LOCK even after an earlier test poisoned it.
  • Full results and fresh xcl-smoke blocks (main 0c725d5d, this head) are in the description.

Not re-measured: the 400-frame upload traffic and the +0.5 GB of video memory in a retail world. I have no world run of this head; a re-run of either of your measurements would show it.

AI use: Claude Code, Claude Opus 5.5 (the change, the tests, the runs and this reply).

<!-- greyfinch-sync:ivall/xcl:comment:7377197252 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3725#issuecomment-7377197252). Originally posted by [Lakanya](https://github.com/Lakanya) on 2026-12-03T11:48:09Z. --- Thanks, @fromthemoonx and @AAsobu. Point 1 is fixed in `8a16e245` (squashed, description updated), along the lines fromthemoonx proposed: - A paged texture whose fingerprint changed is no longer queued whole. `recheck_streamed_unwatched` returns its range instead of setting `pending`, and `refresh` adds its pages to the look's dirty pages (`DIRTY_BUF`, page-aligned, sorted and deduplicated), so `texture_upload::changed` compares them with what was last sent (`known`) and uploads only the pages that differ. The range goes back through the return value, with no new global. The baseline moves to the new fingerprint, so the next milestone finds nothing unless something changed again. - `stream_recheck_catches_a_late_write_under_a_paged_texture` now checks that the late write's range is returned for the dirty pages and that the texture is not made `pending`. The new `a_paged_texture_whose_writes_were_sent_is_not_uploaded_whole_at_its_milestones` covers a page written and already sent by a partial upload: the first milestone hands its pages to the dirty-page comparison, never a whole upload; the next milestone finds nothing; a write that was never sent is still found at the milestone after it. Both fail when the changed texture is queued whole (the previous head's behaviour). - `title_textures` at 8 threads, twice: 68 passed, 1 failed, 1 ignored. The failure is `placed_title_textures_share_vram_and_preserve_pixels`, which fails the same way in parallel on main on this machine (RTX 5070 Laptop) and passes alone; every paged test passes. The paged tests now take `TEST_LOCK` even after an earlier test poisoned it. - Full results and fresh `xcl-smoke` blocks (main `0c725d5d`, this head) are in the description. Not re-measured: the 400-frame upload traffic and the +0.5 GB of video memory in a retail world. I have no world run of this head; a re-run of either of your measurements would show it. AI use: Claude Code, Claude Opus 5.5 (the change, the tests, the runs and this reply).
Foniass commented 2026-12-03 11:50:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T11:50:22Z.


Follow-up review of 8a16e245, since ad7c0a89 (code reading only, not a merge-check) · 1 nit

In short: This push changes what a milestone does when a paged texture's fingerprint changed. Instead of queuing the texture whole, its pages join the look's dirty pages, so texture_upload::changed sends only those that differ from what was sent. A partial upload leaves the baseline of the last whole one, so before this push a paged texture whose writes were all sent went up whole again at its next milestone. A new test covers that case, and a write that was never sent is still found. Nothing blocks it.

Nit

  1. The log counter now counts more than re-uploads. STREAM_RECHECK_HITS still logs "streamed unwatched re-uploads triggered", but for paged textures it now counts textures whose pages were compared, which may upload nothing. Rename the line, or count paged textures separately.
Checked and fine
  • recheck_streamed_unwatched_at returns (src, bytes) for changed paged textures, and still sets pending for the others. The baseline moves to the new fingerprint in both cases, so the next milestone finds nothing unless the bytes change again.
  • The returned ranges are split into pages of the look's page size, added to DIRTY_BUF, then sorted and deduplicated, so a page already dirty is not compared twice.
  • a_paged_texture_whose_writes_were_sent_is_not_uploaded_whole_at_its_milestones checks three things: a sent write gives the range once and no whole upload, the next milestone gives nothing, and an unsent write is found at the following one. The earlier test now expects the range instead of pending.
  • TEST_LOCK is taken with unwrap_or_else(into_inner) in these tests, so one failing test does not poison the rest.
  • The view size from the last push (233 * PAGE) and the new one (239 * PAGE) are not used by any other test.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7377246769 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3725#issuecomment-7377246769). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T11:50:22Z. --- **Follow-up review** of `8a16e245`, since `ad7c0a89` (code reading only, not a merge-check) · 1 nit **In short:** This push changes what a milestone does when a paged texture's fingerprint changed. Instead of queuing the texture whole, its pages join the look's dirty pages, so `texture_upload::changed` sends only those that differ from what was sent. A partial upload leaves the baseline of the last whole one, so before this push a paged texture whose writes were all sent went up whole again at its next milestone. A new test covers that case, and a write that was never sent is still found. Nothing blocks it. #### Nit 1. **The log counter now counts more than re-uploads.** `STREAM_RECHECK_HITS` still logs "streamed unwatched re-uploads triggered", but for paged textures it now counts textures whose pages were compared, which may upload nothing. Rename the line, or count paged textures separately. <details><summary>Checked and fine</summary> - `recheck_streamed_unwatched_at` returns `(src, bytes)` for changed paged textures, and still sets `pending` for the others. The baseline moves to the new fingerprint in both cases, so the next milestone finds nothing unless the bytes change again. - The returned ranges are split into pages of the look's page size, added to `DIRTY_BUF`, then sorted and deduplicated, so a page already dirty is not compared twice. - `a_paged_texture_whose_writes_were_sent_is_not_uploaded_whole_at_its_milestones` checks three things: a sent write gives the range once and no whole upload, the next milestone gives nothing, and an unsent write is found at the following one. The earlier test now expects the range instead of `pending`. - `TEST_LOCK` is taken with `unwrap_or_else(into_inner)` in these tests, so one failing test does not poison the rest. - The view size from the last push (`233 * PAGE`) and the new one (`239 * PAGE`) are not used by any other test. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
Gevroska commented 2026-12-03 13:44:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Gevroska on 2026-12-03T13:44:39Z.


@Lakanya I compared ad7c0a89 and 8a16e245 on my RTX 3080 using the same 128 KiB linear R8 texture. I supplied one ordinary write notification, then changed a 4 KiB stripe in the second backing allocation without notifying the ordinary dirty path. The copy payload came from XCL’s PageMap reads on both revisions.

Event ad7c0a89 copied 8a16e245 copied
Initial upload 128 KiB 128 KiB
Ordinary reported write 4 KiB 4 KiB
Recheck after that write was already uploaded 128 KiB 0
Recheck after the unreported write 128 KiB 4 KiB

All ten fenced snapshots matched across all 131,072 texels. The already-uploaded stripe retained 0x6a, the missed stripe became 0xc5, and its neighbor stayed unchanged.

This confirms both parts of the revision for a linear texture with known upload history: it avoided a redundant copy and recovered the missed write. The fixture used the pinned XCL selection code and a standalone D3D12 copy. I haven’t measured full-queue timing or VRAM use.

AI disclosure: OpenAI Codex GPT-6.2 Sol implemented and ran the comparison. A separate Codex reviewer verified the selected payloads and readbacks. GPT-6.2 Astra drafted this comment.

I reviewed and approved this comment before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7380316377 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3725#issuecomment-7380316377). Originally posted by [Gevroska](https://github.com/Gevroska) on 2026-12-03T13:44:39Z. --- @Lakanya I compared `ad7c0a89` and `8a16e245` on my RTX 3080 using the same 128 KiB linear R8 texture. I supplied one ordinary write notification, then changed a 4 KiB stripe in the second backing allocation without notifying the ordinary dirty path. The copy payload came from XCL’s `PageMap` reads on both revisions. | Event | `ad7c0a89` copied | `8a16e245` copied | |---|---:|---:| | Initial upload | 128 KiB | 128 KiB | | Ordinary reported write | 4 KiB | 4 KiB | | Recheck after that write was already uploaded | 128 KiB | 0 | | Recheck after the unreported write | 128 KiB | 4 KiB | All ten fenced snapshots matched across all 131,072 texels. The already-uploaded stripe retained `0x6a`, the missed stripe became `0xc5`, and its neighbor stayed unchanged. This confirms both parts of the revision for a linear texture with known upload history: it avoided a redundant copy and recovered the missed write. The fixture used the pinned XCL selection code and a standalone D3D12 copy. I haven’t measured full-queue timing or VRAM use. AI disclosure: OpenAI Codex GPT-6.2 Sol implemented and ran the comparison. A separate Codex reviewer verified the selected payloads and readbacks. GPT-6.2 Astra drafted this comment. I reviewed and approved this comment before posting.
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/3725:upstream-pr/3725'
git switch 'upstream-pr/3725'

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/3725'
git switch 'upstream-pr/3725'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3725'
git switch 'upstream-pr/3725'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3725'
git switch 'main'
git merge --squash 'upstream-pr/3725'
git switch 'main'
git merge --ff-only 'upstream-pr/3725'
git switch 'main'
git merge 'upstream-pr/3725'
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!3725
No description provided.