SIGN IN SIGN UP

PLUGINS/UCX: Build notification right after post for overlapping (#2024)

## What?
Micro-optimization that decreases Tx latency by building notification
message right after posting, while requests are in-flight, and therefore
benefit from overlapping.

## Why?
Before we were building notification (around 6 string allocations) after
payload completion, therefore consuming CPU cycles before we can send
the notification.

## How?
Serialize the notification once at post time and keep it in the handle
as unique_ptr.

#### Testing performance on 4KB x 1 nixlbench WRITE
I see stable **3.5% BW** and latency improvement on low dimensions.
```
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.935155       4.4            10.0           10.0           1.1            2.0            3.2            4.0
4096                1              0.968380       4.2            13.0           13.0           1.2            2.0            2.9            4.0
```

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

* **Bug Fixes**
* Improved reliability of UCX notification delivery by keeping message
data available until transmission completes.
* Enhanced asynchronous notification handling for safer endpoint usage
and more dependable cleanup.
* Improved consistency when sending notifications through communication
endpoints.

* **Performance**
* Reduced temporary memory reallocations when constructing serialized
messages.
* Streamlined notification preparation and transmission for more
efficient processing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
I
Ilia Yastrebov committed
79cc687f8815aa043cd25f56f096c1c64ab6f195
Parent: 54a015f
Committed by GitHub <noreply@github.com> on 8/11/2026, 11:47:19 AM