Sample

Dorn/cuda/71

Human rating uses the original dataset scale.

DatasetDorn
Human2.76
Lines30

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
14.8Δ 3.9
Dorn0.3330–1; higher is more readable
27.0Δ 8.4
Mi0.0370–1; higher is more readable
6.1Δ 12.5
LLOC17Logical lines; fewer is more readable
41.2Δ 22.6
DeepSeek V4 Pro12.330–20; mean of three runs
55.8Δ 37.2
GPT-6.1 Sol150–20; mean of three runs
52.8Δ 34.1
BTTF0.2560–1; higher is more readable
10.9Δ 7.8
Human2.761–5; original rating
18.7

Views

Source code

if(tid<c_ActiveVoxelNumber){ //Get the real world position in the source space float4 realPosition = tex1Dfetch(positionFieldTexture,tid); //Get the voxel-based position in the source space float3 voxelPosition; float4 matrix = tex1Dfetch(sourceMatrixTexture,0); voxelPosition.x = matrix.x*realPosition.x + matrix.y*realPosition.y + matrix.z*realPosition.z + matrix.w; matrix = tex1Dfetch(sourceMatrixTexture,1); voxelPosition.y = matrix.x*realPosition.x + matrix.y*realPosition.y + matrix.z*realPosition.z + matrix.w; matrix = tex1Dfetch(sourceMatrixTexture,2); voxelPosition.z = matrix.x*realPosition.x + matrix.y*realPosition.y + matrix.z*realPosition.z + matrix.w; int3 sourceImageSize = c_SourceDim; if( -1<voxelPosition.x && voxelPosition.x<=sourceImageSize.x && -1<voxelPosition.y && voxelPosition.y<=sourceImageSize.y && -1<voxelPosition.z && voxelPosition.z<=sourceImageSize.z){ float3 relativePosition; relativePosition.x=(voxelPosition.x+0.5f)/(float)c_SourceDim.x; relativePosition.y=(voxelPosition.y+0.5f)/(float)c_SourceDim.y; relativePosition.z=(voxelPosition.z+0.5f)/(float)c_SourceDim.z; resultArray[tex1Dfetch(maskTexture,tid)]=tex3D(sourceTexture, relativePosition.x, relativePosition.y, relativePosition.z); } else resultArray[tex1Dfetch(maskTexture,tid)]=c_PaddingValue; } }

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.1666.377−54.99
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.5.009−7.513

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

Feature contributions

FeatureValueContribution
(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.125−1.629
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.125+1.212
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.125−0.271
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.28−0.222
Indentation frequencyHow rapidly indentation changes from line to line.27+0.197
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.31−0.061
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.29.881+0.008

Intercept 0.07 + feature contributions = -0.696 (log-odds).
Score = sigmoid(-0.696) = 0.333.

Score0.037
Score17
Run 1

The code has reasonable structure and comments, but readability is hindered by inconsistent indentation, repeated matrix multiplication code, and somewhat unclear variable names. The nesting depth is moderate but acceptable. Intent is fairly clear - it transforms a position and samples a texture - but the repetitive matrix math makes it longer than necessary and obscures the transformation logic. Action granularity is mostly one action per line, though some assignments are split awkwardly. The reading flow is somewhat disrupted by the uneven indentation and repetitive code blocks. A helper function for the matrix-vector multiplication and consistent formatting would significantly improve readability.

Run 2

The code has a clear overall structure and logical flow, with comments explaining major steps. However, readability is hindered by several factors: inconsistent indentation and spacing, repetitive matrix-vector multiplication code that could be extracted into a helper function or loop, deeply nested conditional logic, and multiple operations on single lines. The boundary check conditions are complex and hard to parse quickly. Variable names are generally clear but could be more descriptive. The code could be significantly shorter and clearer with better abstraction of the transformation logic and cleaner conditional formatting.

Run 3

The code has some readability strengths, such as clear comments separating logical steps, descriptive variable names, and one action per line in many places. However, it suffers from several issues. The nesting is moderately deep with an if-else structure inside the main condition, and conditions are sometimes spread across multiple lines in confusing ways. The matrix transformation code is repetitive and could be extracted into a helper or loop. The boundary condition checking is unclear due to unusual comparison style (-1 < x && x <= size). Mixed tab/space indentation and inconsistent alignment make visual scanning difficult. The overall structure is logical but not cleanly organized, with some ambiguity in intent around the coordinate transformations and mask indexing. While concise enough, the code would benefit from refactoring the repetitive matrix operations, simplifying condition checks, and improving white space consistency.

Run 1

Code Structure: Logically organized into position retrieval, coordinate transformation, bounds checking, and sampling or padding. Nesting: Two conditional levels are manageable, though the outer guard adds indentation. Clarity of intent: Descriptive variable names and comments explain the coordinate conversion; boundary conventions and the mask-based output index are less obvious. Code length: Reasonably concise, but repeated matrix calculations could be encapsulated to reduce repetition. Action granularity: Most statements perform one action, although the output assignment combines index lookup, texture sampling, and storage. Reading flow: Operations follow a natural sequence, but inconsistent spacing, long expressions, the unbraced else, and an unmatched closing brace in the supplied snippet reduce readability.

Run 2

Code Structure: Logically separates coordinate transformation, bounds checking, and sampling or padding. Nesting: Two conditional levels are manageable, though the compact else statement weakens visual consistency. Clarity of intent: Descriptive variable names and comments explain the main steps; texture-based indexing and boundary conventions require domain knowledge. Code length: Reasonably concise, but repeated matrix calculations and normalization could be abstracted to reduce duplication. Action granularity: Most statements perform one action, although the final assignment combines index lookup, texture sampling, and storage. Reading flow: Execution follows a natural transformation-to-validation-to-output sequence, but inconsistent spacing, alignment, long expressions, and an unmatched closing brace in the supplied snippet reduce readability.

Run 3

Code Structure: Logically organized into position retrieval, coordinate transformation, bounds checking, and sampling or padding. Nesting: Only two conditional levels, keeping complexity manageable. Clarity of intent: Descriptive variable names and comments explain the coordinate conversions, though texture APIs, boundary conventions, and mask indexing require domain knowledge. Code length: Reasonably concise, but repeated matrix-row calculations and normalization could be abstracted for readability. Action granularity: Most statements perform one action; nested texture fetches in assignments slightly increase cognitive load. Reading flow: Processing follows a natural sequence, but inconsistent spacing, uneven alignment, the unbraced else, and an unmatched closing brace in the supplied snippet reduce polish and make scope less clear.