Skip to content

Tests: d3d12_present_test skips (77) without a presentation-capable Vulkan device (PresentX core itself landed with #119) - #908

Merged
ItsNotRexed merged 2 commits into
ItsNotRexed:mainfrom
AlxcBTW:presentx-core-v2
Nov 22, 2026
Merged

ItsNotRexed merged 2 commits into
ItsNotRexed:mainfrom
AlxcBTW:presentx-core-v2

Conversation

@AlxcBTW

@AlxcBTW AlxcBTW commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

The PresentX core this PR was opened for (FramePacer, XboxPresentation, the presenter extensions and their tests) is on main now. It landed with #119's merge, and so did the resource_mutex_ fix and the ctest registration of d3d12_present_test from this branch. Thanks @ItsNotRexed.

What is left: one fix

main registers d3d12_present_test with SKIP_RETURN_CODE 77, but the test never returns 77. It starts with EXPECT(d.create(true)), so on a machine without a Vulkan device that can present (CI runners, Wine, headless), it fails (exit 1) instead of being skipped. It now returns 77 there, like xbox_present_test does.

Tested

On the Radeon 880M (26.11.2) and the RTX 5070 (617.42): ctest -R "d3d12_present|xbox_present|frame_pacer" gives 3/3 on each GPU. tests/test_ctest_registration.py passes.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

@kapitche

Copy link
Copy Markdown
Contributor

Tested 5517ed7 on Windows 11 with two GPUs on one machine (MSVC 14.51, full shader toolchain):

NVIDIA RTX 4080 SUPER (32.0.16.1714) Intel UHD 770 (32.0.101.6129)
ctest 34/34 33/34
xbox_present (new) pass pass
frame_pacer (new) pass pass

The Intel failure is d3d12_vulkan_device's OPTIONS19.SupportedSampleCountsWithNoOutputs mismatch, which fails on main too (reported in #634). It isn't from this PR.

One question. On both GPUs, xbox_present logs [rt] d3d12: present failed (VkResult -11) three times (d3d12_vulkan_device.cpp:2908), while every check prints ok (1 plane, RGBA8 solid: ok (swapchain format 44), sRGB source (swapchain follows): ok, suspend/resume with re-registration: ok). -11 is VK_ERROR_FORMAT_NOT_SUPPORTED. Is that a deliberate refused case, for example a source format the swapchain can't take? If so, a word in the test output would help. If it isn't, a present that fails silently while the test passes would be worth tracking down. The unimplemented paths the log also names (ImmediateThresholdPercent, the 2-plane HDR/GameDVR composition, stale or null tokens presented anyway) look intended and documented.

@tylerstraub

Copy link
Copy Markdown
Contributor

Replying to @kapitche.

Yes. At 5517ed7, the three VkResult -11 lines correspond to deliberate refusal cases. The test calls PresentX once each with a 4× MSAA RGBA8 UNORM image, an RGBA8 UINT image, and a BC1 UNORM image. The presenter logs VK_ERROR_FORMAT_NOT_SUPPORTED before mapping it to DXGI_ERROR_UNSUPPORTED, the HRESULT the test expects on all three calls. HRESULT mapping

The test also checks that the present count stays fixed and the displayed colour survives all three refusals. It then reuses the same token with a supported source, requires S_OK, and checks for green pixels. The summary line for this block is unsupported sources (MSAA, integer, BC) refused: ok. Three inputs, expected returns, and pixel checks

AI-assisted.

@kotorvr

kotorvr commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested d5ad74a on RTX 4090 (driver 621.14), Windows 11 26200, MSVC 19.44: pass (no regression against main).

  • Clean RelWithDebInfo Ninja build of runtime/ (Vulkan SDK 1.4.363.0), then ctest with validation on: 67/67 pass.
  • GPU tests with LEONIDA_VK_VALIDATION=1 and the Khronos validation layer: d3d12_com_test, d3d12_copy_xfmt_test, d3d12_debug_markers_test, d3d12_depth_resolve_test, d3d12_descriptor_test, d3d12_fence_events_test, d3d12_fence_timing_test, d3d12_fence_waiter_test, d3d12_gcl8_test, d3d12_indirect_rt_test, d3d12_method_variants_test, d3d12_multithread_test, d3d12_node_mask_test, d3d12_predicated_copy_test, d3d12_present_test, d3d12_query_rules_test, d3d12_resource_desc_test, d3d12_sampler2_test, d3d12_state_map_test, d3d12_typeless_rtv_test, d3d12_uav_clear_test, d3d12_vulkan_device_test, vk_command_replay_test pass, with 0 validation messages (no VUIDs). vk_overlapping_occlusion and vk_binary_occlusion pass under ctest.
  • d3d12_clear_test fails, the same as on plain main f85582e on this GPU (NVIDIA rounds the 0.5 clear on 8-bit UNORM/SNORM down, Vulkan 7f, WARP 80, plus one depth-format-55 case). This is not caused by this PR.

The vk_* harness tests that need translated SPIR-V weren't run. No game files used. AI-assisted run (Claude Code).

…vice with presentation

tests/test_ctest_registration.py requires every built *_test to be run by
ctest. d3d12_present_test now exits 77 when vktest::Device can't be created
with presentation, like xbox_present_test, and is registered with
SKIP_RETURN_CODE 77.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ItsNotRexed added a commit that referenced this pull request Nov 22, 2026
ItsNotRexed added a commit that referenced this pull request Nov 22, 2026
#908 brought the M0 present test (70 frames to a window, then a resize) but no add_test ran it, which
test_ctest_registration catches. It is registered like its neighbours (exit 77 is a skip) and passes on an
RTX 4060 Ti.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AlxcBTW AlxcBTW changed the title Runtime: Xbox presentation core — PresentX, frame events, SuspendX/ResumeX (Depends on #119) Tests: d3d12_present_test skips (77) without a presentation-capable Vulkan device (PresentX core itself landed with #119) Nov 22, 2026
@Vonsek

Vonsek commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

@AlxcBTW, c2967a5 now registers d3d12_present with CTest and sets SKIP_RETURN_CODE to 77. The Windows job on main and the same job on test-only #1394 each failed only test 61, d3d12_present, with line 139: d.create(true). Your existing change at 5db6905 handles precisely the failed device-creation call by returning 77. This reports the hosted baseline result; I have not inferred which Vulkan initialization step on the runner failed. AI-assisted.

aslan2142 added a commit to aslan2142/Leonida that referenced this pull request Nov 22, 2026
main gained 117 commits since f85582e, among them ItsNotRexed#119 itself (through ItsNotRexed#908,
which is built on its head and adds PresentX on top), so both sides now
carry the presentation path: this branch as ItsNotRexed#119's own commits merged with
main at 426023a, main as ItsNotRexed#908's integration of them. Eleven hunks in six
files conflicted.

runtime/src/vulkan_present.h (2 hunks):
- present's blit: main's structure (a blank present, the source rectangle)
  with both locks of the branch. record() reads and updates the context's
  layout tracker, which ExecuteCommandLists guards with tracker_mutex_ (it
  copies the tracker, emits, and commits the copy after the submit); under
  the resource lock alone a present between that copy and that commit would
  lose its update. Order as in the context: resource -> tracker -> submit.
- presentable(): identical code, main's comment.

runtime/shims/d3d12_vulkan_device.cpp (3 hunks):
- includes: shader_library.h stays (pipelines read the translator's index);
- Resource's fields: the branch's arena fields and main's rgb96_ (D3D-62);
- standalone device: info.presentation is set once, where the swapchain
  extension is pushed (the branch's order); main set the same value later.

runtime/shims/d3d12_com.h (2 hunks): the union of the includes; the
branch's VulkanDeviceInfo::features and shader_dir stay.

runtime/CMakeLists.txt: main now builds and registers d3d12_present_test
next to xbox_present_test, so the branch's copy of that block goes; the
compute and draw tests keep theirs. d3d12_present_test keeps returning 77
without a Vulkan device, which main's registration (c2967a5) relies on but
main's test does not do yet.

README.md, docs/d3d12_vulkan.md (3 hunks): the branch's text. main's side
is what the branch had already merged at f85582e, unchanged since.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@ItsNotRexed
ItsNotRexed merged commit f0167e6 into ItsNotRexed:main Nov 22, 2026
11 checks passed
aslan2142 added a commit to aslan2142/Leonida that referenced this pull request Nov 22, 2026
main moved from c2967a5 to bb2e184 (118 commits), among them ItsNotRexed#908 (PresentX)
and one VkQueue per D3D12 command queue. Five hunks in three files conflicted.

runtime/test/d3d12_present_test.cpp: main's skip from ItsNotRexed#908 (77 whenever no
Vulkan device with presentation can be created). The branch's own version of
that skip (4a4acf3) is no longer needed; the file is now main's.

runtime/src/vulkan_replay.h (2 hunks), main's side in both:
- a footprint copy's buffer offset: main now computes buffer_offset + offset
  once as backing_offset, with an overflow and an alignment check; the branch
  wrote the same sum inline;
- CopyResource between buffers: main starts both ranges at buffer_offset, as
  the branch did, and adds the empty-size, overflow and overlap checks
  (source and destination can be the same VkBuffer in the arena).

runtime/shims/d3d12_vulkan_device.cpp (2 hunks), the standalone device:
- the branch's unconditional bufferDeviceAddress (device selection requires
  it) is kept in front of main's block that creates up to 16 queues; the
  single queue priority the branch still had is gone with main's change;
- two additions at the same place are both kept: the branch's device
  features for graphics PSOs and translated shaders (info.features), and
  main's VK_KHR_shader_fma block.

CMakeLists.txt, d3d12_com.cpp, d3d12_com.h, docs/d3d12_vulkan.md and
vk_test_device.h merged without conflicts; no test is registered twice
(tests/test_ctest_registration.py passes).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.

6 participants