Repository navigation
Conversation
Port upstream PR #2437 (by KOLESNiii, commit bb9bea2) onto amd-dev. sync_title_buffers checked every copy's source and scanned indices with gpu::shader::readable. For a range with a non-resident page or over 16 pages, that walked the region with VirtualQuery, stalling the render thread for 1.1-8.8 ms inside draws (#2389 / #2392). Use title_textures::copy_committed_region (ReadProcessMemory, which cannot fault) so freed or protected pages keep what the mirror already holds, and scan indices from the index buffer's mirror once copied (keeping readable() only when an index buffer has no mirror). Includes regression test. Fixes #2392. Part of #2389. Assisted-by: Antigravity (Gemini 4 Neon High)
…#2414, xcl-dev#2415 Integrates per-draw mirror sync fast path (xcl-dev#2437), PresentX compositor hardening (xcl-dev#2418), XAudio2 GetState buffer context fix (xcl-dev#2410), and Wine test fixes (xcl-dev#2414, xcl-dev#2415). Assisted-by: Antigravity (Gemini 4 Neon)
|
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
…#2414, xcl-dev#2415 Integrates per-draw mirror sync fast path (xcl-dev#2437), PresentX compositor hardening (xcl-dev#2418), XAudio2 GetState buffer context fix (xcl-dev#2410), and Wine test fixes (xcl-dev#2414, xcl-dev#2415). Assisted-by: Antigravity (Gemini 4 Neon)
bmjask
left a comment
There was a problem hiding this comment.
No concrete source-level defect found. copy_committed_region preserves prior mirror bytes for inaccessible pages while copying surrounding committed data, and mirrored-index range selection matches what the GPU draws; the focused test is useful. Merge evidence is incomplete: no current Windows build/test, and title validation did not exercise inaccessible sources, whole-buffer copies, instancing, or unmirrored indices. The XCL_ACTIVITY overhead is inherited from stacked #2416 and should be addressed there.
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
bb9bea2 to
c24fbbf
Compare
|
Thanks. On the three points:
(Claude Code, Claude Opus 5.5) |
…outside coherent window) Preserves xcl-dev#871 safe coherent copy under Wine and xcl-dev#2437 pub(super) copy_committed_region. Assisted-by: Antigravity (Gemini 4 Neon)
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
…r sync copies without asking readable() Taken as it is for a test on a title. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> # Conflicts: # crates/xcl/src/hle/d3d12x/list_x.rs # crates/xcl/src/host.rs
Once any buffer mirror exists, sync_title_buffers runs on every draw and nothing reported what it costs. With XCL_ACTIVITY=1 it now logs, every 2 s in which it ran: draws synced and those with a mirror, copies (whole buffers), bytes copied, indices scanned for the vertex range, readable() calls (those over 16 pages, which can take the VirtualQuery walk), the time in readable() and its slowest call, and the time in the function. A row is logged whenever any of these moved, also with no draw synced: the counters of a sync still running at the sample (or stalled for over 2 s) land before its draw is counted, and its slowest readable() would otherwise be dropped with the skipped row. The slowest readable() is not in xcl-dev#2391's list: measuring on xcl-dev#2389 found single calls of 16 pages or fewer taking 1-9 ms, which the other counters average away. The counters cost nothing without XCL_ACTIVITY: host_main turns them on (enable_sync_activity) before it starts the activity thread, and until then sync_title_buffers, sync_readable() and sync_count() check one relaxed bool and take no time stamps and touch no shared counter. No change in behaviour: the old body is sync_mirrors, unchanged apart from the counters, and sync_title_buffers still returns first when no mirror exists. Fixes xcl-dev#2391. Part of xcl-dev#2389. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sync_title_buffers checked every copy's source, and the indices it scans, with gpu::shader::readable. For a range with a page that is not resident, or over 16 pages, that walks the region with VirtualQuery. Measured on xcl-dev#2389, in 18 of 43 two-second windows one such call took 1.1-8.8 ms on the render thread inside a draw. The copy now uses title_textures::copy_committed_region (ReadProcessMemory, which cannot fault), so a page the title freed or protected since keeps what the mirror had. The indices are scanned from the index buffer's mirror once copied there; an index buffer without a mirror is still checked. xcl-dev#2392 proposed checking once per mirror and again after kernelx frees or reprotects memory. kernelx does not see HeapFree, which releases large heap blocks inside ntdll, so that still needed a copy that cannot fault, and with one the check has nothing left to protect. Fixes xcl-dev#2392. Part of xcl-dev#2389. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
c24fbbf to
e426972
Compare
Prime1997
left a comment
There was a problem hiding this comment.
Good within the reviewed scope; retain for integration. The owned-memory mirror-copy change is worth keeping. It copies the readable portions around inaccessible pages and preserves prior destination bytes for inaccessible spans.
PR head e4269721c2795213b996c09ce0b90daf4c461287 integrated locally with current main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. The detached worktree remains at main with the combined changes staged, tree e2e760fee2adae36ee394e4ef9affaa79ea87b2a; it is an uncommitted integration candidate, not a clean PR-head run. Source patch SHA-256 e7b219da2d886b5b1885a4fc3d0d469df9f3f15f87b2beb9e468a4ada1dfdd0c.
Targeted result: 2 passed, 0 failed, 0 ignored, 0 skipped. Each exact filter ran in a fresh process:
hle::d3d12x::list_x::tests::the_mirror_sync_copies_around_a_page_the_title_made_unreadablehle::d3d12x::list_x::tests::the_mirror_sync_copies_whole_buffers_around_a_page_the_title_made_unreadable
Build: cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>. Run: <test-exe> <each-exact-filter-above> --exact --test-threads=1 --nocapture. Private executable/target paths are placeholders. Windows 11 Pro 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug. These selected fixtures did not dispatch GPU work.
Not tested: These are two owned-memory CPU fixtures, not GPU mirror coherence or a title performance measurement. The integration includes the PR stack parent #2416; it is not a standalone top-commit test. No whole suite or retail smoke was run for this batch; this is not merge certification.
AI use: Codex (GPT-6) reviewed source, ran the selected tests and verified raw results. Optional temporary Discord for coordinating contributor work, testing and comparing results.
|
Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2437 at Setup
Targeted RTX 4060 release unit & GPU tests (
|
|
Independent Windows RTX 3080 Ti test of PR #2437 head Tested
Not tested: Retail title smoke or pacing, AMD/Intel GPUs, inaccessible-source behavior in a title run. The two focused fixtures are synthetic; I made no title-performance claim. AI use: Codex (GPT-6.2 Sol) selected and ran the tests, checked the exact revisions and results, and drafted this report. |
|
Correction to my earlier exact-head #2437 report: the shader-cache failure was sensitive to the DXIL cache location in this test environment. On the same clean head Without that setting, the exact shader-cache filter failed on both this head and its parent with Same RTX 3080 Ti / Windows 11 setup as the linked report. No retail run or title pacing measurement. AI use: Codex (GPT-6.2 Sol) traced the cache path, ran the controlled tests, checked the results, and drafted this correction. |
|
Independent full-suite Windows 11 / NVIDIA test report on exact PR head Tested
Not tested
AI use
|
|
Thanks for the follow-up. That diagnosis is right, and the failure isn't in this PR: on AI use: Claude Code, Claude Opus 5.5. |
Stacked on #2416; only the top commit (
D3D12.X: the per-draw mirror sync copies without asking readable()) belongs here.sync_title_bufferschecked every copy's source, and the indices it scans, withgpu::shader::readable. For a range with a page that is not resident, or over 16 pages, that walks the region withVirtualQuery; the measurement on #2389 saw single calls take 1.1–8.8 ms on the render thread inside a draw. The copy now usestitle_textures::copy_committed_region(ReadProcessMemory, which cannot fault), and the indices are scanned from the index buffer's mirror once copied there.Fixes #2392. Part of #2389.
This differs from the proposal in #2392 (check once per mirror, again after kernelx frees or reprotects memory): kernelx does not see
HeapFree, which releases large heap blocks inside ntdll, so that design still needed a copy that cannot fault, and with one the check had nothing left to protect. No kernelx change.What is in it
crates/xcl/src/hle/d3d12x/list_x.rs: the copy goes throughcopy_committed_region; a page the title freed or protected since keeps what the mirror had (before,readablefailed and none of the range was copied). Indices are read from the mirror; an index buffer without a mirror is still checked withreadable. Two tests:the_mirror_sync_copies_around_a_page_the_title_made_unreadable, andthe_mirror_sync_copies_whole_buffers_around_a_page_the_title_made_unreadablefor the other paths with a vertex page made unreadable (an index buffer without a mirror giving the vertex range, a draw with instances, an unreadable index buffer without a mirror: both copy the whole buffer around the page).crates/xcl/src/hle/d3d12x/title_textures.rs:copy_committed_regionispub(super).Tested
NVIDIA RTX 2070 SUPER (driver 32.0.16.2140), AMD Ryzen 5 3600XT, Windows 11 build 26300, Rust 1.100.0; tests in debug, runs in release.
cargo test --workspace -- --test-threads=4one426972(rebased onto D3D12.X: XCL_ACTIVITY counts and times the per-draw buffer mirror sync #2416's review fix): 1427 passed, 0 failed, 46 ignored; 25 SKIPPED (21no wave64, 3 refused gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 forms, 1no heap windows, as onmain).Both new tests fail without the change ("the first page is copied", "the whole buffer is copied") and pass with it.
Retail game, menus, 120 s (on the earlier head
bb9bea2) with its learned coherent window removed so mirrors are made (a 384 KiB index buffer and a 1.1 MiB vertex buffer at 32.5 s),XCL_ACTIVITYcounters from D3D12.X: XCL_ACTIVITY counts and times the per-draw buffer mirror sync #2416, 43 two-second windows each, mean per 2 s:bb01e85)readable()calls, timereadable()The time
readable()took went to the copy instead: no change on average. The slowreadable()calls of D3D12.X: every draw re-syncs buffer mirrors on the CPU (VirtualQuery, whole-buffer copies, index scan) #2389 (1–9 ms) did not occur in thebb01e85run, so this run does not show the stall going away; what the change removes is the code path that made it.Regression run
main:This PR:
Not tested
AI use
🤖 Generated with Claude Code