Sample
Dorn/cuda/10
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 5.0Δ 3.9 |
| Scalabrino | 0.278 | 0–1; higher is more readable | 18.6Δ 9.7 |
| Dorn | 0.216 | 0–1; higher is more readable | 17.8Δ 8.9 |
| Mi | 0.03 | 0–1; higher is more readable | 5.0Δ 3.9 |
| LLOC | 30 | Logical lines; fewer is more readable | 11.4Δ 2.5 |
| DeepSeek V4 Pro | 7.67 | 0–20; mean of three runs | 27.2Δ 18.2 |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs | 52.8Δ 43.9 |
| BTTF | 0.122 | 0–1; higher is more readable | 1.9Δ 7.0 |
| Human | 2.38 | 1–5; original rating | 8.9 |
Views
Select the downloaded ZIP or its extracted folder. Files stay in your browser.
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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. | 2712.038 | −89.497 |
| 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.326 | −7.989 |
Intercept 8.87 + feature contributions = -68.616 (log-odds).
Score = sigmoid(-68.616) = 0.
| Score | 0.278 |
|---|
Feature contributions
| Feature | Value | Contribution (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. | 152.941 | −2.813 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 152.98 | +1.664 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 44 | +0.785 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 44 | −0.589 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 43 | −0.486 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 49.786 | +0.286 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.118 | −0.206 |
Intercept 0.07 + feature contributions = -1.289 (log-odds).
Score = sigmoid(-1.289) = 0.216.
| Score | 0.03 |
|---|
| Score | 30 |
|---|
Run 1
This CUDA kernel code scores low on readability. The structure lacks logical organization, with shared memory indexing, pointer arithmetic, and boundary handling intermixed without clear separation. Nesting is not extreme, but complex expressions within loops make comprehension difficult. Intent is obscured by cryptic macro names (e.g., COLUMNS_RESULT_STEPS, COLUMNS_BLOCKDIM_Y) and unexplained magic values. Code length is moderate but dense, with multiple operations packed into single lines (pointer offsets, ternary conditionals, array indexing). Action granularity is poor—several lines combine computation, memory access, and boundary checks. Reading flow is disrupted by inconsistent spacing, dangling punctuation like `]=`, and commented-out assertions. The use of pragmas and ternary operators further reduces clarity. These patterns increase cognitive load, especially for engineers unfamiliar with CUDA column convolution. While some structural conventions exist (e.g., halo/result loops), the overall implementation is hard to parse without deep domain knowledge.
Run 2
The code exhibits poor readability due to complex macro-based indexing, dense expressions, and unclear parameter conventions. The shared memory indexing with COLUMNS_BLOCKDIM_Y and COLUMNS_RESULT_STEPS requires significant mental effort to understand. Multiple operations are performed per line (e.g., pointer arithmetic combined with assignment), violating the one-action-per-line principle. The variable naming is inconsistent - imageW is passed as pitch parameter, creating ambiguity. While the code has logical sections (main data, upper halo, lower halo, computation), deep nesting within loops and complex bounds-checking ternaries reduce clarity. There are no explanatory comments about the halo/stencil algorithm. The kernel launch parameters and macro definitions are not visible, making the code impossible to fully evaluate. Overall, this is typical CUDA code focused on performance optimization rather than readability, requiring domain expertise to decipher.
Run 3
The code demonstrates moderate readability for CUDA kernel implementation. Structure is logical with clear separation of main data, halo regions, and computation. However, the heavy use of macros (COLUMNS_BLOCKDIM_X, COLUMNS_RESULT_STEPS, etc.) obscures core logic and requires external context to understand. Long expressions on single lines reduce readability, particularly array indexing and conditional operators. The shared memory declaration with complex arithmetic is difficult to parse. Comments are minimal and don't explain the tiling strategy or why specific offsets are used. Variable names are concise but some abbreviations (d_Dst, d_Src) could be clearer. While the code follows CUDA conventions, the dense formatting and macro-heavy approach make it challenging for developers unfamiliar with the specific constants to quickly grasp the algorithm's intent. The unrolled loops with conditional bounds add cognitive load.
Run 1
Code Structure: The kernel and launch wrapper are clearly separated, with commented sections for data loading, halos, and computation. Nesting: Mostly flat loops with only one nested convolution loop, making control flow easy to follow. Clarity of intent: Names and comments convey column convolution, but dense indexing, external constants, and the unexplained kernel offset require CUDA-specific knowledge. Code length: Reasonably concise, although repeated indexing expressions and a commented-out assertion add clutter. Action granularity: Most lines perform one assignment or operation; long expressions increase cognitive load without combining unrelated actions. Reading flow: Loading, synchronization, computation, and launch setup follow a natural sequence. Inconsistent spacing, long lines, and unbraced loop bodies slightly hinder scanning.
Run 2
Code Structure: Clearly separates the GPU kernel from its launch wrapper and organizes loading, halo handling, and computation into commented phases. Nesting: Mostly shallow, with only two nested loops for convolution. Clarity of intent: Function names and comments communicate column convolution, but dense indexing expressions, external constants, and the unexplained kernel-array offset require CUDA-specific knowledge. Code length: Reasonably concise, although repeated indexing formulas and a commented-out assertion add clutter. Action granularity: Generally one operation per line; loop headers and ternary assignments remain conventional. Reading flow: Follows a natural load–synchronize–compute–store sequence, then launch configuration. Inconsistent spacing, long lines, and omitted braces on loop bodies slightly reduce readability.
Run 3
Code Structure: Logically separates data loading, halo handling, convolution, and GPU launch setup, with useful section comments. Nesting: Mostly flat, with only a two-level loop for convolution; omitted braces slightly reduce scanability. Clarity of intent: Function names and comments communicate column convolution, but dense indexing, external constants, and the unexplained kernel-array offset require domain knowledge. Code length: Compact and largely necessary, although repeated indexing expressions and a commented-out assertion add clutter. Action granularity: Generally one assignment or operation per line, with conventional loop headers. Reading flow: Follows a natural load–synchronize–compute–store sequence, then launch configuration, but long lines and inconsistent spacing make expressions harder to parse.