Sample

Dorn/cuda/21

Human rating uses the original dataset scale.

DatasetDorn
Human3.31
Lines10

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
27.9Δ 18.7
Dorn0.1340–1; higher is more readable
9.5Δ 37.0
Mi0.2220–1; higher is more readable
21.7Δ 24.8
LLOC19Logical lines; fewer is more readable
35.5Δ 11.0
DeepSeek V4 Pro8.330–20; mean of three runs
31.2Δ 15.3
GPT-6.1 Sol11.330–20; mean of three runs
15.5Δ 31.1
BTTF0.1730–1; higher is more readable
4.5Δ 42.1
Human3.311–5; original rating
46.5

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.907.775−29.957
Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value.4.809−7.213
Source linesThe number of non-empty source lines.10+4

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

Feature contributions

FeatureValueContribution
(log-odds)
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.202−1.026
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Indentation frequencyHow rapidly indentation changes from line to line.1−0.703
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.11+0.647
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.9.862−0.272
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.10+0.191
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.85.727+0.034

Intercept 0.07 + feature contributions = -1.862 (log-odds).
Score = sigmoid(-1.862) = 0.134.

Score0.222
Score19
Run 1

The code uses a consistent, flat structure with one action per line, which aids readability. The repetitive if-blocks clearly show a halving reduction pattern. However, several issues reduce clarity: the variable names 'smem', 'mySum', and 'tid' are abbreviated, and the macro 'EMUSYNC' hides important synchronization details. The braces and indentation appear inconsistent, with the snippet ending in multiple closing braces without matching openings, making it hard to understand the surrounding context. The repeated assignments and min operations are understandable in isolation, but the lack of comments or context around blockSize and thread indexing makes intent less clear. Overall, the code is readable to someone familiar with parallel reduction patterns but less approachable for general readers.

Run 2

The code shows a clear reduction pattern with consistent structure, making the intent recognizable to experienced CUDA/GPU programmers. Each line follows a predictable template, which aids comprehension. However, readability suffers from several issues: the code relies on implicit context (blockSize, tid, mySum, EMUSYNC are undefined in this snippet), making it ambiguous without surrounding code. The pattern is repetitive and could be simplified with a loop, though unrolling is common in GPU code for performance. The EMUSYNC macro obscures control flow. Overall, the structure is logical but the lack of context, magical constants, and dense conditional assignments prevent this from being more readable.

Run 3

The code is a parallel reduction pattern using shared memory, but it suffers from readability issues. It uses multiple actions on a single line (assignment, min operation, shared memory write, and synchronization macro), violating the one-action-per-line principle. The repetitive if-blocks with hardcoded block size thresholds are redundant and could be refactored into a loop. The use of EMUSYNC macro obscures intent without context. Indentation appears inconsistent, with trailing closing braces. Variable names like 'smem' and 'tid' are conventional but not self-documenting. While the logical structure follows a known algorithm, it relies on implicit assumptions about block size and thread indexing. Nested chained assignments make debugging harder. The code is functionally concise but not optimized for human reading; a developer unfamiliar with GPU reduction patterns would struggle to understand the synchronization and memory access flow.

Run 1

Code Structure: The repeated reduction steps are logically ordered, but unmatched closing braces and missing surrounding context obscure the overall structure. Nesting: The visible conditionals are flat, although heavy indentation suggests enclosing scopes not shown. Clarity of intent: Descending offsets and min operations suggest a parallel minimum reduction, but abbreviated names and the unexplained EMUSYNC macro require domain knowledge. Code length: Compact and reasonably sized for an unrolled reduction, though repetitive. Action granularity: Each conditional combines a comparison, chained assignments, and synchronization on one line, making individual actions harder to distinguish. Reading flow: Consistent formatting and halving offsets create a predictable progression, but compressed statements and trailing braces interrupt readability.

Run 2

Code Structure: The repeated conditions form an orderly, unrolled reduction sequence, although unmatched closing braces obscure the surrounding structure. Nesting: The visible conditions are flat, but indentation suggests omitted enclosing scopes. Clarity of intent: The decreasing offsets and min operations suggest a parallel minimum reduction; mySum is misleadingly named, and EMUSYNC is unexplained. Code length: The snippet is compact, with repetition plausibly justified by unrolling. Action granularity: Each conditional compresses a chained assignment and synchronization into one line, making individual actions harder to scan. Reading flow: Consistent alignment and descending thresholds create a predictable flow, but dense statements, abbreviations, and missing context reduce readability.

Run 3

Code Structure: The repeated reduction stages are logically ordered, but unmatched closing braces and missing surrounding context obscure the overall structure. Nesting: Each visible condition is shallow, although indentation suggests deeper enclosing blocks. Clarity of intent: Halving offsets suggest a minimum reduction, but mySum is misleadingly named and EMUSYNC is unexplained. Code length: The snippet is compact; repetition appears deliberate for an unrolled reduction. Action granularity: Each conditional line combines a comparison, chained assignments, and synchronization, making individual operations harder to inspect. Reading flow: Consistent formatting and descending thresholds create a predictable sequence, but compressed statements and trailing braces interrupt readability.