Skip to content

Tests: fix four CI flakes that fail unrelated pull requests - #3743

Open
Kalmarv wants to merge 4 commits into
xcl-dev:mainfrom
Kalmarv:fix/warp-mixed-window-ci-flake
Open

Kalmarv wants to merge 4 commits into
xcl-dev:mainfrom
Kalmarv:fix/warp-mixed-window-ci-flake

Conversation

@Kalmarv

@Kalmarv Kalmarv commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Four flakes made Build and test (Windows, no GPU) fail on pull requests that did not touch the code involved: 30 of the 60 most recent failed CI runs (2026-12-02). One commit per flake. This takes over #3187 (its commit, unchanged) and does the same as the draft #1671 for kernelx. The fifth cross-branch flake of that survey, the list_x fake allocator, is left to #3472.

Fixes #3586 (the thread-dump crash; @fromthemoonx diagnosed the same cause there first).

What is in it

  • crates/xcl/tests/frame_clock.rs: token_on_timeout_and_token_in_origin_refresh (line 132) expected a 0 ms wait to time out. Its ancillary-block check created unified memory on first use, inside the wait. On a CI runner that took longer than a 60 Hz frame, so a frame ticked during the wait. ClockGuard::acquire now creates unified memory first. Jobs 143831052750, 143800498706, 143770726179, 143765485544, 143752311706, 143681858715, 143672906542; each has the UMA: … line just before the panic.
  • crates/xcl/src/eh.rs: the lib binary ended with 0xc0000005 inside thread_dumps_while_threads_run_and_exit, after 3–36 of its 40 dumps, while a D3D12 device test finished. dump_threads resumes a thread before it unwinds the copy of its stack, and that unwinding reads the unwind data and code of the frame's DLL, which could be unloaded by then. Each frame's DLL is now held with GetModuleHandleExW(FROM_ADDRESS) while it is unwound. The loader refuses that for a DLL it is already unloading, whose unwind data RtlLookupFunctionEntry still finds until it is unmapped, so the stack ends at such a frame. Addresses in the title's images and in XCL's generated thunks (stubs::alloc_code, whose chunks are never freed and are now listed for stubs::in_code_arena) are not the loader's and are unwound unpinned as before. New tests: thread_dumps_while_devices_come_and_go, and unwinding_goes_through_a_generated_thunk (a dump goes on through a thunk to its caller). Thread dumps are now taken one at a time (DUMP_LOCK): two at once could each suspend the other's dumping thread and neither went on. That is how an earlier push of this PR hung CI (job 143904819616: the new device test and thread_dumps_while_threads_run_and_exit under --test-threads=4). A dump asked for on the thread already dumping (the process ending there) returns at once. Test: two_threads_dump_at_once. The process-end hook never waits for that lock: ExitProcess holds the loader lock there, and a dump going on in another thread waits for the loader lock (GetModuleHandleExW), so each waited for the other (found by @vasanex). It dumps the other threads only when no dump is going on. Test: the_process_ends_while_another_thread_dumps. 14 jobs, e.g. 143199589350, 143759900214, 143838507638, 143202141589.
  • crates/xcl/src/hle/kernelx.rs: a_page_whose_move_fails_stays_mapped_where_it_was freed a 64 KiB reservation to get "an address with nothing reserved". Another thread's next first-fit VirtualAlloc could take it, the commit then succeeded, and the page was copied into that test's memory (assertion failed: move_away(…).is_err()). The destination is now the first 64 KiB above lpMaximumApplicationAddress, which nobody can reserve. Job 143772436418.
  • crates/xcl/src/hle/d3d12x/uma_driver.rs (the commit of Tests: the mixed-window remake tests run in a child process #3187): mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment failed (a GPU_UPLOAD segment became CUSTOM: Map gave … or CreateHeap refused), and the remake's stop ended the whole binary with exit code 0x7C10003. The remake runs inside the shared test binary, where what earlier tests leave behind (out-of-memory from CreateCommandQueue, seen with --test-threads=1 too, and E_OUTOFMEMORY lines in the CI logs) and other test threads' use of the address space get in its way. The two mixed-remake tests now run again in a child process of their own; the parent fails when the child fails or ran no test, and passes the child's SKIPPED lines on. Jobs 143828732230, 143718961344, 143562397058, 143175559324 (test failures) and 143794881256, 143742411497, 143252746541, 143175576386 (0x7C10003).

Tested

  • RTX 5070 Ti (NVIDIA 610.74), Ryzen 9 9950X, Windows 11 Pro 26200, rustc 1.99.0 MSVC, debug.
  • .\scripts\test.ps1 (cargo test --workspace -- --test-threads=4): 3010 passed, 0 failed, 52 ignored; SKIPPED 24 (22 no wave64, 2 no heap windows). The run before it on the same head failed the four title_textures tests together (a readback mismatch in placed_title_textures_share_vram_and_preserve_pixels, the other three on its poisoned lock); they also fail that way on main here, see Not tested
  • cargo build --release -p xcl: 39 warnings, the same ones as origin/main
  • Before/after, on the same machine:
    • frame_clock: token_on_timeout_and_token_in_origin_refresh alone, with 64 busy processes on 32 cores: 19/30 failed without the fix, 0/30 with it.
    • eh: thread_dumps_while_devices_come_and_go alone, one or four processes at a time: 6/30 crashed without the change (AV mid-dump), 7/30 with the module hold alone (cdb: AV in RtlLookupFunctionEntry on the .pdata of nvgpucomp64.dll as the driver unloaded it), 0/60 with the hold and the stop at an unloading DLL (measured before the thunk check below was added; it changes nothing for DLL frames). unwinding_goes_through_a_generated_thunk fails without the thunk check ("the unwinding ended at the thunk") and passes with it.
    • eh: two_threads_dump_at_once (two threads, 50 dumps each) under 64 busy processes: 1/15 runs hung without the lock (the test's 120 s check fired), 0/15 with it. The three dump tests run together under --test-threads=4: 5/5 passed in 8–12 s.
    • eh: the_process_ends_while_another_thread_dumps (a child process calls exit(3) while a second thread dumps in a loop): 20/20 hung with the hook waiting for the lock, 0/20 with it taking the lock only when free.
    • uma_driver (from Tests: the mixed-window remake tests run in a child process #3187): on base 54225f58, cargo test -p xcl --lib --no-fail-fast -- --test-threads=4 ended with exit code 0x7C10003 after 1,386 tests, at "coherent window could not be restored … after CreateCommandQueue: … (0x8007000E)"; with the commit, three runs of the same command had all 7 uma_driver tests ok.

Regression run
main:

xcl-smoke v1
commit: 078358a058f7ba5d16690dba8dc4e55d2c88ae0a
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1672 (PresentX 1672)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17291 MB

this PR's head:

xcl-smoke v1
commit: 86462821686cc7830f8da54c4a5baf9ad327d3cd
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1678 (PresentX 1678)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 16886 MB

Not tested

  • The smoke runs exit with 0 and set no XCL_THREAD_DUMP_AT, so they never take a thread dump: the eh.rs change is covered by its test only. They do not reach the changed test code either.
  • AMD; the GitHub runner itself (the fixes were checked against its logs; the runs were on this NVIDIA machine).
  • The kernelx collision and the mixed-window address-space interference did not happen in local runs of the old code; those fixes rest on the mechanism and the CI logs.
  • What exhausts memory in the lib binary for the mixed remake: not found.
  • Other failures seen in the survey that recur on one branch only are left alone: title_textures (several tests at once; it also failed once in the runs above, and once on main code here), DXGI device reset on feat/two-tier-texture-budget-l0, the amd-watch-* AVs.

AI use

  • Claude Code with Claude Opus 5.5: surveyed the CI logs, found the causes, wrote the fixes, the test and this description; the runs above were made by it on the hardware named.

🤖 Generated with Claude Code

`token_on_timeout_and_token_in_origin_refresh` drains the origin events and
expects a 0 ms wait with an ancillary block to time out. Checking the block
(`gpu::shader::readable`) makes unified memory on its first use, which on a
CI runner takes longer than a 60 Hz frame: when this test ran first in the
binary, a frame ticked inside the wait and it returned S_OK (frame_clock.rs
line 132, CI jobs 143831052750, 143800498706, 143770726179, 143765485544,
143752311706, 143681858715, 143672906542; each with the "UMA: ..." line just
before the panic). `ClockGuard::acquire` now makes it first.

With 64 busy processes on 32 cores the test alone failed 19 of 30 runs
without this and 0 of 30 with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added area:hle kernelx, XGameRuntime, XAudio2, VFS, PE loader, TLS, EH area:tests Unit, integration, e2e tests, or testtitle labels Dec 3, 2026
@Kalmarv Kalmarv changed the title Tests: fix two CI flakes (frame clock wait, thread dumps during DLL unload) Tests: fix four CI flakes that fail unrelated pull requests Dec 3, 2026
@vasanex

vasanex commented Dec 3, 2026 •

Copy link
Copy Markdown

merge-check
base: 078358a
head: ec9fba9
merge: clean (merge commit 4ec011d4, git diff --check clean; 5 files, +142/-3)
build: cargo build --workspace -> ok; cargo build --release -p xcl -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3008 passed, 0 failed, 52 ignored (base: 3006 passed, 0 failed, 52 ignored); SKIPPED: 25 on both, the same tests (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache); failing: none
review: no open finding; whole diff read.

  1. The runtime change is in thread dumps only (eh.rs unwind, and stubs.rs recording the code arena's chunks). I checked the previous head 3fb28e48 first and measured that its unwind ended at XCL's generated thunks (a scratch test, not part of any branch: on base 12 frames, 10 of them after a thunk made by stubs::alloc_code_with_unwind; on that head 2 frames). This head fixes it with stubs::in_code_arena: the same scratch test gives 12 frames, 10 after the thunk, as on base, and the PR's own unwinding_goes_through_a_generated_thunk passes.
  2. in_code_arena only tries its lock and answers false while the list is written, so a dump cannot wait on it; the list is written under the arena's mutex, which no dump takes. The pin takes the loader lock (GetModuleHandleExW) once per frame, after the thread was resumed, as the comment in dump_threads requires.
  3. The three test-only commits: frame_clock.rs only makes unified memory before the timing; the kernelx test's destination above lpMaximumApplicationAddress cannot be reserved by anyone; the uma_driver child reruns one test with --exact, fails when the child fails or ran nothing, and passes on its SKIPPED lines.
  4. Alone on the merge: the two eh tests (thread_dumps_while_devices_come_and_go, unwinding_goes_through_a_generated_thunk) passed 20 of 20 runs; on the previous head's merge the uma_driver tests passed 10 of 10 (not repeated on this one, that commit's diff is unchanged). I did not reproduce the "before" failures here: base passed the suite too.
    performance: none expected by default: the runtime change runs in thread dumps only. Smoke, 60 s, release, offline: base 1677 frames, 17992 MB peak commit; merge 1693 frames, 18194 MB; no device removal or crash on either.
    title run: RTX 3080, 60 s of the retail title on the merge's release build with XCL_THREAD_DUMP_AT=30,45, start screen only (not past the loading screen): 0 device removals, 0 crashes, 1701 frames (about 28 presents/s). Both dumps were written: 332 thread stacks, 326 of them end at one and the same address in ntdll (read as the thread's start; the log has no symbol names) and 6 are cut at the 14-frame limit; 293 of the 1461 frames are outside the loader's modules (title images and XCL's thunks) and the stacks go on through them.
    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 / Claude Code, Claude Fable 5.2 (ran the builds, tests and title runs, read the whole diff, wrote this check)

@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 gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Dec 3, 2026

@pvfreis pvfreis 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.

Read the eh.rs change at 3fb28e4. Two points, both from reading the code (nothing here was run):

  1. When GetModuleHandleExW fails, only addresses in title images keep unwinding, so the walk now also ends at XCL's generated thunks. They live in the stubs arena (private VirtualAlloc memory, stubs.rs:83), which image_base_for_addr does not know, and their unwind data is registered so that eh::unwind walks through them (stubs.rs:101). The XCL_TRACE_IMPORTS tracer (make_call_tracer, hle/d3d12x/guard.rs:172) calls the import from its own frame, so with it on, a dump of a thread waiting inside a traced import stops at the tracer and no longer shows the title's callers.

  2. This commit fixes the crash reported in #3586, where the same cause and a patch were posted before this PR was opened (#3586 (comment)). The description does not link it, so Fixes #3586 would close it on merge.

Review written with Claude Code (Claude Opus 5.5 read the diff, Claude Fable 5.2 checked both points); I checked each point.

@Kalmarv
Kalmarv force-pushed the fix/warp-mixed-window-ci-flake branch from 3fb28e4 to ec9fba9 Compare December 3, 2026 00:33
@Kalmarv

Kalmarv commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for checking, @pvfreis:

  1. Fixed in ec9fba994 (ce28e2999): stubs::alloc_code now records its never-freed arena chunks and exposes stubs::in_code_arena, eh::unwind allows modules::image_base_for_addr(rip).is_some() || stubs::in_code_arena(rip), and eh::tests::unwinding_goes_through_a_generated_thunk verifies unwinding through an alloc_code_with_unwind thunk to its caller (eh.rs and stubs.rs are the only RtlAddFunctionTable callers in crates/xcl/src).
  2. Added Fixes #3586 to the PR description so it closes on merge (credit to @fromthemoonx's earlier diagnosis there).

@pvfreis

pvfreis commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Both points are resolved at ec9fba994 (read, nothing run): unwind goes on through thunks in the stubs arena, and unwinding_goes_through_a_generated_thunk would end at the thunk on 3fb28e48. The description now closes #3586. Nothing open from my side.

Checked with Claude Code (Claude Opus 5.5 read the code, Claude Fable 5.2 rechecked); I checked each point.

@vasanex vasanex left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review of 164ff626 (the change since ec9fba99: the dump lock in eh.rs; code reading and the scratch test below, not a merge-check) · 1 finding

In short: serialising thread dumps fixes two dumps suspending each other, and two_threads_dump_at_once covers that. It also makes the process-end hook wait: hk_nt_terminate_process calls dump_threads for a non-zero status, and with the lock a process that ends while another thread is dumping no longer ends. Details inline. My merge check further up was for ec9fba99 and does not cover this head.

Measured (RTX 3080, Ryzen 9 7950X, debug, scratch test in eh.rs' test module, not pushed: a child process installs the crash handler, runs four busy threads and one thread that calls dump_threads in a loop, and calls std::process::exit(3) after 300 ms; the parent waits for it)

  • 164ff626: 20 of 20 children still running after 20 s (killed by the parent). With a 25 ms sleep between the dumps: 12 of 12 still running after 10 s.
  • ec9fba99: 0 of 20; every child ended with status 3.

Not checked: the whole suite and a title run on this head; the other commits of the PR, which are unchanged since ec9fba99.

Review by Claude Code (Claude Fable 5.2), posted without a human check of each point. An automated PR review workflow is running at the request of the user.

Comment thread crates/xcl/src/eh.rs Outdated
return;
}
// (declared in this order, the owner is cleared before the lock is let go)
let _serial = DUMP_LOCK.lock().unwrap_or_else(|e| e.into_inner());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Finding (medium, measured): a process that ends with a non-zero status while another thread is dumping does not end.

hk_nt_terminate_process runs on the thread that ends the process and, for a status other than 0, calls dump_threads, which now waits here for DUMP_LOCK. The scratch test in the review body shows the result: 20 of 20 child processes hang on this head, 0 of 20 on ec9fba99.

From reading, not confirmed with a debugger: the ending thread is inside ExitProcess and holds the loader lock when the hook runs; the thread that owns DUMP_LOCK needs the loader lock for the per-frame GetModuleHandleExW pin this PR added, so each waits for the other. (The run with a 25 ms pause between dumps rules out plain starvation of the waiting thread.) DUMP_OWNER only covers the same thread ending inside its own dump.

Where it matters: a dump is in flight (XCL_THREAD_DUMP_AT, or the dump another exit path started) at the moment the title aborts or exits with an error. Before this commit that process ended; now it stays until it is killed, and smoke.ps1 or a test harness waits on it.

Suggested: the process-end hook should not wait for the lock. try_lock there and skip the other threads' stacks when a dump is in flight (the log line with the status and the ending thread's own stack is already written before it), or give dump_threads a non-blocking variant for that one caller. A test like the scratch one (exit while a second thread dumps, in a child process with a time limit) would pin it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @vasanex, good catch, and the repro made it quick to confirm. Fixed in 86462821 (the eh.rs commit, now 94367b45):

  • The process-end hook calls dump_threads_inner(false): it takes DUMP_LOCK only with try_lock (a poisoned lock is taken over). When another thread is dumping, it logs that and leaves the other threads out; the ending thread's own line and stack are already written by then. dump_threads() (XCL_THREAD_DUMP_AT, tests) still waits for the lock. Those are the only two callers in the repo.
  • New regression test eh::tests::the_process_ends_while_another_thread_dumps, built from your scratch test: a child process installs the crash handler, runs four busy threads and one thread that calls dump_threads in a loop, then calls std::process::exit(3) once two dumps are done. The parent fails the test if the child is not gone with status 3 within 30 s. On an RTX 5070 Ti (debug): 20 of 20 runs hung with the hook waiting for the lock (as on 164ff626), 0 of 20 with this commit.
  • At this head: scripts/test.ps1 3010 passed, 0 failed, 52 ignored (the run before it failed only the four title_textures tests together, which also happens on main here), and the 60 s smoke is in the description.

Reply written with Claude Code (Claude Opus 5.5) from those runs.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fixed in 86462821: the process-end hook no longer waits for the dump lock. Measured here (RTX 3080, Ryzen 9 7950X, debug, this head): eh::tests::the_process_ends_while_another_thread_dumps passed 20 of 20 runs, and cargo test -p xcl --lib -- eh::tests: 18 passed, 0 failed. The whole suite and a title run on this head were not rerun here. (I cannot mark the thread resolved from this account.)

Follow-up by Claude Code (Claude Fable 5.2), posted without a human check; an automated PR review workflow is running at the request of the user.

Kalmarv and others added 3 commits December 2, 2026 22:01
`dump_threads` resumes each thread before unwinding the copy of its stack;
the unwinding still reads the function's unwind data and code in its DLL,
which can be unloaded meanwhile. CI's lib test binary ended with
0xc0000005 inside `thread_dumps_while_threads_run_and_exit` (after 3 to 36
of its 40 dumps; 14 of the last 60 failed runs) while a D3D12 device test
released its device, a thread in D3DSCache.dll in the last dumps written.

Each frame's DLL is now held with GetModuleHandleExW(FROM_ADDRESS) while
it is unwound and let go after. The loader refuses that for a DLL it is
already unloading, whose unwind data RtlLookupFunctionEntry still finds
until it is unmapped (caught under cdb: the AV was in
RtlLookupFunctionEntry, reading the .pdata of nvgpucomp64.dll as the
driver unloaded it): the stack ends at such a frame. Addresses in the
title's images and in XCL's generated thunks (`stubs::alloc_code`, whose
chunks are never freed and are now listed for `stubs::in_code_arena`)
are not the loader's and are unwound unpinned as before;
`unwinding_goes_through_a_generated_thunk` checks that a dump goes on
through a thunk to its caller (without the arena check it ended at the
thunk).

