SIGN IN SIGN UP

PLUGINS/UCX: Single UCX connection per handle (#2040)

## What?
Keep just a single connection pointer per handle, not set of them
- Simplify the code and reasoning about handle connection
- Improve performance (no set nodes allocation on heap)
- Improve debuggability

## Why?
A transfer handle targets exactly one remote agent, since
createXferReq/prepXferReq take a single remote_agent and resolve the
remote descriptors only against that agent's section. The engine keeps
at most one connection per agent in remoteConnMap, and each
nixlUcxPublicMetadata::conn is a const shared_ptr copied from that
entry, so one agent means one nixlUcxConnection. The handle is also
pinned to one worker, and a connection owns one endpoint per worker, so
the whole descriptor list resolves to a single nixlUcxEp.

## Testing
BW and post latency improves by 1% on low dimensions
```
UCX_TLS=^cuda_ipc nixlbench --initiator_seg_type=VRAM --target_seg_type=VRAM --start_block_size=4096 --max_block_size=4096 --num_iter=100000

Block Size (B)      Batch Size     B/W (GB/Sec)   Avg Lat. (us)  Avg Prep (us)  P99 Prep (us)  Avg Post (us)  P99 Post (us)  Avg Tx (us)    P99 Tx (us)
----------------------------------------------------------------------------------------------------------------------------------------------------------------
4096                1              0.943396       4.3            12.0           12.0           1.1           2.0            3.2            4.0
4096                1              0.952939       4.3            12.0           12.0           1.0           2.0            3.2            4.0
```
This also improves sglang performance by 1-2%

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved UCX connection handling to prevent conflicting connection
assignments.
* Increased transfer reliability by consistently using and validating a
single endpoint for grouped requests.
  * Improved request cleanup and completion tracking after transfers.
* Improved error handling by releasing pending transfer requests when
operations fail.
* Simplified transfer processing to improve consistency and reliability
during range-based transfers.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
I
Ilia Yastrebov committed
e72eb50bee00ae020b70656d961b1059fcffdffc
Parent: 45e87d7
Committed by GitHub <noreply@github.com> on 8/5/2026, 11:20:10 AM