Sample
Dorn/cuda/78
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 4.7Δ 3.9 |
| Scalabrino | 0.087 | 0–1; higher is more readable | 5.4Δ 4.6 |
| Dorn | 0.113 | 0–1; higher is more readable | 7.5Δ 6.7 |
| Mi | 0.118 | 0–1; higher is more readable | 12.0Δ 11.1 |
| LLOC | 23 | Logical lines; fewer is more readable | 24.8Δ 24.0 |
| DeepSeek V4 Pro | 6.33 | 0–20; mean of three runs | 18.1Δ 17.3 |
| GPT-6.1 Sol | 13 | 0–20; mean of three runs | 30.6Δ 29.8 |
| BTTF | 0 | 0–1; higher is more readable | 0.1Δ 0.7 |
| Human | 1.71 | 1–5; original rating | 0.8 |
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. | 2517.427 | −83.075 |
| Source linesThe number of non-empty source lines. | 30 | +12 |
| 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.073 | −7.609 |
Intercept 8.87 + feature contributions = -69.814 (log-odds).
Score = sigmoid(-69.814) = 0.
| Score | 0.087 |
|---|
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. | 180.806 | −3.993 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 181 | +2.116 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 29 | +0.266 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 29 | −0.245 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.119 | −0.217 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 31 | −0.061 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 29.692 | +0.005 |
Intercept 0.07 + feature contributions = -2.059 (log-odds).
Score = sigmoid(-2.059) = 0.113.
| Score | 0.118 |
|---|
| Score | 23 |
|---|
Run 1
The code is barely readable due to severe structural issues. The first line appears orphaned from a previous block, and excessive decorative comments add noise without clarity. The host functions are poorly named ('h_findBestFitness' vs 'initRandomStates'), and parameter lists are excessively long. The worst section is h_findBestFitness: an eight-level if-else chain with near-identical template instantiations creates deep logical nesting and massive redundancy. Each branch repeats the same kernel launch with only block size and shared memory differing, making intent obscured. Actions are packed into single lines (kernel launches with many arguments), violating one-action-per-line. Reading flow is broken by inconsistent formatting, magic numbers (8, 16, 32...), and hidden relationships between block sizes and shared memory. The getThreadNumForReduction function is inexplicably placed between unrelated host functions. Overall, the code requires significant refactoring for clarity.
Run 2
The code is a mix of readable and unreadable sections. The initRandomStates function is concise and clear, and getThreadNumForReduction is short but slightly cryptic due to the dense math. The h_findBestFitness function is the biggest problem: a long if-else chain with repetitive template instantiations, each containing duplicated arguments, making it unnecessarily long and hard to scan. The code is flat (good) and each line does roughly one action, but the repetition hurts clarity. The initial dangling assignment `g_globalBestID[setID] = s_fitnesses[0];` appears out of context, suggesting a cut-off snippet. Overall structure is logical but verbose.
Run 3
The code shows some organization with host function section markers and consistent naming, but readability suffers from several issues. The function signatures are extremely long with many parameters, making them hard to parse. The if-else chain for different block sizes is repetitive and could be replaced with a lookup table or switch statement. Magic numbers (8, 16, 32, 64, etc.) lack explanation. Some lines are excessively long, violating the one-action-per-line principle. The first line appears orphaned without context, and the template syntax with varying spacing is inconsistent. While the overall structure is logical, the dense formatting and repetitive branching pattern reduce clarity. The code would benefit from breaking long function calls into multiple lines, adding comments explaining the block size logic, and extracting repeated patterns into helper functions or macros.
Run 1
Code Structure: Host functions are grouped logically, but the opening fragment lacks context. Nesting: The flat if/else-if dispatch is easy to follow, with no deep nesting. Clarity of intent: Function names communicate random-state initialization and fitness reduction, but abbreviated parameters, unexplained shared-memory sizes, and a dense mathematical expression reduce clarity. Code length: Short overall, though repeated kernel-launch arguments make the dispatch verbose. Action granularity: Most lines contain one action, but the single-line function definitions compress declarations and operations unnecessarily. Reading flow: Ascending block-size thresholds provide a natural progression; inconsistent spacing, long lines, omitted conditional braces, and the oversized separator interrupt otherwise straightforward reading.
Run 2
Code Structure: Host functions are separated and logically grouped, but the fragment begins with an orphaned assignment and closing brace. Nesting: The flat if/else-if dispatch is easy to follow, with no deep nesting. Clarity of intent: Function names communicate random-state initialization and fitness reduction, but the dense mathematical expression and unexplained shared-memory sizes require interpretation. Code length: Functions are short overall, although eight nearly identical kernel launches create substantial repetition. Action granularity: Most statements perform one action, but single-line function definitions and the compound reduction-size calculation compress details. Reading flow: Ascending block-size thresholds provide a predictable sequence, and error checking appears naturally at the end; inconsistent spacing, long lines, and a large decorative separator interrupt scanning.
Run 3
Code Structure: Host functions are clearly separated, but the fragment starts with an orphaned statement and closing brace. Nesting: The shallow if/else chain is easy to follow, although missing braces reduce visual boundaries. Clarity of intent: Function names communicate random-state initialization, reduction sizing, and fitness selection; unexplained launch constants and the dense mathematical expression require interpretation. Code length: Functions are short, but eight nearly identical kernel launches introduce substantial repetition. Action granularity: Most lines perform one action, though single-line function definitions compress declarations and implementation. Reading flow: The ascending block-size cases provide a natural sequence, followed by error checking, but inconsistent spacing, long signatures, and an oversized section banner interrupt readability.