Repository navigation
test(cuda-host,finalizer): replace timed contention and release with handshakes - #1716
Merged
nihalpasham merged 1 commit intoNov 9, 2026
Conversation
…handshakes Two CPU tests stood a fixed 30 ms delay in for an ordering they could not observe. The ETXTBSY test released the fake ptxas's write descriptor from another thread after 30 ms. A late release past the ~510 ms retry budget failed it spuriously, and a first exec after the release passed it without exercising the retry. The retry delay now goes through `wait_before_busy_retry`, which a `#[cfg(test)]` thread-local closure can replace. The version probe runs on the caller's thread, so the test can release the descriptor from inside the first retry, proving through `PtxAssembler::from_path` that a real "Text file busy" was hit and ridden out. A second test keeps the descriptor open and asserts the probe still fails with ETXTBSY after exactly the eight doubling delays. The LTOIR cache single-flight test slept 30 ms in the build to encourage the other threads to contend. A thread arriving after publication took the fast path instead, so the test could not tell a working lock from a missing one. `acquire_key_lock` now records each arrival under `#[cfg(test)]`, and the build waits on a condvar until all eight threads have reached the lock, with a watchdog that fails with the count. Both were checked against broken implementations: no retry, nine retries, no re-check after the lock, and no lock all fail. Part of NVIDIA#1680. Signed-off-by: Vyncint Ng <[email protected]>
6 tasks
Collaborator
|
/ok to test 8af55a7 |
Collaborator
|
Thanks, replacing the 30ms sleeps with deterministic retry and lock-arrival hooks removes the timing races and verifies the 8-step At |
nihalpasham
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What This PR Does
Replaces fixed 30ms
thread::sleepdelays with deterministic synchronization in two concurrency/retry unit tests:ETXTBSYVersion-Probe Retry Test (cuda-artifact-finalizer)cuda-host)1. Deterministic Retry & Lock Contention Hooks
Previously, both tests slept for 30ms to approximate thread ordering, which could either fail spuriously on loaded runners or pass without exercising the retry/lock path:
PtxAssembler::from_pathobservesExecutableFileBusyat least once before succeeding.Verification
cargo test -p cuda-artifact-finalizer -p cuda-host --lib: PASScargo clippy -p cuda-artifact-finalizer -p cuda-host --all-targets -- -D warnings: PASScargo oxide fmt --check: PASSPart of #1680