mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:30:53 +01:00
[PR #1293] [CLOSED] runtime: opt-in presentation-path diagnostics (RT-PRESENT-PROBE) #1324
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1324
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1293
Author: @Moriz82
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:split/rt-present-probe📝 Commits (1)
6e8b29cruntime: opt-in presentation-path diagnostics (RT-PRESENT-PROBE)📊 Changes
7 files changed (+539 additions, -10 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+20 -0)📝
runtime/CMakeLists.txt(+11 -0)📝
runtime/shims/d3d12_com.cpp(+8 -3)📝
runtime/shims/xbox_present.cpp(+3 -2)➕
runtime/src/present_probe.h(+31 -0)📝
runtime/src/vulkan_present.h(+8 -5)➕
runtime/test/present_probe_test.cpp(+458 -0)📄 Description
Claimed in the coordination issue as: RT-PRESENT-PROBE (claim).
Part of the split of #984 into small pull requests.
Depends on: none
Overlaps: #984 (integration source; there these lines were unconditional local diagnostics, here they are behind a switch). #498 summarizes the existing capture and shader-lookup lines in
boot_trace.pyand reads none of the new ones. #576 dumps thread stacks of a hung boot. Neither logs the presentation path.What and why
A boot that reaches its frame loop can present frames that show nothing. The log then says only that
PresentXreturned, not where the picture was lost. Two switches, both off by default, answer that.LEONIDA_PRESENT_PROBE=1writes[rt] present-probe:lines to stderr:ClearRenderTargetView: the target's resource id, mip and layers, the colour and the rectangle count.PresentXcall: plane count, whether parameters were given, the suspended and registered states, and per plane the token, resource count, first resource id and flags. A refused call names the check and theHRESULT.blit,composeorblank), the source id, whether it still resolves, its format, extent, mips, layers and samples, and running counts per path. A present queued behind held work is counted.Each kind of line is written for the first few events and then for every 600th (draws: every 1200th; refusals: the first 40). The lines hold ids, sizes, formats, counts and result codes. No line holds buffer or texture contents.
LEONIDA_CAPTURE_SOURCE=1, together with the existingLEONIDA_CAPTURE=<dir>, also copies mip 0 of the texture the title presented, for the same frames the capture writes. It writes<dir>/source_NNNNN.ppmand one line of<dir>/source_index.txtwith the path, format, extent, tracked layout, mean RGB and the number of non-zero texels. The frame capture says what was shown. The source capture says what was handed over, so a black frame can be told from a failed blit or composition. A texture that no tracked operation wrote is listed asnever writtenand not read.With both unset, no line is written, no counter is kept and no extra Vulkan work is submitted. The switches are read once: the capture switch when the presenter is created, the probe switch at the first probed call.
The refusal lines wrap the values
present_xalready returned, so the results ofPresentXare unchanged.Tested
Cross-built on CachyOS Linux 7.3 with clang-cl 23.1.5 and the xwin SDK. Ran the Windows tests one at a time under Wine 11.22 (distribution build, fresh prefix) on a Ryzen 5 5600X, 16 GB RAM, NVIDIA GeForce RTX 4070 12 GB, driver 620.73.04.
present_probe_testclears a target, issues one draw without a viewport and one full-screen draw, then callsPresentXwith one plane, no plane, an overlay plane, three planes and a token that was never handed out. It captures stderr and hasLEONIDA_CAPTUREon in both forms.present_probe_test(both unset)present_probe_test --onClearRenderTargetViewline.PresentXof which 2 refused, 3 submits: blit, blank, compose), 2 source images and their index lines match the yellow scene.Both forms present the same 3 frames (yellow, black, yellow), each checked pixel by pixel, and return the same
HRESULTs.Two further runs of each form stopped before any probed call, at
CreateWindowExW(line 373), while an unrelated job on the same desktop had some thousand crashing Wine processes open. The runs before and after it passed.d3d12_draw_test,d3d12_com_test,vk_presenter_sync_testxbox_present_testd3d12_present_testpython3 -I scripts/check_no_game_data.py,tests/test_docs_env_vars.py,git diff --checkpython3 -I scripts/run_semantic_tests.py tests/semantic -j 2tests/test_imhex_patterns.py, as on the base. None added. Semantic suite: 470 files, 6,168 tests, 0 failing files.Rebased before opening. The cut was made on
6293c1c4f, andmainthen changedrecord_draw(it now tests every bound viewport), which conflicted with the probe's draw line. This head is the same change onmain6261ca916; the probe's "not recorded" test now usesmain'sany_nonempty_viewport(). On the rebased head these were run again and pass: the build ofgta6rt,present_probe_testin both forms (2 runs each, same lines and files as above),d3d12_draw_testwithout the probe (0 probe lines) and withLEONIDA_PRESENT_PROBE=1(14 probe lines), andd3d12_com_test. The base-implementation column,xbox_present_test,d3d12_present_test,vk_presenter_sync_testand the Python loops are from the head before the rebase.Not run: native Windows, Proton, AMD and Intel GPUs, the Vulkan validation layer (not installed), CTest itself (the executables were started directly), and a boot of the title.
GPUs tested: NVIDIA GeForce RTX 4070, driver 620.73.04, Linux under Wine 11.22.
AI-assisted: yes (Claude Code).
Checklist
6261ca916. Merges cleanly.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.