Skip to content

Tests: when the test title does not finish, print why - #2890

Open
Luislariosss wants to merge 1 commit into
xcl-dev:mainfrom
Luislariosss:test/e2e-diagnosable-assert
Open

Luislariosss wants to merge 1 commit into
xcl-dev:mainfrom
Luislariosss:test/e2e-diagnosable-assert

Conversation

@Luislariosss

@Luislariosss Luislariosss commented Nov 26, 2026 •

Copy link
Copy Markdown

Follow-up to #500. Supersedes #512: the branch was force-pushed after that PR was closed, so GitHub cannot reopen it; this is the same change, rebased and updated to the template.

The end-to-end debug-layer test only printed the launcher's opening lines when the test title did not run to the end:

the test title did not run to the end:
XCL 0.1.0 – starting 'XCL.TestTitle'
  ...
  console: imports kernelx.dll, xgameruntime.dll

with no exit code and no log, so a failure could not be told apart from a refusal, a crash, or a title that never started. I hit that once on this machine (it did not reproduce in five later runs, see #500) and could not diagnose it.

What is in it

  • crates/xcl/tests/e2e.rs: the "did not run to the end" and "debug layer did not come up" assertions now print the process exit code, the launcher's stdout and stderr, and the last 40 lines of xcl.log; the log is read with unwrap_or_default(), so a missing log no longer panics on its own and hides why the title stopped. Rebased onto current main, which added an exit-code check of its own: both are kept, with the log tail on the failure paths.
  • The kernelx commit this branch carried earlier is gone: it is kernelx: a lazy page whose commit fails stays lazy, and says so #502's, and this PR is test-only now.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), Windows driver 32.0.32029.2010; Ryzen 5 9600X; Windows 11 build 26200; Rust 1.99.0 stable-x86_64-pc-windows-msvc; debug build.
  • cargo build --workspace: ok.
  • cargo test -p xcl --test e2e (the two debug-layer tests): ok, 2 passed, 0 failed.
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 1316 passed, 2 failed, 27 ignored. The 2 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 and fuzz_validate_and_gpu_3 (a CPU/GPU result mismatch in the DXIL fuzzer): pre-existing on main on this adapter (checked out 8b957be and reran them: same two failures; tracked upstream in DXIL fuzz tests: fuzz_validate_and_gpu_1 fails on AMD (seed 722 and others, RDNA2-4), so the default suite is red there #2115) and untouched by this PR.

Not tested

  • NVIDIA and Intel GPUs; the retail title (this change touches only a test's failure message).

AI use

  • Claude Code (Claude Sonnet 5.5) reworked the test after the rebase, ran the commands above on the hardware named, and drafted this description.

The assertion in the debug-layer end-to-end test only printed the launcher's
opening lines, so a failure looked like "the test title did not run to the end"
with no exit code and no log. I hit exactly that once here (it did not
reproduce in five later runs, issue xcl-dev#500) and could not tell whether the title
crashed, was refused, or never started.

Now the failure carries the process exit code, the launcher's stdout and
stderr, and the last 40 lines of xcl.log, which is where the debug layer's own
objections end up:

    the test title did not run to the end (exit Some(0)):
    --- xcl stdout ---
    ...
    --- xcl stderr ---
    --- xcl.log, last 40 lines ---
    xcl: D3D12 debug layer (error, id 93): ID3D12Device::CreatePixelShader: ...

The log is read before the assertion and with unwrap_or_default, so a missing
log no longer panics on its own and hides the reason the title stopped; the
"debug layer did not come up" assertion prints the same tail.

cargo test -p xcl --test e2e test_title_draws: ok, 1 passed. Test-only, no
production code touched.
@fromthemoonx

Copy link
Copy Markdown

NVIDIA run (listed under Not tested): passes, and the new message shows up on a real failure here.

Tested: c6c14a1 (its base is current main 8b957be, so head = merged). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug, Graphics Tools (D3D12 debug layer) installed.

result
cargo test --workspace --no-fail-fast -- --test-threads=4 1446 passed, 0 failed, 47 ignored; 25 SKIPPED lines (no wave64, refused per-lane forms); the 4 e2e tests pass
XCL_CONSOLE_LISTS=1 cargo test -p xcl --test e2e test_title_draws_with_a_root_signature_under_the_debug_layer (fails the same way on main: the title crashes in D3D12SDKLayers.dll+0x7f00c) fails at the exit-code assertion, which now ends with --- xcl.log, last 40 lines --- and the log's unhandled exception 0xc0000005 in D3D12SDKLayers.dll+0x7f00c (read at address 0x0) line

Two things from that run:

  • For a crash, main's message already names the cause: the exit-code assertion prints stdout, and stdout has the CRASH: unhandled exception … line. The tail adds the log's side. It helps most in the case from Windows 11 26200 + RX 9060 XT: two e2e tests fail; the test title's overlay delete returns ERROR_FILE_NOT_FOUND #500, a title that exits 0 without done, failures: 0.
  • On a crash, 33 of the 40 tail lines are the thread dump (one line per thread), so the exception line was 5th from the top. A title with a few more threads would push it out. Cutting the tail at thread dump ( or taking more lines would keep it in.

Small style point: const TAIL and fn tail sit between the use std::path and use std::process lines; after the use block they would read more naturally.

Not tested: Intel, a title that exits 0 without finishing (I could not trigger one here).

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.

rootw0rm pushed a commit to rootw0rm/xcl that referenced this pull request Nov 26, 2026
…re messages)

Upstream xcl-dev#2890 (c6c14a1, single-commit on upstream/main 8b957be):
title_under_the_debug_layer prints the last TAIL=40 lines of xcl.log
in its three assertion messages and tolerates a missing log file
(unwrap_or_default), so a title that never finishes still shows why.

Verbatim port of the whole fix (1 file, +24/-4): the TAIL const +
tail() helper after the PathBuf import and the three rewritten
asserts. Applies cleanly; the only context offset is the
linux-only debug_layer_skip_line helper above the hunk.
Windows-only siblings xcl-dev#2888 (perf-compare ps1 stack), xcl-dev#2889
(tiling_parity.rs host-driver test, no cfg(windows) gate), xcl-dev#2891
(title_textures.rs write-watch tiering on the 71b8e6e dev-stack)
stay out per the step-139 sync entry.
rootw0rm pushed a commit to rootw0rm/xcl that referenced this pull request Nov 26, 2026
@JJAutoCompare

Copy link
Copy Markdown

Tested

At clean c6c14a157cc683bd2b8c64d15f83c2eb2f3273b9, Windows 11 build 26200, Ryzen 7 3800X, Rust 1.100.0 MSVC debug. Built the checked-in e2e.rs with a synthetic launcher in an isolated harness using cargo test --manifest-path .\control\crates\xcl\Cargo.toml -j 2 --test e2e --no-run, then ran powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\run-controls.ps1. Eight controls passed, with zero failures, ignores or skips. The two success controls passed libtest, and the six negative controls produced their expected failure diagnostics. Checked nonzero exit, missing completion marker, missing debug marker, stdout/stderr capture, exactly the last 40 lines when present, and an empty tail when the log was absent. A delayed child held the harness open during a 400 ms wait and the diagnostic printed after release. The harness has no child timeout at this SHA.

Running & $e2e debug_layer --nocapture --test-threads=1 with the real SystemRoot emitted two explicit skips for missing d3d12SDKLayers.dll. xgameruntime.dll was also absent.

Not tested

Real D3D12 or DRED execution, retail titles, and the full workspace suite.

AI use

T3 Code / Codex (gpt-6.2-sol for the worker run) built and ran the controls and drafted this report. Codex in the coordinator session reran the controls.

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.

3 participants