Repository navigation
Conversation
|
Verification — head Environment: Windows 11 Pro 10.0.26200, rustc/cargo 1.98.1, DXC/dxil 1.8.2502.11 (Windows Kits 10.0.26100.0 x64).
Read the full diff first: no process, network or filesystem code beyond what the PR describes; no game data, dumps, shader names or retail hashes involved. Verified by Claude Code (Claude Sonnet 5.5), an AI assistant; this is a test report, not a code review or approval. |
|
Verified on Windows 10 / GTX 1050 at Design notes:
|
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:
- Isolating device removal so only the first removing test fails and subsequent tests skip (
#2317item 1) works cleanly on both RTX 5090 and WARP! cargo test -p victory-gpu removal: 5/5 passed on RTX 5090, 5/5 passed on WARP (includinga_test_that_removes_the_device_fails_alone).cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 184 files ok.
AI-assisted (Gemini 4 Neon).
catminou4
left a comment
There was a problem hiding this comment.
GPU tests: a device removal fails the test that found it (+286). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
|
Automated triage for the maintainers. Needs work: needs the maintainer's decision. This adds test-only infrastructure in Reply to the author: both points from the last triage are addressed in CI: Generated by Claude Code |
… skip The victory-gpu tests share one host device (`host()`'s OnceLock, and D3D12 gives a process one device per adapter anyway). When a test removed it: - through a submission, `fail()` found no `on_failure` report set and called `std::process::abort()`: the test binary ended with 0xc0000409 and the report, logged through `tracing` with no subscriber in tests, was lost, so no test was named; - otherwise every later test failed at its next device call with the same DXGI_ERROR_DEVICE_REMOVED, the culprit among them or not at all. In test builds only (`host::removal`): a failure report panics in the test that made it; the first test found holding a removed device is named on the process's standard error with the removal reason (and the device-removed data with VICTORY_D3D12_DRED); after it `host()` is None to every other test, which skips the host GPU as on a machine without one; and a panic after the removal notes it. Runtime builds are unchanged. The new test runs this binary in child processes in which a test removes the device (ID3D12Device5::RemoveDevice) by a submission, by a call, or unnoticed, and checks that exactly one test fails, with the reason, the others skip naming it, and the run ends as failed tests (101), not an abort. On main it aborts with 0xc0000409. Part of Marvisak#2317 (item 1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d384113 to
c3d2fcd
Compare
|
Rebased onto main 67e8ae1; AI use: Claude Code (Claude Opus 5.5). |
Triage asked for a maintainer decision on a test that spawns processes. It now carries #[ignore], as the repository's other tests that need something outside a plain run do, so 'cargo test' starts no process; '--ignored' runs it. The note to the test that first finds the device removed also says it may have been removed in a test running alongside it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Both triage points are addressed in
RTX 4060 Laptop: AI use: Claude Code (Claude Opus 5.5) made the change and ran the tests. |
…found it, later tests skip (Marvisak#2317 item 1)
…found it, later tests skip (Marvisak#2317 item 1)
Part of #2317 (item 1: one device removal takes the whole
victory-gputest run down with it). Items 2 and 3 are covered by #2315 / #2322 and are not touched here.Root cause
The
victory-gputests share one host device:host()keeps it in aOnceLock, and D3D12 hands a process the same device per adapter anyway. When a test removes it:Host::executesees the removal and callsfail(). In tests nothing seton_failure, sofail()callsstd::process::abort(). On Windows that is__fastfail, which shows up as0xc0000409(STATUS_STACK_BUFFER_OVERRUN). That is the "stack overrun" in the issue. The report goes throughtracing::error!, and tests have no subscriber, so it is lost. The binary dies mid-line (test x ...and nothing after it) without naming a test or a reason.0x887A0005. Each of those failures looks like its own bug, and the test that actually removed the device may not even fail.Design (test builds only; runtime builds are unchanged)
New
#[cfg(test)] mod host::removal, wired intohost.rswith#[cfg(test)]hooks only:fail()panics in the test that called it instead of aborting. Its message already hasdevice removed: <reason>plus the DRED data (removal_data) when it is on. On avictory-*worker thread, which tests do not join, it writes the report to stderr and aborts as before.fail(), inhost(), or in a panic. The harness writes one line to the real stderr (outside libtest's capture, so it still shows if the process ends early). WithVICTORY_D3D12_DRED=1(diagnostics builds) the line also carries the DRED/breadcrumb data:victory-gpu tests: `<test>` found the host device removed (0x887A0005 …); GPU tests after it skip the host GPUhost()returnsNoneto every other test. Tests already treat that as "no host GPU here" and return early, and runtime code called through the console's tables already handlesNone. Each skipping test writes one line:`<test>` skips the host GPU: the device was found removed in `<culprit>` (<reason>). The recorded test keeps its host, so it fails on its own calls.host()itself never panics, because it is reached fromextern "system"functions, which cannot unwind.the host device is removed (<reason>); this test was the first to find it so …. In any other test:the host device was found removed in `<culprit>` … this failure may only follow from that. This mainly helps tests already running in parallel when the removal happened.I did not recreate the device for later tests. Many statics hold objects made on the device: descriptor heaps, title-buffer copies, pipelines and root signatures, the bindless upload list. A new device would mix objects from two devices. A skip is honest and keeps the scope to tests.
Known limit: if
fail()is reached under anextern "system"frame (a test calling a console table function that submits), the panic cannot unwind past that frame and the process still aborts. The stderr line naming the test and the reason is written before that happens.Tests
host::removal::tests::a_test_that_removes_the_device_fails_aloneruns this test binary in child processes, because a removal in-process would remove the device for every test. In each child,child_1removes the device withID3D12Device5::RemoveDeviceand then either submits a list (submission), makes a device call (call), or does nothing more (unnoticed).child_2andchild_3are ordinary GPU tests that run after it.--test-threads=1keeps them in that order. The parent checks that:child_1, orchild_2in theunnoticedcase, since it is the first to find the removal), with the reason;The
child_*tests do nothing unlessVICTORY_TEST_REMOVES_DEVICEis set, so the normal run never removes the shared device. The assertions use only our own English strings, not the localized HRESULT text.Before (main
940d32f, same test):-1073740791(0xc0000409) aftertest …child_1_removes_the_device ..., no messagechild_1,child_2,child_3all FAILED with the sameHRESULT(0x887A0005)unwrapchild_1ok (the culprit passes),child_2andchild_3FAILED with the same unwrapThe parent test fails on main, on RTX and on WARP:
left: Some(-1073740791) right: Some(101).After: in every scenario exactly one test fails and names the reason, the later ones are
okwith the skip line, and the exit code is 101. The parent test passes.Results
RTX 4060 Laptop (driver 610.47), Windows 11 26200, Rust 1.98.1. WARP is
VICTORY_WARP=1 VICTORY_D3D12_WARP=1with--all-features, becauseVICTORY_D3D12_WARPneeds thediagnosticsfeature.940d32fcargo test --workspace --locked --no-fail-fast(RTX)--all-features(RTX)--all-features, WARPcargo clippy --workspace --all-targets [--all-features] -- -D warningscargo xtask policyOn both sides, the RTX failures are the known ones:
dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views(NVIDIA heap cap, #2315), plus the threevictory-shadertests fixed by #2322. The WARPvictory-shaderfailures (gathers_at_a_level_match_the_hardware,permutes_read_the_lane_named_and_zero_from_lanes_left_out) are identical on main. The new test also passes inside the full parallel run on both adapters. ARemoveDevicein the child process does not disturb the parent's device. WithVICTORY_D3D12_DRED=1the found-removed line carries the breadcrumb data.No game data was used: everything here is
cargo test.AI use: Claude Code (Claude Opus 5.5)
🤖 Generated with Claude Code