Sample
Dorn/cuda/36
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 8.6Δ 10.6 |
| Scalabrino | 0 | 0–1; higher is more readable | 0.0Δ 19.2 |
| Dorn | 0.02 | 0–1; higher is more readable | 3.1Δ 16.2 |
| Mi | 0.333 | 0–1; higher is more readable | 32.6Δ 13.4 |
| LLOC | 35 | Logical lines; fewer is more readable | 4.5Δ 14.8 |
| DeepSeek V4 Pro | 9.33 | 0–20; mean of three runs | 37.2Δ 18.0 |
| GPT-6.1 Sol | 13 | 0–20; mean of three runs | 30.6Δ 11.4 |
| BTTF | 0.321 | 0–1; higher is more readable | 17.5Δ 1.7 |
| Human | 2.76 | 1–5; original rating | 19.2 |
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. | 2458.945 | −81.145 |
| 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.104 | −7.656 |
Intercept 8.87 + feature contributions = -59.931 (log-odds).
Score = sigmoid(-59.931) = 0.
| Score | 0 |
|---|
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. | 150.961 | −2.729 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 39 | +0.612 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.147 | −0.486 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 39 | −0.474 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 40 | −0.38 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 49.013 | +0.275 |
Intercept 0.07 + feature contributions = -3.916 (log-odds).
Score = sigmoid(-3.916) = 0.02.
| Score | 0.333 |
|---|
| Score | 35 |
|---|
Run 1
The code shows moderate readability but suffers from significant redundancy. The switch statement in KernelCalculateRMS repeats nearly identical kernel launch calls for each block size, making the code unnecessarily long and harder to maintain. The template parameter is the only variation, but each case is written out manually rather than using a macro or dispatch mechanism. Nesting is minimal and structure is logical, but the repetitive nature obscures intent and increases cognitive load. The initial if-block with RMS calculation is reasonably clear, with one action per line and proper handling of edge cases, though the variable naming (fRMS vs rmsOut) could be more consistent. Action granularity is acceptable within the shown portion, but the switch statement's repeated launches represent multiple actions that could be simplified. Reading flow is disrupted by the dense repetition. Overall, the code is functional but not optimized for readability or maintainability.
Run 2
The code shows a clear purpose (launching CUDA kernels for RMS calculation) and uses a structured switch-case pattern, which aids comprehension. However, readability is significantly reduced by extreme repetition: each blockSize case performs the same operation with only the template parameter changed. This makes the code unnecessarily long (about 30 lines for one logical action) and harder to maintain. The first function snippet has acceptable nesting (2 levels) and clear intent, with each line performing a single action. The reading flow is natural for CUDA code, but the switch-case repetition interrupts it. While the structure is logical and flat, the lack of abstraction (e.g., a templated helper or macro) penalizes conciseness and action granularity. Overall, it is readable but verbose.
Run 3
The code is moderately readable but suffers from significant verbosity and repetition. The switch statement launching different template instantiations of CalculateRMS is unnecessarily long and could be replaced with a lookup table or macro. The CUDA kernel launch syntax is dense and difficult to parse, with many parameters on a single line. The conditional compilation (#ifdef FERMI) adds complexity. Variable names are somewhat clear but the pattern of identical kernel launches with only template parameters changing hurts readability. The code lacks explanatory comments and the overall flow is disorganized - the block size handling feels disconnected from the actual kernel logic. While the RMS calculation snippet at the top is reasonably clear, the overall presentation would benefit from consolidation of the kernel launch logic into a more compact, data-driven approach.
Run 1
Code Structure: The switch logically organizes kernel dispatch by block size, but the fragment begins and ends mid-structure. Nesting: Mostly shallow, with straightforward cases and a small conditional section. Clarity of intent: Function and variable names indicate RMS calculation, though the fallback value, division by two, and CUDA-specific macros lack explanation. Code length: Repeated kernel launches make the dispatch verbose, although template specialization partly justifies repetition. Action granularity: Most lines contain one action; the inline conditional assignment is a minor exception. Reading flow: Consistent case ordering and spacing help scanning, but long signatures and launch expressions, preprocessor directives, and incomplete boundaries interrupt the flow.
Run 2
Code Structure: The switch logically organizes kernel launches by block size, but the excerpt starts and ends mid-block, obscuring boundaries. Nesting: Visible nesting is shallow and manageable. Clarity of intent: Function and variable names communicate RMS calculation and dispatch, although the normalization factor and invalid-value fallback lack explanation. Code length: Repeated launch statements and long argument lists make the dispatch verbose, even if template specialization motivates repetition. Action granularity: Most lines perform one action; the inline conditional assignment is slightly less scannable. Reading flow: Consistent case ordering, indentation, and spacing make the switch predictable, but preprocessor directives, lengthy lines, and incomplete surrounding context interrupt the flow.
Run 3
Code Structure: The switch logically organizes kernel launches by block size, but the fragment starts and ends mid-structure, limiting context. Nesting: Visible nesting is shallow and easy to follow. Clarity of intent: Function and variable names indicate RMS calculation and dispatch, though the normalization factor and invalid-value fallback are unexplained. Code length: Repeated launch statements and long argument lists make the code verbose, although distinct template instantiations justify some repetition. Action granularity: Most lines perform one action; the inline conditional assignment slightly compresses the flow. Reading flow: Consistent case ordering, indentation, and spacing support scanning, but long lines, conditional compilation, and incomplete boundaries interrupt otherwise predictable reading.