← Back to Pull requests

fix(bazel): match Make library contents (Windows static export-free, Linux DPC without embedded DAAL) #3971

Merged
napetrov merged 19 files (512 lines) on Nov 11, 2026 16:33 UTC
View on GitHub
napetrov napetrov commented on Nov 01, 2026 03:35 UTC
Author

Description

Bazel release packages differed from Make's in link inputs, compile flags, resources and NuGet metadata. This branch makes Bazel match Make; the few remaining differences are listed below with reasons.

Associated issue: #3978 (CI check that fails on /EXPORT: directives in the static libraries; follow-up, not part of this PR).
Documentation / benchmark PRs: none. This is a build and packaging change; no user documentation is affected.

| Difference from Make | Fix | Commit |
|---|---|---|
| Windows static archives carry DLL export defines | Export-free static objects on Windows | 3e7194782 |
| Linux libonedal_dpc.so embeds DAAL and static ILP64 MKL | DPC uses the dal tag only | c26bdf0b2 |
| Linux DPC parameters lib pulls classic VML | VML kept out of the DPC link | c395a7e3a |
| DPC objects compiled with MKL_ILP64 | MKL_LP64 only, as ONEAPI.objs_y.dpc | 0a3c61d5e, c073c1c61 |
| Windows -EHsc on DAAL core too | -EHsc on oneAPI objects (icx); every object (vc) | 3ba3308cb |
| DPC device images not compressed | --offload-compress on Linux DPC links; not on Windows, as Make | e84a06c91, cb492cd73 |
| icx got -fwrapv, -fno-delete-null-pointer-checks (Make: gcc only; icpx -fwrapv) | Per-compiler flags, as Make | 38b07f415 |
| Make compiled _skx.cpp for CPUs not in REQCPU (dead code in libonedal.a) | Makefile skips them, as Bazel (filter on object name, not path) | 2f6b8490a, 05b999604 |
| Windows DLLs without version resource | Make's .rc linked into every DLL; dpc .res before /link | 369a67b79, 0e35761cc |
| libpthread/libdl linking | -lpthread -ldl as Make (no NEEDED on glibc ≥2.34) | dc7e339e0 |
| NuGet .nuspec with placeholders; macOS/ARM64/RISC-V named as x64 | Expanded as prepare_dal_nuget.sh; win-arm64, linux-arm64, linux-riscv64 in rule and script | a98d3e1d3, 9a7759b55, cb492cd73, 9eac68ed2, 0efb3ed77, d1e9bb2cd |

