← Back to Pull requests

fix(rccl): keep DDA LL128 AR/AG/RS tier choice rank-uniform under misaligned buffers #16629

Open
PedramAlizadeh opened this pull request with 1141 lines diff across 20 files
View on GitHub
PedramAlizadeh PedramAlizadeh commented on Nov 24, 2026 04:17 UTC
Author

Motivation

On gfx1250, the DDA fabric LL128 tiers for AllReduce (one-shot and two-shot), AllGather and ReduceScatter were eligible only when the calling rank's own sendbuff and recvbuff were 16-byte aligned. Alignment is a property of each rank's buffers, not of the call, so when some ranks passed misaligned buffers and others did not, the ranks chose different algorithms and every rank hung. For example, with 16 ranks, an fp32 AllReduce of 32 MiB and rank 0's buffers offset by 4 bytes, ranks 1-15 log taking DDA fabric LL128 two-shot path while rank 0 takes another path. Broadcast was not affected: its LL128 eligibility uses only the byte count, and each rank picks an aligned or any-address kernel for its own buffers. This PR applies the same approach to the other three collectives. As a result, misaligned buffers are no longer limited to the slower fallback paths: they run LL128 too, with no extra memory.

Technical Details

The LL128 wire is always aligned peer scratch; only the local loads from sendbuff and the stores to recvbuff see the caller's alignment. ddaLL128ArOneShotEligibleCapped, ddaLL128ArTwoShotEligible (dda_all_reduce_fabric_ll.cu), ncclAllGatherDdaFabricLL128Eligible and ncclReduceScatterDdaFabricLL128Eligible no longer check buffer addresses, so eligibility depends only on the message (count, datatype, op, comm) and every rank reaches the same tier. The LL128 kernels (ddaAllReduceFlatLL128, ddaAllReduceFlatLL128PeerPar, ddaAllReduceTwoShotLL128 with both wires, ddaAllReduceTwoShotLL128PeerPar, ddaAllGatherFabricLL128, ddaReduceScatterFabricLL128 and ddaReduceScatterFabricLL128PeerPar) take a bool kAligned = true template parameter. They forward it to the existing ddaLL128LoadRegs/ddaLL128StoreRegs helpers, which, with kAligned=false, use the memcpy-based ddaLL128UserLoad16B/Store16B<false> accessors that the Broadcast one-shot already uses. The AllGather local copy gets the same treatment. Each launcher computes ddaUserBuffers16ByteAligned(sendbuff, recvbuff) and picks the instance through a shared ddaPickAligned helper in CollCommon.h. Aligned ranks run exactly the instances they ran before, and both instances use the same wire format, so a mix of aligned and misaligned ranks works together. The INFO launch lines now print aligned=. On gfx1250 a 16-byte memcpy at align 1 compiles to the same global_load_b128/global_store_b128, so the any-address instance needs no peeling or staging buffer. The extra instances grow librccl.so by about 1.16 MB (+2.3%).

The single-node IPC (non-gfx1250) DDA AllReduce, AllGather, ReduceScatter and AllToAll eligibility checks also use ddaUserBuffers16ByteAligned and have the same mixed-alignment exposure; they need separate hardware to validate and are not changed here.

Issue Tracking

JIRA ID: AICOMRCCL-3999

