Repository navigation
Conversation
Under Wine, D3DCompile is Wine's d3dcompiler_47 (vkd3d-shader HLSL): it
has no methods on writable byte address buffers (E5005 'Load' is not
defined on RWByteAddressBuffer) and ignores a [RootSignature] attribute,
so the code holds no root signature to make. Every run-time shader of
ours failed there: the argument clamp ("no argument clamp: indirect
execution dropped", every indirect draw and dispatch then dropped as
not bounded), the depth twin's 16-bit conversion ("no depth
conversion"), and the tests' own shaders.
A new module, compute, compiles a shader and serializes its root
signature in Rust from the parameters the host binds. The clamp keeps
main's design (one group, tiles of 64, groupshared costs charged in
order, the list's budget, the record's rest copied) with the title's
records a StructuredBuffer<uint> (t0) and the clamped records and the
budget RWStructuredBuffer<uint> (u0, u1), indexed in words: bound()
already refuses addresses and strides not multiples of 4. Its root
signature is b0 (4 constants), SRV t0, UAV u1, UAV u0, as bound()
binds them. The depth conversion indexes its scratch buffer in words
(footprint offsets and pitches are multiples of 4) with b0 (8
constants) and UAV u0. Test shaders lose their RootSignature
attributes the same way.
A new test checks every word the clamp writes for draws, indexed
draws, dispatches, mesh dispatches, records past the budget and the
budget spent.
The approach is Mumogg's (Marvisak#1279: structured buffers indexed in words,
the root signature serialized beside the shader), ported to main's
rewritten clamp and extended to the depth conversion.
The tests that bound their own root signatures:
The marked-UAV, placed-view and depth-twin rebind tests compile their
shaders with a [RootSignature] attribute Wine's compiler ignores, and
the marked write ORs its page bit through a byte address buffer method
it lacks. Their root signatures are made with crate::compute from what
the tests bind, and the bitmap is a RWStructuredBuffer<uint> indexed in
words.
fuzeofficlal
left a comment
There was a problem hiding this comment.
Reviewed and verified against main (63bcca43) on native Windows 11 (RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1 + dxil.dll) — no native Windows regressions observed (note: includes the compute.rs shader migration also in #2969):
- Explicit
D3D12SerializeRootSignature+StructuredBuffer<uint>/RWStructuredBuffer<uint>preserves all 4-byte alignment invariants (indirect::bound,twin::Twin::copy);pipeline/library.rspassingnullwith length0toCreatePipelineLibrarycomplies with native D3D12 as well as vkd3d-proton. descriptor/host.rsprobingHEAP_VIEWSbefore assertingdynamic_slots_are_held_until_releasedalso fixes that test on native RTX 5090 (1M view-heap limit);net.rsLazyLocklookups preserve nativews2_32.dllpassthrough;crash.rs10 msappend_guard()avoids exception-handler re-entry deadlocks.
Local verification (native Windows 11):
victory-hle: 152/152 unit + 2/2 integration passedvictory-loader: 35/35 unit (includingconcurrent_crash_records_stay_together) + 4/4 integration passedvictory-gpu(--test-threads=1,VICTORY_D3D12_DEBUG=1): WARP--features diagnostics246/246 passed (skipping pre-existingcompositor_failure_presents_primary_in_the_same_frame); RTX 5090 passed all modified suites (dynamic_slots_are_held_until_released,indirect7/7,twin2/2,pipeline::library11/11,queue5/5,bindless3/3)victory-shader:emit::semantics_tests34/34,a_heap_buffer_read_where_no_buffer_view_is_reads_zerospassedcargo clippy --all-targets -- -D warnings(default &--features diagnostics) +cargo xtask policy(192 files ok): 0 warnings
kotekompotek
left a comment
There was a problem hiding this comment.
LGTM — reviewed the stack on top of #2969 (8db9142..cb61564).
The three real fixes check out:
- Null-blob pipeline library:
bytes.is_empty() → nullis the correct fix — an empty Rust slice's pointer is non-null, and vkd3d-proton rejects a non-null pointer with zero length. The raw-vtableCreatePipelineLibrarycall withID3D12PipelineLibrary1::IID+from_rawis sound. - Winsock lazy lookups: refusing with
WSAENETUNREACH/WSAHOST_NOT_FOUND+ aonce()log preserves the console-without-network answer instead of panicking; the export-presence test correctly moves these intoHOST_MAY_LACK. - Crash-record append lock: bounded try-lock (10 ms) that still writes on timeout is the right trade-off for an exception context — a rare interleave beats a deadlock or a lost report; poisoned guards are taken via
into_inner.
Test-side changes verified:
wait_idlebumpssubmittedunder its lock before Signal — no fence-value collision with the submission path; the queue.rs present-test wait matches the documented vkd3d-proton#3524 hang.- Shared
SharedDevice {device, queue}per adapter: command queues are free-threaded, WARP stays serialized, and the vkd3d fence-thread teardown motivation is real. Acceptable consequence: a device-removed event would now persist across tests — in practice that's fatal for the run anyway. under_wine()viawine_get_versionis the standard probe; both uses are cfg(test)/test-only.- Heap-cap probes in descriptor/host.rs and stride_tests.rs ask for the real heap before asserting/skipping — better than name-matching adapters; the (4 + MIN_DYNAMIC) capped assertion pins the documented behavior on NVIDIA.
- The FMad test now reports rather than asserts under Wine — correct, since vkd3d's WARP legitimately differs from Microsoft's rasterizer.
|
Automated triage for the maintainers. Merge candidate, to land after #2969 (recommending a look, not approving). Thanks for the split. The runtime fixes are now #3091 and #3092, the shared shader-test host is #3093, and the empty-library fix was dropped in favour of #1722. Apart from #2969's commit (
On Windows, each change is either a skip that doesn't trigger or the original assertion. CI Nits, none blocking:
Its first commit is #2969, so merging #2969 first, then rebasing this, keeps the history clean. Generated by Claude Code |
dynamic_slots_are_held_until_released asserted a view heap of at least HEAP_VIEWS (2^21) slots, which HostHeap::new only makes where the host takes that many; a host that caps its heaps (NVIDIA, and vkd3d-proton on NVIDIA's 32 MiB Vulkan descriptor heaps: at most 1,041,451 slots) gets the title's slots and MIN_DYNAMIC more, as the code says. The test now asks the host for a heap of HEAP_VIEWS: where it takes one, the assertion is as before; elsewhere the heap is the capped one.
lists_share_a_table_and_copies_keep_their_views and
a_submission_that_missed_leaves_the_copies_at_once read and write title
memory through views[NonUniformResourceIndex(...)], an unbounded
resource array of shader model 5.1. Wine's D3DCompile (vkd3d-shader)
has none ("Unbounded resource arrays", "Shader model 5.1+ resource
array" are hlsl_fixme there): the compile fails with E_NOTIMPL. Under
Wine (ntdll exports wine_get_version) the two tests say so and return.
Wine's CreateHardLinkW maps to link(2) on the host filesystem, whose link limit is not NTFS's 1023, so the test's expectation cannot hold there. Under Wine it says so and returns.
hosts_that_do_not_fuse_are_named asserted that WARP never fuses FMad. Under Wine the WARP adapter is vkd3d-proton, which does: there the test reports what each adapter does, and the assertion stays on Windows. The null-buffer-view probe is skipped only on hosts that cannot make a heap with the null view slot (both vkd3d adapters cap their view heaps below HEAP_VIEWS), instead of failing there.
…exits A process that exits right after its first present can be killed under Wine on NVIDIA: vkd3d-proton makes the swap chain on its queue thread after Present returns, Wine ends that thread inside the driver at exit, and the driver's exit handler waits for a lock the thread held (HansKristian-Work/vkd3d-proton#3524). The test now waits for the host queue after presenting.
cb61564 to
46d1586
Compare
|
Thanks. Split as suggested:
This PR now holds only test changes (body and results table updated). It stays on #2969 until that's decided; then I'll rebase it out. On |
Test changes so that
cargo xtask wine-test(#1218) runs the Windows test suite on Linux. Stacked on #2969: the first commit here is that PR, so please review fromGPU tests: a capped view heap keeps its documented sizeon. I'll rebase it out once #2969 is decided.The runtime fixes this PR used to carry are now separate:
What's left here (tests that assumed Windows or particular hardware):
hosts_that_do_not_fuse_are_namedstill asserts on Windows that WARP doesn't fuse FMad. Under Wine, "WARP" is vkd3d-proton, which does fuse, so the test reports it instead. The null-buffer-view probe is skipped only where the host can't make the heap.E_NOTIMPL);Results under Wine 11.22, vkd3d-proton 3.1-83 (GE-Proton11-14) and DXVK
dxgi, on an RTX 5090 (driver 620.73.04), with #1218 merged for the runner (passed / failed):main63bcca4cargo clippy --workspace --all-targets(with and withoutdiagnostics) andcargo xtask policyare clean. Not run on Windows: on Windows these changes are skips that don't apply there, or keep the Windows assertion as it was.AI-assisted (Claude); measured on my machine, no game data shared.