Open differences

  • Windows tbb12.dll/tbbmalloc.dll: Make uses oneTBB from the TBB root, Bazel the PyPI wheel. Owner decision.

  • Linux libonedal_dpc.so .text −261 KB: being attributed.

  • Host GCC 7.5 (Make) vs 8.5 (Bazel). Owner decision.

  • libonedal_dpc.so has no RUNPATH and fewer NEEDED (--as-needed); undefined symbols identical. Accepted.
  • Verification

  • Windows (icx, //:release --config=release-dpc at 0e35761cc): static .lib have 0 /EXPORT: (as Make 2026.2.0); all DLLs incl. onedal_dpc.4.dll link and carry .rsrc with the DPC names.

  • Linux: aquery for per-compiler flags; nuspec ids per --platforms; Make dry-run for skx; glibc 2.39 probe for NEEDED.

  • CI for 925c7a181: 8 checks were still pending when this description was updated; see the checks on the PR. Make and Bazel release runs at 9eac68ed2 completed; the package comparison was in progress.
  • Merge danger

  • Windows static subtree compiles twice (DLL + export-free): more build time and cache.

  • Linux DPC library content changed (no embedded DAAL/MKL); DPC load test advised.

  • NuGet ids for ARM64/RISC-V are new names.
  • ---

    <details>
    <summary>Checklist:</summary>

    Completeness and readability

  • I have commented my code, particularly in hard-to-understand areas.

  • I have updated the documentation to reflect the changes or created a separate PR with updates and provided its number in the description, if necessary. _Build-only change; no user docs affected._

  • Git commit message contains an appropriate signed-off-by string. _Earlier commits on this branch are not rewritten and lack the trailer. Commits added from this point are signed off with Signed-off-by._

  • I have resolved any merge conflicts that might occur with the base branch. _main is merged into the branch; no conflicts._
  • Testing

  • I have run it locally and tested the changes extensively. _See Verification._

  • All CI jobs are green or I have provided justification why they aren't. _Checks were still running at this update; see the PR checks._

  • I have extended testing suite if new functionality was introduced in this PR. _No new functionality; packaging parity with Make._
  • Performance

  • I have provided justification why performance and/or quality metrics have changed or why changes are not expected. _No runtime change is expected: this PR changes build and packaging only (compile and link flags, library contents, NuGet metadata). No runtime code is changed, so no scikit-learn_bench run was made and no performance numbers are reported._
  • </details>

    🤖 Generated with Claude Code

    Diff: 512 lines (+424 / -88) across 19 files Reviewer: napetrov Review duration: 15177m
    All Vouch review confidence checks passed
    Residual risk 0.12 = Change Risk (0.83) × (1 − Review Confidence (0.85)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.83 · 512 lines diff across 19 files
    0.83
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.94 · 5 substantive comment(s)
    0.94
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    84%
    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.373
    Self Review self_review
    0.140
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    40 items
    Copilot Copilot commented on code on Nov 01, 2026 05:43 UTC
    Code Review
    dev/bazel/cc/compile.bzl:1
    @@ -315,6 +316,10 @@ def _compile(name, ctx, toolchain, feature_config, compilation_contexts=[],
             includes = includes,
             system_includes = system_includes,
             quote_includes = quote_includes,
    +        # @mkl//:mkl_static propagates MKL_ILP64 through the DAAL deps, but
    +        # Make compiles DPC objects with MKL_LP64 only (ONEAPI.objs_y.dpc).
    +        drop_defines = ["MKL_ILP64"] if cc_common.is_enabled(
    +            feature_configuration = feature_config, feature_name = "dpc++") else [],

    This also strips MKL_ILP64 from cpp/oneapi/dal/test/engine/mkl:mkl_dpc, whose @mkl//:mkl_core dependency still supplies the ILP64 static interface. Its blas.cpp then passes 32-bit MKL_INT dimensions to GEMM; when resolved to that interface, these calls read 64-bit values from 32-bit objects and can produce incorrect results or crash. Restrict the filtering to LP64-linked targets, preserving ILP64 for this helper, or change its compilation and linkage together.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 01, 2026 05:43 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟡 Changes recommended

    Removing MKL_ILP64 from the ILP64-linked mkl_dpc helper creates an integer-width mismatch in GEMM calls that can cause incorrect results or crashes.

    <details open>
    <summary><strong>1 open issue</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.png" alt="High severity" width="62" height="18" align="texttop"></picture> Preserve ILP64 for the MKL DPC test helper · New

  • </details>

    <details>
    <summary><strong>What changed in this PR</strong></summary>

    This PR brings Bazel release libraries closer to Make’s packaging by separating Windows static compilation from DLL exports and reducing Linux DPC link inputs. The reported DPC parameter-library data growth remains unresolved.

    Changes:

  • Compile Windows static-library dependencies without DAAL and oneDAL export defines.

  • Remove embedded DAAL objects, static MKL archives, and classic VML libraries from Linux DPC link inputs.

  • Filter inherited MKL_ILP64 defines during DPC compilation.
  • | File | Description |
    | ---- | ----------- |
    | dev/​bazel/​deps/​mkl.tpl.BUILD | Removes classic VML libraries from DPC link inputs. |
    | dev/​bazel/​dal.bzl | Omits oneDAL export defines for export-free static builds. |
    | dev/​bazel/​daal.bzl | Omits DAAL export defines while preserving assertion settings. |
    | dev/​bazel/​config/​config.tpl.BUILD | Adds the export-free static-build setting. |
    | dev/​bazel/​cc/​compile.bzl | Filters inherited MKL_ILP64 defines for DPC compilation. |
    | dev/​bazel/​cc.bzl | Adds a Windows static-dependency configuration transition. |
    | cpp/​oneapi/​dal/​BUILD | Removes DAAL and static MKL tags from Linux DPC libraries. |
    </details>

    <sub>Review effort: Balanced</sub>

    coderabbitai[bot] coderabbitai[bot] commented on Nov 01, 2026 05:50 UTC
    Bot

    <!-- coderabbit-ai-generated:v1 -->

    <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
    <!-- review_stack_entry_start -->

    <a href="https://app.coderabbit.ai/change-stack/uxlfoundation/oneDAL/pull/3971?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a>

    <!-- review_stack_entry_end -->
    <!-- This is an auto-generated comment: review paused by coderabbit.ai -->

    [!NOTE]

    ## Reviews paused

    > It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

    > - Last reviewed commit: 83f101d85733112e7a52d5e86415476ffdfb60b0

    - Latest commit, not reviewed: 925c7a181178cbe066337c5dc44274813ada4dcc

    > Use the following commands to manage reviews:

    - @coderabbitai resume to resume automatic reviews.

    - @coderabbitai review to trigger a single review.

    > Use the checkboxes below for quick actions:

    - [ ] <!-- {"checkboxId":"7f6cc2e2-2e4e-497a-8c31-c9e4573e93d1"} --> Resume reviews

    - [ ] <!-- {"checkboxId":"e9bb8d72-00e8-4f67-9cb2-caf3b22574fe"} --> Trigger review

    <!-- end of auto-generated comment: review paused by coderabbit.ai -->
    <!-- walkthrough_start -->

    <details>
    <summary><strong>Summary</strong></summary>
    <dl>
    <dd>
    <br>

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

    Summary by CodeRabbit

    Build Improvements
    Linux dynamic DPC builds use a reduced set of link tags.
    Windows static-library builds compile dependencies without export annotations.
    DPC library builds use LP64 settings, while the DPC MKL test helper retains ILP64.
    Dynamic MKL builds no longer include VML libraries in their shared-library sources.
    DPC-specific link options and updated exception-handling settings are applied to relevant builds.
    Linux compiler and linker settings have been updated.
    Windows dynamic libraries can include configured resource information.
    Packaging
    NuGet metadata is generated for development, redistributable, and static distributions with platform-specific details.
    Linux ARM64 and RISC-V 64-bit, and Windows ARM64, are recognized for packaging.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->
    The changes update Bazel compilation and linking, Windows resource handling, and Linux toolchain settings. They add platform-specific NuGet nuspec generation and package mappings, extend RISC-V64 detection, and filter unselected CPU-specific sources in Make.

    Changes: Bazel compilation and linking

    |Layer / File(s)|Summary|
    |:---|:---|
    |Export settings and DPC compile defines <br> dev/bazel/config/config.tpl.BUILD, dev/bazel/cc.bzl, dev/bazel/daal.bzl, dev/bazel/dal.bzl, dev/bazel/cc/compile.bzl, dev/bazel/tests/
    , .ci/pipeline/ci.yml|A Windows static-library setting controls export defines in dependencies. DPC library modules can remove inherited MKL_ILP64 defines. The aquery test checks the compile defines for the DPC library and test helper, and CI runs the test.|
    |Windows dynamic-library resources <br> dev/bazel/cc.bzl, dev/bazel/daal.bzl, dev/bazel/dal.bzl, cpp/daal/BUILD, dev/bazel/toolchains/tools/dpc_link_win.ps1|Windows dynamic-library rules compile configured resource scripts and pass the resulting resources to link actions. DAL and DAAL targets provide resource settings. The Windows DPC link script reorders resource arguments.|
    |DPC links and compiler toolchains <br> cpp/oneapi/dal/BUILD, dev/bazel/dal.bzl, dev/bazel/deps/mkl.tpl.BUILD, dev/bazel/toolchains/cc_toolchain_lnx.bzl, dev/bazel/flags.bzl, dev/bazel/cc/compile.bzl|DPC targets add offload compression and change platform-specific tags and link options. Linux toolchain probing, link libraries, compiler flags, and MKL runtime sources also change.|

    NuGet platform package generation

    |Layer / File(s)|Summary|
    |:---|:---|
    |Generate distribution-specific nuspec files <br> BUILD, dev/bazel/scripts.bzl|The release targets generate devel, redist, and static nuspec files from a template. The generator selects platform identifiers and substitutes distribution descriptions and version components.|
    |NuGet platform and architecture mappings <br> deploy/nuget/prepare_dal_nuget.sh, dev/make/identify_os.sh|The package script accepts an explicit platform and adds Linux ARM64, Linux RISC-V64, and Windows ARM64 mappings. Linux OS detection recognizes RISC-V64.|

    Make CPU-specific source selection

    |Layer / File(s)|Summary|
    |:---|:---|
    |Filter unavailable CPU-specific sources <br> makefile|The CPU population step excludes NRH, HSW, and SKX source files when their CPUs are not selected.|

    <!-- change_assessment_start -->

    Estimated code review effort: 4 (Complex) | ~50 minutes

    <!-- change_assessment_commit:"83f101d85733112e7a52d5e86415476ffdfb60b0" -->
    <!-- change_assessment_priority:{"version":1,"urgency":"p2","manual":false} -->
    Change: Bug fix
    <!-- change_assessment_end -->

    Possibly related issues

  • uxlfoundation/oneDAL#3530: The changes cover parts of the tracked Make parity scope, including Bazel linkage, compiler behavior, and package metadata.
  • Suggested labels: dpc++, infrastructure

    </dd>
    </dl>
    </details>

    <!-- walkthrough_end -->
    <details>
    <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-normal-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Moderate</strong> · up to <code>83f10</code></summary>
    <dl>
    <dd>
    <br>

    <!-- final_review_risk_start -->
    <!-- final_review_risk_label
    Merge Risk: 🟡 Moderate · up to 83f10
    -->
    <!-- final_review_risk_coverage:{"sourceCommitId":"83f101d85733112e7a52d5e86415476ffdfb60b0","coveredCommitId":"83f101d85733112e7a52d5e86415476ffdfb60b0","kind":"reviewed"} -->

    NuGet packages for Linux ARM64, Linux RISC-V64 and Windows ARM64 can contain the wrong library types, and Windows ARM64 redist packages omit import libraries. Fix the suffix selection and the import-library guard in the NuGet preparation script before merging. The makefile CPU filter is a narrower edge case that only affects a work directory whose path contains an excluded CPU suffix.
    <!-- final_review_risk_end -->

    </dd>
    </dl>
    </details>
    <!-- pre_merge_checks_walkthrough_start -->

    <details>
    <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 3</strong></summary>
    <dl>
    <dd>
    <br>

    | Check name | Status | Explanation |
    | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Linked Issues check | !Passed | Check skipped because no linked issues were found for this pull request. |
    | Out of Scope Changes check | !Passed | Check skipped because no linked issues were found for this pull request. |
    | Description check | !Passed | The description gives a comprehensive account of the changes, associated issue, open differences, verification, merge risks, and checklist status. It explains why documentation and performance work ar… |

    <details>
    <summary><strong>Full details: Description check</strong></summary>
    <dl>
    <dd>
    <br>

    Explanation

    The description gives a comprehensive account of the changes, associated issue, open differences, verification, merge risks, and checklist status. It explains why documentation and performance work are not applicable. CI checks and some commit sign-offs remain incomplete, but the description identifies these gaps and is mostly complete.

    </dd>
    </dl>
    </details>

    </dd>
    </dl>
    </details>

    <!-- pre_merge_checks_walkthrough_end -->
    <!-- autopilot:start -->

  • <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

  • <!-- autopilot:end -->
    <!-- tips_start -->

    Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

    <details>
    <summary><strong>Share</strong></summary>
    <dl>
    <dd>
    <br>

  • X

  • Mastodon

  • Reddit

  • LinkedIn
  • </dd>
    </dl>
    </details>

    <!-- tips_end -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 01, 2026 05:50 UTC
    Code Review
    dev/bazel/cc.bzl:1
    @@ -399,6 +425,18 @@ cc_static_lib = rule(
     )
     
     
    +def cc_static_lib(name, **kwargs):
    +    # Windows static archives are built export-free (see the transition above);
    +    # Linux archives are not, so Linux keeps exactly the configuration it had.
    +    _cc_static_lib(
    +        name = name,
    +        static_export_free = select({
    +            "@platforms//os:windows": True,
    +            "//conditions:default": False,
    +        }),

    <!-- coderabbit-ai-generated:v1 -->

    <picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/amber-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minor · Maintainability & Code Quality · Quick win

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details.svg" width="16" height="16" align="absmiddle" alt=""></picture> Supported by static analysis</summary>
    <dl>
    <dd>

    Script executed:

    # Read-only inspection. Bounded output.
    sed -n '1,30p' AGENTS.md || true
    echo "--- windows references in dev/bazel and workflows ---"
    rg -n -i -F -e 'windows' -- dev/bazel .github/workflows | head -n 150 || test "$?" -eq 1
    echo "--- archive inspection or export tooling ---"
    rg -n -F -e 'dumpbin' -e 'llvm-nm' -e 'llvm-ar' -e 'lib.exe' -e '/EXPORT' -e 'EXPORT:' -- dev .github | head -n 80 || test "$?" -eq 1
    echo "--- bazel test targets under dev/bazel ---"
    rg -n -F -e 'cc_test' -e 'dal_test_suite' -e 'sh_test' -e 'py_test' -- dev/bazel | head -n 80 || test "$?" -eq 1
    echo "--- static_export_free usages ---"
    rg -n -F -e 'static_export_free' -- dev cpp | head -n 60 || test "$?" -eq 1
    

    Repository: uxlfoundation/oneDAL

    Length of output: 25003

    ---

    </dd>
    </dl>
    </details>

    Add a regression check for /EXPORT: directives in Windows static archives.

    AGENTS.md requires that a bug fix comes with a test that fails without the fix. This change alters the contents of Windows static archives through the static_export_free transition, but it adds no test that inspects the archive. The Linux probe in the PR does not exercise the Windows artifact.

    Add a Windows-only check that reads the static archive and fails when it contains /EXPORT: directives. The Windows CI already runs dumpbin on binaries (.github/workflows/ci-win.yml:153), so the tool is available there. Run the check in a Windows build or test step that consumes the cc_static_lib output.

    <!-- cr-indicator-types:potential_issue -->

    <!-- cr-comment:v1:364faf71fd903f121ee28110 -->

    <!-- This is an auto-generated reply by CodeRabbit -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 01, 2026 05:50 UTC
    Code Review
    dev/bazel/cc/compile.bzl:1
    @@ -315,6 +316,10 @@ def _compile(name, ctx, toolchain, feature_config, compilation_contexts=[],
             includes = includes,
             system_includes = system_includes,
             quote_includes = quote_includes,
    +        # @mkl//:mkl_static propagates MKL_ILP64 through the DAAL deps, but
    +        # Make compiles DPC objects with MKL_LP64 only (ONEAPI.objs_y.dpc).
    +        drop_defines = ["MKL_ILP64"] if cc_common.is_enabled(
    +            feature_configuration = feature_config, feature_name = "dpc++") else [],

    <!-- coderabbit-ai-generated:v1 -->

    <picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/amber-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minor · Functional Correctness · Quick win

    Add a regression test for the DPC define filter.

    Add a Bazel regression test or action-query assertion that fails before this fix. Verify that a dpc++ compile receives MKL_LP64 without MKL_ILP64. Also verify that host compilation remains unchanged. The repository requires bug fixes to include a test that fails without the fix.

    <!-- fingerprinting:phantom:triton:caracal -->

    <!-- cr-indicator-types:potential_issue -->

    <!-- cr-comment:v1:a6efc5a357de59ea4dbd9181 -->

    _Source: Coding guidelines_

    <!-- This is an auto-generated reply by CodeRabbit -->

    ✅ Confirmed as addressed by @napetrov

    <!-- This is an auto-generated reply by CodeRabbit -->

    coderabbitai[bot] coderabbitai[bot] commented on Nov 01, 2026 05:51 UTC
    Reviewer

    <!-- coderabbit-ai-generated:v1 -->

    Actionable comments posted: 2

    ---

    <details>
    <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="16" height="16" align="absmiddle" alt=""></picture> Review info</summary>
    <dl>
    <dd>

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</summary>
    <dl>
    <dd>

  • Source mode: Auto

  • Repository: Unavailable

  • Branch: Unavailable

  • File: No configuration file from this repository applied

  • Commit: Unavailable

  • Layers: Organization UI

  • Review profile: CHILL

  • Plan: Advanced

  • Run ID: f9f1a27d-2635-4368-8a60-d1c4f653acaa
  • </dd>
    </dl>
    </details>

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</summary>
    <dl>
    <dd>

    Reviewing files that changed from the base of the PR and between a898f914202955d4286bef71f36f5d1c5ccd174b and 0a3c61d5e3fb23e21d131f6eaaab069f476f8ca6.

    </dd>
    </dl>
    </details>

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 7</summary>
    <dl>
    <dd>

    cpp/oneapi/dal/BUILD
    dev/bazel/cc.bzl
    dev/bazel/cc/compile.bzl
    dev/bazel/config/config.tpl.BUILD
    dev/bazel/daal.bzl
    dev/bazel/dal.bzl

  • dev/bazel/deps/mkl.tpl.BUILD
  • </dd>
    </dl>
    </details>

    Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

    </dd>
    </dl>
    </details>

    <!-- This is an auto-generated comment by CodeRabbit for review status -->

    <!-- coderabbit-review-publication v1 publication=90e8a4be-552f-4c03-b462-38056688f97b attempt=87691cac-c1dc-44d0-8d95-15ade489cc1c batch=1/1 -->

    napetrov napetrov commented on code on Nov 01, 2026 18:20 UTC
    Code Review
    dev/bazel/cc/compile.bzl:1
    @@ -315,6 +316,10 @@ def _compile(name, ctx, toolchain, feature_config, compilation_contexts=[],
             includes = includes,
             system_includes = system_includes,
             quote_includes = quote_includes,
    +        # @mkl//:mkl_static propagates MKL_ILP64 through the DAAL deps, but
    +        # Make compiles DPC objects with MKL_LP64 only (ONEAPI.objs_y.dpc).
    +        drop_defines = ["MKL_ILP64"] if cc_common.is_enabled(
    +            feature_configuration = feature_config, feature_name = "dpc++") else [],

    <!-- pr-address: PRRT_kwDOA0Yky86yXrDm answer accept -->
    Fixed in c073c1c61: the filter now skips the ILP64 test helper.

    napetrov napetrov commented on code on Nov 01, 2026 18:20 UTC
    Code Review
    dev/bazel/cc/compile.bzl:1
    @@ -315,6 +316,10 @@ def _compile(name, ctx, toolchain, feature_config, compilation_contexts=[],
             includes = includes,
             system_includes = system_includes,
             quote_includes = quote_includes,
    +        # @mkl//:mkl_static propagates MKL_ILP64 through the DAAL deps, but
    +        # Make compiles DPC objects with MKL_LP64 only (ONEAPI.objs_y.dpc).
    +        drop_defines = ["MKL_ILP64"] if cc_common.is_enabled(
    +            feature_configuration = feature_config, feature_name = "dpc++") else [],

    <!-- pr-address: PRRT_kwDOA0Yky86yXtdR answer accept -->
    Added dpc_mkl_defines_test.sh in 0ecab4da7, run in the analysis-only CI step.

    napetrov napetrov commented on code on Nov 01, 2026 18:20 UTC
    Code Review
    dev/bazel/cc.bzl:1
    @@ -399,6 +425,18 @@ cc_static_lib = rule(
     )
     
     
    +def cc_static_lib(name, **kwargs):
    +    # Windows static archives are built export-free (see the transition above);
    +    # Linux archives are not, so Linux keeps exactly the configuration it had.
    +    _cc_static_lib(
    +        name = name,
    +        static_export_free = select({
    +            "@platforms//os:windows": True,
    +            "//conditions:default": False,
    +        }),

    <!-- pr-address: PRRT_kwDOA0Yky86yXtdP ask asked -->
    Waiting on a decision before I change this: the /EXPORT: check only runs on a Windows build, and this box has no MSVC toolchain. Option A: a dumpbin /directives step on the cc_static_lib output in ci-win.yml, in this PR. Option B: a follow-up issue. Recommend B, since it needs Windows CI. Thread stays open until then.

    napetrov napetrov commented on Nov 01, 2026 18:20 UTC
    Author

    <!-- pr-address: PRR_kwDOA0Yky88AAAABVVW8sw answer already-fixed -->
    Already fixed in c073c1c61, same claim as that thread.

    <!-- pr-address: PRR_kwDOA0Yky88AAAABVVX91A answer already-fixed -->
    Already fixed in 0ecab4da7, same request as that thread.

    <!-- pr-address: IC_kwDOA0Yky88AAAABhqe1hw answer already-fixed -->
    Already fixed in c073c1c61 and 0ecab4da7, as in those threads.

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 01, 2026 18:20 UTC
    Code Review
    dev/bazel/cc.bzl:1
    @@ -399,6 +425,18 @@ cc_static_lib = rule(
     )
     
     
    +def cc_static_lib(name, **kwargs):
    +    # Windows static archives are built export-free (see the transition above);
    +    # Linux archives are not, so Linux keeps exactly the configuration it had.
    +    _cc_static_lib(
    +        name = name,
    +        static_export_free = select({
    +            "@platforms//os:windows": True,
    +            "//conditions:default": False,
    +        }),

    <!-- coderabbit-ai-generated:v1 -->

    @napetrov Option B is reasonable for the automated regression check. Deferring the check does not verify the Windows artifact; Windows build and consumer validation remain outstanding.

    Would you like me to open a follow-up issue, assigned to you, for a Windows CI check that runs dumpbin /directives on the cc_static_lib output and fails on /EXPORT: directives? The check should fail without the fix and pass with it.

    This finding remains open.

    <sub><i>You are interacting with an AI system.</i></sub>

    <!-- This is an auto-generated reply by CodeRabbit -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 01, 2026 18:20 UTC
    Code Review
    dev/bazel/cc/compile.bzl:1
    @@ -315,6 +316,10 @@ def _compile(name, ctx, toolchain, feature_config, compilation_contexts=[],
             includes = includes,
             system_includes = system_includes,
             quote_includes = quote_includes,
    +        # @mkl//:mkl_static propagates MKL_ILP64 through the DAAL deps, but
    +        # Make compiles DPC objects with MKL_LP64 only (ONEAPI.objs_y.dpc).
    +        drop_defines = ["MKL_ILP64"] if cc_common.is_enabled(
    +            feature_configuration = feature_config, feature_name = "dpc++") else [],

    <!-- coderabbit-ai-generated:v1 -->

    @napetrov Thanks for adding dpc_mkl_defines_test.sh in 0ecab4da7 and including it in the analysis-only CI step. This addresses the regression-test request.

    ---

    <details>
    <summary>Learnings used</summary>
    <dl>
    <dd>

    Learnt from: CR
    Repo: uxlfoundation/oneDAL PR: 0
    File: CONTRIBUTING.md:0-0
    Timestamp: 2026-10-21T08:00:58.826Z
    Learning: Applicability reference:
    AGENTS.md: # AGENTS.md - oneDAL
    ## Further Reading
    - `CONTRIBUTING.md`, `INSTALL.md`
    
    Source excerpt:
    # How to Contribute
    
    ## Pull Requests
    
    To contribute your changes directly to the repository, do the following:
    - Product uses bazel for validation and your changes should pass tests. Please add new tests as necessary. [Bazel Guide for oneDAL](https://github.com/uxlfoundation/oneDAL/tree/main/dev/bazel)
    

    </dd>
    </dl>
    </details>

    ---

    <!-- This is an auto-generated comment: tweet message by coderabbit.ai -->

    If you found this review helpful, would you consider giving us a shout-out on X?

    Thank you for using CodeRabbit!

    <!-- end of auto-generated comment: tweet message by coderabbit.ai -->

    Review thread resolved.

    <sub><i>You are interacting with an AI system.</i></sub>

    <!-- This is an auto-generated reply by CodeRabbit -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 01, 2026 19:52 UTC
    Code Review
    cpp/oneapi/dal/BUILD:1
    @@ -113,6 +113,9 @@ dal_static_lib(
     dal_dynamic_lib(
         name = "dynamic",
         lib_name = "onedal",
    +    # Make passes --offload-compress to the DPC link of this library
    +    # (makefile:821, LOPT). Host links do not get it.
    +    dpc_linkopts = ["--offload-compress"],

    <!-- coderabbit-ai-generated:v1 -->

    <picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major · Stability & Availability · Quick win

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details.svg" width="16" height="16" align="absmiddle" alt=""></picture> Supported by static analysis</summary>
    <dl>
    <dd>

    Web query:

    Do the oldest oneAPI DPC++ compiler versions supported by oneDAL accept --offload-compress for SYCL shared-library links, and do their distributed compiler binaries include zstd support?

    Result:

    Sources consulted:
    - oneDAL/INSTALL.md at main · uxlfoundation/oneDAL · GitHub — https://github.com/uxlfoundation/oneDAL/blob/main/INSTALL.md
    - GitHub - intel/llvm: Intel staging area for llvm.org contribution. Home for Intel LLVM-based projects. · GitHub — https://github.com/intel/llvm
    - Users Manual — oneAPI DPC++ Compiler documentation — https://intel.github.io/llvm/UsersManual.html
    - Getting Started with oneAPI DPC++ — oneAPI DPC++ Compiler documentation — https://intel.github.io/llvm/GetStartedGuide.html
    - …and 82 more
    

    ---

    Script executed:

    set -o pipefail
    printf '%s\n' '--- diff ---'
    git diff --no-ext-diff --unified=40 cac0203942cc88966648cb0b4c92c34c31c6a181 81a68eeecd9e98f8291ffd401bf5e6a803d9e512 -- cpp/oneapi/dal/BUILD dev/bazel/README.md MODULE.bazel .github 2>&1
    printf '%s\n' '--- BUILD target context ---'
    nl -ba cpp/oneapi/dal/BUILD | sed -n '70,145p'
    printf '%s\n' '--- DPC link option definitions/usages ---'
    rg -n -F --glob '!*build*' --glob '!node_modules' -e 'dpc_linkopts' -e 'dynamic_parameters' -e 'offload-compress' dev cpp MODULE.bazel .github 2>/dev/null || test "$?" -eq 1
    printf '%s\n' '--- compiler/version requirements ---'
    rg -n -i --glob '!node_modules' --glob '!*build*' -e 'icpx' -e 'dpc\+\+' -e 'oneapi.*compiler' -e 'compiler.*version' -e 'minimum.*version' -e 'version.*minimum' -e 'zstd' dev .github MODULE.bazel README.md INSTALL.md 2>/dev/null || test "$?" -eq 1
    

    Repository: uxlfoundation/oneDAL

    Length of output: 41555

    ---

    Script executed:

    printf '%s\n' '--- Linux toolchain probe ---'
    nl -ba dev/bazel/toolchains/cc_toolchain_lnx.bzl | sed -n '150,215p'
    printf '%s\n' '--- shared compiler setup and version detection ---'
    nl -ba dev/bazel/toolchains/cc_toolchain.bzl | sed -n '1,115p'
    printf '%s\n' '--- Windows DPC link configuration ---'
    nl -ba dev/bazel/toolchains/cc_toolchain_config_win.bzl | sed -n '390,430p'
    nl -ba dev/bazel/toolchains/cc_toolchain_config_win.bzl | sed -n '660,710p'
    printf '%s\n' '--- Bazel documentation around compiler capability and release DPC ---'
    nl -ba dev/bazel/README.md | sed -n '125,180p'
    nl -ba dev/bazel/README.md | sed -n '960,1015p'
    

    Repository: uxlfoundation/oneDAL

    Length of output: 19919

    ---

    </dd>
    </dl>
    </details>

    Gate --offload-compress separately from new-driver selection.

    The Linux probe tests --offload-compress, but a failed probe returns only an empty --offload-new-driver flag list. It does not remove the unconditional dpc_linkopts entry. An icpx build without zstd support can therefore still receive --offload-compress and fail both DPC library links.

    Gate --offload-compress on the probe result, or require a zstd-enabled compiler. Apply the same handling to dynamic_parameters.

    <!-- cr-indicator-types:potential_issue -->

    <!-- cr-comment:v1:cd0255c0fca006fa1c9f80cd -->

    <!-- This is an auto-generated reply by CodeRabbit -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 01, 2026 19:52 UTC
    Code Review
    dev/bazel/dal.bzl:1
    @@ -150,14 +150,18 @@ def dal_static_lib(name, lib_name, dal_deps=[], host_deps=[],
     
     def dal_dynamic_lib(name, lib_name, dal_deps=[], host_deps=[],
                         dpc_deps=[], dpc_host_deps=[], extra_deps=[], lib_tags=["dal"],
    -                    dpc_lib_tags=None, features=[], **kwargs):
    +                    dpc_lib_tags=None, dpc_linkopts=[], features=[], **kwargs):
         cc_dynamic_lib(
             name = name,
             lib_name = lib_name,
             lib_tags = lib_tags,
             deps = dal_deps + extra_deps + host_deps,
             **kwargs
         )
    +    # `dpc_linkopts` go to the DPC library only. Make puts its DPC-only link
    +    # options on LOPT of those targets (e.g. makefile:821, 851).
    +    dpc_kwargs = dict(kwargs)
    +    dpc_kwargs["linkopts"] = kwargs.get("linkopts", []) + dpc_linkopts

    <!-- coderabbit-ai-generated:v1 -->

    <picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/amber-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minor · Functional Correctness · Quick win

    Pass DPC driver options before /link on Windows.

    cpp/oneapi/dal/BUILD passes --offload-compress here. The Windows toolchain emits user_link_flags after /link, so the driver cannot enable compression and the linker receives the option instead. Windows DPC images therefore remain uncompressed. Route driver options before /link. (raw.githubusercontent.com)

    <!-- cr-indicator-types:potential_issue -->

    <!-- cr-comment:v1:181cc8ff0e164f14eead3f31 -->

    <!-- This is an auto-generated reply by CodeRabbit -->

    ✅ Confirmed as addressed by @napetrov

    <!-- This is an auto-generated reply by CodeRabbit -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 01, 2026 19:52 UTC
    Code Review
    dev/bazel/flags.bzl:1
    @@ -55,14 +55,12 @@ lnx_cc_flags = {
     win_icx_common_flags = [
         "-nologo",
         "-WX",
    -    # C++ exception handling. The Makefile passes `-EHsc` for every oneAPI
    -    # object on Windows (makefile:152, used at makefile:692/704/717); without
    -    # it clang-cl defaults to exceptions disabled and any `throw` in
    -    # cpp/oneapi/dal/detail/common.hpp is a hard error. This used to be
    -    # supplied implicitly as a side effect of `-Qopenmp-simd` (which turns on
    -    # -fexceptions in clang), so it only surfaced once that flag became
    -    # release-runtime-only. Pass it explicitly instead of relying on that.
    -    "-EHsc",
    +    # No `-EHsc` here, on purpose. Make adds it only to the oneAPI objects

    <!-- coderabbit-ai-generated:v1 -->

    <picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major · Stability & Availability · Quick win

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details.svg" width="16" height="16" align="absmiddle" alt=""></picture> Supported by static analysis</summary>
    <dl>
    <dd>

    Script executed:

    rg -n -C 5 'name = "threading_tbb"|_setNumberOfThreads\s*\(' cpp/daal
    

    Repository: uxlfoundation/oneDAL

    Length of output: 4378

    ---

    Script executed:

    set -o pipefail
    printf '%s\n' '--- diff from merge base ---'
    git diff --unified=20 cac0203942cc88966648cb0b4c92c34c31c6a181 81a68eeecd9e98f8291ffd401bf5e6a803d9e512 -- dev/bazel/flags.bzl cpp/daal/BUILD cpp/daal/src/threading/threading.cpp cpp/daal/src/externals/core_threading_win_dll.cpp
    printf '%s\n' '--- flags.bzl relevant declarations ---'
    nl -ba dev/bazel/flags.bzl | sed -n '1,150p'
    printf '%s\n' '--- daal.bzl module implementation ---'
    rg -n -F -- 'def daal_module' dev/bazel
    nl -ba dev/bazel/daal.bzl | sed -n '1,260p'
    printf '%s\n' '--- threading function and nearby helpers ---'
    nl -ba cpp/daal/src/threading/threading.cpp | sed -n '70,155p'
    printf '%s\n' '--- threading_tbb BUILD block ---'
    nl -ba cpp/daal/BUILD | sed -n '180,225p'
    printf '%s\n' '--- direct callers ---'
    rg -n -C 8 -F -- '_setNumberOfThreads(' cpp | head -240
    

    Repository: uxlfoundation/oneDAL

    Length of output: 34127

    ---

    Script executed:

    set -o pipefail
    printf '%s\n' '--- module and compile flag assembly ---'
    rg -n -C 8 -F -- 'def cc_module' dev/bazel
    rg -n -C 12 -e 'get_default_flags' -e 'win_icx_flags' -e 'win_clang_flags' -e 'EHsc' dev/bazel
    printf '%s\n' '--- complete relevant cc module implementation ---'
    nl -ba dev/bazel/cc.bzl | sed -n '1,280p'
    printf '%s\n' '--- dal module implementation ---'
    rg -n -C 12 -F -- 'def dal_module' dev/bazel/dal.bzl dev/bazel
    printf '%s\n' '--- all setNumberOfThreads references ---'
    rg -n -C 8 -F -- 'setNumberOfThreads' cpp | sed -n '1,320p'
    printf '%s\n' '--- all exception handling around threading calls ---'
    rg -n -C 8 -e 'catch\s*\(' -e 'try\s*\{' cpp/oneapi cpp/daal | rg -n -C 4 'thread|Thread|setNumber|global_control|catch|try' | sed -n '1,260p'
    

    Repository: uxlfoundation/oneDAL

    Length of output: 42627

    ---

    Script executed:

    printf '%s\n' '--- cc_module and compiler flag assembly ---'
    rg -n -C 12 -e 'def cc_module' -e 'get_default_flags' -e 'EHsc' dev/bazel
    printf '%s\n' '--- complete cc.bzl module block ---'
    nl -ba dev/bazel/cc.bzl | sed -n '1,260p'
    printf '%s\n' '--- complete dal.bzl module block ---'
    nl -ba dev/bazel/dal.bzl | sed -n '1,180p'
    printf '%s\n' '--- setNumberOfThreads callers ---'
    rg -n -C 8 -F -- 'setNumberOfThreads' cpp
    

    Repository: uxlfoundation/oneDAL

    Length of output: 42490

    ---

    Web query:

    Clang-cl /EHsc or -EHsc exception handling stack unwinding destructors when exception crosses a function compiled without the option

    Result:

    Sources consulted:
    - /EH (Exception handling model) | Microsoft Learn — https://learn.microsoft.com/en-us/cpp/build/reference/eh-exception-handling-model?view=msvc-170
    - Compiler Warning (level 1) C4530 | Microsoft Learn — https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4530?view=msvc-160
    - Clang Compiler User’s Manual - Clang — https://clang.llvm.org/docs/UsersManual.html
    - clang - the Clang C, C++, and Objective-C compiler - Clang — https://clang.llvm.org/docs/CommandGuide/clang.html?highlight=ofast
    - LLVM IR Generation for EH and Cleanups - Clang — https://clang.llvm.org/docs/LLVMExceptionHandlingCodeGen.html
    - …and 10 more
    

    ---

    </dd>
    </dl>
    </details>

    Restore exception handling for threading_tbb.

    threading_tbb uses daal_module, so it does not receive the -EHsc added by dal_module. _setNumberOfThreads holds tbb::spin_mutex::scoped_lock while new tbb::global_control(...) can throw. If a caller catches the allocation exception and retries, missing unwind cleanup can leave the mutex locked and block later thread-setting calls.

    Add the compiler-specific exception-unwind option to threading_tbb for the Windows icx and clang-cl configurations.

    <!-- cr-indicator-types:potential_issue -->

    <!-- cr-comment:v1:42d924afcb4a7edd8fdf5c4d -->

    <!-- This is an auto-generated reply by CodeRabbit -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 01, 2026 19:52 UTC
    Code Review
    dev/bazel/scripts.bzl:1
    @@ -128,6 +128,82 @@ def generate_cmake_config(name, template, out, **kwargs):
             **kwargs
         )
     
    +# ---------------------------------------------------------------------------
    +# NuGet nuspec
    +# ---------------------------------------------------------------------------
    +
    +# Content summary per distribution type, as in deploy/nuget/prepare_dal_nuget.sh.
    +_NUSPEC_CONTENT = {
    +    "redist": "dynamic libraries and headers",
    +    "devel": "dynamic and static libraries and headers",
    +    "static": "static libraries and headers",
    +}
    +
    +def _generate_nuspec_impl(ctx):
    +    """Expand deploy/nuget/inteldal.nuspec.tpl as prepare_dal_nuget.sh does.
    +
    +    The script maps the Linux platform to `linux` (TBB `linux`) and the Windows
    +    platform to `win-x64` (TBB `win`), then runs one `sed` over the template.
    +    Both the Linux and the Windows file come from this rule; `release_extra_file`
    +    picks which one to stage on which OS.
    +    """
    +    vi = ctx.attr._version_info[VersionInfo]
    +    # identify_os.sh gives mac32e on macOS, which prepare_dal_nuget.sh maps to
    +    # osx-x64 / osx (its `elif` branch for mac32e).
    +    if ctx.target_platform_has_constraint(ctx.attr._windows_constraint[platform_common.ConstraintValueInfo]):
    +        platform, tbb_platform = "win-x64", "win"

    <!-- coderabbit-ai-generated:v1 -->

    <picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major · Data Integrity & Integration · Heavy lift

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details.svg" width="16" height="16" align="absmiddle" alt=""></picture> Supported by static analysis</summary>
    <dl>
    <dd>

    Script executed:

    sed -n 125,210p dev/bazel/scripts.bzl
    rg -n -i 'arm64|aarch64' dev/bazel/config dev/bazel/release.bzl BUILD deploy/nuget | head -n 60
    

    Repository: uxlfoundation/oneDAL

    Length of output: 4847

    ---

    Script executed:

    set -eu
    printf '%s\n' '--- generate_nuspec callers and release definitions ---'
    rg -n -F --glob '*.bzl' -e 'generate_nuspec' -e 'release_extra_file' -e 'release_' dev/bazel
    printf '%s\n' '--- release.bzl ---'
    sed -n '1,280p' dev/bazel/release.bzl
    printf '%s\n' '--- config.tpl.BUILD Windows targets ---'
    sed -n '145,205p' dev/bazel/config/config.tpl.BUILD
    printf '%s\n' '--- nuspec template ---'
    nl -ba deploy/nuget/inteldal.nuspec.tpl | sed -n '1,220p'
    

    Repository: uxlfoundation/oneDAL

    Length of output: 24219

    ---

    Script executed:

    set -eu
    printf '%s\n' '--- all nuspec callers and related package targets ---'
    rg -n -F --glob '!bazel-*' -e 'generate_nuspec' -e 'inteldal.nuspec' -e 'prepare_dal_nuget' -e 'win-x64' -e 'winarm' .
    printf '%s\n' '--- release architecture helper ---'
    sed -n '175,220p' dev/bazel/config/config.bzl
    printf '%s\n' '--- release staging implementation ---'
    sed -n '280,330p' dev/bazel/release.bzl
    sed -n '480,575p' dev/bazel/release.bzl
    sed -n '735,875p' dev/bazel/release.bzl
    printf '%s\n' '--- release/package BUILD context ---'
    find . -path '*/BUILD' -o -path '*/BUILD.bazel' | sort | xargs grep -n -E 'generate_nuspec|release_extra_file|nuspec|release\(' 2>/dev/null || true
    printf '%s\n' '--- Make-side nuspec mapping ---'
    rg -n -F -e 'winarm' -e 'win-x64' -e 'osx-x64' -e 'prepare_dal_nuget' deploy/nuget makefile* dev/make 2>/dev/null || true
    

    Repository: uxlfoundation/oneDAL

    Length of output: 24065

    ---

    Script executed:

    set -eu
    printf '%s\n' '--- root BUILD nuspec and release declarations ---'
    nl -ba BUILD | sed -n '70,225p'
    printf '%s\n' '--- NuGet platform selection and Windows-specific staging ---'
    nl -ba deploy/nuget/prepare_dal_nuget.sh | sed -n '50,165p'
    printf '%s\n' '--- Windows ARM64 documentation and release constraints ---'
    nl -ba dev/bazel/README.md | sed -n '920,955p'
    nl -ba dev/bazel/README.md | sed -n '1025,1060p'
    rg -n -i -F -e 'nuget' -e 'ARM64' -e 'winarm' --glob '*.md' --glob '*.sh' --glob 'BUILD' --glob '*.bzl' . | head -n 160
    

    Repository: uxlfoundation/oneDAL

    Length of output: 29103

    ---

    </dd>
    </dl>
    </details>

    Reject nuspec generation for Windows ARM64.

    windows_arm64 reaches generate_nuspec because the rule checks only the Windows constraint. It then emits the win-x64 package identity, while the release libraries are staged under lib/ARM64 and redist/ARM64. The nuspec template includes this value in the package ID. This can produce an x64-named package containing ARM64 binaries.

    The Make NuGet script has no ARM64 mapping. Reject this unsupported combination unless an explicit ARM64 package identity and matching staging layout are defined.

    <details>
    <summary>Suggested guard</summary>
    <dl>
    <dd>

         if ctx.target_platform_has_constraint(ctx.attr._windows_constraint[platform_common.ConstraintValueInfo]):
    +        if ctx.target_platform_has_constraint(ctx.attr._aarch64_constraint[platform_common.ConstraintValueInfo]):
    +            fail("NuGet nuspec generation is unsupported for Windows ARM64")
             platform, tbb_platform = "win-x64", "win"
    @@
             "_windows_constraint": attr.label(
                 default = "@platforms//os:windows",
             ),
    +        "_aarch64_constraint": attr.label(
    +            default = "@platforms//cpu:aarch64",
    +        ),
    

    </dd>
    </dl>
    </details>

    <!-- fingerprinting:phantom:medusa:beignet55 -->

    <!-- cr-indicator-types:potential_issue -->

    <!-- cr-comment:v1:dcd3153a6ed03217a7db6116 -->

    <!-- This is an auto-generated reply by CodeRabbit -->

    ✅ Confirmed as addressed by @napetrov

    <!-- This is an auto-generated reply by CodeRabbit -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 01, 2026 19:52 UTC
    Code Review
    dev/bazel/toolchains/cc_toolchain_lnx.bzl:1
    @@ -159,7 +159,9 @@ def _get_gcc_toolchain_path(repo_ctx, cc):
         return str(gcc.dirname.dirname.realpath) if gcc else None
     
     def _add_gcc_toolchain_if_needed(repo_ctx, cc):
    -    gcc_toolchain = _get_gcc_toolchain_path(repo_ctx, cc) if ("clang" in cc) or ("icpx" in cc) else None
    +    # Pin icx to the same gcc as icpx (the one on PATH), as Make does. Without it, icx's cc
    +    # actions fall back to icx's default gcc lookup, which can be a different install.
    +    gcc_toolchain = _get_gcc_toolchain_path(repo_ctx, cc) if ("clang" in cc) or ("icx" in cc) or ("icpx" in cc) else None

    <!-- coderabbit-ai-generated:v1 -->

    <picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/amber-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minor · Functional Correctness · Quick win

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details.svg" width="16" height="16" align="absmiddle" alt=""></picture> Supported by static analysis</summary>
    <dl>
    <dd>

    Script executed:

    sed -n 100,200p dev/bazel/toolchains/cc_toolchain_lnx.bzl
    

    Repository: uxlfoundation/oneDAL

    Length of output: 5011

    ---

    </dd>
    </dl>
    </details>

    Derive the GCC prefix from the resolved gcc path.

    _get_gcc_toolchain_path takes the parent of the unresolved gcc path before it resolves symlinks. If gcc on PATH is a symlink into a different installation, the returned prefix is the symlink's grandparent directory, not the GCC installation. The --gcc-toolchain value that _add_gcc_toolchain_if_needed passes to icx, icpx, and clang then points at the wrong location. This can select a libstdc++ that does not match the compiler, or fail to find GCC headers and libraries if that directory has no GCC installation. Resolve the executable first, then take its prefix.

    <details>
    <summary>Suggested fix</summary>
    <dl>
    <dd>

    -    return str(gcc.dirname.dirname.realpath) if gcc else None
    +    return str(gcc.realpath.dirname.dirname) if gcc else None
    

    </dd>
    </dl>
    </details>

    <!-- fingerprinting:phantom:medusa:beignet55 -->

    <!-- cr-indicator-types:potential_issue -->

    <!-- cr-comment:v1:209a6a087192da1450ee722b -->

    <!-- This is an auto-generated reply by CodeRabbit -->

    coderabbitai[bot] coderabbitai[bot] commented on Nov 01, 2026 19:52 UTC
    Reviewer

    <!-- coderabbit-ai-generated:v1 -->

    Actionable comments posted: 5

    ---

    <details>
    <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="16" height="16" align="absmiddle" alt=""></picture> Review info</summary>
    <dl>
    <dd>

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</summary>
    <dl>
    <dd>

  • Source mode: Auto

  • Repository: Unavailable

  • Branch: Unavailable

  • File: No configuration file from this repository applied

  • Commit: Unavailable

  • Layers: Organization UI

  • Review profile: CHILL

  • Plan: Advanced

  • Run ID: 78ac5aa2-1dce-41ce-85fc-680b22e25281
  • </dd>
    </dl>
    </details>

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</summary>
    <dl>
    <dd>

    Reviewing files that changed from the base of the PR and between 6f1d55ed0b25c4ec332b7fcf134b1c7979128fae and 81a68eeecd9e98f8291ffd401bf5e6a803d9e512.

    </dd>
    </dl>
    </details>

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 11</summary>
    <dl>
    <dd>

    .ci/pipeline/ci.yml
    BUILD
    cpp/oneapi/dal/BUILD
    dev/bazel/cc.bzl
    dev/bazel/cc/compile.bzl
    dev/bazel/dal.bzl
    dev/bazel/flags.bzl
    dev/bazel/scripts.bzl
    dev/bazel/tests/BUILD
    dev/bazel/tests/dpc_mkl_defines_test.sh

  • dev/bazel/toolchains/cc_toolchain_lnx.bzl
  • </dd>
    </dl>
    </details>

    Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

    </dd>
    </dl>
    </details>

    <!-- This is an auto-generated comment by CodeRabbit for review status -->

    <!-- coderabbit-review-publication v1 publication=978ce454-943b-4d29-bbab-de89dc315c8a attempt=e59febff-844b-4ea9-b879-de5056a6015b batch=1/1 -->

    coderabbitai[bot] coderabbitai[bot] commented on Nov 01, 2026 20:11 UTC
    Reviewer

    <!-- coderabbit-ai-generated:v1 -->

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/brush-cleaning-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/brush-cleaning.svg" width="16" height="16" align="absmiddle" alt=""></picture> Nitpick comments: 1</summary><blockquote>
    <dl>
    <dd>

    <details>
    <summary>dev/bazel/toolchains/cc_toolchain_lnx.bzl: 1</summary><blockquote>
    <dl>
    <dd>

    178-192: <picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/neutral-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Trivial · Stability & Availability · Heavy lift

    Validate all flags in a real DPC link.

    The probe checks only --offload-new-driver and --offload-compress. The success path also adds -Xsycl-target-backend=spir64 and -ftarget-register-alloc-mode=pvc:-ze-intel-enable-auto-large-GRF-mode to DPC link actions. Run both DPC shared-library links and a device-image load test because either additional flag can fail outside the probe.

    <!-- cr-comment:v1:0c72f23c130feb81fa5e9a62 -->

    </dd>
    </dl>
    </blockquote></details>

    </dd>
    </dl>
    </blockquote></details>

    ---

    <details>
    <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="16" height="16" align="absmiddle" alt=""></picture> Review info</summary>
    <dl>
    <dd>

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</summary>
    <dl>
    <dd>

  • Source mode: Auto

  • Repository: Unavailable

  • Branch: Unavailable

  • File: No configuration file from this repository applied

  • Commit: Unavailable

  • Layers: Organization UI

  • Review profile: CHILL

  • Plan: Advanced

  • Run ID: 710b6286-84dc-4946-979c-cae5b2327242
  • </dd>
    </dl>
    </details>

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</summary>
    <dl>
    <dd>

    Reviewing files that changed from the base of the PR and between 81a68eeecd9e98f8291ffd401bf5e6a803d9e512 and 270252cd406cb406abf31707095f2e279232d207.

    </dd>
    </dl>
    </details>

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 1</summary>
    <dl>
    <dd>

  • dev/bazel/toolchains/cc_toolchain_lnx.bzl
  • </dd>
    </dl>
    </details>

    Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

    </dd>
    </dl>
    </details>

    <!-- This is an auto-generated comment by CodeRabbit for review status -->

    <!-- coderabbit-review-publication v1 publication=a0225dda-e183-4892-b2a2-3e6ef79cf1aa attempt=b4dffdd9-1105-48be-92e8-b7a8ab7bb3c2 batch=1/1 -->

    napetrov napetrov commented on code on Nov 02, 2026 18:20 UTC
    Code Review
    cpp/oneapi/dal/BUILD:1
    @@ -113,6 +113,9 @@ dal_static_lib(
     dal_dynamic_lib(
         name = "dynamic",
         lib_name = "onedal",
    +    # Make passes --offload-compress to the DPC link of this library
    +    # (makefile:821, LOPT). Host links do not get it.
    +    dpc_linkopts = ["--offload-compress"],

    <!-- pr-address: PRRT_kwDOA0Yky86yd2Nq answer push-back -->
    Make does the same. --offload-compress goes on every DPC library link unconditionally (makefile:824), and only --offload-new-driver is probe-gated (makefile:836). Gating it here would diverge from Make, so it stays.

    napetrov napetrov commented on code on Nov 02, 2026 18:20 UTC
    Code Review
    dev/bazel/dal.bzl:1
    @@ -150,14 +150,18 @@ def dal_static_lib(name, lib_name, dal_deps=[], host_deps=[],
     
     def dal_dynamic_lib(name, lib_name, dal_deps=[], host_deps=[],
                         dpc_deps=[], dpc_host_deps=[], extra_deps=[], lib_tags=["dal"],
    -                    dpc_lib_tags=None, features=[], **kwargs):
    +                    dpc_lib_tags=None, dpc_linkopts=[], features=[], **kwargs):
         cc_dynamic_lib(
             name = name,
             lib_name = lib_name,
             lib_tags = lib_tags,
             deps = dal_deps + extra_deps + host_deps,
             **kwargs
         )
    +    # `dpc_linkopts` go to the DPC library only. Make puts its DPC-only link
    +    # options on LOPT of those targets (e.g. makefile:821, 851).
    +    dpc_kwargs = dict(kwargs)
    +    dpc_kwargs["linkopts"] = kwargs.get("linkopts", []) + dpc_linkopts

    <!-- pr-address: PRRT_kwDOA0Yky86yd2Nr ask asked -->
    Waiting on a decision before I change this: Make sends no compression flag on Windows (common.mk:142-144 drops LOPT there). Options: (A) drop it on Windows DPC links, matching Make (recommended); (B) move it before /link, which turns compression on, unlike Make; (C) leave it. Not testable here. Thread stays open until you pick.

    napetrov napetrov commented on code on Nov 02, 2026 18:20 UTC
    Code Review
    dev/bazel/flags.bzl:1
    @@ -55,14 +55,12 @@ lnx_cc_flags = {
     win_icx_common_flags = [
         "-nologo",
         "-WX",
    -    # C++ exception handling. The Makefile passes `-EHsc` for every oneAPI
    -    # object on Windows (makefile:152, used at makefile:692/704/717); without
    -    # it clang-cl defaults to exceptions disabled and any `throw` in
    -    # cpp/oneapi/dal/detail/common.hpp is a hard error. This used to be
    -    # supplied implicitly as a side effect of `-Qopenmp-simd` (which turns on
    -    # -fexceptions in clang), so it only surfaced once that flag became
    -    # release-runtime-only. Pass it explicitly instead of relying on that.
    -    "-EHsc",
    +    # No `-EHsc` here, on purpose. Make adds it only to the oneAPI objects

    <!-- pr-address: PRRT_kwDOA0Yky86yd2Nt answer push-back -->
    Make compiles threading without -EHsc: it is added only to the oneAPI objects (makefile:711, 723, 736), as flags.bzl:60 says. Adding it would diverge from Make, so the flags stay.

    napetrov napetrov commented on code on Nov 02, 2026 18:20 UTC
    Code Review
    dev/bazel/scripts.bzl:1
    @@ -128,6 +128,82 @@ def generate_cmake_config(name, template, out, **kwargs):
             **kwargs
         )
     
    +# ---------------------------------------------------------------------------
    +# NuGet nuspec
    +# ---------------------------------------------------------------------------
    +
    +# Content summary per distribution type, as in deploy/nuget/prepare_dal_nuget.sh.
    +_NUSPEC_CONTENT = {
    +    "redist": "dynamic libraries and headers",
    +    "devel": "dynamic and static libraries and headers",
    +    "static": "static libraries and headers",
    +}
    +
    +def _generate_nuspec_impl(ctx):
    +    """Expand deploy/nuget/inteldal.nuspec.tpl as prepare_dal_nuget.sh does.
    +
    +    The script maps the Linux platform to `linux` (TBB `linux`) and the Windows
    +    platform to `win-x64` (TBB `win`), then runs one `sed` over the template.
    +    Both the Linux and the Windows file come from this rule; `release_extra_file`
    +    picks which one to stage on which OS.
    +    """
    +    vi = ctx.attr._version_info[VersionInfo]
    +    # identify_os.sh gives mac32e on macOS, which prepare_dal_nuget.sh maps to
    +    # osx-x64 / osx (its `elif` branch for mac32e).
    +    if ctx.target_platform_has_constraint(ctx.attr._windows_constraint[platform_common.ConstraintValueInfo]):
    +        platform, tbb_platform = "win-x64", "win"

    <!-- pr-address: PRRT_kwDOA0Yky86yd2Nx ask asked -->
    Waiting on a decision before I change this: the bot is right, generate_nuspec emits win-x64 for Windows ARM64 (scripts.bzl:146-150). Make has no ARM64 NuGet case (prepare_dal_nuget.sh exits 1 on an unknown platform). Options: (A) fail for ARM64, as Make does (recommended); (B) skip the nuspec for ARM64. Thread stays open until you pick.

    napetrov napetrov commented on code on Nov 02, 2026 18:20 UTC
    Code Review
    dev/bazel/toolchains/cc_toolchain_lnx.bzl:1
    @@ -159,7 +159,9 @@ def _get_gcc_toolchain_path(repo_ctx, cc):
         return str(gcc.dirname.dirname.realpath) if gcc else None
     
     def _add_gcc_toolchain_if_needed(repo_ctx, cc):
    -    gcc_toolchain = _get_gcc_toolchain_path(repo_ctx, cc) if ("clang" in cc) or ("icpx" in cc) else None
    +    # Pin icx to the same gcc as icpx (the one on PATH), as Make does. Without it, icx's cc
    +    # actions fall back to icx's default gcc lookup, which can be a different install.
    +    gcc_toolchain = _get_gcc_toolchain_path(repo_ctx, cc) if ("clang" in cc) or ("icx" in cc) or ("icpx" in cc) else None

    <!-- pr-address: PRRT_kwDOA0Yky86yd2N0 answer push-back -->
    Make resolves the same way: makefile:97 takes realpath of the parent of the unresolved gcc directory. The suggested realpath before dirname would diverge from Make for a symlinked gcc, so it stays.

    napetrov napetrov commented on code on Nov 02, 2026 18:20 UTC
    Code Review
    dev/bazel/cc.bzl:1
    @@ -399,6 +425,18 @@ cc_static_lib = rule(
     )
     
     
    +def cc_static_lib(name, **kwargs):
    +    # Windows static archives are built export-free (see the transition above);
    +    # Linux archives are not, so Linux keeps exactly the configuration it had.
    +    _cc_static_lib(
    +        name = name,
    +        static_export_free = select({
    +            "@platforms//os:windows": True,
    +            "//conditions:default": False,
    +        }),

    <!-- pr-address: PRRT_kwDOA0Yky86yXtdP ask asked -->
    Waiting on a decision before I change this: you asked whether to open the Windows dumpbin /directives check as a follow-up issue. My recommendation is yes (option B, a follow-up), since it needs Windows CI. Reply A (this PR) or B and I will do it. This thread stays open until then.

    napetrov napetrov commented on code on Nov 02, 2026 18:20 UTC
    Code Review
    dev/bazel/cc/compile.bzl:1
    @@ -315,6 +316,10 @@ def _compile(name, ctx, toolchain, feature_config, compilation_contexts=[],
             includes = includes,
             system_includes = system_includes,
             quote_includes = quote_includes,
    +        # @mkl//:mkl_static propagates MKL_ILP64 through the DAAL deps, but
    +        # Make compiles DPC objects with MKL_LP64 only (ONEAPI.objs_y.dpc).
    +        drop_defines = ["MKL_ILP64"] if cc_common.is_enabled(
    +            feature_configuration = feature_config, feature_name = "dpc++") else [],

    <!-- pr-address: PRRT_kwDOA0Yky86yXtdR answer push-back -->
    Covered: dpc_mkl_defines_test.sh (0ecab4da7) is the regression test, run in the analysis-only CI step. No change this round.

    napetrov napetrov commented on Nov 02, 2026 18:20 UTC
    Author

    <!-- pr-address: PRR_kwDOA0Yky88AAAABVYjRIg#1 answer push-back -->
    Probed here: icx shared links with the new-driver and compress flags, and with the backend and GRF flags added, both exit 0. Make uses the same flags under the same gate (makefile:836-837). A device-image load needs a GPU, so not here.

    <!-- pr-address: PRR_kwDOA0Yky88AAAABVYfTZA answer push-back -->
    Summary only: its five actionable comments are the threads above, each answered in its thread.

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 02, 2026 18:21 UTC
    Code Review
    dev/bazel/cc.bzl:1
    @@ -399,6 +425,18 @@ cc_static_lib = rule(
     )
     
     
    +def cc_static_lib(name, **kwargs):
    +    # Windows static archives are built export-free (see the transition above);
    +    # Linux archives are not, so Linux keeps exactly the configuration it had.
    +    _cc_static_lib(
    +        name = name,
    +        static_export_free = select({
    +            "@platforms//os:windows": True,
    +            "//conditions:default": False,
    +        }),

    <!-- coderabbit-ai-generated:v1 -->

    @napetrov B — open a follow-up issue. The Windows CI check should run dumpbin /directives on the cc_static_lib output and fail on /EXPORT: directives. Verify that the check fails without the fix and passes with it.

    Keep this thread open. Deferring the regression check does not replace the outstanding Windows build and consumer validation.

    <sub><i>You are interacting with an AI system.</i></sub>

    <!-- This is an auto-generated reply by CodeRabbit -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 02, 2026 18:21 UTC
    Code Review
    dev/bazel/scripts.bzl:1
    @@ -128,6 +128,82 @@ def generate_cmake_config(name, template, out, **kwargs):
             **kwargs
         )
     
    +# ---------------------------------------------------------------------------
    +# NuGet nuspec
    +# ---------------------------------------------------------------------------
    +
    +# Content summary per distribution type, as in deploy/nuget/prepare_dal_nuget.sh.
    +_NUSPEC_CONTENT = {
    +    "redist": "dynamic libraries and headers",
    +    "devel": "dynamic and static libraries and headers",
    +    "static": "static libraries and headers",
    +}
    +
    +def _generate_nuspec_impl(ctx):
    +    """Expand deploy/nuget/inteldal.nuspec.tpl as prepare_dal_nuget.sh does.
    +
    +    The script maps the Linux platform to `linux` (TBB `linux`) and the Windows
    +    platform to `win-x64` (TBB `win`), then runs one `sed` over the template.
    +    Both the Linux and the Windows file come from this rule; `release_extra_file`
    +    picks which one to stage on which OS.
    +    """
    +    vi = ctx.attr._version_info[VersionInfo]
    +    # identify_os.sh gives mac32e on macOS, which prepare_dal_nuget.sh maps to
    +    # osx-x64 / osx (its `elif` branch for mac32e).
    +    if ctx.target_platform_has_constraint(ctx.attr._windows_constraint[platform_common.ConstraintValueInfo]):
    +        platform, tbb_platform = "win-x64", "win"

    <!-- coderabbit-ai-generated:v1 -->

    @napetrov Choose A: fail nuspec generation for Windows ARM64. This matches the Make behavior you described and prevents an ARM64 package from receiving the win-x64 identity.

    In dev/bazel/scripts.bzl:

  • Add _aarch64_constraint with @platforms//cpu:aarch64.

  • Inside the Windows branch, check that constraint and call fail("NuGet nuspec generation is unsupported for Windows ARM64").

  • Leave the other platform mappings unchanged.
  • Before closing this thread, verify that Windows ARM64 nuspec generation fails with that message and Windows x64 still emits win-x64. The finding remains open pending the change and verification.

    ---

    <details>
    <summary>Learnings used</summary>
    <dl>
    <dd>

    Learnt from: CR
    Repo: uxlfoundation/oneDAL PR: 0
    File: dev/AGENTS.md:0-0
    Timestamp: 2026-10-21T08:00:37.071Z
    Learning: Applicability reference:
    AGENTS.md: # AGENTS.md - oneDAL
    ## Directory Guides
    - [dev/AGENTS.md](dev/AGENTS.md): Development tools and build system context
    
    deploy/AGENTS.md: # Deployment and Distribution - AI Agents Context
    ## 📖 Further Reading
    - **[dev/AGENTS.md](../dev/AGENTS.md)** - Development tools context
    
    dev/bazel/AGENTS.md: # Bazel Build System - AI Agents Context
    ## 📖 Further Reading
    - **[dev/AGENTS.md](../AGENTS.md)** - Development tools context
    
    Source excerpt:
    # AGENTS.md - Development Tools and Build Systems (dev/)
    
    ## Rules for Changes
    
    - A build change usually has to land in both Make and Bazel. Library versions, exports and symbol visibility must match between them.
    

    </dd>
    </dl>
    </details>

    <sub><i>You are interacting with an AI system.</i></sub>

    <!-- This is an auto-generated reply by CodeRabbit -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 02, 2026 18:21 UTC
    Code Review
    cpp/oneapi/dal/BUILD:1
    @@ -113,6 +113,9 @@ dal_static_lib(
     dal_dynamic_lib(
         name = "dynamic",
         lib_name = "onedal",
    +    # Make passes --offload-compress to the DPC link of this library
    +    # (makefile:821, LOPT). Host links do not get it.
    +    dpc_linkopts = ["--offload-compress"],

    <!-- coderabbit-ai-generated:v1 -->

    @napetrov Agreed. Keeping --offload-compress unconditional matches Make and this PR’s parity objective. My recommendation would introduce a Bazel-only difference, so I withdraw this finding. No change is needed for either dynamic or dynamic_parameters.

    <!-- <review_comment_withdrawn> -->

    Review thread resolved.

    <sub><i>You are interacting with an AI system.</i></sub>

    <!-- This is an auto-generated reply by CodeRabbit -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 02, 2026 18:21 UTC
    Code Review
    dev/bazel/toolchains/cc_toolchain_lnx.bzl:1
    @@ -159,7 +159,9 @@ def _get_gcc_toolchain_path(repo_ctx, cc):
         return str(gcc.dirname.dirname.realpath) if gcc else None
     
     def _add_gcc_toolchain_if_needed(repo_ctx, cc):
    -    gcc_toolchain = _get_gcc_toolchain_path(repo_ctx, cc) if ("clang" in cc) or ("icpx" in cc) else None
    +    # Pin icx to the same gcc as icpx (the one on PATH), as Make does. Without it, icx's cc
    +    # actions fall back to icx's default gcc lookup, which can be a different install.
    +    gcc_toolchain = _get_gcc_toolchain_path(repo_ctx, cc) if ("clang" in cc) or ("icx" in cc) or ("icpx" in cc) else None

    <!-- coderabbit-ai-generated:v1 -->

    @napetrov Understood. Keeping gcc.dirname.dirname.realpath preserves the Make behavior you described. My suggestion would change that behavior and conflict with this PR’s parity objective. I withdraw the suggestion.

    ---

    <details>
    <summary>Learnings used</summary>
    <dl>
    <dd>

    Learnt from: CR
    Repo: uxlfoundation/oneDAL PR: 0
    File: dev/AGENTS.md:0-0
    Timestamp: 2026-10-21T08:00:37.071Z
    Learning: Applicability reference:
    AGENTS.md: # AGENTS.md - oneDAL
    ## Directory Guides
    - [dev/AGENTS.md](dev/AGENTS.md): Development tools and build system context
    
    deploy/AGENTS.md: # Deployment and Distribution - AI Agents Context
    ## 📖 Further Reading
    - **[dev/AGENTS.md](../dev/AGENTS.md)** - Development tools context
    
    dev/bazel/AGENTS.md: # Bazel Build System - AI Agents Context
    ## 📖 Further Reading
    - **[dev/AGENTS.md](../AGENTS.md)** - Development tools context
    
    Source excerpt:
    # AGENTS.md - Development Tools and Build Systems (dev/)
    
    ## Rules for Changes
    
    - A build change usually has to land in both Make and Bazel. Library versions, exports and symbol visibility must match between them.
    

    </dd>
    </dl>
    </details>

    <!-- <review_comment_withdrawn> -->

    Review thread resolved.

    <sub><i>You are interacting with an AI system.</i></sub>

    <!-- This is an auto-generated reply by CodeRabbit -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 02, 2026 18:21 UTC
    Code Review
    dev/bazel/cc/compile.bzl:1
    @@ -315,6 +316,10 @@ def _compile(name, ctx, toolchain, feature_config, compilation_contexts=[],
             includes = includes,
             system_includes = system_includes,
             quote_includes = quote_includes,
    +        # @mkl//:mkl_static propagates MKL_ILP64 through the DAAL deps, but
    +        # Make compiles DPC objects with MKL_LP64 only (ONEAPI.objs_y.dpc).
    +        drop_defines = ["MKL_ILP64"] if cc_common.is_enabled(
    +            feature_configuration = feature_config, feature_name = "dpc++") else [],

    <!-- coderabbit-ai-generated:v1 -->

    @napetrov You're right. dpc_mkl_defines_test.sh in 0ecab4da7 already addresses this regression-test request and runs in the analysis-only CI step. I withdraw the repeated request. No further change is needed for this thread.

    ---

    <details>
    <summary>Learnings used</summary>
    <dl>
    <dd>

    Learnt from: CR
    Repo: uxlfoundation/oneDAL PR: 0
    File: CONTRIBUTING.md:0-0
    Timestamp: 2026-10-21T08:00:58.826Z
    Learning: Applicability reference:
    AGENTS.md: # AGENTS.md - oneDAL
    ## Further Reading
    - `CONTRIBUTING.md`, `INSTALL.md`
    
    Source excerpt:
    # How to Contribute
    
    ## Pull Requests
    
    To contribute your changes directly to the repository, do the following:
    - Product uses bazel for validation and your changes should pass tests. Please add new tests as necessary. [Bazel Guide for oneDAL](https://github.com/uxlfoundation/oneDAL/tree/main/dev/bazel)
    

    </dd>
    </dl>
    </details>

    <!-- <review_comment_withdrawn> -->

    Review thread resolved.

    <sub><i>You are interacting with an AI system.</i></sub>

    <!-- This is an auto-generated reply by CodeRabbit -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 02, 2026 18:21 UTC
    Code Review
    dev/bazel/flags.bzl:1
    @@ -55,14 +55,12 @@ lnx_cc_flags = {
     win_icx_common_flags = [
         "-nologo",
         "-WX",
    -    # C++ exception handling. The Makefile passes `-EHsc` for every oneAPI
    -    # object on Windows (makefile:152, used at makefile:692/704/717); without
    -    # it clang-cl defaults to exceptions disabled and any `throw` in
    -    # cpp/oneapi/dal/detail/common.hpp is a hard error. This used to be
    -    # supplied implicitly as a side effect of `-Qopenmp-simd` (which turns on
    -    # -fexceptions in clang), so it only surfaced once that flag became
    -    # release-runtime-only. Pass it explicitly instead of relying on that.
    -    "-EHsc",
    +    # No `-EHsc` here, on purpose. Make adds it only to the oneAPI objects

    <!-- coderabbit-ai-generated:v1 -->

    @napetrov Understood. Omitting -EHsc for Windows icx and clang-cl threading objects is intentional Make parity. My suggestion would change that behavior, so I will not press for it in this PR. The exception-unwind concern remains unverified, not a confirmed defect.

    ---

    <details>
    <summary>Learnings used</summary>
    <dl>
    <dd>

    Learnt from: CR
    Repo: uxlfoundation/oneDAL PR: 0
    File: dev/bazel/AGENTS.md:0-0
    Timestamp: 2026-10-21T08:02:20.099Z
    Learning: Applies to dev/bazel/** : Applicability reference:
    AGENTS.md: # AGENTS.md - oneDAL
    ## Directory Guides
    - [dev/bazel/AGENTS.md](dev/bazel/AGENTS.md): Bazel build system specifics
    
    Source excerpt:
    # Bazel Build System - AI Agents Context
    
    ## 🔧 Build Rules and Patterns
    
    oneDAL does not use bare `cc_library` / `cc_test`. All modules go through the macros in `@onedal//dev/bazel:dal.bzl` (`dal_module`, `dal_test_suite`) and `@onedal//dev/bazel:daal.bzl` (`daal_module`). Compiler flags, CPU dispatch and threading are toolchain-owned (`dev/bazel/flags.bzl`); never hand-write `copts`.
    
    
    python
    load("@onedal//dev/bazel:dal.bzl", "dal_module", "dal_test_suite")

    package(default_visibility = ["//visibility:public"])

    dal_module(
    name = "core",
    auto = True, # globs sources by convention, excludes test/
    dal_deps = ["@onedal//cpp/oneapi/dal:core"],
    extra_deps = ["@onedal//cpp/daal/src/algorithms/pca:kernel"],
    )

    dal_module(
    name = "pca",
    dal_deps = [":core"],
    )

    dal_test_suite(
    name = "interface_tests",
    srcs = glob(["test/.cpp"]),
    hdrs = glob(["test/
    .hpp"]),
    dal_deps = [":pca"],
    framework = "catch2", # injects the catch2 main; don't add a catch2 dep by hand
    )

    dal_test_suite(
    name = "tests", # aggregate target CI invokes
    tests = [":interface_tests"],
    )

    </dd>
    </dl>
    </details>

    <sub><i>You are interacting with an AI system.</i></sub>

    <!-- This is an auto-generated reply by CodeRabbit -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 02, 2026 18:21 UTC
    Code Review
    dev/bazel/dal.bzl:1
    @@ -150,14 +150,18 @@ def dal_static_lib(name, lib_name, dal_deps=[], host_deps=[],
     
     def dal_dynamic_lib(name, lib_name, dal_deps=[], host_deps=[],
                         dpc_deps=[], dpc_host_deps=[], extra_deps=[], lib_tags=["dal"],
    -                    dpc_lib_tags=None, features=[], **kwargs):
    +                    dpc_lib_tags=None, dpc_linkopts=[], features=[], **kwargs):
         cc_dynamic_lib(
             name = name,
             lib_name = lib_name,
             lib_tags = lib_tags,
             deps = dal_deps + extra_deps + host_deps,
             **kwargs
         )
    +    # `dpc_linkopts` go to the DPC library only. Make puts its DPC-only link
    +    # options on LOPT of those targets (e.g. makefile:821, 851).
    +    dpc_kwargs = dict(kwargs)
    +    dpc_kwargs["linkopts"] = kwargs.get("linkopts", []) + dpc_linkopts

    <!-- coderabbit-ai-generated:v1 -->

    @napetrov Choose A: drop --offload-compress from Windows DPC links in both dynamic and dynamic_parameters. Keep the Linux compression flag.

    This matches the PR’s Make-parity objective and the Windows Make behavior you identified. My original recommendation to move the flag before /link was not appropriate for that objective. Do not change the Windows toolchain flag ordering for this issue.

    Keep this thread open until the change is made. When a Windows environment is available, inspect the generated DPC link commands to confirm that they omit --offload-compress. Windows linking remains unverified.

    <sub><i>You are interacting with an AI system.</i></sub>

    <!-- This is an auto-generated reply by CodeRabbit -->

    napetrov napetrov commented on code on Nov 02, 2026 19:14 UTC
    Code Review
    dev/bazel/dal.bzl:1
    @@ -150,14 +150,18 @@ def dal_static_lib(name, lib_name, dal_deps=[], host_deps=[],
     
     def dal_dynamic_lib(name, lib_name, dal_deps=[], host_deps=[],
                         dpc_deps=[], dpc_host_deps=[], extra_deps=[], lib_tags=["dal"],
    -                    dpc_lib_tags=None, features=[], **kwargs):
    +                    dpc_lib_tags=None, dpc_linkopts=[], features=[], **kwargs):
         cc_dynamic_lib(
             name = name,
             lib_name = lib_name,
             lib_tags = lib_tags,
             deps = dal_deps + extra_deps + host_deps,
             **kwargs
         )
    +    # `dpc_linkopts` go to the DPC library only. Make puts its DPC-only link
    +    # options on LOPT of those targets (e.g. makefile:821, 851).
    +    dpc_kwargs = dict(kwargs)
    +    dpc_kwargs["linkopts"] = kwargs.get("linkopts", []) + dpc_linkopts

    Fixed in cb492cd73: on Windows dpc_linkopts are dropped, as Make's dpc.link.dynamic.win (common.mk:142-144) never passes LOPT. Linux keeps --offload-compress (aquery checked).

    napetrov napetrov commented on code on Nov 02, 2026 19:14 UTC
    Code Review
    dev/bazel/scripts.bzl:1
    @@ -128,6 +128,82 @@ def generate_cmake_config(name, template, out, **kwargs):
             **kwargs
         )
     
    +# ---------------------------------------------------------------------------
    +# NuGet nuspec
    +# ---------------------------------------------------------------------------
    +
    +# Content summary per distribution type, as in deploy/nuget/prepare_dal_nuget.sh.
    +_NUSPEC_CONTENT = {
    +    "redist": "dynamic libraries and headers",
    +    "devel": "dynamic and static libraries and headers",
    +    "static": "static libraries and headers",
    +}
    +
    +def _generate_nuspec_impl(ctx):
    +    """Expand deploy/nuget/inteldal.nuspec.tpl as prepare_dal_nuget.sh does.
    +
    +    The script maps the Linux platform to `linux` (TBB `linux`) and the Windows
    +    platform to `win-x64` (TBB `win`), then runs one `sed` over the template.
    +    Both the Linux and the Windows file come from this rule; `release_extra_file`
    +    picks which one to stage on which OS.
    +    """
    +    vi = ctx.attr._version_info[VersionInfo]
    +    # identify_os.sh gives mac32e on macOS, which prepare_dal_nuget.sh maps to
    +    # osx-x64 / osx (its `elif` branch for mac32e).
    +    if ctx.target_platform_has_constraint(ctx.attr._windows_constraint[platform_common.ConstraintValueInfo]):
    +        platform, tbb_platform = "win-x64", "win"

    Fixed in 9eac68ed2: nuspec ids are now win-arm64, linux-arm64 and linux-riscv64 in both the Bazel rule and prepare_dal_nuget.sh (x64 ids unchanged). The script takes PLAT=winarm, with redist/ARM64 and lib/ARM64 as in winarm.mk. Checked with --platforms for each target.

    coderabbitai[bot] coderabbitai[bot] commented on code on Nov 02, 2026 19:15 UTC
    Code Review
    dev/bazel/dal.bzl:1
    @@ -150,14 +150,18 @@ def dal_static_lib(name, lib_name, dal_deps=[], host_deps=[],
     
     def dal_dynamic_lib(name, lib_name, dal_deps=[], host_deps=[],
                         dpc_deps=[], dpc_host_deps=[], extra_deps=[], lib_tags=["dal"],
    -                    dpc_lib_tags=None, features=[], **kwargs):
    +                    dpc_lib_tags=None, dpc_linkopts=[], features=[], **kwargs):
         cc_dynamic_lib(
             name = name,
             lib_name = lib_name,
             lib_tags = lib_tags,
             deps = dal_deps + extra_deps + host_deps,
             **kwargs
         )
    +    # `dpc_linkopts` go to the DPC library only. Make puts its DPC-only link
    +    # options on LOPT of those targets (e.g. makefile:821, 851).
    +    dpc_kwargs = dict(kwargs)
    +    dpc_kwargs["linkopts"] = kwargs.get("linkopts", []) + dpc_linkopts

    <!-- coderabbit-ai-generated:v1 -->

    @napetrov The supplied dal_dynamic_lib code now drops dpc_linkopts on Windows and preserves them on Linux. This addresses the agreed Make-parity change.

    Windows linking remains unverified. When a Windows environment is available, confirm that both DPC link commands omit --offload-compress.

    ---

    <!-- This is an auto-generated comment: tweet message by coderabbit.ai -->

    If you found this review helpful, would you consider giving us a shout-out on X?

    Thank you for using CodeRabbit!

    <!-- end of auto-generated comment: tweet message by coderabbit.ai -->

    Review thread resolved.

    <sub><i>You are interacting with an AI system.</i></sub>

    <!-- This is an auto-generated reply by CodeRabbit -->

    napetrov napetrov commented on Nov 08, 2026 06:06 UTC
    Author

    <!-- pr-address: PRR_kwDOA0Yky88AAAABWlK1uQ ask asked -->
    Inline items: answered in their threads. Waiting on a decision before I change this: the pre-merge check asks for the repo description template, performance numbers, and Signed-off-by on commits. Options: (A) rewrite the description, noting no runtime change is expected (the flags match Make); (B) measure with scikit-learn_bench first. Recommend A; I would not rewrite old commits for sign-off.

    napetrov napetrov commented on Nov 10, 2026 22:37 UTC
    Author

    <!-- pr-address: PRR_kwDOA0Yky88AAAABWlK1uQ answer accept -->
    Re: review by coderabbitai

    Description check: add the repository template, and state the performance results or why none are expected<br>Decision: option A. The PR description is rewritten to follow the repository's pull request template, filled from the diff. Performance: no runtime change is expected, since the PR changes build and packaging only, so no benchmark numbers are given. Commits added from here on are signed off; earlier commits are not rewritten.

    Reviewers
    Assignees
    napetrov napetrov
    Labels
    risk: low confidence: 84.9% 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: 82.8% (HIGH) · Higher = larger blast radius
    82.8%
    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: 84.9% · Lower = rushed or shallow review
    84.9%
    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: 12.5% · Safe to merge
    12.5%