Repository navigation
[upstream #1813] DirectStorage: EnqueueSignal takes a fence in memory VirtualQuery does not know - #324
Draft
ufoptg wants to merge 7 commits into
Draft
[upstream #1813] DirectStorage: EnqueueSignal takes a fence in memory VirtualQuery does not know#324ufoptg wants to merge 7 commits into
ufoptg wants to merge 7 commits into
Conversation
The `title:` line of an xcl-smoke block printed the game folder's name, and folder names are whatever people called their copy, so PR descriptions ended up naming specific copies of a commercial game (xcl-dev#677). It now prints the first 8 hex digits of the SHA-256 of the folder name (trimmed, UTF-8). pr_check.py only compares the main and PR blocks' titles for equality, so the check is unchanged, and two different folders still get different titles. Existing blocks can be converted with the same function (Python: hashlib.sha256(name.strip().encode()).hexdigest()[:8]). -Title <label> prints a label of your choice instead. Control, format and line/paragraph separator characters and backticks are refused: pr_check.py splits lines with str.splitlines(), so a U+2028 in a label would otherwise add keys such as `commit:` to the block. scripts/smoke-title.tests.ps1 checks hashes of ASCII, accented, CJK and emoji names against Python's, a trailing backslash, -Title, and the refused labels, with a stand-in for xcl.exe. Fixes xcl-dev#677
…v#1307) The structured form wraps the items that follow a forward jump in a guard that lists every pending skip flag, and reopens it whenever the set changes. With many flags pending at once that grows with the square of the flags. Since b8b1f49 one compute program of the retail pack reaches it: 148 MB of HLSL from 334 KB of code (3 861 flags, guards of up to 597 terms, 99 MB in guard lines), against 14 MB as pc blocks. DXC on that fits the host's commit growing about 1 GB/s until it runs out, seen with b8b1f49 and not without it. Structured code longer than 128 bytes per byte of program is now translated as pc blocks. Over the whole pack (CPU-side translation of every program, macOS), only that program changes, to 13.8 MB. The next largest structured program is at 61 bytes per byte. Every other program comes out as it does on main, so b8b1f49's gain stays (1 670 -> 170 programs as pc blocks). oversized_structured_code_falls_back_to_pc_blocks: 200 conditional forward jumps whose targets all follow them, in order, cross the bound; 50 do not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-oom dxil: eliminate giant-shader IR and CFG blowup in FormatLoad and multi-window memory
Scripts: smoke blocks name the game folder by a hash, not its name
…s not know EnqueueSignal checked the fence and its table with gpu::shader::readable, which asks VirtualQuery. A native host's D3D12 (D3DMetal under CrossOver) keeps its objects in memory Wine's VirtualQuery does not know, so every fence there was refused and its signal dropped: a title waiting on a DirectStorage fence waited forever. The fence pointer and its table are now read with read_own (ReadProcessMemory), which still refuses memory that cannot be read. Test: a_fence_of_the_hosts_d3d12_is_signalled. Part of #258.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a Mac, a DirectStorage fence is never signalled, so a title that waits on one waits forever.
EnqueueSignalchecks the fence and its table withgpu::shader::readable, which asksVirtualQuery. D3DMetal (CrossOver) keeps its D3D12 objects in memory that Wine'sVirtualQuerydoes not know (the test title's fence is at0x7fcc2d0f7540), so every fence is refused and its signal dropped, with nothing in the log. This PR reads the fence pointer and its table withread_own(ReadProcessMemory), the helper this file already uses for the page lists. It still refuses memory that cannot be read. Part of #258, found while testing xcl-dev#1329 there (xcl-dev#1329 (comment)).What is in it
crates/xcl/src/hle/dstorage.rs,queue_enqueue_signal: the fence's first word and the table's first 11 words are read withread_own. A null pointer, a null table or memory that cannot be read still enqueues nothing, as before. The Signal call itself is unchanged.a_fence_of_the_hosts_d3d12_is_signalled: a fence from the host's D3D12 (WARP if there is no adapter, as infence_x.rs) is taken byEnqueueSignal, andSubmitsignals it. A pointer to a reserved, uncommitted page is still not taken.Tested
hle::dstorage::one at a time (--test-threads=1), at this PR's head4d19aedonmaine9e94ce: 30 passed, 0 failed, the new test included (on the earlier base9e3831e: 18 of 18).queue_enqueue_signal(on9e3831e) fails on D3DMetal:the host's fence was not taken(0 entries instead of 1). With this PR it passes.tests/e2e.rsruns it, with a freshXCL_DATA_ROOT), with this change on the earlier base. Plainmainstops on a Mac before the DirectStorage check, so this is onmain9e3831e+ D3D12.X: a stage the PC cannot run goes to the fallback without the driver xcl-dev/xcl#750 + D3D12.X: the committed window gets a copy in video memory xcl-dev/xcl#1329 + Ahmet-Dedeler'spr/native-host-vtables(ddf3be7). With those, the title runs to its end:DirectStorage (xcrdapi): … the DirectStorage fence was not signalled;IsBadReadPtrversion). The other three are the window cloak (e2e: the console screen may be hidden where DWM cannot cloak it xcl-dev/xcl#1462), "no GPU timestamp" (D3D12.X: timestamps are the CPU's clock on a host without GPU timestamps xcl-dev/xcl#996) and XMA2GetState(XAudio2: GetState names the oldest queued buffer when the host gives none xcl-dev/xcl#890).Regression run
This changes
crates/xcl/src/hle, so it needsxcl-smokepairs. I have no title. On Windows a D3D12 fence is in memoryVirtualQueryknows, and both checks take it, so I expect nothing to change there. A Windows pair would confirm that, and a Mac pair would show the effect on a title. Draft until the pairs are here.main:
PR:
Not tested
hle::dstorage::.AI use
Mirror of xcl-dev#1813 (auto-synced, do not edit).