Test Plan

  • Host microtests (test/host/algorithms/dda):

  • - The AG, RS and AR one-shot/two-shot LL128 eligibility tests now expect misaligned buffers to stay eligible.
    - New kernel-pointer tests check that every LL128 launcher picks the aligned or any-address instance from its own buffers: AR flat, AR two-shot with the coop and async wires, AR PeerPar one-shot and two-shot, AG, and RS batched and PeerPar.
  • Device unit tests (gfx1250, one GPU, a helper kernel plays the peers). All run at offsets 0, 1, 4 and 8 (plus 12 for AG), in place and out of place, and check the result, the guard bytes around the buffer, and the lines every peer unpacks:

  • - The AR PeerPar one-shot and two-shot kernels.
    - The one-warp-per-slice AR one-shot and two-shot kernels.
    - The RS PeerPar kernel.
    - A new DdaAllGatherFabricLL128 test.
  • Fixture tests (DdaFabricEligibilityTests.cpp, Debug): misaligned buffers stay eligible for AG, AR one-shot, AR two-shot and RS.

  • Correctness, multi-node (4 nodes x 4 GPUs = 16 ranks, SPX), develop against this PR, 25 cases:

  • - A rank misaligned by 1, 2 or 4 bytes: rank 0 or rank 5, send-only, recv-only or both, in place and out of place.
    - fp32, bf16 and fp8.
    - AR 4M-128M, AG 1M-256M, RS 4M-256M, and Broadcast and the LL-tier AR as controls.
    - The test fills exact small integers and checks every output element and the bytes just outside the output.
  • Correctness and performance, mixed alignment (1 node, 4 ranks), fp32, 1M-256M, 3 repetitions alternating which build ran first. Five patterns:

  • - All aligned.
    - One rank misaligned.
    - Half the ranks misaligned.
    - Every rank at a different offset, with send and recv offsets differing.
    - All ranks misaligned.
    - Also bf16, fp8 and in-place runs with the varied offsets.
  • Performance, aligned: rccl-tests all_reduce_perf, all_gather_perf and reduce_scatter_perf at 16 ranks:

  • - 1M-32M: 200 iterations, 3 repetitions, rotating which build runs first.
    - 64K-256M: 2 repetitions.

    Test Results

  • Unit tests:

  • - All DDA host microtests pass.
    - All 41 DDA LL128 device tests pass.
    - All 228 DdaFabric
    /DdaIpcEligibility* fixture tests pass.
  • Correctness, multi-node: develop hangs in all 16 mixed-alignment AR, AG and RS cases. With this PR all 25 cases complete with 0 wrong values, and every rank logs the same LL128 path.

  • Mixed alignment: develop hangs on every mixed pattern on 1 node too (AR at 4M, AG at 1M, RS at 4M). With this PR every pattern gives 0 wrong values. In the LL128 band each pattern is within 2-4% of develop's aligned bandwidth, mostly within 1%.

  • Aligned: within run-to-run noise of develop.

  • All misaligned (works on develop through the fallback): up to 4.9x faster at 16 ranks. At 256M, the top of the band, AR and RS are 2.5-3.6% below the fallback.
  • Summary (algbw vs develop with aligned buffers, LL128 band, 1 node, 4 ranks)

    | | develop, all misaligned | one misaligned | half misaligned | every rank a different offset | all misaligned |
    |---|---|---|---|---|---|
    | AllReduce 4M-64M | 0.48-0.86x | 1.00x (develop hangs) | 1.00x (develop hangs) | 0.98-1.00x (develop hangs) | 0.98-1.00x |
    | AllGather 1M-64M | 0.22-0.54x | 0.98-1.00x (develop hangs) | 0.97-1.00x (develop hangs) | 0.98-1.00x (develop hangs) | 0.98-1.00x |
    | ReduceScatter 4M-64M | 0.36-0.83x | 0.98-1.00x (develop hangs) | 0.99-1.04x (develop hangs) | 0.97-1.00x (develop hangs) | 0.96-1.02x |

    Diff: 1141 lines (+843 / -298) across 20 files Reviewer: corey-derochie-amd Review duration: 16068m
    All Vouch review confidence checks passed
    Residual risk 0.07 = Change Risk (0.72) × (1 − Review Confidence (0.90)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.72 · 1141 lines diff across 20 files
    0.72
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.89 · 5 substantive comment(s)
    0.89
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 85%
    90%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.400
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    31 items
    therock-pr-bot[bot] therock-pr-bot[bot] commented on Nov 24, 2026 04:18 UTC
    Bot

    <!-- therock-pr-bot-policy-check -->

    ✅ All Checks Passed — Ready for Review

    | Check | Status | Details |
    |---|:---:|---|
    | 📝 PR Description | ✅ Pass | — |
    | ⛔ Forbidden Files | ✅ Pass | — |
    | 🧪 Unit Test | ✅ Pass | — |
    | 🔎 pre-commit | ✅ Pass | — |
    | 🚫 Draft PR | 🔜 To Be Enabled | — |
    | 🚩 Feature Flag | 🔜 To Be Enabled | — |
    | 📊 Code Coverage | 🔜 To Be Enabled | — |
    | 🤖 therock-pr-bot | ✅ Pass | — |

    🎉 All checks passed! This PR is ready for review.

    📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

    🙋 Wish to Override Policy?

    therock-pr-bot[bot] therock-pr-bot[bot] commented on Nov 24, 2026 04:18 UTC
    Bot

    <!-- therock-pr-bot-fix-policies -->
    🎉 All checks passed! This PR is ready for review.

    amd-argus[bot] amd-argus[bot] commented on Nov 24, 2026 04:33 UTC
    Bot

    @cppccppccppc @sunguobao PTAL

    amd-argus[bot] amd-argus[bot] commented on code on Nov 24, 2026 04:48 UTC
    Code Review
    projects/rccl/src/algorithms/dda/all_gather/dda_all_gather_fabric_ll128.cu:1
    @@ -147,12 +151,10 @@ bool ncclAllGatherDdaFabricLL128Eligible(ncclComm* comm, const void* sendbuff, v
         return false;
       }
       const size_t perRankBytes = sendcount * ncclTypeSize(datatype);
    +  // Buffer alignment is not checked: it differs between ranks, and every rank has to pick the same tier.

    Medium

    With the alignment check gone, four host microtests still expect misaligned buffers to be rejected, and they now get true:

    dda-all-gather-fabric-ll128-test.cc:154-155      AG LL128      0x1008 / 0x2008
    dda-reduce-scatter-fabric-ll128-test.cc:195-196  RS LL128      0x1008
    dda-all-reduce-fabric-ll-test.cc:321-323         AR one-shot   0x1008 / 0x2001
    dda-all-reduce-fabric-ll-test.cc:351-353         AR two-shot   0x1004 / 0x2002
    

    These binaries run in the quick/precheck set (test_categories_micro_dda.yaml). Could we flip them to EXPECT_TRUE, as DdaFabricEligibilityTests.cpp already does?

    amd-argus[bot] amd-argus[bot] commented on code on Nov 24, 2026 04:48 UTC
    Code Review
    projects/rccl/src/algorithms/dda/all_gather/all_gather_dda_fabric_ll128.h:1
    @@ -90,20 +90,30 @@ __launch_bounds__(1024)
         const int eltInSlice =
           rem < (size_t)kDdaLL128DataBytesPerSlice ? (int)rem : kDdaLL128DataBytesPerSlice;
         uint64_t regs[kDdaLL128WordsPerThread];
    -    ddaLL128LoadRegsBatched<int8_t>(regs, srcBytes + dataByte, eltInSlice, lane, flagLane);
    +    ddaLL128LoadRegsBatched<int8_t, kDdaLL128LineElems, kAligned>(regs, srcBytes + dataByte, eltInSlice, lane,
    +                                                                  flagLane);
         ddaLL128StoreWire(
           scatterSlot + s * (size_t)kDdaLL128WireWordsPerSlice + 2 * lane, regs, flag, flagLane);
       }
     
       // Local copy sendbuff -> recvbuff[selfRank].
       {
    -    v4u_gptr s4 = (v4u_gptr)sendbuff;
    -    v4u_gptr d4 = (v4u_gptr)(reinterpret_cast<char*>(recvbuff) + (size_t)selfRank * perRankBytes);
    +    char* const dst = reinterpret_cast<char*>(recvbuff) + (size_t)selfRank * perRankBytes;
         const size_t nVec = perRankBytes >> 4; // 16B chunks
         const size_t gtid = (size_t)flatBlockId * (size_t)nthreads + (size_t)tid;
         const size_t stride = (size_t)total * (size_t)nthreads;
    -    for (size_t i = gtid; i < nVec; i += stride) {
    -      d4[i] = s4[i];
    +    if constexpr (kAligned) {
    +      v4u_gptr s4 = (v4u_gptr)sendbuff;
    +      v4u_gptr d4 = (v4u_gptr)dst;
    +      for (size_t i = gtid; i < nVec; i += stride) {
    +        d4[i] = s4[i];
    +      }
    +    } else {
    +      for (size_t i = gtid; i < nVec; i += stride) {
    +        uint64_t lo, hi;
    +        ddaLL128UserLoad16B<false>(srcBytes + 16 * i, lo, hi);

    Medium

    No device test runs the kAligned=false instances of ddaAllGatherFabricLL128 (including this new local-copy branch), ddaAllReduceFlatLL128 or the non-PeerPar ddaAllReduceTwoShotLL128. Every misaligned AllGather takes this kernel, and capped AllReduce launches (the registered re-routes at rccl_wrap.cc:2157/2167) keep the non-PeerPar kernels (dda_all_reduce_fabric_ll.cu:290). Could the misaligned-offset cases from DdaAllReduceFabricLL128PeerParTests.cpp:450 cover these too?

    amd-argus[bot] amd-argus[bot] commented on code on Nov 24, 2026 04:48 UTC
    Code Review
    projects/rccl/src/algorithms/dda/all_reduce/dda_all_reduce_fabric_ll.cu:1
    @@ -352,16 +366,17 @@ static ncclResult_t ncclAllReduceDdaFabricLL128OneShotTyped(const void* sendbuff
       uint32_t* epochDev = comm->ddaLLEpochDev;
       const int epochLen = comm->ddaLLEpochLen;
     
    +  const bool aligned = dda::common::ddaUserBuffers16ByteAligned(sendbuff, recvbuff);

    Medium

    No test checks which instance the four LL128 launchers pick for misaligned buffers: every host launch test uses 0x1000/0x2000. Hardcoding aligned = true here, at line 413, at dda_all_gather_fabric_ll128.cu:94 or at dda_reduce_scatter_fabric_ll128.cu:138 still passes. Could we add a kernel-pointer case per launcher like dda-broadcast-fabric-ll128-test.cc:424?

    amd-argus[bot] amd-argus[bot] commented on code on Nov 24, 2026 04:48 UTC
    Code Review
    projects/rccl/src/algorithms/dda/all_reduce/dda_all_reduce_fabric_ll.cu:1
    @@ -300,32 +300,46 @@ static std::pair<dim3, dim3> ddaArLL128Geom(const ncclComm* comm, size_t bytes,
                                ddaArLL128SliceThreads(comm, peerPar, cap), cap);
     }
     
    +// The LL128 kernels' user-buffer access: 16B-aligned, or valid at any address. Each rank picks it from its own
    +// buffers; it does not change the wire, so ranks that pick differently still run the same algorithm.

    Low

    The per-rank alignment rationale appears at about ten sites in this PR; one short line suffices here.

    // Picks this rank's aligned or any-address user-buffer instance; both use the same wire format.
    

    amd-argus[bot] amd-argus[bot] commented on Nov 24, 2026 04:48 UTC
    Reviewer

    <!-- argus:v1 pr=16629 sha=bc20f1162e70 mode=review -->

    ARGUS

    Findings

    <details>
    <summary>1 more finding(s), not posted inline</summary>

  • projects/rccl/src/algorithms/dda/all_gather/dda_all_gather_fabric_ll128.cu:111 (Low) AR, RS and AG launchers pick kAligned three different ways; sharing ddaArPickAligned/ddaArPickRanksCt via a header would unify them.
  • </details>

    Impact

    <details>
    <summary>Reaches gfx1250; the PR targets gfx1250; 7 test(s) to run, 7 heatmap cell(s) to measure</summary>

    Only gfx1250 runs this at runtime: the fabric DDA selectors check IsArchMatch("gfx1250") at rccl_wrap.cc:2146 (AllReduce) and 2430 (AllGather), and ReduceScatter's selector at rccl_wrap.cc:2737 is reached only on fabric-enabled comms. The kernels still compile for every build target. On gfx1250, AllReduce (LL128 one-shot and two-shot, PeerPar and capped non-PeerPar), AllGather LL128 and ReduceScatter LL128 (batched and PeerPar) now pick LL128 for misaligned user buffers in every dtype (fp32, fp16, bf16, fp8). Before, those calls went to VMM, CE-registered, Ring or the kernel path. The registered-window re-routes (eager CE-registered and graph-captured Ring) now land on capped one-warp unaligned kernels. The NRANKS_CT=4/8 unaligned instances and single-node comms are outside the PR's 16-rank (4x4) measurements. Aligned callers run the same instances as before. Reaches gfx1250; the PR targets gfx1250.

    Tests that exercise this change

  • rccl-UnitTestsFixturesDebug quick, DdaFabricEligibilityTest.: pins the AR one-shot/two-shot and AG eligibility that no longer reads buffer alignment (projects/rccl/test/test_categories_fixtures_debug.yaml)

  • rccl-UnitTestsFixturesDebug quick, DdaFabricLL128EligibilityTest.: AG and RS LL128 eligibility with misaligned buffers (projects/rccl/test/test_categories_fixtures_debug.yaml)

  • rccl-UnitTests standard, DdaAllReduceFabricLL128PeerPar.: runs the new misaligned-offset PeerPar AR instances on device (projects/rccl/test/test_categories.yaml)

  • rccl-UnitTestsFixtures standard, DdaAllReduceFabricLL128PeerPar.: same device tests in the fixtures binary (projects/rccl/test/test_categories_fixtures.yaml)

  • rccl-UnitTestsMPI standard, DdaFabricBlockCap.: drives capped DDA launches, the non-PeerPar kernels the re-route now picks for misaligned buffers (projects/rccl/test/test_categories_mpi.yaml)

  • rccl-UnitTestsMPI standard_env_dda_fp8_ll128, DdaFp8MPI_LL128.: end-to-end fabric LL128 tier, whose kernels gained the kAligned template parameter (projects/rccl/test/test_categories_mpi.yaml)

  • rccl-UnitTestsMPI standard_env_dda_fp8_ll128_twoshot, DdaFp8MPI_LL128TwoShot.*: forces the LL128 two-shot AR whose kernel selection now takes the aligned flag (projects/rccl/test/test_categories_mpi.yaml)
  • Heatmap cells to measure, baseline against this PR, interleaved A/B

  • gfx1250 all_reduce any/sum, 1 node(s), 2 MiB to 4 MiB (not measured in the heatmap): registered eager re-route band at 4 ranks (4 x 512K-1M shards): misaligned windows now take the capped non-PeerPar unaligned LL128 kernel instead of CE-registered

  • gfx1250 all_reduce any/sum, 1 node(s), 1 MiB to 128 MiB (not measured in the heatmap): misaligned buffers on 4/8-rank comms now run the NRANKS_CT 4/8 unaligned LL128 instances; the PR measured only 16 ranks

  • gfx1250 all_reduce any/sum, 4 node(s), 64 MiB to 256 MiB (not measured in the heatmap): PR reports misaligned LL128 against the old fallback at -3.6% to +17% here; this is the top of the LL128 band

  • gfx1250 all_reduce any/sum, 4 node(s), 8 MiB to 16 MiB (not measured in the heatmap): registered eager re-route band at 16 ranks, now capped unaligned LL128 for misaligned windows

  • gfx1250 all_gather any, 1 node(s), 64 KiB to 128 MiB (not measured in the heatmap): misaligned AG now takes the LL128 &lt;T,4/8,false&gt; instances instead of VMM or the kernel path

  • gfx1250 reduce_scatter any/sum, 1 node(s), 1 MiB to 224 MiB (not measured in the heatmap): misaligned RS now takes the unaligned batched/PeerPar LL128 instances below 8 ranks, unmeasured

  • gfx1250 reduce_scatter any/sum, 4 node(s), 64 MiB to 256 MiB (not measured in the heatmap): PR reports RS misaligned LL128 within -3.6% to +17% of the fallback here
  • </details>

    Bottom line: Worth settling before approval: four host microtests under test/host/algorithms/dda still expect misaligned buffers to be LL128-ineligible and now fail, and no test runs the kAligned=false AllGather, flat AllReduce or non-PeerPar two-shot kernels.

    <sub>Comment <code>@argus review</code> to re-run, or <code>@argus re-review</code> after pushing.</sub>

    PedramAlizadeh PedramAlizadeh commented on code on Nov 24, 2026 06:18 UTC
    Code Review
    projects/rccl/src/algorithms/dda/all_gather/dda_all_gather_fabric_ll128.cu:1
    @@ -147,12 +151,10 @@ bool ncclAllGatherDdaFabricLL128Eligible(ncclComm* comm, const void* sendbuff, v
         return false;
       }
       const size_t perRankBytes = sendcount * ncclTypeSize(datatype);
    +  // Buffer alignment is not checked: it differs between ranks, and every rank has to pick the same tier.

    Agreed, fixed in 6b2df196d8. All four now expect true, the AG and RS tests are renamed, and rccl-UnitTestsMicroDdaAllGatherFabricLl128, ...AllReduceFabricLl and ...ReduceScatterFabricLl128 pass.

    PedramAlizadeh PedramAlizadeh commented on code on Nov 24, 2026 06:18 UTC
    Code Review
    projects/rccl/src/algorithms/dda/all_gather/all_gather_dda_fabric_ll128.h:1
    @@ -90,20 +90,30 @@ __launch_bounds__(1024)
         const int eltInSlice =
           rem < (size_t)kDdaLL128DataBytesPerSlice ? (int)rem : kDdaLL128DataBytesPerSlice;
         uint64_t regs[kDdaLL128WordsPerThread];
    -    ddaLL128LoadRegsBatched<int8_t>(regs, srcBytes + dataByte, eltInSlice, lane, flagLane);
    +    ddaLL128LoadRegsBatched<int8_t, kDdaLL128LineElems, kAligned>(regs, srcBytes + dataByte, eltInSlice, lane,
    +                                                                  flagLane);
         ddaLL128StoreWire(
           scatterSlot + s * (size_t)kDdaLL128WireWordsPerSlice + 2 * lane, regs, flag, flagLane);
       }
     
       // Local copy sendbuff -> recvbuff[selfRank].
       {
    -    v4u_gptr s4 = (v4u_gptr)sendbuff;
    -    v4u_gptr d4 = (v4u_gptr)(reinterpret_cast<char*>(recvbuff) + (size_t)selfRank * perRankBytes);
    +    char* const dst = reinterpret_cast<char*>(recvbuff) + (size_t)selfRank * perRankBytes;
         const size_t nVec = perRankBytes >> 4; // 16B chunks
         const size_t gtid = (size_t)flatBlockId * (size_t)nthreads + (size_t)tid;
         const size_t stride = (size_t)total * (size_t)nthreads;
    -    for (size_t i = gtid; i < nVec; i += stride) {
    -      d4[i] = s4[i];
    +    if constexpr (kAligned) {
    +      v4u_gptr s4 = (v4u_gptr)sendbuff;
    +      v4u_gptr d4 = (v4u_gptr)dst;
    +      for (size_t i = gtid; i < nVec; i += stride) {
    +        d4[i] = s4[i];
    +      }
    +    } else {
    +      for (size_t i = gtid; i < nVec; i += stride) {
    +        uint64_t lo, hi;
    +        ddaLL128UserLoad16B<false>(srcBytes + 16 * i, lo, hi);

    Fixed in 6b2df196d8. New DdaAllGatherFabricLL128.GathersEveryRankAndSendsEveryPeerAtAnyOffset runs ddaAllGatherFabricLL128<int8_t, 4/8/0, true/false>, including the new local-copy branch, at offsets 0/1/4/8/12, in and out of place. DdaAllReduceFabricLL128PeerPar.WarpPerSliceKernelsMatchTheSumAtAnyOffset runs ddaAllReduceFlatLL128 and the cooperative ddaAllReduceTwoShotLL128 at offsets 0/1/4/8, using bf16 integers because those kernels do not fold in rank order. Both check the result, the guard bytes and the lines every peer unpacks.

    PedramAlizadeh PedramAlizadeh commented on code on Nov 24, 2026 06:18 UTC
    Code Review
    projects/rccl/src/algorithms/dda/all_reduce/dda_all_reduce_fabric_ll.cu:1
    @@ -352,16 +366,17 @@ static ncclResult_t ncclAllReduceDdaFabricLL128OneShotTyped(const void* sendbuff
       uint32_t* epochDev = comm->ddaLLEpochDev;
       const int epochLen = comm->ddaLLEpochLen;
     
    +  const bool aligned = dda::common::ddaUserBuffers16ByteAligned(sendbuff, recvbuff);

    Fixed in 6b2df196d8. Added RunLL128_AlignedKernelFrom16ByteOwnBuffersOnly for AR (flat one-shot, coop two-shot, NRANKS_CT 0), RunLL128_StagedWriterAlignedKernelFrom16ByteOwnBuffersOnly for the async wire, the PeerPar fixture variant, and Launch_AlignedKernelFrom16ByteOwnBuffersOnly for AG and RS (batched and PeerPar). Hardcoding aligned = true in any of these launchers now fails a test.

    PedramAlizadeh PedramAlizadeh commented on code on Nov 24, 2026 06:18 UTC
    Code Review
    projects/rccl/src/algorithms/dda/all_reduce/dda_all_reduce_fabric_ll.cu:1
    @@ -300,32 +300,46 @@ static std::pair<dim3, dim3> ddaArLL128Geom(const ncclComm* comm, size_t bytes,
                                ddaArLL128SliceThreads(comm, peerPar, cap), cap);
     }
     
    +// The LL128 kernels' user-buffer access: 16B-aligned, or valid at any address. Each rank picks it from its own
    +// buffers; it does not change the wire, so ranks that pick differently still run the same algorithm.

    Applied, and the comment moved with the helper into CollCommon.h as ddaPickAligned. I kept the one-line notes at the eligibility checks so nobody re-adds the alignment check there, and at the launchers.

    PedramAlizadeh PedramAlizadeh commented on Nov 24, 2026 06:18 UTC
    Author

    Addressed in 6b2df196d8. Also applied the low finding about the launchers picking kAligned three different ways: ddaPickAligned in CollCommon.h is now shared by the AR, AG and RS launchers. I added JIRA ID : AICOMRCCL-3999 to the description for the policy check. @argus re-review

    amd-argus[bot] amd-argus[bot] commented on Nov 24, 2026 06:52 UTC
    Reviewer

    <!-- argus:v1 pr=16629 sha=6b2df196d8fd mode=re-review -->

    ARGUS

    This PR changes 1,141 lines across 20 files. A change this size is hard to review
    well, for a person and for this bot alike: reviewers lose the thread, defects hide in the
    volume, and the feedback arrives too late to be cheap to act on. Splitting it into a
    stacked pull request
    gives each piece a reviewable diff and keeps the history. This review covers the whole change
    regardless.

    Impact

    <details>
    <summary>Reaches gfx1250; the PR targets gfx1250; 8 test(s) to run, 7 heatmap cell(s) to measure</summary>

    Only gfx1250 is reached at runtime. The AllReduce, AllGather and ReduceScatter fabric DDA selectors all check IsArchMatch("gfx1250") (rccl_wrap.cc:2146, 2430, 2725); the kernels still compile for every target. On gfx1250, calls whose own sendbuff/recvbuff are not 16B aligned now take LL128 (AR one-shot/two-shot, PeerPar and capped one-warp; AG; RS batched and PeerPar) through the new kAligned=false instances. Before, they went to LL, VMM, CE-registered or Ring, or they hung when ranks were mixed. Aligned callers get the same template instances as before (kAligned defaults to true and the helpers' aligned branch is unchanged), so the only aligned-side change is library size, about +2.3%. Reaches gfx1250; the PR targets gfx1250.

    Tests that exercise this change

  • rccl-UnitTestsFixturesDebug quick, DdaFabricEligibilityTest.: pins AR one-shot/two-shot and AG LL128 eligibility that no longer reads buffer addresses (projects/rccl/test/test_categories_fixtures_debug.yaml)

  • rccl-UnitTestsFixturesDebug quick, DdaFabricLL128EligibilityTest.: AG and RS LL128 eligibility with misaligned buffers (projects/rccl/test/test_categories_fixtures_debug.yaml)

  • test_categories_micro_dda.yaml quick, DdaAllReduce: host microtests for the AR launchers' aligned/any-address kernel pick (projects/rccl/test/test_categories_micro_dda.yaml)

  • test_categories_micro_dda.yaml quick, DdaAllGather: AG LL128 launcher kernel-pointer and eligibility microtests (projects/rccl/test/test_categories_micro_dda.yaml)

  • test_categories_micro_dda.yaml quick, DdaReduceScatter: RS LL128 batched/PeerPar launcher kernel-pointer and eligibility microtests (projects/rccl/test/test_categories_micro_dda.yaml)

  • rccl-UnitTestsFixtures standard, DdaAllGatherFabricLL128.: new device test runs ddaAllGatherFabricLL128&lt;4/8/0, true/false&gt; at offsets 0/1/4/8/12 (projects/rccl/test/test_categories_fixtures.yaml)

  • rccl-UnitTestsFixtures standard, DdaAllReduceFabricLL128PeerPar.: device tests for the misaligned PeerPar and warp-per-slice AR instances (projects/rccl/test/test_categories_fixtures.yaml)

  • rccl-UnitTestsMPI standard_env_dda_fp8_ll128_twoshot, DdaFp8MPI_LL128TwoShot.: end-to-end LL128 two-shot AR, whose kernel pick now takes the aligned flag (projects/rccl/test/test_categories_mpi.yaml)
  • Heatmap cells to measure, baseline against this PR, interleaved A/B

  • gfx1250 all_reduce any/sum, 2 node(s), 4 MiB to 128 MiB on mi4xx-rccl-scaleup-nightly-dpx (8 GPUs/node), mi4xx-rccl-scaleup-nightly-spx (4 GPUs/node): 8-rank (2-node SPX) misaligned buffers now run the NRANKS_CT=8 unaligned LL128 instances; the PR measured perf only at 4 and 16 ranks

  • gfx1250 all_gather any, 2 node(s), 1 MiB to 256 MiB on mi4xx-rccl-scaleup-nightly-dpx (8 GPUs/node), mi4xx-rccl-scaleup-nightly-spx (4 GPUs/node): misaligned AG at 8 ranks now takes ddaAllGatherFabricLL128&lt;T,8,false&gt; instead of VMM or the kernel path

  • gfx1250 reduce_scatter any/sum, 2 node(s), 4 MiB to 256 MiB on mi4xx-rccl-scaleup-nightly-dpx (8 GPUs/node), mi4xx-rccl-scaleup-nightly-spx (4 GPUs/node): misaligned RS at 8 ranks now takes the unaligned batched/PeerPar LL128 instances, not measured

  • gfx1250 all_reduce float/sum, 4 node(s), 64 MiB to 256 MiB (not measured in the heatmap): top of the LL128 band, where the PR reports all-misaligned AR at 2.5-3.6% below the old fallback

  • gfx1250 reduce_scatter float/sum, 4 node(s), 64 MiB to 256 MiB (not measured in the heatmap): top of the LL128 band, where the PR reports all-misaligned RS at 2.5-3.6% below the old fallback

  • gfx1250 all_reduce any/sum, 1 node(s), 2 MiB to 4 MiB (not measured in the heatmap): registered eager re-route (rccl_wrap.cc:2167-2186): misaligned windows now land on the capped one-warp unaligned LL128 kernel instead of CE-registered

  • gfx1250 all_reduce float/sum, 2 node(s), 1 MiB to 32 MiB on mi4xx-rccl-scaleup-nightly-dpx (8 GPUs/node), mi4xx-rccl-scaleup-nightly-spx (4 GPUs/node): aligned control: same instances as before, so no change is expected; confirms nothing moved from the doubled instance count
  • </details>

    Bottom line: LGTM.

    <sub>Comment <code>@argus review</code> to re-run, or <code>@argus re-review</code> after pushing.</sub>

    amd-argus[bot] amd-argus[bot] commented on code on Nov 24, 2026 06:52 UTC
    Code Review
    projects/rccl/src/algorithms/dda/all_gather/dda_all_gather_fabric_ll128.cu:1
    @@ -147,12 +151,10 @@ bool ncclAllGatherDdaFabricLL128Eligible(ncclComm* comm, const void* sendbuff, v
         return false;
       }
       const size_t perRankBytes = sendcount * ncclTypeSize(datatype);
    +  // Buffer alignment is not checked: it differs between ranks, and every rank has to pick the same tier.

    Resolved by 6b2df196d8.

    amd-argus[bot] amd-argus[bot] commented on code on Nov 24, 2026 06:52 UTC
    Code Review
    projects/rccl/src/algorithms/dda/all_gather/all_gather_dda_fabric_ll128.h:1
    @@ -90,20 +90,30 @@ __launch_bounds__(1024)
         const int eltInSlice =
           rem < (size_t)kDdaLL128DataBytesPerSlice ? (int)rem : kDdaLL128DataBytesPerSlice;
         uint64_t regs[kDdaLL128WordsPerThread];
    -    ddaLL128LoadRegsBatched<int8_t>(regs, srcBytes + dataByte, eltInSlice, lane, flagLane);
    +    ddaLL128LoadRegsBatched<int8_t, kDdaLL128LineElems, kAligned>(regs, srcBytes + dataByte, eltInSlice, lane,
    +                                                                  flagLane);
         ddaLL128StoreWire(
           scatterSlot + s * (size_t)kDdaLL128WireWordsPerSlice + 2 * lane, regs, flag, flagLane);
       }
     
       // Local copy sendbuff -> recvbuff[selfRank].
       {
    -    v4u_gptr s4 = (v4u_gptr)sendbuff;
    -    v4u_gptr d4 = (v4u_gptr)(reinterpret_cast<char*>(recvbuff) + (size_t)selfRank * perRankBytes);
    +    char* const dst = reinterpret_cast<char*>(recvbuff) + (size_t)selfRank * perRankBytes;
         const size_t nVec = perRankBytes >> 4; // 16B chunks
         const size_t gtid = (size_t)flatBlockId * (size_t)nthreads + (size_t)tid;
         const size_t stride = (size_t)total * (size_t)nthreads;
    -    for (size_t i = gtid; i < nVec; i += stride) {
    -      d4[i] = s4[i];
    +    if constexpr (kAligned) {
    +      v4u_gptr s4 = (v4u_gptr)sendbuff;
    +      v4u_gptr d4 = (v4u_gptr)dst;
    +      for (size_t i = gtid; i < nVec; i += stride) {
    +        d4[i] = s4[i];
    +      }
    +    } else {
    +      for (size_t i = gtid; i < nVec; i += stride) {
    +        uint64_t lo, hi;
    +        ddaLL128UserLoad16B<false>(srcBytes + 16 * i, lo, hi);

    Resolved by a later commit.

    amd-argus[bot] amd-argus[bot] commented on code on Nov 24, 2026 06:52 UTC
    Code Review
    projects/rccl/src/algorithms/dda/all_reduce/dda_all_reduce_fabric_ll.cu:1
    @@ -352,16 +366,17 @@ static ncclResult_t ncclAllReduceDdaFabricLL128OneShotTyped(const void* sendbuff
       uint32_t* epochDev = comm->ddaLLEpochDev;
       const int epochLen = comm->ddaLLEpochLen;
     
    +  const bool aligned = dda::common::ddaUserBuffers16ByteAligned(sendbuff, recvbuff);

    Resolved by 6b2df196d8.

    amd-argus[bot] amd-argus[bot] commented on code on Nov 24, 2026 06:53 UTC
    Code Review
    projects/rccl/src/algorithms/dda/all_reduce/dda_all_reduce_fabric_ll.cu:1
    @@ -300,32 +300,46 @@ static std::pair<dim3, dim3> ddaArLL128Geom(const ncclComm* comm, size_t bytes,
                                ddaArLL128SliceThreads(comm, peerPar, cap), cap);
     }
     
    +// The LL128 kernels' user-buffer access: 16B-aligned, or valid at any address. Each rank picks it from its own
    +// buffers; it does not change the wire, so ranks that pick differently still run the same algorithm.

    Resolved by 6b2df196d8.

    github-actions[bot] github-actions[bot] commented on Nov 24, 2026 09:12 UTC
    Bot

    <!-- markdownlint-disable MD013 -->

    pr-rocm-systems-16629-oci-rccl-pr-smoke

    View this job on CoCo

    Builds

    All 15 components built.

    Failures

    No failing tests in this run.

    12 tests skipped.

    Performance regressions

    Thresholds. A reading is marked regressed when its performance drops more than 5% and the change is significant. The run fails when a point drops more than 10% and an adjacent size does too. Performance is bandwidth, or the inverse of latency.

    pr-16629_rccl-perf_rocm-10.2-latest vs rocm-10.2-latest_rccl-develop-perf

    Readings: flat 2070.

    Fails the run: 0 regressed point(s) past 10%, each confirmed by an adjacent size.

    No confirmed regressions or improvements.

    github-actions[bot] github-actions[bot] commented on Nov 24, 2026 09:12 UTC
    Bot

    <!-- markdownlint-disable MD013 -->

    pr-rocm-systems-16629-ruby64-rccl-pr-smoke

    View this job on CoCo

    Builds

    All 15 components built.

    Failures

    No failing tests in this run.

    12 tests skipped.

    Performance regressions

    Thresholds. A reading is marked regressed when its performance drops more than 5% and the change is significant. The run fails when a point drops more than 8% and an adjacent size does too. Performance is bandwidth, or the inverse of latency.

    pr-16629_rccl-perf_rocm-10.2-latest vs rocm-10.2-latest_rccl-develop-perf

    Readings: flat 2070.

    Fails the run: 0 regressed point(s) past 8%, each confirmed by an adjacent size.

    No confirmed regressions or improvements.

    alex-breslow-amd alex-breslow-amd commented on Nov 30, 2026 23:50 UTC
    Reviewer

    High level comment here. If we are supporting misaligned buffers, why not just assume that buffers are misaligned? From your results, it didn't look like there was much a difference in performance from the aligned and misaligned code paths. Let me know if I am missing something here. If the slow path is decently fast, then converging to that path is one less thing we have to maintain.

    More generally, I was unaware that we wanted DDA to support pointers that are not aligned to 16 bytes. If we expanding the scope, can you let me know? If so, we need to make sure it works on all of the DDA code paths.

    alex-breslow-amd alex-breslow-amd commented on code on Nov 30, 2026 23:57 UTC
    Code Review
    projects/rccl/src/algorithms/dda/all_gather/all_gather_dda_fabric_ll128.h:1
    @@ -90,20 +90,30 @@ __launch_bounds__(1024)
         const int eltInSlice =
           rem < (size_t)kDdaLL128DataBytesPerSlice ? (int)rem : kDdaLL128DataBytesPerSlice;
         uint64_t regs[kDdaLL128WordsPerThread];
    -    ddaLL128LoadRegsBatched<int8_t>(regs, srcBytes + dataByte, eltInSlice, lane, flagLane);
    +    ddaLL128LoadRegsBatched<int8_t, kDdaLL128LineElems, kAligned>(regs, srcBytes + dataByte, eltInSlice, lane,
    +                                                                  flagLane);
         ddaLL128StoreWire(
           scatterSlot + s * (size_t)kDdaLL128WireWordsPerSlice + 2 * lane, regs, flag, flagLane);
       }
     
       // Local copy sendbuff -> recvbuff[selfRank].
       {
    -    v4u_gptr s4 = (v4u_gptr)sendbuff;
    -    v4u_gptr d4 = (v4u_gptr)(reinterpret_cast<char*>(recvbuff) + (size_t)selfRank * perRankBytes);
    +    char* const dst = reinterpret_cast<char*>(recvbuff) + (size_t)selfRank * perRankBytes;
         const size_t nVec = perRankBytes >> 4; // 16B chunks
         const size_t gtid = (size_t)flatBlockId * (size_t)nthreads + (size_t)tid;
         const size_t stride = (size_t)total * (size_t)nthreads;
    -    for (size_t i = gtid; i < nVec; i += stride) {
    -      d4[i] = s4[i];
    +    if constexpr (kAligned) {
    +      v4u_gptr s4 = (v4u_gptr)sendbuff;
    +      v4u_gptr d4 = (v4u_gptr)dst;
    +      for (size_t i = gtid; i < nVec; i += stride) {
    +        d4[i] = s4[i];

    You need to be a little bit careful here. For local copies it's fine not to make them device scope if it's a one-time write and the data won't be read by any other WGP. The end of kernel flush should write them to right scope. However, if there's any reuse of this data by any other WGP or even the same WGP in some cases, then you need to be careful here.

    corey-derochie-amd corey-derochie-amd commented on code on Dec 02, 2026 16:29 UTC
    Code Review
    projects/rccl/src/algorithms/dda/reduce_scatter/dda_reduce_scatter_fabric_ll128.cu:1
    @@ -169,6 +180,8 @@ static ncclResult_t ncclReduceScatterDdaFabricLL128Typed(const void* sendbuff, v
     
     bool ncclReduceScatterDdaFabricLL128Eligible(ncclComm* comm, const void* sendbuff, void* recvbuff, size_t recvcount,
                                                  ncclDataType_t datatype, ncclRedOp_t op) {
    +  (void)sendbuff;
    +  (void)recvbuff;

    Nit: Consider whether these functions are required to maintain these unused args, or whether they could just be removed.

    corey-derochie-amd corey-derochie-amd commented on code on Dec 02, 2026 16:38 UTC
    Code Review
    projects/rccl/test/device/DdaAllReduceFabricLL128PeerParTests.cpp:1
    @@ -35,6 +36,8 @@ constexpr size_t kWholeBytes = 40 * kDdaLL128DataBytesPerSlice;
     constexpr uint32_t kFlag = 2;  // epoch cells start at 1, so the kernels use flag 2 and bank 0
     constexpr uint8_t kUntouched = 0xA5;
     constexpr unsigned kMaxGrid = 8;
    +// Room for a user buffer at any byte offset up to a 16B chunk.
    +constexpr size_t kOffsetRoom = 16;

    Consider kOffsetRoomBytes

    corey-derochie-amd corey-derochie-amd commented on code on Dec 02, 2026 16:44 UTC
    Code Review
    projects/rccl/test/device/DdaAllReduceFabricLL128PeerParTests.cpp:1
    @@ -158,7 +174,8 @@ class DdaAllReduceFabricLL128PeerPar : public DeviceTestBase {
         for (DeviceBuffer<uint8_t>& b : scratch_) {
           b.zero();
         }
    -    sendBuf_->copyFrom(send_[(size_t)c_.self]);
    +    HIP_CHECK(hipMemset(sendBuf_->ptr, kUntouched, sendBuf_->count));
    +    HIP_CHECK(hipMemcpy(sendBuf_->ptr + offset_, send_[(size_t)c_.self].data(), messageBytes(c_), hipMemcpyHostToDevice));

    This change makes sense but might warrant a comment.

    corey-derochie-amd corey-derochie-amd commented on code on Dec 02, 2026 16:54 UTC
    Code Review
    projects/rccl/test/device/DdaAllReduceFabricLL128PeerParTests.cpp:1
    @@ -418,6 +456,42 @@ TEST_F(DdaAllReduceFabricLL128PeerPar, Bf16MatchesTheExactSum) {
       }
     }
     
    +// Buffers at any byte offset: the unaligned instance gives the same fold and sends every peer the same lines, so a
    +// rank whose buffers are aligned differently from its peers' still runs their algorithm.
    +TEST_F(DdaAllReduceFabricLL128PeerPar, MisalignedBuffersMatchTheRankOrderFold) {
    +  for (size_t offset : {1, 4, 8}) {
    +    for (const Case& c : {Case{Kind::kOneShot, 3, 2, 0, 2, 512, kPartialBytes},
    +                          Case{Kind::kOneShot, 8, 5, 8, 3, 512, kPartialBytes},
    +                          Case{Kind::kTwoShot, 4, 1, 4, 2, 512, kPartialBytes},
    +                          Case{Kind::kTwoShot, 16, 9, 0, 2, 512, kPartialBytes}}) {
    +      for (bool inPlace : {false, true}) {
    +        SCOPED_TRACE(Describe(c) + ", offset " + std::to_string(offset) + (inPlace ? ", in place" : ""));
    +        const auto send = FloatMessages(c.nRanks, messageBytes(c));
    +        setUp(c, send, FloatRankOrderFold(send), offset);
    +        expectRankOrderFold<float>(inPlace);
    +      }
    +    }
    +  }
    +}
    +
    +// The one-warp-per-slice kernels, aligned and at any byte offset. They do not fold in rank order, so the messages are
    +// bf16 integers, exact in any order.
    +TEST_F(DdaAllReduceFabricLL128PeerPar, WarpPerSliceKernelsMatchTheSumAtAnyOffset) {
    +  for (size_t offset : {0, 1, 4, 8}) {
    +    for (const Case& c : {Case{Kind::kOneShot, 3, 2, 0, 2, 512, kPartialBytes, false},
    +                          Case{Kind::kOneShot, 8, 5, 8, 3, 512, kPartialBytes, false},
    +                          Case{Kind::kTwoShot, 4, 1, 4, 2, 512, kPartialBytes, false},
    +                          Case{Kind::kTwoShot, 16, 9, 0, 2, 512, kPartialBytes, false}}) {
    +      for (bool inPlace : {false, true}) {
    +        SCOPED_TRACE(Describe(c) + ", offset " + std::to_string(offset) + (inPlace ? ", in place" : ""));
    +        const auto send = Bf16IntMessages(c.nRanks, messageBytes(c));
    +        setUp(c, send, Bf16Sum(send), offset);
    +        expectRankOrderFold<bf16>(inPlace);

    Just double-checking the use of expectRankOrderFold here. I think this is fine because it is Sum with integer type, but it is misleading.

    corey-derochie-amd corey-derochie-amd commented on code on Dec 02, 2026 16:57 UTC
    Code Review
    projects/rccl/test/device/DdaReduceScatterFabricLL128PeerParTests.cpp:1
    @@ -35,6 +36,7 @@ constexpr size_t kWholeShardBytes = 40 * kDdaLL128DataBytesPerSlice;
     constexpr uint32_t kFlag = 2;  // epoch cells start at 1, so the kernels use flag 2 and bank 0
     constexpr uint8_t kUntouched = 0xA5;
     constexpr size_t kGuardBytes = 256;  // after recvbuff, so a store past the shard lands here
    +constexpr size_t kOffsetRoom = 16;   // room for a user buffer at any byte offset up to a 16B chunk

    Nit: consider kOffsetRoomBytes

    corey-derochie-amd corey-derochie-amd approved these changes on Dec 03, 2026 14:50 UTC
    Approved Reviewer

    LGTM from code stand-point, all notes are nits.

    corey-derochie-amd corey-derochie-amd commented on Dec 03, 2026 14:52 UTC
    Contributor

    High level comment here. If we are supporting misaligned buffers, why not just assume that buffers are misaligned? From your results, it didn't look like there was much a difference in performance from the aligned and misaligned code paths. Let me know if I am missing something here. If the slow path is decently fast, then converging to that path is one less thing we have to maintain.

    > More generally, I was unaware that we wanted DDA to support pointers that are not aligned to 16 bytes. If we expanding the scope, can you let me know? If so, we need to make sure it works on all of the DDA code paths.

    I was wondering this as well, what is the origin of this requirement?

    corey-derochie-amd corey-derochie-amd commented on code on Dec 03, 2026 14:54 UTC
    Code Review
    projects/rccl/src/algorithms/dda/all_gather/all_gather_dda_fabric_ll128.h:1
    @@ -90,20 +90,30 @@ __launch_bounds__(1024)
         const int eltInSlice =
           rem < (size_t)kDdaLL128DataBytesPerSlice ? (int)rem : kDdaLL128DataBytesPerSlice;
         uint64_t regs[kDdaLL128WordsPerThread];
    -    ddaLL128LoadRegsBatched<int8_t>(regs, srcBytes + dataByte, eltInSlice, lane, flagLane);
    +    ddaLL128LoadRegsBatched<int8_t, kDdaLL128LineElems, kAligned>(regs, srcBytes + dataByte, eltInSlice, lane,
    +                                                                  flagLane);
         ddaLL128StoreWire(
           scatterSlot + s * (size_t)kDdaLL128WireWordsPerSlice + 2 * lane, regs, flag, flagLane);
       }
     
       // Local copy sendbuff -> recvbuff[selfRank].
       {
    -    v4u_gptr s4 = (v4u_gptr)sendbuff;
    -    v4u_gptr d4 = (v4u_gptr)(reinterpret_cast<char*>(recvbuff) + (size_t)selfRank * perRankBytes);
    +    char* const dst = reinterpret_cast<char*>(recvbuff) + (size_t)selfRank * perRankBytes;
         const size_t nVec = perRankBytes >> 4; // 16B chunks
         const size_t gtid = (size_t)flatBlockId * (size_t)nthreads + (size_t)tid;
         const size_t stride = (size_t)total * (size_t)nthreads;
    -    for (size_t i = gtid; i < nVec; i += stride) {
    -      d4[i] = s4[i];
    +    if constexpr (kAligned) {
    +      v4u_gptr s4 = (v4u_gptr)sendbuff;
    +      v4u_gptr d4 = (v4u_gptr)dst;
    +      for (size_t i = gtid; i < nVec; i += stride) {
    +        d4[i] = s4[i];

    This does match the existing code path, however. For this review, I'm less concerned, but should watch out for how this would manifest.

    Assignees
    PedramAlizadeh PedramAlizadeh
    Labels
    risk: low confidence: 90.3% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 71.5% (HIGH) · Higher = larger blast radius
    71.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 90.3% · Lower = rushed or shallow review
    90.3%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 6.9% · Safe to merge
    6.9%