You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "LindaSummer (via GitHub)" <gi...@apache.org> on 2024/09/26 14:46:18 UTC
[PR] fix(test): use fixed seed to improve reproducibility. [kvrocks]
LindaSummer opened a new pull request, #2557:
URL: https://github.com/apache/kvrocks/pull/2557
# Issue
Fix: #2550
Unit test's random generation may make result unstable to expected result.
# Proposed Changes
Use fixed seed for hnsw index unit test for improving reproducibility.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(test): use fixed seed to improve reproducibility. [kvrocks]
Posted by "LindaSummer (via GitHub)" <gi...@apache.org>.
LindaSummer commented on code in PR #2557:
URL: https://github.com/apache/kvrocks/pull/2557#discussion_r1777890834
##########
src/search/hnsw_indexer.h:
##########
@@ -92,7 +92,10 @@ struct HnswIndex {
std::mt19937 generator;
double m_level_normalization_factor;
- HnswIndex(const SearchKey& search_key, HnswVectorFieldMetadata* vector, engine::Storage* storage);
+ HnswIndex(const SearchKey& search_key, HnswVectorFieldMetadata* vector, engine::Storage* storage,
+ std::random_device::result_type seed);
+ HnswIndex(const SearchKey& search_key, HnswVectorFieldMetadata* vector, engine::Storage* storage)
+ : HnswIndex(search_key, vector, storage, std::random_device()()) {}
Review Comment:
Hi @Beihao-Zhou ,
Thanks for your review suggestions!
I have updated related constructors. 😊
Best Regards,
Edward
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(test): use fixed seed to improve reproducibility. [kvrocks]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #2557:
URL: https://github.com/apache/kvrocks/pull/2557#issuecomment-2377453264
## [](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=2557) **Quality Gate failed**
Failed conditions
 [1 Security Hotspot](https://sonarcloud.io/project/security_hotspots?id=apache_kvrocks&pullRequest=2557&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [D Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=2557) (required ≥ A)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=2557)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(test): use fixed seed to improve reproducibility. [kvrocks]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #2557:
URL: https://github.com/apache/kvrocks/pull/2557#issuecomment-2378310679
## [](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=2557) **Quality Gate failed**
Failed conditions
 [1 Security Hotspot](https://sonarcloud.io/project/security_hotspots?id=apache_kvrocks&pullRequest=2557&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=2557)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(test): use fixed seed to improve reproducibility. [kvrocks]
Posted by "Beihao-Zhou (via GitHub)" <gi...@apache.org>.
Beihao-Zhou commented on PR #2557:
URL: https://github.com/apache/kvrocks/pull/2557#issuecomment-2377958970
The rest LGTM :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(test): use fixed seed to improve reproducibility. [kvrocks]
Posted by "Beihao-Zhou (via GitHub)" <gi...@apache.org>.
Beihao-Zhou commented on PR #2557:
URL: https://github.com/apache/kvrocks/pull/2557#issuecomment-2377961089
The rest LGTM :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(test): use fixed seed to improve reproducibility. [kvrocks]
Posted by "LindaSummer (via GitHub)" <gi...@apache.org>.
LindaSummer commented on code in PR #2557:
URL: https://github.com/apache/kvrocks/pull/2557#discussion_r1777890834
##########
src/search/hnsw_indexer.h:
##########
@@ -92,7 +92,10 @@ struct HnswIndex {
std::mt19937 generator;
double m_level_normalization_factor;
- HnswIndex(const SearchKey& search_key, HnswVectorFieldMetadata* vector, engine::Storage* storage);
+ HnswIndex(const SearchKey& search_key, HnswVectorFieldMetadata* vector, engine::Storage* storage,
+ std::random_device::result_type seed);
+ HnswIndex(const SearchKey& search_key, HnswVectorFieldMetadata* vector, engine::Storage* storage)
+ : HnswIndex(search_key, vector, storage, std::random_device()()) {}
Review Comment:
Hi @Beihao-Zhou ,
I have updated related constructors. 😊
Best Regards,
Edward
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(test): use fixed seed to improve reproducibility. [kvrocks]
Posted by "Beihao-Zhou (via GitHub)" <gi...@apache.org>.
Beihao-Zhou commented on code in PR #2557:
URL: https://github.com/apache/kvrocks/pull/2557#discussion_r1777744954
##########
src/search/hnsw_indexer.h:
##########
@@ -92,7 +92,10 @@ struct HnswIndex {
std::mt19937 generator;
double m_level_normalization_factor;
- HnswIndex(const SearchKey& search_key, HnswVectorFieldMetadata* vector, engine::Storage* storage);
+ HnswIndex(const SearchKey& search_key, HnswVectorFieldMetadata* vector, engine::Storage* storage,
+ std::random_device::result_type seed);
+ HnswIndex(const SearchKey& search_key, HnswVectorFieldMetadata* vector, engine::Storage* storage)
+ : HnswIndex(search_key, vector, storage, std::random_device()()) {}
Review Comment:
Maybe we can use a single constructor with a default argument?
```
HnswIndex(const SearchKey& search_key,
HnswVectorFieldMetadata* vector,
engine::Storage* storage,
std::random_device::result_type seed = std::random_device()())
{
...
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(test): use fixed seed to improve reproducibility. [kvrocks]
Posted by "Beihao-Zhou (via GitHub)" <gi...@apache.org>.
Beihao-Zhou merged PR #2557:
URL: https://github.com/apache/kvrocks/pull/2557
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org