mirror of
https://git.wownero.com/wownero/RandomWOW.git
synced 2024-08-15 00:23:14 +00:00
More helpful error messages in the benchmark
Move reciprocal tests before Dataset initialization Fix randomx.dll project
This commit is contained in:
parent
6ea6cceb63
commit
4a4b06e44b
5 changed files with 52 additions and 23 deletions
|
@ -192,7 +192,22 @@ There is a total of 29 different instructions. The sum of frequencies must be eq
|
|||
|
||||
#### Notes
|
||||
|
||||
Making large changes to the default values is not recommended. The only exceptions are the instruction pairs IROR_R/IROL_R, FADD_R/FSUB_R and FADD_M/FSUB_M, which are functionally equivalent.
|
||||
Making changes to the default values is not recommended. The only exceptions are the instruction pairs IROR_R/IROL_R, FADD_R/FSUB_R and FADD_M/FSUB_M, which are functionally equivalent. Example of a safe custom configuration:
|
||||
|
||||
||default|custom|
|
||||
|-|------|------|-|
|
||||
|`RANDOMX_FREQ_IROR_R`|8|5|
|
||||
|`RANDOMX_FREQ_IROL_R`|2|5|
|
||||
|
||||
||default|custom|
|
||||
|-|------|------|
|
||||
|`RANDOMX_FREQ_FADD_R`|16|17|
|
||||
|`RANDOMX_FREQ_FSUB_R`|16|15|
|
||||
|
||||
||default|custom|
|
||||
|-|------|------|
|
||||
|`RANDOMX_FREQ_FADD_M`|5|4|
|
||||
|`RANDOMX_FREQ_FSUB_M`|5|6|
|
||||
|
||||
## Unsafe configurations
|
||||
|
||||
|
@ -200,6 +215,7 @@ There are some configurations that are considered 'unsafe' because they affect t
|
|||
|
||||
These checks can be disabled by definining `RANDOMX_UNSAFE` when building RandomX, e.g. by using `-DRANDOMX_UNSAFE` command line switch in GCC or MSVC. It is not recommended to disable these checks except for testing purposes.
|
||||
|
||||
|
||||
### 1. Memory-time tradeoffs
|
||||
|
||||
#### Condition
|
||||
|
|
|
@ -204,7 +204,10 @@ int main(int argc, char** argv) {
|
|||
|
||||
try {
|
||||
if (jit && !RANDOMX_HAVE_COMPILER) {
|
||||
throw std::runtime_error("JIT compilation is not supported on this platform");
|
||||
throw std::runtime_error("JIT compilation is not supported on this platform. Try without --jit");
|
||||
}
|
||||
if (!jit && RANDOMX_HAVE_COMPILER) {
|
||||
std::cout << "WARNING: You are using the interpreter mode. Use --jit for optimal performance." << std::endl;
|
||||
}
|
||||
|
||||
Stopwatch sw(true);
|
||||
|
@ -243,7 +246,13 @@ int main(int argc, char** argv) {
|
|||
for (int i = 0; i < threadCount; ++i) {
|
||||
randomx_vm *vm = randomx_create_vm(flags, cache, dataset);
|
||||
if (vm == nullptr) {
|
||||
throw std::runtime_error("Unsupported virtual machine options");
|
||||
if (!softAes) {
|
||||
throw std::runtime_error("Cannot create VM with the selected options. Try using --softAes");
|
||||
}
|
||||
if (largePages) {
|
||||
throw std::runtime_error("Cannot create VM with the selected options. Try without --largePages");
|
||||
}
|
||||
throw std::runtime_error("Cannot create VM");
|
||||
}
|
||||
vms.push_back(vm);
|
||||
}
|
||||
|
|
|
@ -118,6 +118,26 @@ int main() {
|
|||
}
|
||||
});
|
||||
|
||||
runTest("randomx_reciprocal", true, []() {
|
||||
assert(randomx_reciprocal(3) == 12297829382473034410U);
|
||||
assert(randomx_reciprocal(13) == 11351842506898185609U);
|
||||
assert(randomx_reciprocal(33) == 17887751829051686415U);
|
||||
assert(randomx_reciprocal(65537) == 18446462603027742720U);
|
||||
assert(randomx_reciprocal(15000001) == 10316166306300415204U);
|
||||
assert(randomx_reciprocal(3845182035) == 10302264209224146340U);
|
||||
assert(randomx_reciprocal(0xffffffff) == 9223372039002259456U);
|
||||
});
|
||||
|
||||
runTest("randomx_reciprocal_fast", RANDOMX_HAVE_FAST_RECIPROCAL, []() {
|
||||
assert(randomx_reciprocal_fast(3) == 12297829382473034410U);
|
||||
assert(randomx_reciprocal_fast(13) == 11351842506898185609U);
|
||||
assert(randomx_reciprocal_fast(33) == 17887751829051686415U);
|
||||
assert(randomx_reciprocal_fast(65537) == 18446462603027742720U);
|
||||
assert(randomx_reciprocal_fast(15000001) == 10316166306300415204U);
|
||||
assert(randomx_reciprocal_fast(3845182035) == 10302264209224146340U);
|
||||
assert(randomx_reciprocal_fast(0xffffffff) == 9223372039002259456U);
|
||||
});
|
||||
|
||||
runTest("Dataset initialization (interpreter)", stringsEqual(RANDOMX_ARGON_SALT, "RandomX\x03"), []() {
|
||||
initCache("test key 000");
|
||||
uint64_t datasetItem[8];
|
||||
|
@ -154,26 +174,6 @@ int main() {
|
|||
assert(equalsHex(state, "fa89397dd6ca422513aeadba3f124b5540324c4ad4b6db434394307a17c833ab"));
|
||||
});
|
||||
|
||||
runTest("randomx_reciprocal", true, []() {
|
||||
assert(randomx_reciprocal(3) == 12297829382473034410U);
|
||||
assert(randomx_reciprocal(13) == 11351842506898185609U);
|
||||
assert(randomx_reciprocal(33) == 17887751829051686415U);
|
||||
assert(randomx_reciprocal(65537) == 18446462603027742720U);
|
||||
assert(randomx_reciprocal(15000001) == 10316166306300415204U);
|
||||
assert(randomx_reciprocal(3845182035) == 10302264209224146340U);
|
||||
assert(randomx_reciprocal(0xffffffff) == 9223372039002259456U);
|
||||
});
|
||||
|
||||
runTest("randomx_reciprocal_fast", RANDOMX_HAVE_FAST_RECIPROCAL, []() {
|
||||
assert(randomx_reciprocal_fast(3) == 12297829382473034410U);
|
||||
assert(randomx_reciprocal_fast(13) == 11351842506898185609U);
|
||||
assert(randomx_reciprocal_fast(33) == 17887751829051686415U);
|
||||
assert(randomx_reciprocal_fast(65537) == 18446462603027742720U);
|
||||
assert(randomx_reciprocal_fast(15000001) == 10316166306300415204U);
|
||||
assert(randomx_reciprocal_fast(3845182035) == 10302264209224146340U);
|
||||
assert(randomx_reciprocal_fast(0xffffffff) == 9223372039002259456U);
|
||||
});
|
||||
|
||||
randomx::NativeRegisterFile reg;
|
||||
randomx::BytecodeMachine decoder;
|
||||
randomx::InstructionByteCode ibc;
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
<ClCompile Include="..\src\assembly_generator_x86.cpp" />
|
||||
<ClCompile Include="..\src\blake2\blake2b.c" />
|
||||
<ClCompile Include="..\src\blake2_generator.cpp" />
|
||||
<ClCompile Include="..\src\bytecode_machine.cpp" />
|
||||
<ClCompile Include="..\src\dataset.cpp" />
|
||||
<ClCompile Include="..\src\instruction.cpp" />
|
||||
<ClCompile Include="..\src\instructions_portable.cpp" />
|
||||
|
|
|
@ -169,5 +169,8 @@
|
|||
<ClCompile Include="..\src\blake2\blake2b.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\bytecode_machine.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
Loading…
Reference in a new issue