`thread_dumps_while_devices_come_and_go` dumps 200 times while another
thread makes and releases D3D12 devices (RTX 5070 Ti, driver 610.74):
without the change it crashed 6 of 30 runs mid-dump, with the hold alone
7 of 30, with this change 0 of 60.

Thread dumps are taken one at a time (`DUMP_LOCK`): two at once could each
suspend the other's dumping thread, and neither went on. On CI the new
device test and `thread_dumps_while_threads_run_and_exit` hung that way
under --test-threads=4 (job 143904819616, cancelled after 45 min). A dump
asked for on the thread that is dumping (the process ending there) returns
at once. `two_threads_dump_at_once` runs two dumpers of 50 dumps each:
without the lock 1 of 15 runs hung under 64 busy processes, with it 0 of
15.

The process-end hook never waits for that lock: ExitProcess holds the
loader lock there, and a dump going on in another thread waits for the
loader lock in the per-frame GetModuleHandleExW, so each waited for the
other (found in review). It takes the lock only when it is free and
otherwise leaves the other threads out, after its own line and stack are
logged. `the_process_ends_while_another_thread_dumps` ends a child process
with exit(3) while a second thread dumps in a loop: 20 of 20 runs hung
with the hook waiting, 0 of 20 with this commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`a_page_whose_move_fails_stays_mapped_where_it_was` reserved 64 KiB and
released it to have "an address with nothing reserved". The next
`VirtualAlloc(NULL, ...)` of any other test thread is placed first-fit, in
that freshly freed hole: the commit in `move_away` then succeeded, the
assertion failed (CI job 143772436418), and the page's 64 KiB were copied
into the other test's memory and its old address released.

