Skip to content

test: synthetic end-to-end D3D12 first-boot trace guest - #4264

Open
sds-228 wants to merge 2 commits into
ItsNotRexed:mainfrom
sds-228:boottrace-d3d12-e2e
Open

sds-228 wants to merge 2 commits into
ItsNotRexed:mainfrom
sds-228:boottrace-d3d12-e2e

Conversation

@sds-228

@sds-228 sds-228 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

TEST-916 (claimed in #3918, carried to #4084). Adds an opt-in, GPU-gated CTest that runs a synthetic EXE under gta6rt --run with both first-boot traces enabled. It checks the guest marker, startup JSONL, D3D12 call log, and the same tools/boot_trace.py summary used for triage. No game files, no new D3D12 behaviour, no changes to the runtime; opt-in CMake flag defaults OFF.

RTX 3090/621.24: targeted CTest 1/1; full CTest 154 passed, 0 failed; 9 startup events, 12 D3D12 calls, 0 failed/unsupported/refused, exit 0. Negative control fails when a call outcome is changed.

AI-assisted (OpenCode).

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Built and ran the opt-in test at 692ba1ee on Windows 11, RTX 5070 Ti, with -DLEONIDA_TEST_BOOT_TRACE_GUEST=ON:

  • Built gta6rt, the d3d12_xs stub fixture and tiny_boot_trace_guest.
  • ctest -R '^d3d12_boot_trace_guest$' -> 1/1 passed (1.23 s).
  • The guest runs through gta6rt --run; the check reports 9 startup events, 12 D3D12 calls, 0 failed, 0 unsupported, 0 refused, exit 0, and boot_trace.py --json consumes the same logs. The marker line and both traces are verified.

This is synthetic-only and opt-in, and the normal (OFF) configure is unchanged. No blocking issue.

@Flyander Flyander left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The opt-in guest checks the startup and D3D12 traces from the same gta6rt run, and verifies the expected calls and outcomes. Independent Windows GPU review passed the targeted CTest; the PR reports 154/154 full CTest passing. No blocking issue found.

@SweatierKey

Copy link
Copy Markdown
Contributor

Independent code read + build/hygiene check at 692ba1ee on Linux (WSL2, Python 3.13.5, no Windows/GPU host, no game files): pass (Windows Vulkan GPU run of d3d12_boot_trace_guest not run here).

  • Code read (runtime/CMakeLists.txt, d3d12_boot_stub.*, d3d12_trace_guest.cpp, check_boot_trace_guest.py, run_boot_trace_guest.cmake):
    • Link-time d3d12_boot_stub (outputting d3d12_xs into fixtures/boot_stub/<CONFIG> returning E_FAIL) cleanly forces tiny_boot_trace_guest.exe (in fixtures/boot_guest/<CONFIG>) to resolve D3D12XboxCreateDevice through gta6rt --run's shim registry rather than a local DLL.
    • check_boot_trace_guest.py and run_boot_trace_guest.cmake agree consistently on the 12 recorded D3D12 lines (9 ok + 3 XboxID3D12CommandQueue::* called proxy lines), exact method order, boot_trace.py --json summary fields (startup.exit == 0, d3d12.calls == 12, d3d12.last_seq == 12), and strict single-occurrence marker check.
    • Properly opt-in (LEONIDA_TEST_BOOT_TRACE_GUEST OFF by default) with SKIP_RETURN_CODE 77 and TIMEOUT 180.
  • Checks run (clean worktree on 03b09a08): py_compile runtime/test/check_boot_trace_guest.py, git diff --check, test_ctest_registration.py (4/4), test_docs_links.py (6/6), test_docs_repo_paths.py (2/2), test_text_write_line_endings.py (3/3), test_text_encoding.py (2/2) all pass.
  • Not run here: Windows MSVC build and live d3d12_boot_trace_guest Vulkan execution.

AI-assisted review.

@JRamos1993

Copy link
Copy Markdown
Contributor

Tested 692ba1e merged onto main d0835dd on an RTX 5090 (driver 616.92), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363, RelWithDebInfo:

  • Full ctest: 154/155.
  • Failed only in the parallel run: xdxr_build_check (passed when rerun on its own).
  • Warnings: none new in the files this PR changes.

AI-assisted (Claude Code).

Opt-in, GPU-gated CTest runs a synthetic EXE under gta6rt --run with both first-boot traces. Checks the guest marker, startup JSONL, D3D12 call log, and the same boot_trace.py summary a triage uses. No game files.

AI-assisted (OpenCode)
@sds-228
sds-228 force-pushed the boottrace-d3d12-e2e branch from 692ba1e to 13e9791 Compare November 23, 2026 06:53
@sds-228

sds-228 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased onto current main; both the tiny_frame and the boot-trace test registrations are kept. The synthetic guest now waits for GPU completion before fence teardown (0 semaphore-in-use VUIDs). Validation CTest: 178 passed, 0 failed, 0 validation errors; boot-trace guest 1/1 pass, 13 D3D12 calls.

AI-assisted (OpenCode).

@amarovndres

Copy link
Copy Markdown

Tested 13e9791b (rebased head) on AMD Radeon RX 9060 XT (RDNA4), AMD 26.10.1, Windows 11 Pro (build 26200). gta6rt, tiny_boot_trace_guest and d3d12_boot_stub were built from this head with MSVC (VS 2022 Build Tools, Windows SDK 10.0.26100) and -DLEONIDA_TEST_BOOT_TRACE_GUEST=ON: pass.

  • ctest -R '^d3d12_boot_trace_guest$': passed. boot trace verified: 3 startup event(s), 13 D3D12 call(s), 0 failed, 0 unsupported, 0 refused, exit 0, and marker line and both traces verified. The trace runs through XboxID3D12Fence::SetEventOnCompletion.
  • Note: LEONIDA_TEST_BOOT_TRACE_GUEST is off by default, so a plain configure (and, as far as I can tell, CI) never builds or runs this test. If it's meant to guard the boot path, it may be worth turning on in runtime.yml's Windows leg.

AI-assisted (Claude Code). Synthetic guest only, no game files.

@tunczzz

tunczzz commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 13e9791b (merge base 3faac557) on Windows 11 10.0.26300 with an NVIDIA GeForce RTX 5070 Ti (Blackwell, subgroup 32..32), driver 616.56. Result: pass.

  • Runtime built from this head: MSVC 19.44 (BuildTools 2022), Ninja, RelWithDebInfo, -DLEONIDA_VULKAN_HEADERS_FETCH=ON (no Vulkan SDK; the loader comes from the NVIDIA driver). glslangValidator and llvm-mc 21 came from WSL Ubuntu. Build exit 0.
  • ctest -j 3: 177/177 passed.
  • scripts/run_gpu_tests.py --build <this build>: 170/217 passed, 47 skipped, 0 failed.
  • d3d12_boot_trace_guest is off by default, so I reconfigured the same build with -DLEONIDA_TEST_BOOT_TRACE_GUEST=ON and ran it (Python 3, Windows host): passed. Its output: boot trace verified: 9 startup event(s), 13 D3D12 call(s), 0 failed, 0 unsupported, 0 refused, exit 0, then marker line and both traces verified.
  • Every test gives the same result as on main 3faac557 (ctest 177/177, GPU 170/217).
  • As on main, run_gpu_tests.py records cs_fmt_d16_xyz twice and skips cs_tbuffer_store. That's main's runner bug, fixed by run_gpu_tests: record cs_tbuffer_store's result; fail a run that records a test twice #4784, not this PR.

Not run: other GPUs/vendors, Linux, the Vulkan validation layer (not installed). No game files.

AI-assisted (Claude Code).

@sds-228

sds-228 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@amarovndres @tunczzz Done — the Windows CI configure now sets LEONIDA_TEST_BOOT_TRACE_GUEST=ON, so the guest is built and its CTest runs there. A GPU-less runner reports a CTest skip instead of a failure, and tools/boot_trace.py is now in the workflow path filters so changes to the tool retrigger CI.

CPU-only verification: workflow path test 5/5, CI configure flags 6/6, CTest registration 5/5, compile and no-game-data checks clean. I can't run CMake/CTest natively here, so the Windows execution still rests on your two passes.

AI-assisted (OpenCode).

@lines9686-rgb

Copy link
Copy Markdown
Contributor

Tested d38b1bbfe merged onto main dde82f27e on Windows 11, Python 3.12.0 (Windows PowerShell 5.1), user profile path with non-ASCII characters: pass for the Python side only. The guest was not built and the CTest was not run (no build or GPU here).

  • python -I tests/test_cmake_vulkan_missing.py: 6 OK. python -I tests/test_ctest_registration.py: 5 OK.
  • Fails on main: the PR's versions of both files against unmodified main each give 1 failure: test_windows_ci_builds_the_boot_trace_guest and test_boot_trace_guest_skips_without_a_vulkan_device.
  • runtime/test/check_boot_trace_guest.py on synthetic traces written to D:\Leonida\тест tmp\boot trace\ (Cyrillic plus spaces, with the 13 EXPECTED_METHODS, 9 ok + 4 called, and a startup trace with trace_open/map/exit 0): exit 0, boot trace verified: 3 startup event(s), 13 D3D12 call(s), .... The same with LF, CRLF and UTF-16 LE with BOM.
  • Negative control: with call Proof of GPU #3 changed to failed, it exits 1 with 1 D3D12 call(s) ended as failed; D3D12 ok outcomes are 8, not 9; 1 failed call(s).
  • tests/test_runtime_paths.py: 1 failure (tools/replace_retry.py: missing (via tools/rdna2spirv.py)), the same on main, so it is not from this PR.

No game files. AI-assisted (Claude Code).

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.

8 participants