Skip to content

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

Merged
throny merged 1 commit into
xcl-dev:mainfrom
Luislariosss:test/e2e-diagnosable-assert
Dec 2, 2026
Merged

throny merged 1 commit into
xcl-dev:mainfrom
Luislariosss:test/e2e-diagnosable-assert

Conversation

@Luislariosss

@Luislariosss Luislariosss commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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.

@BBareth

BBareth commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

merge-check claim
head: c6c14a1

@github-actions github-actions Bot added area:tests Unit, integration, e2e tests, or testtitle needs-1st-check Passes gates; needs first independent merge-check (#3041) labels Dec 1, 2026
@BBareth

BBareth commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

merge-check
base: 493dbd3
head: c6c14a1
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> two runs: 2899 passed, 1 failed, 51 ignored, then 2900 passed, 0 failed, 51 ignored; 28 SKIPPED lines in both, as on the base; failing in the first run only: hle::d3d12x::pso_async::used_tests::emission_resolves_the_retained_recipe_after_title_address_reuse (pso_async.rs:6063, a leftover reference count of 1), in a file this PR does not touch; cargo test -p xcl --lib pso_async on the base alone then passed 6 of 6 times, so it is intermittent and not from this PR. The base alone, same machine, same commit: 2900 passed, 0 failed, 51 ignored, 28 SKIPPED lines (22 no wave64, 2 no heap windows, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 cannot disable the driver cache). The e2e tests this PR changes (test_title_runs_under_the_debug_layer_with_dred and the one without DRED) ran and passed in both runs.
review: no blocking finding; one file (+24/-4, crates/xcl/tests/e2e.rs), every line read. The three assertions of title_under_the_debug_layer now also print the exit code and the last 40 lines of xcl.log; the log is read before the assertions with unwrap_or_default, so a missing log no longer panics on the read but fails the "debug layer did not come up" assertion with an empty tail. Nit: the new TAIL constant and tail function sit between two use lines. Not tested here: a failing title run, where the new text would show.
performance: none: test code only.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.

@github-actions github-actions Bot added needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) and removed needs-1st-check Passes gates; needs first independent merge-check (#3041) labels Dec 1, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Triage (#1607) – head c6c14a1

This is the same change as #512 (closed, same author), which it replaces. No open PR makes the same change.
Minor points in crates/xcl/tests/e2e.rs: TAIL and tail are declared between the two use lines, and the doc comment (The last n lines of s) is on the const, not on the function. The other title test's assertion ("the test title did not run to the end", e2e.rs:191 on main) still prints nothing.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

@vasanex

vasanex commented Dec 2, 2026

Copy link
Copy Markdown

merge-check
base: 1c8b551
head: c6c14a1
merge: clean (merged tree 44b777a0, git diff --check clean)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2909 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache), the same set as on the base; failing: none. Base alone, same machine: 2909 passed, 0 failed, 51 ignored. The e2e test this PR changes ran and passed (test_title_runs_under_the_debug_layer_with_dred).
review: whole diff read (one file, crates/xcl/tests/e2e.rs, +24/-4). No blocking finding. The three assertions of title_under_the_debug_layer now print the exit code and the last 40 lines of xcl.log; the log is read before them with unwrap_or_default, so a missing log fails the "debug layer did not come up" assertion with an empty tail instead of panicking on the read. Nit, as the first check says: TAIL and tail sit between two use lines. The new messages were not seen here, since the title run did not fail.
performance: none: test code only.
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3080 10 GB (driver 621.40), AMD Ryzen 9 7950X, Windows 11 Pro 26200, rustc 1.100.0, debug / Claude Code with Claude Fable 5.2. Run and posted without a human check of each point.

@github-actions github-actions Bot added ready-to-merge Has 2 independent safe merge-checks on current head (#3041) and removed needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) labels Dec 2, 2026
@throny
throny merged commit e35cd7c into xcl-dev:main Dec 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tests Unit, integration, e2e tests, or testtitle ready-to-merge Has 2 independent safe merge-checks on current head (#3041)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants