Sample

Dorn/cuda/13

Human rating uses the original dataset scale.

DatasetDorn
Human3.47
Lines30

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
39.3Δ 22.0
Scalabrino0.5290–1; higher is more readable
47.7Δ 13.6
Dorn0.6990–1; higher is more readable
65.7Δ 4.5
Mi0.6590–1; higher is more readable
74.4Δ 13.1
LLOC9Logical lines; fewer is more readable
61.3Δ 0.0
DeepSeek V4 Pro15.670–20; mean of three runs
82.6Δ 21.3
GPT-6.1 Sol160–20; mean of three runs
66.0Δ 4.7
BTTF0.3770–1; higher is more readable
21.2Δ 40.1
Human3.471–5; original rating
61.3

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.910.349−30.042
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.734−7.102

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

Score0.529

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.79.871+0.484
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.79.871+0.282
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.21−0.061
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.091+0.06
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.30−0.026
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.877+0.008

Intercept 0.07 + feature contributions = 0.841 (log-odds).
Score = sigmoid(0.841) = 0.699.

Score0.659
Score9
Run 1

The code is reasonably readable. It has a clear purpose—ray-box intersection—and the comments help explain each step. Structure is logical with a single function, though nesting is minimal. However, there are bugs: the largest_tmin and smallest_tmax calculations use tmin.x and tmax.x twice instead of tmin.z and tmax.z. The function also lacks a return statement, and error handling (e.g., division by zero) is missing. Code length and action granularity are acceptable, but the missing return and unclear contract reduce clarity. The typedef and struct at the top provide context, but the compressed multi-step lines slightly hinder readability.

Run 2

The code is generally readable with clear structure: a struct definition, a documented function, and logical steps separated by comments. It avoids deep nesting and keeps actions granular, with one operation per line. The intent is clear—ray-box intersection—and the comments explain the math references and intermediate steps. However, there are minor issues: inconsistent indentation in the typedef, the unused constant `c_invViewMatrix_bk`, and some redundancy in the `fmaxf`/`fminf` calls (e.g., `fmaxf(tmin.x, tmin.z)` may be a typo for `tmin.z`). These do not severely harm readability but slightly reduce clarity and precision. Overall, it is concise and follows a natural reading flow, scoring well above average.

Run 3

The code is well-structured and readable for a CUDA ray-box intersection routine. It uses clear naming (boxmin/boxmax, tnear/tfar, invR, tbot/ttop) and follows a logical, flat sequence: compute inverse direction, slab intersections, reorder per axis, then reduce to entry/exit t values. Comments explain each step without being excessive. The function is concise and each line performs one clear operation. Minor deductions: the final reduction for largest_tmin and smallest_tmax has a small redundancy (e.g., fmaxf(tmin.x, tmin.y) vs tmin.z would be slightly cleaner), and there is no check for division by zero or parallel rays which could slightly confuse intent, but these do not significantly hurt readability. Overall, a solid implementation with clear purpose and natural flow.

Run 1

Code Structure: Types, constant data, and the intersection routine are logically organized, but the excerpt ends before the function is completed. Nesting: Control flow is flat; nested min/max calls add only modest expression complexity. Clarity of intent: The function name and step-by-step comments clearly describe ray-box intersection, though abbreviations such as o, d, invR, and the bk suffix require interpretation. Code length: The visible code is concise, but the repeated tmin.x and tmax.x comparisons are redundant. Action granularity: Each statement performs one coherent calculation, making intermediate results easy to track. Reading flow: Calculations progress naturally from plane intersections to ordered bounds and aggregate limits. Mixed indentation and the missing return, output assignments, and closing brace reduce readability of the supplied excerpt.

Run 2

Code Structure: Types, constant data, and intersection calculations are logically organized into clear stages. Nesting: The code is flat, with only modest nesting of min/max expressions. Clarity of intent: Comments explain the algorithm and ray fields, although abbreviated names such as invR, tbot, and ttop require interpretation. Code length: The visible code is concise, but repeated comparisons involving the x component make the final reductions less straightforward than necessary. Action granularity: Each statement performs one primary action, supporting easy scanning. Reading flow: Calculations progress naturally from plane intersections to interval bounds; inconsistent indentation slightly disrupts presentation. The snippet ends before the function returns or closes, leaving its final behavior and output handling unclear.

Run 3

Code Structure: Types, constant data, and intersection calculations are logically organized into clear stages. Nesting: The code is flat, with only short nested mathematical calls. Clarity of intent: Comments explain the algorithm and ray fields, though abbreviated names such as o, d, invR, and tbot require interpretation. Code length: The excerpt is concise, but repeated tmin.x and tmax.x comparisons add unnecessary complexity. Action granularity: Each statement generally performs one calculation, making individual steps easy to follow. Reading flow: The calculations progress naturally from plane intersections to per-axis bounds and aggregate limits. Mixed indentation slightly weakens consistency. The excerpt ends before output assignments, a return statement, and the closing brace, so the function's complete behavior cannot be read.