Sample

Dorn/cuda/31

Human rating uses the original dataset scale.

DatasetDorn
Human3.65
Lines50

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
37.3Δ 36.5
Scalabrino0.8240–1; higher is more readable
88.0Δ 14.2
Dorn0.4490–1; higher is more readable
38.7Δ 35.1
Mi0.6840–1; higher is more readable
79.1Δ 5.3
LLOC18Logical lines; fewer is more readable
38.4Δ 35.4
DeepSeek V4 Pro90–20; mean of three runs
34.7Δ 39.1
GPT-6.1 Sol13.670–20; mean of three runs
37.7Δ 36.1
BTTF0.4030–1; higher is more readable
24.2Δ 49.6
Human3.651–5; original rating
73.8

Views

Download official ZIP ↗

Select the downloaded ZIP or its extracted folder. Files stay in your browser.

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.1202.748−39.691
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.093−7.639

Intercept 8.87 + feature contributions = -18.46 (log-odds).
Score = sigmoid(-18.46) = 0.

Score0.824

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.51−0.769
Indentation frequencyHow rapidly indentation changes from line to line.40+0.646
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.159−0.603
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.84+0.551
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.40−0.497
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.49.824+0.287
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.922+0.111

Intercept 0.07 + feature contributions = -0.205 (log-odds).
Score = sigmoid(-0.205) = 0.449.

Score0.684
Score18
Run 1

The code has some structure but suffers from significant readability issues. The main problems are: (1) minimal error checking - CUDA memory operations and the device-to-host copy have no return value checks, making failure modes unclear; (2) implicit type casts and mixed use of void pointers without clear intent; (3) the large commented-out mlock/munlock blocks create noise and unclear status; (4) incomplete resource cleanup - devPtr is never freed, and backPtr is also leaked; (5) magic number 126 lacks explanation; (6) the for-loop writes byte-by-byte with an index variable that could be clearer. On the positive side, indentation is mostly consistent, variable names are reasonably descriptive, and the code follows a sequential logic. However, missing error handling for critical CUDA operations and incomplete cleanup significantly reduce both clarity and reliability.

Run 2

The code has a clear top-level flow (allocate, initialize, copy to device, copy back, free), but several readability issues lower the score. The structure is fragmented with commented-out code blocks disrupting the reading flow, and includes unused headers (sched.h, fcntl.h, sys/mman.h) that add noise. Error handling is inconsistent—some paths return -1, others (cudaMemcpy) lack checking entirely, making intent unclear. Variable naming (hostPtr, backPtr, devPtr) is acceptable but not descriptive. The initialization loop is straightforward but could use memset-like clarity. The code is sufficiently flat with minimal nesting, and actions are mostly one per line, but the overall organization feels incomplete (missing device free, no cudaFree, truncated main). The commented-out mlock/munlock sections create ambiguity about intended functionality. While individual lines are simple, the lack of cohesive structure and unexplained omissions make the code harder to follow than necessary.

Run 3

The code has a clear overall flow but suffers from readability issues. Structure is linear but incomplete: missing closing braces, return statement, and device memory cleanup. Nesting is acceptable with only basic conditionals. Intent is generally clear (CUDA memory transfer test), but commented-out mlock/munlock blocks create ambiguity about pinned memory use. Code length is reasonable but lacks helper functions or constants for error handling. Action granularity is mostly one action per line, which is good. Reading flow is disrupted by large commented sections, inconsistent spacing, and missing error checks on cudaMemcpy calls. Variable names like 'backPtr' are somewhat unclear. The incomplete code at the end (no return 0, no cudaFree, missing closing brace) significantly impacts readability as a complete program.

Run 1

Code Structure: Allocation, initialization, and CUDA transfers follow a logical sequence, but the snippet ends without a closing brace or complete cleanup. Nesting: Shallow conditionals and a single loop keep complexity low. Clarity of intent: CUDA API names and TRANSFER_SIZE communicate a host-device round trip, although hostPtr/backPtr naming and the unexplained initialization formula weaken clarity. Code length: Mostly concise, but unused includes and commented-out memory-pinning blocks add clutter. Action granularity: Each statement generally performs one action, making operations easy to distinguish. Reading flow: The execution order is natural, but inconsistent spacing, redundant casts, and intrusive commented blocks interrupt scanning.

Run 2

Code Structure: Operations follow a logical allocation, initialization, transfer, and cleanup sequence, but the single function is visibly incomplete and cleanup is partial. Nesting: Shallow conditionals and a simple loop keep complexity low. Clarity of intent: CUDA transfer directions make the round-trip purpose understandable, but generic pointer names and unexplained initialization values obscure details. Code length: The active code is concise, though unused headers and commented-out memory-pinning blocks add clutter. Action granularity: Statements generally perform one action per line; the loop header conventionally combines initialization, testing, and incrementing. Reading flow: Execution proceeds naturally, but inconsistent spacing, excessive blank lines, and disabled blocks interrupt scanning. The missing closing brace and abrupt ending reduce readability and make the intended final cleanup unclear.

Run 3

Code Structure: Allocation, initialization, device allocation, transfers, and cleanup follow a logical sequence, but everything is in main and the snippet ends incompletely. Nesting: Shallow conditionals and a single loop make the code easy to scan. Clarity of intent: CUDA calls clearly indicate a host-to-device round trip, though hostPtr and backPtr are somewhat vague and the initialization formula is unexplained. Code length: Mostly concise, but unused headers, redundant pointer initialization and assignment, and commented-out memory-pinning blocks add clutter. Action granularity: Statements generally perform one action per line. Reading flow: Execution order is natural, but inconsistent spacing, excessive blank lines, and disabled blocks interrupt it. Missing transfer checks and incomplete cleanup also make the intended full lifecycle less clear.