Sample
Dorn/cuda/30
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 0.8Δ 7.8 |
| Scalabrino | 0.168 | 0–1; higher is more readable | 12.0Δ 3.4 |
| Dorn | 0 | 0–1; higher is more readable | 0.0Δ 8.6 |
| Mi | 0 | 0–1; higher is more readable | 0.3Δ 8.4 |
| LLOC | 29 | Logical lines; fewer is more readable | 13.5Δ 4.9 |
| DeepSeek V4 Pro | 10.33 | 0–20; mean of three runs | 42.9Δ 34.3 |
| GPT-6.1 Sol | 12 | 0–20; mean of three runs | 19.9Δ 11.3 |
| BTTF | 0 | 0–1; higher is more readable | 0.1Δ 8.5 |
| Human | 2.3 | 1–5; original rating | 8.6 |
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. | 3607.614 | −119.051 |
| 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.269 | −7.904 |
Intercept 8.87 + feature contributions = -98.085 (log-odds).
Score = sigmoid(-98.085) = 0.
| Score | 0.168 |
|---|
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. | 306.98 | −9.337 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 46 | +0.854 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 49 | −0.704 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 47 | −0.628 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.142 | −0.437 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 49.773 | +0.286 |
Intercept 0.07 + feature contributions = -10.7 (log-odds).
Score = sigmoid(-10.7) = 0.
| Score | 0 |
|---|
| Score | 29 |
|---|
Run 1
The code suffers from multiple readability issues. Variable names are overly abbreviated (w, a, b, h, v, I, J) without clear context, making intent ambiguous. The function uses deep nesting with multiple #ifdef blocks, reducing flow. Kernel launch configurations mix host and device pointer logic inline, creating tangled structure. Lines are long, packing multiple arguments and expressions. The pattern of calling two similar functions with nearly identical parameters feels redundant. There is no explanatory comment for the branching logic based on connections vs MAX_THREADS_PER_BLOCK, nor for random value management. Action granularity is inconsistent—some lines perform multiple operations. While some structure exists (e.g., separate initialization functions), overall clarity suffers from cryptic naming, dense lines, and lack of contextual documentation.
Run 2
The code has moderate readability with clear function names and some logical structure, but suffers from several issues. The functions are reasonably named (RandomizeWeights, ComputeStatusUnits) and the conditional compilation blocks are understandable. However, the ComputeStatusUnits function has a confusing pointer arithmetic line that packs multiple operations, and the ternary operator adds cognitive load. The kernel launch configurations with many parameters are hard to parse. Conditional compilation (#ifdef) creates visual noise and disrupts flow. The variable naming is inconsistent (w vs weights, b vs biases), and there's no documentation explaining the RBM-specific terms (visible/hidden units, CD-k, etc.). The action granularity varies - some lines perform single operations while others combine multiple. The nested conditionals and preprocessor directives make the reading flow choppy. The code lacks whitespace and comments to separate logical sections. Overall, someone familiar with RBMs and CUDA could follow it, but a newcomer would struggle.
Run 3
The code shows a mix of clear and problematic elements. Structure attempts logical organization with separate functions for initialization and computation, but suffers from inconsistent naming conventions (Kernel vs KERNEL prefixes) and heavy preprocessor conditional blocks that disrupt flow. Nesting is moderate - the deepest nesting occurs in conditional compilation sections, making the code hard to follow. The intent is generally clear (RBM weight initialization and unit computation), but the two parallel paths for large vs small connections create ambiguity. Code length is reasonable but could be more concise by extracting repeated initialization patterns. Action granularity varies - some lines pack multiple operations while others are appropriately single-purpose. Reading flow is disrupted by the #ifdef blocks interrupting the natural sequence of operations. The pointer arithmetic for random value offsetting is somewhat opaque and could benefit from clearer variable naming or extraction into a helper function.
Run 1
Code Structure: Function boundaries and initialization stages provide logical organization, but conditional compilation and lengthy kernel calls obscure it. Nesting: Shallow conditionals keep complexity manageable. Clarity of intent: Descriptive function names help, while terse identifiers such as I, J, a, b, and w, unexplained constants, and absent comments require domain knowledge. Code length: Generally concise, but declarations and kernel invocations are excessively long horizontally. Action granularity: Most statements perform one action per line, though the weight initialization loop combines control flow and assignment on one line. Reading flow: Blank lines separate stages naturally, but inconsistent spacing, dense argument lists, and preprocessor branches interrupt scanning. The snippet ends before ComputeStatusUnits closes, limiting readability and assessment of its complete flow.
Run 2
Code Structure: Function boundaries and initialization stages provide logical organization, but conditional compilation and lengthy kernel calls clutter it. Nesting: Control flow is shallow, with simple conditionals and no deeply nested blocks. Clarity of intent: Descriptive function names reveal RBM initialization and unit computation, but terse identifiers such as I, J, a, b, v, and h require domain knowledge. Code length: The excerpt is reasonably concise, although long argument lists and duplicated conditional launch variants increase reading effort. Action granularity: Most statements perform one action per line, but the single-line weight-initialization loop compresses iteration and assignment. Reading flow: Execution generally follows a natural sequence, but inconsistent spacing, dense expressions, and indented preprocessor directives interrupt scanning. The excerpt also ends without closing ComputeStatusUnits, making its overall flow incomplete.
Run 3
Code Structure: Functions separate initialization from unit computation, but conditional compilation and CUDA launch details clutter the organization; the excerpt also ends mid-function. Nesting: Shallow loops and simple if/else branches are easy to follow. Clarity of intent: Descriptive function names communicate the main operations, while abbreviated variables such as I, J, a, b, and rnd obscure their roles. Code length: Generally concise, but lengthy declarations and kernel argument lists are difficult to scan. Action granularity: Most statements perform one action per line, though the inline weight-initialization loop compresses iteration and assignment. Reading flow: Initialization proceeds logically into device updates and bias setup, but inconsistent spacing, long lines, preprocessor branches, and missing explanatory comments interrupt readability.