Sample
Dorn/cuda/27
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 24.0Δ 21.4 |
| Dorn | 0.485 | 0–1; higher is more readable | 41.5Δ 3.9 |
| Mi | 0.278 | 0–1; higher is more readable | 27.3Δ 18.1 |
| LLOC | 20 | Logical lines; fewer is more readable | 32.5Δ 13.0 |
| DeepSeek V4 Pro | 8 | 0–20; mean of three runs | 29.4Δ 16.0 |
| GPT-6.1 Sol | 13.67 | 0–20; mean of three runs | 37.7Δ 7.7 |
| BTTF | 0.455 | 0–1; higher is more readable | 33.4Δ 12.0 |
| Human | 3.28 | 1–5; original rating | 45.4 |
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. | 1224.683 | −40.415 |
| 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. | 4.97 | −7.454 |
Intercept 8.87 + feature contributions = -26.999 (log-odds).
Score = sigmoid(-26.999) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.144 | −0.455 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 73.226 | +0.377 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 24 | −0.13 |
| 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. | 83.968 | +0.109 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 31 | −0.061 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 22 | +0.024 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 29.918 | +0.008 |
Intercept 0.07 + feature contributions = -0.058 (log-odds).
Score = sigmoid(-0.058) = 0.485.
| Score | 0.278 |
|---|
| Score | 20 |
|---|
Run 1
The code has several readability issues. The structure is fragmented with unclear synchronization boundaries and a conditional block that leaves the function scope ambiguous. The binning logic is repetitive with four separate if-statements that could be consolidated using clamp functions. The loop at the end runs entirely on a single thread, creating a bottleneck and making the parallel intent unclear. There's commented-out code that adds confusion. Variable names like 's_binned_A' are reasonably descriptive, but the overall flow jumps between shared memory operations, synchronization, and serial processing without clear separation. The scale calculation is concise but the purpose of histogram binning is not well-documented. The nesting is moderate but the control flow is messy, especially with the return statement after an unclosed conditional block. The action granularity is generally one operation per line, but this doesn't compensate for the structural problems that make the code difficult to follow.
Run 2
The code has some logical organization, but readability suffers from several issues. The nesting is moderate but the final section combines loops and conditionals in a way that obscures intent. Clarity of intent is mixed: the binning calculations are understandable, but the boundary clamping via repeated single-line if statements is verbose and unclear. Code length is acceptable, but action granularity is inconsistent—some lines perform multiple operations while repetitive if-statements each perform one trivial action. Reading flow is disrupted by commented-out code and unclear synchronization. Error handling for edge cases (values equal to max) is implicit rather than explicit. Variable naming is reasonably descriptive, and shared memory usage is clear. Overall, the code works but requires effort to understand, with room for improvement in structure and clarity.
Run 3
The code performs a GPU histogram binning operation but suffers from several readability issues. The structure is somewhat logical but lacks encapsulation, and the flat conditional checks for bounds feel repetitive. There is moderate nesting with multiple if statements, though not deeply nested. Clarity of intent is hindered by cryptic variable names like 'tid', 's_binned_A', and 'd_array_A' with minimal comments explaining the algorithm's purpose. The code length is reasonable but could be more concise with helper functions or macros for binning. Action granularity is mixed—some lines contain multiple operations while others are properly separated. Reading flow is disjointed due to abrupt transitions between shared memory loading, synchronization, and final histogram writing. The commented-out alternative implementation adds confusion. Overall, the code requires significant effort to understand without prior context about the CUDA histogram computation.
Run 1
Code Structure: Scaling, binning, clamping, and histogram updates form logical stages, but duplicated clamping and a leftover commented statement add clutter. Nesting: Mostly shallow, though the final unbraced if/for/if chain makes scope harder to follow. Clarity of intent: Comments and variable names convey histogram construction, but abbreviations and the synchronization inside a conditional require CUDA knowledge to interpret. Code length: Reasonably concise, with some repetitive indexing and unnecessary trailing clutter. Action granularity: Each statement performs one main action, although the histogram increment combines index calculation and updating. Reading flow: The processing sequence is natural, but inconsistent spacing, omitted braces, and unmatched closing braces in the supplied snippet interrupt readability.
Run 2
Code Structure: Scaling, binning, clamping, and histogram updates follow a logical sequence, though the synchronization placement makes thread participation harder to follow. Nesting: Mostly shallow, but the final unbraced if/for/if chain reduces visual clarity. Clarity of intent: Variable names and comments convey histogram construction, although abbreviated identifiers and CUDA-specific operations require background knowledge. Code length: Reasonably concise, but repeated clamping logic and a commented-out alternative add clutter. Action granularity: Most lines perform one action; the loop header and indexed histogram increment are conventional exceptions. Reading flow: The processing order is natural, but inconsistent spacing, omitted braces, and trailing closing braces without surrounding context interrupt readability.
Run 3
Code Structure: Scaling, binning, clamping, and histogram updates follow a logical sequence, although duplicated A/B handling adds repetition. Nesting: Mostly shallow, but the final unbraced if/for/if chain makes control boundaries harder to follow. Clarity of intent: Variable names and comments communicate histogram construction, though abbreviations and dense indexing require GPU context. The conditional synchronization also complicates understanding of thread coordination. Code length: Fairly concise, but the commented-out alternative update and repeated clamping statements add clutter. Action granularity: Each statement generally performs one action; loop control and the indexed increment are conventional exceptions. Reading flow: Processing order is natural, but inconsistent spacing, omitted braces, and trailing closing braces without surrounding context reduce readability.