← Back to Pull requests

Add RISC-V 64 TLS support and atomic yield functionality #1305

Closed
mengzhuo closed this pull request without merging on Jun 24, 2026 11:21 UTC
View on GitHub
mengzhuo mengzhuo commented on Jun 05, 2026 03:07 UTC
Author

No description provided by author.

Diff: 136 lines (+88 / -48) across 13 files Reviewer: daanx Review duration: 27853m
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.73) × (1 − Review Confidence (0.79)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.73 · 136 lines diff across 13 files
0.73
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.72 · 5 substantive comment(s)
0.72
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
78%
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.294
Sensitive Paths sensitive_paths
0.073
Empty Description empty_description
0.060
Real PR Conversation Timeline
6 items
daanx daanx commented on code on Jun 22, 2026 17:34 UTC
Code Review
include/mimalloc/prim.h:1
@@ -139,7 +139,7 @@ void _mi_prim_thread_associate_default_heap(mi_heap_t* heap);
 // but unfortunately we can not detect support reliably (see issue #883)
 // We also use it on Apple OS as we use a TLS slot for the default heap there.
 #if defined(__GNUC__) && ( \
-           (defined(__GLIBC__)   && (defined(__x86_64__) || defined(__i386__) || (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__))) \
+           (defined(__GLIBC__)   && (defined(__x86_64__) || defined(__i386__) || (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__) || (defined(__riscv) && __riscv_xlen == 64))) \

Why must the the xlen be 64 ? This should work for 32 as well right?

daanx daanx commented on code on Jun 22, 2026 17:36 UTC
Code Review
include/mimalloc/prim.h:1
@@ -263,6 +271,7 @@ static inline void mi_prim_tls_slot_set(size_t slot, void* value) mi_attr_noexce
       && !defined(MI_LIBC_MUSL) \
       && (!defined(__clang_major__) || __clang_major__ >= 14)  /* older clang versions emit bad code; fall back to using the TLS slot (<https://lore.kernel.org/linux-arm-kernel/202110280952.352F66D8@keescook/T/>) */
     #if    (defined(__GNUC__) && (__GNUC__ >= 7)  && defined(__aarch64__)) /* aarch64 for older gcc versions (issue #851) */ \
+        || (defined(__GNUC__) && (__GNUC__ >= 7)  && defined(__riscv) && __riscv_xlen == 64) \

Again, is the test for xlen==64 necessary here? And if we can skip it, can we merge the previous test as (defined(__GNUC__) && (__GNUC__ >= 7) && (defined(__aarch64__) || defined(__riscv))) ?

daanx daanx commented on Jun 22, 2026 17:37 UTC
Contributor

Thanks so much! Once we resolve the comments, can you rebase this commit on dev instead? (if it is too much hassle, I can also manually apply).

mengzhuo mengzhuo commented on Jun 23, 2026 02:18 UTC
Author

Thanks for review, all done

daanx daanx commented on Jun 23, 2026 20:32 UTC
Contributor

Thanks! Can you resubmit the PR but based on the dev branch? (this is the preferred branch for PR's)

Reviewers
Assignees
mengzhuo mengzhuo
Labels
risk: low confidence: 78.5% reviewed sensitive_module
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: 73.2% (HIGH) · Higher = larger blast radius
73.2%
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: 78.5% · Lower = rushed or shallow review
78.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: 15.7% · Safe to merge
15.7%