Skip to content

Runtime: compare CheckFeatureSupport error HRESULTs with the host (D3D-50) - #459

Merged
ItsNotRexed merged 1 commit into
ProjectLeonida:mainfrom
luisbaker:d3d-50-checkfeaturesupport
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ProjectLeonida:mainfrom
luisbaker:d3d-50-checkfeaturesupport

Conversation

@luisbaker

Copy link
Copy Markdown
Contributor

D3D-50: compare CheckFeatureSupport error HRESULTs with the host PC runtime.

Adds compare_check_feature_support to runtime/test/d3d12_vulkan_device_test.cpp, following the existing compare_footprints / compare_allocation_info pattern. It runs CheckFeatureSupport on both the shim and the host runtime and asserts their HRESULTs agree for invalid inputs:

  • a null data pointer,
  • a structure smaller than the feature requires (0, 1 byte, and one byte short for every answered feature's data type),
  • feature values no runtime defines (0x4000, 0x7fffffff).

Valid queries are not compared - their answers are the GPU's choice. No game files; runs on WARP or any D3D12/Vulkan GPU.

AI-assisted.

Tested: d3d12_vulkan_device_test on Intel(R) Graphics (Windows 11); all comparisons matched.

Claim: #374 (comment)

@Ayinaki

Ayinaki commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 3cb0c8b on NVIDIA GeForce RTX 5070, driver 616.86, Windows 10.0.26200.9711: pass.

Built runtime with the VS 2026 C++ toolchain and Vulkan SDK 1.4.363, then ran runtime/build/Release/d3d12_vulkan_device_test.exe. The CheckFeatureSupport invalid-input/error-HRESULT comparisons matched the host, along with the rest of the device test; exit 0.

@NRXM

NRXM commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 3cb0c8b (on main 91b36cf) on an NVIDIA RTX 4090 (621.24) and an AMD Radeon iGPU (2.0.353), Windows 11 (build 26300), MSVC 14.44, Vulkan SDK 1.4.363.0, clean Ninja build of runtime/: pass on both.

  • ctest 23/23 on each GPU
  • the extended d3d12_vulkan_device_test ends "…GetResourceTiling and CheckFeatureSupport error paths all matched" on both GPUs
  • d3d12_com_test, d3d12_descriptor_test, d3d12_uint_clear_test and vk_command_replay_test exit 0 on each GPU
  • everything ran with LEONIDA_VK_VALIDATION=1 and VK_LOADER_LAYERS_DISABLE=~implicit~: no validation-layer errors on either GPU (only loader notices); the AMD run used VK_LOADER_DRIVERS_SELECT=*amd*

(AI-assisted test run.)

@luisbaker

Copy link
Copy Markdown
Contributor Author

Note on CI and #497:

  • CI: the red checks (check, semantic-tests, linux-gpu-tools) are pre-existing on main (main@91b36cf is also red on the same jobs) - date-seeded translator fuzzer tests (seed 20261122), unrelated to this PR. The windows (MSVC) build passes, and this PR was rebased onto main (was conflicting after the merge round).
  • Overlap: this PR and Runtime: compare fence and queue semantics with the host (D3D-48) #497 both add a comparison function to
    untime/test/d3d12_vulkan_device_test.cpp. Whichever merges first, the other will need a small rebase onto it.

AI-assisted.

@kacper-serewis

Copy link
Copy Markdown
Contributor

Tested 8748177 on RTX 5070 (Blackwell, subgroup 32..32), NVIDIA 616.56, Windows 11 Pro 26200: pass.

  • runtime built with MSVC 19.50 (build_runtime.ps1, Vulkan SDK 1.4.363.0); ctest 19/19
  • d3d12_vulkan_device_test exit 0: "... GetResourceAllocationInfo and CheckFeatureSupport error paths all matched"

@luisbaker

Copy link
Copy Markdown
Contributor Author

Thanks @Ayinaki, @NRXM and @kacper-serewis for the GPU test reports - appreciated! (The rebased head is 3cb0c8b; the code is unchanged from 8748177.)

@S1m0ne1997

Copy link
Copy Markdown
Contributor

Tested 3cb0c8b on RTX 4090 (driver 621.24, Vulkan 1.4.357), Windows 11 Home build 26300, MSVC 14.44 (VS 2022 Build Tools), Vulkan SDK 1.4.363.0, llvm-mc 23.1.5 (MSYS2): pass

  • runtime build clean, ctest all passed; d3d12_vulkan_device_test with LEONIDA_VK_VALIDATION=1 OK, no validation errors.
  • build.py 68/68 translated and spirv-val-valid; check.py 37 of 64 pass, 27 skipped; run_gpu_tests.py 45/71 passed, 26 skipped, no failures.
  • pytest: the 7 failures are test_tile_probe needing numpy, not installed here (same on main).
  • semantic: test_alu_shift_b64 fails once (v_ashrrev_i64); this branch is based on the main that had only the first half of tests/semantic: export test_alu_shift_b64 results in 16-bit halves (fixes CI on Python < 3.14) #454, the fix (a9353e8) landed after it. Passes on current main, not caused by this PR.

No game files involved.

AI-assisted (Claude Code).

@JavierBlanco23

Copy link
Copy Markdown
Contributor

Tested on Windows 11, RTX 5080 (Blackwell), driver 616.56, Vulkan 1.4.x, MSVC 19.44.

compare_check_feature_support: all error paths match host runtime.

Tested cases (all HRESULTs match):

  • Null data pointer → both return same error
  • Zero size structure → both return same error
  • One byte structure → both return same error
  • Structure one byte short (for each answered feature type: FEATURE_LEVELS, ARCHITECTURE, ARCHITECTURE1, D3D12_OPTIONS, GPU_VIRTUAL_ADDRESS_SUPPORT, FORMAT_SUPPORT) → both return same error
  • Undefined feature values (0x4000, 0x7fffffff) → both return same error

Valid queries are not compared (GPU's choice), as designed.

d3d12_vulkan_device_test output: "CheckFeatureSupport error paths all matched"

Exit code 0 without validation. With LEONIDA_VK_VALIDATION=1: 1 pre-existing validation error (ReShade layer load), unrelated to this PR.

AI-assisted.

@luisbaker

Copy link
Copy Markdown
Contributor Author

Rebased onto origin/main (c432cdc, latest).

Resolved a merge conflict in runtime/test/d3d12_vulkan_device_test.cpp (the PR and main both touched the comment block and the area around compare_resolves). The rebase keeps this PR's compare_check_feature_support() addition intact on top of current main.

No functional change to the D3D-50 logic itself — just brought it forward onto current main so the branch applies cleanly. CI checks (check, linux-gpu-tools, semantic-tests) were red before the rebase and appear pre-existing on main (same pattern on #525 which is already merged).

Ready for review when a maintainer has capacity — claim is in #374.

@luisbaker luisbaker closed this Nov 22, 2026
@luisbaker
luisbaker force-pushed the d3d-50-checkfeaturesupport branch from 79626e8 to 003e781 Compare November 22, 2026 14:37
…D-50)

Add a comparison test that runs CheckFeatureSupport on both the shim and the host PC runtime and asserts their HRESULTs agree for invalid inputs: a null data pointer, a structure smaller than the feature requires, and feature values no runtime defines. Valid queries are not compared (their answers are the GPU choice). No game files; runs on WARP or any D3D12/Vulkan GPU.
@luisbaker luisbaker reopened this Nov 22, 2026
@luisbaker

luisbaker commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Reopened and cleanly rebased onto current main (4eb6155d) as 697bdae8 (earlier automated rebase accidentally pushed main with 0 commits, which auto-closed the PR).

Re-verified locally on Windows 11 / Intel(R) Graphics (MSVC 14.44, Vulkan SDK 1.4.363.0): d3d12_vulkan_device_test passes with and without LEONIDA_VK_VALIDATION=1 (0 validation errors). AI-assisted.

@ItsNotRexed
ItsNotRexed merged commit 56e0e72 into ProjectLeonida:main Nov 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants