Repository navigation
Conversation
This was referenced Nov 24, 2026
A frame that is presented but shows nothing leaves no trace of where it was lost: whether the title cleared or drew into the target, whether PresentX was refused and by which check, which path the presenter took and what its source texture was. LEONIDA_PRESENT_PROBE=1 writes bounded `[rt] present-probe:` lines for ClearRenderTargetView, for each draw (recorded, or dropped for want of a viewport), for each PresentX call and refusal, and for each present the presenter submits (blit, compose or blank, with the source's description). LEONIDA_CAPTURE_SOURCE=1, with LEONIDA_CAPTURE, also reads back the presented texture of each captured frame and writes it next to the frame with one index line. The lines hold ids, sizes, formats, counts and result codes, never the contents of a buffer or texture. Unset, nothing is written and no counter is kept. Cross-built gta6rt and present_probe_test. The test makes the same clear, draws and PresentX calls with both variables unset and set. With the base's implementation the unset form passed and the set form failed at its first probe expectation. On the change both passed under Wine 11.22 on an RTX 4070: 0 probe lines and 0 source files unset, 20 probe lines and 2 source images set, and the same 3 presented frames in both. AI-assisted (Claude Code). Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Moriz82
force-pushed
the
split/rt-present-probe
branch
from
November 25, 2026 03:51
b18845d to
6e8b29c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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