Repository navigation
Conversation
|
I reproduced the reserved-page behavior on a pre-fix diagnostic build with Windows WARP. Once the texture readback completed, the native fence was at I also checked whether that pattern appeared during the RTX 3080 loading stall I reported in #505. On driver Next I’ll run the same mixed-page download on the PR’s parent and head AI disclosure — Codex GPT-6.2 Sol ran the initial diagnostics. GPT-6.2 Astra drafted this comment. I reviewed and approved this comment before posting. |
|
Source review on head This is distinct from an unused reservation. XCL's existing page-mapping fixture reserves a GPU-view VA, maps one of its pages to a committed physical pool page, and reads the pool's The publication path needs to distinguish a genuine unmapped hole from a reserved view with a mapped physical home. For a paged texture, resolve each destination page as uploads do, write changed bytes to the committed backing page, and skip only holes. Tie that resolution to the queue's mapping order so a remap cannot silently send the result to the wrong home before the writer is retired. A focused regression can extend the existing mapped-pool fixture with a GPU write and fence, then assert the pool bytes match the GPU result when the title sees completion. Keep the direct-reservation test too. This is a source trace; I did not run that new GPU regression. AI use: Codex (GPT-6.2 Sol) checked the publication path; Codex (GPT-6.2 Astra) independently traced the mapped-page case and regression. |
|
Follow-up to the mapped-page finding, on head The source permits this sequence: a queue submits a GPU write while a GPU-view page shows physical page A; a later The publication invariant should include page identity at the writer's queue position, not just resource generation and address. A later A→B remap must not send A's GPU result into B. If A remains live, its earlier write still needs publication to A; that may require taking the readback before the remap changes the resource's tiles. If A merely moves, publication should follow A to its current home. A focused regression should check both physical pages after A→B before fence publication, plus a move of A's backing address without a remap. This is a source-derived schedule; I have not run the new GPU regression. AI use: Codex (GPT-6.2 Sol) traced the mapping and download lifecycle. |
3cf3ebb to
069739d
Compare
|
Thanks for both findings; I checked them against the source and they hold. Head is now 069739d.
Limits, also under Not tested in the description:
Suite on 069739d: 2891 passed, 0 failed, 51 ignored, 28 SKIPPED lines (as before). The smoke blocks in the description are rerun on this head. AI use: Claude Code, Claude Fable 5.2 checked both points against the source, wrote the change and this reply, and ran the tests. |
|
merge-check AI-written and posted by Foniass without a human check of each point. |
|
I finished the Windows WARP comparison I mentioned above, using the same two-page texture download on parent While readback was pending, the native fence was This verifies the mixed-page fix in the synchronous fence-refresh path on WARP. The PR has since advanced to AI disclosure — Codex GPT-6.2 Sol ran the comparison. A separate GPT-6.2 Sol agent verified the test source and original run logs. GPT-6.2 Astra drafted this comment. I reviewed and approved this comment before posting. |
069739d to
a615e1b
Compare
|
Follow-up to the merge check above, head a615e1b: the two optional points are in.
No other change. Suite on a615e1b: 2891 passed, 0 failed, 51 ignored, 28 SKIPPED lines. The smoke blocks in the description are rerun on this head (the 120 s run logged no such line). AI use: Claude Code, Claude Fable 5.2 wrote the change and this comment and ran the tests. |
|
Re-review (head a615e1b; the range-diff from 069739d, which I merge-checked, read). Both suggestions are in. A page left out is now logged, the first two and then at powers of two ( AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
No open or merged PR makes the same change. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
A GPU-written title texture is copied back into the title's memory when its fence completes, and the fence value stays hidden until that copy succeeds. write_changed_pages refused any changed page that was not committed, so a destination whose pages are only reserved (a sparse home not in use) failed on every retry and the fence never became visible. In a retail game the frame-pacing wait on that fence then spun forever: from 522 s every retry of two downloads (0x20000 and 0x10000 bytes) found MEM_RESERVE pages, submits stopped at 528 s and the title's GPU watchdog crashed it at 552 s. With reserved and free pages left out (the title cannot read them), no download is held back and the game kept rendering to 623 s in the same run. A texture over pages the title mapped (CopyPageMappingsBatchX) is another case of the same refusal: its own address is a reserved GPU view and each page is kept elsewhere. Its download is now read and written where each page is kept, as uploads read it. A page that shows nothing takes no bytes, and neither does one mapped to another home since the download was prepared, so the GPU's bytes cannot reach the wrong page. Committed pages that are read-only or guarded still fail closed. A page left out is logged (the first two, then at powers of two). A mapped physical page that is reserved only until its first use (kernelx::lazy) is not such a page: the title can read it, so it is committed and written (found in triage, xcl-dev#1607). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
a615e1b to
c3a9139
Compare
|
On the triage note above (lazy pages): confirmed in the source, and fixed in c3a9139. A mapped physical page that is still zero stays On the two other points: the PR does carry two things since the review (the reserved-page skip and the paged-texture download); they are the same refusal in Suite on c3a9139: 2892 passed, 0 failed, 51 ignored, 28 SKIPPED lines. The smoke blocks in the description are rerun on this head. AI use: Claude Code, Claude Fable 5.2 checked the point against the source, wrote the change and this comment and ran the tests. |
|
merge-check AI-written and posted by Foniass without a human check of each point. |
gut0to
left a comment
There was a problem hiding this comment.
AI-assisted review: I traced the texture-download publication path and the page-mapping update path in the current head. I used AI assistance; I did not run a concurrency test.
| @@ -3997,7 +4006,11 @@ fn publish_download(download: &ReadyDownload) -> Result<bool, String> { | |||
| let mut table = TEXTURES.lock().unwrap(); | |||
| let Some(entry) = table.by_res.get_mut(&download.res) else { return Ok(true) }; | |||
There was a problem hiding this comment.
Could the mapping identity stay protected through these writes, or be revalidated under the same synchronization immediately before each write? mapped_homes() calls mirrors::resolve(), which returns a snapshot after releasing the page-map locks; apply_batches() can change the mappings afterward. If it remaps a GPU-view page after now is collected but before this loop writes the captured homes address, the stale download can write into a physical page whose mapping/ownership has since changed. Comparing against now closes changes that happened before the snapshot but leaves this check-to-write window. Please serialize the write with mapping updates or add a per-page revalidation that cannot race.
A GPU-written title texture is copied back into the title's memory when its fence completes, and the fence value stays hidden from the title until that copy succeeds.
write_changed_pagesrefused every changed page that was not committed, so a download into memory the title has only reserved (a sparse home not in use) failed on every retry and its fence never became visible. This change leaves reserved and free pages out of the copy, since the title cannot read them. One kind of reserved page is not left out: a mapped physical page that XCL keeps reserved until its first use (kernelx::lazy). The title can read it, so it is committed and written. Committed pages that are read-only or guarded still fail closed and retry, as before.A texture over pages the title mapped (
CopyPageMappingsBatchX) is a second case of the same refusal: its own address is a reserved GPU view and each page is kept elsewhere. Its download is now read and written where each page is kept, as uploads already read it. A page that shows nothing takes no bytes, and neither does a page mapped to another home since the download was prepared.In GTA 6 (part of #505) this hung the game when the world loaded. From 522 s, every retry of two downloads (0x20000 and 0x10000 bytes) found
MEM_RESERVEpages, so the title's frame-pacing wait on that fence spun, submits stopped at 528 s, and the title's own GPU watchdog crashed it at 552 s.What is in it
crates/xcl/src/hle/d3d12x/title_textures.rs:write_changed_pages(the coalesced runs from D3D12.X: coalesce contiguous WriteProcessMemory runs in write_changed_pages #3237) skips pages inMEM_RESERVE/MEM_FREEto the end of their region.write_changed_pages_leaves_out_pages_the_title_has_not_committed: it fails without the fix.write_changed_pagescallskernelx::lazy::ensureon a reserved run before it decides to skip (once per run), ascpu_writesand DirectStorage do before their writes. Unit testwrite_changed_pages_commits_a_lazy_page_and_writes_it: a committed page and a lazy page take the bytes, a plain reservation stays reserved. Found in triage (PR triage: duplicate PRs and batch-tested PRs, each checked by two contributors #1607).publish_download/prepare_downloads: a paged texture carries the homes of its pages (mapped_homes, fromkernelx::mirrors::resolve) from preparation to publication;write_changed_mapped_pageswrites each 64 KiB page at its home and leaves out a page whose home changed in between. A page left out, for either reason, is logged (note_download_page_left_out: the first two, then at powers of two).a_download_over_mapped_pages_is_written_where_they_are_kept: the pool page takes the bytes, a page never named goes to the CPU view, an unmapped page holds nothing back, and after a remap neither pool page is written.Tested
cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4on c3a9139 (on main ff0c364): 2892 passed, 0 failed, 51 ignored.SKIPPEDon this adapter: 28: 22no wave64; 2no heap windows; 2no d3d12SDKLayers.dll; 1no D3D12 debug layer; 1 cannot disable the driver cache (no Developer Mode).reserved pages must not hold the download back) and passes with it.Regression run
Each run follows one warm-up run of the same build; the A button is pressed once at 70 s.
Not tested
AI use
🤖 Generated with Claude Code