Sample

Dorn/cuda/4

Human rating uses the original dataset scale.

DatasetDorn
Human3.75
Lines49

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
43.7Δ 37.6
Scalabrino0.8290–1; higher is more readable
89.5Δ 8.2
Dorn0.5430–1; higher is more readable
46.8Δ 34.5
Mi0.6850–1; higher is more readable
79.7Δ 1.7
LLOC19Logical lines; fewer is more readable
35.5Δ 45.8
DeepSeek V4 Pro10.330–20; mean of three runs
42.9Δ 38.4
GPT-6.1 Sol14.330–20; mean of three runs
44.4Δ 36.9
BTTF0.4210–1; higher is more readable
27.0Δ 54.3
Human3.751–5; original rating
81.3

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.1045.324−34.496
Source linesThe number of non-empty source lines.49+19.6
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.041−7.561

Intercept 8.87 + feature contributions = -13.587 (log-odds).
Score = sigmoid(-13.587) = 0.

Score0.829

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.48−0.663
Indentation frequencyHow rapidly indentation changes from line to line.39+0.612
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.83.98+0.551
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.39−0.474
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.129−0.307
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.48.859+0.273
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.83.94+0.11

Intercept 0.07 + feature contributions = 0.171 (log-odds).
Score = sigmoid(0.171) = 0.543.

Score0.685
Score19
Run 1

The code is moderately readable but has several issues. It lacks comments explaining the purpose of memory transfers, uses vague variable names like 'hostPtr' and 'backPtr', and includes commented-out code that creates clutter. The main function is too long and could benefit from helper functions. Error handling is inconsistent - some functions check return values while others don't. The memory allocation has no error checking for malloc beyond initial null check, and there's no validation of cudaMemcpy results. The code structure is linear but lacks clear separation of concerns. Nesting is minimal, which is good, but the overall organization feels haphazard. Action granularity is generally one action per line, but there's no spacing or grouping of related operations. The reading flow is disrupted by the commented-out sections and sudden transitions between memory operations. The code would benefit from better function decomposition, more descriptive variable names, consistent error checking, and removal of dead code.

Run 2

The code has a clear overall structure with logical sections for allocation, initialization, device transfer, and cleanup. Nesting is minimal, which is good. However, there are several readability issues: missing includes for standard functions (malloc, fprintf), unused variable (backPtr after allocation), commented-out code blocks, and inconsistent formatting. Variable declarations like 'int i;' at the top feel outdated. Error handling is duplicated and could be refactored. Some operations (allocation, memcpy) are clear, but the intent of the transfer pattern is not immediately obvious without comment. The reading flow is mostly natural, but the unused variable and commented sections create confusion about what is actually being executed versus planned.

Run 3

The code is mostly linear and each statement is on its own line, which helps readability. However, it has several issues: missing includes for standard functions (malloc, free, fprintf, stderr), inconsistent indentation, unnecessary blank lines, and commented-out code that adds clutter. The variable names are reasonably clear, but the lack of error checking after cudaMemcpy calls and unused variable 'backPtr' after allocation reduce clarity. The intent is somewhat ambiguous due to missing context around the memory transfer operations. Overall, the code is understandable but would benefit from cleaner structure, consistent formatting, and removal of dead code.

Run 1

Code Structure: The allocation, initialization, device allocation, transfer, and cleanup stages are logically ordered, though commented-out memory-pinning blocks interrupt organization. Nesting: Minimal nesting and straightforward conditionals make the code easy to scan. Clarity of intent: CUDA transfer calls clearly suggest a host-to-device round trip, but generic pointer names, unused returned data, missing relevant headers, and incomplete cleanup obscure the intended completeness of the example. Code length: Mostly concise, with unnecessary commented-out code and blank lines. Action granularity: Statements generally perform one action per line; the initialization loop is compact and understandable. Reading flow: Execution proceeds naturally, but inconsistent spacing, redundant casts, and the unbraced loop slightly reduce readability.

Run 2

Code Structure: Allocation, initialization, device transfer, and cleanup are logically ordered, but commented-out memory-pinning blocks clutter the organization. Nesting: Shallow conditionals and a single loop make the code easy to follow. Clarity of intent: Pointer names and CUDA calls suggest a host-to-device round trip, but its purpose is unexplained and the returned data is never checked. Missing standard/CUDA includes and incomplete cleanup reduce clarity. Code length: Generally concise, though redundant initialization and disabled code add noise. Action granularity: Each statement performs one main action. Reading flow: The execution sequence is natural, but inconsistent spacing, excessive blank lines, repeated casts, and an unbraced loop interrupt readability.

Run 3

Code Structure: Allocation, initialization, device transfer, and cleanup follow a logical sequence, though commented-out memory-pinning blocks add clutter. Nesting: Shallow conditionals and a single loop make the code easy to scan. Clarity of intent: CUDA calls reveal the transfer workflow, but abbreviated pointer names, no explanation of the initialization pattern, and an unused copied-back result obscure its purpose. Missing standard-library and CUDA includes also weaken self-containment. Code length: Generally concise, with unnecessary casts and commented-out code. Action granularity: Each statement performs one action, supporting readability. Reading flow: Mostly natural, but inconsistent spacing, excess blank lines, and an unbraced loop reduce polish. Incomplete cleanup and unchecked transfers leave the resource lifecycle and failure handling less clear.