Sample

Dorn/cuda/99

Human rating uses the original dataset scale.

DatasetDorn
Human3.21
Lines50

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
12.1Δ 29.1
Dorn0.1870–1; higher is more readable
14.9Δ 26.3
Mi0.4560–1; higher is more readable
46.7Δ 5.4
LLOC30Logical lines; fewer is more readable
11.4Δ 29.8
DeepSeek V4 Pro140–20; mean of three runs
65.9Δ 24.7
GPT-6.1 Sol13.330–20; mean of three runs
34.7Δ 6.5
BTTF0.4460–1; higher is more readable
32.5Δ 8.8
Human3.211–5; original rating
41.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.2106.21−69.505
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.058−7.586

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

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.45+0.819
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.177−0.776
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.48−0.663
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.46−0.635
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.49.524+0.282
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.80.882+0.239

Intercept 0.07 + feature contributions = -1.468 (log-odds).
Score = sigmoid(-1.468) = 0.187.

Score0.456
Score30
Run 1

The code follows a clear, recognizable pattern of parallel reduction for finding minimum values and positions, with a logical progression from larger to smaller block sizes. The structure is consistent, and each step is relatively flat with only two levels of nesting. However, readability suffers from repetition: the same comparison and assignment logic is duplicated many times, making the code longer than necessary and increasing maintenance risk. The use of `blockSize` guards alongside thread index checks is somewhat redundant once the block size is known, and the transition to volatile pointers mid-way is abrupt without explanation. Action granularity is mostly one action per line, which helps, but the repetitive blocks disrupt natural reading flow. Intent is inferable but not explicitly documented. Overall, the code is understandable to someone familiar with CUDA reduction patterns, but it could be improved with a loop, helper function, or comments explaining the pattern.

Run 2

The code shows a clear parallel reduction pattern with a logical structure, but it has several readability issues. The primary problems are repetitive, nearly identical blocks that could be refactored into a loop or macro, and multiple actions per line (condition and assignment on the same line). The nesting is moderate (2 levels), but the code length is unnecessarily long due to copy-paste style blocks. The intent is somewhat clear for CUDA developers familiar with reduction patterns, but the magic numbers and repeated pattern make it harder to follow. The transition from syncthreads to volatile shared memory at warp level adds complexity. Overall, it's understandable but verbose and repetitive, reducing its readability.

Run 3

The code structure is repetitive but follows a clear pattern for parallel reduction, making the intent understandable. Nesting is shallow, which is good, and each action is on its own line, improving readability. However, the code length is unnecessarily long due to nearly identical blocks for different block sizes, which could be simplified with a loop or macro. The reading flow is somewhat disorganized because the sequence of conditional blocks appears repetitive and manually unrolled. Missing context, such as variable declarations or the purpose of the overall function, slightly reduces clarity, but the variable names and logic make the intent evident. Overall, it is readable but verbose and could benefit from abstraction.

Run 1

Code Structure: Reduction stages are logically grouped by decreasing block size, but the fragment starts with an unmatched closing brace and ends mid-block. Nesting: Two to three levels are manageable, though repeated nested conditions add visual overhead. Clarity of intent: Updating minimum values and their positions suggests a parallel minimum reduction; CUDA synchronization and volatile aliases lack explanatory comments. Code length: Repeated stages make the snippet verbose, although explicit unrolling may be intentional for performance. Action granularity: Each assignment and synchronization occupies its own line, making operations easy to distinguish. Reading flow: Consistent indentation and descending offsets provide a predictable progression, but repeated indexing expressions and the incomplete context interrupt readability.

Run 2

Code Structure: Reduction stages are logically organized by decreasing block size, although the fragment starts with an unmatched closing brace and ends incomplete. Nesting: Two to three conditional levels are manageable but add visual complexity. Clarity of intent: Tracking minimum values and their positions is reasonably clear from variable names and comparisons; CUDA-specific synchronization and volatile pointers require specialist knowledge, with no explanatory comments. Code length: Repeated comparison-and-update blocks make the snippet verbose, though explicit unrolling may serve performance goals. Action granularity: Each assignment and synchronization occupies its own line, making operations easy to distinguish. Reading flow: Consistent indentation and descending offsets create a predictable progression, but repetition, long indexing expressions, and the incomplete boundaries impede smooth reading.

Run 3

Code Structure: Reduction stages are logically organized by decreasing block size, though the fragment begins with an unmatched closing brace and ends incomplete. Nesting: Two to three conditional levels are manageable but add visual complexity. Clarity of intent: Comparing minimum values and copying their positions suggests a minimum reduction; CUDA-specific synchronization and volatile pointers lack explanatory comments. Code length: Repeated comparison-and-copy blocks make the code verbose, although explicit unrolling may serve performance goals. Action granularity: Each assignment and synchronization occupies its own line, making individual operations easy to follow. Reading flow: Consistent indentation, spacing, and descending offsets create a predictable sequence, but repeated indexing expressions and the unexplained transition to warp-level processing slow comprehension.