Skip to content

gpu lib tests: the host-tier tests that park a stream run in the serial hw_held_ pass (gate-gpu-lib hang) - #505

Merged
midagedev merged 1 commit into
mainfrom
libhang
Oct 19, 2026
Merged

midagedev merged 1 commit into
mainfrom
libhang

Conversation

@midagedev

Copy link
Copy Markdown
Owner

gate-gpu-lib hung at its 900 s bound on main in most runs (b2-fixmap, warmres, lintchk, tixrace, q38img and others; 0 % GPU, threads in futex_wait).

Cause: two host-tier tests park the tier stream on a go wait and make driver calls (reset_remote, a capture) before they release it. Meanwhile a device-wide sync in a parallel test (any cuMemFree, or a fresh handle's first-stream cuCtxSynchronize) holds the driver's lock while it waits for that stream. The parker's next call queues behind it, and neither returns. This is the same class as checkpoint::hold::Hold, whose tests already run in the hw_held_ serial pass.

Fix: the two tests are named hw_held_… and get their work through parking_work, which refuses by name outside RUST_TEST_THREADS=1. The rule has one owner, checkpoint::hold::require_serial_pass, which Hold::on uses too. Test bodies are unchanged.

Production: sync and free run only on the serve engine thread's load and teardown, and the release path makes no driver call before the release (tier.rs release_opened before drain). The bound is stated in capsync.rs's module doc.

Evidence (box, 3090):

  • Loop of gate-gpu-lib's lib binary: base 6 hangs of 10, fixed 0 hangs of 30.
  • FAIL-first for the refusal: without RUST_TEST_THREADS rc 101 with the named message; serial rc 0.
  • just gate-gpu-lib 3× rc 0.
  • remote-static: lint is main's.

🤖 Generated with Claude Code

…driver before it releases runs alone (hw_held_)

A device-wide sync in a parallel test (cuMemFree, a fresh handle's cuCtxSynchronize) holds the driver's lock while it
waits for the parked stream; the parker's next driver call queues behind it, and gate-gpu-lib hung at its bound.
hold::require_serial_pass owns the rule for Hold::on and the tier tests' parking_work.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@midagedev midagedev added gpu The card engine: crates/gpu*, crates/app tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo needs-gpu Changes code a card must check, and carries no gate run on a card labels Oct 19, 2026
@midagedev
midagedev enabled auto-merge (rebase) October 19, 2026 16:59

@github-actions github-actions Bot 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.

Verdict: CLEAN: Both parked-stream tests enter the existing serial pass and share its refusal check without changing their assertions.

Checked

Duplicates: 4 added or renamed functions checked; no duplicate owner found. Dryer reported 0 pairs.
Complexity: Crapper flagged no changed functions.
Silent failure: 1 environment-result site followed; missing or invalid thread-count configuration causes a named panic before parking.
Tests: Static checks confirmed both renamed tests remain selected exactly once, with their original assertions and cleanup. Removing the release at tier.rs:1391 makes the reset test's success assertion fail after its bounded drain. Dropping either column update at tier.rs:1413 or tier.rs:1455 fails the column assertion. These mutation results are from code inspection.
Gates: No bands or pins moved; both tests remain ignored hardware gates.
Adversarial checks: The serial pass excludes concurrent libtests; the other remote-work caller enqueues no parked stream; both constructors check the configuration before parking.
Performance: No production hot-path code changed.
Escape catalog: No patterns matched.

Notes

CUDA tests were not run during this review. The reported GPU runs lack the nvidia-smi line, exact commit hashes and command output required for verified GPU evidence; gpu.json records false.

Card check: needs-gpu. This pull request changes crates/gpu/src/capsync.rs, crates/gpu/src/checkpoint.rs, crates/gpu/src/host/tier.rs and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@midagedev
midagedev merged commit 5eed582 into main Oct 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant