openwall / openwall/john

OpenCL: Custom MaxDuration from john.conf isn't halved in initial GWS tuning, and seems to be limited to original value.

Open
#4,916 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C
Stars
13.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Normally when a kernel is autotuned with a max_duration of 200, that figured is halved for the initial GWS tune:

Benchmarking: Bitcoin-opencl, Bitcoin Core [SHA512 AES OpenCL]... Loaded 13 hashes with 13 different salts to test db from test vectors
(...)
Calculating best GWS for LWS=32; max. 100 ms single kernel invocation.
(...)
Calculating best LWS for GWS=65536
(...)
Calculating best GWS for LWS=256; max. 200 ms single kernel invocation.
(...)
LWS=256 GWS=34816 (136 blocks) DONE
Speed for cost 1 (iteration count) of 200460
Raw:    10582 c/s real, 10614 c/s virtual, Dev#2 util: 100%

Problem 1:
If I decrease the default using Bitcoin_MaxDuration = 80 in john.conf, the figure will be honored but not halved for the initial one:

Benchmarking: Bitcoin-opencl, Bitcoin Core [SHA512 AES OpenCL]... Loaded 13 hashes with 13 different salts to test db from test vectors
(...)
Calculating best GWS for LWS=32; max. 80 ms single kernel invocation.
(...)
Calculating best LWS for GWS=65536
(...)
Calculating best GWS for LWS=256; max. 80 ms single kernel invocation.
(...)
LWS=256 GWS=34816 (136 blocks) DONE
Speed for cost 1 (iteration count) of 200460
Raw:    10614 c/s real, 10614 c/s virtual, Dev#2 util: 100%

Problem 2:
If I increase the value instead using using Bitcoin_MaxDuration = 400, it seems to be limited to the original value and silently ignored:

Benchmarking: Bitcoin-opencl, Bitcoin Core [SHA512 AES OpenCL]... Loaded 13 hashes with 13 different salts to test db from test vectors
(...)
Calculating best GWS for LWS=32; max. 100 ms single kernel invocation.
(...)
Calculating best LWS for GWS=65536
(...)
Calculating best GWS for LWS=256; max. 200 ms single kernel invocation.
(...)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the OpenCL autotuning output with Bitcoin_MaxDuration set to 80, 200, and 400 in john.conf, then trace how max_duration is applied during the initial GWS and later LWS tuning. Done means the configured value is consistently handled as intended in both tuning stages, including values below and above the default.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.