Tests and fixes so the suite runs under Wine #2971

Open
neonbyte1 wants to merge 7 commits from upstream-pr/2973 into main
neonbyte1 commented 2026-11-26 01:50:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-26T01:50:25Z.


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 from GPU tests: a capped view heap keeps its documented size on. I'll rebase it out once #2969 is decided.

The runtime fixes this PR used to carry are now separate:

  • #3091 Winsock overrides without the newer host exports
  • #3092 crash records stay whole
  • #3093 the shader tests share one D3D12 queue per adapter, so the change to every GPU test can be reviewed on its own
  • The empty pipeline library fix was already in #1722, so it's dropped here.

What's left here (tests that assumed Windows or particular hardware):

  • Capped view heap. A capped view heap keeps the size the code documents (vkd3d-proton on NVIDIA allows at most 1,041,451 slots). The test now asks the host for a full heap first.
  • Host capabilities. hosts_that_do_not_fuse_are_named still 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.
  • Present test. It waits for the host queue after presenting. Under Wine on NVIDIA, a process that exits right after its first present can hang in the driver's exit handler (HansKristian-Work/vkd3d-proton#3524).
  • Skipped under Wine, each printing why:
    • the two page-table memory tests: Wine's compiler has no shader model 5.1 resource arrays (E_NOTIMPL);
    • the NTFS hard-link limit test: Wine's links go to the host filesystem.

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):

Crate main 63bcca4 this PR Remaining failures, fixed by
victory-gpu 200 / 30 229 / 3 #2101 (placed-view formats), #1722 (two pipeline-library tests)
victory-shader 298 / 4 300 / 2 #2968, #1266; its SIGKILL at exit by #3093
victory-hle 150 / 2 152 / 1 #3091
victory-loader 34 / 1 34 / 1 #3092

cargo clippy --workspace --all-targets (with and without diagnostics) and cargo xtask policy are 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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6617697494 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2973). Originally posted by [neonbyte1](https://github.com/neonbyte1) on 2026-11-26T01:50:25Z. --- 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 from `GPU tests: a capped view heap keeps its documented size` on. I'll rebase it out once #2969 is decided. The runtime fixes this PR used to carry are now separate: - **#3091** Winsock overrides without the newer host exports - **#3092** crash records stay whole - **#3093** the shader tests share one D3D12 queue per adapter, so the change to every GPU test can be reviewed on its own - The empty pipeline library fix was already in **#1722**, so it's dropped here. **What's left here** (tests that assumed Windows or particular hardware): - **Capped view heap.** A capped view heap keeps the size the code documents (vkd3d-proton on NVIDIA allows at most 1,041,451 slots). The test now asks the host for a full heap first. - **Host capabilities.** `hosts_that_do_not_fuse_are_named` still 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. - **Present test.** It waits for the host queue after presenting. Under Wine on NVIDIA, a process that exits right after its first present can hang in the driver's exit handler (HansKristian-Work/vkd3d-proton#3524). - **Skipped under Wine, each printing why:** - the two page-table memory tests: Wine's compiler has no shader model 5.1 resource arrays (`E_NOTIMPL`); - the NTFS hard-link limit test: Wine's links go to the host filesystem. **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): | Crate | `main` 63bcca4 | this PR | Remaining failures, fixed by | |---|---|---|---| | victory-gpu | 200 / 30 | 229 / 3 | #2101 (placed-view formats), #1722 (two pipeline-library tests) | | victory-shader | 298 / 4 | 300 / 2 | #2968, #1266; its SIGKILL at exit by #3093 | | victory-hle | 150 / 2 | 152 / 1 | #3091 | | victory-loader | 34 / 1 | 34 / 1 | #3092 | `cargo clippy --workspace --all-targets` (with and without `diagnostics`) and `cargo xtask policy` are 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._
fuzeofficlal commented 2026-11-26 03:04:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T02:08:24Z.

Review: COMMENTED


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.rs passing null with length 0 to CreatePipelineLibrary complies with native D3D12 as well as vkd3d-proton.
  • descriptor/host.rs probing HEAP_VIEWS before asserting dynamic_slots_are_held_until_released also fixes that test on native RTX 5090 (1M view-heap limit); net.rs LazyLock lookups preserve native ws2_32.dll passthrough; crash.rs 10 ms append_guard() avoids exception-handler re-entry deadlocks.

Local verification (native Windows 11):

  • victory-hle: 152/152 unit + 2/2 integration passed
  • victory-loader: 35/35 unit (including concurrent_crash_records_stay_together) + 4/4 integration passed
  • victory-gpu (--test-threads=1, VICTORY_D3D12_DEBUG=1): WARP --features diagnostics 246/246 passed (skipping pre-existing compositor_failure_presents_primary_in_the_same_frame); RTX 5090 passed all modified suites (dynamic_slots_are_held_until_released, indirect 7/7, twin 2/2, pipeline::library 11/11, queue 5/5, bindless 3/3)
  • victory-shader: emit::semantics_tests 34/34, a_heap_buffer_read_where_no_buffer_view_is_reads_zeros passed
  • cargo clippy --all-targets -- -D warnings (default & --features diagnostics) + cargo xtask policy (192 files ok): 0 warnings
<!-- greyfinch-sync:Marvisak/VIctory:review:6067611162 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2973#pullrequestreview-6067611162). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T02:08:24Z. **Review:** COMMENTED --- 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.rs` passing `null` with length `0` to `CreatePipelineLibrary` complies with native D3D12 as well as vkd3d-proton. - `descriptor/host.rs` probing `HEAP_VIEWS` before asserting `dynamic_slots_are_held_until_released` also fixes that test on native RTX 5090 (1M view-heap limit); `net.rs` `LazyLock` lookups preserve native `ws2_32.dll` passthrough; `crash.rs` 10 ms `append_guard()` avoids exception-handler re-entry deadlocks. **Local verification (native Windows 11)**: - `victory-hle`: **152/152** unit + **2/2** integration passed - `victory-loader`: **35/35** unit (including `concurrent_crash_records_stay_together`) + **4/4** integration passed - `victory-gpu` (`--test-threads=1`, `VICTORY_D3D12_DEBUG=1`): WARP `--features diagnostics` **246/246 passed** (skipping pre-existing `compositor_failure_presents_primary_in_the_same_frame`); RTX 5090 passed all modified suites (`dynamic_slots_are_held_until_released`, `indirect` 7/7, `twin` 2/2, `pipeline::library` 11/11, `queue` 5/5, `bindless` 3/3) - `victory-shader`: `emit::semantics_tests` **34/34**, `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` passed - `cargo clippy --all-targets -- -D warnings` (default & `--features diagnostics`) + `cargo xtask policy` (`192 files ok`): 0 warnings
kotekompotek commented 2026-11-26 03:04:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T02:50:41Z.

Review: APPROVED


LGTM — reviewed the stack on top of #2969 (8db914232..cb61564dc).

The three real fixes check out:

  • Null-blob pipeline library: bytes.is_empty() → null is 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-vtable CreatePipelineLibrary call with ID3D12PipelineLibrary1::IID + from_raw is sound.
  • Winsock lazy lookups: refusing with WSAENETUNREACH/WSAHOST_NOT_FOUND + a once() log preserves the console-without-network answer instead of panicking; the export-presence test correctly moves these into HOST_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_idle bumps submitted under 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() via wine_get_version is 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.
<!-- greyfinch-sync:Marvisak/VIctory:review:6067902162 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2973#pullrequestreview-6067902162). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-26T02:50:41Z. **Review:** APPROVED --- LGTM — reviewed the stack on top of #2969 (8db914232..cb61564dc). The three real fixes check out: - **Null-blob pipeline library**: `bytes.is_empty() → null` is 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-vtable `CreatePipelineLibrary` call with `ID3D12PipelineLibrary1::IID` + `from_raw` is sound. - **Winsock lazy lookups**: refusing with `WSAENETUNREACH`/`WSAHOST_NOT_FOUND` + a `once()` log preserves the console-without-network answer instead of panicking; the export-presence test correctly moves these into `HOST_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_idle` bumps `submitted` under 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()` via `wine_get_version` is 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.
Marvisak commented 2026-11-26 06:03:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T05:22:49Z.


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 (16080c4), the branch now changes only tests:

  • dynamic_slots_are_held_until_released (descriptor/host.rs) first probes for a HEAP_VIEWS-slot heap. On a capped host it expects (4 + MIN_DYNAMIC, MIN_DYNAMIC), which matches HostHeap::new's make(count + MIN_DYNAMIC) branch on main.
  • hosts_that_do_not_fuse_are_named keeps the Windows WARP assertion and only reports the answer under Wine.
  • The two page-table memory tests and the hard-link limit test (xgamesave.rs, using the existing xmem::on_wine) skip under Wine with a reason printed.
  • The present test waits for the queue through a test-only Host::wait_idle.

On Windows, each change is either a skip that doesn't trigger or the original assertion. CI check passes.

Nits, none blocking:

  • under_wine is written twice, in victory-gpu/src/compute.rs and victory-shader/src/emit/host.rs.
  • a_heap_buffer_read_where_no_buffer_view_is_reads_zeros no longer fails when no adapter ran. On a machine with no SM 6.6 device it now passes silently.

Its first commit is #2969, so merging #2969 first, then rebasing this, keeps the history clean.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7183433160 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2973#issuecomment-7183433160). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-26T05:22:49Z. --- <!-- victory-triage v1 head=46d158621f5bb2de74e248d6214ccbe079311d70 verdict=merge-candidate at=2026-11-26T08:19:28Z --> 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 (`16080c4`), the branch now changes only tests: - `dynamic_slots_are_held_until_released` (`descriptor/host.rs`) first probes for a `HEAP_VIEWS`-slot heap. On a capped host it expects `(4 + MIN_DYNAMIC, MIN_DYNAMIC)`, which matches `HostHeap::new`'s `make(count + MIN_DYNAMIC)` branch on `main`. - `hosts_that_do_not_fuse_are_named` keeps the Windows WARP assertion and only reports the answer under Wine. - The two page-table memory tests and the hard-link limit test (`xgamesave.rs`, using the existing `xmem::on_wine`) skip under Wine with a reason printed. - The present test waits for the queue through a test-only `Host::wait_idle`. On Windows, each change is either a skip that doesn't trigger or the original assertion. CI `check` passes. Nits, none blocking: - `under_wine` is written twice, in `victory-gpu/src/compute.rs` and `victory-shader/src/emit/host.rs`. - `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` no longer fails when no adapter ran. On a machine with no SM 6.6 device it now passes silently. Its first commit is #2969, so merging #2969 first, then rebasing this, keeps the history clean. --- _Generated by [Claude Code](https://claude.ai/code)_
neonbyte1 commented 2026-11-26 08:03:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-26T07:34:01Z.


Thanks. Split as suggested:

  • Runtime fixes: #3091 (Winsock) and #3092 (crash records).
  • Shader-test host change: #3093, with a request for a Windows run.
  • Empty pipeline library: dropped here, since #1722 is the same fix and older.

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 crash.rs: the interleaving was within one process. concurrent_crash_records_stay_together writes from several threads, and under Wine two records came out mixed. The lock doesn't cover two processes writing the same log. I haven't seen that case, and #3092 says so.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7185594979 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2973#issuecomment-7185594979). Originally posted by [neonbyte1](https://github.com/neonbyte1) on 2026-11-26T07:34:01Z. --- Thanks. Split as suggested: - **Runtime fixes:** #3091 (Winsock) and #3092 (crash records). - **Shader-test host change:** #3093, with a request for a Windows run. - **Empty pipeline library:** dropped here, since #1722 is the same fix and older. 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 `crash.rs`: the interleaving was within one process. `concurrent_crash_records_stay_together` writes from several threads, and under Wine two records came out mixed. The lock doesn't cover two processes writing the same log. I haven't seen that case, and #3092 says so.
neonbyte1 commented 2026-11-26 16:05:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-26T15:14:47Z.


Thanks for the two nits. Both are fixed in a follow-up commit, d70de2e:

  • under_wine is defined once now, in victory_shader::emit::host. victory-gpu already depends on that crate with the host feature, so the two GPU call sites use the shared helper, and the copy in compute.rs is gone.
  • a_heap_buffer_read_where_no_buffer_view_is_reads_zeros now prints a skip that names the test and the missing condition (an SM 6.6 device with a full view heap), following the existing eprintln!("...; skipped") convention, instead of passing without a word.

Checked under Wine on the RTX 5090:

  • The heap-buffer test reports no SM 6.6 device with a 2097152-slot view heap; skipped.
  • hosts_that_do_not_fuse_are_named and the two memory tests that use the shared helper pass.
  • Both clippy configurations and cargo xtask policy pass.

AI-assisted (Claude); measured on my machine, no game data shared.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7195992550 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2973#issuecomment-7195992550). Originally posted by [neonbyte1](https://github.com/neonbyte1) on 2026-11-26T15:14:47Z. --- Thanks for the two nits. Both are fixed in a follow-up commit, `d70de2e`: - **`under_wine`** is defined once now, in `victory_shader::emit::host`. `victory-gpu` already depends on that crate with the `host` feature, so the two GPU call sites use the shared helper, and the copy in `compute.rs` is gone. - **`a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`** now prints a skip that names the test and the missing condition (an SM 6.6 device with a full view heap), following the existing `eprintln!("...; skipped")` convention, instead of passing without a word. **Checked** under Wine on the RTX 5090: - The heap-buffer test reports `no SM 6.6 device with a 2097152-slot view heap; skipped`. - `hosts_that_do_not_fuse_are_named` and the two memory tests that use the shared helper pass. - Both clippy configurations and `cargo xtask policy` pass. _AI-assisted (Claude); measured on my machine, no game data shared._
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2973:upstream-pr/2973'
git switch 'upstream-pr/2973'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2973'
git switch 'upstream-pr/2973'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2973'
git switch 'upstream-pr/2973'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2973'
git switch 'main'
git merge --squash 'upstream-pr/2973'
git switch 'main'
git merge --ff-only 'upstream-pr/2973'
git switch 'main'
git merge 'upstream-pr/2973'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!2971
No description provided.