Sample

Dorn/cuda/51

Human rating uses the original dataset scale.

DatasetDorn
Human2.5
Lines50

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
5.8Δ 6.4
Scalabrino0.330–1; higher is more readable
24.0Δ 11.8
Dorn0.0190–1; higher is more readable
2.8Δ 9.5
Mi0.5110–1; higher is more readable
53.2Δ 40.9
LLOC41Logical lines; fewer is more readable
0.7Δ 11.6
DeepSeek V4 Pro11.330–20; mean of three runs
49.3Δ 37.0
GPT-6.1 Sol140–20; mean of three runs
41.4Δ 29.1
BTTF0.3230–1; higher is more readable
17.8Δ 5.6
Human2.51–5; original rating
12.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.2677.191−88.347
Source linesThe number of non-empty source lines.50+20
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.099−7.648

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

Score0.33

Feature contributions

FeatureValueContribution
(log-odds)
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.142.863−2.386
Indentation frequencyHow rapidly indentation changes from line to line.50+0.992
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.51−0.769
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.50−0.727
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.159−0.603
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.49.424+0.281

Intercept 0.07 + feature contributions = -3.945 (log-odds).
Score = sigmoid(-3.945) = 0.019.

Score0.511
Score41
Run 1

The code is moderately readable. The switch statement in KernelSumSmallArray is clear and flat, with each block size case explicitly listed, but it is highly repetitive and unnecessarily long—a template loop or macro could condense it. The first code fragment is concise but lacks context: variable names like 'sum' and 'multiplyFactor' are vague, and the purpose of SumBeforeWarp and SumWarp is implied but not obvious. Nesting is minimal (two levels), which is good, and action granularity is mostly one action per line. The reading flow is natural for CUDA programmers but confusing for general readers due to unexplained synchronization and warp-level operations. Overall, structure is logical but verbosity and cryptic naming reduce clarity.

Run 2

The code shows mixed readability. The switch-case dispatch in KernelSumSmallArray is clear but highly repetitive, making it unnecessarily long and prone to maintenance errors. Each case contains essentially the same kernel launch with only the template parameter and blockSize varying. The kernel code itself uses helper functions (SumBeforeWarp, SumWarp) which indicate good abstraction, but the snippet begins mid-function without context, hurting clarity of intent. Nesting is reasonable—only two levels deep—and action granularity is mostly one operation per line. However, the repetitive launch configuration and lack of a default case reduce overall readability. The __syncthreads() call and conditional sections are understandable but would benefit from brief comments explaining warp-level reduction logic.

Run 3

The code shows a clear CUDA kernel ending and a dispatcher function. The switch statement has a flat structure with consistent cases, which is good for readability. However, it is unnecessarily verbose - 11 nearly identical cases with long kernel launch configurations repeated each time. The intent is understandable, but the code length and repetition hurt maintainability. Nesting is minimal, which helps, but the launch configuration lines extend far beyond comfortable reading width. Action granularity is reasonable with one launch per case. The reading flow is natural but tedious due to repetition. A template-based dispatch or macro could reduce this to a fraction of the length while maintaining clarity. The initial kernel fragment lacks context and makes the first part hard to evaluate independently.

Run 1

Code Structure: The reduction and kernel-dispatch logic are logically organized, though the snippet begins mid-function. Nesting: Shallow conditional nesting and a straightforward switch keep complexity manageable. Clarity of intent: Descriptive function and parameter names convey summation and block-size dispatch, but CUDA-specific syntax, the unexplained warp constant 32, and no default case leave some behavior implicit. Code length: Repeated kernel launches make the switch verbose, although template specialization explains the repetition. Action granularity: Most lines perform one action; the inline conditional assignment slightly compresses control flow. Reading flow: Descending block sizes and consistent case formatting are easy to follow, but long signatures and launch expressions, along with conditional compilation, interrupt scanning.

Run 2

Code Structure: The reduction and kernel-dispatch logic are logically organized, but the snippet begins mid-function and the switch lacks an explicit default case. Nesting: Shallow conditional nesting and a straightforward switch keep complexity manageable. Clarity of intent: Function and parameter names convey summation and block-size selection, although CUDA-specific syntax and unexplained constants require domain knowledge. Code length: Nearly identical launch statements make the switch repetitive and lengthy, though template specialization helps explain the repetition. Action granularity: Most statements perform one action per line; the inline conditional assignment slightly compresses control flow. Reading flow: Descending block sizes and consistent case layout are easy to scan, but long lines, inconsistent spacing, and the embedded preprocessor directive interrupt the flow.

Run 3

Code Structure: Reduction logic and kernel dispatch are logically separated, and switch cases are consistently organized, but the snippet starts mid-function and lacks a default case. Nesting: Mostly shallow, with only two nested thread checks. Clarity of intent: Function and variable names communicate summation and scaling, although CUDA launch syntax, template specialization, and the unexplained FERMI condition require domain knowledge. Code length: Repeated kernel launches make the dispatch verbose, though explicit cases support compile-time specialization. Action granularity: Most statements perform one action per line; the inline conditional assignment slightly compresses control flow. Reading flow: Descending block sizes and consistent case formatting are easy to follow, but long lines, preprocessor directives, and the incomplete opening context interrupt the flow.