Sample

Dorn/cuda/43

Human rating uses the original dataset scale.

DatasetDorn
Human2.59
Lines10

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.0010–1; higher is more readable
58.8Δ 44.6
Scalabrino0.6070–1; higher is more readable
60.5Δ 46.3
Dorn0.6440–1; higher is more readable
56.8Δ 42.6
Mi0.1870–1; higher is more readable
19.2Δ 5.0
LLOC6Logical lines; fewer is more readable
72.8Δ 58.6
DeepSeek V4 Pro13.670–20; mean of three runs
62.8Δ 48.6
GPT-6.1 Sol160–20; mean of three runs
66.0Δ 51.8
BTTF0.2510–1; higher is more readable
10.0Δ 4.2
Human2.591–5; original rating
14.2

Views

Download official ZIP ↗

Select the downloaded ZIP or its extracted folder. Files stay in your browser.

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.368.017−12.145
Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value.5.249−7.874
Source linesThe number of non-empty source lines.10+4

Intercept 8.87 + feature contributions = -7.149 (log-odds).
Score = sigmoid(-7.149) = 0.001.

Score0.607

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.105+0.89
Identifier layout (horizontal)How rapidly the visual pattern of identifier characters changes from left to right. It measures spatial frequency, not the meaning of the names.104.909−0.778
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.11+0.647
Indentation frequencyHow rapidly indentation changes from line to line.9−0.426
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.9.821−0.273
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.071+0.249
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.9+0.214

Intercept 0.07 + feature contributions = 0.593 (log-odds).
Score = sigmoid(0.593) = 0.644.

Score0.187
Score6
Run 1

The code is generally readable but has some issues. The macro invocations at the top are clear but lack context. The function has a descriptive name and clear parameters, but the parameter list is long and could be structured better. Nesting is flat, which is good. The intent is mostly clear—copy data to GPU constant memory—but the magic numbers (8192, MAX_CHARSET_LENGTH) reduce clarity. Code length is appropriate, though the repeated CUDA_SAFE_CALL lines are slightly verbose. Action granularity is good—one operation per line. Reading flow is natural: setup, then three copy operations. The main drawbacks are the unexplained macros, magic numbers, and lack of comments explaining the relationship between parameters and their GPU counterparts.

Run 2

The code is moderately readable. Structure is logical: macro-based kernel instantiations followed by a device-to-constant copy function. Nesting is flat, which is good. Clarity of intent is mixed: the function name is descriptive, but the macros hide implementation details and the magic numbers (8192, MAX_PASSWORD_LEN) are unexplained. Code length is concise, but the single-line CUDA_SAFE_CALL statements contain multiple actions (call, error check) and long parameter lists, reducing action granularity. Reading flow is natural but compromised by the macro names and unexplained constants. Overall, understandable for domain experts but less approachable for general developers.

Run 3

The code is moderately readable. The function name and parameter names are descriptive, and the intent to copy data to GPU constant memory is clear. However, readability is reduced by the long macro invocations at the top, which obscure their purpose without context. The function itself is flat and concise, which is positive, but the multiple CUDA_SAFE_CALL lines are somewhat lengthy and mix function call with error handling. Magic numbers like 8192 and MAX_PASSWORD_LEN lack immediate explanation. The action granularity is one action per line, which aids comprehension, but the reading flow is slightly disrupted by the verbose CUDA calls and unexplained constants. Overall structure is logical for a CUDA utility function, but clarity could be improved with comments or named constants.

Run 1

Code Structure: The snippet is logically organized, with kernel declarations followed by a focused data-copy function. Nesting: Flat execution with no nested control flow makes it easy to scan. Clarity of intent: Descriptive function and variable names reveal the purpose, but the comment incorrectly describes copying to the host while the calls copy host data to device symbols. The unused threadId parameter, unexplained macro arguments, and magic number 8192 reduce clarity. Code length: Concise, with little unnecessary code. Action granularity: Each copy operation occupies its own line. Reading flow: The three similarly formatted calls form a natural sequence, though long lines and the wrapped signature slightly hinder readability.

Run 2

Code Structure: A small, focused function logically groups three CUDA constant-memory transfers, although the preceding kernel-generation macros lack context. Nesting: The function is flat, with no branching or nested blocks. Clarity of intent: Descriptive function and parameter names make the transfers understandable, but the comment incorrectly describes copying to the host rather than to device constant memory. The unused threadId parameter and unexplained literal 8192 reduce clarity. Code length: Concise, without unnecessary implementation detail. Action granularity: Each transfer occupies its own statement and line. Reading flow: The sequence is straightforward, though long lines, uneven signature formatting, and opaque wrapper macros slightly impede scanning.

Run 3

Code Structure: A compact, logically grouped function follows two kernel-generation macros. Nesting: Flat, with no branching or nested blocks. Clarity of intent: Descriptive names and CUDA copy calls make the purpose apparent, but the comment incorrectly says data is copied to the host rather than device constant memory. The unused threadId parameter, unexplained 8192 constant, and opaque macros reduce clarity. Code length: Concise, without unnecessary implementation detail. Action granularity: Each copy operation occupies its own statement and line. Reading flow: The sequential copies are easy to follow, although long lines and uneven parameter formatting slightly hinder scanning.