The destination is now the first 64 KiB above `lpMaximumApplicationAddress`:
committing there fails and nobody can reserve it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`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>
@fromthemoonx

fromthemoonx commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

merge-check
base: 395405e
head: 8646282
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3016 passed, 0 failed, 56 ignored, the same in 3 runs of 3 (base: 3012 passed, 0 failed, 56 ignored; its first run ended in the #3586 crash after 8 dumps, the rerun gave these counts); SKIPPED: 25, the same as base (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none
review: read the whole diff (5 files, +235 -4). No open finding.

  1. The Tests: the lib test binary sometimes ends with 0xc0000005 during eh::tests::thread_dumps_while_threads_run_and_exit #3586 crash: thread_dumps_while_devices_come_and_go passed 22 of 22 runs. With only the DLL pin taken out it crashed in 8 of 24 (access violation).
  2. The process-end fix in this head: the_process_ends_while_another_thread_dumps passed 30 of 30. With the hook waiting for the lock again it failed 3 of 3. Without the in_code_arena check unwinding_goes_through_a_generated_thunk failed 5 of 5; with it, 30 of 30 pass. two_threads_dump_at_once: 30 of 30.
  3. The kernelx flake reproduces here when its tests run on their own (hle::kernelx::tests::, 60 runs per cell, base and merge alternating):
base merge
a_page_whose_move_fails_stays_mapped_where_it_was failed, 4 threads 5 0
the same, 8 threads 12 0
runs that failed for any reason, 4 threads 6 1
runs that failed for any reason, 8 threads 22 9

The failures left are other tests of that module (an_address_keeps_the_page_the_title_mapped_there_last, changed_gpu_view_pages_are_told_once_in_order, a_gpu_view_page_follows_its_physical_page, gpu_visible_fallback_memory_is_write_watched, a_page_leaving_plain_memory_has_the_tiles_over_it_linked_again) and, at 8 threads, a crash with no test named (4 on base, 2 on the merge). All but gpu_visible_fallback_memory_is_write_watched (1 run) also failed on base. I did not look for their cause; #1487 tracks these parallel failures; they are not for this PR.
4) The pin makes a dump call the loader, so I checked a dump taken while another thread holds the loader lock (LdrLockLoaderLock, scratch test): it ends in about 25 ms on base and on the merge. A thread stuck inside a DllMain is not tested.
5) The uma_driver tests passed 10 of 10 runs and frame_clock 20 of 20. I did not reproduce their old failures.
6) Not tested: a retail title (none on this machine), AMD.
performance: none expected: the runtime change runs only in thread dumps and when a process ends with an error. Reasoned, not measured.
verdict: safe to merge
hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)

@throny

throny commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Merge check: safe (head 8646282, merged onto main 16c2fd0)

Not tested: AMD/Intel cards.

AI use: Claude Code (Claude Opus 5.5) ran the checks and wrote this comment.

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:hle kernelx, XGameRuntime, XAudio2, VFS, PE loader, TLS, EH area:memory Virtual/physical memory, arenas, VRAM budget, UMA area:tests Unit, integration, e2e tests, or testtitle gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests: the lib test binary sometimes ends with 0xc0000005 during eh::tests::thread_dumps_while_threads_run_and_exit

5 participants