Skip to content

Conversation

@lightbrotherV
Copy link
Contributor

PR Category

Execute Infrastructure

PR Types

Bug fixes

Description

GetRandomId() 函数每次调用时都会重新初始化随机数生成器 (std::random_device 和 std::mt19937_64),这会导致生成的随机数可能重复或不够随机。

  1. std::random_device 被重复初始化:
    每次调用函数时都新建 random_device 和 mt19937_64,可能导致种子相似(尤其在某些平台上 random_device 实现不够完善)。

  2. 伪随机数引擎未复用:
    mt19937_64 的状态在每次函数调用时重置,失去了伪随机序列的长期统计特性

@paddle-bot
Copy link

paddle-bot bot commented Aug 2, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@CLAassistant
Copy link

CLAassistant commented Aug 2, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@paddle-bot paddle-bot bot added the contributor External developers label Aug 2, 2025
Copy link
Contributor Author

@lightbrotherV lightbrotherV left a comment

Choose a reason for hiding this comment

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

fix random num same

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@5b8c1e0). Learn more about missing BASE report.

Additional details and impacted files
@@ Coverage Diff @@ ## develop #74378 +/- ## =========================================== Coverage ? 100.00% =========================================== Files ? 1 Lines ? 3 Branches ? 0 =========================================== Hits ? 3 Misses ? 0 Partials ? 0 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Aug 5, 2025
@lixinqi lixinqi merged commit 9e2272c into PaddlePaddle:develop Aug 5, 2025
66 of 67 checks passed
@lixinqi
Copy link
Contributor

lixinqi commented Aug 5, 2025

fix random num same

thanks

@luotao1
Copy link
Contributor

luotao1 commented Aug 6, 2025

hi, @lightbrotherV

  • 非常感谢你对飞桨的贡献,我们正在运营一个PFCC组织。PFCC是飞桨开源的贡献者俱乐部,只有给飞桨合入过代码的开发者才能加入,俱乐部里每两周会有一次例会(按兴趣参加),也会时不时办线下meetup面基,详情可见 https://github.com/luotao1 主页说明。
  • 如果你对PFCC有兴趣,请发送邮件至 ext_paddle_oss@baidu.com,我们会邀请你加入~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers HappyOpenSource 快乐开源活动issue与PR

5 participants