Sample
Dorn/cuda/90
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 17.3Δ 68.5 |
| Scalabrino | 0.782 | 0–1; higher is more readable | 85.3Δ 0.5 |
| Dorn | 0.555 | 0–1; higher is more readable | 47.9Δ 37.9 |
| Mi | 0.668 | 0–1; higher is more readable | 76.0Δ 9.7 |
| LLOC | 26 | Logical lines; fewer is more readable | 18.8Δ 67.0 |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs | 82.6Δ 3.2 |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs | 80.4Δ 5.4 |
| BTTF | 0.558 | 0–1; higher is more readable | 63.0Δ 22.8 |
| Human | 3.86 | 1–5; original rating | 85.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. | 1803.784 | −59.525 |
| 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. | 4.774 | −7.161 |
Intercept 8.87 + feature contributions = -37.815 (log-odds).
Score = sigmoid(-37.815) = 0.
| Score | 0.782 |
|---|
Feature contributions
| Feature | Value | Contribution (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. | 41 | +0.681 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 42 | −0.543 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 80 | +0.486 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 49.901 | +0.288 |
| 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.98 | +0.278 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.125 | −0.269 |
Intercept 0.07 + feature contributions = 0.221 (log-odds).
Score = sigmoid(0.221) = 0.555.
| Score | 0.668 |
|---|
| Score | 26 |
|---|
Run 1
The code is generally readable with clear purpose and structure. Functions are logically separated, each performing a single well-defined operation (ray-box intersection, vector transforms). However, there are notable flaws: the 'd' member alone at the top suggests truncated code, hurting completeness. In intersectBox, the largest_tmin and smallest_tmax computations use hardcoded component comparisons, repetitive and harder to follow than using a third fminf/fmaxf. Comments help intent, though some are terse. Nesting is flat and most lines perform a single action, aiding readability. The use of overloaded mul is concise but could benefit from clearer naming for translating vs non-translating variants. Overall structure is logical, but minor redundancy and incomplete context reduce clarity slightly.
Run 2
The code is generally clear and well-structured, with logical separation of functions and helpful comments. The ray-box intersection is straightforward, with flat nesting and one action per line for the core calculations. However, readability is slightly reduced by the inconsistent use of `make_float3` (used in the first `mul` but not the second), which creates ambiguity about whether M.m rows are already float4. The `if` condition in `intersectBox` is concise but could be more explicit. Variable names like `tbot`, `ttop`, `tmin`, and `tmax` are standard in ray tracing and aid understanding, but the duplicate `fmaxf(tmin.x, tmin.z)` suggests a copy-paste error (likely should be `tmin.y, tmin.z` for the largest_tmin), which may confuse readers. Overall, the code is readable but could benefit from minor consistency and clarity improvements.
Run 3
The code is generally readable with clear comments and logical structure. The `intersectBox` function is well-organized, with each step explained and one action per line. However, the calculation of `largest_tmin` and `smallest_tmax` uses redundant fmaxf/fminf calls (x repeated) and condenses multiple operations into single lines, slightly reducing clarity. The `mul` functions are straightforward, though constructing `float3` temporaries from matrix rows adds minor verbosity. Overall, the code is flat, concise, and understandable but could improve by fixing the redundant axis comparisons and clarifying matrix row access.
Run 1
Code Structure: Functions are logically separated into ray-box intersection and matrix transformations, though the opening fragment lacks context. Nesting: Control flow is flat; only the nested min/max expressions require extra parsing. Clarity of intent: Comments and descriptive intersection variables explain the algorithm well, while abbreviated names and overloaded mul functions require some mathematical familiarity. Code length: The implementation is concise, although repeated axis terms in the min/max expressions add unnecessary complexity. Action granularity: Each statement performs a single assignment or return, making individual steps easy to follow. Reading flow: Consistent formatting and staged calculations provide a natural progression from intermediate values to results; the incomplete opening slightly disrupts that flow.
Run 2
Code Structure: Functions are logically separated into box intersection and matrix transformations, though the opening fragment lacks context. Nesting: Control flow is flat; only the min/max expressions have modest expression nesting. Clarity of intent: Comments clearly explain the algorithm and distinguish transformations with and without translation, but abbreviated names such as invR, tbot, and mul require some interpretation. Code length: The implementation is concise without substantial boilerplate, although repeated axis terms in the min/max expressions add unnecessary complexity. Action granularity: Each statement performs a focused calculation or assignment, with no crowded multi-statement lines. Reading flow: Computation proceeds naturally from plane intersections through interval bounds to the result, and the transformation functions are straightforward. Consistent formatting supports readability, while the incomplete opening and compact mathematical expressions slightly reduce accessibility.
Run 3
Code Structure: Functions are logically separated into ray-box intersection and matrix transformations, though the opening fragment lacks context. Nesting: Control flow is flat, with only minor nesting in min/max expressions. Clarity of intent: Comments clearly explain each calculation and distinguish transformations with and without translation; abbreviated names such as r, v, and mul are less descriptive. Code length: The implementation is concise without unnecessary boilerplate, although repeated axis terms make the extrema expressions slightly harder to parse. Action granularity: Each statement performs one clear assignment or return. Reading flow: Calculations progress naturally from plane intersections to interval bounds and the intersection result, with consistent formatting and useful spacing. CUDA-specific types and overloaded operations require some domain knowledge.