Skip to content

Tests: the mixed-window remake tests run in a child process - #3187

Open
Kalmarv wants to merge 1 commit into
xcl-dev:mainfrom
Kalmarv:opus/uma-test-stop
Open

Kalmarv wants to merge 1 commit into
xcl-dev:mainfrom
Kalmarv:opus/uma-test-stop

Conversation

@Kalmarv

@Kalmarv Kalmarv commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

On nvidia-dev the xcl lib test binary is ended by a mixed-window test on NVIDIA (exit code 0x7C10003), reported by throny on #3041 (#3041 (comment)) and worked around with --skip in #3116, #3169 and #3176. These tests came with our #3005-#3007.

Cause: a_refused_gpu_upload_segment_becomes_custom and mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment remake a window inside the shared test binary. After the lib's earlier tests, the remake's CreateCommandQueue returns E_OUTOFMEMORY, here as on throny's RTX 4080. It does so with --test-threads=1 too, so the cause is something earlier tests leave in the process, not tests running beside it. I have not found what. standby saw command queues made from the shared device kept for the process once it is adopted, which fits but is not verified. The queue is made after a segment was mapped, so the remake cannot restore the window and stops the process. That is the fail-stop doing its job in a title, but in the test binary it ended every test after it. First I made the stop panic in tests instead. That was not enough: the binary then died later with an access violation, because the failed remake had left the window with the driver. So the fix isolates the tests instead.

What is in it

  • crates/xcl/src/hle/d3d12x/uma_driver.rs (test module only): ran_in_child. Each of the two remake tests now runs again on its own in a child process, as failed_restore_stops_before_importing_an_unbacked_window already does. The parent fails when the child fails (or when the child ran no test) and passes the child's SKIPPED lines on. No runtime code changes, so I ask for the test-only label instead of a smoke pair.

Tested

  • RTX 5070 Ti, driver 610.74, Windows 10.0.26200, Rust 1.99.0, debug, no XCL_* variable set.
  • Base 54225f58, cargo test -p xcl --lib --no-fail-fast -- --test-threads=4: the binary ended with exit code 0x7C10003 after 1,386 ok, at "coherent window could not be restored … after CreateCommandQueue: … (0x8007000E)".
  • This head, the same command, no --skip, three runs: 1770 / 8 / 28, 1770 / 8 / 28 and 1774 / 4 / 28 (passed / failed / ignored). All 7 uma_driver tests ok every time. In the third run the four title_textures tests passed: their out-of-memory failures come and go between runs.
    • The 8 failures also fail on the base: link_tests::{gpu_linked_memory_accessors, linked_programs_keep_their_declarations} (DXC: "attribute WaveSize only valid on entry point function"), the four title_textures tests throny listed, and vram::tests::{d32s8_targets_take_their_own_size_of_video_memory, gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark}. The two vram tests fail on the head with E_OUTOFMEMORY, and also in a run with the two mixed tests skipped; on the base the binary ended before reaching them.
  • cargo test -p xcl --lib uma_driver: 7 passed, 0 failed.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4, this head, no --skip: 40 test binaries, 1902 passed, 8 failed (the 8 lib tests above), 48 ignored. 150 SKIPPED lines: 123 "validator 1.7 < 1.8 (validation step only)", 21 "no wave64", 3 per-lane forms refused for gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426, and two_pass_binds_set_the_shared_view_heap and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).

