Sample

Dorn/cuda/42

Human rating uses the original dataset scale.

DatasetDorn
Human2.93
Lines50

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
26.7Δ 1.1
Scalabrino0.6230–1; higher is more readable
64.0Δ 38.3
Dorn0.490–1; higher is more readable
42.3Δ 16.7
Mi0.6850–1; higher is more readable
79.4Δ 53.8
LLOC22Logical lines; fewer is more readable
26.7Δ 1.1
DeepSeek V4 Pro13.670–20; mean of three runs
62.8Δ 37.2
GPT-6.1 Sol13.330–20; mean of three runs
34.7Δ 9.1
BTTF0.4280–1; higher is more readable
28.7Δ 3.1
Human2.931–5; original rating
25.6

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.1390.211−45.877
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.119−7.678

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

Score0.623

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.45+0.819
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.51−0.769
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.91.98+0.68
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.45−0.612
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.49.849+0.287
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.126−0.285
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.91.98−0.231

Intercept 0.07 + feature contributions = -0.041 (log-odds).
Score = sigmoid(-0.041) = 0.49.

Score0.685
Score22
Run 1

The code is generally readable with clear separation of kernel functions and logical structure. It uses flat control flow with minimal nesting, and most lines perform a single action. Intent is mostly clear, especially in the setup_kernel. However, readability is hampered by several factors: the function naming uses camelCase while variables use snake_case (inconsistent style), multiple operations are packed into single lines (e.g., posID calculation, IMUL chains), and heavy use of preprocessor conditionals (#ifdef MAXIMIZE) fragments the logic flow. The shared memory extern declaration lacks context about its size or purpose. Template parameter threadNum obscures launch configuration details. Comments are helpful but sparse. Overall structure is solid but style inconsistencies and dense expressions reduce clarity.

Run 2

The code is fairly readable but has several issues. It uses meaningful function and variable names, follows a logical structure, and separates setup from fitness evaluation. However, it suffers from excessive preprocessor conditional blocks (#ifdef MAXIMIZE/#else) that interrupt reading flow and make intent harder to follow. The template parameter 'threadNum' has no explicit constraint or documentation. Multiple operations occur per line (e.g., posID calculation), reducing action granularity. The code mixes initialization, conditional assignment, reduction, and global update in one kernel with limited comments explaining the overall algorithm. Nesting is shallow, which is good. The shared memory pointer cast from extern 'array' lacks clarity. Overall, the code is functional and not tangled, but could be improved with refactoring to reduce conditional compilation, better comments, and clearer separation of concerns.

Run 3

The code shows moderate readability. Structure is logical with clear kernel separation, and the reduceToMax/Min abstraction is good. Action granularity is mostly one-action-per-line. However, issues exist: preprocessor conditionals create visual clutter and duplicate logic for MAXIMIZE/MINIMIZE; magic numbers (-1e20, 1e20) lack named constants; the shared memory pointer 'array' is cryptic; inconsistent brace style and the stray __syncthreads() usage is misleading. Nesting is relatively flat, but the conditional compilation branches make flow harder to follow. Variable names like 'posID', 'setID', 'tid' are reasonably clear, but 's_fitnesses' naming is redundant. Overall, understandable but would benefit from refactoring the min/max logic into separate functions and improving naming/constants.

Run 1

Code Structure: Separate kernels and distinct initialization, reduction, and update stages provide logical organization, but the snippet ends without closing the second kernel. Nesting: Shallow conditionals keep complexity low, although preprocessor branches interrupt the flow. Clarity of intent: Descriptive kernel names and comments explain the main purpose; abbreviated identifiers, unexplained IMUL usage, magic sentinel values, and the unused g_globalBestID parameter reduce clarity. The minimum-reduction comment is misleading under MAXIMIZE. Code length: Generally concise, though initialization assignments are somewhat repetitive. Action granularity: Most lines perform one action, making operations easy to follow. Reading flow: The algorithm progresses naturally, but inconsistent spacing, indentation, pointer formatting, and the long index calculation make reading less smooth.

Run 2

Code Structure: Separate kernels and a staged initialization/reduction/update sequence provide logical organization, but the supplied snippet ends without closing the second function. Nesting: Shallow conditionals keep control flow easy to follow, although preprocessor branches add visual complexity. Clarity of intent: Descriptive kernel names and comments explain the purpose, but abbreviations such as tid and posID, external macros, magic sentinel values, and the unused g_globalBestID parameter obscure details. Code length: Mostly concise, though bestFitness introduces redundant assignments. Action granularity: Statements generally perform one action per line; the position calculation is comparatively dense. Reading flow: Execution proceeds naturally, but inconsistent indentation, whitespace, pointer formatting, and mixed comment styles interrupt scanning. The minimum-only reduction comment also conflicts with the MAXIMIZE branch.

Run 3

Code Structure: Separate kernels and a clear initialization/load/reduction/update sequence provide logical organization, but the snippet ends without closing the function, and several parameters or variables appear unused. Nesting: Shallow conditionals keep complexity low, though preprocessor branches interrupt the layout. Clarity of intent: Kernel names and comments explain the main purpose; abbreviations, IMUL, external reduction helpers, and magic values require additional context. Code length: Mostly concise, but duplicated initialization and the intermediate bestFitness variable add minor redundancy. Action granularity: Statements generally perform one action per line, although index calculations combine several operations. Reading flow: Execution proceeds naturally, but inconsistent indentation, pointer spacing, line wrapping, and comment formatting reduce visual consistency.