Repository navigation
Conversation
|
Review of In short: The PR keeps textures read through their pages ( Medium
Nit
Checked and fine
Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point. |
85b5338 to
91304b3
Compare
|
Thanks, @Foniass. Checked against
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). |
|
Follow-up review of In short: Since
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
Checked and fine
Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point. |
91304b3 to
7a59f45
Compare
|
Follow-up review of In short: This push only changes the commit's author; the code is the same as at Medium
Checked and fine
Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point. |
A texture read through the pages the title mapped under a GPU view (CopyPageMappingsBatchX, `Entry::paged`) was left out of STREAM_RECHECK: `seed_stream_recheck` skipped it and `recheck_streamed_unwatched_at` pruned it, on the grounds that its pages are found written where they are kept. A page the title moved is kept away from the view's address, and texels that arrived there after the first (zeroed) upload without a write the dirty path saw never reached the PC texture. Such a texture is now seeded and rechecked like the others, fingerprinted through its page table (`sample_fingerprint_in`): three 128-byte probes in every 64 KiB page (an even subset past 256 pages, at most 96 KiB read), so a single late page in the middle of a big texture is seen. A texture with no page mapped any more leaves the schedule; a new mapping reads it again. A partial upload of such a texture makes no entry without a baseline (that would bring a whole upload 4 frames after each partial one of a streaming texture): its schedule starts at whole uploads. At most 32 of them are fingerprinted in a frame (up to 3 MiB read); the others stay due for the next frames. GTA VI (before the two changes above): 64-4,096 paged textures re-queued per run, none before; the look before submits took the same share of time (26 %). Tests: stream_recheck_catches_a_late_write_under_a_paged_texture and a_paged_fingerprint_sees_a_late_page_inside_the_texture fail without the change (the first is pruned, the second's start/middle/end sample misses the page) and pass with it; paged_rechecks_keep_to_the_frame_budget and the paged case added to stream_recheck_partial_upload_without_an_entry_queues_a_whole_upload fail without the budget and the partial-upload rule. Assisted-by: Claude Code (Claude Opus 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7a59f45 to
ad7c0a8
Compare
|
Thanks, @Foniass, right: AI use: Claude Code, Claude Opus 5.5 (the change, the runs and this reply). |
|
Follow-up review of In short: This push fixes the test point from my last review. Checked and fine
Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point. |
|
merge-check
A change that fixes it: when a paged texture's fingerprint differs, do not set @Lakanya point 1 needs a change; the rest is fine. The change I tried (scratch code, not polished)// recheck_streamed_unwatched_at, where a changed entry is queued:
if e.paged && !e.gpu_written && !e.pending {
let end = e.src + e.tex.size() as usize;
FOUND.lock().unwrap().extend((e.src & !0xFFF..end).step_by(0x1000));
queued += 1;
} else if !e.gpu_written && !e.pending { /* as now */ }
// refresh, right after recheck_streamed_unwatched(&ranges, recheck_frame):
let found = std::mem::take(&mut *FOUND.lock().unwrap());
let dirty_len = if found.is_empty() { dirty_len } else {
DIRTY_BUF.with(|c| { let mut d = c.borrow_mut(); d.extend(found); d.sort_unstable(); d.dedup(); d.len() })
}; |
Textures read through physical pages mapped under a GPU view (
CopyPageMappingsBatchX,Entry::paged) were skipped inseed_stream_recheckand pruned inrecheck_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
ad7c0a89, squashed;91304b35with the commit author corrected and the budget test on a view size no other test uses): a partial upload of a paged texture no longer makes an entry without a baseline (which brought a whole upload 4 frames after each partial one of a streaming texture), and at most 32 paged textures are fingerprinted per frame (up to 3 MiB read); the others stay due for the next frames.What is in it
d3d12x::title_textures:sample_fingerprint_inper-64 KiB page probing throughPageMap, seeding (whole uploads only) and milestone recheck forEntry::pagedtextures inseed_stream_recheckandrecheck_streamed_unwatched_at, withPAGED_CHECKS_PER_FRAME(32) paged checks per frame at most.stream_recheck_catches_a_late_write_under_a_paged_texture,a_paged_fingerprint_sees_a_late_page_inside_the_texture,paged_rechecks_keep_to_the_frame_budget, and a paged case instream_recheck_partial_upload_without_an_entry_queues_a_whole_upload.Regression run
(both made with
scripts/smoke.ps1run on a hidden desktop,CreateDesktopW, so that no window shows)Tested
C:\gta6), on a local stack (the first version of this change, before the partial-upload rule and the per-frame budget, 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 %). As the review points out, that count may include whole uploads brought by partial ones, which this version no longer makes.91304b35: 4 passed.paged_rechecks_keep_to_the_frame_budgetfails without the budget ((33, 33)checked against(32, 33)), and the paged case fails without the partial-upload rule.cargo test -p xcl --lib -- hle::d3d12x::title_textures:: --test-threads=4 --skip placed_title_textures_share_vram_and_preserve_pixels: 67 passed, 0 failed, 1 ignored..\scripts\test.ps1(cargo test --workspace -- --test-threads=4) on91304b35: thexcllib test process exits with0x80004005partway ("sparse upload preparation still failed after bounded retries", the stop Tests: on an AMD RDNA2 iGPU the xcl lib test binary stops itself partway ("sparse upload preparation still failed after bounded retries") since #2959 #3488 reports on an AMD iGPU);817eb1fcexits the same way. Remaining binaries (--no-fail-fast): 152 passed, 0 failed, 20 ignored.xcllib tests run one module group at a time (cargo test -p xcl --lib -- <module>:: --test-threads=4, 199 groups, all 2,887 tests): 2,852 passed, 3 failed, 32 ignored. Failed:title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, then twostream_recheck_*tests through theTEST_LOCKit poisons; all pass alone, the wholetitle_texturesgroup passes without the first (above), and they fail the same way on817eb1fc.bind::tests::records_for_falls_back_to_whole_before_shrinking_halves, intermittent (on the first head thebind::group failed it 1 of 4 runs, and 2 of 3 on817eb1fc).ad7c0a89(only the budget test's view size differs from91304b35):cargo test -p xcl --lib -- paged_rechecks_keep_to_the_frame_budget: 1 passed;cargo test -p xcl --lib -- hle::kernelx:: hle::d3d12x::title_textures:: --test-threads=4 --skip placed_title_textures_share_vram_and_preserve_pixels(the test that used the same size runs next to it): 136 passed, 0 failed, 2 ignored.Not tested
AI use
817eb1fc.scripts/smoke.ps1regression runs, and PR preparation.🤖 Generated with Claude Code