Sample

Dorn/cuda/26

Human rating uses the original dataset scale.

DatasetDorn
Human3.59
Lines50

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
46.2Δ 23.7
Scalabrino0.6920–1; higher is more readable
75.2Δ 5.3
Dorn0.0540–1; higher is more readable
5.8Δ 64.1
Mi0.0010–1; higher is more readable
0.6Δ 69.4
LLOC21Logical lines; fewer is more readable
29.7Δ 40.3
DeepSeek V4 Pro9.330–20; mean of three runs
37.2Δ 32.7
GPT-6.1 Sol130–20; mean of three runs
30.6Δ 39.3
BTTF0.3660–1; higher is more readable
20.6Δ 49.3
Human3.591–5; original rating
69.9

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.1026.373−33.87
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.4.983−7.475

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

Score0.692

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.225.98−5.907
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.226+2.842
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.50−0.734
Indentation frequencyHow rapidly indentation changes from line to line.35+0.473
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.052+0.437
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.33−0.336
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.49.85+0.287

Intercept 0.07 + feature contributions = -2.867 (log-odds).
Score = sigmoid(-2.867) = 0.054.

Score0.001
Score21
Run 1

The code has logical intent but suffers from major readability issues. Structure is fragmented, with a dangling closing brace at the start and an incomplete if block at the end. Nesting is relatively flat, which is positive, but the kernel mixes index manipulation, shared memory layout, and ring-topology logic in one dense block. Action granularity is moderate, though several lines combine multiple concepts. Reading flow is disrupted by inconsistent formatting and unexplained magic numbers (0, blockDim.x+1, particleID+2). The purpose is partially clear through comments but the implementation details are ambiguous. Code length is concise but at the cost of clarity. The missing __syncthreads() and commented-out synchronization add confusion about correctness. Overall, the kernel is understandable only with prior knowledge of the algorithm and shared memory layout.

Run 2

The code has some readable elements like comments explaining intent and reasonable variable naming, but suffers from several readability issues. The structure is fragmented - starting with a stray closing brace and comment block. It uses a magic shared memory alias (s_addends cast to float*) which obscures intent. Missing __syncthreads() (commented out) raises correctness concerns that impact clarity. The toroidal ring logic with boundary conditions (bestID == 0, blockDim.x + 1) is confusing without clear documentation. BETTER_THAN macro obscures comparison logic. The function has too many responsibilities: loading fitnesses, updating best fitnesses, and computing neighbor bests. Action granularity is reasonable but nesting and flow are disrupted by conditional boundary handling. Overall, the code requires significant domain knowledge to understand and could benefit from clearer structure and separation of concerns.

Run 3

The code has clear intent with good comments and a logical structure, but several issues reduce readability. The missing __syncthreads() call (commented out) creates a potential data race and confusion about synchronization. Variable naming is inconsistent (g_bestFitnesses vs g_fitnesses, s_fitnesses vs s_addends) and the IMUL macro obscures simple arithmetic. Magic numbers and implicit ring topology indexing make the neighbor logic hard to follow. The function signature doesn't match the documented parameters, and the initial fragment appears disconnected from the function. Nesting is generally flat, and actions are mostly one per line, but the overall flow is disrupted by these inconsistencies. The code could benefit from clearer variable names, explicit synchronization, and more transparent index calculations.

Run 1

Code Structure: The kernel follows logical stages—index setup, fitness loading, ring-boundary handling, and neighbor comparison—but the fragment starts and ends mid-function. Nesting: Flat conditionals keep complexity low. Clarity of intent: Descriptive names and comments explain the local-best update, but BETTER_THAN, IMUL, shared-memory aliasing, and offset indices require external knowledge. The commented-out synchronization and documentation referring to an absent update flag create uncertainty. Code length: The implementation is reasonably concise, though lengthy documentation and decorative separators add clutter. Action granularity: Most statements perform one action per line, making operations easy to follow. Reading flow: The main sequence is natural, but inconsistent spacing, excessive blank lines, and shifts between particle indices and padded shared-memory indices interrupt comprehension.

Run 2

Code Structure: The kernel follows logical phases—initialization, fitness loading, ring-boundary handling, and neighbor selection—but the fragment begins and ends mid-function. Nesting: Flat, simple conditionals make control flow easy to follow. Clarity of intent: Descriptive names and comments explain the algorithm, but undocumented macros, shared-memory aliasing, an unused parameter, and a commented-out synchronization call introduce ambiguity. The documentation also mentions a flag not shown in the code. Code length: The implementation is reasonably concise, though lengthy comments and decorative separators add clutter. Action granularity: Most lines perform a single action, aiding readability. Reading flow: Operations proceed naturally, but inconsistent spacing, excessive blank lines, and bestID switching between padded shared-memory indices and particle indices require extra mental tracking.

Run 3

Code Structure: The kernel follows logical stages—initialize fitness, populate shared memory, compare neighbors, and adjust ring indices—but the excerpt includes unrelated trailing code and ends mid-function. Nesting: Flat conditionals make control flow easy to follow. Clarity of intent: Descriptive names and comments explain the local-best update, though custom macros, implicit shared-memory storage, an unused parameter, and the commented-out synchronization obscure details. The documentation also mentions a flag not shown in the implementation. Code length: The implementation is reasonably concise, but lengthy documentation and decorative separators add clutter. Action granularity: Most lines perform one action, making individual operations straightforward to inspect. Reading flow: Sequential processing is natural, but inconsistent spacing, mixed index conventions, and unexplained boundary-index conversions require extra attention.