← Back to Pull requests

fix(rocRAND): add linker export allowlist on Linux #14414

Closed
unknown closed this pull request without merging on Nov 21, 2026 02:20 UTC
View on GitHub
unknown unknown commented on Oct 26, 2026 19:04 UTC
Author

JIRA ID : AIPRIMS-246

Motivation

librocrand.so exported 5,380 dynamic symbols, of which only 38 are public API. The rest leaked because nothing enforced the export set at link time.

Technical Details

  • Linux: added library\rocrand.map with ROCRAND_1 (37 public symbols) and ROCRAND_PRIVATE_1 (rocrand_h_mt19937_jump).

  • CMake: added LINKER:--version-script for shared, non-Windows builds only.

  • Windows: no .def file. ROCRANDAPI (__declspec(dllexport)) already limits the DLL to the same 38 symbols. A .def can only add exports, and the plain rocrand_h_mt19937_jump name would fail to link (C++ linkage, mangled on Windows).
  • Test Plan

  • Compare exports before and after (nm -D --defined-only), and check symbol versions (readelf -V, readelf --dyn-syms).

  • Check every map entry is declared in the public headers, and that the set of ROCRANDAPI declarations equals the map (keeps Windows and Linux consistent).

  • Run rocRAND and hipRAND ctest.

  • Windows: dumpbin /exports rocrand.dll built without a .def.
  • Test Result

  • Dynamic exports: 5,380 in released ROCm, 38 with this change (37 @@ROCRAND_1, 1 @@ROCRAND_PRIVATE_1).

  • ctest: rocRAND 53/53, hipRAND 5/5 passed.

  • All rocRAND and hipRAND binaries resolve every symbol against the new library.

  • Windows (gfx1152): rocrand.dll exports exactly the same 38 symbols.
  • Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
  • Diff: 190 lines (+142 / -48) across 2 files Reviewer: amd-jmahovsky Review duration: 36435m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 190 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.314
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #14414"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 35.9% (MEDIUM) · Higher = larger blast radius
    35.9%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 14.2% · Safe to merge
    14.2%