Sample
Dorn/cuda/59
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 12.1Δ 19.6 |
| Dorn | 0.187 | 0–1; higher is more readable | 14.9Δ 16.9 |
| Mi | 0.456 | 0–1; higher is more readable | 46.7Δ 14.9 |
| LLOC | 30 | Logical lines; fewer is more readable | 11.4Δ 20.3 |
| DeepSeek V4 Pro | 9 | 0–20; mean of three runs | 34.7Δ 2.9 |
| GPT-6.1 Sol | 13 | 0–20; mean of three runs | 30.6Δ 1.1 |
| BTTF | 0.446 | 0–1; higher is more readable | 32.5Δ 0.7 |
| Human | 3.02 | 1–5; original rating | 31.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. | 2106.21 | −69.505 |
| 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.058 | −7.586 |
Intercept 8.87 + feature contributions = -48.221 (log-odds).
Score = sigmoid(-48.221) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 45 | +0.819 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.177 | −0.776 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 48 | −0.663 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 46 | −0.635 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 49.524 | +0.282 |
| 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. | 80.882 | +0.239 |
Intercept 0.07 + feature contributions = -1.468 (log-odds).
Score = sigmoid(-1.468) = 0.187.
| Score | 0.456 |
|---|
| Score | 30 |
|---|
Run 1
The code shows a parallel reduction pattern but struggles with readability due to heavy repetition and dense conditional nesting. Structure is logical but monolithic—each reduction step is copy-pasted with minor changes. Nesting depth is moderate (two levels), yet the repeated if-blocks make it feel deeply tangled. Clarity of intent is partially obscured: the reduction logic is recognizable but buried under boilerplate. Code length is unnecessarily long; a loop or macro could collapse the repetitive blocks. Action granularity is mostly one action per line, but the verbose conditionals reduce scanning efficiency. Reading flow is disorganized due to the repetitive, blocky layout and lack of abstraction, though the sequential halving pattern is discernible. Overall, it's understandable for CUDA experts but not highly readable or maintainable for general software engineers.
Run 2
The code shows a consistent pattern for parallel reduction, which helps intent, but it is highly repetitive and verbose. Each block duplicates the same compare-and-swap logic, making the overall structure long and hard to scan. Nesting is moderate—only two levels per block—but the many sequential if statements increase cognitive load. Action granularity is acceptable, with one logical operation per line, but the volatile pointer setup interrupts the flow. The reading flow is disrupted by the abrupt start, the repeated blockSize checks, and the lack of helper functions or macros. The code would benefit from a loop or templated unrolling to reduce duplication. Overall, the logic is understandable but unnecessarily long, making it less readable.
Run 3
The code shows a clear parallel reduction pattern but suffers from repetitive, hardcoded block sizes and deeply nested conditionals. Structure is logical but fragmented, with duplicated logic for each reduction step. Nesting is shallow but the repeated if-blocks create visual clutter. Intent is somewhat clear to CUDA developers, but the pattern could be expressed more concisely with a loop or template. Code length is unnecessarily long due to unrolled, copy-pasted blocks. Each line performs a single action, which is good, but the flow is repetitive and disrupts natural reading. Overall, functional but not elegant or easily maintainable.
Run 1
Code Structure: Reduction stages are logically ordered by decreasing block size, but the fragment starts with an unmatched closing brace and ends incomplete. Nesting: Two to three conditional levels add moderate complexity. Clarity of intent: Comparisons and paired value/index updates suggest a minimum reduction, though CUDA-specific synchronization and volatile aliases lack explanatory comments. Code length: Repeated stages make the snippet verbose, although explicit unrolling exposes each step. Action granularity: Each assignment and synchronization occupies its own line, making individual operations easy to follow. Reading flow: Consistent formatting and descending offsets create a predictable sequence, but repeated indexing expressions and the switch to underscore-prefixed aliases increase reading effort.
Run 2
Code Structure: Reduction stages are logically organized by decreasing block size, but the fragment starts with an unmatched closing brace and ends incomplete. Nesting: Two to three conditional levels are manageable, though the warp-level section is more nested. Clarity of intent: Names and comparisons suggest a minimum-value reduction that tracks positions, but comments explaining synchronization and volatile pointers would help. Code length: Repeated, explicitly unrolled stages increase length, although this may serve GPU performance requirements. Action granularity: Each assignment and synchronization call occupies its own line, making operations easy to distinguish. Reading flow: Consistent indentation and descending offsets create a predictable progression, but repetition, long indexed expressions, and incomplete context slow comprehension.
Run 3
Code Structure: Reduction stages are logically organized by decreasing block size, although the fragment starts with an unmatched closing brace and ends incomplete. Nesting: Two to three conditional levels add moderate complexity but remain manageable. Clarity of intent: Names such as minvalue and minpos suggest minimum-value reduction with position tracking; CUDA-specific synchronization and volatile aliases require specialized knowledge, and comments would help explain the stages. Code length: Repeated comparison-and-update blocks make the snippet verbose, though explicit unrolling may serve performance needs. Action granularity: Each assignment and synchronization occupies its own line, making operations easy to distinguish. Reading flow: Consistent indentation and descending offsets provide a predictable flow, but repetitive indexing expressions and the switch to underscored aliases add visual noise.