Not tested

  • AMD, and other NVIDIA cards and drivers (throny's 4080 / 621.40, KDenKC's 3090 / 5090).
  • What exhausts memory in the lib binary (the remake's CreateCommandQueue; the title_textures and vram tests above): not found.
  • The whole-workspace counts are from the first push (3d83639). This head differs only in a comment.
  • No title run: the diff is test code only.

AI use

  • Claude Code (Claude Opus 5.5): found the cause, wrote the change, ran the tests on the hardware above and wrote this description.

🤖 Generated with Claude Code

@throny

throny commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

merge-check claim
head: 3d83639

On the card that reported it (RTX 4080, 621.40): the whole suite on nvidia-dev + this PR without the three --skips, after the suite that is running now.

@andrewDoing

Copy link
Copy Markdown
Contributor

The child isolation behaved as intended in a Windows libtest harness with the exact ran_in_child from 3d836390: normal completion passed, a permitted skip surfaced its SKIPPED line, and both a child assertion and an exact filter matching zero tests failed the parent.

One diagnostic is lost for the failure that motivated the PR. I made the synthetic child exit with 0x07C10003 without a panic. Direct invocation returned 130088963; under the wrapper the parent correctly failed with libtest exit 101, but its report contained only the child's partial transcript and no child exit code. A different native termination with the same partial output would look identical. Including output.status in the failed assertion preserved 130088963 in my retest while keeping the parent exit 101. Printing the Windows code in hex as well would make comparison with #3041 easier.

These are CPU-only process-runner controls. I did not induce a driver failure or run the hardware fixture. AI use: OpenAI Codex built and ran the controls and prepared this report.

@throny

throny commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

merge-check
base: 54225f5 (nvidia-dev)
head: 3d83639
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (no --skip) on nvidia-dev 54225f5 + this PR -> 1904 passed, 6 failed, 48 ignored, 27 SKIPPED lines; every test binary ran to its end. Without this PR the lib test binary is terminated on this card (exit 0x7C10003), and with the three uma_driver tests skipped the same base gives 1901 passed, 6 failed, 48 ignored: so the three tests now run and pass (a_refused_gpu_upload_segment_becomes_custom, mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment, failed_restore_stops_before_importing_an_unbacked_window, all ok) and nothing else changed. The 6 failures are the ones this base has here without the PR: placed_title_textures_share_vram_and_preserve_pixels, three stream_recheck_* tests, and two vram::tests (d32s8_targets_take_their_own_size_of_video_memory, gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark).
review: read in full by me (31 lines, test code only). The helper runs the named test again alone in a child process with a marker variable, passes the child's SKIPPED lines on, and fails with the child's output when the child fails or does not report one passed test; in the child it returns false and the body runs. The lock that keeps the two tests apart is still taken first, so the two children do not run at the same time. Two notes, neither blocking: on a machine where the child skips (no D3D12 device), the parent still needs "1 passed" from it, which holds because a skipping test passes; and a failure inside the child shows up as the parent's assert with the transcript, so the first line of a failure report is the helper's, not the test's.
performance: none (test code only; no translator source).
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

Kalmarv added a commit to Kalmarv/xcl that referenced this pull request Nov 28, 2026
- Recompiler: the thread-limit prologue keeps nvidia-dev's exact form without a remap and
  divides the console group by the remap ratio with one (xcl_cg); its tests follow the kept forms.
  The LDS-clamp test uses a thread-dependent address, since main's min/max folding turned its
  constant address into a constant clamp.
- bind: the native-snapshot test sets a graphics root signature (nvidia-dev skips a PC-pipeline
  indirect draw without one).
- pso_async: the earlier-run test takes nvidia-dev's assert, because a pipeline no earlier run
  used is now built ahead by the backlog.
- sparse: the copy-back lock test waits for the submitting token instead of a queue_fences
  entry the merge no longer makes.
- shaders: nvidia-dev's file-based WorkerClaim and its test go; main's OS-backed Claim does
  the job.

cargo test -p xcl --lib -- --test-threads=4 (RTX 5070 Ti, two uma_driver remake tests skipped,
xcl-dev#3187): 2444 passed, 2 failed (link_tests DXC WaveSize, as on stock nvidia-dev), 29 ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thehollowedone

thehollowedone commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

merge-check
base: 54225f5 (nvidia-dev)
head: d338db7
merge: clean (head descends from the current base)
build: cargo build --offline --locked -j 4 --workspace -> ok; git diff --check -> ok
tests: cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 -> 1,910 passed, 0 failed, 48 ignored, 40 targets, 26 explicit SKIPPED notices. XCL_DXIL_CACHE pointed to a writable local cache. All three mixed-window tests, including the two now isolated in child processes, passed. Without that cache setting, the library binary still finished normally at 1,777 passed, 1 failed, 28 ignored; the sole failure was console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk (DXIL not compiled yet). That test passed 1/0/0 when rerun with the writable cache. The default-cache failure is not a passing full-suite result.
review: I read the complete 31-line test-only diff. Each remake test retains its serialization lock, runs its named body in a separate child, propagates skip notices, and fails the parent if the child fails or matches no passing test. The child does not recursively spawn. The missing child exit code in a failure message, reported separately, would improve diagnosis but does not change the pass/fail behavior.
performance: no runtime path changes; child process startup affects only these two tests.
verdict: safe to merge
hardware / tool and model: Windows 11 build 26300, RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, rustc 1.99.1 MSVC; Codex (GPT-6.2 Sol) read the diff and ran the build and tests. I did not run a title or AMD/Intel hardware.

@Kalmarv
Kalmarv changed the base branch from nvidia-dev to main November 28, 2026 19:50
@throny

throny commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

merge-check claim
head: d338db7

Re-check of the head rebased onto main.

@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:memory Virtual/physical memory, arenas, VRAM budget, UMA labels Nov 29, 2026
@github-actions github-actions Bot added gpu:nvidia Code is specific to NVIDIA / wave32 GPUs (scope tag; see needs:nvidia-test) needs-pr-check Failing the PR description check (CONTRIBUTING.md) labels Nov 29, 2026
@throny

throny commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

merge-check
base: fa20459
head: d338db7
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2608 passed, 0 failed, 49 ignored (27 SKIPPED lines). Base alone at fa20459: 2608 passed, 0 failed, 49 ignored. Every test binary ran to its end; the three uma_driver tests are ok. Without this PR, 2 of 10 whole-suite runs on main last night had no lib counts because the lib test binary was ended.
review: re-check of the head rebased onto main. Compared with the head I checked, only the helper's doc comment changed (it now says the failure can also happen with one test thread); the code is the same.
performance: none (test code only).
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

@Foniass

Foniass commented Nov 29, 2026

Copy link
Copy Markdown
Contributor
merge-check
base: d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0
head: d338db7a8e24aeb0f42c4c96d98bacd651550f29
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2614 passed, 4 failed, 49 ignored; SKIPPED: 44; failing: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (driver E_OUTOFMEMORY, same on base on this machine)
review: test-only. It moves the mixed-window remake tests into a child process, which fixes the flaky UMA exit 0x7C10003 seen tonight. It needs the test-only label.
performance: none (tests only)
verdict: safe to merge (with the test-only label)
hardware / tool and model: RTX 5070 Ti (driver 32.0.16.2114), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

Merge-check run and written with Claude Code (Claude Opus 5.5): a test merge onto the base above and the full suite on this machine. The 4 fuzz_validate_and_gpu_* failures happen on main on this machine too.

`a_refused_gpu_upload_segment_becomes_custom` and
`mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment` remade a
window inside the lib test binary. After the lib's earlier tests the
remake's CreateCommandQueue returns E_OUTOFMEMORY (here and on throny's
RTX 4080), also with --test-threads=1, so it is something earlier tests
leave in the process, not the tests running beside it. The queue is made
after a segment was mapped, so the remake cannot restore the window and
stops the process with 0x7C10003. That ended the lib test binary after
~1,390 tests on NVIDIA (reported on xcl-dev#3041). Making the stop panic in
tests instead is not enough: the binary then died later with an access
violation, after the failed remake left the window to the driver.

Each of the two tests now runs again on its own in a child process, as
`failed_restore_stops_before_importing_an_unbacked_window` already
does; the parent fails when the child does and passes the child's
SKIPPED lines on.

A failing child's exit code (decimal and hex) heads the parent's failure message: a stop without a panic, such as 0x7C10003, leaves only a partial transcript.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the needs-pr-check Failing the PR description check (CONTRIBUTING.md) label Nov 30, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Re-review (head cd13b17, diff read, not a merge-check: PR description fails without the test-only label, so not run again here). Follow-up to my merge-check of d338db7.

  • Since d338db7 only uma_driver.rs ~717-720 changed: a comment, plus the child's exit code (decimal and hex) in both assert messages. When the tests pass and fail is unchanged, so my earlier verdict stands: safe to merge once a maintainer applies the test-only label (every hunk is inside #[cfg(test)]). Without it the required check keeps failing (no smoke pair).
  • The description's "This head differs only in a comment" isn't exact: the two assert messages changed too, and the workspace counts are from 3d83639.
  • This isolates the tests rather than fixing the cause: something left in the lib test binary still exhausts memory (the description says the vram tests still fail with E_OUTOFMEMORY).

Fine: the lock is taken before the child starts, so the two children never run together, and the child doesn't start another. SKIPPED lines are passed on through raw stderr, a child failure or crash fails the parent with the transcript and exit code, and a renamed test (zero matches) fails the "1 passed" check. It merges cleanly onto main d0832e6.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Test report (not a merge-check: PR description red)
base: b2b1f10
head: cd13b17
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2902 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: not repeated here; my review of this same head is at #3187 (comment), and its findings stand. This run adds what reading couldn't: whether the change merges, builds and passes the whole suite on current main.
performance: no smoke run.
assessment: merges, builds and passes the whole suite on current main (0 failed); the findings in my review stand
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:memory Virtual/physical memory, arenas, VRAM budget, UMA gpu:nvidia Code is specific to NVIDIA / wave32 GPUs (scope tag; see needs:nvidia-test)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants