Skip to content

UCT/MLX5: Preserve SGL batch completions during purge - #12423

Open
gleon99 wants to merge 6 commits into
openucx:masterfrom
gleon99:sgl-ft/split-uct
Open

gleon99 wants to merge 6 commits into
openucx:masterfrom
gleon99:sgl-ft/split-uct

Conversation

@gleon99

@gleon99 gleon99 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

What?

Handle native SGL PUT/GET batches in mlx5 outstanding purge.

Why?

Recovery must identify undelivered elements without completing or
releasing their shared batch prematurely. This provides the UCT
prerequisite for UCP SGL PUT recovery in a follow-up PR.

How?

Report outstanding elements through the existing purge callback,
transfer a completion reference per reported element, and retain
the original batch reference until the final WQE is processed.

Reuse the existing peer-failure fixture and descriptor validators.
Cover partial delivery, zero-length PUT entries, missing RX tokens,
and deferred, inline, canceled and absent completions.

Validation: standalone CUDA-enabled build; 123 tests passed with
zero skips. The regression fails with the master purge implementation
and passes with this fix.

@gleon99
gleon99 requested a review from a team as a code owner November 23, 2026 10:17
@gleon99 gleon99 added the WIP-DNM Work in progress / Do not review label Nov 23, 2026
@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX release DRP · commit 4dbc460f

TL;DR: The "Check build condition" step of the CheckRelease job died with exit 128 because check_release_build() ran git rev-parse "<sha>^2" on a commit that has only one parent (the checked-out source version is the PR head commit, not a GitHub merge commit), and under set -eE that aborts the whole pipeline. Fix is to make the PullRequest branch tolerate a missing second parent (git rev-parse -q --verify "<sha>^2" with a fallback) instead of assuming a two-parent merge commit.

Full analysis

Summary: Azure build 147032 (UCX release DRP, stage Prepare / job CheckRelease) failed in the Bash step "Check build condition" with fatal: ambiguous argument '4dbc460f1ac2e934ece32a7a778f520a0693d599^2': unknown revision or path not in the working tree → ##[error]Bash exited with code '128'.

Root cause: Infrastructure/script bug, unrelated to the PR's UCT/MLX5 code. The log shows the checkout of refs/pull/12423/merge actually landed on HEAD is now at 4dbc460f1 UCT/MLX5: Preserve SGL batch completions during purge — i.e. the PR head commit, which has a single parent (git rev-parse ^1 resolved fine to [REDACTED:Hex High Entropy String], ^2 does not exist). check_release_build() unconditionally assumes Build.SourceVersion is a GitHub-generated two-parent merge commit:

base_revision=$(git rev-parse "${build_sourceversion}^1")
head_revision=$(git rev-parse "${build_sourceversion}^2")

Because the step runs set -eE (and az-helpers.sh itself is #!/bin/bash -eE), the failing rev-parse terminates the step with git's exit code 128. Per the comment in the YAML ("Runs first: a failure here leaves Launch unset, so nothing is built"), this also leaves CheckRelease.Result.Launch unset, so the whole release pipeline reports failure. There is no hang involved — the entire job spans ~11 s (10:18:44 → 10:18:55) with no timestamp gaps.

Implicated commit: The failing code path lives in check_release_build(); most recent related changes are [REDACTED:Hex High Entropy String] "AZP/RELEASE: Enable on-demand DRP testing" and 3757306e / fbbf7a74 / c33d77d3 (Alexey Rivkin) touching buildlib/az-helpers.sh and buildlib/azure-pipelines-release.yml. The ^1/^2 assumption itself predates these; exact introducing sha not confirmed.

File: buildlib/az-helpers.sh:276-277 (invoked from buildlib/azure-pipelines-release.yml:106-112)

Suggested fix: Make the PullRequest branch resilient to a single-parent source version, e.g.:

elif [ "${build_reason}" == "PullRequest" ]
then
    if head_revision=$(git rev-parse -q --verify "${build_sourceversion}^2"); then
        base_revision=$(git rev-parse "${build_sourceversion}^1")
    else
        # Not a merge commit (ADO gave us the PR head): diff against the target branch
        head_revision=$(git rev-parse "${build_sourceversion}")
        base_revision=$(git merge-base "origin/${SYSTEM_PULLREQUEST_TARGETBRANCH#refs/heads/}" \
                        "${head_revision}" 2>/dev/null || git rev-parse "${head_revision}^1")
    fi
    for sha1 in $(git log --first-parent --no-merges \
                     "${base_revision}..${head_revision}" --format="%h"); do
        ...
    done
fi

Also consider defensively emitting Launch=False (the printf '##%s[task.setvariable ...]' line) even on error — e.g. wrap the git logic in a function with || launch=False — so an unexpected git state degrades to "don't release" rather than failing the pipeline. Note fetchDepth: 100 could also leave the base commit outside the shallow history for long-running branches, which the merge-base fallback should guard against (use fetchDepth: 0 or git fetch --deepen if that recurs).

Related: #10020 (AZP/RELEASE: Scheduled DRP testing — added the DRP trigger paths in this function); PR under test: #12423

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id 36ce7aa7-7862-4297-a2e5-3c5355a97aeb in the triage console for the audit trail.

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX snapshot · commit 4dbc460f

TL;DR: The snapshot pipeline's "Check build condition" step died with exit 128 because check_release_build() does git rev-parse "<Build.SourceVersion>^2" and this PR build's Build.SourceVersion (4dbc460f) is the PR head commit (single parent), not the two-parent merge commit the code assumes. Make the ^2 lookup optional and fall back to git merge-base against the PR target branch (and never let this git call abort the step).

Full analysis

Summary: Job "UCX snapshot" failed in the Prepare/Check stage — ##[error]Bash exited with code '128' in the Result (Check build condition) Bash task, before any build/test ran.

Root cause: The log shows the step executing:

+ check_release_build PullRequest [REDACTED:Hex High Entropy String] 'AZP/SNAPSHOT: '
+ base_revision=[REDACTED:Hex High Entropy String]           # ^1 resolved fine
++ git rev-parse '4dbc460f...^2'
fatal: ambiguous argument '[REDACTED:Hex High Entropy String]^2': unknown revision or path not in the working tree.

check_release_build() assumes Build.SourceVersion for a PullRequest build is the GitHub merge commit, so it derives the PR commit range as <sha>^1..<sha>^2. In this build Azure passed the PR head commit instead (the checkout log confirms the merge commit is a different sha: HEAD is now at 5a5cb6c07 Merge 4dbc460f... into 65cd5425). 4dbc460f has only one parent, so rev-parse ...^2 exits 128; since the step runs under set -eE, the failing command substitution aborts the whole task. This is pure CI-infrastructure breakage — it is unrelated to the sgl-ft/split-uct code changes, and it will also leave the Launch output variable unset, silently skipping all downstream stages.

Implicated commit: cfd9cd1f — "BUILD/CI: Limit PR commit range checks (#11527)", Yossi Itigin (introduced the ^1/^2 range derivation; c33d77d3 / fbbf7a74 by Alexey Rivkin later reworked the same function).

File: buildlib/az-helpers.sh:276-277 (invoked from buildlib/azure-pipelines-release.yml:110 and the equivalent line in the snapshot pipeline, passing $(Build.Reason) $(Build.SourceVersion))

Suggested fix: Handle both merge-commit and head-commit forms of Build.SourceVersion, and fail soft:

elif [ "${build_reason}" == "PullRequest" ]
then
    # Build.SourceVersion may be the PR merge commit or the PR head commit
    if head_revision=$(git rev-parse -q --verify "${build_sourceversion}^2"); then
        base_revision=$(git rev-parse "${build_sourceversion}^1")
    else
        head_revision=$(git rev-parse "${build_sourceversion}")
        target="${SYSTEM_PULLREQUEST_TARGETBRANCH#refs/heads/}"
        base_revision=$(git merge-base "origin/${target:-master}" "${head_revision}") || \
            base_revision="${head_revision}~1"
    fi
    for sha1 in $(git log --first-parent --no-merges \
                     "${base_revision}..${head_revision}" --format="%h"); do
        ...

Alternatively, since the workspace already has the merge commit checked out, pass HEAD (or $(System.PullRequest.SourceCommitId) with a merge-base) instead of $(Build.SourceVersion). Also wrap the whole PR branch so a git failure sets launch=False and still emits the Launch variable rather than aborting the stage, and note the fetchDepth: 100 shallow fetch can make merge-base fail on long-lived branches — guard for that too.

Related: #11527 (introduced the ^1..^2 range), #12246 (prior fix to the same Launch / Check-stage logic)

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id d4a4dfe9-0d88-4589-b5d0-89ed199fba61 in the triage console for the audit trail.

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX release · commit 4dbc460f

TL;DR: The "Check build condition" step of the UCX release pipeline died with exit 128 because check_release_build() runs git rev-parse "<Build.SourceVersion>^2" on a commit that has only one parent (the PR head, not a GitHub merge commit), and set -eE turns that git error into a job failure; make the ^2 lookup tolerant (git rev-parse --verify -q ... || fallback).

Full analysis

Summary: Stage Prepare / job CheckRelease / step "Check build condition" failed: fatal: ambiguous argument '4dbc460f1ac2e934ece32a7a778f520a0693d599^2': unknown revision or path not in the working tree → ##[error]Bash exited with code '128'.

Root cause: This is a pipeline-infrastructure bug, not a product/test failure. check_release_build() assumes that for Build.Reason == PullRequest the checked-out Build.SourceVersion is always GitHub's two-parent merge commit (refs/pull/N/merge), so it unconditionally resolves both ^1 (PR base) and ^2 (PR head). In this build the checkout log shows HEAD is now at 4dbc460f1 UCT/MLX5: Preserve SGL batch completions during purge — a normal single-parent commit (the PR head itself; the build was poll-triggered, so no merge ref sha was used). ^1 resolved fine (base_revision=[REDACTED:Hex High Entropy String]…), ^2 did not exist, git exited 128, and because the step runs set -eE (and az-helpers.sh is #!/bin/bash -eE) the command substitution failure aborted the whole step. Side effect: the Launch output variable is never set, so the GitHubDraft and Build stages are skipped — exactly the failure mode the in-file comment at buildlib/azure-pipelines-release.yml:97 warns about.

Secondary latent bug in the same function: the loop body [[ "$title" == "${title_mask}"* ]] && launch=True; returns non-zero when the last inspected commit doesn't match the mask, which under set -e can also kill the step.

Implicated commit: cfd9cd1f "BUILD/CI: Limit PR commit range checks (#11527)" (Yossi Itigin) introduced the ^1/^2 commit-range logic; the hard-failure behaviour was reinforced by c33d77d3 / fbbf7a74 (Alexey Rivkin). The product commit under test (4dbc460f1) is not at fault.

File: buildlib/az-helpers.sh:276-283 (invoked from buildlib/azure-pipelines-release.yml:106-112)

Suggested fix: Make the PR branch of check_release_build() robust to a non-merge Build.SourceVersion:

elif [ "${build_reason}" == "PullRequest" ]
then
    base_revision=$(git rev-parse "${build_sourceversion}^1")
    # Poll-triggered / non-merge-ref builds check out the PR head itself,
    # which has no second parent.
    head_revision=$(git rev-parse --verify -q "${build_sourceversion}^2") || \
        head_revision=$(git rev-parse "${build_sourceversion}")
    for sha1 in $(git log --first-parent --no-merges \
                     "${base_revision}..${head_revision}" --format="%h")
    do
        title=$(git log -1 --format="%s" "$sha1")
        if [[ "$title" == "${title_mask}"* ]]; then launch=True; fi
    done
fi

Note that when ^2 is absent, ${base}..${head} collapses to just the head commit, which is still the correct thing to title-match. Also convert the && launch=True into the if form shown (or append || true) so a non-matching last commit can't trip set -e. Re-running the PR build once GitHub's refs/pull/12423/merge is available will mask the issue but not fix it.

Related: PR #11527 (introduced the ^1..^2 range check); no existing issue found for this rev-parse ^2 failure.

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id edda2a13-8d2a-4d5d-acf1-4337adae05b9 in the triage console for the audit trail.

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (Codestyle AUTHORS file update check) · commit 4dbc460f

TL;DR: The "AUTHORS file update check" step died with fatal: ambiguous argument '4dbc460f…^2' because the build checked out the PR head commit (a single-parent commit) instead of the refs/pull/12423/merge two-parent merge commit, and the step unconditionally does git rev-parse <sha>^2 under set -eEx. Make the step fall back to the merge-base against the target branch when ^2 doesn't exist (and refresh/rebase the PR branch so GitHub regenerates a mergeable merge ref).

Full analysis

Summary: Codestyle → author job ("AUTHORS file update check") failed at step "AUTHORS file check" with Bash exited with code '128' before contrib/authors_update.sh ever ran.

Root cause: Evidence from the Azure log:

  • Checkout resolved to HEAD is now at 4dbc460f1 UCT/MLX5: Preserve SGL batch completions during purge via git checkout --progress --force refs/remotes/origin/[REDACTED:Hex High Entropy String] — i.e. the raw PR head SHA, not the refs/pull/12423/merge merge commit (Azure falls back to Build.SourceVersion when the GitHub merge ref is unusable/stale, typically an unmergeable or just-pushed PR).
  • The step then ran:
    • git rev-parse '4dbc460f…^1' → base_revision=[REDACTED:Hex High Entropy String]… (OK, master tip)
    • git rev-parse '4dbc460f…^2' → fatal: ambiguous argument '4dbc460f…^2': unknown revision or path not in the working tree.
  • Because the script starts with set -eEx, that non-zero git rev-parse aborted the step with exit 128.

So the failure is purely a CI-script assumption ("Build.SourceVersion is always a 2-parent PR merge commit"), not a problem with the PR's C code. There are no timing gaps/hangs — the whole step took <0.1 s.

Implicated commit: cfd9cd1f — "BUILD/CI: Limit PR commit range checks (#11527)", Yossi Itigin (introduced the ^1/^2 rev-parse pattern in the codestyle jobs)

File: buildlib/pr/codestyle.yml:88-89 (same pattern also at buildlib/pr/codestyle.yml:21-22 in the commit_title job)

Suggested fix:

  1. Harden the revision resolution so a non-merge checkout degrades gracefully, e.g.:
set -eEx
src=$(Build.SourceVersion)
if head_revision=$(git rev-parse -q --verify "${src}^2"); then
    base_revision=$(git rev-parse "${src}^1")
else
    # Not a PR merge commit (Azure checked out the PR head directly)
    head_revision=$(git rev-parse "${src}")
    git fetch --no-tags --depth=100 origin "$(System.PullRequest.TargetBranch)"
    base_revision=$(git merge-base FETCH_HEAD "${head_revision}")
fi
./contrib/authors_update.sh "${base_revision}..${head_revision}"
git diff --exit-code
  1. Apply the identical change to the commit_title job (lines 21-22) — it will hit the same 128 on any build where the merge ref is absent.
  2. Short-term unblock for this PR: rebase/force-push sgl-ft/split-uct onto current master so GitHub recomputes refs/pull/12423/merge, then re-run the Codestyle stage.

Related: PR #12423 (this build); commit cfd9cd1 / PR #11527 which added the ^1..^2 range logic; PR #12120 ("CI: Add UCF CLA check for pull requests") touches similar PR-range plumbing and would benefit from the same guard.

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id 837963f1-c738-4445-9e64-f9e3d1b6b38c in the triage console for the audit trail.

Comment thread src/uct/ib/mlx5/rc/rc_mlx5_ep.c Outdated
if (sgl_op == NULL) {
op = uct_rc_mlx5_ep_outstanding_peek_send_op(ep, pi);
if ((op != NULL) &&
((op->handler == uct_rc_ep_put_sgl_zcopy_completion_handler) ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls add a uct_rc_mlx5_send_op_is_sgl_zcopy() predicate next to the other uct_rc_mlx5_send_op_is_*() helpers and use it here, so all handler comparisons stay in one place.

Comment thread src/uct/ib/mlx5/rc/rc_mlx5_ep.c Outdated
if ((op != NULL) &&
((op->handler == uct_rc_ep_put_sgl_zcopy_completion_handler) ||
(op->handler == uct_rc_ep_get_sgl_zcopy_completion_handler))) {
sgl_op = ucs_queue_pull_elem_non_empty(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sgl_op = ucs_queue_pull_elem_non_empty(
sgl_op = op;
ucs_queue_pull_non_empty(&ep->super.txqp.outstanding);

uct_rc_mlx5_ep_outstanding_peek_send_op() already returned the queue head, no need to look it up again.

Comment thread src/uct/ib/mlx5/rc/rc_mlx5_ep.c Outdated

memset(info, 0, sizeof(*info));
if (sgl_op != NULL) {
uct_rc_mlx5_wqe_rma_segs(txwq, ctrl, wqe_size, &raddr, &inl,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: the SGL path drops inl/inline_length, so if a batch WQE ever carries an inline segment dptr is NULL and the element is reported with an empty iov. pls add ucs_assertv_always(inline_length == 0, ...) like uct_rc_mlx5_op_info_fill_get() does.

Comment thread src/uct/api/v2/uct_v2.h Outdated

/* Original completion. */
/**
* Original completion, when @ref UCT_EP_OP_INFO_FIELD_COMP is set. For an

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the callback also owns the reported completion for non-SGL operations (the transport only completes flush/ep_check ops itself), so can we document the rule for every reported operation instead of only for an SGL batch? as written it reads like single-WQE ops behave differently.

Comment thread test/gtest/uct/test_peer_failure.cc Outdated
/* rc_mlx5 RX tokens contain the next expected 24-bit packet sequence number. */
class test_uct_purge_sgl : public test_uct_purge_outstanding {
public:
void init() override {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: pls put the opening brace on the next line, like the other init() overrides in this file.

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — Blossom-CI · commit fa8c5101

TL;DR: The Blossom-CI security-scan step failed because the external BlackDuck/Pulse service returned HTTP 503 ("upstream connect error … Connection refused") on all 3 retry attempts — an infrastructure outage, not a code defect in PR #12423. Fix is to simply re-run the job (/build) once the BlackDuck endpoint is healthy.

Full analysis

Summary: NVIDIA/blossom-action step in the Blossom-CI "Authorization"/Vulnerability-scan workflow exited with code 255 after the BlackDuck BOM scan failed three consecutive times.

Root cause: The pulse ... scan CLI could not authenticate to the BlackDuck hub. The log shows:

  • Attempt 1 (11:29:02): urllib3.exceptions.MaxRetryError: ... /api/current-user (Caused by ResponseError('too many 503 error responses')) → requests.exceptions.RetryError
  • Attempt 2 (11:29:33) and 3 (11:30:34): RuntimeError: ('Unhandled HTTP response', <Response [503]>) with body upstream connect error or disconnect/reset before headers … delayed connect error: Connection refused served by Cloudflare.

The 503s originate from the BlackDuck service's upstream (connection refused behind the Cloudflare edge), i.e. the scanning backend was down. The action's own retry wrapper ("Transient BlackDuck failure detected (attempt N/3)") exhausted its 3 attempts within ~90 s of backoff and then surfaced exit status 1 → Process completed with exit code 255. Also note the earlier benign-looking Failed to create new client at 11:27:56 in the AUTH step, consistent with the same backend being unreachable.

No UCX source was compiled or tested in this run — the repo was only checked out (merge commit 132596d of fa8c510 into a64e75e) before the scan step aborted. Nothing in the diff (sgl-ft/split-uct) is implicated. There is no wall-clock timeout involved; the largest log gap is the ~30 s/60 s deliberate retry backoff.

Implicated commit: none — not a code regression (PR head [REDACTED:Hex High Entropy String], author gleon99, is unrelated to the failure)

File: .github/workflows/blossom-ci.yml (the NVIDIA/blossom-action@main vulnerability-scan step); failure is inside the external pulse/BlackDuck client, not in repo code

Suggested fix:

  1. Re-trigger the job (comment /build on PR UCT/MLX5: Preserve SGL batch completions during purge #12423) once the BlackDuck/Pulse endpoint returns 200 — the run should pass unchanged.
  2. If this recurs, raise it with the NVIDIA Blossom/ProdSec team: the BlackDuck hub behind the Cloudflare edge was refusing connections and 3 retries over ~90 s was not enough to ride out the outage. Ask for longer/exponential backoff (e.g. 5 attempts with 2–5 min backoff) in blossom-action, and/or have the action report a distinct "infra error" status instead of a hard failure so PR authors aren't blocked by a scanner outage.
  3. No change to UCX sources or build scripts is warranted.

Related: none (searched the repo; only an unrelated match on PR #503)

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id 7adbd3ea-b38d-49f7-b927-ce2dcef4eb97 in the triage console for the audit trail.

Comment thread src/uct/ib/mlx5/rc/rc_mlx5_ep.c Outdated
&iface->super, ep, pi, delivered ? UCS_OK : UCS_ERR_CANCELED);

/* Only the final WQE of an SGL batch requests a CQ update. */
if ((sgl_op != NULL) && (ctrl->fm_ce_se & MLX5_WQE_CTRL_CQ_UPDATE)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move this block above uct_rc_mlx5_ep_outstanding_complete_send_ops()? a flush posted right after the SGL gets sn == sig_pi == this WQE's pi, so its completion is currently invoked before the SGL completion, inverting the posting order.

Comment thread src/uct/ib/mlx5/rc/rc_mlx5_ep.c Outdated

if (sgl_op == NULL) {
op = uct_rc_mlx5_ep_outstanding_peek_send_op(ep, pi);
if ((op != NULL) &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ((op != NULL) &&
if ((op != NULL) && uct_rc_mlx5_send_op_is_sgl_zcopy(op)) {

pls add uct_rc_mlx5_send_op_is_sgl_zcopy() next to the other send_op_is_* helpers; after this PR is_put_zcopy()/is_get_zcopy() no longer tell SGL ops apart, so an explicit predicate is clearer.

Comment thread src/uct/ib/mlx5/rc/rc_mlx5_ep.c Outdated
uct_ep_op_info_t *info)
{
memset(info, 0, sizeof(*info));
if (op == NULL) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uct_rc_mlx5_op_info_fill() has a single caller which already peeked the op one line earlier, so this peeks twice. can we pass (sgl_op != NULL) ? sgl_op : op from the caller and drop ep/pi and this peek?

Comment thread src/uct/api/v2/uct_v2.h Outdated

/* Original completion. */
/**
* Original completion, when @ref UCT_EP_OP_INFO_FIELD_COMP is set. For an

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls also update the uct_ep_outstanding_purge doc — it still says the callback is invoked "once for each undelivered outstanding operation", but an SGL operation is now reported once per element. also "SGL batch"/"fragment" here vs "element" in the SGL API docs.

Comment thread test/gtest/uct/test_peer_failure.cc Outdated
class test_uct_purge_sgl : public test_uct_purge_outstanding {
public:
void init() override {
modify_config("IB_INDIRECT_ATOMIC", "n", SETENV_IF_NOT_EXIST);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these needed? the other purge tests run with the defaults, and RC_FENCE is overridden unconditionally while IB_INDIRECT_ATOMIC uses SETENV_IF_NOT_EXIST.

Comment thread test/gtest/uct/test_peer_failure.cc Outdated
/* rc_mlx5 RX tokens contain the next expected 24-bit packet sequence number. */
class test_uct_purge_sgl : public test_uct_purge_outstanding {
public:
void init() override {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: function body brace goes on a new line (docs/CodeStyle.md), same for the new UCS_TEST_P bodies below.

@svc-nvidia-pr-review

Copy link
Copy Markdown

Residual coverage gap worth noting: the new tests are rc_mlx5-only and fake the RX token instead of racing real delivery, so the partially-delivered path is only modelled, not exercised against hardware; gga_mlx5 (which also derives from the rc_mlx5 base ep) is not covered.

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Comment thread src/uct/ib/mlx5/rc/rc_mlx5_ep.c Outdated
if (status == UCS_OK) {
/* The original reference keeps the SGL alive even when a
* replay callback completes an element synchronously. */
if ((sgl_op != NULL) && (sgl_op->user_comp != NULL)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we take the extra reference from the reported descriptor instead?

Suggested change
if ((sgl_op != NULL) && (sgl_op->user_comp != NULL)) {
/* The original reference keeps the SGL alive even when a
* replay callback completes an element synchronously. */
if (info.field_mask & UCT_EP_OP_INFO_FIELD_COMP) {
++info.comp->count;
}

this way the added reference always matches what the callback was told, instead of relying on every fill path setting UCT_EP_OP_INFO_FIELD_COMP for SGL elements.

(minor) The extra reference is derived from sgl_op->user_comp instead of from what the callback was actually told (info). Today they always agree, but it couples the reference transfer to an invariant in the fill helpers rather than to the reported descriptor.

Comment thread src/uct/ib/mlx5/rc/rc_mlx5_ep.c Outdated
wqe_first_psn = (wqe_first_psn + num_packets) & UCT_IB_MLX5_PSN_MASK;
}

ucs_assert(sgl_op == NULL);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: pls use ucs_assert_always here; sgl_op is already off the outstanding queue, so if a chain ever ends without CQ_UPDATE the op leaks and its completion never fires in release builds. Other WQE-parsing invariants in this file use ucs_assertv_always.

uct_rc_mlx5_op_callback_data_t *callback_data,
uct_ep_op_info_t *info)
{
memset(info, 0, sizeof(*info));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: unrelated whitespace change, pls restore the blank line.

Comment thread src/uct/ib/mlx5/rc/rc_mlx5_ep.c Outdated
Comment on lines +2022 to +2026
/* The original reference keeps the SGL alive even when a
* replay callback completes a fragment synchronously. */
if ((sgl_op != NULL) && (sgl_op->user_comp != NULL)) {
++sgl_op->user_comp->count;
}

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.

IMO something wrong here and in UCP POC too, purge callback should provide an origin undelivered operation with the same parameters, we cannot control user's completion since user (UCP) can build a logic on its value.
UCT should invoke uct completion only once when whole requested operation is completed (successfully or not)

Comment thread test/gtest/uct/test_peer_failure.cc Outdated
Comment on lines +1196 to +1202
} ctx = {{this, operation, {completion_cb, 1, UCS_OK}}, with_comp,
completion_mode == INLINE,
count - ((is_put && with_rx_token) ? delivered_prefix : 0), {}};
unsigned first = count - ctx.count;
ctx.expected.iov = iov + first;
ctx.expected.remote_addr = remote.addr() + first * stride;
ctx.expected.rkey = remote.rkey();

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.

minor: to improve human readability better to fill everything after definition, near ctx.expected ... = ...

Comment thread test/gtest/uct/test_peer_failure.cc Outdated
Comment on lines +1247 to +1248
params.cb = [](const uct_ep_op_info_t *info, void *arg) {
auto &ctx = *static_cast<sgl_purge_ctx*>(arg);

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.

monor: I would define a static callback instead of lambda to keep this function shorter

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX-OSS/ucx-build-static-oss · commit 134b919b

TL;DR: The build never ran any code — both matrix pods (x86_64/ubuntu2004-mofed5.0 and x86_64/centos7-ib) were rejected by Kubernetes because the nbu-swx-ucx namespace CPU quota was exhausted (118 of 120 cores already used, 6500m requested each), and the job then sat in "Still waiting to schedule task" until the 90-minute pipeline timeout aborted it. This is a CI infrastructure/capacity issue, not a regression from PR #12423 — retry the build.

Full analysis

Summary: ucx-build-static-oss #143 aborted after 90 min because neither agent pod could be scheduled: pods "ucx-build-static-...-143-..." is forbidden: exceeded quota: resourcequota-nbu-swx-ucx, requested: cpu=6500m, used: cpu=118, limited: cpu=120.

Root cause: Kubernetes namespace resource-quota exhaustion. At 13:53:11 both parallel branches failed POST /api/v1/namespaces/nbu-swx-ucx/pods with HTTP 403 Forbidden (quota exceeded), retried, and then both labels reported "All nodes of label ... are offline". The log then goes completely silent from 13:53:24 to 15:23:09 (~90 min with zero output) — i.e. pure scheduling wait, not a hung or slow build — until Cancelling nested steps due to timeout / FlowInterruptedException: Timeout has been exceeded. The Build Static step never started, so none of the PR's changed files (src/uct/api/v2/uct_v2.h, src/uct/ib/mlx5/rc/rc_mlx5_ep.c, test/gtest/uct/test_peer_failure.cc) were ever compiled. Each task asks for requests/limits: cpu 6000m plus ~500m jnlp overhead, so only ~18 such tasks fit in the 120-core namespace quota; concurrent load from other UCX jobs starved this one.

Implicated commit: none in the PR — infrastructure. Closest related config change: [REDACTED:Hex High Entropy String] "CI: reduce CPU requests in all CI pipelines (#11494)" by NirWolfer (last touch to the CPU request values).

File: .ci/pipeline/build_static_matrix.yaml (the kubernetes: block — limits/requests: "{memory: 8Gi, cpu: 6000m}")

Suggested fix: Re-run build #143; the failure is transient. To reduce recurrence: (1) lower requests.cpu in .ci/pipeline/build_static_matrix.yaml below the limits.cpu (e.g. request 2000m, limit 6000m) so a static build doesn't reserve 6.5 cores of quota while mostly idle on I/O; (2) ask the CI/infra owners to raise the resourcequota-nbu-swx-ucx CPU limit or cap concurrent leaf jobs in the dispatcher; (3) consider failing fast instead of silently burning the 90-minute timeout_minutes — wrap the node acquisition in a shorter timeout (e.g. 15 min) inside the existing retry so quota rejections surface quickly as a retryable infra error rather than a build timeout.

Related: #12418 (CI: performance-optimized durability for Jenkins leaf jobs), #12168 (CI: Match Azure build matrix in the Jenkins static build job), #11494 (CI: reduce CPU requests in all CI pipelines)

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id deaf3676-75dc-464d-9d38-c66927569a17 in the triage console for the audit trail.

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX-OSS/ucx-test-oss · commit 134b919b

TL;DR: The build failed as pure CI infrastructure flake: all four ucx-test worker pods were rejected by Kubernetes with exceeded quota: resourcequota-nbu-swx-ucx (namespace was at 118/120 CPU, 289/300 Gi), so nothing ever ran and the 90-minute pipeline timeout aborted the job. Re-run the build; no code change in PR #12423 is implicated.

Full analysis

Summary: Parallel end stage aborted after 90 min — none of the 4 matrix workers (x86_64/ubuntu2404-doca2.9/w1..w4) could be scheduled because the Kubernetes namespace resource quota was exhausted.

Root cause: At 13:53:37 the Kubernetes plugin got HTTP 403 for every pod create: pods "ucx-test-ubuntu2404-doca29-181-..." is forbidden: exceeded quota: resourcequota-nbu-swx-ucx, requested: cpu=6500m,memory=18Gi, used: cpu=118,memory=289536Mi, limited: cpu=120,memory=300Gi. Each matrix leg requests 6000m CPU / 16 Gi (≈6500m / 18 Gi with the jnlp sidecar), and 4 legs run concurrently, so the job needs ~26 CPU / 72 Gi of a 120 CPU / 300 Gi namespace that was already 98% consumed by other concurrent builds. After the retry wrapper failed, the legs sat in Still waiting to schedule task / All nodes of label ... are offline for the full 90 minutes with zero intervening log output (13:53:50 → 15:23:35 — a 90-minute gap of complete silence), then Cancelling nested steps due to timeout → FlowInterruptedException: Timeout has been exceeded. This is a scheduling starvation, not a hang in UCX code and not a genuine shortage of wall time: the PR's changed files (src/uct/api/v2/uct_v2.h, src/uct/ib/mlx5/rc/rc_mlx5_ep.c, test/gtest/uct/test_peer_failure.cc) were never compiled or tested.

Implicated commit: unknown — not a source regression. The resource sizing comes from [REDACTED:Hex High Entropy String] (NirWolfer, "CI: reduce CPU requests in all CI pipelines", #11494), but the trigger was external namespace contention.

File: .ci/pipeline/test_matrix.yaml:13-14 (pod limits/requests), .ci/pipeline/test_matrix.yaml:8 (timeout_minutes: 90)

Suggested fix: Short term: simply re-trigger build #181 — it will pass once the namespace frees up. Medium term, to stop quota exhaustion from burning a 90-minute slot and reporting as a red PR:

  1. Fail fast on unschedulable pods instead of silently waiting — set a podRetention/slaveConnectTimeout (e.g. 10 min) on the podTemplate in the ci-demo matrix_job library so quota rejections surface as an infra error within minutes rather than as a build timeout.
  2. Reduce the per-leg footprint or concurrency: 4 × 6000m/16Gi is a large single-build claim on a 120 CPU / 300 Gi quota. Either lower requests below limits (burstable) in .ci/pipeline/test_matrix.yaml:13-14, or cap concurrent matrix legs (e.g. 2 at a time) so a saturated namespace can still make progress.
  3. Mark quota-exceeded aborts as UNSTABLE/infra-retry rather than FAILURE so they don't gate PRs.
    Do not raise timeout_minutes — the workers never started, so more wall time would change nothing.

Related: #12418 ("CI: Use the performance-optimized durability for the Jenkins leaf jobs"), #12094 ("CI: Jenkins integration testing") — both touch the same Jenkins leaf-job/pod configuration; #11494 last adjusted these CPU requests.

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id cf4dd986-4589-4dd2-99b3-43856e6bd8e9 in the triage console for the audit trail.

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX-OSS/ucx-static-checks-oss · commit 134b919b

TL;DR: The build didn't fail on code — the Kubernetes agent pod could never be created because the nbu-swx-ucx namespace CPU ResourceQuota was exhausted (used 118 of 120 cpu, pod needed 4500m), so the node step waited for an agent until the 90-minute pipeline timeout aborted it. Fix is infra-side: free/raise the namespace quota (or lower the job's CPU request) and add a short agent-provisioning timeout so this fails fast and retries instead of burning 90 minutes.

Full analysis

Summary: UCX-OSS/ucx-static-checks-oss #136 branch x86_64/fedora33 never started; pipeline aborted by the 90-min timeout while waiting for a Kubernetes agent.

Root cause: Pure CI infrastructure/capacity failure, not a code regression. From the build log at 13:53:14Z:

WARNING: Unable to create pod: il-ipp-blossom-prod-nbu-swx-ucx nbu-swx-ucx/ucx-static-checks-fedora33-136-lgt02-3n61x
because kubernetes resource quota exceeded.
pods "..." is forbidden: exceeded quota: resourcequota-nbu-swx-ucx,
requested: cpu=4500m, used: cpu=118, limited: cpu=120
ERROR: Failed to launch ucx-static-checks-fedora33-136-lgt02-3n61x
Retrying...
Still waiting to schedule task
All nodes of label 'UCX-OSS_ucx-static-checks-oss_136-bb74m' are offline

Timestamp analysis confirms a hang-while-waiting, not slow work: the last meaningful log line is at 13:53:27.530Z ("All nodes ... are offline"), and the next line is 15:23:12.677Z "Failed in branch x86_64/fedora33" — a ~90 minute gap with zero output. Nothing was executing; the retry/node block simply blocked waiting for a pod slot that never freed up (only 2 of 120 cpu available in the namespace). The outer timeout_minutes: 90 then fired, producing FlowInterruptedException: Timeout has been exceeded.

Note the request/quota mismatch: the job declares cpu: 4000m, but the actual pod request is 4500m because the jnlp sidecar adds its own request on top of the build container. The static-checks job also only runs static_checks.sh (checkpatch/codespell/clang-format style checks on 3 changed files) — it does not need 4 full cores. The PR's changed files (src/uct/api/v2/uct_v2.h, src/uct/ib/mlx5/rc/rc_mlx5_ep.c, test/gtest/uct/test_peer_failure.cc) were never even compiled or linted.

Implicated commit: unknown — no code commit is implicated. The commit under test (134b919 / merge dbb9be6) is innocent. The closest related config change is [REDACTED:Hex High Entropy String] "CI: reduce CPU requests in all CI pipelines (#11494)" by NirWolfer, which last tuned these values.

File: .ci/pipeline/static_checks_matrix.yaml:13-14 (cpu requests/limits), .ci/pipeline/static_checks_matrix.yaml:8 (timeout_minutes)

Suggested fix:

  1. Immediate: Just re-run build RC: Add parameter checks. #136. This is a transient capacity contention; it will pass once other jobs release their quota.
  2. Reduce the footprint so the job fits in leftover quota. Static checks are not CPU-bound at 4 cores:
    kubernetes:
      cloud: il-ipp-blossom-prod-nbu-swx-ucx
      namespace: nbu-swx-ucx
      limits: "{memory: 8Gi, cpu: 2000m}"
      requests: "{memory: 4Gi, cpu: 1000m}"
    Setting requests below limits lets the pod schedule under quota pressure while still bursting when cores are free. (Verify the matrix library honors split request/limit values; the current config sets them identically, which is what forces the full 4000m + 500m jnlp reservation.)
  3. Fail fast instead of hanging 90 minutes. Wrap agent acquisition in a short timeout so the retry actually retries rather than blocking on an unschedulable pod — e.g. a 10-15 min provisioning timeout inside the retry block in the ci-demo matrix_job library, or lower timeout_minutes for this leaf job. Burning a 90-minute executor slot on a pod that was rejected in the first second makes the quota starvation worse for every other queued job.
  4. Ops follow-up: ask the Blossom/IPP admins to raise resourcequota-nbu-swx-ucx above 120 cpu, or check for leaked/stuck pods pinning 118 cpu in nbu-swx-ucx — a 2-cpu headroom on a namespace whose smallest job wants 4.5 cpu means every new job deterministically fails to schedule.

Related: #12418 "CI: Use the performance-optimized durability for the Jenkins leaf jobs" and #12168 "CI: Match Azure build matrix in the Jenkins static build job" touch the same Jenkins leaf-job configuration; [REDACTED:Hex High Entropy String] (#11494) is the prior CPU-request reduction. No existing issue tracks the quota exhaustion itself — worth opening one against the CI team.

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id 1bfae858-91b4-4e52-9bb5-2d6b2c543a67 in the triage console for the audit trail.

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX-OSS/ucx-coverity-oss · commit 134b919b

TL;DR: The build never ran any Coverity work — both matrix branches sat in "Still waiting to schedule task / All nodes of label … are offline" for the full 90 minutes until the pipeline-level timeout aborted them, so this is a Kubernetes agent-provisioning/capacity failure, not a code regression from PR #12423.

Full analysis

Summary: UCX-OSS/ucx-coverity-oss #139 failed with FlowInterruptedException: Timeout has been exceeded in the Parallel end stage after 5,400,629 ms (90 min); neither x86_64/cov/release nor x86_64/cov/devel ever acquired an agent pod.

Root cause: Infrastructure, not the commit. The console log shows the outer jnlp pod was created and the checkout stage succeeded (74 s), but when the matrix entered parallel, both nested podTemplate/node steps logged only:

[2026-11-23T14:21:48.806Z] Still waiting to schedule task
[2026-11-23T14:21:48.806Z] All nodes of label 'UCX-OSS_ucx-coverity-oss_139-5712k' are offline
[2026-11-23T14:21:48.855Z] Still waiting to schedule task
[2026-11-23T14:21:48.855Z] All nodes of label 'UCX-OSS_ucx-coverity-oss_139-vct6z' are offline

There is no Created Pod: / [PodInfo] line for either worker pod — unlike the outer agent, which logged both. The largest timestamp gap in the log is 14:21:48 → 15:51:33 (≈89.7 min, i.e. essentially the entire runtime), with zero output in between, ending in Cancelling nested steps due to timeout. So the pods were never instantiated by the il-ipp-blossom-prod-nbu-swx-ucx cloud in namespace nbu-swx-ucx — most likely namespace resource-quota exhaustion or no node able to satisfy the request: each branch asks for {memory: 8Gi, cpu: 6000m} (.ci/pipeline/coverity_matrix.yaml:13-14), and two run concurrently = 16 Gi / 12 CPU, plus the hostPath volumes /hpc/local and /auto/sw_tools/Commercial restrict placement to nodes that mount those shares.

Supporting evidence that the PR is innocent: the log's own git diff --name-only origin/master..HEAD lists only src/uct/api/v2/uct_v2.h, src/uct/ib/mlx5/rc/rc_mlx5_ep.c, test/gtest/uct/test_peer_failure.cc — no CI/build files, and coverity.sh was never invoked.

Implicated commit: unknown — not a source regression. (For context, the resource requests were last touched by [REDACTED:Hex High Entropy String], NirWolfer, "CI: reduce CPU requests in all CI pipelines (#11494)"; a346463, Alexey Rivkin, added the file. Neither is the trigger here.)

File: .ci/pipeline/coverity_matrix.yaml:8-14 (timeout + pod requests)

Suggested fix:

  1. Immediate: re-trigger build IB/RC: Set QP parameters. #139. This is a transient scheduling failure with no product-code signal.
  2. Infra: check quota and allocatable capacity in namespace nbu-swx-ucx (kubectl describe quota -n nbu-swx-ucx, kubectl get events -n nbu-swx-ucx) and confirm nodes exposing /hpc/local and /auto/sw_tools/Commercial are Ready — the absent Created Pod: line points at the cloud/quota layer rather than image pull.
  3. Fail fast instead of burning 90 min: wrap the node acquisition in a short timeout (e.g. 10 min) so an unschedulable pod aborts quickly and the existing retry block can re-request a fresh agent, rather than the whole-pipeline 90 min timeout_minutes being consumed while idle.
  4. Reduce contention: lower requests below limits (currently identical at 8Gi/6000m) so two concurrent branches need less guaranteed headroom, or cap matrix concurrency to 1 for this job since the Coverity step itself is parallel: false.

Related: none — searches for this signature returned only unrelated CI PRs (#12168, #12094).

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id 41870c6f-f4af-4519-b24a-65874962c741 in the triage console for the audit trail.

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX-OSS/ucx-build-oss · commit 134b919b

TL;DR: One of the 36 parallel Build branches died after 1.1 s with ./buildlib/tools/builds.sh: No such file or directory (exit 127) because its agent workspace contained no source tree — a CI infrastructure/pipeline problem (missing per-branch checkout on a freshly allocated/retried pod), not a regression from PR #12423. Fix by doing an explicit checkout scm/unstash inside each parallel branch's node/retry block (and guarding with a fail-fast check).

Full analysis

Summary: Jenkins build #134 failed in stage ID 1085 ("Build" branch inside the Parallel stage) with Step Build failed with exit code=127; all 35 other Build branches passed, including the UCT-split soname/linkage checks introduced by the PR.

Root cause: The only log line for the failing branch is:
[REDACTED:Base64 High Entropy String]@tmp/durable-c2a70bdb/script.sh.copy: line 4: ./buildlib/tools/builds.sh: No such file or directory
The shell was executing from [REDACTED:Base64 High Entropy String], and buildlib/tools/builds.sh is present in the repo on this branch (it exists and was last touched in 40a33dc, Oct 2026 — nothing in recent history removes or renames it). Successful branches show the same workspace path being used as the autotools srcdir (e.g. test . = ".../ucx-build-oss/contrib/.."), i.e. the source is expected to already be in the branch's workspace, populated by the single top-level "Checkout source code" stage. The failing branch started late (15:23:43Z, long after the others) and aborted in 1.1 s — the signature of a newly allocated / retried pod (the console shows retry, podTemplate, node, container wrappers) whose workspace was never populated with the checkout. So this is an empty-workspace / missing-checkout infrastructure failure, not a build or test regression: exit 127 is "command not found", emitted before any compilation started.

Implicated commit: none — not a source regression. Commit under test is [REDACTED:Hex High Entropy String] (PR #12423, branch sgl-ft/split-uct), whose UCT-split checks all passed in the other 35 branches.

File: Jenkins pipeline definition for UCX-OSS/ucx-build-oss (parallel Build branch body that invokes ./buildlib/tools/builds.sh); script referenced: buildlib/tools/builds.sh:1

Suggested fix:

  1. Re-run the job — this branch failure is not reproducible from the commit under test.
  2. In the pipeline, make each parallel branch own its source: inside the per-branch node { container { ... } } (and inside the retry block, so a retried pod re-fetches), do a checkout scm or unstash 'source' before calling builds.sh. Relying on a workspace populated by a different/earlier node allocation breaks whenever a pod is recreated or evicted.
  3. Add a fail-fast guard with a clear message, e.g. [ -x ./buildlib/tools/builds.sh ] || { echo "FATAL: workspace not populated (no source checkout) in $(pwd)"; ls -la; exit 1; }, so this misleading exit 127 is immediately diagnosable instead of looking like a build break.

Related: #12166 ("Jenkins CI: Gate Jenkins jobs on a basic compile"), #12094 ("CI: Jenkins integration testing") — both touch this Jenkins pipeline's node/checkout structure.

🛡️ This comment had 2 potential secret(s) redacted (Base64 High Entropy String, Hex High Entropy String). See request_id 7ba6c1af-d210-421d-8e65-0b77a204cdeb in the triage console for the audit trail.

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

uct_rc_mlx5_op_callback_data_t *callback_data, uct_ep_op_info_t *info)
{
uct_iov_t *iov = buffer;
uct_ib_mem_t *memh = (void*)(iov + max_count);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Place the 64-bit arrays before the memory-handle array:

uint64_t addrs = (void)(iov + max_count);
uct_rkey_t rkeys = (void)(addrs + max_count);
uct_ib_mem_t memh = (void)(rkeys + max_count);

uct_ib_mem_t is 12 bytes, so the current layout misaligns both arrays whenever max_count is odd, causing undefined 64-bit accesses and alignment-sanitizer failures during purge.

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (Coverity coverity devel on coverity_rh7) · commit 3c8e2d5f

TL;DR: The Coverity (devel) job failed because static analysis found one new FORWARD_NULL defect at src/uct/ib/mlx5/rc/rc_mlx5_ep.c:1923 — element.rma.payload.zcopy.iov is dereferenced after uct_rc_mlx5_op_info_fill() zeroed the whole uct_ep_op_info_t; gate the dereference on the pointer itself (iov != NULL) instead of on iovcnt.

Full analysis

Summary: coverity devel stage: build + cov-analyze succeeded, then the gate failed with ##[error]Coverity found 1 issues: /__w/1/s/src/uct/ib/mlx5/rc/rc_mlx5_ep.c:1923 Type: Explicit null dereferenced (FORWARD_NULL) → script returned 1 (nerrors=1, [[ 1 -eq 0 ]] false).

Root cause: In the new SGL purge helper uct_rc_mlx5_op_info_fill_sgl(), uct_rc_mlx5_op_info_fill() starts with memset(info, 0, sizeof(*info)) (rc_mlx5_ep.c:1648) and can return early (MLX5_OPCODE_NOP → UCS_ERR_NO_ELEM). Coverity's write_zero_model therefore knows element.rma.payload.zcopy.iov == NULL, but it does not correlate the companion field iovcnt, so on the path where it assumes element.rma.payload.zcopy.iovcnt != 0 (line 1922) the dereference element.rma.payload.zcopy.iov[0] at line 1923 is a provable null deref for the checker. The ucs_assert_always(status == UCS_OK) on line 1918 does not prune the path (Coverity explored both branches of it), so the analyzer reaches the deref. This is net-new code on this PR branch, not a pre-existing defect — the analysis itself was clean otherwise (FORWARD_NULL count 7, only this one newly reported).

Implicated commit: fa8c5101 "UCT/MLX5: Reuse existing purge parsers for SGL batches" (Leonid Genkin), which introduced uct_rc_mlx5_op_info_fill_sgl(); branch tip [REDACTED:Hex High Entropy String] (Leonid Genkin) still carries it.

File: src/uct/ib/mlx5/rc/rc_mlx5_ep.c:1922-1926 (zero-write model origin at src/uct/ib/mlx5/rc/rc_mlx5_ep.c:1648)

Suggested fix: Make the guard test the pointer that is dereferenced, which both silences the checker and is the stronger invariant:

        memset(&iov[i], 0, sizeof(iov[i]));
        iov[i].count = 1;
        if (element.rma.payload.zcopy.iov != NULL) {
            ucs_assert_always(element.rma.payload.zcopy.iovcnt == 1);
            iov[i]      = element.rma.payload.zcopy.iov[0];
            memh[i]     = *(uct_ib_mem_t*)iov[i].memh;
            iov[i].memh = &memh[i];
        }

(equivalently if ((element.rma.payload.zcopy.iovcnt != 0) && (element.rma.payload.zcopy.iov != NULL))). While there, consider handling the status != UCS_OK case explicitly rather than relying only on ucs_assert_always, since uct_rc_mlx5_op_info_fill() can legitimately return UCS_ERR_NO_ELEM for a NOP WQE inside the batch — that is the exact path Coverity walked, so it may be a real logic gap, not just a false positive. Re-run the Coverity job after the change; the HTML report is available as the coverity_devel pipeline artifact for build 147287.

Related: none found (no matching issues/PRs in this repo); prior related work: #11763 (implement get_sgl_zcopy), #12133 (outstanding-purge/NOP revert).

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id 5fb34fb4-543e-4682-8e80-908ec59727e9 in the triage console for the audit trail.

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX-OSS/ucx-coverity-oss · commit 3c8e2d5f

TL;DR: The Coverity analysis stage failed because cov-analyze reported 1 new defect — a FORWARD_NULL (null-pointer dereference) at src/uct/ib/mlx5/rc/rc_mlx5_ep.c:1923 in the newly added uct_rc_mlx5_op_info_fill_sgl(); fix it by failing explicitly (not via ucs_assert_always) when uct_rc_mlx5_op_info_fill() returns non-UCS_OK, and/or by also null-checking element.rma.payload.zcopy.iov.

Full analysis

Summary: Stage "Coverity" failed: build and 758-TU cov-build succeeded, but cov-format-errors returned nerrors=1, so the script exited non-zero (and the parallel stage was aborted).

Root cause: Coverity's reported path (from the stage log):

  • uct_rc_mlx5_op_info_fill() is called with &element; its first statement is memset(info, 0, sizeof(*info)) (line 1648), and for MLX5_OPCODE_NOP it returns UCS_ERR_NO_ELEM immediately (line 1651-1652). Coverity models this as element.rma.payload.zcopy.iov == NULL ("write_zero_model").
  • Back in uct_rc_mlx5_op_info_fill_sgl(), the only protection is ucs_assert_always(status == UCS_OK) (line 1918) and ucs_assert_always(element.rma.payload.zcopy.iovcnt <= 1) (line 1919). Coverity does not treat ucs_assert_always as terminating, so it keeps the status != UCS_OK / all-zero element path alive, then takes the iovcnt != 0 branch (line 1922) and flags iov[i] = element.rma.payload.zcopy.iov[0]; at line 1923 as dereferencing a NULL pointer.

So this is a Coverity-visible gap in the new SGL purge-parser reuse code: control flow for the NOP / UCS_ERR_NO_ELEM case is only guarded by asserts rather than by real error handling.

Implicated commit: fa8c5101 "UCT/MLX5: Reuse existing purge parsers for SGL batches" (Leonid Genkin) — introduced uct_rc_mlx5_op_info_fill_sgl(); build was on [REDACTED:Hex High Entropy String] "UCT/BASE: CR fix" (Leonid Genkin), same PR #12423.

File: src/uct/ib/mlx5/rc/rc_mlx5_ep.c:1923 (defect site; contributing code at :1916-1922 and :1648-1652)

Suggested fix: Replace the assert-only guards in uct_rc_mlx5_op_info_fill_sgl() with explicit, Coverity-visible control flow, e.g.:

status = uct_rc_mlx5_op_info_fill(iface, txwq, op, ctrl, *wqe_size,
                                  callback_data, &element);
if (ucs_unlikely(status != UCS_OK)) {
    ucs_fatal("rc mlx5: unexpected sgl wqe opcode 0x%x status %s",
              uct_ib_mlx5_wqe_opcode(ctrl), ucs_status_string(status));
}
...
if ((element.rma.payload.zcopy.iovcnt != 0) &&
    (element.rma.payload.zcopy.iov != NULL)) {
    iov[i]      = element.rma.payload.zcopy.iov[0];
    ...
}

ucs_fatal is UCS_F_NORETURN, so Coverity will prune the zeroed-element path and the FORWARD_NULL disappears; the extra iov != NULL check makes the invariant explicit and is defensive against future op_info_fill variants that set iovcnt without iov. (A NOP WQE inside an SGL batch is "can't happen" today — if that is truly guaranteed, the fatal is the right documentation of it; do not simply suppress the Coverity finding, since the current code would really dereference NULL in a release build where asserts are compiled out.)

Related: PR #12423 (branch sgl-ft/split-uct); prior SGL work: 51224230 "UCT/IB/MLX5/RC: Implement get_sgl_zcopy (#11763)", [REDACTED:Hex High Entropy String] "Revert outstanding-purge transmit range + NOP in invalidate (#12133)". No existing issue found for this specific defect.

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id a59573e2-6e0c-4f37-aea7-6120bcc7e146 in the triage console for the audit trail.

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX-OSS/ucx-test-oss · commit 3c8e2d5f

TL;DR: The build never ran any tests — all four parallel branches failed because the Kubernetes namespace nbu-swx-ucx was at its resource quota (cpu 398400m/400, memory ~988–1015Gi/1000Gi), so no agent pod could be scheduled and the pipeline hit its 90-minute timeout. This is a CI infrastructure/capacity problem, not a regression in PR #12423.

Full analysis

Summary: UCX-OSS/ucx-test-oss #208 aborted in the Parallel end stage after 90 min; branches x86_64/ubuntu2404-doca2.9/w1..w4 all reported "Failed to launch ucx-test-ubuntu2404-doca29-208-…" with HTTP 403 exceeded quota: resourcequota-nbu-swx-ucx.

Root cause: The Jenkins Kubernetes plugin repeatedly tried to create the four ucx-test-ubuntu2404-doca29-208-* agent pods (each requesting cpu=6500m, memory=18Gi) and the API server rejected every attempt with 403 Forbidden ... exceeded quota: resourcequota-nbu-swx-ucx, requested: cpu=6500m,memory=18Gi, used: cpu=398400m,memory=1015040Mi, limited: cpu=400,memory=1000Gi. The namespace was essentially fully consumed by other/stale workloads (~99.6% of CPU and 98–101% of the memory quota), leaving <2 CPU free versus the 6.5 CPU needed. The plugin kept retrying roughly every 10 s from ~19:49 until the stage's wall-clock timeout fired ("Cancelling nested steps due to timeout" → FlowInterruptedException: Timeout has been exceeded). Note this is not a hang inside a test: the log shows continuous retry activity at ~10 s intervals right up to the kill, and no build/test command ever started — the checkout stage (31 s) is the only work that completed. Commit 3c8e2d5 / PR #12423 is therefore not implicated; no UCX source was compiled or executed.

Implicated commit: none — infrastructure failure, unrelated to [REDACTED:Hex High Entropy String]

File: n/a (Jenkins podTemplate resource request cpu=6500m, memory=18Gi vs. namespace quota resourcequota-nbu-swx-ucx: cpu=400, memory=1000Gi)

Suggested fix: Simply re-run build #208 once the cluster drains — nothing in the PR needs changing. For durability: (1) check for leaked/stuck agent pods in namespace nbu-swx-ucx (kubectl get pods -n nbu-swx-ucx --sort-by=.metadata.creationTimestamp) and reap orphans from aborted builds, since 398/400 CPU allocated with nothing progressing strongly suggests leftovers; (2) either raise the namespace quota or lower the per-agent request (6.5 CPU × 4 workers = 26 CPU per build is large) so builds fit under contention; (3) make the pod-launch retry fail fast instead of silently burning the whole 90-minute stage timeout — e.g. bound the retry count around podTemplate/node and surface "quota exceeded" as a distinct infra error so it isn't misreported as a test timeout. Also worth noting: the pipeline's post-build notification logged Response Code :: 401, so a CI notification credential may need refreshing/rotating as well.

Related: PR #12423 (the PR under test, not the cause); #12418 "CI: Use the performance-optimized durability for the Jenkins leaf jobs" touches the same Jenkins leaf-job infrastructure.

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id 34230a6b-0f9a-4286-aa36-e38743b93a83 in the triage console for the audit trail.

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

uct_rc_mlx5_op_callback_data_t *callback_data, uct_ep_op_info_t *info)
{
uct_iov_t *iov = buffer;
uct_ib_mem_t *memh = (void*)(iov + max_count);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For odd max_count values (e.g. RC_TX_QUEUE_LEN=14), placing the 12-byte uct_ib_mem_t array before addrs misaligns both 64-bit arrays, so purge can fault on strict-alignment targets. Place the 64-bit arrays first:

Suggested change
uct_ib_mem_t *memh = (void*)(iov + max_count);
uint64_t *addrs = (void*)(iov + max_count);
uct_rkey_t *rkeys = (void*)(addrs + max_count);
uct_ib_mem_t *memh = (void*)(rkeys + max_count);

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

ctrl, wqe_size);

if ((rx_token != NULL) && (num_packets != 0)) {
op = uct_rc_mlx5_ep_outstanding_peek_send_op(ep, pi);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skip cancel-on-purge bursts before calling uct_rc_mlx5_ep_outstanding_peek_send_op(). Their descriptor stays queued until wqe_end_pi, so the second WQE has op->sn < pi and this new unconditional lookup triggers the helper’s assertion in debug builds instead of canceling the burst.

{
uct_iov_t *iov = buffer;
uct_ib_mem_t *memh = (void*)(iov + max_count);
uint64_t *addrs = (void*)(memh + max_count);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align the address/key arrays and account for padding in scratch_size. uct_ib_mem_t is 12 bytes, so an odd max_count—for example, 3 with RC_TX_QUEUE_LEN=6—leaves both arrays only four-byte aligned, making their uint64_t accesses undefined and potentially faulting on alignment-sensitive platforms.

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (Coverity coverity release on coverity_rh7) · commit 02fe6462

TL;DR: The Coverity (release) gate failed with one new FORWARD_NULL defect: uct_rc_mlx5_op_info_fill_sgl() dereferences element.rma.payload.zcopy.iov at rc_mlx5_ep.c:1921 on a path where the parser left it NULL; guard the dereference on the pointer itself (and handle a non-UCS_OK status explicitly) instead of relying on iovcnt/asserts.

Full analysis

Summary: coverity release on coverity_rh7 failed — build and cov-analyze succeeded, but cov-format-errors reported 1 issue, so the job exited non-zero: ##[error]Coverity found 1 issues: /src/uct/ib/mlx5/rc/rc_mlx5_ep.c:1921 Type: Explicit null dereferenced (FORWARD_NULL).

Root cause: In the new SGL purge helper uct_rc_mlx5_op_info_fill_sgl(), the per-WQE element is filled by uct_rc_mlx5_op_info_fill(), which first does memset(info, 0, sizeof(*info)) and can return early with UCS_ERR_NO_ELEM (MLX5_OPCODE_NOP, rc_mlx5_ep.c:1648-1652). Coverity therefore models the callee as "writes 0 to *info" — i.e. element.rma.payload.zcopy.iov == NULL. The only protection in the caller is ucs_assert_always(status == UCS_OK) and ucs_assert_always(iovcnt <= 1) (lines 1918-1919); the subsequent branch at line 1920 tests iovcnt != 0, not the pointer, so on the modelled path Coverity reaches iov[i] = element.rma.payload.zcopy.iov[0]; (line 1921) with a null iov and a further deref of iov[i].memh at line 1922. The checker does not correlate iovcnt with iov across the callee's multiple return paths, so a pointer-based guard is required; the code as written gives Coverity no way to prove safety (and relies on asserts for a case — a NOP WQE inside an SGL batch — that is only caught at runtime).

Implicated commit: fa8c5101 "UCT/MLX5: Reuse existing purge parsers for SGL batches" (Leonid Genkin), refined by 9e08ff75 "UCT/MLX5: Preserve original SGL operations during purge" — both on branch sgl-ft/split-uct, HEAD [REDACTED:Hex High Entropy String].

File: src/uct/ib/mlx5/rc/rc_mlx5_ep.c:1921 (guard at 1918-1920; callee model at rc_mlx5_ep.c:1648-1652)

Suggested fix: Make the guard pointer-based and handle the error status as control flow rather than an assertion, e.g.:

const uct_iov_t *src_iov;
...
status = uct_rc_mlx5_op_info_fill(iface, txwq, op, ctrl, *wqe_size,
                                  callback_data, &element);
ucs_assert_always(status == UCS_OK);
ucs_assert_always(element.rma.payload.zcopy.iovcnt <= 1);

src_iov = element.rma.payload.zcopy.iov;
if ((status == UCS_OK) && (element.rma.payload.zcopy.iovcnt != 0) &&
    (src_iov != NULL)) {
    iov[i]      = src_iov[0];
    memh[i]     = *(uct_ib_mem_t*)iov[i].memh;
    iov[i].memh = &memh[i];
} else {
    memset(&iov[i], 0, sizeof(iov[i]));
    iov[i].count = 1;
}

This removes the FORWARD_NULL path and also makes the NOP/UCS_ERR_NO_ELEM case safe in release builds. Re-run the Coverity stage to confirm the defect count returns to 0 (the 56 pre-existing defects are not gating; only the newly introduced one is reported).

Related: none found (no matching issue/PR in this repo); PR #12423 is the change under test.

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id 79523b86-6f69-47c8-9cb5-2c3c2c8d86b1 in the triage console for the audit trail.

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX-OSS/ucx-coverity-oss · commit 02fe6462

TL;DR: The Coverity gate failed on a single new FORWARD_NULL defect at src/uct/ib/mlx5/rc/rc_mlx5_ep.c:1921, where uct_rc_mlx5_op_info_fill_sgl() dereferences element.rma.payload.zcopy.iov on the MLX5_OPCODE_NOP path where uct_rc_mlx5_op_info_fill() only zeroes info and returns UCS_ERR_NO_ELEM; replace the ucs_assert_always(status == UCS_OK) with a non-returning error branch (and/or a NULL-guard on iov).

Full analysis

Summary: ucx-coverity-oss #182 failed in the Coverity and Coverity end stages — cov-format-errors reported nerrors=1, so the pipeline exited non-zero (the same defect is reported in both the release and devel analyses).

Root cause: Coverity's write_zero_model for uct_rc_mlx5_op_info_fill() (rc_mlx5_ep.c:1648, memset(info, 0, sizeof(*info))) plus the MLX5_OPCODE_NOP early return UCS_ERR_NO_ELEM (line 1650-1652) produces a path where element.rma.payload.zcopy.iov == NULL. In uct_rc_mlx5_op_info_fill_sgl() the only protection is ucs_assert_always(status == UCS_OK) and ucs_assert_always(element.rma.payload.zcopy.iovcnt <= 1) (lines 1918-1919). Coverity treats asserts as ordinary conditions it can fall through, so it reaches if (element.rma.payload.zcopy.iovcnt != 0) at line 1920 with iov still NULL and flags iov[0] at line 1921 as an explicit null dereference. The log confirms the build itself was clean ("Emitted 758 C/C++ compilation units (100%) successfully", "The cov-build utility completed successfully"); nothing hung — analysis ran continuously and finished in 9:15.

Implicated commit: 9e08ff7 — "UCT/MLX5: Preserve original SGL operations during purge", Leonid Genkin (2026-11-23T20:06Z, branch sgl-ft/split-uct); the function was introduced/reworked in the fa8c510 / 4dbc460 / 9e08ff7 series.

File: src/uct/ib/mlx5/rc/rc_mlx5_ep.c:1921 (defect site); source of the NULL: src/uct/ib/mlx5/rc/rc_mlx5_ep.c:1648-1652

Suggested fix: Give the failure path an explicitly non-returning exit so Coverity prunes the NOP branch, instead of relying on an assert:

status = uct_rc_mlx5_op_info_fill(iface, txwq, op, ctrl, *wqe_size,
                                  callback_data, &element);
if (status != UCS_OK) {
    ucs_fatal("rc mlx5: unexpected wqe opcode 0x%x in SGL purge: %s",
              uct_ib_mlx5_wqe_opcode(ctrl), ucs_status_string(status));
}
ucs_assert_always(element.rma.payload.zcopy.iovcnt <= 1);
if (element.rma.payload.zcopy.iov != NULL) {   /* instead of iovcnt != 0 */
    iov[i]      = element.rma.payload.zcopy.iov[0];
    ...

ucs_fatal is UCS_F_NORETURN, which eliminates the UCS_ERR_NO_ELEM/all-zeros path, and keying the branch off the pointer (or additionally NULL-checking it) removes the residual iovcnt != 0 && iov == NULL contradiction Coverity cannot prove away. Re-run the coverity job after the change; no suppression/model file edit should be needed.

Related: PR #12423 (branch sgl-ft/split-uct); no existing issue found for this defect signature.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP-DNM Work in progress / Do not review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants