diff --git a/docs/README.md b/docs/README.md index 1fb607ec00..f7af8e938f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -87,6 +87,7 @@ method, scope and caveats. No game data is included. | [gameinput.md](gameinput.md) | The GameInput shim on SDL3: `GameInputCreate` and the v0 `IGameInput`/`IGameInputDevice`/`IGameInputReading`/`IGameInputDispatcher` surface on any SDL gamepad, DualSense adaptive-trigger approximation and lightbar, force-feedback motors and trigger haptics through SDL's haptic API; 261 checks on virtual joysticks and a fake haptic backend; by hand on an Xbox Series X pad (Bluetooth) and a DualSense (USB). 261 checks on virtual joysticks and a fake haptic backend, not yet tried on a real pad. | | [saves.md](saves.md) | Save containers: `JSAV` (index + JSON story save, byte-exact rebuild), `ASAV` header, `SLAYER1` packed copy (not decoded); `tools/saves.py` and import into the offline `XGameSave` folder; key hashes are case-sensitive joaat (`tools/save_keys.py`). | | [pipeline_check.md](pipeline_check.md) | Driver-level corpus check: the full corpus, 26,503 of 26,503 modules and pipelines, 0 failures (RTX 4060 Ti); an earlier 10/12-shard run, 22,092 modules and 2,217 compute pipelines, also had 0 failures. Driver-level corpus check: 10/12 shards, 22,092 modules, 2,217 compute pipelines, 0 failures. | +| [runtime_ctest_hosts.md](runtime_ctest_hosts.md) | The runtime ctest suite on two hosts, Wine and native Windows 10, on one Pascal card: the 19 failures that are Wine's host, the 5 that reproduce (ours), and the 6 that only fail natively, deterministic, including a SegFault. | | [multi_gpu_validation.md](multi_gpu_validation.md) | Running disjoint shards on eight identical RDNA1/RADV GPUs: PCI-BDF pinning, base controls, per-card logs, the V540 farm's aggregate results and its known driver limitations. | | [shader_validation.md](shader_validation.md) | Differential CPU/GPU validation design and the current CPU interpreter prototype. | | [isa_coverage.md](isa_coverage.md) | RDNA2 ISA coverage of the translator against AMD's machine-readable XML: which of its 1,153 instructions have a rule, and which matched names are not RDNA2. | diff --git a/docs/runtime_ctest_hosts.md b/docs/runtime_ctest_hosts.md new file mode 100644 index 0000000000..d8d8956579 --- /dev/null +++ b/docs/runtime_ctest_hosts.md @@ -0,0 +1,105 @@ +# The runtime ctest suite on two hosts: Wine and native Windows + +The same runtime test suite, the same GPU model, two hosts: Wine on Linux ([#1150](https://github.com/ubiquitarianism/leonida/issues/1150)) and native Windows 10. The point is not to compare percentages but to separate the failures that belong to Wine's host DLLs from the ones that are ours. A test that fails only under Wine is a limit of the host; a test that fails on both is a bug in the layer, and one that fails only natively is a bug Wine was hiding. + +No game files were used by either run. The suite builds its own fixtures. + +## The two runs + +| | Wine run (#1150) | Native run (this page) | +|---|---|---| +| Host | Parrot Linux (Debian 13), Wine 10.0 | Windows 10 Pro 19045, no Wine | +| GPU | NVIDIA GPU (Pascal class, 4 GB). Model and PCI id withheld | the same card | +| Driver | NVIDIA 555.58 | NVIDIA 582.28 | +| Compiler | clang-cl 21 / lld-link, xwin SDK 10.0.26100 | MSVC 19.44 x64, installed SDK | +| Commit | `3aa97542` | `58be9cdf` | +| Tests run | 304 of 304 | 307 of 308 (one disabled) | +| Result | 239 passed, 19 failed, 5 timeouts, 40 skipped — 92% | 278 passed, 11 failed (9 failed, 1 SegFault, 1 timeout), 18 skipped — 96%, 452 s | +| ctest valve | `--timeout 120` | `--timeout 120` | + +The commits differ by a day of `main`. Nothing in the 24 Wine failures is a test added between them except `d3d12_existing_heap`, `d3d12_xmem_placed` and `root_sig`, which all exist in both. + +## 19 Wine failures pass natively + +These are host limits. Wine's `ntdll`/`bcrypt`/`dxgi`/vkd3d answer differently from the Windows DLLs the tests compare against: + +| Test | What Wine does that heals here | +|---|---| +| `xmem` | protection windows, page charging and read-only faults: Windows virtual-memory semantics Wine does not give | +| `file_system` | `ReadFile` into uncommitted pages does not fail with `ERROR_NO_ACCESS` | +| `bcrypt_rng`, `bcrypt_rng_seeded` | the unknown-algorithm probe: the shim delegates to Wine's `bcrypt`, which answers another status | +| `d3d12_clear`, `d3d12_clear_formats` | no WARP under Wine, so the differential test cannot run | +| `dxgi_swapchain` | `CreateSwapChainForHwnd` returned `0x887a0001` against the host's `0x00000000` | +| `dstorage` | the timeout with no output after `OpenFile: null or empty path` is Wine's, not ours | +| `run_startup_cmdline` | the Wine init-message issue | +| `vk_device_filter_tools` | the script ran the `.exe` directly on Linux (`Exec format error`) instead of through Wine | +| `root_sig` | the all-zero-checksum Xbox blob: Wine's chained serialization, as the issue suspected | +| `d3d12_residency`, `d3d12_fence_timing`, `d3d12_indirect_dispatch_count`, `d3d12_xmem_placed` | the documented host-comparison family | +| `d3d12_buffer_tiles`, `d3d12_texture_tiles` | the sparse-residency deadlock: the first `UpdateTileMappings` is refused under Wine and teardown blocks on the queue | +| `dxgi_host_parity`, `dxgi_waitable_latency` | the page fault on write to `0x0` only turned into a hang because winedbg attached | + +The four hangs are the clearest case: natively they are ordinary sub-second passes. + +## 5 Wine failures reproduce natively, so they are ours + +| Test | Measured | +|---|---| +| `d3d12_vulkan_device` | fails as under Wine | +| `d3d12_subresource_copy` | `CPU copies (host image copy): the steps differ from the host's`, line 391 | +| `d3d12_heap_properties` | `heap properties committed texture, CUSTOM write-back L0: ours 0x8007000e host 0x0` — our `E_OUTOFMEMORY` where the host creates the resource | +| `d3d12_existing_heap` | `a title-placed buffer (device slot 133) could not import its pages…`, line 196 `GetGPUVirtualAddress() == (D3D12_GPU_VIRTUAL_ADDRESS)pages` (`HRESULT 0x80004001`) | +| `d3d12_r9g9b9e5_uav` | line 669 `SUCCEEDED(device->CreateCommittedResource(&custom_heap, ..., &cpu_uav.p))` — CPU-heap `HOST_TRANSFER` texture gets `E_OUTOFMEMORY` on Pascal (same root cause as `d3d12_subresource_copy` and `d3d12_heap_properties`, after the expected `GetResourceAllocationInfo format not supported yet: 67` refusal log) | + +## 6 that only fail natively, deterministic 3 of 3 + +Each was rerun three times alone with `ctest -R '^name$' --repeat until-fail:3`; every repetition failed the same way on this build. + +| Test | Symptom | +|---|---| +| `d3d12_subgroup` | **SegFault** at 1.4 s, right after `device slot 16 (CreateRootSignature) first call`. Stack-layout-dependent: device slot 14 (`CreateDescriptorHeap`) accepted an unaligned caller stack word (`0x65626f72705f7370`, `"ps_probe"`) as a console heap address whenever the next word happened to equal `32` ([#1328](https://github.com/ubiquitarianism/leonida/pull/1328)); an independent Pascal 4 GB build with a different stack frame passed 3/3 | +| `d3d12_set_descriptor_heaps` | `CHECK failed: !blob.empty()` (line 341), after two `upload heaps in system memory (no Resizable BAR)` lines | +| `root_signature_oracle` | `FAIL 1.1 with every root-signature flag: Microsoft serializer accepts it` (`Unsupported bit-flag set (root signature flags c7f)` — Windows 10's `d3d12.dll` refuses the SM 6.6 heap-direct bits `0xC00`) | +| `d3d12_close_parity` | the compared steps diverge from the host from the third case on | +| `d3d12_pso_validation` | line 436 `check_gfx_parity("gfx: Flags=DYNAMIC_DEPTH_BIAS", ...)` (`layer 0x00000000 != host 0x80070057`: Windows 10's runtime refuses `DYNAMIC_DEPTH_BIAS`; the `depth-stencil format not supported: 9999, ...` lines are negative-case logs) | +| `xdxr_build_check` | a **Timeout at 120 s** that is not a hang: with `--timeout 400` it passes in **212 s** | + +`d3d12_subgroup` is the most serious: a crash in device slot 14's console-layout heuristic ([#1328](https://github.com/ubiquitarianism/leonida/pull/1328)) that depended on adjacent stack words, which is why neither the `clang-cl` Wine build nor a second MSVC build on the same Pascal 4 GB class hit it. `xdxr_build_check` costs a full-suite run two minutes of wall clock and a false fail on this card; 212 s on a 4 GB Pascal for a DXR build is a plausible ceiling for any low-end machine. + +## Reading it + +- A native pass does not mean the Wine report was wrong: it means the missing piece was Wine. Both runs stay useful. +- Skipped here are 18 (7 retail-package skips plus 11 validation, DXR, conservative-tier-3 and mesh-shader skips); the Wine run skipped 40 for its own reasons. A skip is neither a pass nor a fail and the percentages do not compare one for one. +- This run was from an interactive desktop session, where `xgameruntime_offline` and `xgameruntime_offline_hdr` pass (`0.11 s` and `0.03 s`); over a non-interactive SSH session they fail `XDisplayAcquireTimeoutDeferral`. +- The implicit Vulkan layers were disabled (`VK_LOADER_LAYERS_DISABLE=~implicit~`): this machine has OBS and RenderDoc layers installed. + +## Re-measured on `main` `d1dff794` (27 November 2026) + +Two days later, same card and same Windows 10 19045 host, five rows of the tables above re-run three times each +(`ctest -R '^name$' --timeout 300`). This is a targeted re-run, not a new full-suite figure: the counts in "The two +runs" still describe `58be9cdf`. + +| Test | 25 November | 27 November, `main` `d1dff794` | Covers it now | +|---|---|---|---| +| `d3d12_subresource_copy` | failed, line 391 (`CPU copies (host image copy): the steps differ from the host's`) | **passes 3/3** (0.55–0.56 s) | [#1364](https://github.com/ubiquitarianism/leonida/pull/1364), merged 24 November | +| `d3d12_r9g9b9e5_uav` | failed, line 669 (CPU-heap `HOST_TRANSFER` texture gets `E_OUTOFMEMORY`) | **passes 3/3** (0.31–0.32 s) | [#1364](https://github.com/ubiquitarianism/leonida/pull/1364) | +| `d3d12_existing_heap` | failed, line 196 (`0x80004001`) | still fails 3/3; each run logs `texture memory unavailable: 2048 bytes, alignment 1024, type bits 0x0 (vk format 9 256x8)` twice | [#1894](https://github.com/ubiquitarianism/leonida/pull/1894): with its head `2d258c8c` applied to this tree the test passes 3/3 and each run logs `title image has no host-transfer memory type, using staging for Vulkan format` | +| `d3d12_heap_properties` | failed on the `0x8007000e` CPU-heap rows | still fails 3/3, now on exactly two rows: `placed buffer` and `placed texture, DEFAULT heap, ALLOW_ALL` give `0x0` in the layer and `0x80070057` on the host | [#1389](https://github.com/ubiquitarianism/leonida/pull/1389) | +| `d3d12_vulkan_device` | failed (the `CreateHeap` comparison) | still fails 3/3; the last compared row is now `invalid arguments heap: HARDWARE_PROTECTED: an older host runtime (Windows 10, Windows 11 23H2) refuses it (ours 0x00000000, host 0x80070057)` | [#1389](https://github.com/ubiquitarianism/leonida/pull/1389) | + +Both remaining `d3d12_heap_properties` rows are the same host fact. This GPU reports +`D3D12_RESOURCE_HEAP_TIER_1`, and `D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES` (the value `0`, no `DENY` flag) is +heap tier 2 and greater only, so the host refuses the two `ALLOW_ALL` cases with `E_INVALIDARG` while the +`ALLOW_ONLY_*` rows match. The layer accepts them because the console it imitates is tier 2; what has to change is the +host comparison in the test, which is what #1389 does. + +The `HARDWARE_PROTECTED` row is the same kind of host gate: Windows 10's `d3d12.dll` refuses the flag with +`E_INVALIDARG`, and the layer, like the console, accepts it. Also #1389. + +`d3d12_existing_heap` is not a heap-flag case. The layer builds the title's 256x8 Vulkan format-9 image (2048 bytes, +alignment 1024), finds no host-transfer memory type for it and the placed import fails; #1894 stages that upload. The +sub-page host buffer imports named above for this test ([#1458](https://github.com/ubiquitarianism/leonida/pull/1458)) +are a different path and are still open. + +## What follows + +The 5 reproduced and the 6 native-only are the actionable list (5 + 6 = 11 failures). Since this run: [#1364](https://github.com/ubiquitarianism/leonida/pull/1364) fixed the Pascal `HOST_TRANSFER` CPU-heap image failure behind `d3d12_subresource_copy`, `d3d12_r9g9b9e5_uav` and the `0x8007000e` rows of `d3d12_heap_properties` and `d3d12_vulkan_device`; open pull requests cover the remaining host-tier-1 heap comparisons ([#1389](https://github.com/ubiquitarianism/leonida/pull/1389)), sub-page host buffer imports on 256-byte UBO GPUs (`d3d12_existing_heap`, [#1458](https://github.com/ubiquitarianism/leonida/pull/1458)), `d3d12_subgroup` ([#1328](https://github.com/ubiquitarianism/leonida/pull/1328)), `d3d12_set_descriptor_heaps` ([#1353](https://github.com/ubiquitarianism/leonida/pull/1353)), `root_signature_oracle` ([#988](https://github.com/ubiquitarianism/leonida/pull/988)), `d3d12_close_parity` ([#989](https://github.com/ubiquitarianism/leonida/pull/989)), `d3d12_pso_validation` ([#967](https://github.com/ubiquitarianism/leonida/pull/967), [#1377](https://github.com/ubiquitarianism/leonida/pull/1377)), and `xdxr_build_check`'s timeout ([#1424](https://github.com/ubiquitarianism/leonida/pull/1424)).