Skip to content

Tests: the stand-in race test keeps the let-go pipeline on its thread - #3474

Merged
Prime1997 merged 1 commit into
xcl-dev:mainfrom
Foniass:tests-standin-race-let-go
Nov 30, 2026
Merged

Prime1997 merged 1 commit into
xcl-dev:mainfrom
Foniass:tests-standin-race-let-go

Conversation

@Foniass

@Foniass Foniass commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline (from #2369, merged) fails on every run on main 53e85fb1: 15 of 15 runs, also run alone (left: (0, 1, 1), right: (0, 0, 1)). The test expects the winner's driver pipeline to be released with the last shell. On main the last shell lets it go through late_release::hold_pipeline, which holds it until the queues are past the lists that may bind it. So one reference is still there when the test checks. The runtime is right; the test is not.

The test now keeps what let_go is given on its thread (LET_GO, as set_private_data_validation_and_per_shell_set_name does), checks that it is the winner's pipeline, and releases it. Test-only: only the test changes.

What is in it

  • crates/xcl/src/hle/d3d12x/standin.rs: the test above

Tested

  • NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.2114), AMD Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), debug tests, release smoke
  • cargo test -p xcl --lib standin::tests: 7 passed, 0 failed, 5 runs in a row. Before the change, the test failed on 15 of 15 runs.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on 5454468: 2793 passed, 0 failed, 49 ignored. SKIPPED GPU tests: 45 distinct notices, almost all no wave64.
  • Retail title: 60 s smoke run below. The runtime does not change; the run is here for the check.

Regression run

main:

xcl-smoke v1
commit: 3b6a91ed096d6d6e0fee52cfb86dc0a7d7c8c1b0
gpu: NVIDIA GeForce RTX 5070 Ti
title: 3cb1d8e0
seconds: 60
exit: 0x0
frames shown: 1193 (PresentX 1193)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15684 MB

this PR:

xcl-smoke v1
commit: 54544682011e89267ed230e19c064b8ff589a3aa
gpu: NVIDIA GeForce RTX 5070 Ti
title: 3cb1d8e0
seconds: 60
exit: 0x0
frames shown: 1472 (PresentX 1472)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15598 MB

Not tested

  • Nothing beyond the test; the runtime does not change.

AI use

  • Claude Code with Claude Opus 5.5: found the failure on main, wrote the test change, ran the tests and the smoke runs, wrote this description.

🤖 Generated with Claude Code

concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline (xcl-dev#2369)
expected the winner's driver pipeline to be released with the last
shell. On main the last shell lets it go through late_release (it is
held until the queues are past the lists that may bind it), so the
test found one reference left and failed on every run. The test now
keeps what let_go is given on its thread, as the other stand-in tests
do, checks that it is the winner's pipeline, and releases it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Nov 29, 2026
@tiagonleal

Copy link
Copy Markdown
Contributor

merge-check
base: 53e85fb
head: 5454468
merge: clean
build: cargo build --workspace -> ok
tests: Tier 0 (test-only diff, +5/-0 in standin.rs inside mod tests), so the touched targets and not the whole suite: cargo test -p xcl --lib hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline -- --exact -> passed 10 of 10 on the merged tree; on the base alone it fails with left: (0, 1, 1), right: (0, 0, 1). cargo test -p xcl --lib hle::d3d12x::standin:: -- --test-threads=4 -> 7 passed, 0 failed, 0 ignored. cargo test -p xcl --lib hle::d3d12x::late_release:: -- --test-threads=4 -> 4 passed, 0 failed, 0 ignored. SKIPPED: none in these. Whole suite not run on this head.
review: whole diff read. The test arms LET_GO on its own thread before the shells are made, so the winner's pipeline that the last release lets go is caught there and never reaches late_release's HELD. It then checks that exactly the winner was let go, once, drops that reference and keeps the original (0, 0, 1) check, so it still proves the loser is released and nothing leaks. LET_GO is cleared at the end, as the test above it does. Both releases run on the test's thread, so the capture does not depend on timing. Nothing outside mod tests changes.
performance: none, test-only.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB (617.42), Ryzen 7 9800X3D, 32 GB, Windows 11 26300, rustc 1.100.0, debug / Claude Code (Claude Fable 5.2 ran the tests, read the diff and wrote this)

  • Tiago

@vasanex

vasanex commented Nov 29, 2026

Copy link
Copy Markdown
merge-check
base: 53e85fb124eae624641e9884517e4f3c4a7d8794
head: 54544682011e89267ed230e19c064b8ff589a3aa
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2793 passed, 0 failed, 49 ignored; SKIPPED: 28 lines (22 no wave64, 3 per-lane f16/f32 forms refused, 2 heap windows opt-in, 1 driver cache needs Developer Mode); failing: none. On the base alone the same command gave 2792 passed, 1 failed, 49 ignored here, the one failure being this PR's test (standin.rs:459, left (0, 1, 1), right (0, 0, 1)) in 4 of 4 whole-suite runs. With the PR: cargo test -p xcl --lib standin::tests -> 7 passed, 0 failed, 5 runs in a row.
review: none. Five lines inside one test in standin.rs, nothing outside mod tests. The test now takes what let_go is given on its thread (LET_GO, as set_private_data_validation_and_per_shell_set_name does), asserts it is the winner's pipeline and releases it, then clears the thread-local. The shells are released on the test's own thread, so the thread-local sees the call; the loser's pipeline is still asserted at 0 references before that, so the test keeps checking that the loser is released at once.
performance: none - test-only.
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3080 10 GB, driver 32.0.16.2140 (621.40), AMD Ryzen 9 7950X, Windows 11 26200, rustc 1.100.0, debug / Claude Code (Claude Fable 5.2)

Tier 0 (test-only diff): no retail run. A second card for @tiagonleal's check above; the failure on plain main reproduces here on every run, and is gone with this.

@Parakeet-Wheat

Parakeet-Wheat commented Nov 30, 2026 •

Copy link
Copy Markdown

merge-check
base: 9335bc0
head: 5454468
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2802 passed, 0 failed, 50 ignored; SKIPPED: 29 (22 no wave64, 3 wave32 per-lane form refused (#1426), 2 no heap windows, 1 driver cache needs Developer Mode, 1 no GPU_UPLOAD heaps); failing: none
review: Run alone, concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline fails in 5 of 5 runs on the base and 0 of 5 runs on the merge. Each base failure is the same assertion at standin.rs:459: left: (0, 1, 1), right: (0, 0, 1). The diff adds 5 lines to the test module of standin.rs and changes no runtime code. On the base, the last shell's drop calls let_go, and let_go gives the pipeline to late_release::hold_pipeline. That hold keeps one reference to the winner's pipeline, so the old assertion finds one reference left. The test now turns on the thread-local LET_GO capture, checks that let_go got only the winner's pipeline, and releases that pipeline itself. The test releases both shells on its own thread, so the capture sees the last drop. pipelines_of_one_key_share_a_driver_pipeline_while_one_of_them_lives and a_shell_has_the_drivers_interfaces_and_its_own_references_and_private_data use the same capture and reset. The description names set_private_data_validation_and_per_shell_set_name as the model, but that test does not use LET_GO. standin.rs and late_release.rs have no changes between 53e85fb1 and the base.
performance: No runtime change: the PR changes only a test. This check made no title run.
verdict: safe to merge (test-only; the stand-in race test now passes on our RTX 3070, where it fails on main)
hardware / tool and model: RTX 3070 8 GB (610.88), AMD Ryzen 5 5600X, Windows 11 Home 26300, Rust 1.95.0, debug / Claude Code, Claude Opus 5.5 (merge, build, suite, base and merge reruns, and review)

@github-actions github-actions Bot added needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU 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) needs:amd-test Needs a test report or merge-check on an AMD GPU labels Nov 30, 2026
@Prime1997
Prime1997 merged commit a41c75a into xcl-dev:main Nov 30, 2026
3 checks passed
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 gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) 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.

5 participants