Public report of huggingface/candle, published 26 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 26 October 2026, 04:23 UTC · Survey ID cd_b7f5d17695644070beb970007d69a70e
huggingface/candle
Measured 26 October 2026, 04:16 UTC, at code version 12bb5d1
No regression since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
No change since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 155,474 lines of product code in 13 projects, tests not counted · Estimated rebuild effort: about 1.3 person-years · Weakest lens: Accessibility, 35
Findings by how serious they are
38 critical1740 serious255 minor
16 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
26 October 2026, 04:16 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
67of 67 dimensions measured by tools.
2015of 2033 findings point to an exact file and line, so you can open each one in the code. The other 18 concern the repository as a whole, such as missing documentation.
67dimensions across 7 lenses, read from 155,474 lines of product code in 13 projects.
huggingface/candle falls short of our standard for a preview release because it has images with no text description. It scores 50 out of 100 and is rated Adequate, and four of its 38 critical findings are security problems in the build pipeline and in its automatic dependency updates.
Accessibility, at 35, is the weakest lens and counts most in the score. The best first step is adding text alternatives, worth about 8 points. Adding type checking comes next, worth about 4 points. Raising Accessibility to 65 would lift the score to about 61.
Fifteen images have no description for people who can't see them. Two pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with, and six form fields can't be read by a screen reader. Describing the images, pinning each tool to an exact version and labelling the form fields would close these risks. Setting a waiting period for automatic updates would fix the automatic dependency update that takes a new release at once, and the pipeline step that installs packages without pinning their versions needs the packages it installs pinned to exact versions. The ten pages that don't say their language need their language set.
The product code is 155,474 lines, about €190,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 6 findings
These 6 critical or serious findings were in the previous survey, on 12 October 2026, and are gone from this one.
Visual & motion safety · Animation without a prefers-reduced-motion guard candle-wasm-examples/quant-qwen3/index.html
Rebuild cost: about €190,000 · Estimate
Cost to rebuild
€65,000 to €330,000, for 1,079 to 3,422 hours of work, about 1.3 person-years for 1 to 3 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 50. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 155,474 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Raises the score by about 8 points · Medium effort · Text alternatives
2
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Raises the score by about 4 points · Medium effort · Type Safety
3
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 2 points · Low effort · ADR Quality
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €190,000 to build again, about 1.3 person-years of work. Its weakest lens is Accessibility, at 35 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video. Of all the actions in this report, it raises the score most for the work it takes: about 8 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.3 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 4% to 10% on every change. The history of the code shows how much it changes: about 17,218 lines over the last 90 days, which is about 69,829 lines a year. At that pace, the extra work comes to an estimated 7.5 to 45.3 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
430 modules, with 2108 dependencies between them. 5 loops run through 55 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 390 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
candle_core.dtype uses candle_core.cpu_backend, so a change to candle_core.cpu_backend can break candle_core.dtype, while a change to candle_core.dtype can't break candle_core.cpu_backend.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_core.layout uses candle_core.shape, so a change to candle_core.shape can break candle_core.layout, while a change to candle_core.layout can't break candle_core.shape.
Position
Below the diagonal: candle_core.layout uses a module listed above it, which is the healthy direction.
4→25 candle_metal_kernels.metal.buffer uses candle_metal_kernels.utilspart of a loop✕
Connections
1 pair of types, where a type in candle_metal_kernels.metal.buffer uses a type in candle_metal_kernels.utils.
candle_metal_kernels.metal.buffer uses candle_metal_kernels.utils, so a change to candle_metal_kernels.utils can break candle_metal_kernels.metal.buffer, while a change to candle_metal_kernels.metal.buffer can't break candle_metal_kernels.utils.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_core.quantized uses candle_core.shape, so a change to candle_core.shape can break candle_core.quantized, while a change to candle_core.quantized can't break candle_core.shape.
Position
Below the diagonal: candle_core.quantized uses a module listed above it, which is the healthy direction.
candle_core.quantized uses candle_core.layout, so a change to candle_core.layout can break candle_core.quantized, while a change to candle_core.quantized can't break candle_core.layout.
Position
Below the diagonal: candle_core.quantized uses a module listed above it, which is the healthy direction.
5→6 candle_core.quantized uses candle_core.devicepart of a loop✕
Connections
2 pairs of types, where a type in candle_core.quantized uses a type in candle_core.device.
candle_core.quantized uses candle_core.device, so a change to candle_core.device can break candle_core.quantized, while a change to candle_core.quantized can't break candle_core.device.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→7 candle_core.quantized uses candle_core.dummy_metal_backendpart of a loop✕
Connections
1 pair of types, where a type in candle_core.quantized uses a type in candle_core.dummy_metal_backend.
candle_core.quantized uses candle_core.dummy_metal_backend, so a change to candle_core.dummy_metal_backend can break candle_core.quantized, while a change to candle_core.quantized can't break candle_core.dummy_metal_backend.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→11 candle_core.quantized uses candle_core.custom_oppart of a loop✕
Connections
1 pair of types, where a type in candle_core.quantized uses a type in candle_core.custom_op.
candle_core.quantized uses candle_core.custom_op, so a change to candle_core.custom_op can break candle_core.quantized, while a change to candle_core.quantized can't break candle_core.custom_op.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→20 candle_core.quantized uses candle_core.cuda_backendpart of a loop✕
Connections
1 pair of types, where a type in candle_core.quantized uses a type in candle_core.cuda_backend.
candle_core.quantized uses candle_core.cuda_backend, so a change to candle_core.cuda_backend can break candle_core.quantized, while a change to candle_core.quantized can't break candle_core.cuda_backend.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→24 candle_core.quantized uses candle_core.cpu_backendpart of a loop✕
Connections
1 pair of types, where a type in candle_core.quantized uses a type in candle_core.cpu_backend.
candle_core.quantized uses candle_core.cpu_backend, so a change to candle_core.cpu_backend can break candle_core.quantized, while a change to candle_core.quantized can't break candle_core.cpu_backend.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→27 candle_core.quantized uses candle_core.tensorpart of a loop✕
Connections
2 pairs of types, where a type in candle_core.quantized uses a type in candle_core.tensor.
candle_core.quantized uses candle_core.tensor, so a change to candle_core.tensor can break candle_core.quantized, while a change to candle_core.quantized can't break candle_core.tensor.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→28 candle_core.quantized uses candle_corepart of a loop✕
Connections
1 pair of types, where a type in candle_core.quantized uses a type in candle_core.
candle_core.quantized uses candle_core, so a change to candle_core can break candle_core.quantized, while a change to candle_core.quantized can't break candle_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_core.device uses candle_core.shape, so a change to candle_core.shape can break candle_core.device, while a change to candle_core.device can't break candle_core.shape.
Position
Below the diagonal: candle_core.device uses a module listed above it, which is the healthy direction.
candle_core.device uses candle_core.dtype, so a change to candle_core.dtype can break candle_core.device, while a change to candle_core.device can't break candle_core.dtype.
Position
Below the diagonal: candle_core.device uses a module listed above it, which is the healthy direction.
candle_core.device uses candle_core.quantized, so a change to candle_core.quantized can break candle_core.device, while a change to candle_core.device can't break candle_core.quantized.
Position
Below the diagonal: candle_core.device uses a module listed above it, which is the healthy direction.
6→24 candle_core.device uses candle_core.cpu_backendpart of a loop✕
Connections
1 pair of types, where a type in candle_core.device uses a type in candle_core.cpu_backend.
candle_core.device uses candle_core.cpu_backend, so a change to candle_core.cpu_backend can break candle_core.device, while a change to candle_core.device can't break candle_core.cpu_backend.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_core.dummy_metal_backend uses candle_core.shape, so a change to candle_core.shape can break candle_core.dummy_metal_backend, while a change to candle_core.dummy_metal_backend can't break candle_core.shape.
Position
Below the diagonal: candle_core.dummy_metal_backend uses a module listed above it, which is the healthy direction.
candle_core.dummy_metal_backend uses candle_core.dtype, so a change to candle_core.dtype can break candle_core.dummy_metal_backend, while a change to candle_core.dummy_metal_backend can't break candle_core.dtype.
Position
Below the diagonal: candle_core.dummy_metal_backend uses a module listed above it, which is the healthy direction.
candle_core.dummy_metal_backend uses candle_core.layout, so a change to candle_core.layout can break candle_core.dummy_metal_backend, while a change to candle_core.dummy_metal_backend can't break candle_core.layout.
Position
Below the diagonal: candle_core.dummy_metal_backend uses a module listed above it, which is the healthy direction.
candle_core.dummy_metal_backend uses candle_core.device, so a change to candle_core.device can break candle_core.dummy_metal_backend, while a change to candle_core.dummy_metal_backend can't break candle_core.device.
Position
Below the diagonal: candle_core.dummy_metal_backend uses a module listed above it, which is the healthy direction.
7→22 candle_core.dummy_metal_backend uses candle_core.backendpart of a loop✕
Connections
2 pairs of types, where a type in candle_core.dummy_metal_backend uses a type in candle_core.backend.
candle_core.dummy_metal_backend uses candle_core.backend, so a change to candle_core.backend can break candle_core.dummy_metal_backend, while a change to candle_core.dummy_metal_backend can't break candle_core.backend.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
7→24 candle_core.dummy_metal_backend uses candle_core.cpu_backendpart of a loop✕
Connections
1 pair of types, where a type in candle_core.dummy_metal_backend uses a type in candle_core.cpu_backend.
candle_core.dummy_metal_backend uses candle_core.cpu_backend, so a change to candle_core.cpu_backend can break candle_core.dummy_metal_backend, while a change to candle_core.dummy_metal_backend can't break candle_core.cpu_backend.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_core.quantized.ggml_file uses candle_core.quantized, so a change to candle_core.quantized can break candle_core.quantized.ggml_file, while a change to candle_core.quantized.ggml_file can't break candle_core.quantized.
Position
Below the diagonal: candle_core.quantized.ggml_file uses a module listed above it, which is the healthy direction.
candle_core.quantized.ggml_file uses candle_core.device, so a change to candle_core.device can break candle_core.quantized.ggml_file, while a change to candle_core.quantized.ggml_file can't break candle_core.device.
Position
Below the diagonal: candle_core.quantized.ggml_file uses a module listed above it, which is the healthy direction.
candle_metal_kernels.kernel uses candle_core.device, so a change to candle_core.device can break candle_metal_kernels.kernel, while a change to candle_metal_kernels.kernel can't break candle_core.device.
Position
Below the diagonal: candle_metal_kernels.kernel uses a module listed above it, which is the healthy direction.
candle_transformers.quantized_var_builder uses candle_core.dtype, so a change to candle_core.dtype can break candle_transformers.quantized_var_builder, while a change to candle_transformers.quantized_var_builder can't break candle_core.dtype.
Position
Below the diagonal: candle_transformers.quantized_var_builder uses a module listed above it, which is the healthy direction.
candle_transformers.quantized_var_builder uses candle_core.device, so a change to candle_core.device can break candle_transformers.quantized_var_builder, while a change to candle_transformers.quantized_var_builder can't break candle_core.device.
Position
Below the diagonal: candle_transformers.quantized_var_builder uses a module listed above it, which is the healthy direction.
candle_core.custom_op uses candle_core.layout, so a change to candle_core.layout can break candle_core.custom_op, while a change to candle_core.custom_op can't break candle_core.layout.
Position
Below the diagonal: candle_core.custom_op uses a module listed above it, which is the healthy direction.
candle_core.custom_op uses candle_core.dummy_metal_backend, so a change to candle_core.dummy_metal_backend can break candle_core.custom_op, while a change to candle_core.custom_op can't break candle_core.dummy_metal_backend.
Position
Below the diagonal: candle_core.custom_op uses a module listed above it, which is the healthy direction.
11→20 candle_core.custom_op uses candle_core.cuda_backendpart of a loop✕
Connections
8 pairs of types, where a type in candle_core.custom_op uses a type in candle_core.cuda_backend.
candle_core.custom_op uses candle_core.cuda_backend, so a change to candle_core.cuda_backend can break candle_core.custom_op, while a change to candle_core.custom_op can't break candle_core.cuda_backend.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
11→24 candle_core.custom_op uses candle_core.cpu_backendpart of a loop✕
Connections
7 pairs of types, where a type in candle_core.custom_op uses a type in candle_core.cpu_backend.
candle_core.custom_op uses candle_core.cpu_backend, so a change to candle_core.cpu_backend can break candle_core.custom_op, while a change to candle_core.custom_op can't break candle_core.cpu_backend.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
11→27 candle_core.custom_op uses candle_core.tensorpart of a loop✕
Connections
3 pairs of types, where a type in candle_core.custom_op uses a type in candle_core.tensor.
candle_core.custom_op uses candle_core.tensor, so a change to candle_core.tensor can break candle_core.custom_op, while a change to candle_core.custom_op can't break candle_core.tensor.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_nn.activation uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_nn.activation, while a change to candle_nn.activation can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_nn.activation uses a module listed above it, which is the healthy direction.
12→27 candle_nn.activation uses candle_core.tensorpart of a loop✕
Connections
2 pairs of types, where a type in candle_nn.activation uses a type in candle_core.tensor.
candle_nn.activation uses candle_core.tensor, so a change to candle_core.tensor can break candle_nn.activation, while a change to candle_nn.activation can't break candle_core.tensor.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
12→28 candle_nn.activation uses candle_corepart of a loop✕
Connections
2 pairs of types, where a type in candle_nn.activation uses a type in candle_core.
candle_nn.activation uses candle_core, so a change to candle_core can break candle_nn.activation, while a change to candle_nn.activation can't break candle_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_nn.conv uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_nn.conv, while a change to candle_nn.conv can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_nn.conv uses a module listed above it, which is the healthy direction.
13→27 candle_nn.conv uses candle_core.tensorpart of a loop✕
Connections
4 pairs of types, where a type in candle_nn.conv uses a type in candle_core.tensor.
candle_nn.conv uses candle_core.tensor, so a change to candle_core.tensor can break candle_nn.conv, while a change to candle_nn.conv can't break candle_core.tensor.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
13→28 candle_nn.conv uses candle_corepart of a loop✕
Connections
4 pairs of types, where a type in candle_nn.conv uses a type in candle_core.
candle_nn.embedding uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_nn.embedding, while a change to candle_nn.embedding can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_nn.embedding uses a module listed above it, which is the healthy direction.
14→27 candle_nn.embedding uses candle_core.tensorpart of a loop✕
Connections
1 pair of types, where a type in candle_nn.embedding uses a type in candle_core.tensor.
candle_nn.embedding uses candle_core.tensor, so a change to candle_core.tensor can break candle_nn.embedding, while a change to candle_nn.embedding can't break candle_core.tensor.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
14→28 candle_nn.embedding uses candle_corepart of a loop✕
Connections
1 pair of types, where a type in candle_nn.embedding uses a type in candle_core.
candle_nn.embedding uses candle_core, so a change to candle_core can break candle_nn.embedding, while a change to candle_nn.embedding can't break candle_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_nn.layer_norm uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_nn.layer_norm, while a change to candle_nn.layer_norm can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_nn.layer_norm uses a module listed above it, which is the healthy direction.
15→27 candle_nn.layer_norm uses candle_core.tensorpart of a loop✕
Connections
2 pairs of types, where a type in candle_nn.layer_norm uses a type in candle_core.tensor.
candle_nn.layer_norm uses candle_core.tensor, so a change to candle_core.tensor can break candle_nn.layer_norm, while a change to candle_nn.layer_norm can't break candle_core.tensor.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
15→28 candle_nn.layer_norm uses candle_corepart of a loop✕
Connections
2 pairs of types, where a type in candle_nn.layer_norm uses a type in candle_core.
candle_nn.layer_norm uses candle_core, so a change to candle_core can break candle_nn.layer_norm, while a change to candle_nn.layer_norm can't break candle_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_nn.linear uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_nn.linear, while a change to candle_nn.linear can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_nn.linear uses a module listed above it, which is the healthy direction.
16→27 candle_nn.linear uses candle_core.tensorpart of a loop✕
Connections
1 pair of types, where a type in candle_nn.linear uses a type in candle_core.tensor.
candle_nn.linear uses candle_core.tensor, so a change to candle_core.tensor can break candle_nn.linear, while a change to candle_nn.linear can't break candle_core.tensor.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
16→28 candle_nn.linear uses candle_corepart of a loop✕
Connections
1 pair of types, where a type in candle_nn.linear uses a type in candle_core.
The types involved
candle_nn.linear.Linear → candle_core.Module
Direction
candle_nn.linear uses candle_core, so a change to candle_core can break candle_nn.linear, while a change to candle_nn.linear can't break candle_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_core.cuda_backend.device uses candle_core.shape, so a change to candle_core.shape can break candle_core.cuda_backend.device, while a change to candle_core.cuda_backend.device can't break candle_core.shape.
Position
Below the diagonal: candle_core.cuda_backend.device uses a module listed above it, which is the healthy direction.
candle_core.cuda_backend.device uses candle_core.dtype, so a change to candle_core.dtype can break candle_core.cuda_backend.device, while a change to candle_core.cuda_backend.device can't break candle_core.dtype.
Position
Below the diagonal: candle_core.cuda_backend.device uses a module listed above it, which is the healthy direction.
candle_core.cuda_backend.device uses candle_core.device, so a change to candle_core.device can break candle_core.cuda_backend.device, while a change to candle_core.cuda_backend.device can't break candle_core.device.
Position
Below the diagonal: candle_core.cuda_backend.device uses a module listed above it, which is the healthy direction.
candle_core.cuda_backend.device uses candle_core.custom_op, so a change to candle_core.custom_op can break candle_core.cuda_backend.device, while a change to candle_core.cuda_backend.device can't break candle_core.custom_op.
Position
Below the diagonal: candle_core.cuda_backend.device uses a module listed above it, which is the healthy direction.
17→22 candle_core.cuda_backend.device uses candle_core.backendpart of a loop✕
Connections
1 pair of types, where a type in candle_core.cuda_backend.device uses a type in candle_core.backend.
candle_core.cuda_backend.device uses candle_core.backend, so a change to candle_core.backend can break candle_core.cuda_backend.device, while a change to candle_core.cuda_backend.device can't break candle_core.backend.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→24 candle_core.cuda_backend.device uses candle_core.cpu_backendpart of a loop✕
Connections
1 pair of types, where a type in candle_core.cuda_backend.device uses a type in candle_core.cpu_backend.
candle_core.cuda_backend.device uses candle_core.cpu_backend, so a change to candle_core.cpu_backend can break candle_core.cuda_backend.device, while a change to candle_core.cuda_backend.device can't break candle_core.cpu_backend.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→28 candle_core.cuda_backend.device uses candle_corepart of a loop✕
Connections
1 pair of types, where a type in candle_core.cuda_backend.device uses a type in candle_core.
candle_core.cuda_backend.device uses candle_core, so a change to candle_core can break candle_core.cuda_backend.device, while a change to candle_core.cuda_backend.device can't break candle_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_transformers.models.based uses candle_core.dtype, so a change to candle_core.dtype can break candle_transformers.models.based, while a change to candle_transformers.models.based can't break candle_core.dtype.
Position
Below the diagonal: candle_transformers.models.based uses a module listed above it, which is the healthy direction.
candle_transformers.models.based uses candle_core.device, so a change to candle_core.device can break candle_transformers.models.based, while a change to candle_transformers.models.based can't break candle_core.device.
Position
Below the diagonal: candle_transformers.models.based uses a module listed above it, which is the healthy direction.
candle_transformers.models.based uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_transformers.models.based, while a change to candle_transformers.models.based can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_transformers.models.based uses a module listed above it, which is the healthy direction.
candle_transformers.models.based uses candle_nn.conv, so a change to candle_nn.conv can break candle_transformers.models.based, while a change to candle_transformers.models.based can't break candle_nn.conv.
Position
Below the diagonal: candle_transformers.models.based uses a module listed above it, which is the healthy direction.
candle_transformers.models.based uses candle_nn.embedding, so a change to candle_nn.embedding can break candle_transformers.models.based, while a change to candle_transformers.models.based can't break candle_nn.embedding.
Position
Below the diagonal: candle_transformers.models.based uses a module listed above it, which is the healthy direction.
candle_transformers.models.based uses candle_nn.layer_norm, so a change to candle_nn.layer_norm can break candle_transformers.models.based, while a change to candle_transformers.models.based can't break candle_nn.layer_norm.
Position
Below the diagonal: candle_transformers.models.based uses a module listed above it, which is the healthy direction.
candle_transformers.models.based uses candle_nn.linear, so a change to candle_nn.linear can break candle_transformers.models.based, while a change to candle_transformers.models.based can't break candle_nn.linear.
Position
Below the diagonal: candle_transformers.models.based uses a module listed above it, which is the healthy direction.
18→27 candle_transformers.models.based uses candle_core.tensorpart of a loop✕
Connections
9 pairs of types, where a type in candle_transformers.models.based uses a type in candle_core.tensor.
candle_transformers.models.based uses candle_core.tensor, so a change to candle_core.tensor can break candle_transformers.models.based, while a change to candle_transformers.models.based can't break candle_core.tensor.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
18→28 candle_transformers.models.based uses candle_corepart of a loop✕
Connections
1 pair of types, where a type in candle_transformers.models.based uses a type in candle_core.
candle_transformers.models.based uses candle_core, so a change to candle_core can break candle_transformers.models.based, while a change to candle_transformers.models.based can't break candle_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_transformers.models.beit uses candle_core.device, so a change to candle_core.device can break candle_transformers.models.beit, while a change to candle_transformers.models.beit can't break candle_core.device.
Position
Below the diagonal: candle_transformers.models.beit uses a module listed above it, which is the healthy direction.
candle_transformers.models.beit uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_transformers.models.beit, while a change to candle_transformers.models.beit can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_transformers.models.beit uses a module listed above it, which is the healthy direction.
candle_transformers.models.beit uses candle_nn.conv, so a change to candle_nn.conv can break candle_transformers.models.beit, while a change to candle_transformers.models.beit can't break candle_nn.conv.
Position
Below the diagonal: candle_transformers.models.beit uses a module listed above it, which is the healthy direction.
candle_transformers.models.beit uses candle_nn.layer_norm, so a change to candle_nn.layer_norm can break candle_transformers.models.beit, while a change to candle_transformers.models.beit can't break candle_nn.layer_norm.
Position
Below the diagonal: candle_transformers.models.beit uses a module listed above it, which is the healthy direction.
candle_transformers.models.beit uses candle_nn.linear, so a change to candle_nn.linear can break candle_transformers.models.beit, while a change to candle_transformers.models.beit can't break candle_nn.linear.
Position
Below the diagonal: candle_transformers.models.beit uses a module listed above it, which is the healthy direction.
19→27 candle_transformers.models.beit uses candle_core.tensorpart of a loop✕
Connections
6 pairs of types, where a type in candle_transformers.models.beit uses a type in candle_core.tensor.
candle_transformers.models.beit uses candle_core.tensor, so a change to candle_core.tensor can break candle_transformers.models.beit, while a change to candle_transformers.models.beit can't break candle_core.tensor.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→28 candle_transformers.models.beit uses candle_corepart of a loop✕
Connections
6 pairs of types, where a type in candle_transformers.models.beit uses a type in candle_core.
candle_transformers.models.beit uses candle_core, so a change to candle_core can break candle_transformers.models.beit, while a change to candle_transformers.models.beit can't break candle_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_core.cuda_backend uses candle_core.dtype, so a change to candle_core.dtype can break candle_core.cuda_backend, while a change to candle_core.cuda_backend can't break candle_core.dtype.
Position
Below the diagonal: candle_core.cuda_backend uses a module listed above it, which is the healthy direction.
candle_core.cuda_backend uses candle_core.layout, so a change to candle_core.layout can break candle_core.cuda_backend, while a change to candle_core.cuda_backend can't break candle_core.layout.
Position
Below the diagonal: candle_core.cuda_backend uses a module listed above it, which is the healthy direction.
candle_core.cuda_backend uses candle_core.cuda_backend.device, so a change to candle_core.cuda_backend.device can break candle_core.cuda_backend, while a change to candle_core.cuda_backend can't break candle_core.cuda_backend.device.
Position
Below the diagonal: candle_core.cuda_backend uses a module listed above it, which is the healthy direction.
20→22 candle_core.cuda_backend uses candle_core.backendpart of a loop✕
Connections
1 pair of types, where a type in candle_core.cuda_backend uses a type in candle_core.backend.
candle_core.cuda_backend uses candle_core.backend, so a change to candle_core.backend can break candle_core.cuda_backend, while a change to candle_core.cuda_backend can't break candle_core.backend.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_transformers.models.blip_text uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_transformers.models.blip_text, while a change to candle_transformers.models.blip_text can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_transformers.models.blip_text uses a module listed above it, which is the healthy direction.
candle_transformers.models.blip_text uses candle_nn.activation, so a change to candle_nn.activation can break candle_transformers.models.blip_text, while a change to candle_transformers.models.blip_text can't break candle_nn.activation.
Position
Below the diagonal: candle_transformers.models.blip_text uses a module listed above it, which is the healthy direction.
candle_transformers.models.blip_text uses candle_nn.embedding, so a change to candle_nn.embedding can break candle_transformers.models.blip_text, while a change to candle_transformers.models.blip_text can't break candle_nn.embedding.
Position
Below the diagonal: candle_transformers.models.blip_text uses a module listed above it, which is the healthy direction.
candle_transformers.models.blip_text uses candle_nn.layer_norm, so a change to candle_nn.layer_norm can break candle_transformers.models.blip_text, while a change to candle_transformers.models.blip_text can't break candle_nn.layer_norm.
Position
Below the diagonal: candle_transformers.models.blip_text uses a module listed above it, which is the healthy direction.
candle_transformers.models.blip_text uses candle_nn.linear, so a change to candle_nn.linear can break candle_transformers.models.blip_text, while a change to candle_transformers.models.blip_text can't break candle_nn.linear.
Position
Below the diagonal: candle_transformers.models.blip_text uses a module listed above it, which is the healthy direction.
candle_transformers.models.blip_text uses candle_transformers.models.based, so a change to candle_transformers.models.based can break candle_transformers.models.blip_text, while a change to candle_transformers.models.blip_text can't break candle_transformers.models.based.
Position
Below the diagonal: candle_transformers.models.blip_text uses a module listed above it, which is the healthy direction.
21→27 candle_transformers.models.blip_text uses candle_core.tensorpart of a loop✕
Connections
14 pairs of types, where a type in candle_transformers.models.blip_text uses a type in candle_core.tensor.
candle_transformers.models.blip_text uses candle_core.tensor, so a change to candle_core.tensor can break candle_transformers.models.blip_text, while a change to candle_transformers.models.blip_text can't break candle_core.tensor.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→28 candle_transformers.models.blip_text uses candle_corepart of a loop✕
Connections
5 pairs of types, where a type in candle_transformers.models.blip_text uses a type in candle_core.
candle_transformers.models.blip_text uses candle_core, so a change to candle_core can break candle_transformers.models.blip_text, while a change to candle_transformers.models.blip_text can't break candle_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_core.backend uses candle_core.shape, so a change to candle_core.shape can break candle_core.backend, while a change to candle_core.backend can't break candle_core.shape.
Position
Below the diagonal: candle_core.backend uses a module listed above it, which is the healthy direction.
candle_core.backend uses candle_core.dtype, so a change to candle_core.dtype can break candle_core.backend, while a change to candle_core.backend can't break candle_core.dtype.
Position
Below the diagonal: candle_core.backend uses a module listed above it, which is the healthy direction.
candle_core.backend uses candle_core.layout, so a change to candle_core.layout can break candle_core.backend, while a change to candle_core.backend can't break candle_core.layout.
Position
Below the diagonal: candle_core.backend uses a module listed above it, which is the healthy direction.
candle_core.backend uses candle_core.device, so a change to candle_core.device can break candle_core.backend, while a change to candle_core.backend can't break candle_core.device.
Position
Below the diagonal: candle_core.backend uses a module listed above it, which is the healthy direction.
candle_core.backend uses candle_core.cuda_backend, so a change to candle_core.cuda_backend can break candle_core.backend, while a change to candle_core.backend can't break candle_core.cuda_backend.
Position
Below the diagonal: candle_core.backend uses a module listed above it, which is the healthy direction.
22→24 candle_core.backend uses candle_core.cpu_backendpart of a loop✕
Connections
1 pair of types, where a type in candle_core.backend uses a type in candle_core.cpu_backend.
candle_core.backend uses candle_core.cpu_backend, so a change to candle_core.cpu_backend can break candle_core.backend, while a change to candle_core.backend can't break candle_core.cpu_backend.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_transformers.models.blip uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_transformers.models.blip, while a change to candle_transformers.models.blip can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_transformers.models.blip uses a module listed above it, which is the healthy direction.
candle_transformers.models.blip uses candle_nn.activation, so a change to candle_nn.activation can break candle_transformers.models.blip, while a change to candle_transformers.models.blip can't break candle_nn.activation.
Position
Below the diagonal: candle_transformers.models.blip uses a module listed above it, which is the healthy direction.
candle_transformers.models.blip uses candle_nn.conv, so a change to candle_nn.conv can break candle_transformers.models.blip, while a change to candle_transformers.models.blip can't break candle_nn.conv.
Position
Below the diagonal: candle_transformers.models.blip uses a module listed above it, which is the healthy direction.
candle_transformers.models.blip uses candle_nn.layer_norm, so a change to candle_nn.layer_norm can break candle_transformers.models.blip, while a change to candle_transformers.models.blip can't break candle_nn.layer_norm.
Position
Below the diagonal: candle_transformers.models.blip uses a module listed above it, which is the healthy direction.
candle_transformers.models.blip uses candle_nn.linear, so a change to candle_nn.linear can break candle_transformers.models.blip, while a change to candle_transformers.models.blip can't break candle_nn.linear.
Position
Below the diagonal: candle_transformers.models.blip uses a module listed above it, which is the healthy direction.
candle_transformers.models.blip uses candle_transformers.models.based, so a change to candle_transformers.models.based can break candle_transformers.models.blip, while a change to candle_transformers.models.blip can't break candle_transformers.models.based.
Position
Below the diagonal: candle_transformers.models.blip uses a module listed above it, which is the healthy direction.
candle_transformers.models.blip uses candle_transformers.models.beit, so a change to candle_transformers.models.beit can break candle_transformers.models.blip, while a change to candle_transformers.models.blip can't break candle_transformers.models.beit.
Position
Below the diagonal: candle_transformers.models.blip uses a module listed above it, which is the healthy direction.
candle_transformers.models.blip uses candle_transformers.models.blip_text, so a change to candle_transformers.models.blip_text can break candle_transformers.models.blip, while a change to candle_transformers.models.blip can't break candle_transformers.models.blip_text.
Position
Below the diagonal: candle_transformers.models.blip uses a module listed above it, which is the healthy direction.
23→27 candle_transformers.models.blip uses candle_core.tensorpart of a loop✕
Connections
6 pairs of types, where a type in candle_transformers.models.blip uses a type in candle_core.tensor.
candle_transformers.models.blip uses candle_core.tensor, so a change to candle_core.tensor can break candle_transformers.models.blip, while a change to candle_transformers.models.blip can't break candle_core.tensor.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
23→28 candle_transformers.models.blip uses candle_corepart of a loop✕
Connections
3 pairs of types, where a type in candle_transformers.models.blip uses a type in candle_core.
candle_transformers.models.blip uses candle_core, so a change to candle_core can break candle_transformers.models.blip, while a change to candle_transformers.models.blip can't break candle_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_core.cpu_backend uses candle_core.shape, so a change to candle_core.shape can break candle_core.cpu_backend, while a change to candle_core.cpu_backend can't break candle_core.shape.
Position
Below the diagonal: candle_core.cpu_backend uses a module listed above it, which is the healthy direction.
candle_core.cpu_backend uses candle_core.dtype, so a change to candle_core.dtype can break candle_core.cpu_backend, while a change to candle_core.cpu_backend can't break candle_core.dtype.
Position
Below the diagonal: candle_core.cpu_backend uses a module listed above it, which is the healthy direction.
candle_core.cpu_backend uses candle_core.layout, so a change to candle_core.layout can break candle_core.cpu_backend, while a change to candle_core.cpu_backend can't break candle_core.layout.
Position
Below the diagonal: candle_core.cpu_backend uses a module listed above it, which is the healthy direction.
candle_core.cpu_backend uses candle_core.device, so a change to candle_core.device can break candle_core.cpu_backend, while a change to candle_core.cpu_backend can't break candle_core.device.
Position
Below the diagonal: candle_core.cpu_backend uses a module listed above it, which is the healthy direction.
candle_core.cpu_backend uses candle_core.backend, so a change to candle_core.backend can break candle_core.cpu_backend, while a change to candle_core.cpu_backend can't break candle_core.backend.
Position
Below the diagonal: candle_core.cpu_backend uses a module listed above it, which is the healthy direction.
candle_metal_kernels.utils uses candle_metal_kernels.metal.buffer, so a change to candle_metal_kernels.metal.buffer can break candle_metal_kernels.utils, while a change to candle_metal_kernels.utils can't break candle_metal_kernels.metal.buffer.
Position
Below the diagonal: candle_metal_kernels.utils uses a module listed above it, which is the healthy direction.
candle_metal_kernels.utils uses candle_transformers.models.blip, so a change to candle_transformers.models.blip can break candle_metal_kernels.utils, while a change to candle_metal_kernels.utils can't break candle_transformers.models.blip.
Position
Below the diagonal: candle_metal_kernels.utils uses a module listed above it, which is the healthy direction.
candle_transformers.models.deepseek2 uses candle_core.shape, so a change to candle_core.shape can break candle_transformers.models.deepseek2, while a change to candle_transformers.models.deepseek2 can't break candle_core.shape.
Position
Below the diagonal: candle_transformers.models.deepseek2 uses a module listed above it, which is the healthy direction.
candle_transformers.models.deepseek2 uses candle_core.dtype, so a change to candle_core.dtype can break candle_transformers.models.deepseek2, while a change to candle_transformers.models.deepseek2 can't break candle_core.dtype.
Position
Below the diagonal: candle_transformers.models.deepseek2 uses a module listed above it, which is the healthy direction.
candle_transformers.models.deepseek2 uses candle_core.layout, so a change to candle_core.layout can break candle_transformers.models.deepseek2, while a change to candle_transformers.models.deepseek2 can't break candle_core.layout.
Position
Below the diagonal: candle_transformers.models.deepseek2 uses a module listed above it, which is the healthy direction.
candle_transformers.models.deepseek2 uses candle_core.device, so a change to candle_core.device can break candle_transformers.models.deepseek2, while a change to candle_transformers.models.deepseek2 can't break candle_core.device.
Position
Below the diagonal: candle_transformers.models.deepseek2 uses a module listed above it, which is the healthy direction.
candle_transformers.models.deepseek2 uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_transformers.models.deepseek2, while a change to candle_transformers.models.deepseek2 can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_transformers.models.deepseek2 uses a module listed above it, which is the healthy direction.
candle_transformers.models.deepseek2 uses candle_core.custom_op, so a change to candle_core.custom_op can break candle_transformers.models.deepseek2, while a change to candle_transformers.models.deepseek2 can't break candle_core.custom_op.
Position
Below the diagonal: candle_transformers.models.deepseek2 uses a module listed above it, which is the healthy direction.
candle_transformers.models.deepseek2 uses candle_nn.activation, so a change to candle_nn.activation can break candle_transformers.models.deepseek2, while a change to candle_transformers.models.deepseek2 can't break candle_nn.activation.
Position
Below the diagonal: candle_transformers.models.deepseek2 uses a module listed above it, which is the healthy direction.
candle_transformers.models.deepseek2 uses candle_nn.embedding, so a change to candle_nn.embedding can break candle_transformers.models.deepseek2, while a change to candle_transformers.models.deepseek2 can't break candle_nn.embedding.
Position
Below the diagonal: candle_transformers.models.deepseek2 uses a module listed above it, which is the healthy direction.
candle_transformers.models.deepseek2 uses candle_nn.layer_norm, so a change to candle_nn.layer_norm can break candle_transformers.models.deepseek2, while a change to candle_transformers.models.deepseek2 can't break candle_nn.layer_norm.
Position
Below the diagonal: candle_transformers.models.deepseek2 uses a module listed above it, which is the healthy direction.
candle_transformers.models.deepseek2 uses candle_nn.linear, so a change to candle_nn.linear can break candle_transformers.models.deepseek2, while a change to candle_transformers.models.deepseek2 can't break candle_nn.linear.
Position
Below the diagonal: candle_transformers.models.deepseek2 uses a module listed above it, which is the healthy direction.
candle_transformers.models.deepseek2 uses candle_transformers.models.based, so a change to candle_transformers.models.based can break candle_transformers.models.deepseek2, while a change to candle_transformers.models.deepseek2 can't break candle_transformers.models.based.
Position
Below the diagonal: candle_transformers.models.deepseek2 uses a module listed above it, which is the healthy direction.
candle_transformers.models.deepseek2 uses candle_transformers.models.beit, so a change to candle_transformers.models.beit can break candle_transformers.models.deepseek2, while a change to candle_transformers.models.deepseek2 can't break candle_transformers.models.beit.
Position
Below the diagonal: candle_transformers.models.deepseek2 uses a module listed above it, which is the healthy direction.
candle_transformers.models.deepseek2 uses candle_core.cpu_backend, so a change to candle_core.cpu_backend can break candle_transformers.models.deepseek2, while a change to candle_transformers.models.deepseek2 can't break candle_core.cpu_backend.
Position
Below the diagonal: candle_transformers.models.deepseek2 uses a module listed above it, which is the healthy direction.
26→27 candle_transformers.models.deepseek2 uses candle_core.tensorpart of a loop✕
Connections
11 pairs of types, where a type in candle_transformers.models.deepseek2 uses a type in candle_core.tensor.
candle_transformers.models.deepseek2 uses candle_core.tensor, so a change to candle_core.tensor can break candle_transformers.models.deepseek2, while a change to candle_transformers.models.deepseek2 can't break candle_core.tensor.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
candle_core.tensor uses candle_core.shape, so a change to candle_core.shape can break candle_core.tensor, while a change to candle_core.tensor can't break candle_core.shape.
Position
Below the diagonal: candle_core.tensor uses a module listed above it, which is the healthy direction.
candle_core.tensor uses candle_core.dtype, so a change to candle_core.dtype can break candle_core.tensor, while a change to candle_core.tensor can't break candle_core.dtype.
Position
Below the diagonal: candle_core.tensor uses a module listed above it, which is the healthy direction.
candle_core.tensor uses candle_core.layout, so a change to candle_core.layout can break candle_core.tensor, while a change to candle_core.tensor can't break candle_core.layout.
Position
Below the diagonal: candle_core.tensor uses a module listed above it, which is the healthy direction.
candle_core.tensor uses candle_core.device, so a change to candle_core.device can break candle_core.tensor, while a change to candle_core.tensor can't break candle_core.device.
Position
Below the diagonal: candle_core.tensor uses a module listed above it, which is the healthy direction.
candle_core.tensor uses candle_core.cpu_backend, so a change to candle_core.cpu_backend can break candle_core.tensor, while a change to candle_core.tensor can't break candle_core.cpu_backend.
Position
Below the diagonal: candle_core.tensor uses a module listed above it, which is the healthy direction.
candle_core.tensor uses candle_metal_kernels.utils, so a change to candle_metal_kernels.utils can break candle_core.tensor, while a change to candle_core.tensor can't break candle_metal_kernels.utils.
Position
Below the diagonal: candle_core.tensor uses a module listed above it, which is the healthy direction.
candle_core.tensor uses candle_transformers.models.deepseek2, so a change to candle_transformers.models.deepseek2 can break candle_core.tensor, while a change to candle_core.tensor can't break candle_transformers.models.deepseek2.
Position
Below the diagonal: candle_core.tensor uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in candle_core uses a type in candle_core.tensor.
The types involved
candle_core.Module → candle_core.tensor.Tensor
candle_core.ModuleT → candle_core.tensor.Tensor
Direction
candle_core uses candle_core.tensor, so a change to candle_core.tensor can break candle_core, while a change to candle_core can't break candle_core.tensor.
Position
Below the diagonal: candle_core uses a module listed above it, which is the healthy direction.
candle_nn.kv_cache uses candle_core.dtype, so a change to candle_core.dtype can break candle_nn.kv_cache, while a change to candle_nn.kv_cache can't break candle_core.dtype.
Position
Below the diagonal: candle_nn.kv_cache uses a module listed above it, which is the healthy direction.
candle_nn.kv_cache uses candle_core.device, so a change to candle_core.device can break candle_nn.kv_cache, while a change to candle_nn.kv_cache can't break candle_core.device.
Position
Below the diagonal: candle_nn.kv_cache uses a module listed above it, which is the healthy direction.
candle_nn.kv_cache uses candle_core.tensor, so a change to candle_core.tensor can break candle_nn.kv_cache, while a change to candle_nn.kv_cache can't break candle_core.tensor.
Position
Below the diagonal: candle_nn.kv_cache uses a module listed above it, which is the healthy direction.
candle_nn.group_norm uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_nn.group_norm, while a change to candle_nn.group_norm can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_nn.group_norm uses a module listed above it, which is the healthy direction.
candle_nn.group_norm uses candle_core.tensor, so a change to candle_core.tensor can break candle_nn.group_norm, while a change to candle_nn.group_norm can't break candle_core.tensor.
Position
Below the diagonal: candle_nn.group_norm uses a module listed above it, which is the healthy direction.
candle_nn.group_norm uses candle_core, so a change to candle_core can break candle_nn.group_norm, while a change to candle_nn.group_norm can't break candle_core.
Position
Below the diagonal: candle_nn.group_norm uses a module listed above it, which is the healthy direction.
candle_transformers.models.bert uses candle_core.dtype, so a change to candle_core.dtype can break candle_transformers.models.bert, while a change to candle_transformers.models.bert can't break candle_core.dtype.
Position
Below the diagonal: candle_transformers.models.bert uses a module listed above it, which is the healthy direction.
candle_transformers.models.bert uses candle_core.device, so a change to candle_core.device can break candle_transformers.models.bert, while a change to candle_transformers.models.bert can't break candle_core.device.
Position
Below the diagonal: candle_transformers.models.bert uses a module listed above it, which is the healthy direction.
candle_transformers.models.bert uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_transformers.models.bert, while a change to candle_transformers.models.bert can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_transformers.models.bert uses a module listed above it, which is the healthy direction.
candle_transformers.models.bert uses candle_nn.embedding, so a change to candle_nn.embedding can break candle_transformers.models.bert, while a change to candle_transformers.models.bert can't break candle_nn.embedding.
Position
Below the diagonal: candle_transformers.models.bert uses a module listed above it, which is the healthy direction.
candle_transformers.models.bert uses candle_nn.layer_norm, so a change to candle_nn.layer_norm can break candle_transformers.models.bert, while a change to candle_transformers.models.bert can't break candle_nn.layer_norm.
Position
Below the diagonal: candle_transformers.models.bert uses a module listed above it, which is the healthy direction.
candle_transformers.models.bert uses candle_nn.linear, so a change to candle_nn.linear can break candle_transformers.models.bert, while a change to candle_transformers.models.bert can't break candle_nn.linear.
Position
Below the diagonal: candle_transformers.models.bert uses a module listed above it, which is the healthy direction.
candle_transformers.models.bert uses candle_transformers.models.based, so a change to candle_transformers.models.based can break candle_transformers.models.bert, while a change to candle_transformers.models.bert can't break candle_transformers.models.based.
Position
Below the diagonal: candle_transformers.models.bert uses a module listed above it, which is the healthy direction.
candle_transformers.models.bert uses candle_core.tensor, so a change to candle_core.tensor can break candle_transformers.models.bert, while a change to candle_transformers.models.bert can't break candle_core.tensor.
Position
Below the diagonal: candle_transformers.models.bert uses a module listed above it, which is the healthy direction.
candle_transformers.models.bert uses candle_core, so a change to candle_core can break candle_transformers.models.bert, while a change to candle_transformers.models.bert can't break candle_core.
Position
Below the diagonal: candle_transformers.models.bert uses a module listed above it, which is the healthy direction.
candle_transformers.models.chatglm uses candle_core.dtype, so a change to candle_core.dtype can break candle_transformers.models.chatglm, while a change to candle_transformers.models.chatglm can't break candle_core.dtype.
Position
Below the diagonal: candle_transformers.models.chatglm uses a module listed above it, which is the healthy direction.
candle_transformers.models.chatglm uses candle_core.device, so a change to candle_core.device can break candle_transformers.models.chatglm, while a change to candle_transformers.models.chatglm can't break candle_core.device.
Position
Below the diagonal: candle_transformers.models.chatglm uses a module listed above it, which is the healthy direction.
candle_transformers.models.chatglm uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_transformers.models.chatglm, while a change to candle_transformers.models.chatglm can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_transformers.models.chatglm uses a module listed above it, which is the healthy direction.
candle_transformers.models.chatglm uses candle_nn.embedding, so a change to candle_nn.embedding can break candle_transformers.models.chatglm, while a change to candle_transformers.models.chatglm can't break candle_nn.embedding.
Position
Below the diagonal: candle_transformers.models.chatglm uses a module listed above it, which is the healthy direction.
candle_transformers.models.chatglm uses candle_nn.layer_norm, so a change to candle_nn.layer_norm can break candle_transformers.models.chatglm, while a change to candle_transformers.models.chatglm can't break candle_nn.layer_norm.
Position
Below the diagonal: candle_transformers.models.chatglm uses a module listed above it, which is the healthy direction.
candle_transformers.models.chatglm uses candle_nn.linear, so a change to candle_nn.linear can break candle_transformers.models.chatglm, while a change to candle_transformers.models.chatglm can't break candle_nn.linear.
Position
Below the diagonal: candle_transformers.models.chatglm uses a module listed above it, which is the healthy direction.
candle_transformers.models.chatglm uses candle_transformers.models.based, so a change to candle_transformers.models.based can break candle_transformers.models.chatglm, while a change to candle_transformers.models.chatglm can't break candle_transformers.models.based.
Position
Below the diagonal: candle_transformers.models.chatglm uses a module listed above it, which is the healthy direction.
candle_transformers.models.chatglm uses candle_transformers.models.beit, so a change to candle_transformers.models.beit can break candle_transformers.models.chatglm, while a change to candle_transformers.models.chatglm can't break candle_transformers.models.beit.
Position
Below the diagonal: candle_transformers.models.chatglm uses a module listed above it, which is the healthy direction.
candle_transformers.models.chatglm uses candle_core.tensor, so a change to candle_core.tensor can break candle_transformers.models.chatglm, while a change to candle_transformers.models.chatglm can't break candle_core.tensor.
Position
Below the diagonal: candle_transformers.models.chatglm uses a module listed above it, which is the healthy direction.
candle_transformers.models.chatglm uses candle_core, so a change to candle_core can break candle_transformers.models.chatglm, while a change to candle_transformers.models.chatglm can't break candle_core.
Position
Below the diagonal: candle_transformers.models.chatglm uses a module listed above it, which is the healthy direction.
candle_transformers.models.dac uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_transformers.models.dac, while a change to candle_transformers.models.dac can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_transformers.models.dac uses a module listed above it, which is the healthy direction.
candle_transformers.models.dac uses candle_nn.conv, so a change to candle_nn.conv can break candle_transformers.models.dac, while a change to candle_transformers.models.dac can't break candle_nn.conv.
Position
Below the diagonal: candle_transformers.models.dac uses a module listed above it, which is the healthy direction.
candle_transformers.models.dac uses candle_nn.embedding, so a change to candle_nn.embedding can break candle_transformers.models.dac, while a change to candle_transformers.models.dac can't break candle_nn.embedding.
Position
Below the diagonal: candle_transformers.models.dac uses a module listed above it, which is the healthy direction.
candle_transformers.models.dac uses candle_transformers.models.based, so a change to candle_transformers.models.based can break candle_transformers.models.dac, while a change to candle_transformers.models.dac can't break candle_transformers.models.based.
Position
Below the diagonal: candle_transformers.models.dac uses a module listed above it, which is the healthy direction.
candle_transformers.models.dac uses candle_transformers.models.blip, so a change to candle_transformers.models.blip can break candle_transformers.models.dac, while a change to candle_transformers.models.dac can't break candle_transformers.models.blip.
Position
Below the diagonal: candle_transformers.models.dac uses a module listed above it, which is the healthy direction.
candle_transformers.models.dac uses candle_core.tensor, so a change to candle_core.tensor can break candle_transformers.models.dac, while a change to candle_transformers.models.dac can't break candle_core.tensor.
Position
Below the diagonal: candle_transformers.models.dac uses a module listed above it, which is the healthy direction.
candle_transformers.models.dac uses candle_core, so a change to candle_core can break candle_transformers.models.dac, while a change to candle_transformers.models.dac can't break candle_core.
Position
Below the diagonal: candle_transformers.models.dac uses a module listed above it, which is the healthy direction.
candle_transformers.models.granite uses candle_core.dtype, so a change to candle_core.dtype can break candle_transformers.models.granite, while a change to candle_transformers.models.granite can't break candle_core.dtype.
Position
Below the diagonal: candle_transformers.models.granite uses a module listed above it, which is the healthy direction.
candle_transformers.models.granite uses candle_core.device, so a change to candle_core.device can break candle_transformers.models.granite, while a change to candle_transformers.models.granite can't break candle_core.device.
Position
Below the diagonal: candle_transformers.models.granite uses a module listed above it, which is the healthy direction.
candle_transformers.models.granite uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_transformers.models.granite, while a change to candle_transformers.models.granite can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_transformers.models.granite uses a module listed above it, which is the healthy direction.
candle_transformers.models.granite uses candle_nn.embedding, so a change to candle_nn.embedding can break candle_transformers.models.granite, while a change to candle_transformers.models.granite can't break candle_nn.embedding.
Position
Below the diagonal: candle_transformers.models.granite uses a module listed above it, which is the healthy direction.
candle_transformers.models.granite uses candle_nn.layer_norm, so a change to candle_nn.layer_norm can break candle_transformers.models.granite, while a change to candle_transformers.models.granite can't break candle_nn.layer_norm.
Position
Below the diagonal: candle_transformers.models.granite uses a module listed above it, which is the healthy direction.
candle_transformers.models.granite uses candle_nn.linear, so a change to candle_nn.linear can break candle_transformers.models.granite, while a change to candle_transformers.models.granite can't break candle_nn.linear.
Position
Below the diagonal: candle_transformers.models.granite uses a module listed above it, which is the healthy direction.
candle_transformers.models.granite uses candle_transformers.models.based, so a change to candle_transformers.models.based can break candle_transformers.models.granite, while a change to candle_transformers.models.granite can't break candle_transformers.models.based.
Position
Below the diagonal: candle_transformers.models.granite uses a module listed above it, which is the healthy direction.
candle_transformers.models.granite uses candle_transformers.models.beit, so a change to candle_transformers.models.beit can break candle_transformers.models.granite, while a change to candle_transformers.models.granite can't break candle_transformers.models.beit.
Position
Below the diagonal: candle_transformers.models.granite uses a module listed above it, which is the healthy direction.
candle_transformers.models.granite uses candle_core.tensor, so a change to candle_core.tensor can break candle_transformers.models.granite, while a change to candle_transformers.models.granite can't break candle_core.tensor.
Position
Below the diagonal: candle_transformers.models.granite uses a module listed above it, which is the healthy direction.
candle_transformers.models.granite uses candle_nn.kv_cache, so a change to candle_nn.kv_cache can break candle_transformers.models.granite, while a change to candle_transformers.models.granite can't break candle_nn.kv_cache.
Position
Below the diagonal: candle_transformers.models.granite uses a module listed above it, which is the healthy direction.
candle_transformers.models.metavoice.transformer uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_transformers.models.metavoice.transformer, while a change to candle_transformers.models.metavoice.transformer can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_transformers.models.metavoice.transformer uses a module listed above it, which is the healthy direction.
candle_transformers.models.metavoice.transformer uses candle_nn.embedding, so a change to candle_nn.embedding can break candle_transformers.models.metavoice.transformer, while a change to candle_transformers.models.metavoice.transformer can't break candle_nn.embedding.
Position
Below the diagonal: candle_transformers.models.metavoice.transformer uses a module listed above it, which is the healthy direction.
candle_transformers.models.metavoice.transformer uses candle_nn.layer_norm, so a change to candle_nn.layer_norm can break candle_transformers.models.metavoice.transformer, while a change to candle_transformers.models.metavoice.transformer can't break candle_nn.layer_norm.
Position
Below the diagonal: candle_transformers.models.metavoice.transformer uses a module listed above it, which is the healthy direction.
candle_transformers.models.metavoice.transformer uses candle_nn.linear, so a change to candle_nn.linear can break candle_transformers.models.metavoice.transformer, while a change to candle_transformers.models.metavoice.transformer can't break candle_nn.linear.
Position
Below the diagonal: candle_transformers.models.metavoice.transformer uses a module listed above it, which is the healthy direction.
candle_transformers.models.metavoice.transformer uses candle_transformers.models.based, so a change to candle_transformers.models.based can break candle_transformers.models.metavoice.transformer, while a change to candle_transformers.models.metavoice.transformer can't break candle_transformers.models.based.
Position
Below the diagonal: candle_transformers.models.metavoice.transformer uses a module listed above it, which is the healthy direction.
candle_transformers.models.metavoice.transformer uses candle_transformers.models.beit, so a change to candle_transformers.models.beit can break candle_transformers.models.metavoice.transformer, while a change to candle_transformers.models.metavoice.transformer can't break candle_transformers.models.beit.
Position
Below the diagonal: candle_transformers.models.metavoice.transformer uses a module listed above it, which is the healthy direction.
candle_transformers.models.metavoice.transformer uses candle_core.tensor, so a change to candle_core.tensor can break candle_transformers.models.metavoice.transformer, while a change to candle_transformers.models.metavoice.transformer can't break candle_core.tensor.
Position
Below the diagonal: candle_transformers.models.metavoice.transformer uses a module listed above it, which is the healthy direction.
candle_transformers.models.metavoice.transformer uses candle_core, so a change to candle_core can break candle_transformers.models.metavoice.transformer, while a change to candle_transformers.models.metavoice.transformer can't break candle_core.
Position
Below the diagonal: candle_transformers.models.metavoice.transformer uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_gemma3 uses candle_core.dtype, so a change to candle_core.dtype can break candle_transformers.models.quantized_gemma3, while a change to candle_transformers.models.quantized_gemma3 can't break candle_core.dtype.
Position
Below the diagonal: candle_transformers.models.quantized_gemma3 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_gemma3 uses candle_core.quantized, so a change to candle_core.quantized can break candle_transformers.models.quantized_gemma3, while a change to candle_transformers.models.quantized_gemma3 can't break candle_core.quantized.
Position
Below the diagonal: candle_transformers.models.quantized_gemma3 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_gemma3 uses candle_core.device, so a change to candle_core.device can break candle_transformers.models.quantized_gemma3, while a change to candle_transformers.models.quantized_gemma3 can't break candle_core.device.
Position
Below the diagonal: candle_transformers.models.quantized_gemma3 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_gemma3 uses candle_core.quantized.ggml_file, so a change to candle_core.quantized.ggml_file can break candle_transformers.models.quantized_gemma3, while a change to candle_transformers.models.quantized_gemma3 can't break candle_core.quantized.ggml_file.
Position
Below the diagonal: candle_transformers.models.quantized_gemma3 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_gemma3 uses candle_nn.embedding, so a change to candle_nn.embedding can break candle_transformers.models.quantized_gemma3, while a change to candle_transformers.models.quantized_gemma3 can't break candle_nn.embedding.
Position
Below the diagonal: candle_transformers.models.quantized_gemma3 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_gemma3 uses candle_nn.layer_norm, so a change to candle_nn.layer_norm can break candle_transformers.models.quantized_gemma3, while a change to candle_transformers.models.quantized_gemma3 can't break candle_nn.layer_norm.
Position
Below the diagonal: candle_transformers.models.quantized_gemma3 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_gemma3 uses candle_transformers.models.based, so a change to candle_transformers.models.based can break candle_transformers.models.quantized_gemma3, while a change to candle_transformers.models.quantized_gemma3 can't break candle_transformers.models.based.
Position
Below the diagonal: candle_transformers.models.quantized_gemma3 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_gemma3 uses candle_transformers.models.beit, so a change to candle_transformers.models.beit can break candle_transformers.models.quantized_gemma3, while a change to candle_transformers.models.quantized_gemma3 can't break candle_transformers.models.beit.
Position
Below the diagonal: candle_transformers.models.quantized_gemma3 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_gemma3 uses candle_core.tensor, so a change to candle_core.tensor can break candle_transformers.models.quantized_gemma3, while a change to candle_transformers.models.quantized_gemma3 can't break candle_core.tensor.
Position
Below the diagonal: candle_transformers.models.quantized_gemma3 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_gemma3 uses candle_core, so a change to candle_core can break candle_transformers.models.quantized_gemma3, while a change to candle_transformers.models.quantized_gemma3 can't break candle_core.
Position
Below the diagonal: candle_transformers.models.quantized_gemma3 uses a module listed above it, which is the healthy direction.
candle_transformers.models.encodec uses candle_core.dtype, so a change to candle_core.dtype can break candle_transformers.models.encodec, while a change to candle_transformers.models.encodec can't break candle_core.dtype.
Position
Below the diagonal: candle_transformers.models.encodec uses a module listed above it, which is the healthy direction.
candle_transformers.models.encodec uses candle_core.layout, so a change to candle_core.layout can break candle_transformers.models.encodec, while a change to candle_transformers.models.encodec can't break candle_core.layout.
Position
Below the diagonal: candle_transformers.models.encodec uses a module listed above it, which is the healthy direction.
candle_transformers.models.encodec uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_transformers.models.encodec, while a change to candle_transformers.models.encodec can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_transformers.models.encodec uses a module listed above it, which is the healthy direction.
candle_transformers.models.encodec uses candle_core.custom_op, so a change to candle_core.custom_op can break candle_transformers.models.encodec, while a change to candle_transformers.models.encodec can't break candle_core.custom_op.
Position
Below the diagonal: candle_transformers.models.encodec uses a module listed above it, which is the healthy direction.
candle_transformers.models.encodec uses candle_nn.conv, so a change to candle_nn.conv can break candle_transformers.models.encodec, while a change to candle_transformers.models.encodec can't break candle_nn.conv.
Position
Below the diagonal: candle_transformers.models.encodec uses a module listed above it, which is the healthy direction.
candle_transformers.models.encodec uses candle_nn.embedding, so a change to candle_nn.embedding can break candle_transformers.models.encodec, while a change to candle_transformers.models.encodec can't break candle_nn.embedding.
Position
Below the diagonal: candle_transformers.models.encodec uses a module listed above it, which is the healthy direction.
candle_transformers.models.encodec uses candle_transformers.models.based, so a change to candle_transformers.models.based can break candle_transformers.models.encodec, while a change to candle_transformers.models.encodec can't break candle_transformers.models.based.
Position
Below the diagonal: candle_transformers.models.encodec uses a module listed above it, which is the healthy direction.
candle_transformers.models.encodec uses candle_transformers.models.blip, so a change to candle_transformers.models.blip can break candle_transformers.models.encodec, while a change to candle_transformers.models.encodec can't break candle_transformers.models.blip.
Position
Below the diagonal: candle_transformers.models.encodec uses a module listed above it, which is the healthy direction.
candle_transformers.models.encodec uses candle_core.cpu_backend, so a change to candle_core.cpu_backend can break candle_transformers.models.encodec, while a change to candle_transformers.models.encodec can't break candle_core.cpu_backend.
Position
Below the diagonal: candle_transformers.models.encodec uses a module listed above it, which is the healthy direction.
candle_transformers.models.encodec uses candle_core.tensor, so a change to candle_core.tensor can break candle_transformers.models.encodec, while a change to candle_transformers.models.encodec can't break candle_core.tensor.
Position
Below the diagonal: candle_transformers.models.encodec uses a module listed above it, which is the healthy direction.
candle_transformers.models.encodec uses candle_core, so a change to candle_core can break candle_transformers.models.encodec, while a change to candle_transformers.models.encodec can't break candle_core.
Position
Below the diagonal: candle_transformers.models.encodec uses a module listed above it, which is the healthy direction.
candle_transformers.models.encodec uses candle_nn.group_norm, so a change to candle_nn.group_norm can break candle_transformers.models.encodec, while a change to candle_transformers.models.encodec can't break candle_nn.group_norm.
Position
Below the diagonal: candle_transformers.models.encodec uses a module listed above it, which is the healthy direction.
candle_transformers.models.encodec uses candle_transformers.models.dac, so a change to candle_transformers.models.dac can break candle_transformers.models.encodec, while a change to candle_transformers.models.encodec can't break candle_transformers.models.dac.
Position
Below the diagonal: candle_transformers.models.encodec uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_glm4 uses candle_core.dtype, so a change to candle_core.dtype can break candle_transformers.models.quantized_glm4, while a change to candle_transformers.models.quantized_glm4 can't break candle_core.dtype.
Position
Below the diagonal: candle_transformers.models.quantized_glm4 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_glm4 uses candle_core.quantized, so a change to candle_core.quantized can break candle_transformers.models.quantized_glm4, while a change to candle_transformers.models.quantized_glm4 can't break candle_core.quantized.
Position
Below the diagonal: candle_transformers.models.quantized_glm4 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_glm4 uses candle_core.device, so a change to candle_core.device can break candle_transformers.models.quantized_glm4, while a change to candle_transformers.models.quantized_glm4 can't break candle_core.device.
Position
Below the diagonal: candle_transformers.models.quantized_glm4 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_glm4 uses candle_core.quantized.ggml_file, so a change to candle_core.quantized.ggml_file can break candle_transformers.models.quantized_glm4, while a change to candle_transformers.models.quantized_glm4 can't break candle_core.quantized.ggml_file.
Position
Below the diagonal: candle_transformers.models.quantized_glm4 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_glm4 uses candle_nn.activation, so a change to candle_nn.activation can break candle_transformers.models.quantized_glm4, while a change to candle_transformers.models.quantized_glm4 can't break candle_nn.activation.
Position
Below the diagonal: candle_transformers.models.quantized_glm4 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_glm4 uses candle_nn.embedding, so a change to candle_nn.embedding can break candle_transformers.models.quantized_glm4, while a change to candle_transformers.models.quantized_glm4 can't break candle_nn.embedding.
Position
Below the diagonal: candle_transformers.models.quantized_glm4 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_glm4 uses candle_nn.layer_norm, so a change to candle_nn.layer_norm can break candle_transformers.models.quantized_glm4, while a change to candle_transformers.models.quantized_glm4 can't break candle_nn.layer_norm.
Position
Below the diagonal: candle_transformers.models.quantized_glm4 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_glm4 uses candle_transformers.models.based, so a change to candle_transformers.models.based can break candle_transformers.models.quantized_glm4, while a change to candle_transformers.models.quantized_glm4 can't break candle_transformers.models.based.
Position
Below the diagonal: candle_transformers.models.quantized_glm4 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_glm4 uses candle_transformers.models.beit, so a change to candle_transformers.models.beit can break candle_transformers.models.quantized_glm4, while a change to candle_transformers.models.quantized_glm4 can't break candle_transformers.models.beit.
Position
Below the diagonal: candle_transformers.models.quantized_glm4 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_glm4 uses candle_core.tensor, so a change to candle_core.tensor can break candle_transformers.models.quantized_glm4, while a change to candle_transformers.models.quantized_glm4 can't break candle_core.tensor.
Position
Below the diagonal: candle_transformers.models.quantized_glm4 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_glm4 uses candle_core, so a change to candle_core can break candle_transformers.models.quantized_glm4, while a change to candle_transformers.models.quantized_glm4 can't break candle_core.
Position
Below the diagonal: candle_transformers.models.quantized_glm4 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_glm4 uses candle_nn.kv_cache, so a change to candle_nn.kv_cache can break candle_transformers.models.quantized_glm4, while a change to candle_transformers.models.quantized_glm4 can't break candle_nn.kv_cache.
Position
Below the diagonal: candle_transformers.models.quantized_glm4 uses a module listed above it, which is the healthy direction.
candle_transformers.models.quantized_glm4 uses candle_transformers.models.quantized_gemma3, so a change to candle_transformers.models.quantized_gemma3 can break candle_transformers.models.quantized_glm4, while a change to candle_transformers.models.quantized_glm4 can't break candle_transformers.models.quantized_gemma3.
Position
Below the diagonal: candle_transformers.models.quantized_glm4 uses a module listed above it, which is the healthy direction.
candle_transformers.models.rwkv_v5 uses candle_core.device, so a change to candle_core.device can break candle_transformers.models.rwkv_v5, while a change to candle_transformers.models.rwkv_v5 can't break candle_core.device.
Position
Below the diagonal: candle_transformers.models.rwkv_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.rwkv_v5 uses candle_core.quantized.ggml_file, so a change to candle_core.quantized.ggml_file can break candle_transformers.models.rwkv_v5, while a change to candle_transformers.models.rwkv_v5 can't break candle_core.quantized.ggml_file.
Position
Below the diagonal: candle_transformers.models.rwkv_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.rwkv_v5 uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_transformers.models.rwkv_v5, while a change to candle_transformers.models.rwkv_v5 can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_transformers.models.rwkv_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.rwkv_v5 uses candle_nn.embedding, so a change to candle_nn.embedding can break candle_transformers.models.rwkv_v5, while a change to candle_transformers.models.rwkv_v5 can't break candle_nn.embedding.
Position
Below the diagonal: candle_transformers.models.rwkv_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.rwkv_v5 uses candle_nn.layer_norm, so a change to candle_nn.layer_norm can break candle_transformers.models.rwkv_v5, while a change to candle_transformers.models.rwkv_v5 can't break candle_nn.layer_norm.
Position
Below the diagonal: candle_transformers.models.rwkv_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.rwkv_v5 uses candle_nn.linear, so a change to candle_nn.linear can break candle_transformers.models.rwkv_v5, while a change to candle_transformers.models.rwkv_v5 can't break candle_nn.linear.
Position
Below the diagonal: candle_transformers.models.rwkv_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.rwkv_v5 uses candle_transformers.models.based, so a change to candle_transformers.models.based can break candle_transformers.models.rwkv_v5, while a change to candle_transformers.models.rwkv_v5 can't break candle_transformers.models.based.
Position
Below the diagonal: candle_transformers.models.rwkv_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.rwkv_v5 uses candle_transformers.models.beit, so a change to candle_transformers.models.beit can break candle_transformers.models.rwkv_v5, while a change to candle_transformers.models.rwkv_v5 can't break candle_transformers.models.beit.
Position
Below the diagonal: candle_transformers.models.rwkv_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.rwkv_v5 uses candle_core.tensor, so a change to candle_core.tensor can break candle_transformers.models.rwkv_v5, while a change to candle_transformers.models.rwkv_v5 can't break candle_core.tensor.
Position
Below the diagonal: candle_transformers.models.rwkv_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.rwkv_v5 uses candle_nn.group_norm, so a change to candle_nn.group_norm can break candle_transformers.models.rwkv_v5, while a change to candle_transformers.models.rwkv_v5 can't break candle_nn.group_norm.
Position
Below the diagonal: candle_transformers.models.rwkv_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.rwkv_v5 uses candle_transformers.models.chatglm, so a change to candle_transformers.models.chatglm can break candle_transformers.models.rwkv_v5, while a change to candle_transformers.models.rwkv_v5 can't break candle_transformers.models.chatglm.
Position
Below the diagonal: candle_transformers.models.rwkv_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.rwkv_v5 uses candle_transformers.models.metavoice.transformer, so a change to candle_transformers.models.metavoice.transformer can break candle_transformers.models.rwkv_v5, while a change to candle_transformers.models.rwkv_v5 can't break candle_transformers.models.metavoice.transformer.
Position
Below the diagonal: candle_transformers.models.rwkv_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.stella_en_v5 uses candle_core.dtype, so a change to candle_core.dtype can break candle_transformers.models.stella_en_v5, while a change to candle_transformers.models.stella_en_v5 can't break candle_core.dtype.
Position
Below the diagonal: candle_transformers.models.stella_en_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.stella_en_v5 uses candle_core.device, so a change to candle_core.device can break candle_transformers.models.stella_en_v5, while a change to candle_transformers.models.stella_en_v5 can't break candle_core.device.
Position
Below the diagonal: candle_transformers.models.stella_en_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.stella_en_v5 uses candle_transformers.quantized_var_builder, so a change to candle_transformers.quantized_var_builder can break candle_transformers.models.stella_en_v5, while a change to candle_transformers.models.stella_en_v5 can't break candle_transformers.quantized_var_builder.
Position
Below the diagonal: candle_transformers.models.stella_en_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.stella_en_v5 uses candle_nn.activation, so a change to candle_nn.activation can break candle_transformers.models.stella_en_v5, while a change to candle_transformers.models.stella_en_v5 can't break candle_nn.activation.
Position
Below the diagonal: candle_transformers.models.stella_en_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.stella_en_v5 uses candle_nn.embedding, so a change to candle_nn.embedding can break candle_transformers.models.stella_en_v5, while a change to candle_transformers.models.stella_en_v5 can't break candle_nn.embedding.
Position
Below the diagonal: candle_transformers.models.stella_en_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.stella_en_v5 uses candle_nn.layer_norm, so a change to candle_nn.layer_norm can break candle_transformers.models.stella_en_v5, while a change to candle_transformers.models.stella_en_v5 can't break candle_nn.layer_norm.
Position
Below the diagonal: candle_transformers.models.stella_en_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.stella_en_v5 uses candle_nn.linear, so a change to candle_nn.linear can break candle_transformers.models.stella_en_v5, while a change to candle_transformers.models.stella_en_v5 can't break candle_nn.linear.
Position
Below the diagonal: candle_transformers.models.stella_en_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.stella_en_v5 uses candle_transformers.models.based, so a change to candle_transformers.models.based can break candle_transformers.models.stella_en_v5, while a change to candle_transformers.models.stella_en_v5 can't break candle_transformers.models.based.
Position
Below the diagonal: candle_transformers.models.stella_en_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.stella_en_v5 uses candle_transformers.models.beit, so a change to candle_transformers.models.beit can break candle_transformers.models.stella_en_v5, while a change to candle_transformers.models.stella_en_v5 can't break candle_transformers.models.beit.
Position
Below the diagonal: candle_transformers.models.stella_en_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.stella_en_v5 uses candle_core.tensor, so a change to candle_core.tensor can break candle_transformers.models.stella_en_v5, while a change to candle_transformers.models.stella_en_v5 can't break candle_core.tensor.
Position
Below the diagonal: candle_transformers.models.stella_en_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.stella_en_v5 uses candle_core, so a change to candle_core can break candle_transformers.models.stella_en_v5, while a change to candle_transformers.models.stella_en_v5 can't break candle_core.
Position
Below the diagonal: candle_transformers.models.stella_en_v5 uses a module listed above it, which is the healthy direction.
candle_transformers.models.stella_en_v5 uses candle_transformers.models.encodec, so a change to candle_transformers.models.encodec can break candle_transformers.models.stella_en_v5, while a change to candle_transformers.models.stella_en_v5 can't break candle_transformers.models.encodec.
Position
Below the diagonal: candle_transformers.models.stella_en_v5 uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 51% · Adequate · gated by D2, R1 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
7
High / Critical
A03:2025 — Software Supply Chain Failures
3
Medium
Roadmap
First, ensure all media elements have appropriate text alternatives and captions to support diverse users. Next, introduce TypeScript to the frontend build process to improve code reliability, starting with the highest-traffic modules. Simultaneously, enforce accessibility standards by adding automated checks to the test suite and CI pipeline to prevent regressions. Finally, address visual and structural issues by maintaining visible focus styles, respecting reduced motion preferences, and correcting color contrast and page landmarks.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 38
A definite problem that already costs you something and drags the score down: a
missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here
tends to cause failures elsewhere.
Serious — 1740
Likely wrong, but not failing yet. It degrades
the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to
carry for two years either.
Minor — 255
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 16
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 67 of 67 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.8 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 67 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 2015 of 2033 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.rs) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.rs) and this repository declares a Cargo test suite (repository root, 62 test files), but it was not re-run: its build outgrew the 8 GB scratch ceiling (8.72 GB measured) and was stopped; its suite was not run. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D14 License Compliance — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — this repository declares Cargo manifests but commits no Cargo.lock, so its dependency graph was closed from the manifests over the crates.io index, and part of it could not be read: no published release of tokio satisfies `1.*`. A licence verdict over part of a dependency graph is not a licence verdict. NOT a finding that this repository's licences are compliant: this dimension asserts nothing about its licensing in either direction.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D44 Platform End-of-Life — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python, Rust, c, cpp is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python, Rust, c, cpp is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's C, Cpp, Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
47 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was candle_onnx::eval::simple_eval_ at 345. A further 23 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being MetalStorage::unary_impl at 111 — they are counted neither in the figure above nor in this dimension's score. 7 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: candle-metal-kernels/src/kernels/sdpa.rs (candle_metal_kernels::kernels::sdpa::call_sdpa_vector_2pass at 38), candle-core/src/quantized/mod.rs (QStorage::from_data at 31), candle-core/src/safetensors.rs (Tensor::from_raw_buffer at 23), candle-core/src/sort.rs (ArgSort::metal_fwd at 23), candle-metal-kernels/src/kernels/quantized.rs (candle_metal_kernels::kernels::quantized::call_quantized_matmul_mv_t at 21), and 2 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 25 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with candle_onnx::eval::simple_eval_ (cyclomatic 345). — Refactoring it lifts Cyclomatic Complexity from 4.7 to about 5.8/10.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 63 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cognitive Complexity — start with candle_onnx::eval::simple_eval_ (cognitive 754). — Refactoring it lifts Cognitive Complexity from 3.9 to about 5.8/10.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.7 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 50 FileTooLong finding(s) in God Classes — start with mod.rs (5), lib.rs (3), text.rs (2). — One of this dimension's main actionable groups (50 warning-level).
Resolve the 31 MethodTooLong finding(s) in God Classes — start with mod.rs (9), lib.rs (4), backprop.rs (2). — One of this dimension's main actionable groups (31 warning-level).
Resolve the 29 FunctionTooLong finding(s) in God Classes — start with neon.rs (10), cutile.rs (2), varlen.rs (2). — One of this dimension's main actionable groups (29 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
1101 duplicated block group(s) detected. A further 147 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 48 of the 1248 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 284 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 117 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with neon.rs (11), model.rs (9), mod.rs (7). — One of this dimension's main actionable groups (117 warning-level).
Resolve the 78 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with mod.rs (10), model.rs (8), mixformer.rs (5). — One of this dimension's main actionable groups (78 warning-level).
Resolve the 72 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with neon.rs (7), cuda.rs (4), lib.rs (4). — One of this dimension's main actionable groups (72 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
13 production modules (Cargo+Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 2 module(s) off the main sequence, with abstractness counted on 11 of the 13 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: candle-kernels · ×2
✓ On the Gold path — maintain.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with tensor.rs. — One of this dimension's main actionable groups (1 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
431 test methods: 182 unit, 249 integration, 0 BDD, 0 e2e. The Rust suite contributes 387 `#[test]` function(s) across 62 file(s) declaring at least one; its unit/integration split is Cargo's own — 36 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 44 test function(s) across 6 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
4 outdated, 0 yanked direct Cargo dependencies. Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from Cargo.lock there.
Outdated: js-sys · ×4
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 1 Hotspot finding(s) in Churn × Complexity Hotspots — start with eval.rs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.7 / 10Exemplary✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
12 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is candle-core/src/quantized/repack.rs. Counted over 342 of the 417 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
123 deducted task-comment markers across 155474 LoC (0.1/KLoC) → score 9.8. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 116 TodoComment finding(s) in Explicit Debt — start with main.rs (12), mod.rs (12), lib.rs (8). — One of this dimension's main actionable groups (116 warning-level).
Resolve the 4 XxxComment finding(s) in Explicit Debt — start with eval.rs (2), safetensors.rs (2). — One of this dimension's main actionable groups (4 warning-level).
Resolve the 2 HackComment finding(s) in Explicit Debt — start with eval.rs, npy.rs. — One of this dimension's main actionable groups (2 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 30 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
2 of 12 build units (Cargo) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
7 finding(s): 0 critical, 4 high, 3 medium, 0 low. semgrep hit a parse error in 1 file(s) — `candle-examples/examples/moondream/main.rs` (line 275) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
What to do
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
220 of 342 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is candle-transformers/src/models/debertav2.rs. Counted over 342 of the 417 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Most significant orphaned file · ×3candle-transformers/src/models/debertav2.rs:1
Concentrated knowledge decay
What to do
Resolve the 217 Orphaned file finding(s) in Knowledge Freshness — start with mod.rs (7), model.rs (6), lib.rs (3). — One of this dimension's main actionable groups (217 recommendation-level).
Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with debertav2.rs, text.rs, vision.rs. — One of this dimension's main actionable groups (3 recommendation-level).
Resolve the 1 Concentrated knowledge decay finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 1 Boundary-crossing change coupling finding(s) in Change Coupling — start with mod.rs. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 2 Change coupling finding(s) in Change Coupling — start with lib.rs, backend.rs. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives1.0 / 10Critical✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×6) — candle-wasm-examples/blip/index.html:348, candle-wasm-examples/moondream/index.html:261, candle-wasm-examples/segment-anything/lib-example.html:532, …
An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. (×15) — candle-wasm-examples/blip/index.html:377, candle-wasm-examples/blip/index.html:381, candle-wasm-examples/blip/index.html:385, …
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Do you agree with this assessment?
AC2 · Forms & labels6.6 / 10Strong✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×6) — candle-wasm-examples/bert/lib-example.html:328, candle-wasm-examples/llama2-c/lib-example.html:229, candle-wasm-examples/moondream/index.html:89, …
A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×2) — candle-wasm-examples/llama2-c/lib-example.html:235, REDACTED:442
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×10) — candle-wasm-examples/bert/lib-example.html:1, candle-wasm-examples/blip/index.html:2, candle-wasm-examples/llama2-c/lib-example.html:1, …
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — candle-wasm-examples/quant-qwen3/index.html:2
Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. — candle-wasm-examples/quant-qwen3/index.html:307
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
<input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×5) — candle-wasm-examples/bert/lib-example.html:308, candle-wasm-examples/bert/lib-example.html:328, candle-wasm-examples/llama2-c/lib-example.html:229, …
This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade. (×7) — candle-wasm-examples/bert/lib-example.html:349, candle-wasm-examples/blip/index.html:355, candle-wasm-examples/llama2-c/lib-example.html:339, …
<textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×2) — candle-wasm-examples/bert/lib-example.html:354, REDACTED:432
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 13 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a README to the 2 of 25 project(s) that lack one — worth up to 0.2 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability5.3 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 6/14 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `candle-wasm-examples/bert`, `candle-wasm-examples/blip`, `candle-wasm-examples/moondream`, `candle-wasm-examples/phi` and 3 more.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Dependabot is configured but does not watch `github-actions`, `pip` — add those `package-ecosystem` entries to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Do you agree with this assessment?
R1 · Type Safety0.0 / 10Critical✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
0 typed · 14 plain JS — the untyped files are candle-wasm-examples/bert/bertWorker.js, candle-wasm-examples/bert/utils.js, candle-wasm-examples/blip/blipWorker.js, candle-wasm-examples/llama2-c/llama2cWorker.js, REDACTED, candle-wasm-examples/moondream/moondreamWorker.js (+8 more).
What to do
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
12 duplicated blocks under candle-wasm-examples/ have copies in at least two of the sibling directories bert, blip, llama2-c, moondream, phi, segment-anything (+3 more sibling(s) not listed) — 11 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 12 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 12 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 12 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — candle-wasm-examples/moondream/moondreamWorker.js:6
candle-wasm-examples/moondream/moondreamWorker.js:6 · candle-wasm-examples/phi/phiWorker.js:4 — the two spans are one implementation copied and then locally edited — 652 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — candle-wasm-examples/moondream/moondreamWorker.js:6
candle-wasm-examples/t5/T5ModelConditionalGeneration.js:2 · candle-wasm-examples/t5/T5ModelEncoderWorker.js:2 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — candle-wasm-examples/t5/T5ModelConditionalGeneration.js:2
candle-wasm-examples/bert/bertWorker.js:20 · candle-wasm-examples/t5/T5ModelEncoderWorker.js:27 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — candle-wasm-examples/bert/bertWorker.js:20
candle-wasm-examples/moondream/moondreamWorker.js:59 · candle-wasm-examples/segment-anything/samWorker.js:39 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — candle-wasm-examples/moondream/moondreamWorker.js:59
candle-wasm-examples/llama2-c/llama2cWorker.js:30 · candle-wasm-examples/phi/phiWorker.js:54 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — candle-wasm-examples/llama2-c/llama2cWorker.js:30
candle-wasm-examples/llama2-c/llama2cWorker.js:88 · candle-wasm-examples/moondream/moondreamWorker.js:176 · candle-wasm-examples/phi/phiWorker.js:130 — the 3 copies are spread across 3 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — candle-wasm-examples/llama2-c/llama2cWorker.js:88
candle-wasm-examples/blip/blipWorker.js:26 · candle-wasm-examples/t5/T5ModelConditionalGeneration.js:29 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — candle-wasm-examples/blip/blipWorker.js:26
candle-wasm-examples/bert/utils.js:12 · candle-wasm-examples/t5/utils.js:14 · candle-wasm-examples/t5/utils.js:48 — the 3 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — candle-wasm-examples/bert/utils.js:12
candle-wasm-examples/llama2-c/llama2cWorker.js:71 · candle-wasm-examples/phi/phiWorker.js:105 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — candle-wasm-examples/llama2-c/llama2cWorker.js:71
candle-wasm-examples/bert/bertWorker.js:5 · candle-wasm-examples/blip/blipWorker.js:5 · candle-wasm-examples/llama2-c/llama2cWorker.js:4 · candle-wasm-examples/segment-anything/samWorker.js:7 · +4 more site(s) not listed — the 8 copies are spread across 7 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 8 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — candle-wasm-examples/bert/bertWorker.js:5
candle-wasm-examples/t5/utils.js:10 · candle-wasm-examples/t5/utils.js:44 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — candle-wasm-examples/t5/utils.js:10
candle-wasm-examples/llama2-c/llama2cWorker.js:3 · candle-wasm-examples/yolo/yoloWorker.js:4 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — candle-wasm-examples/llama2-c/llama2cWorker.js:3
candle-wasm-examples/moondream/moondreamWorker.js:128 · candle-wasm-examples/segment-anything/samWorker.js:127 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — candle-wasm-examples/moondream/moondreamWorker.js:128
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
Do you agree with this assessment?
R3 · Large Files10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
Do you agree with this assessment?
R7 · Dead Code10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
14 file(s) (~1700 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: candle-wasm-examples/moondream/moondreamWorker.js imports './build/m.js', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. Markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself, since a page handed to a consumer runs in that consumer’s origin. The server controls — HTTPS enforcement, HSTS, cookie flags, input validation — are read from a Rust server this repository starts itself, and its production Rust starts none. What serves its HTTP is outside the Rust source, and only what this card names about it was assessed.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
`https://cdn.tailwindcss.com` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. 10 such include(s) across the repository's markup. — candle-wasm-examples/bert/lib-example.html:21
What to do
Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader2.4 / 10Weak✓ Tool-verified
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
`len` is read from the bytes being parsed at line 483 (`read_u32`), then used to size a `vec![…; n]` at line 484 — and nowhere in its scope is `len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` against the bytes actually remaining and a maximum the format allows before allocating. — candle-core/src/pickle.rs:484
`len` is read from the bytes being parsed at line 110 (`read_u32`), then used to size a `vec![…; n]` at line 111 — and nowhere in its scope is `len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` against the bytes actually remaining and a maximum the format allows before allocating. — candle-core/src/quantized/ggml_file.rs:111
`n_dims` is read from the bytes being parsed at line 196 (`read_u32`), then used to size a `vec![…; n]` at line 200 — and nowhere in its scope is `n_dims` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `n_dims` against the bytes actually remaining and a maximum the format allows before allocating. — candle-core/src/quantized/ggml_file.rs:200
`name_len` is read from the bytes being parsed at line 197 (`read_u32`), then used to size a `vec![…; n]` at line 205 — and nowhere in its scope is `name_len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `name_len` against the bytes actually remaining and a maximum the format allows before allocating. — candle-core/src/quantized/ggml_file.rs:205
`len` is read from the bytes being parsed at line 42 (`read_i32`), then used to size a `vec![…; n]` at line 51 — and nowhere in its scope is `len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` against the bytes actually remaining and a maximum the format allows before allocating. — candle-core/src/quantized/imatrix_file.rs:51
What to do
Each finding names the read that takes the length from the input and the site that spends it, and states that the value is never compared in between. Confirm from the two, then bound the length against the remaining stream before using it.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`warning` at line 18 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — candle-pyo3/py_src/candle/__init__.py:18
`warning` at line 24 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — candle-pyo3/py_src/candle/__init__.py:24
`warning` at line 40 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — candle-pyo3/py_src/candle/__init__.py:40
Statically assessed 13 of 55 WCAG 2.2 Level A/AA success criteria (24%; ≈26% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 42 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 15 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 60 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — 13 markup documents under demonstration, documentation or developer-tool trees (or modules the build marks non-production) but none in the product; no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — those pages are demos or docs for the code, not something this tier can boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository starts no server another machine can reach (no actix-web HttpServer, axum::serve, Rocket launch, warp::serve, poem or salvo Server, tonic Server::builder, hyper or tiny_http server outside examples and tests, none bound beyond loopback). Access control is therefore N/A here — a crate is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D10 Test Quality — ~52585 lines of test source are present (.rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
D14 License Compliance — Crate licences not graded — the lock-less Cargo graph could not be read in full
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency is measured on C# only; JavaScript, Python, Rust, html not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .py, .rs, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest and a Python pyproject.toml/requirements.txt (pip/uv/Poetry) — not scanned yet).
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest and a Python pyproject.toml/requirements.txt (pip/uv/Poetry) — not scanned yet).
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not included — suite not readable by the collector
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (77 value object(s))
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Python, Rust source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF2 Allocation hygiene — Not applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
R4 Test Coverage — the JS/TS workspace (14 production file(s)) has no JavaScript/TypeScript test, but it is 2.31% of this repository's production source and the other 97.69% carries 52,585 line(s) of test code this pass cannot read — an incidental frontend's reachability is not the repository's test posture, so it is not scored as one
R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
R6 Tooling — no package.json in the repository — test/lint/typecheck wiring is read from package.json scripts (corroborated against CI), so this project's own toolchain isn't measured here
R8 Dependency Hygiene — Not measured — no package.json declares any dependency, so there is nothing to check imports against (imports may resolve through a host runtime rather than node).
X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X2 Cancellation propagation — no C# was loaded; this repository's Python and Rust were read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Critical — 38 finding(s)
AC1 · Text alternatives· <img> without a text alternative · ×15
<img> without a text alternative candle-wasm-examples/blip/index.html:377— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative candle-wasm-examples/blip/index.html:381— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative candle-wasm-examples/blip/index.html:385— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative candle-wasm-examples/moondream/index.html:292— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative candle-wasm-examples/moondream/index.html:296— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative candle-wasm-examples/moondream/index.html:300— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative candle-wasm-examples/moondream/index.html:304— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative candle-wasm-examples/segment-anything/lib-example.html:541— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative candle-wasm-examples/segment-anything/lib-example.html:561— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative candle-wasm-examples/segment-anything/lib-example.html:564— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative candle-wasm-examples/segment-anything/lib-example.html:567— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative candle-wasm-examples/yolo/lib-example.html:471— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative candle-wasm-examples/yolo/lib-example.html:484— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative candle-wasm-examples/yolo/lib-example.html:488— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative candle-wasm-examples/yolo/lib-example.html:492— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<html> without a lang candle-wasm-examples/bert/lib-example.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang candle-wasm-examples/blip/index.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang candle-wasm-examples/llama2-c/lib-example.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang candle-wasm-examples/moondream/index.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang REDACTED:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang candle-wasm-examples/quant-qwen3/index.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang candle-wasm-examples/segment-anything/lib-example.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang candle-wasm-examples/t5/index.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang candle-wasm-examples/whisper/lib-example.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang candle-wasm-examples/yolo/lib-example.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC2 · Forms & labels· <input> without a programmatic label · ×4
<input> without a programmatic label candle-wasm-examples/bert/lib-example.html:328— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label candle-wasm-examples/llama2-c/lib-example.html:229— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label candle-wasm-examples/moondream/index.html:89— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label candle-wasm-examples/t5/index.html:201— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
AC2 · Forms & labels· <button> with no accessible text · ×2
<button> with no accessible text candle-wasm-examples/llama2-c/lib-example.html:235— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text REDACTED:442— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
AC2 · Forms & labels· <textarea> without a programmatic label · ×2
<textarea> without a programmatic label REDACTED:432— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<textarea> without a programmatic label candle-wasm-examples/quant-qwen3/index.html:315— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
Boundary-crossing change coupling: mod.rs ↔ tests.rs candle-core/src/metal_backend/mod.rs:1— `candle-core/src/metal_backend/mod.rs` (context candle-core) and `candle-metal-kernels/src/tests.rs` (context candle-metal-kernels) sit in DIFFERENT parts of the tree yet change together 67% of the time (34 of the 51 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 34 shared commits counted here, the most recent 3 are `4b46187c` [Metal] Improve ternary further (#3242); `e33d776d` [Metal] cast improvements (#3241); `73fd9c31` [Metal] further improve unary and binary (#3239) — run `git show` on any of them.
Duplicated block (5 lines × 2) candle-core/src/accelerate.rs:398— candle-core/src/accelerate.rs:398-402 | candle-core/src/mkl.rs:351-355 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) candle-core/src/accelerate.rs:409— candle-core/src/accelerate.rs:409-413 | candle-core/src/mkl.rs:362-366 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) candle-core/src/cpu/neon.rs:551— candle-core/src/cpu/neon.rs:551-555 | candle-core/src/cpu/neon.rs:604-608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/cpu_backend/mod.rs:1030— candle-core/src/cpu_backend/mod.rs:1030-1034 | candle-core/src/cpu_backend/mod.rs:1254-1259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/cuda_backend/mod.rs:494— candle-core/src/cuda_backend/mod.rs:494-498 | candle-core/src/cuda_backend/mod.rs:549-553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/quantized/avx.rs:56— candle-core/src/quantized/avx.rs:56-60 | candle-core/src/quantized/avx.rs:77-81 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/quantized/avx.rs:245— candle-core/src/quantized/avx.rs:245-249 | candle-core/src/quantized/neon.rs:3937-3941 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) candle-core/src/quantized/k_quants.rs:1021— candle-core/src/quantized/k_quants.rs:1021-1025 | candle-core/src/quantized/k_quants.rs:1399-1406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/quantized/k_quants.rs:1696— candle-core/src/quantized/k_quants.rs:1696-1700 | candle-core/src/quantized/k_quants.rs:1998-2002 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/quantized/metal.rs:393— candle-core/src/quantized/metal.rs:393-397 | candle-core/src/quantized/metal.rs:408-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/quantized/neon.rs:541— candle-core/src/quantized/neon.rs:541-545 | candle-core/src/quantized/neon.rs:2916-2920 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/quantized/neon.rs:1001— candle-core/src/quantized/neon.rs:1001-1005 | candle-core/src/quantized/neon.rs:1449-1453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/quantized/neon.rs:1290— candle-core/src/quantized/neon.rs:1290-1294 | candle-core/src/quantized/neon.rs:1599-1603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/quantized/neon.rs:1618— candle-core/src/quantized/neon.rs:1618-1622 | candle-core/src/quantized/neon.rs:1741-1745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/quantized/neon.rs:1673— candle-core/src/quantized/neon.rs:1673-1677 | candle-core/src/quantized/neon.rs:1775-1780 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/quantized/neon.rs:1822— candle-core/src/quantized/neon.rs:1822-1826 | candle-core/src/quantized/neon.rs:2609-2613 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/quantized/neon.rs:2012— candle-core/src/quantized/neon.rs:2012-2017 | candle-core/src/quantized/neon.rs:2165-2169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/quantized/neon.rs:2548— candle-core/src/quantized/neon.rs:2548-2552 | candle-core/src/quantized/neon.rs:2554-2558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/quantized/neon.rs:2813— candle-core/src/quantized/neon.rs:2813-2817 | candle-core/src/quantized/neon.rs:3097-3101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/quantized/repack_x86.rs:100— candle-core/src/quantized/repack_x86.rs:100-104 | candle-core/src/quantized/repack_x86.rs:143-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/quantized/simd128.rs:130— candle-core/src/quantized/simd128.rs:130-134 | candle-core/src/quantized/simd128.rs:142-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/safetensors.rs:228— candle-core/src/safetensors.rs:228-232 | candle-core/src/safetensors.rs:332-336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-core/src/tensor.rs:2500— candle-core/src/tensor.rs:2500-2504 | candle-core/src/tensor.rs:2511-2515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-metal-kernels/src/kernels/sdpa.rs:282— candle-metal-kernels/src/kernels/sdpa.rs:282-286 | candle-metal-kernels/src/kernels/sdpa.rs:427-431 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) candle-nn/src/attention/cpu_flash/varlen.rs:92— candle-nn/src/attention/cpu_flash/varlen.rs:92-96 | candle-nn/src/attention/varlen.rs:73-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
TodoComment candle-wasm-examples/whisper/src/worker.rs:213— // TODO: Besides suppress tokens, we should apply the heuristics from — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-examples/examples/whisper-microphone/main.rs:196— // TODO: Besides suppress tokens, we should apply the heuristics from — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/bert.rs:139— // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/trocr.rs:315— // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-examples/examples/musicgen/musicgen_model.rs:248— // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/bert.rs:193— // TODO: Proper absolute positions? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/bert.rs:419— // TODO: Support cross-attention? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/distilbert.rs:261— // TODO: Support cross-attention? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/bert.rs:421— // TODO: Support something similar to `apply_chunking_to_forward`? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/distilbert.rs:263— // TODO: Support something similar to `apply_chunking_to_forward`? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/bigcode.rs:225— // TODO: we could trim the tensors to MAX_SEQ_LEN so that this would work for — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/falcon.rs:281— // TODO: we could trim the tensors to MAX_SEQ_LEN so that this would work for — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/bigcode.rs:266— // TODO: Add cross-attention? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/debertav2.rs:873— // TODO: In order to fully test ConvLayer a model needs to be found has a configuration where `conv_kernel_size` exists and is > 0 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/encodec.rs:538— // TODO: Apply dilations! — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/gemma2.rs:32— // TODO: Handle the sliding window in the attention mask. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/granitemoehybrid.rs:552— // TODO: Not supprting Mamba layers (blocks) for now, — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/llama2_c_weights.rs:113— // TODO: As of 2023-08-04, gemm is slower than expected when multiplying a matrix of — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/metavoice.rs:476— // TODO: causal mask — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/metavoice.rs:656— // TODO: speaker embs. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/quantized_qwen3.rs:268— // TODO: b > 1 needs varlen CPU flash with interleaved cache support. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/quantized_t5.rs:361— // TODO: Use flash_attn. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/t5.rs:490— // TODO: Use flash_attn. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/quantized_t5.rs:432— // TODO: position_bias_masked? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment candle-transformers/src/models/t5.rs:562— // TODO: position_bias_masked? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
Duplicated block (6 lines × 2) candle-core/src/cpu_backend/mod.rs:688— candle-core/src/cpu_backend/mod.rs:688-693 | candle-core/src/cpu_backend/mod.rs:748-753 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/cpu_backend/mod.rs:914— candle-core/src/cpu_backend/mod.rs:914-919 | candle-core/src/cpu_backend/mod.rs:936-942 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/cuda_backend/mod.rs:1902— candle-core/src/cuda_backend/mod.rs:1902-1907 | candle-core/src/cuda_backend/mod.rs:2088-2093 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/cuda_backend/mod.rs:1913— candle-core/src/cuda_backend/mod.rs:1913-1918 | candle-core/src/cuda_backend/mod.rs:2099-2104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/cuda_backend/mod.rs:1921— candle-core/src/cuda_backend/mod.rs:1921-1926 | candle-core/src/cuda_backend/mod.rs:2107-2112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/cuda_backend/mod.rs:1929— candle-core/src/cuda_backend/mod.rs:1929-1934 | candle-core/src/cuda_backend/mod.rs:2115-2120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/cuda_backend/mod.rs:2036— candle-core/src/cuda_backend/mod.rs:2036-2041 | candle-core/src/metal_backend/mod.rs:1161-1167 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) candle-core/src/quantized/k_quants.rs:469— candle-core/src/quantized/k_quants.rs:469-474 | candle-core/src/quantized/k_quants.rs:786-791 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/quantized/k_quants.rs:1235— candle-core/src/quantized/k_quants.rs:1235-1240 | candle-core/src/quantized/k_quants.rs:1333-1338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/quantized/k_quants.rs:1690— candle-core/src/quantized/k_quants.rs:1690-1695 | candle-core/src/quantized/k_quants.rs:1992-1997 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/quantized/mod.rs:936— candle-core/src/quantized/mod.rs:936-941 | candle-core/src/quantized/mod.rs:995-1000 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/quantized/neon.rs:1397— candle-core/src/quantized/neon.rs:1397-1402 | candle-core/src/quantized/neon.rs:2135-2140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/quantized/neon.rs:2825— candle-core/src/quantized/neon.rs:2825-2830 | candle-core/src/quantized/neon.rs:2857-2862 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/quantized/neon.rs:3251— candle-core/src/quantized/neon.rs:3251-3256 | candle-core/src/quantized/neon.rs:3529-3534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/quantized/neon.rs:3983— candle-core/src/quantized/neon.rs:3983-3988 | candle-core/src/quantized/neon.rs:3989-3994 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/quantized/repack_x86.rs:338— candle-core/src/quantized/repack_x86.rs:338-343 | candle-core/src/quantized/repack_x86.rs:385-390 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/safetensors.rs:117— candle-core/src/safetensors.rs:117-122 | candle-core/src/safetensors.rs:147-152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/scalar.rs:29— candle-core/src/scalar.rs:29-34 | candle-core/src/scalar.rs:47-52 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-core/src/tensor.rs:1985— candle-core/src/tensor.rs:1985-1990 | candle-core/src/tensor.rs:2016-2021 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-flash-attn-v3/src/lib.rs:479— candle-flash-attn-v3/src/lib.rs:479-484 | candle-flash-attn/src/lib.rs:518-523 — before extracting anything, compare `candle-flash-attn-v3/src/lib.rs` and `candle-flash-attn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) candle-flash-attn-v3/src/lib.rs:603— candle-flash-attn-v3/src/lib.rs:603-608 | candle-flash-attn/src/lib.rs:701-706 — before extracting anything, compare `candle-flash-attn-v3/src/lib.rs` and `candle-flash-attn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) candle-nn/src/attention/cpu_flash/causal.rs:827— candle-nn/src/attention/cpu_flash/causal.rs:827-832 | candle-nn/src/attention/cpu_flash/standard.rs:241-246 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) candle-onnx/src/eval.rs:667— candle-onnx/src/eval.rs:667-672 | candle-onnx/src/eval.rs:732-737 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) candle-transformers/src/models/bert.rs:239— candle-transformers/src/models/bert.rs:239-244 | candle-transformers/src/models/chinese_clip/text_model.rs:247-252 — before extracting anything, compare `candle-transformers/src/models/bert.rs` and `candle-transformers/src/models/chinese_clip/text_model.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) candle-transformers/src/models/blip_text.rs:487— candle-transformers/src/models/blip_text.rs:487-492 | candle-transformers/src/models/quantized_blip_text.rs:483-488 — before extracting anything, compare `candle-transformers/src/models/blip_text.rs` and `candle-transformers/src/models/quantized_blip_text.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 215 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) candle-core/src/accelerate.rs:355— candle-core/src/accelerate.rs:355-361 | candle-core/src/accelerate.rs:365-371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-core/src/cpu_backend/mod.rs:348— candle-core/src/cpu_backend/mod.rs:348-354 | candle-core/src/cpu_backend/mod.rs:360-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-core/src/npy.rs:291— candle-core/src/npy.rs:291-297 | candle-core/src/npy.rs:315-321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-core/src/quantized/cuda.rs:706— candle-core/src/quantized/cuda.rs:706-712 | candle-core/src/quantized/cuda.rs:734-740 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-core/src/quantized/cuda.rs:767— candle-core/src/quantized/cuda.rs:767-773 | candle-core/src/quantized/cuda.rs:791-797 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-core/src/quantized/cuda.rs:763— candle-core/src/quantized/cuda.rs:763-769 | candle-core/src/quantized/metal.rs:181-187 — before extracting anything, compare `candle-core/src/quantized/cuda.rs` and `candle-core/src/quantized/metal.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) candle-core/src/quantized/cuda.rs:787— candle-core/src/quantized/cuda.rs:787-793 | candle-core/src/quantized/metal.rs:202-208 — before extracting anything, compare `candle-core/src/quantized/cuda.rs` and `candle-core/src/quantized/metal.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) candle-core/src/quantized/k_quants.rs:426— candle-core/src/quantized/k_quants.rs:426-432 | candle-core/src/quantized/k_quants.rs:532-538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-core/src/quantized/metal.rs:48— candle-core/src/quantized/metal.rs:48-54 | candle-core/src/quantized/metal.rs:447-453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-core/src/quantized/neon.rs:366— candle-core/src/quantized/neon.rs:366-372 | candle-core/src/quantized/neon.rs:443-449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-core/src/quantized/neon.rs:1009— candle-core/src/quantized/neon.rs:1009-1015 | candle-core/src/quantized/neon.rs:1457-1463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-core/src/quantized/neon.rs:1271— candle-core/src/quantized/neon.rs:1271-1277 | candle-core/src/quantized/neon.rs:2006-2012 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-core/src/quantized/neon.rs:1592— candle-core/src/quantized/neon.rs:1592-1598 | candle-core/src/quantized/neon.rs:1709-1715 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-core/src/quantized/neon.rs:1880— candle-core/src/quantized/neon.rs:1880-1886 | candle-core/src/quantized/neon.rs:2667-2673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-core/src/quantized/neon.rs:3425— candle-core/src/quantized/neon.rs:3425-3431 | candle-core/src/quantized/neon.rs:3448-3454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-core/src/quantized/repack.rs:521— candle-core/src/quantized/repack.rs:521-527 | candle-core/src/quantized/repack.rs:563-569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-core/src/quantized/simd128.rs:135— candle-core/src/quantized/simd128.rs:135-141 | candle-core/src/quantized/simd128.rs:147-153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-core/src/quantized/utils.rs:408— candle-core/src/quantized/utils.rs:408-414 | candle-core/src/quantized/utils.rs:449-455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-flash-attn-v3/src/lib.rs:43— candle-flash-attn-v3/src/lib.rs:43-49 | candle-flash-attn/src/lib.rs:34-40 — before extracting anything, compare `candle-flash-attn-v3/src/lib.rs` and `candle-flash-attn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) candle-flash-attn-v3/src/lib.rs:515— candle-flash-attn-v3/src/lib.rs:515-521 | candle-flash-attn/src/lib.rs:588-594 — before extracting anything, compare `candle-flash-attn-v3/src/lib.rs` and `candle-flash-attn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) candle-nn/src/attention/cpu_flash/causal.rs:402— candle-nn/src/attention/cpu_flash/causal.rs:402-408 | candle-nn/src/attention/cpu_flash/causal.rs:474-480 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-nn/src/attention/cpu_flash/standard.rs:151— candle-nn/src/attention/cpu_flash/standard.rs:151-157 | candle-nn/src/attention/cpu_flash/standard.rs:223-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-nn/src/attention/cpu_flash/standard.rs:158— candle-nn/src/attention/cpu_flash/standard.rs:158-164 | candle-nn/src/attention/cpu_flash/standard.rs:239-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-nn/src/attention/cpu_flash/standard.rs:152— candle-nn/src/attention/cpu_flash/standard.rs:152-158 | candle-nn/src/attention/cpu_flash/standard.rs:322-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) candle-nn/src/attention/cpu_flash/standard.rs:321— candle-nn/src/attention/cpu_flash/standard.rs:321-327 | candle-nn/src/attention/cpu_flash/standard.rs:399-405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-core/src/accelerate.rs:417— candle-core/src/accelerate.rs:417-424 | candle-core/src/mkl.rs:370-377 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) candle-core/src/accelerate.rs:428— candle-core/src/accelerate.rs:428-435 | candle-core/src/mkl.rs:381-388 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) candle-core/src/backprop.rs:306— candle-core/src/backprop.rs:306-313 | candle-core/src/backprop.rs:335-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-core/src/cpu_backend/mod.rs:1124— candle-core/src/cpu_backend/mod.rs:1124-1131 | candle-core/src/cpu_backend/mod.rs:1189-1196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-core/src/cuda_backend/mod.rs:759— candle-core/src/cuda_backend/mod.rs:759-766 | candle-core/src/cuda_backend/mod.rs:802-809 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-core/src/metal_backend/device.rs:205— candle-core/src/metal_backend/device.rs:205-212 | candle-core/src/metal_backend/device.rs:287-295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-core/src/metal_backend/mod.rs:1274— candle-core/src/metal_backend/mod.rs:1274-1281 | candle-core/src/metal_backend/mod.rs:1321-1328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-core/src/quantized/k_quants.rs:1169— candle-core/src/quantized/k_quants.rs:1169-1176 | candle-core/src/quantized/k_quants.rs:1178-1185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-core/src/quantized/k_quants.rs:1220— candle-core/src/quantized/k_quants.rs:1220-1227 | candle-core/src/quantized/k_quants.rs:1324-1331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-core/src/quantized/neon.rs:979— candle-core/src/quantized/neon.rs:979-986 | candle-core/src/quantized/neon.rs:1420-1427 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-core/src/quantized/neon.rs:1209— candle-core/src/quantized/neon.rs:1209-1216 | candle-core/src/quantized/neon.rs:1418-1425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-core/src/quantized/neon.rs:3589— candle-core/src/quantized/neon.rs:3589-3596 | candle-core/src/quantized/neon.rs:3678-3685 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-core/src/quantized/repack_x86.rs:963— candle-core/src/quantized/repack_x86.rs:963-970 | candle-core/src/quantized/repack_x86.rs:1013-1020 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-core/src/sort.rs:25— candle-core/src/sort.rs:25-32 | candle-core/src/sort.rs:40-47 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-core/src/tensor.rs:2001— candle-core/src/tensor.rs:2001-2008 | candle-core/src/tensor.rs:2042-2049 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-flash-attn-v3/src/lib.rs:83— candle-flash-attn-v3/src/lib.rs:83-90 | candle-flash-attn/src/lib.rs:74-81 — before extracting anything, compare `candle-flash-attn-v3/src/lib.rs` and `candle-flash-attn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) candle-flash-attn-v3/src/lib.rs:192— candle-flash-attn-v3/src/lib.rs:192-199 | candle-flash-attn-v3/src/lib.rs:637-644 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-metal-kernels/src/kernels/random.rs:25— candle-metal-kernels/src/kernels/random.rs:25-32 | candle-metal-kernels/src/kernels/random.rs:56-63 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-nn/src/kv_cache.rs:124— candle-nn/src/kv_cache.rs:124-131 | candle-nn/src/kv_cache.rs:132-139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-nn/src/ops.rs:300— candle-nn/src/ops.rs:300-307 | candle-nn/src/ops.rs:734-741 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-onnx/src/eval.rs:478— candle-onnx/src/eval.rs:478-485 | candle-onnx/src/eval.rs:513-520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) candle-transformers/src/models/beit.rs:395— candle-transformers/src/models/beit.rs:395-402 | candle-transformers/src/models/eva2.rs:423-430 — before extracting anything, compare `candle-transformers/src/models/beit.rs` and `candle-transformers/src/models/eva2.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) candle-transformers/src/models/blip.rs:181— candle-transformers/src/models/blip.rs:181-188 | candle-transformers/src/models/quantized_blip.rs:142-149 — before extracting anything, compare `candle-transformers/src/models/blip.rs` and `candle-transformers/src/models/quantized_blip.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) candle-transformers/src/models/blip.rs:241— candle-transformers/src/models/blip.rs:241-248 | candle-transformers/src/models/quantized_blip.rs:202-209 — before extracting anything, compare `candle-transformers/src/models/blip.rs` and `candle-transformers/src/models/quantized_blip.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) candle-transformers/src/models/blip_text.rs:309— candle-transformers/src/models/blip_text.rs:309-316 | candle-transformers/src/models/quantized_blip_text.rs:305-312 — before extracting anything, compare `candle-transformers/src/models/blip_text.rs` and `candle-transformers/src/models/quantized_blip_text.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 215 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) candle-core/src/cpu_backend/mod.rs:1577— candle-core/src/cpu_backend/mod.rs:1577-1586 | candle-core/src/cpu_backend/mod.rs:1695-1704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-core/src/cuda_backend/mod.rs:234— candle-core/src/cuda_backend/mod.rs:234-243 | candle-core/src/cuda_backend/mod.rs:287-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-core/src/error.rs:260— candle-core/src/error.rs:260-269 | candle-metal-kernels/src/err.rs:49-58 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) candle-core/src/quantized/mod.rs:909— candle-core/src/quantized/mod.rs:909-918 | candle-core/src/quantized/mod.rs:966-975 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-core/src/quantized/neon.rs:1017— candle-core/src/quantized/neon.rs:1017-1026 | candle-core/src/quantized/neon.rs:1465-1474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-core/src/quantized/neon.rs:3336— candle-core/src/quantized/neon.rs:3336-3345 | candle-core/src/quantized/neon.rs:3718-3727 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-core/src/tensor.rs:665— candle-core/src/tensor.rs:665-674 | candle-core/src/tensor.rs:1959-1968 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-flash-attn-v3/src/lib.rs:544— candle-flash-attn-v3/src/lib.rs:544-553 | candle-flash-attn/src/lib.rs:608-617 — before extracting anything, compare `candle-flash-attn-v3/src/lib.rs` and `candle-flash-attn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) candle-metal-kernels/src/kernels/indexing.rs:25— candle-metal-kernels/src/kernels/indexing.rs:25-34 | candle-metal-kernels/src/kernels/indexing.rs:74-83 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-metal-kernels/src/metal/commands.rs:176— candle-metal-kernels/src/metal/commands.rs:176-185 | candle-metal-kernels/src/metal/commands.rs:214-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-nn/src/conv.rs:64— candle-nn/src/conv.rs:64-73 | candle-nn/src/conv.rs:135-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-nn/src/conv.rs:226— candle-nn/src/conv.rs:226-235 | candle-nn/src/conv.rs:295-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-nn/src/conv.rs:352— candle-nn/src/conv.rs:352-361 | candle-nn/src/conv.rs:373-382 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-nn/src/conv.rs:441— candle-nn/src/conv.rs:441-450 | candle-nn/src/conv.rs:462-471 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-nn/src/kv_cache.rs:59— candle-nn/src/kv_cache.rs:59-68 | candle-nn/src/kv_cache.rs:218-227 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-nn/src/moe.rs:81— candle-nn/src/moe.rs:81-90 | candle-nn/src/moe.rs:229-238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-nn/src/moe/cutile.rs:65— candle-nn/src/moe/cutile.rs:65-74 | candle-nn/src/moe/cutile.rs:104-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-nn/src/ops.rs:649— candle-nn/src/ops.rs:649-658 | candle-nn/src/ops.rs:900-909 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-nn/src/rotary_emb.rs:505— candle-nn/src/rotary_emb.rs:505-514 | candle-nn/src/rotary_emb.rs:779-788 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-nn/src/var_builder.rs:371— candle-nn/src/var_builder.rs:371-380 | candle-nn/src/var_builder.rs:393-402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-nn/src/var_builder.rs:440— candle-nn/src/var_builder.rs:440-449 | candle-nn/src/var_builder.rs:485-494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-onnx/src/eval.rs:1398— candle-onnx/src/eval.rs:1398-1407 | candle-onnx/src/eval.rs:1507-1516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-transformers/src/models/bert.rs:283— candle-transformers/src/models/bert.rs:283-292 | candle-transformers/src/models/bert.rs:372-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) candle-transformers/src/models/bert.rs:506— candle-transformers/src/models/bert.rs:506-515 | candle-transformers/src/models/chinese_clip/text_model.rs:511-520 — before extracting anything, compare `candle-transformers/src/models/bert.rs` and `candle-transformers/src/models/chinese_clip/text_model.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) candle-transformers/src/models/chinese_clip/text_model.rs:189— candle-transformers/src/models/chinese_clip/text_model.rs:189-198 | candle-transformers/src/models/chinese_clip/text_model.rs:356-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
FileTooLong: quantized/neon.rs candle-core/src/quantized/neon.rs— FileTooLong — 3184 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 59 free functions. The bar is 500 significant lines; this is 2684 over it, 6.37× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: cpu_backend/mod.rs candle-core/src/cpu_backend/mod.rs— FileTooLong — 2467 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1967 over it, 4.93× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: cuda_backend/mod.rs candle-core/src/cuda_backend/mod.rs— FileTooLong — 2185 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1685 over it, 4.37× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: metal_backend/mod.rs candle-core/src/metal_backend/mod.rs— FileTooLong — 1994 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 83% of them inside a single declaration: MetalStorage (3 blocks, 78-2019). The bar is 500 significant lines; this is 1494 over it, 3.99× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: quantized/k_quants.rs candle-core/src/quantized/k_quants.rs— FileTooLong — 1983 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1483 over it, 3.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/eval.rs candle-onnx/src/eval.rs— FileTooLong — 1786 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1286 over it, 3.57× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/tensor.rs candle-core/src/tensor.rs— FileTooLong — 1710 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 90% of them inside a single declaration: Tensor (4 blocks, 47-3152). The bar is 500 significant lines; this is 1210 over it, 3.42× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/lib.rs candle-pyo3/src/lib.rs— FileTooLong — 1054 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 554 over it, 2.11× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: models/debertav2.rs candle-transformers/src/models/debertav2.rs— FileTooLong — 1028 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 528 over it, 2.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/ops.rs candle-nn/src/ops.rs— FileTooLong — 978 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 478 over it, 1.96× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: quantized/mod.rs candle-core/src/quantized/mod.rs— FileTooLong — 942 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 442 over it, 1.88× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/op.rs candle-core/src/op.rs— FileTooLong — 908 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 408 over it, 1.82× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: quantized/repack.rs candle-core/src/quantized/repack.rs— FileTooLong — 824 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 324 over it, 1.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: models/deepseek2.rs candle-transformers/src/models/deepseek2.rs— FileTooLong — 788 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 288 over it, 1.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: quantized/cuda.rs candle-core/src/quantized/cuda.rs— FileTooLong — 773 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 273 over it, 1.55× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: quantized/repack_x86.rs candle-core/src/quantized/repack_x86.rs— FileTooLong — 771 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 271 over it, 1.54× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: models/metavoice.rs candle-transformers/src/models/metavoice.rs— FileTooLong — 741 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 241 over it, 1.48× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: paddleocr_vl/text.rs candle-transformers/src/models/paddleocr_vl/text.rs— FileTooLong — 728 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 228 over it, 1.46× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: paddleocr_vl/vision.rs candle-transformers/src/models/paddleocr_vl/vision.rs— FileTooLong — 706 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 206 over it, 1.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: cpu_flash/causal.rs candle-nn/src/attention/cpu_flash/causal.rs— FileTooLong — 695 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 195 over it, 1.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/rotary_emb.rs candle-nn/src/rotary_emb.rs— FileTooLong — 687 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 187 over it, 1.37× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: z_image/transformer.rs candle-transformers/src/models/z_image/transformer.rs— FileTooLong — 686 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 186 over it, 1.37× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: gemma4/audio.rs candle-transformers/src/models/gemma4/audio.rs— FileTooLong — 679 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 179 over it, 1.36× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: stable_diffusion/unet_2d_blocks.rs candle-transformers/src/models/stable_diffusion/unet_2d_blocks.rs— FileTooLong — 673 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 173 over it, 1.35× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: models/t5.rs candle-transformers/src/models/t5.rs— FileTooLong — 673 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 173 over it, 1.35× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
Duplicated block (9 lines × 2) candle-core/src/cpu_backend/mod.rs:689— candle-core/src/cpu_backend/mod.rs:689-697 | candle-core/src/cpu_backend/mod.rs:847-855 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-core/src/cuda_backend/cudnn.rs:63— candle-core/src/cuda_backend/cudnn.rs:63-73 | candle-core/src/cuda_backend/cudnn.rs:167-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-core/src/cuda_backend/mod.rs:400— candle-core/src/cuda_backend/mod.rs:400-408 | candle-core/src/cuda_backend/mod.rs:413-421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-core/src/quantized/k_quants.rs:247— candle-core/src/quantized/k_quants.rs:247-255 | candle-core/src/quantized/k_quants.rs:462-470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-core/src/quantized/neon.rs:235— candle-core/src/quantized/neon.rs:235-243 | candle-core/src/quantized/neon.rs:246-254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-core/src/quantized/neon.rs:987— candle-core/src/quantized/neon.rs:987-995 | candle-core/src/quantized/neon.rs:1428-1436 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-core/src/quantized/neon.rs:1318— candle-core/src/quantized/neon.rs:1318-1326 | candle-core/src/quantized/neon.rs:1335-1343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-core/src/quantized/neon.rs:1973— candle-core/src/quantized/neon.rs:1973-1981 | candle-core/src/quantized/neon.rs:2156-2164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-core/src/quantized/repack_x86.rs:354— candle-core/src/quantized/repack_x86.rs:354-362 | candle-core/src/quantized/repack_x86.rs:410-418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-core/src/tensor.rs:1356— candle-core/src/tensor.rs:1356-1364 | candle-core/src/tensor.rs:1394-1402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-metal-kernels/src/kernel.rs:114— candle-metal-kernels/src/kernel.rs:114-122 | candle-metal-kernels/src/kernel.rs:159-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-metal-kernels/src/kernels/unary.rs:53— candle-metal-kernels/src/kernels/unary.rs:53-61 | candle-metal-kernels/src/kernels/unary.rs:118-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-metal-kernels/src/metal/encoder.rs:293— candle-metal-kernels/src/metal/encoder.rs:293-301 | candle-metal-kernels/src/metal/encoder.rs:318-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-nn/src/attention/cpu_flash/causal.rs:957— candle-nn/src/attention/cpu_flash/causal.rs:957-965 | candle-nn/src/attention/cpu_flash/varlen.rs:266-274 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) candle-nn/src/conv.rs:317— candle-nn/src/conv.rs:317-325 | candle-nn/src/conv.rs:400-409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-nn/src/rnn.rs:212— candle-nn/src/rnn.rs:212-220 | candle-nn/src/rnn.rs:365-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-nn/src/var_map.rs:59— candle-nn/src/var_map.rs:59-67 | candle-nn/src/var_map.rs:81-89 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-transformers/src/models/blip.rs:212— candle-transformers/src/models/blip.rs:212-220 | candle-transformers/src/models/quantized_blip.rs:173-181 — before extracting anything, compare `candle-transformers/src/models/blip.rs` and `candle-transformers/src/models/quantized_blip.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) candle-transformers/src/models/blip.rs:269— candle-transformers/src/models/blip.rs:269-277 | candle-transformers/src/models/quantized_blip.rs:230-238 — before extracting anything, compare `candle-transformers/src/models/blip.rs` and `candle-transformers/src/models/quantized_blip.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) candle-transformers/src/models/blip_text.rs:449— candle-transformers/src/models/blip_text.rs:449-457 | candle-transformers/src/models/quantized_blip_text.rs:445-453 — before extracting anything, compare `candle-transformers/src/models/blip_text.rs` and `candle-transformers/src/models/quantized_blip_text.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 215 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) candle-transformers/src/models/convnext.rs:189— candle-transformers/src/models/convnext.rs:189-197 | candle-transformers/src/models/convnext.rs:208-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) candle-transformers/src/models/dinov2.rs:72— candle-transformers/src/models/dinov2.rs:72-80 | candle-transformers/src/models/dinov2reg4.rs:65-73 — before extracting anything, compare `candle-transformers/src/models/dinov2.rs` and `candle-transformers/src/models/dinov2reg4.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) candle-transformers/src/models/efficientvit.rs:151— candle-transformers/src/models/efficientvit.rs:151-159 | candle-transformers/src/models/mobilenetv4.rs:300-308 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) candle-transformers/src/models/encodec.rs:337— candle-transformers/src/models/encodec.rs:337-345 | candle-transformers/src/models/mimi/quantization.rs:228-236 — before extracting anything, compare `candle-transformers/src/models/encodec.rs` and `candle-transformers/src/models/mimi/quantization.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) candle-transformers/src/models/gemma2.rs:124— candle-transformers/src/models/gemma2.rs:124-132 | candle-transformers/src/models/gemma3.rs:129-137 — before extracting anything, compare `candle-transformers/src/models/gemma2.rs` and `candle-transformers/src/models/gemma3.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
+ 24 more in this group — see findings.md.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×34
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-core/src/cpu/avx.rs:335— candle-core/src/cpu/avx.rs:335-352 | candle-core/src/cpu/avx.rs:373-391 | candle-core/src/cpu/simd128.rs:224-241 | candle-core/src/cpu/simd128.rs:260-278 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-core/src/cpu/neon.rs:58— candle-core/src/cpu/neon.rs:58-69 | candle-core/src/cpu/neon.rs:123-134 | candle-core/src/cpu/neon.rs:322-333 | candle-core/src/cpu/neon.rs:402-414 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-core/src/quantized/cuda.rs:704— candle-core/src/quantized/cuda.rs:704-725 | candle-core/src/quantized/cuda.rs:732-753 | candle-core/src/quantized/cuda.rs:760-782 | candle-core/src/quantized/cuda.rs:784-806 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-core/src/quantized/cuda.rs:760— candle-core/src/quantized/cuda.rs:760-782 | candle-core/src/quantized/cuda.rs:784-806 | candle-core/src/quantized/metal.rs:178-197 | candle-core/src/quantized/metal.rs:199-218 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-core/src/quantized/k_quants.rs:957— candle-core/src/quantized/k_quants.rs:957-1014 | candle-core/src/quantized/k_quants.rs:1279-1375 | candle-core/src/quantized/k_quants.rs:1619-1683 | candle-core/src/quantized/k_quants.rs:1900-1981 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-core/src/quantized/mod.rs:547— candle-core/src/quantized/mod.rs:547-566 | candle-core/src/quantized/mod.rs:572-602 | candle-core/src/quantized/mod.rs:610-646 | candle-core/src/quantized/mod.rs:649-675 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-core/src/quantized/neon.rs:365— candle-core/src/quantized/neon.rs:365-438 | candle-core/src/quantized/neon.rs:442-513 | candle-core/src/quantized/neon.rs:2824-2852 | candle-core/src/quantized/neon.rs:2856-2888 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-core/src/quantized/neon.rs:677— candle-core/src/quantized/neon.rs:677-745 | candle-core/src/quantized/neon.rs:853-920 | candle-core/src/quantized/neon.rs:2968-3036 | candle-core/src/quantized/neon.rs:3113-3178 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-core/src/tensor.rs:664— candle-core/src/tensor.rs:664-682 | candle-core/src/tensor.rs:1958-1980 | candle-core/src/tensor.rs:1983-2011 | candle-core/src/tensor.rs:2014-2052 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-nn/src/attention/cpu_flash/causal.rs:65— candle-nn/src/attention/cpu_flash/causal.rs:65-186 | candle-nn/src/attention/cpu_flash/varlen.rs:40-369 | candle-transformers/src/models/quantized_qwen3.rs:238-378 | candle-transformers/src/models/smol/quantized_smollm3.rs:391-570 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-nn/src/attention/cpu_flash/standard.rs:150— candle-nn/src/attention/cpu_flash/standard.rs:150-205 | candle-nn/src/attention/cpu_flash/standard.rs:222-306 | candle-nn/src/attention/cpu_flash/standard.rs:320-381 | candle-nn/src/attention/cpu_flash/standard.rs:398-488 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-nn/src/ops.rs:394— candle-nn/src/ops.rs:394-434 | candle-nn/src/rotary_emb.rs:195-246 | candle-nn/src/rotary_emb.rs:500-552 | candle-nn/src/rotary_emb.rs:774-827 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-nn/src/rotary_emb.rs:290— candle-nn/src/rotary_emb.rs:290-308 | candle-transformers/src/models/llama2_c.rs:151-166 | candle-transformers/src/models/quantized_llama2_c.rs:38-53 | candle-wasm-examples/llama2-c/src/model.rs:74-89 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-transformers/src/models/beit.rs:265— candle-transformers/src/models/beit.rs:265-278 | candle-transformers/src/models/dinov2.rs:216-229 | candle-transformers/src/models/dinov2reg4.rs:209-222 | candle-transformers/src/models/eva2.rs:249-262 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-transformers/src/models/beit.rs:291— candle-transformers/src/models/beit.rs:291-307 | candle-transformers/src/models/dinov2.rs:243-266 | candle-transformers/src/models/dinov2reg4.rs:237-258 | candle-transformers/src/models/eva2.rs:276-296 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-transformers/src/models/chinese_clip/mod.rs:191— candle-transformers/src/models/chinese_clip/mod.rs:191-203 | candle-transformers/src/models/clip/mod.rs:136-146 | candle-transformers/src/models/mobileclip.rs:85-95 | candle-transformers/src/models/siglip.rs:785-797 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-transformers/src/models/deepseek2.rs:341— candle-transformers/src/models/deepseek2.rs:341-360 | candle-transformers/src/models/gemma4/text.rs:116-136 | candle-transformers/src/models/paddleocr_vl/text.rs:35-61 | candle-transformers/src/models/qwen3_vl/text.rs:24-39 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-transformers/src/models/flux/autoencoder.rs:50— candle-transformers/src/models/flux/autoencoder.rs:50-55 | candle-transformers/src/models/moondream.rs:58-63 | candle-transformers/src/models/quantized_moondream.rs:22-27 | candle-transformers/src/models/z_image/vae.rs:86-91 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-transformers/src/models/gemma.rs:171— candle-transformers/src/models/gemma.rs:171-195 | candle-transformers/src/models/gemma2.rs:165-190 | candle-transformers/src/models/gemma3.rs:179-216 | candle-transformers/src/models/helium.rs:168-192 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-transformers/src/models/gemma3.rs:398— candle-transformers/src/models/gemma3.rs:398-425 | candle-transformers/src/models/gemma4/text.rs:486-513 | candle-transformers/src/models/quantized_gemma3.rs:151-178 | candle-transformers/src/models/qwen3_vl/mod.rs:36-54 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-transformers/src/models/glm4_new.rs:362— candle-transformers/src/models/glm4_new.rs:362-370 | candle-transformers/src/models/qwen3.rs:477-485 | candle-transformers/src/models/qwen3_moe.rs:332-340 | candle-transformers/src/models/smol/smollm3.rs:427-435 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-transformers/src/models/mixformer.rs:35— candle-transformers/src/models/mixformer.rs:35-49 | candle-transformers/src/models/mixformer.rs:51-65 | candle-transformers/src/models/mixformer.rs:67-81 | candle-transformers/src/models/mixformer.rs:84-98 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-transformers/src/models/mixtral.rs:299— candle-transformers/src/models/mixtral.rs:299-354 | candle-transformers/src/models/quantized_llama.rs:76-142 | candle-transformers/src/models/qwen2_moe.rs:262-322 | candle-transformers/src/models/qwen3_moe.rs:124-175 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-transformers/src/models/mobilenetv4.rs:93— candle-transformers/src/models/mobilenetv4.rs:93-134 | candle-transformers/src/models/mobilenetv4.rs:136-186 | candle-transformers/src/models/mobilenetv4.rs:188-233 | candle-transformers/src/models/mobilenetv4.rs:235-290 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) candle-transformers/src/models/nomic_bert.rs:92— candle-transformers/src/models/nomic_bert.rs:92-109 | candle-transformers/src/models/quantized_lfm2.rs:102-115 | candle-transformers/src/models/quantized_phi3.rs:207-220 | candle-transformers/src/models/quantized_qwen2.rs:165-178 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (12 lines × 2) candle-core/src/cpu_backend/mod.rs:900— candle-core/src/cpu_backend/mod.rs:900-911 | candle-core/src/cpu_backend/mod.rs:921-932 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) candle-core/src/cpu_backend/mod.rs:1126— candle-core/src/cpu_backend/mod.rs:1126-1137 | candle-core/src/cpu_backend/mod.rs:1199-1210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) candle-core/src/cpu_backend/mod.rs:1611— candle-core/src/cpu_backend/mod.rs:1611-1622 | candle-core/src/cpu_backend/mod.rs:1729-1740 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) candle-core/src/metal_backend/mod.rs:357— candle-core/src/metal_backend/mod.rs:357-368 | candle-core/src/metal_backend/mod.rs:416-427 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) candle-core/src/quantized/k_quants.rs:2190— candle-core/src/quantized/k_quants.rs:2190-2201 | candle-core/src/quantized/k_quants.rs:2270-2281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) candle-core/src/quantized/neon.rs:3491— candle-core/src/quantized/neon.rs:3491-3502 | candle-core/src/quantized/neon.rs:3575-3586 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) candle-core/src/safetensors.rs:124— candle-core/src/safetensors.rs:124-135 | candle-core/src/safetensors.rs:155-166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) candle-core/src/safetensors.rs:274— candle-core/src/safetensors.rs:274-285 | candle-core/src/safetensors.rs:375-386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) candle-flash-attn-v3/src/lib.rs:168— candle-flash-attn-v3/src/lib.rs:168-179 | candle-flash-attn-v3/src/lib.rs:612-623 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) candle-flash-attn/src/lib.rs:890— candle-flash-attn/src/lib.rs:890-901 | candle-flash-attn/src/lib.rs:1058-1069 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) candle-nn/src/ops.rs:590— candle-nn/src/ops.rs:590-601 | candle-nn/src/ops.rs:835-846 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) candle-onnx/src/eval.rs:1919— candle-onnx/src/eval.rs:1919-1930 | candle-onnx/src/eval.rs:2129-2140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) candle-transformers/src/models/clip/text_model.rs:308— candle-transformers/src/models/clip/text_model.rs:308-319 | candle-transformers/src/models/stable_diffusion/clip.rs:368-379 — before extracting anything, compare `candle-transformers/src/models/clip/text_model.rs` and `candle-transformers/src/models/stable_diffusion/clip.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) candle-transformers/src/models/codegeex4_9b.rs:138— candle-transformers/src/models/codegeex4_9b.rs:138-149 | candle-transformers/src/models/glm4.rs:159-170 — before extracting anything, compare `candle-transformers/src/models/codegeex4_9b.rs` and `candle-transformers/src/models/glm4.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 443 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) candle-transformers/src/models/dac.rs:75— candle-transformers/src/models/dac.rs:75-86 | candle-transformers/src/models/snac.rs:283-294 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) candle-transformers/src/models/dinov2.rs:281— candle-transformers/src/models/dinov2.rs:281-292 | candle-transformers/src/models/eva2.rs:318-329 — before extracting anything, compare `candle-transformers/src/models/dinov2.rs` and `candle-transformers/src/models/eva2.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) candle-transformers/src/models/gemma.rs:181— candle-transformers/src/models/gemma.rs:181-192 | candle-transformers/src/models/helium.rs:178-189 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/helium.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) candle-transformers/src/models/metavoice.rs:890— candle-transformers/src/models/metavoice.rs:890-901 | candle-transformers/src/models/quantized_metavoice.rs:193-204 — before extracting anything, compare `candle-transformers/src/models/metavoice.rs` and `candle-transformers/src/models/quantized_metavoice.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) candle-transformers/src/models/mpt.rs:272— candle-transformers/src/models/mpt.rs:272-283 | candle-transformers/src/models/quantized_mpt.rs:207-218 — before extracting anything, compare `candle-transformers/src/models/mpt.rs` and `candle-transformers/src/models/quantized_mpt.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) candle-transformers/src/models/nvembed_v2/model.rs:90— candle-transformers/src/models/nvembed_v2/model.rs:90-101 | candle-transformers/src/models/stable_diffusion/attention.rs:113-124 — before extracting anything, compare `candle-transformers/src/models/nvembed_v2/model.rs` and `candle-transformers/src/models/stable_diffusion/attention.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) candle-transformers/src/models/quantized_rwkv_v5.rs:56— candle-transformers/src/models/quantized_rwkv_v5.rs:56-67 | candle-transformers/src/models/quantized_rwkv_v6.rs:63-74 — before extracting anything, compare `candle-transformers/src/models/quantized_rwkv_v5.rs` and `candle-transformers/src/models/quantized_rwkv_v6.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) candle-transformers/src/models/stable_diffusion/unet_2d_blocks.rs:141— candle-transformers/src/models/stable_diffusion/unet_2d_blocks.rs:141-152 | candle-transformers/src/models/stable_diffusion/unet_2d_blocks.rs:230-241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) candle-transformers/src/models/stable_diffusion/unet_2d_blocks.rs:153— candle-transformers/src/models/stable_diffusion/unet_2d_blocks.rs:153-164 | candle-transformers/src/models/stable_diffusion/unet_2d_blocks.rs:521-532 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) candle-transformers/src/models/voxtral/model.rs:516— candle-transformers/src/models/voxtral/model.rs:516-527 | candle-transformers/src/models/voxtral/model.rs:540-551 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) candle-transformers/src/models/whisper/audio.rs:192— candle-transformers/src/models/whisper/audio.rs:192-203 | candle-wasm-examples/whisper/src/audio.rs:171-182 — before extracting anything, compare `candle-transformers/src/models/whisper/audio.rs` and `candle-wasm-examples/whisper/src/audio.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
MethodTooLong: Tensor.backward candle-core/src/backprop.rs:165— MethodTooLong — backward runs 445 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 345 over it, 4.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CpuStorage.to_dtype candle-core/src/cpu_backend/mod.rs:1940— MethodTooLong — to_dtype runs 309 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 209 over it, 3.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ModelWeights.from_gguf candle-transformers/src/models/quantized_lfm2.rs:310— MethodTooLong — from_gguf runs 238 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 138 over it, 2.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FlashAttnVarLen.cuda_fwd_t candle-flash-attn/src/lib.rs:464— MethodTooLong — cuda_fwd_t runs 227 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 127 over it, 2.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Sdpa.metal_fwd candle-nn/src/ops.rs:1033— MethodTooLong — metal_fwd runs 190 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 90 over it, 1.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Qwen3VLModel.forward candle-transformers/src/models/qwen3_vl/mod.rs:57— MethodTooLong — forward runs 172 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 72 over it, 1.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WDiffNeXt.new candle-transformers/src/models/wuerstchen/diffnext.rs:92— MethodTooLong — new runs 167 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: UNet2DConditionModel.new candle-transformers/src/models/stable_diffusion/unet_2d.rs:104— MethodTooLong — new runs 162 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 62 over it, 1.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MetalStorage.unary_impl candle-core/src/metal_backend/mod.rs:668— MethodTooLong — unary_impl runs 153 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FlashAttnVarLen.cuda_fwd_t candle-flash-attn-v3/src/lib.rs:444— MethodTooLong — cuda_fwd_t runs 145 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CudaStorage.copy_strided_src candle-core/src/cuda_backend/mod.rs:2362— MethodTooLong — copy_strided_src runs 144 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ModelWeights.from_gguf candle-transformers/src/models/quantized_llama.rs:367— MethodTooLong — from_gguf runs 135 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Stack.read candle-core/src/pickle.rs:437— MethodTooLong — read runs 134 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ModelWeights.from_gguf candle-transformers/src/models/quantized_gemma3.rs:261— MethodTooLong — from_gguf runs 134 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: QuantizedAttention.forward candle-transformers/src/models/smol/quantized_smollm3.rs:391— MethodTooLong — forward runs 133 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LLaVA.prepare_inputs_labels_for_multimodal candle-transformers/src/models/llava/mod.rs:238— MethodTooLong — prepare_inputs_labels_for_multimodal runs 132 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CpuStorage.concat candle-core/src/cpu_backend/mod.rs:1756— MethodTooLong — concat runs 130 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MetalStorage.reduce_op candle-core/src/metal_backend/mod.rs:298— MethodTooLong — reduce_op runs 125 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DebertaV2DisentangledSelfAttention.disentangled_attention_bias candle-transformers/src/models/debertav2.rs:540— MethodTooLong — disentangled_attention_bias runs 123 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FlashAttn.cuda_fwd_t candle-flash-attn-v3/src/lib.rs:30— MethodTooLong — cuda_fwd_t runs 122 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: GGUFQWenMoE.from_gguf candle-transformers/src/models/quantized_qwen3_moe.rs:245— MethodTooLong — from_gguf runs 121 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CudaStorage.to_dtype candle-core/src/cuda_backend/mod.rs:1566— MethodTooLong — to_dtype runs 119 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FlashAttn.cuda_fwd_t candle-flash-attn/src/lib.rs:21— MethodTooLong — cuda_fwd_t runs 112 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ConformerAttention.forward candle-transformers/src/models/gemma4/audio.rs:500— MethodTooLong — forward runs 110 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Tensor.sorted_nodes candle-core/src/backprop.rs:35— MethodTooLong — sorted_nodes runs 108 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
candle_core::quantized::utils::make_qx_quants (cognitive 70) candle-core/src/quantized/utils.rs:62— candle_core::quantized::utils::make_qx_quants has cognitive complexity 70 (threshold 15). Drivers by points: if/else 24 (47 pts), loops 12 (20 pts), boolean chains 3 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
candle_core::cpu_backend::conv2d::conv2d_tiled (cognitive 44) candle-core/src/cpu_backend/conv2d.rs:126— candle_core::cpu_backend::conv2d::conv2d_tiled has cognitive complexity 44 (threshold 15). Drivers by points: loops 14 (33 pts), if/else 2 (9 pts), boolean chains 2 (nesting depth added 26). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
candle_core::cpu_backend::conv2d::conv2d_direct (cognitive 38) candle-core/src/cpu_backend/conv2d.rs:273— candle_core::cpu_backend::conv2d::conv2d_direct has cognitive complexity 38 (threshold 15). Drivers by points: loops 9 (25 pts), if/else 2 (11 pts), boolean chains 2 (nesting depth added 25). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
candle_core::quantized::utils::make_qkx3_quants (cognitive 36) candle-core/src/quantized/utils.rs:356— candle_core::quantized::utils::make_qkx3_quants has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 5 (8 pts), match/switch 5 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
candle_core::quantized::repack_x86::pack_q4k_amx (cognitive 34) candle-core/src/quantized/repack_x86.rs:617— candle_core::quantized::repack_x86::pack_q4k_amx has cognitive complexity 34 (threshold 15). Drivers by points: loops 9 (34 pts) (nesting depth added 25). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
candle_core::quantized::utils::make_q3_quants (cognitive 34) candle-core/src/quantized/utils.rs:287— candle_core::quantized::utils::make_q3_quants has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 6 (11 pts), boolean chains 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
candle_core::pickle::read_pth_tensor_info (cognitive 32) candle-core/src/pickle.rs:670— candle_core::pickle::read_pth_tensor_info has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 4 (13 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
candle_core::quantized::neon::vec_dot_8_q6kx8_q8k_8x4 (cognitive 32) candle-core/src/quantized/neon.rs:2447— candle_core::quantized::neon::vec_dot_8_q6kx8_q8k_8x4 has cognitive complexity 32 (threshold 15). Drivers by points: loops 8 (22 pts), if/else 4 (10 pts) (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
candle_core::quantized::neon::store_q5kx8_4x8_i8mm (cognitive 31) candle-core/src/quantized/neon.rs:1409— candle_core::quantized::neon::store_q5kx8_4x8_i8mm has cognitive complexity 31 (threshold 15). Drivers by points: loops 13 (31 pts) (nesting depth added 18). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
candle_core::quantized::repack_x86::amx::q4k_m32 (cognitive 31) candle-core/src/quantized/repack_x86.rs:724— candle_core::quantized::repack_x86::amx::q4k_m32 has cognitive complexity 31 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 5 (15 pts) (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
candle_core::quantized::neon::store_q4kx8_4x8_i8mm (cognitive 29) candle-core/src/quantized/neon.rs:970— candle_core::quantized::neon::store_q4kx8_4x8_i8mm has cognitive complexity 29 (threshold 15). Drivers by points: loops 12 (29 pts) (nesting depth added 17). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
candle_core::quantized::repack_x86::pack_q4k (cognitive 28) candle-core/src/quantized/repack_x86.rs:90— candle_core::quantized::repack_x86::pack_q4k has cognitive complexity 28 (threshold 15). Drivers by points: loops 8 (28 pts) (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (candle_core::quantized::repack_x86::pack_q6k) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
candle_core::quantized::repack_x86::pack_q6k (cognitive 28) candle-core/src/quantized/repack_x86.rs:134— candle_core::quantized::repack_x86::pack_q6k has cognitive complexity 28 (threshold 15). Drivers by points: loops 8 (28 pts) (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (candle_core::quantized::repack_x86::pack_q4k) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
candle_core::cpu_backend::utils::unary_map (cognitive 27) candle-core/src/cpu_backend/utils.rs:221— candle_core::cpu_backend::utils::unary_map has cognitive complexity 27 (threshold 15). Drivers by points: loops 6 (20 pts), if/else 4 (6 pts), match/switch 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
candle_core::quantized::neon::store_q6kx8_4x8 (cognitive 27) candle-core/src/quantized/neon.rs:1964— candle_core::quantized::neon::store_q6kx8_4x8 has cognitive complexity 27 (threshold 15). Drivers by points: loops 8 (22 pts), if/else 1 (5 pts) (nesting depth added 18). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
candle_core::quantized::neon::vec_dot_8_q6kx8_q8k_8x8 (cognitive 27) candle-core/src/quantized/neon.rs:2310— candle_core::quantized::neon::vec_dot_8_q6kx8_q8k_8x8 has cognitive complexity 27 (threshold 15). Drivers by points: loops 7 (17 pts), if/else 4 (10 pts) (nesting depth added 16). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
candle_core::quantized::repack::try_indexed_gemv (cognitive 26) candle-core/src/quantized/repack.rs:989— candle_core::quantized::repack::try_indexed_gemv has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (10 pts), boolean chains 4, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
candle_core::quantized::utils::make_qp_quants (cognitive 26) candle-core/src/quantized/utils.rs:470— candle_core::quantized::utils::make_qp_quants has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 5 (6 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
candle_core::quantized::neon::quantize_q8k_x4_interleaved (cognitive 24) candle-core/src/quantized/neon.rs:923— candle_core::quantized::neon::quantize_q8k_x4_interleaved has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (8 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
candle_core::quantized::neon::store_q6kx8_4x8_i8mm (cognitive 23) candle-core/src/quantized/neon.rs:2147— candle_core::quantized::neon::store_q6kx8_4x8_i8mm has cognitive complexity 23 (threshold 15). Drivers by points: loops 8 (18 pts), if/else 1 (5 pts) (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
candle_core::quantized::neon::store_q5kx8_4x8 (cognitive 22) candle-core/src/quantized/neon.rs:1200— candle_core::quantized::neon::store_q5kx8_4x8 has cognitive complexity 22 (threshold 15). Drivers by points: loops 10 (22 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
candle_core::cuda_backend::gemm_config (cognitive 20) candle-core/src/cuda_backend/mod.rs:1402— candle_core::cuda_backend::gemm_config has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 12, if/else 6, match/switch 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
candle_core::quantized::k_quants::matmul (cognitive 20) candle-core/src/quantized/k_quants.rs:2421— candle_core::quantized::k_quants::matmul has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
candle_core::quantized::neon::vec_dot_8_q5kx8_q8k_8x4 (cognitive 20) candle-core/src/quantized/neon.rs:1578— candle_core::quantized::neon::vec_dot_8_q5kx8_q8k_8x4 has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (15 pts), match/switch 1 (5 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
candle_core::cpu_backend::utils::unary_map_vec (cognitive 19) candle-core/src/cpu_backend/utils.rs:279— candle_core::cpu_backend::utils::unary_map_vec has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (12 pts), if/else 4 (6 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Duplicated block (13 lines × 2) candle-core/src/backprop.rs:238— candle-core/src/backprop.rs:238-250 | candle-core/src/backprop.rs:277-289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) candle-core/src/cpu/avx.rs:126— candle-core/src/cpu/avx.rs:126-138 | candle-core/src/cpu/avx.rs:203-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) candle-core/src/cpu_backend/mod.rs:595— candle-core/src/cpu_backend/mod.rs:595-607 | candle-core/src/cpu_backend/mod.rs:610-622 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) candle-core/src/cpu_backend/mod.rs:1541— candle-core/src/cpu_backend/mod.rs:1541-1553 | candle-core/src/cpu_backend/mod.rs:1632-1644 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) candle-core/src/cpu_backend/mod.rs:3193— candle-core/src/cpu_backend/mod.rs:3193-3205 | candle-core/src/cpu_backend/mod.rs:3256-3268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) candle-core/src/cuda_backend/device.rs:466— candle-core/src/cuda_backend/device.rs:466-478 | candle-core/src/cuda_backend/device.rs:620-632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) candle-core/src/metal_backend/mod.rs:208— candle-core/src/metal_backend/mod.rs:208-220 | candle-core/src/metal_backend/mod.rs:264-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) candle-core/src/quantized/metal.rs:309— candle-core/src/quantized/metal.rs:309-321 | candle-core/src/quantized/metal.rs:376-388 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) candle-metal-kernels/src/kernels/reduce.rs:329— candle-metal-kernels/src/kernels/reduce.rs:329-341 | candle-metal-kernels/src/kernels/reduce.rs:415-427 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) candle-transformers/src/models/bert.rs:521— candle-transformers/src/models/bert.rs:521-533 | candle-transformers/src/models/chinese_clip/text_model.rs:532-544 — before extracting anything, compare `candle-transformers/src/models/bert.rs` and `candle-transformers/src/models/chinese_clip/text_model.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) candle-transformers/src/models/blip.rs:133— candle-transformers/src/models/blip.rs:133-145 | candle-transformers/src/models/quantized_blip.rs:94-106 — before extracting anything, compare `candle-transformers/src/models/blip.rs` and `candle-transformers/src/models/quantized_blip.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) candle-transformers/src/models/encodec.rs:226— candle-transformers/src/models/encodec.rs:226-238 | candle-transformers/src/models/mimi/quantization.rs:56-68 — before extracting anything, compare `candle-transformers/src/models/encodec.rs` and `candle-transformers/src/models/mimi/quantization.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) candle-transformers/src/models/flux/model.rs:542— candle-transformers/src/models/flux/model.rs:542-554 | candle-transformers/src/models/flux/quantized_model.rs:381-393 — before extracting anything, compare `candle-transformers/src/models/flux/model.rs` and `candle-transformers/src/models/flux/quantized_model.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) candle-transformers/src/models/flux/model.rs:592— candle-transformers/src/models/flux/model.rs:592-604 | candle-transformers/src/models/flux/quantized_model.rs:431-443 — before extracting anything, compare `candle-transformers/src/models/flux/model.rs` and `candle-transformers/src/models/flux/quantized_model.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) candle-transformers/src/models/gemma2.rs:436— candle-transformers/src/models/gemma2.rs:436-448 | candle-transformers/src/models/gemma3.rs:517-529 — before extracting anything, compare `candle-transformers/src/models/gemma2.rs` and `candle-transformers/src/models/gemma3.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) candle-transformers/src/models/gemma4/mod.rs:104— candle-transformers/src/models/gemma4/mod.rs:104-116 | candle-transformers/src/models/gemma4/mod.rs:154-166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) candle-transformers/src/models/llama2_c_weights.rs:160— candle-transformers/src/models/llama2_c_weights.rs:160-172 | candle-wasm-examples/llama2-c/src/worker.rs:234-246 — before extracting anything, compare `candle-transformers/src/models/llama2_c_weights.rs` and `candle-wasm-examples/llama2-c/src/worker.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) candle-transformers/src/models/mimi/seanet.rs:175— candle-transformers/src/models/mimi/seanet.rs:175-187 | candle-transformers/src/models/mimi/seanet.rs:333-345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) candle-transformers/src/models/mimi/transformer.rs:200— candle-transformers/src/models/mimi/transformer.rs:200-212 | candle-transformers/src/models/mimi/transformer.rs:300-312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) candle-transformers/src/models/moondream.rs:204— candle-transformers/src/models/moondream.rs:204-216 | candle-transformers/src/models/quantized_moondream.rs:134-146 — before extracting anything, compare `candle-transformers/src/models/moondream.rs` and `candle-transformers/src/models/quantized_moondream.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) candle-transformers/src/models/mpt.rs:73— candle-transformers/src/models/mpt.rs:73-85 | candle-transformers/src/models/quantized_mpt.rs:50-62 — before extracting anything, compare `candle-transformers/src/models/mpt.rs` and `candle-transformers/src/models/quantized_mpt.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) candle-transformers/src/models/mpt.rs:130— candle-transformers/src/models/mpt.rs:130-142 | candle-transformers/src/models/quantized_mpt.rs:107-119 — before extracting anything, compare `candle-transformers/src/models/mpt.rs` and `candle-transformers/src/models/quantized_mpt.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) candle-transformers/src/models/quantized_recurrent_gemma.rs:157— candle-transformers/src/models/quantized_recurrent_gemma.rs:157-169 | candle-transformers/src/models/recurrent_gemma.rs:390-402 — before extracting anything, compare `candle-transformers/src/models/quantized_recurrent_gemma.rs` and `candle-transformers/src/models/recurrent_gemma.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) candle-transformers/src/models/quantized_t5.rs:618— candle-transformers/src/models/quantized_t5.rs:618-630 | candle-transformers/src/models/t5.rs:748-760 — before extracting anything, compare `candle-transformers/src/models/quantized_t5.rs` and `candle-transformers/src/models/t5.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 364 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) candle-transformers/src/models/smol/quantized_smollm3.rs:29— candle-transformers/src/models/smol/quantized_smollm3.rs:29-41 | candle-transformers/src/models/smol/quantized_smollm3.rs:48-60 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) candle-core/src/cuda_backend/mod.rs:185— candle-core/src/cuda_backend/mod.rs:185-195 | candle-core/src/cuda_backend/mod.rs:316-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) candle-core/src/cuda_backend/mod.rs:501— candle-core/src/cuda_backend/mod.rs:501-511 | candle-core/src/cuda_backend/mod.rs:554-564 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) candle-core/src/metal_backend/device.rs:107— candle-core/src/metal_backend/device.rs:107-117 | candle-core/src/metal_backend/device.rs:118-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) candle-core/src/metal_backend/mod.rs:479— candle-core/src/metal_backend/mod.rs:479-489 | candle-core/src/metal_backend/mod.rs:510-520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) candle-core/src/quantized/avx.rs:302— candle-core/src/quantized/avx.rs:302-312 | candle-core/src/quantized/avx.rs:438-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) candle-core/src/quantized/k_quants.rs:1654— candle-core/src/quantized/k_quants.rs:1654-1664 | candle-core/src/quantized/k_quants.rs:1935-1945 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) candle-core/src/quantized/neon.rs:1681— candle-core/src/quantized/neon.rs:1681-1691 | candle-core/src/quantized/neon.rs:1784-1794 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) candle-datasets/src/vision/cifar.rs:107— candle-datasets/src/vision/cifar.rs:107-117 | candle-datasets/src/vision/mnist.rs:107-117 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) candle-metal-kernels/src/kernels/mlx_gemm.rs:296— candle-metal-kernels/src/kernels/mlx_gemm.rs:296-306 | candle-metal-kernels/src/kernels/mlx_gemm.rs:504-514 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) candle-metal-kernels/src/kernels/reduce.rs:20— candle-metal-kernels/src/kernels/reduce.rs:20-30 | candle-metal-kernels/src/kernels/reduce.rs:78-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) candle-nn/src/attention/cpu_flash/causal.rs:690— candle-nn/src/attention/cpu_flash/causal.rs:690-700 | candle-nn/src/attention/cpu_flash/causal.rs:787-797 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) candle-nn/src/conv.rs:58— candle-nn/src/conv.rs:58-68 | candle-nn/src/conv.rs:220-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) candle-transformers/src/models/bert.rs:225— candle-transformers/src/models/bert.rs:225-235 | candle-transformers/src/models/chinese_clip/text_model.rs:233-243 — before extracting anything, compare `candle-transformers/src/models/bert.rs` and `candle-transformers/src/models/chinese_clip/text_model.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) candle-transformers/src/models/blip.rs:110— candle-transformers/src/models/blip.rs:110-120 | candle-transformers/src/models/quantized_blip.rs:71-81 — before extracting anything, compare `candle-transformers/src/models/blip.rs` and `candle-transformers/src/models/quantized_blip.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) candle-transformers/src/models/gemma2.rs:377— candle-transformers/src/models/gemma2.rs:377-387 | candle-transformers/src/models/gemma3.rs:457-467 — before extracting anything, compare `candle-transformers/src/models/gemma2.rs` and `candle-transformers/src/models/gemma3.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) candle-transformers/src/models/llama2_c.rs:238— candle-transformers/src/models/llama2_c.rs:238-248 | candle-transformers/src/models/quantized_llama2_c.rs:125-135 — before extracting anything, compare `candle-transformers/src/models/llama2_c.rs` and `candle-transformers/src/models/quantized_llama2_c.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) candle-transformers/src/models/llama2_c.rs:362— candle-transformers/src/models/llama2_c.rs:362-372 | candle-transformers/src/models/quantized_llama2_c.rs:249-259 — before extracting anything, compare `candle-transformers/src/models/llama2_c.rs` and `candle-transformers/src/models/quantized_llama2_c.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) candle-transformers/src/models/mamba2.rs:514— candle-transformers/src/models/mamba2.rs:514-524 | candle-transformers/src/models/mamba2.rs:527-537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) candle-transformers/src/models/marian.rs:489— candle-transformers/src/models/marian.rs:489-499 | candle-transformers/src/models/marian.rs:549-559 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) candle-transformers/src/models/metavoice.rs:774— candle-transformers/src/models/metavoice.rs:774-784 | candle-transformers/src/models/quantized_metavoice.rs:77-87 — before extracting anything, compare `candle-transformers/src/models/metavoice.rs` and `candle-transformers/src/models/quantized_metavoice.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) candle-transformers/src/models/mmdit/blocks.rs:64— candle-transformers/src/models/mmdit/blocks.rs:64-74 | candle-transformers/src/models/mmdit/blocks.rs:168-178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) candle-transformers/src/models/modernbert.rs:289— candle-transformers/src/models/modernbert.rs:289-299 | candle-transformers/src/models/xlm_roberta.rs:517-527 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) candle-transformers/src/models/mpt.rs:118— candle-transformers/src/models/mpt.rs:118-128 | candle-transformers/src/models/quantized_mpt.rs:95-105 — before extracting anything, compare `candle-transformers/src/models/mpt.rs` and `candle-transformers/src/models/quantized_mpt.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) candle-transformers/src/models/paddleocr_vl/vision.rs:962— candle-transformers/src/models/paddleocr_vl/vision.rs:962-972 | candle-transformers/src/models/qwen3_vl/vision.rs:546-556 — `candle-transformers/src/models/paddleocr_vl/vision.rs` and `candle-transformers/src/models/qwen3_vl/vision.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 11 separate duplicated blocks between them, totalling at least 77 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 2) candle-transformers/src/models/quantized_rwkv_v5.rs:106— candle-transformers/src/models/quantized_rwkv_v5.rs:106-116 | candle-transformers/src/models/rwkv_v5.rs:157-167 — before extracting anything, compare `candle-transformers/src/models/quantized_rwkv_v5.rs` and `candle-transformers/src/models/rwkv_v5.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 141 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
FunctionTooLong: candle_onnx::eval::simple_eval_ candle-onnx/src/eval.rs:250— FunctionTooLong — candle_onnx::eval::simple_eval_ runs 1588 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1488 over it, 15.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_nn::moe::cutile::kernels::routed_grouped_matmul candle-nn/src/moe/cutile.rs:26— FunctionTooLong — candle_nn::moe::cutile::kernels::routed_grouped_matmul runs 251 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 151 over it, 2.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_nn::attention::cpu_flash::varlen::flash_attn_varlen_cpu candle-nn/src/attention/cpu_flash/varlen.rs:27— FunctionTooLong — candle_nn::attention::cpu_flash::varlen::flash_attn_varlen_cpu runs 232 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 132 over it, 2.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_metal_kernels::kernels::sdpa::call_sdpa_full candle-metal-kernels/src/kernels/sdpa.rs:22— FunctionTooLong — candle_metal_kernels::kernels::sdpa::call_sdpa_full runs 177 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 77 over it, 1.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_metal_kernels::kernels::mlx_gemm::call_mlx_gemm candle-metal-kernels/src/kernels/mlx_gemm.rs:453— FunctionTooLong — candle_metal_kernels::kernels::mlx_gemm::call_mlx_gemm runs 160 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_core::quantized::neon::store_q5kx8_4x8 candle-core/src/quantized/neon.rs:1200— FunctionTooLong — candle_core::quantized::neon::store_q5kx8_4x8 runs 151 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_metal_kernels::kernels::mlx_gemm::call_mlx_gemv candle-metal-kernels/src/kernels/mlx_gemm.rs:261— FunctionTooLong — candle_metal_kernels::kernels::mlx_gemm::call_mlx_gemv runs 145 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_nn::moe::moe_gemm_gguf candle-nn/src/moe.rs:172— FunctionTooLong — candle_nn::moe::moe_gemm_gguf runs 134 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_core::quantized::neon::store_q6kx8_4x8 candle-core/src/quantized/neon.rs:1964— FunctionTooLong — candle_core::quantized::neon::store_q6kx8_4x8 runs 133 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_core::quantized::utils::make_qx_quants candle-core/src/quantized/utils.rs:62— FunctionTooLong — candle_core::quantized::utils::make_qx_quants runs 133 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_metal_kernels::kernels::sdpa::call_sdpa_vector_2pass candle-metal-kernels/src/kernels/sdpa.rs:373— FunctionTooLong — candle_metal_kernels::kernels::sdpa::call_sdpa_vector_2pass runs 129 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_core::quantized::neon::store_q5kx8_4x8_i8mm candle-core/src/quantized/neon.rs:1409— FunctionTooLong — candle_core::quantized::neon::store_q5kx8_4x8_i8mm runs 126 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_core::quantized::neon::vec_dot_8_q4k_q8k candle-core/src/quantized/neon.rs:4099— FunctionTooLong — candle_core::quantized::neon::vec_dot_8_q4k_q8k runs 126 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_nn::moe::cutile::routed_grouped_matmul_inner candle-nn/src/moe/cutile.rs:491— FunctionTooLong — candle_nn::moe::cutile::routed_grouped_matmul_inner runs 126 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_metal_kernels::kernels::sort::multi_block_sort candle-metal-kernels/src/kernels/sort.rs:58— FunctionTooLong — candle_metal_kernels::kernels::sort::multi_block_sort runs 125 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_core::quantized::fast_mmvq::try_fwd candle-core/src/quantized/fast_mmvq.rs:161— FunctionTooLong — candle_core::quantized::fast_mmvq::try_fwd runs 123 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_metal_kernels::kernels::quantized::call_quantized_matmul_mv_t candle-metal-kernels/src/kernels/quantized.rs:28— FunctionTooLong — candle_metal_kernels::kernels::quantized::call_quantized_matmul_mv_t runs 123 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_core::quantized::neon::vec_dot_4_q6k_q8k candle-core/src/quantized/neon.rs:3316— FunctionTooLong — candle_core::quantized::neon::vec_dot_4_q6k_q8k runs 117 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_core::quantized::neon::store_q4kx8_4x8_i8mm candle-core/src/quantized/neon.rs:970— FunctionTooLong — candle_core::quantized::neon::store_q4kx8_4x8_i8mm runs 114 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_nn::moe::moe_gemm candle-nn/src/moe.rs:12— FunctionTooLong — candle_nn::moe::moe_gemm runs 113 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_core::quantized::neon::vec_dot_4_q4k_q8k candle-core/src/quantized/neon.rs:3644— FunctionTooLong — candle_core::quantized::neon::vec_dot_4_q4k_q8k runs 109 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_nn::attention::cpu_flash::causal::run_causal_attn_cpu candle-nn/src/attention/cpu_flash/causal.rs:54— FunctionTooLong — candle_nn::attention::cpu_flash::causal::run_causal_attn_cpu runs 108 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_core::quantized::fast_mmq::try_fwd candle-core/src/quantized/fast_mmq.rs:253— FunctionTooLong — candle_core::quantized::fast_mmq::try_fwd runs 105 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_core::quantized::k_quants::matmul candle-core/src/quantized/k_quants.rs:2421— FunctionTooLong — candle_core::quantized::k_quants::matmul runs 105 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: candle_core::quantized::neon::vec_dot_8_q6kx8_q8k_8x8 candle-core/src/quantized/neon.rs:2310— FunctionTooLong — candle_core::quantized::neon::vec_dot_8_q6kx8_q8k_8x8 runs 103 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (14 lines × 2) candle-core/src/cuda_backend/mod.rs:872— candle-core/src/cuda_backend/mod.rs:872-885 | candle-core/src/cuda_backend/mod.rs:921-934 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) candle-core/src/metal_backend/mod.rs:227— candle-core/src/metal_backend/mod.rs:227-240 | candle-core/src/metal_backend/mod.rs:283-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) candle-core/src/quantized/k_quants.rs:665— candle-core/src/quantized/k_quants.rs:665-678 | candle-core/src/quantized/k_quants.rs:774-787 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) candle-core/src/quantized/neon.rs:1031— candle-core/src/quantized/neon.rs:1031-1044 | candle-core/src/quantized/neon.rs:1485-1498 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) candle-core/src/quantized/neon.rs:2043— candle-core/src/quantized/neon.rs:2043-2056 | candle-core/src/quantized/neon.rs:2065-2078 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) candle-nn/src/attention/cpu_flash/causal.rs:605— candle-nn/src/attention/cpu_flash/causal.rs:605-618 | candle-nn/src/attention/cpu_flash/causal.rs:719-732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) candle-nn/src/ops.rs:561— candle-nn/src/ops.rs:561-574 | candle-nn/src/ops.rs:800-813 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) candle-nn/src/var_builder.rs:420— candle-nn/src/var_builder.rs:420-433 | candle-nn/src/var_builder.rs:465-478 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) candle-onnx/src/eval.rs:1382— candle-onnx/src/eval.rs:1382-1395 | candle-onnx/src/eval.rs:1491-1504 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) candle-transformers/src/models/blip.rs:155— candle-transformers/src/models/blip.rs:155-168 | candle-transformers/src/models/quantized_blip.rs:116-129 — before extracting anything, compare `candle-transformers/src/models/blip.rs` and `candle-transformers/src/models/quantized_blip.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) candle-transformers/src/models/flux/model.rs:244— candle-transformers/src/models/flux/model.rs:244-257 | candle-transformers/src/models/flux/quantized_model.rs:83-96 — before extracting anything, compare `candle-transformers/src/models/flux/model.rs` and `candle-transformers/src/models/flux/quantized_model.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) candle-transformers/src/models/flux/model.rs:461— candle-transformers/src/models/flux/model.rs:461-474 | candle-transformers/src/models/flux/quantized_model.rs:300-313 — before extracting anything, compare `candle-transformers/src/models/flux/model.rs` and `candle-transformers/src/models/flux/quantized_model.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) candle-transformers/src/models/granite.rs:66— candle-transformers/src/models/granite.rs:66-79 | candle-transformers/src/models/llama.rs:68-81 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/llama.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 297 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) candle-transformers/src/models/granite.rs:325— candle-transformers/src/models/granite.rs:325-338 | candle-transformers/src/models/llama.rs:372-385 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/llama.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 297 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) candle-transformers/src/models/marian.rs:473— candle-transformers/src/models/marian.rs:473-486 | candle-transformers/src/models/marian.rs:527-540 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) candle-transformers/src/models/metavoice.rs:797— candle-transformers/src/models/metavoice.rs:797-810 | candle-transformers/src/models/quantized_metavoice.rs:100-113 — before extracting anything, compare `candle-transformers/src/models/metavoice.rs` and `candle-transformers/src/models/quantized_metavoice.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) candle-transformers/src/models/metavoice.rs:938— candle-transformers/src/models/metavoice.rs:938-951 | candle-transformers/src/models/quantized_metavoice.rs:240-253 — before extracting anything, compare `candle-transformers/src/models/metavoice.rs` and `candle-transformers/src/models/quantized_metavoice.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) candle-transformers/src/models/mimi/conv.rs:81— candle-transformers/src/models/mimi/conv.rs:81-94 | candle-transformers/src/models/mimi/conv.rs:163-176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) candle-transformers/src/models/moondream.rs:139— candle-transformers/src/models/moondream.rs:139-152 | candle-transformers/src/models/quantized_moondream.rs:71-84 — before extracting anything, compare `candle-transformers/src/models/moondream.rs` and `candle-transformers/src/models/quantized_moondream.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) candle-transformers/src/models/olmo.rs:295— candle-transformers/src/models/olmo.rs:295-308 | candle-transformers/src/models/olmo2.rs:290-303 — before extracting anything, compare `candle-transformers/src/models/olmo.rs` and `candle-transformers/src/models/olmo2.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) candle-transformers/src/models/quantized_llama.rs:574— candle-transformers/src/models/quantized_llama.rs:574-587 | candle-transformers/src/models/quantized_qwen2.rs:323-336 — before extracting anything, compare `candle-transformers/src/models/quantized_llama.rs` and `candle-transformers/src/models/quantized_qwen2.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) candle-metal-kernels/src/kernels/convolution.rs:240— candle-metal-kernels/src/kernels/convolution.rs:240-253 | candle-metal-kernels/src/kernels/convolution.rs:287-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) candle-core/src/tensor.rs:1830— candle-core/src/tensor.rs:1830-1843 | candle-core/src/tensor.rs:1892-1906 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) candle-onnx/src/eval.rs:935— candle-onnx/src/eval.rs:935-948 | candle-onnx/src/eval.rs:951-964 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) candle-transformers/src/models/depth_anything_v2.rs:121— candle-transformers/src/models/depth_anything_v2.rs:121-134 | candle-transformers/src/models/depth_anything_v2.rs:206-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 3) candle-core/src/conv.rs:195— candle-core/src/conv.rs:195-200 | candle-core/src/conv.rs:261-266 | candle-core/src/conv.rs:331-336 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) candle-core/src/cpu_backend/mod.rs:1460— candle-core/src/cpu_backend/mod.rs:1460-1465 | candle-core/src/cpu_backend/mod.rs:1541-1546 | candle-core/src/cpu_backend/mod.rs:1632-1637 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) candle-core/src/cuda_backend/mod.rs:145— candle-core/src/cuda_backend/mod.rs:145-150 | candle-core/src/cuda_backend/mod.rs:176-181 | candle-core/src/cuda_backend/mod.rs:307-312 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) candle-core/src/cuda_backend/mod.rs:590— candle-core/src/cuda_backend/mod.rs:590-595 | candle-core/src/cuda_backend/mod.rs:644-649 | candle-core/src/cuda_backend/mod.rs:696-701 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) candle-core/src/cuda_backend/mod.rs:958— candle-core/src/cuda_backend/mod.rs:958-963 | candle-core/src/cuda_backend/mod.rs:1003-1008 | candle-core/src/cuda_backend/mod.rs:1049-1054 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) candle-core/src/quantized/k_quants.rs:1520— candle-core/src/quantized/k_quants.rs:1520-1525 | candle-core/src/quantized/k_quants.rs:1785-1790 | candle-core/src/quantized/simd128.rs:225-230 — before extracting anything, compare `candle-core/src/quantized/k_quants.rs` and `candle-core/src/quantized/simd128.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) candle-metal-kernels/src/kernels/affine.rs:50— candle-metal-kernels/src/kernels/affine.rs:50-55 | candle-metal-kernels/src/kernels/affine.rs:117-122 | candle-metal-kernels/src/kernels/affine.rs:183-188 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) candle-nn/src/ops.rs:354— candle-nn/src/ops.rs:354-359 | candle-nn/src/ops.rs:573-578 | candle-nn/src/ops.rs:816-821 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) candle-onnx/src/eval.rs:478— candle-onnx/src/eval.rs:478-483 | candle-onnx/src/eval.rs:513-518 | candle-onnx/src/eval.rs:877-882 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) candle-transformers/src/models/chinese_clip/mod.rs:198— candle-transformers/src/models/chinese_clip/mod.rs:198-203 | candle-transformers/src/models/clip/mod.rs:141-146 | candle-transformers/src/models/mobileclip.rs:90-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) candle-transformers/src/models/chinese_clip/vision_model.rs:205— candle-transformers/src/models/chinese_clip/vision_model.rs:205-210 | candle-transformers/src/models/clip/text_model.rs:171-176 | candle-transformers/src/models/stable_diffusion/clip.rs:246-251 — before extracting anything, compare `candle-transformers/src/models/chinese_clip/vision_model.rs` and `candle-transformers/src/models/clip/text_model.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) candle-transformers/src/models/clip/mod.rs:137— candle-transformers/src/models/clip/mod.rs:137-142 | candle-transformers/src/models/mobileclip.rs:86-91 | candle-transformers/src/models/siglip.rs:786-791 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) candle-transformers/src/models/fastvit.rs:184— candle-transformers/src/models/fastvit.rs:184-189 | candle-transformers/src/models/mobileone.rs:112-117 | candle-transformers/src/models/repvgg.rs:128-133 — before extracting anything, compare `candle-transformers/src/models/fastvit.rs` and `candle-transformers/src/models/mobileone.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) candle-transformers/src/models/gemma.rs:131— candle-transformers/src/models/gemma.rs:131-136 | candle-transformers/src/models/gemma2.rs:124-129 | candle-transformers/src/models/gemma3.rs:129-134 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) candle-transformers/src/models/paddleocr_vl/mod.rs:358— candle-transformers/src/models/paddleocr_vl/mod.rs:358-363 | candle-transformers/src/models/paddleocr_vl/mod.rs:476-481 | candle-transformers/src/models/paddleocr_vl/mod.rs:765-770 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) candle-transformers/src/models/paddleocr_vl/text.rs:298— candle-transformers/src/models/paddleocr_vl/text.rs:298-303 | candle-transformers/src/models/paddleocr_vl/text.rs:433-439 | candle-transformers/src/models/paddleocr_vl/text.rs:558-563 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) candle-core/src/cuda_backend/device.rs:20— candle-core/src/cuda_backend/device.rs:20-25 | candle-core/src/metal_backend/device.rs:22-27 | candle-core/src/tensor.rs:17-22 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) candle-transformers/src/models/beit.rs:185— candle-transformers/src/models/beit.rs:185-190 | candle-transformers/src/models/dinov2.rs:127-132 | candle-transformers/src/models/dinov2reg4.rs:120-125 — before extracting anything, compare `candle-transformers/src/models/beit.rs` and `candle-transformers/src/models/dinov2.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) candle-transformers/src/models/bert.rs:324— candle-transformers/src/models/bert.rs:324-329 | candle-transformers/src/models/chinese_clip/text_model.rs:299-304 | candle-transformers/src/models/jina_bert.rs:236-241 — before extracting anything, compare `candle-transformers/src/models/bert.rs` and `candle-transformers/src/models/chinese_clip/text_model.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) candle-transformers/src/models/quantized_llama.rs:57— candle-transformers/src/models/quantized_llama.rs:57-62 | candle-transformers/src/models/quantized_qwen2.rs:32-37 | candle-transformers/src/models/quantized_qwen3_moe.rs:20-25 — before extracting anything, compare `candle-transformers/src/models/quantized_llama.rs` and `candle-transformers/src/models/quantized_qwen2.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) candle-nn/src/ops.rs:364— candle-nn/src/ops.rs:364-369 | candle-nn/src/ops.rs:584-589 | candle-nn/src/ops.rs:827-833 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) candle-transformers/src/models/quantized_phi.rs:206— candle-transformers/src/models/quantized_phi.rs:206-212 | candle-transformers/src/models/quantized_phi3.rs:229-235 | candle-transformers/src/models/quantized_qwen2.rs:186-191 — before extracting anything, compare `candle-transformers/src/models/quantized_phi.rs` and `candle-transformers/src/models/quantized_phi3.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) candle-metal-kernels/src/kernels/affine.rs:21— candle-metal-kernels/src/kernels/affine.rs:21-26 | candle-metal-kernels/src/kernels/affine.rs:89-94 | candle-metal-kernels/src/kernels/affine.rs:155-160 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) candle-onnx/src/eval.rs:766— candle-onnx/src/eval.rs:766-771 | candle-onnx/src/eval.rs:854-859 | candle-onnx/src/eval.rs:1802-1807 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) candle-core/src/cuda_backend/mod.rs:795— candle-core/src/cuda_backend/mod.rs:795-800 | candle-core/src/cuda_backend/mod.rs:866-871 | candle-core/src/cuda_backend/mod.rs:914-919 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) candle-core/src/cpu_backend/mod.rs:408— candle-core/src/cpu_backend/mod.rs:408-412 | candle-core/src/cpu_backend/mod.rs:447-451 | candle-core/src/cpu_backend/mod.rs:524-528 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) candle-core/src/quantized/neon.rs:1139— candle-core/src/quantized/neon.rs:1139-1143 | candle-core/src/quantized/neon.rs:1888-1892 | candle-core/src/quantized/neon.rs:2675-2679 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) candle-core/src/quantized/neon.rs:3977— candle-core/src/quantized/neon.rs:3977-3982 | candle-core/src/quantized/neon.rs:3984-3988 | candle-core/src/quantized/neon.rs:3990-3994 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) candle-core/src/tensor.rs:1641— candle-core/src/tensor.rs:1641-1645 | candle-core/src/tensor.rs:1824-1828 | candle-core/src/tensor.rs:1886-1890 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) candle-nn/src/ops.rs:299— candle-nn/src/ops.rs:299-303 | candle-nn/src/ops.rs:479-483 | candle-nn/src/ops.rs:733-737 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) candle-transformers/src/models/blip.rs:223— candle-transformers/src/models/blip.rs:223-228 | candle-transformers/src/models/quantized_blip.rs:184-189 | candle-transformers/src/models/siglip.rs:498-502 — before extracting anything, compare `candle-transformers/src/models/blip.rs` and `candle-transformers/src/models/quantized_blip.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) candle-transformers/src/models/chatglm.rs:85— candle-transformers/src/models/chatglm.rs:85-89 | candle-transformers/src/models/codegeex4_9b.rs:97-101 | candle-transformers/src/models/glm4.rs:118-122 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) candle-transformers/src/models/dinov2.rs:270— candle-transformers/src/models/dinov2.rs:270-274 | candle-transformers/src/models/dinov2reg4.rs:262-266 | candle-transformers/src/models/eva2.rs:306-310 — before extracting anything, compare `candle-transformers/src/models/dinov2.rs` and `candle-transformers/src/models/dinov2reg4.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) candle-transformers/src/models/efficientvit.rs:324— candle-transformers/src/models/efficientvit.rs:324-328 | candle-transformers/src/models/fastvit.rs:171-175 | candle-transformers/src/models/mobileone.rs:99-103 — before extracting anything, compare `candle-transformers/src/models/fastvit.rs` and `candle-transformers/src/models/mobileone.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) candle-transformers/src/models/granite.rs:305— candle-transformers/src/models/granite.rs:305-309 | candle-transformers/src/models/granitemoehybrid.rs:355-359 | candle-transformers/src/models/llama.rs:352-356 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) candle-transformers/src/models/llama2_c.rs:195— candle-transformers/src/models/llama2_c.rs:195-199 | candle-transformers/src/models/quantized_llama2_c.rs:82-86 | candle-wasm-examples/llama2-c/src/model.rs:113-117 — before extracting anything, compare `candle-transformers/src/models/llama2_c.rs` and `candle-transformers/src/models/quantized_llama2_c.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) candle-transformers/src/models/paddleocr_vl/text.rs:407— candle-transformers/src/models/paddleocr_vl/text.rs:407-411 | candle-transformers/src/models/paddleocr_vl/text.rs:498-502 | candle-transformers/src/models/paddleocr_vl/text.rs:658-662 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) candle-transformers/src/models/parler_tts.rs:138— candle-transformers/src/models/parler_tts.rs:138-142 | candle-transformers/src/models/quantized_stable_lm.rs:155-159 | candle-transformers/src/models/stable_lm.rs:278-282 — before extracting anything, compare `candle-transformers/src/models/quantized_stable_lm.rs` and `candle-transformers/src/models/stable_lm.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) candle-nn/src/attention/cpu_flash/standard.rs:32— candle-nn/src/attention/cpu_flash/standard.rs:32-37 | candle-nn/src/attention/cpu_flash/standard.rs:38-42 | candle-nn/src/attention/cpu_flash/standard.rs:45-49 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) candle-transformers/src/models/chatglm.rs:363— candle-transformers/src/models/chatglm.rs:363-367 | candle-transformers/src/models/codegeex4_9b.rs:384-388 | candle-transformers/src/models/glm4.rs:405-409 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) candle-transformers/src/models/chinese_clip/vision_model.rs:165— candle-transformers/src/models/chinese_clip/vision_model.rs:165-169 | candle-transformers/src/models/clip/text_model.rs:131-135 | candle-transformers/src/models/stable_diffusion/clip.rs:212-216 — before extracting anything, compare `candle-transformers/src/models/chinese_clip/vision_model.rs` and `candle-transformers/src/models/clip/text_model.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) candle-transformers/src/models/granite.rs:357— candle-transformers/src/models/granite.rs:357-361 | candle-transformers/src/models/llama.rs:404-408 | candle-transformers/src/models/voxtral/voxtral_llama.rs:328-332 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/llama.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 297 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) candle-metal-kernels/src/kernels/unary.rs:27— candle-metal-kernels/src/kernels/unary.rs:27-31 | candle-metal-kernels/src/kernels/unary.rs:90-96 | candle-metal-kernels/src/kernels/unary.rs:171-177 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) candle-nn/src/attention/cpu_flash/causal.rs:136— candle-nn/src/attention/cpu_flash/causal.rs:136-140 | candle-nn/src/attention/cpu_flash/causal.rs:141-145 | candle-nn/src/attention/cpu_flash/causal.rs:146-150 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) candle-transformers/src/models/chatglm.rs:76— candle-transformers/src/models/chatglm.rs:76-80 | candle-transformers/src/models/codegeex4_9b.rs:88-92 | candle-transformers/src/models/glm4.rs:109-113 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) candle-transformers/src/models/granite.rs:218— candle-transformers/src/models/granite.rs:218-222 | candle-transformers/src/models/granitemoehybrid.rs:267-271 | candle-transformers/src/models/llama.rs:264-268 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) candle-transformers/src/models/quantized_lfm2.rs:120— candle-transformers/src/models/quantized_lfm2.rs:120-124 | candle-transformers/src/models/quantized_phi3.rs:101-105 | candle-transformers/src/models/quantized_qwen2.rs:73-77 — before extracting anything, compare `candle-transformers/src/models/quantized_lfm2.rs` and `candle-transformers/src/models/quantized_phi3.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) candle-wasm-examples/llama2-c/src/app.rs:25— candle-wasm-examples/llama2-c/src/app.rs:25-29 | candle-wasm-examples/whisper/src/app.rs:34-38 | candle-wasm-examples/yolo/src/app.rs:25-29 — before extracting anything, compare `candle-wasm-examples/llama2-c/src/app.rs` and `candle-wasm-examples/whisper/src/app.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) candle-wasm-examples/llama2-c/src/app.rs:63— candle-wasm-examples/llama2-c/src/app.rs:63-67 | candle-wasm-examples/whisper/src/app.rs:104-108 | candle-wasm-examples/yolo/src/app.rs:62-66 — before extracting anything, compare `candle-wasm-examples/llama2-c/src/app.rs` and `candle-wasm-examples/whisper/src/app.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) candle-core/src/quantized/cuda.rs:819— candle-core/src/quantized/cuda.rs:819-834 | candle-core/src/quantized/metal.rs:236-251 — before extracting anything, compare `candle-core/src/quantized/cuda.rs` and `candle-core/src/quantized/metal.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) candle-core/src/quantized/k_quants.rs:1602— candle-core/src/quantized/k_quants.rs:1602-1617 | candle-core/src/quantized/k_quants.rs:1668-1683 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) candle-core/src/quantized/neon.rs:1250— candle-core/src/quantized/neon.rs:1250-1265 | candle-core/src/quantized/neon.rs:1997-2012 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) candle-core/src/quantized/simd128.rs:36— candle-core/src/quantized/simd128.rs:36-51 | candle-core/src/quantized/simd128.rs:76-91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) candle-core/src/tensor.rs:1639— candle-core/src/tensor.rs:1639-1654 | candle-core/src/tensor.rs:1822-1837 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) candle-flash-attn/src/lib.rs:893— candle-flash-attn/src/lib.rs:893-908 | candle-flash-attn/src/lib.rs:950-965 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) candle-flash-attn/src/lib.rs:1061— candle-flash-attn/src/lib.rs:1061-1076 | candle-flash-attn/src/lib.rs:1120-1135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) candle-nn/src/attention/cpu_flash/standard.rs:224— candle-nn/src/attention/cpu_flash/standard.rs:224-239 | candle-nn/src/attention/cpu_flash/standard.rs:400-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) candle-onnx/src/eval.rs:157— candle-onnx/src/eval.rs:157-172 | candle-onnx/src/eval.rs:175-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) candle-transformers/src/models/bert.rs:483— candle-transformers/src/models/bert.rs:483-498 | candle-transformers/src/models/distilbert.rs:322-337 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) candle-transformers/src/models/encodec.rs:498— candle-transformers/src/models/encodec.rs:498-513 | candle-transformers/src/models/mimi/conv.rs:295-310 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (16 lines × 2) candle-transformers/src/models/llama2_c_weights.rs:57— candle-transformers/src/models/llama2_c_weights.rs:57-72 | candle-wasm-examples/llama2-c/src/worker.rs:116-131 — before extracting anything, compare `candle-transformers/src/models/llama2_c_weights.rs` and `candle-wasm-examples/llama2-c/src/worker.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) candle-transformers/src/models/mixformer.rs:389— candle-transformers/src/models/mixformer.rs:389-404 | candle-transformers/src/models/quantized_mixformer.rs:304-319 — before extracting anything, compare `candle-transformers/src/models/mixformer.rs` and `candle-transformers/src/models/quantized_mixformer.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) candle-transformers/src/models/mpt.rs:92— candle-transformers/src/models/mpt.rs:92-107 | candle-transformers/src/models/quantized_mpt.rs:69-84 — before extracting anything, compare `candle-transformers/src/models/mpt.rs` and `candle-transformers/src/models/quantized_mpt.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) candle-transformers/src/models/quantized_stable_lm.rs:92— candle-transformers/src/models/quantized_stable_lm.rs:92-107 | candle-transformers/src/models/stable_lm.rs:214-229 — before extracting anything, compare `candle-transformers/src/models/quantized_stable_lm.rs` and `candle-transformers/src/models/stable_lm.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) candle-transformers/src/models/quantized_stable_lm.rs:144— candle-transformers/src/models/quantized_stable_lm.rs:144-159 | candle-transformers/src/models/stable_lm.rs:267-282 — before extracting anything, compare `candle-transformers/src/models/quantized_stable_lm.rs` and `candle-transformers/src/models/stable_lm.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) candle-transformers/src/models/stable_diffusion/mod.rs:342— candle-transformers/src/models/stable_diffusion/mod.rs:342-357 | candle-transformers/src/models/stable_diffusion/mod.rs:437-452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) candle-metal-kernels/src/kernels/indexing.rs:80— candle-metal-kernels/src/kernels/indexing.rs:80-95 | candle-metal-kernels/src/kernels/indexing.rs:127-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) candle-wasm-examples/llama2-c/src/app.rs:225— candle-wasm-examples/llama2-c/src/app.rs:225-240 | candle-wasm-examples/yolo/src/app.rs:245-260 — before extracting anything, compare `candle-wasm-examples/llama2-c/src/app.rs` and `candle-wasm-examples/yolo/src/app.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) candle-core/src/cuda_backend/cudnn.rs:38— candle-core/src/cuda_backend/cudnn.rs:38-52 | candle-core/src/cuda_backend/cudnn.rs:137-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) candle-core/src/quantized/neon.rs:2325— candle-core/src/quantized/neon.rs:2325-2339 | candle-core/src/quantized/neon.rs:2462-2476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) candle-datasets/src/batcher.rs:73— candle-datasets/src/batcher.rs:73-87 | candle-datasets/src/batcher.rs:122-136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) candle-transformers/src/models/blip_text.rs:263— candle-transformers/src/models/blip_text.rs:263-277 | candle-transformers/src/models/quantized_blip_text.rs:259-273 — before extracting anything, compare `candle-transformers/src/models/blip_text.rs` and `candle-transformers/src/models/quantized_blip_text.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 215 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) candle-transformers/src/models/flux/model.rs:381— candle-transformers/src/models/flux/model.rs:381-395 | candle-transformers/src/models/flux/quantized_model.rs:220-234 — before extracting anything, compare `candle-transformers/src/models/flux/model.rs` and `candle-transformers/src/models/flux/quantized_model.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) candle-transformers/src/models/flux/model.rs:606— candle-transformers/src/models/flux/model.rs:606-620 | candle-transformers/src/models/flux/quantized_model.rs:445-459 — before extracting anything, compare `candle-transformers/src/models/flux/model.rs` and `candle-transformers/src/models/flux/quantized_model.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) candle-transformers/src/models/mmdit/blocks.rs:42— candle-transformers/src/models/mmdit/blocks.rs:42-56 | candle-transformers/src/models/mmdit/blocks.rs:128-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) candle-transformers/src/models/paddleocr_vl/text.rs:393— candle-transformers/src/models/paddleocr_vl/text.rs:393-407 | candle-transformers/src/models/paddleocr_vl/text.rs:644-658 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) candle-transformers/src/models/paddleocr_vl/text.rs:1008— candle-transformers/src/models/paddleocr_vl/text.rs:1008-1022 | candle-transformers/src/models/qwen3_vl/text.rs:215-229 — `candle-transformers/src/models/paddleocr_vl/text.rs` and `candle-transformers/src/models/qwen3_vl/text.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 34 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 2) candle-transformers/src/models/quantized_recurrent_gemma.rs:194— candle-transformers/src/models/quantized_recurrent_gemma.rs:194-208 | candle-transformers/src/models/recurrent_gemma.rs:427-441 — before extracting anything, compare `candle-transformers/src/models/quantized_recurrent_gemma.rs` and `candle-transformers/src/models/recurrent_gemma.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) candle-transformers/src/models/stable_diffusion/uni_pc.rs:396— candle-transformers/src/models/stable_diffusion/uni_pc.rs:396-410 | candle-transformers/src/models/stable_diffusion/uni_pc.rs:509-523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) candle-transformers/src/models/whisper/audio.rs:135— candle-transformers/src/models/whisper/audio.rs:135-149 | candle-wasm-examples/whisper/src/audio.rs:125-139 — before extracting anything, compare `candle-transformers/src/models/whisper/audio.rs` and `candle-wasm-examples/whisper/src/audio.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) candle-transformers/src/models/whisper/model.rs:44— candle-transformers/src/models/whisper/model.rs:44-58 | candle-transformers/src/models/whisper/quantized_model.rs:41-55 — before extracting anything, compare `candle-transformers/src/models/whisper/model.rs` and `candle-transformers/src/models/whisper/quantized_model.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) tensor-tools/src/main.rs:185— tensor-tools/src/main.rs:185-199 | tensor-tools/src/main.rs:305-319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) candle-core/src/quantized/fast_mmq.rs:23— candle-core/src/quantized/fast_mmq.rs:23-37 | candle-core/src/quantized/fast_mmvq.rs:22-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) candle-metal-kernels/src/kernels/indexing.rs:31— candle-metal-kernels/src/kernels/indexing.rs:31-45 | candle-metal-kernels/src/kernels/indexing.rs:175-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) candle-wasm-examples/moondream/src/bin/m.rs:247— candle-wasm-examples/moondream/src/bin/m.rs:247-261 | candle-wasm-examples/phi/src/bin/m.rs:134-148 — before extracting anything, compare `candle-wasm-examples/moondream/src/bin/m.rs` and `candle-wasm-examples/phi/src/bin/m.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) candle-nn/src/attention/cpu_flash/causal.rs:221— candle-nn/src/attention/cpu_flash/causal.rs:221-231 | candle-nn/src/attention/cpu_flash/causal.rs:314-324 | candle-nn/src/attention/cpu_flash/causal.rs:403-413 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) candle-nn/src/attention/cpu_flash/causal.rs:285— candle-nn/src/attention/cpu_flash/causal.rs:285-295 | candle-nn/src/attention/cpu_flash/causal.rs:371-381 | candle-nn/src/attention/cpu_flash/causal.rs:451-461 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) candle-nn/src/rotary_emb.rs:214— candle-nn/src/rotary_emb.rs:214-224 | candle-nn/src/rotary_emb.rs:519-529 | candle-nn/src/rotary_emb.rs:793-803 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) candle-nn/src/var_builder.rs:510— candle-nn/src/var_builder.rs:510-520 | candle-nn/src/var_builder.rs:540-550 | candle-nn/src/var_builder.rs:570-580 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) candle-transformers/src/models/beit.rs:216— candle-transformers/src/models/beit.rs:216-226 | candle-transformers/src/models/dinov2.rs:158-168 | candle-transformers/src/models/dinov2reg4.rs:151-161 — before extracting anything, compare `candle-transformers/src/models/beit.rs` and `candle-transformers/src/models/dinov2.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) candle-transformers/src/models/beit.rs:231— candle-transformers/src/models/beit.rs:231-241 | candle-transformers/src/models/dinov2.rs:173-183 | candle-transformers/src/models/dinov2reg4.rs:166-176 — before extracting anything, compare `candle-transformers/src/models/beit.rs` and `candle-transformers/src/models/dinov2.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) candle-transformers/src/models/bert.rs:248— candle-transformers/src/models/bert.rs:248-258 | candle-transformers/src/models/chinese_clip/text_model.rs:256-266 | candle-transformers/src/models/jina_bert.rs:171-181 — before extracting anything, compare `candle-transformers/src/models/bert.rs` and `candle-transformers/src/models/chinese_clip/text_model.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) candle-transformers/src/models/chatglm.rs:153— candle-transformers/src/models/chatglm.rs:153-163 | candle-transformers/src/models/codegeex4_9b.rs:170-180 | candle-transformers/src/models/glm4.rs:191-201 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) candle-transformers/src/models/chatglm.rs:579— candle-transformers/src/models/chatglm.rs:579-589 | candle-transformers/src/models/codegeex4_9b.rs:601-611 | candle-transformers/src/models/glm4.rs:622-632 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) candle-transformers/src/models/granite.rs:160— candle-transformers/src/models/granite.rs:160-170 | candle-transformers/src/models/granitemoehybrid.rs:203-213 | candle-transformers/src/models/llama.rs:206-216 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) candle-transformers/src/models/granite.rs:450— candle-transformers/src/models/granite.rs:450-460 | candle-transformers/src/models/llama.rs:523-533 | candle-transformers/src/models/voxtral/voxtral_llama.rs:458-468 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/llama.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 297 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) candle-transformers/src/models/helium.rs:374— candle-transformers/src/models/helium.rs:374-384 | candle-transformers/src/models/mistral.rs:430-440 | candle-transformers/src/models/quantized_mistral.rs:315-325 — before extracting anything, compare `candle-transformers/src/models/helium.rs` and `candle-transformers/src/models/mistral.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) candle-transformers/src/models/mistral.rs:385— candle-transformers/src/models/mistral.rs:385-395 | candle-transformers/src/models/mixtral.rs:426-436 | candle-transformers/src/models/qwen2_moe.rs:421-431 — before extracting anything, compare `candle-transformers/src/models/mistral.rs` and `candle-transformers/src/models/mixtral.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) candle-transformers/src/models/mmdit/blocks.rs:44— candle-transformers/src/models/mmdit/blocks.rs:44-54 | candle-transformers/src/models/mmdit/blocks.rs:130-140 | candle-transformers/src/models/mmdit/blocks.rs:226-236 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) candle-transformers/src/models/chatglm.rs:518— candle-transformers/src/models/chatglm.rs:518-528 | candle-transformers/src/models/codegeex4_9b.rs:539-549 | candle-transformers/src/models/glm4.rs:560-570 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) candle-wasm-examples/yolo/src/model.rs:264— candle-wasm-examples/yolo/src/model.rs:264-274 | candle-wasm-examples/yolo/src/model.rs:279-289 | candle-wasm-examples/yolo/src/model.rs:294-304 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) candle-core/src/cpu_backend/mod.rs:1125— candle-core/src/cpu_backend/mod.rs:1125-1131 | candle-core/src/cpu_backend/mod.rs:1190-1196 | candle-core/src/cpu_backend/mod.rs:1198-1204 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) candle-core/src/cuda_backend/mod.rs:786— candle-core/src/cuda_backend/mod.rs:786-792 | candle-core/src/cuda_backend/mod.rs:857-863 | candle-core/src/cuda_backend/mod.rs:905-911 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) candle-core/src/quantized/neon.rs:1076— candle-core/src/quantized/neon.rs:1076-1082 | candle-core/src/quantized/neon.rs:1530-1536 | candle-core/src/quantized/neon.rs:2246-2252 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) candle-core/src/quantized/neon.rs:1111— candle-core/src/quantized/neon.rs:1111-1117 | candle-core/src/quantized/neon.rs:1565-1571 | candle-core/src/quantized/neon.rs:2271-2277 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) candle-nn/src/rotary_emb.rs:85— candle-nn/src/rotary_emb.rs:85-91 | candle-nn/src/rotary_emb.rs:390-396 | candle-nn/src/rotary_emb.rs:664-670 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) candle-nn/src/rotary_emb.rs:143— candle-nn/src/rotary_emb.rs:143-149 | candle-nn/src/rotary_emb.rs:448-454 | candle-nn/src/rotary_emb.rs:722-728 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) candle-transformers/src/models/csm.rs:360— candle-transformers/src/models/csm.rs:360-366 | candle-transformers/src/models/helium.rs:361-367 | candle-transformers/src/models/mistral.rs:417-423 — before extracting anything, compare `candle-transformers/src/models/csm.rs` and `candle-transformers/src/models/helium.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) candle-transformers/src/models/dinov2.rs:279— candle-transformers/src/models/dinov2.rs:279-285 | candle-transformers/src/models/dinov2reg4.rs:270-276 | candle-transformers/src/models/eva2.rs:316-322 — before extracting anything, compare `candle-transformers/src/models/dinov2.rs` and `candle-transformers/src/models/dinov2reg4.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) candle-transformers/src/models/mimi/transformer.rs:65— candle-transformers/src/models/mimi/transformer.rs:65-71 | candle-transformers/src/models/quantized_mistral.rs:43-49 | candle-transformers/src/models/quantized_mixformer.rs:69-75 — before extracting anything, compare `candle-transformers/src/models/quantized_mistral.rs` and `candle-transformers/src/models/quantized_mixformer.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) candle-transformers/src/models/blip.rs:250— candle-transformers/src/models/blip.rs:250-256 | candle-transformers/src/models/quantized_blip.rs:211-217 | candle-transformers/src/models/siglip.rs:525-531 — before extracting anything, compare `candle-transformers/src/models/blip.rs` and `candle-transformers/src/models/quantized_blip.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) candle-transformers/src/models/blip_text.rs:220— candle-transformers/src/models/blip_text.rs:220-226 | candle-transformers/src/models/quantized_blip_text.rs:216-222 | candle-transformers/src/models/vit.rs:291-297 — before extracting anything, compare `candle-transformers/src/models/blip_text.rs` and `candle-transformers/src/models/quantized_blip_text.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 215 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) candle-transformers/src/models/chinese_clip/vision_model.rs:308— candle-transformers/src/models/chinese_clip/vision_model.rs:308-314 | candle-transformers/src/models/clip/text_model.rs:258-264 | candle-transformers/src/models/stable_diffusion/clip.rs:331-337 — before extracting anything, compare `candle-transformers/src/models/chinese_clip/vision_model.rs` and `candle-transformers/src/models/clip/text_model.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) candle-transformers/src/models/granite.rs:111— candle-transformers/src/models/granite.rs:111-117 | candle-transformers/src/models/granitemoehybrid.rs:149-155 | candle-transformers/src/models/llama.rs:155-161 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) candle-transformers/src/models/glm4_new.rs:313— candle-transformers/src/models/glm4_new.rs:313-319 | candle-transformers/src/models/qwen3.rs:422-428 | candle-transformers/src/models/z_image/text_encoder.rs:385-395 — before extracting anything, compare `candle-transformers/src/models/glm4_new.rs` and `candle-transformers/src/models/qwen3.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) candle-nn/src/ops.rs:409— candle-nn/src/ops.rs:409-415 | candle-nn/src/ops.rs:631-637 | candle-nn/src/ops.rs:880-886 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) candle-transformers/src/models/llama2_c.rs:280— candle-transformers/src/models/llama2_c.rs:280-286 | candle-transformers/src/models/quantized_llama2_c.rs:167-173 | candle-wasm-examples/llama2-c/src/model.rs:194-200 — before extracting anything, compare `candle-transformers/src/models/llama2_c.rs` and `candle-transformers/src/models/quantized_llama2_c.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) candle-core/src/quantized/k_quants.rs:972— candle-core/src/quantized/k_quants.rs:972-981 | candle-core/src/quantized/k_quants.rs:1635-1644 | candle-core/src/quantized/k_quants.rs:1916-1925 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) candle-core/src/quantized/k_quants.rs:1598— candle-core/src/quantized/k_quants.rs:1598-1607 | candle-core/src/quantized/k_quants.rs:1664-1673 | candle-core/src/quantized/k_quants.rs:1945-1954 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) candle-nn/src/attention/cpu_flash/causal.rs:909— candle-nn/src/attention/cpu_flash/causal.rs:909-918 | candle-nn/src/attention/cpu_flash/standard.rs:330-339 | candle-nn/src/attention/cpu_flash/standard.rs:417-426 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 3) candle-transformers/src/models/beit.rs:142— candle-transformers/src/models/beit.rs:142-151 | candle-transformers/src/models/dinov2.rs:85-94 | candle-transformers/src/models/dinov2reg4.rs:78-87 — before extracting anything, compare `candle-transformers/src/models/beit.rs` and `candle-transformers/src/models/dinov2.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) candle-transformers/src/models/chatglm.rs:97— candle-transformers/src/models/chatglm.rs:97-106 | candle-transformers/src/models/codegeex4_9b.rs:109-118 | candle-transformers/src/models/glm4.rs:130-139 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) candle-transformers/src/models/chinese_clip/vision_model.rs:280— candle-transformers/src/models/chinese_clip/vision_model.rs:280-289 | candle-transformers/src/models/clip/text_model.rs:230-239 | candle-transformers/src/models/stable_diffusion/clip.rs:303-312 — before extracting anything, compare `candle-transformers/src/models/chinese_clip/vision_model.rs` and `candle-transformers/src/models/clip/text_model.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) candle-transformers/src/models/convnext.rs:323— candle-transformers/src/models/convnext.rs:323-332 | candle-transformers/src/models/efficientvit.rs:473-482 | candle-transformers/src/models/mobileone.rs:317-326 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (10 lines × 3) candle-transformers/src/models/granite.rs:367— candle-transformers/src/models/granite.rs:367-376 | candle-transformers/src/models/llama.rs:414-423 | candle-transformers/src/models/voxtral/voxtral_llama.rs:338-347 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/llama.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 297 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) candle-transformers/src/models/llama2_c.rs:237— candle-transformers/src/models/llama2_c.rs:237-246 | candle-transformers/src/models/quantized_llama2_c.rs:124-133 | candle-wasm-examples/llama2-c/src/model.rs:151-160 — before extracting anything, compare `candle-transformers/src/models/llama2_c.rs` and `candle-transformers/src/models/quantized_llama2_c.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) candle-transformers/src/models/paddleocr_vl/mod.rs:371— candle-transformers/src/models/paddleocr_vl/mod.rs:371-380 | candle-transformers/src/models/paddleocr_vl/mod.rs:489-498 | candle-transformers/src/models/paddleocr_vl/mod.rs:788-797 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) candle-transformers/src/models/quantized_lfm2.rs:170— candle-transformers/src/models/quantized_lfm2.rs:170-179 | candle-transformers/src/models/quantized_phi.rs:148-157 | candle-transformers/src/models/quantized_qwen2.rs:135-144 — before extracting anything, compare `candle-transformers/src/models/quantized_lfm2.rs` and `candle-transformers/src/models/quantized_phi.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) candle-transformers/src/models/repvgg.rs:297— candle-transformers/src/models/repvgg.rs:297-306 | candle-transformers/src/models/resnet.rs:112-121 | candle-transformers/src/models/resnet.rs:224-233 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 3) candle-transformers/src/models/blip_text.rs:103— candle-transformers/src/models/blip_text.rs:103-112 | candle-transformers/src/models/quantized_blip_text.rs:99-108 | candle-transformers/src/models/vit.rs:213-222 — before extracting anything, compare `candle-transformers/src/models/blip_text.rs` and `candle-transformers/src/models/quantized_blip_text.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 215 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) candle-core/src/metal_backend/mod.rs:123— candle-core/src/metal_backend/mod.rs:123-132 | candle-core/src/metal_backend/mod.rs:187-196 | candle-core/src/metal_backend/mod.rs:243-252 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) candle-core/src/quantized/avx.rs:367— candle-core/src/quantized/avx.rs:367-374 | candle-core/src/quantized/avx.rs:375-382 | candle-core/src/quantized/avx.rs:383-390 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) candle-core/src/quantized/k_quants.rs:1184— candle-core/src/quantized/k_quants.rs:1184-1191 | candle-core/src/quantized/k_quants.rs:1544-1551 | candle-core/src/quantized/k_quants.rs:1809-1816 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) candle-nn/src/rotary_emb.rs:160— candle-nn/src/rotary_emb.rs:160-167 | candle-nn/src/rotary_emb.rs:465-472 | candle-nn/src/rotary_emb.rs:739-746 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) candle-transformers/src/models/chatglm.rs:141— candle-transformers/src/models/chatglm.rs:141-148 | candle-transformers/src/models/codegeex4_9b.rs:158-165 | candle-transformers/src/models/glm4.rs:179-186 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) candle-transformers/src/models/gemma2.rs:337— candle-transformers/src/models/gemma2.rs:337-344 | candle-transformers/src/models/gemma3.rs:377-384 | candle-transformers/src/models/gemma4/text.rs:463-470 — before extracting anything, compare `candle-transformers/src/models/gemma2.rs` and `candle-transformers/src/models/gemma3.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) candle-transformers/src/models/helium.rs:233— candle-transformers/src/models/helium.rs:233-240 | candle-transformers/src/models/mistral.rs:282-289 | candle-transformers/src/models/mixtral.rs:214-221 — before extracting anything, compare `candle-transformers/src/models/helium.rs` and `candle-transformers/src/models/mistral.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) candle-transformers/src/models/marian.rs:329— candle-transformers/src/models/marian.rs:329-336 | candle-transformers/src/models/parler_tts.rs:145-152 | candle-transformers/src/models/trocr.rs:243-250 — before extracting anything, compare `candle-transformers/src/models/marian.rs` and `candle-transformers/src/models/trocr.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) candle-transformers/src/models/mixtral.rs:333— candle-transformers/src/models/mixtral.rs:333-340 | candle-transformers/src/models/qwen2_moe.rs:295-302 | candle-transformers/src/models/qwen3_moe.rs:156-163 — before extracting anything, compare `candle-transformers/src/models/mixtral.rs` and `candle-transformers/src/models/qwen2_moe.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 275 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) candle-transformers/src/models/nvembed_v2/embedding.rs:163— candle-transformers/src/models/nvembed_v2/embedding.rs:163-171 | candle-transformers/src/models/smol/quantized_smollm3.rs:560-569 | candle-transformers/src/models/starcoder2.rs:203-210 — before extracting anything, compare `candle-transformers/src/models/nvembed_v2/embedding.rs` and `candle-transformers/src/models/starcoder2.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) candle-transformers/src/models/nvembed_v2/embedding.rs:160— candle-transformers/src/models/nvembed_v2/embedding.rs:160-168 | candle-transformers/src/models/parler_tts.rs:146-153 | candle-transformers/src/models/starcoder2.rs:200-207 — before extracting anything, compare `candle-transformers/src/models/nvembed_v2/embedding.rs` and `candle-transformers/src/models/starcoder2.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) candle-transformers/src/models/quantized_gemma3.rs:77— candle-transformers/src/models/quantized_gemma3.rs:77-84 | candle-transformers/src/models/quantized_llama.rs:291-298 | candle-transformers/src/models/quantized_phi.rs:182-189 — before extracting anything, compare `candle-transformers/src/models/quantized_gemma3.rs` and `candle-transformers/src/models/quantized_llama.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) candle-transformers/src/models/chatglm.rs:532— candle-transformers/src/models/chatglm.rs:532-539 | candle-transformers/src/models/codegeex4_9b.rs:553-560 | candle-transformers/src/models/glm4.rs:574-581 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) candle-transformers/src/models/llama2_c.rs:175— candle-transformers/src/models/llama2_c.rs:175-182 | candle-transformers/src/models/quantized_llama2_c.rs:62-69 | candle-wasm-examples/llama2-c/src/model.rs:92-99 — before extracting anything, compare `candle-transformers/src/models/llama2_c.rs` and `candle-transformers/src/models/quantized_llama2_c.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) candle-wasm-examples/llama2-c/src/app.rs:74— candle-wasm-examples/llama2-c/src/app.rs:74-81 | candle-wasm-examples/whisper/src/app.rs:115-122 | candle-wasm-examples/yolo/src/app.rs:117-124 — before extracting anything, compare `candle-wasm-examples/llama2-c/src/app.rs` and `candle-wasm-examples/whisper/src/app.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
candle_nn::attention::cpu_flash::varlen::flash_attn_varlen_cpu (cognitive 83) candle-nn/src/attention/cpu_flash/varlen.rs:27— candle_nn::attention::cpu_flash::varlen::flash_attn_varlen_cpu has cognitive complexity 83 (threshold 15). Drivers by points: if/else 31 (46 pts), loops 10 (20 pts), match/switch 8 (11 pts), boolean chains 6 (nesting depth added 28). Of this number, 76 points are the body's own statements and 7 belong to 2 function items inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
candle_nn::attention::cpu_flash::causal::causal_prefill_f32 (cognitive 30) candle-nn/src/attention/cpu_flash/causal.rs:573— candle_nn::attention::cpu_flash::causal::causal_prefill_f32 has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
candle_nn::attention::cpu_flash::standard::flash_attn_decode (cognitive 24) candle-nn/src/attention/cpu_flash/standard.rs:208— candle_nn::attention::cpu_flash::standard::flash_attn_decode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 4 (8 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (candle_nn::attention::cpu_flash::standard::flash_attn_prefill) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
candle_nn::attention::cpu_flash::standard::flash_attn_prefill (cognitive 24) candle-nn/src/attention/cpu_flash/standard.rs:384— candle_nn::attention::cpu_flash::standard::flash_attn_prefill has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 4 (8 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (candle_nn::attention::cpu_flash::standard::flash_attn_decode) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
candle_nn::attention::cpu_flash::causal::causal_decode_f32 (cognitive 23) candle-nn/src/attention/cpu_flash/causal.rs:192— candle_nn::attention::cpu_flash::causal::causal_decode_f32 has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
candle_nn::attention::cpu_flash::causal::causal_decode_f32_interleaved_gqa2 (cognitive 21) candle-nn/src/attention/cpu_flash/causal.rs:465— candle_nn::attention::cpu_flash::causal::causal_decode_f32_interleaved_gqa2 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
candle_nn::attention::varlen::flash_attn_varlen_unfused (cognitive 20) candle-nn/src/attention/varlen.rs:25— candle_nn::attention::varlen::flash_attn_varlen_unfused has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 2 (nesting depth added 6). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
candle_nn::attention::cpu_flash::causal::run_causal_attn_cpu (cognitive 18) candle-nn/src/attention/cpu_flash/causal.rs:54— candle_nn::attention::cpu_flash::causal::run_causal_attn_cpu has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 6 (9 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
candle_nn::moe::moe_gemm_gguf::cuda_fwd (cognitive 18) candle-nn/src/moe.rs:188— candle_nn::moe::moe_gemm_gguf::cuda_fwd has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 6 (9 pts) (nesting depth added 5). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
candle_nn::moe::cutile::routed_grouped_matmul_inner (cognitive 18) candle-nn/src/moe/cutile.rs:491— candle_nn::moe::cutile::routed_grouped_matmul_inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
candle_nn::attention::cpu_flash::standard::run_flash_attn_cpu (cognitive 17) candle-nn/src/attention/cpu_flash/standard.rs:12— candle_nn::attention::cpu_flash::standard::run_flash_attn_cpu has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
candle_nn::attention::cpu_flash::causal::causal_decode_f32_lean (cognitive 16) candle-nn/src/attention/cpu_flash/causal.rs:300— candle_nn::attention::cpu_flash::causal::causal_decode_f32_lean has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (candle_nn::attention::cpu_flash::causal::causal_prefill_f32_lean) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
candle_nn::attention::cpu_flash::causal::causal_prefill_f32_lean (cognitive 16) candle-nn/src/attention/cpu_flash/causal.rs:704— candle_nn::attention::cpu_flash::causal::causal_prefill_f32_lean has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (candle_nn::attention::cpu_flash::causal::causal_decode_f32_lean) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×11
Members sharing a duplicated core (5 members, 50+ identical tokens) candle-core/src/quantized/neon.rs:978— candle-core/src/quantized/neon.rs:978-1120 | candle-core/src/quantized/neon.rs:1208-1405 | candle-core/src/quantized/neon.rs:1417-1574 | candle-core/src/quantized/neon.rs:1972-2143 | candle-core/src/quantized/neon.rs:2155-2280 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) candle-core/src/quantized/repack.rs:458— candle-core/src/quantized/repack.rs:458-489 | candle-core/src/quantized/repack.rs:492-533 | candle-core/src/quantized/repack.rs:536-579 | candle-core/src/quantized/repack.rs:628-659 | candle-core/src/quantized/repack.rs:662-692 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) candle-nn/src/attention/cpu_flash/causal.rs:204— candle-nn/src/attention/cpu_flash/causal.rs:204-295 | candle-nn/src/attention/cpu_flash/causal.rs:310-381 | candle-nn/src/attention/cpu_flash/causal.rs:397-461 | candle-nn/src/attention/cpu_flash/causal.rs:587-700 | candle-nn/src/attention/cpu_flash/causal.rs:716-797 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) candle-transformers/src/models/glm4_new.rs:332— candle-transformers/src/models/glm4_new.rs:332-352 | candle-transformers/src/models/quantized_glm4.rs:430-455 | candle-transformers/src/models/quantized_qwen3.rs:538-561 | candle-transformers/src/models/qwen3_moe.rs:302-322 | candle-transformers/src/models/smol/smollm3.rs:396-417 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) candle-transformers/src/models/granite.rs:120— candle-transformers/src/models/granite.rs:120-170 | candle-transformers/src/models/granitemoehybrid.rs:163-213 | candle-transformers/src/models/lfm2.rs:165-186 | candle-transformers/src/models/llama.rs:164-216 | candle-transformers/src/models/voxtral/voxtral_llama.rs:89-111 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) candle-transformers/src/models/granite.rs:395— candle-transformers/src/models/granite.rs:395-403 | candle-transformers/src/models/llama.rs:442-450 | candle-transformers/src/models/llama2_c.rs:313-320 | candle-transformers/src/models/quantized_llama2_c.rs:200-207 | candle-transformers/src/models/voxtral/voxtral_llama.rs:366-374 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) candle-transformers/src/models/granite.rs:434— candle-transformers/src/models/granite.rs:434-444 | candle-transformers/src/models/llama.rs:503-513 | candle-transformers/src/models/llama2_c.rs:347-356 | candle-transformers/src/models/quantized_llama2_c.rs:234-243 | candle-transformers/src/models/voxtral/voxtral_llama.rs:438-448 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) candle-transformers/src/models/mixtral.rs:107— candle-transformers/src/models/mixtral.rs:107-116 | candle-transformers/src/models/recurrent_gemma.rs:135-144 | candle-transformers/src/models/stable_lm.rs:117-126 | candle-transformers/src/models/starcoder2.rs:77-86 | candle-transformers/src/models/yi.rs:108-117 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) candle-transformers/src/models/quantized_gemma3.rs:265— candle-transformers/src/models/quantized_gemma3.rs:265-437 | candle-transformers/src/models/quantized_llama.rs:371-524 | candle-transformers/src/models/quantized_phi.rs:205-270 | candle-transformers/src/models/quantized_phi3.rs:228-302 | candle-transformers/src/models/quantized_qwen2.rs:185-294 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) candle-transformers/src/models/quantized_lfm2.rs:589— candle-transformers/src/models/quantized_lfm2.rs:589-598 | candle-transformers/src/models/quantized_llama.rs:547-556 | candle-transformers/src/models/quantized_phi.rs:272-281 | candle-transformers/src/models/quantized_phi3.rs:304-313 | candle-transformers/src/models/quantized_qwen2.rs:296-305 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) candle-transformers/src/models/stable_diffusion/mod.rs:77— candle-transformers/src/models/stable_diffusion/mod.rs:77-139 | candle-transformers/src/models/stable_diffusion/mod.rs:146-209 | candle-transformers/src/models/stable_diffusion/mod.rs:230-292 | candle-transformers/src/models/stable_diffusion/mod.rs:299-364 | candle-transformers/src/models/stable_diffusion/mod.rs:398-459 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (9 lines × 3) candle-core/src/cpu_backend/mod.rs:2903— candle-core/src/cpu_backend/mod.rs:2903-2915 | candle-core/src/cuda_backend/mod.rs:1981-1993 | candle-core/src/metal_backend/mod.rs:1027-1035 — `candle-core/src/cpu_backend/mod.rs` and `candle-core/src/cuda_backend/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) candle-nn/src/rotary_emb.rs:95— candle-nn/src/rotary_emb.rs:95-103 | candle-nn/src/rotary_emb.rs:400-408 | candle-nn/src/rotary_emb.rs:674-682 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) candle-transformers/src/models/chatglm.rs:500— candle-transformers/src/models/chatglm.rs:500-508 | candle-transformers/src/models/codegeex4_9b.rs:521-529 | candle-transformers/src/models/glm4.rs:542-550 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) candle-transformers/src/models/efficientvit.rs:315— candle-transformers/src/models/efficientvit.rs:315-323 | candle-transformers/src/models/fastvit.rs:162-170 | candle-transformers/src/models/mobileone.rs:90-98 — before extracting anything, compare `candle-transformers/src/models/fastvit.rs` and `candle-transformers/src/models/mobileone.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) candle-transformers/src/models/modernbert.rs:291— candle-transformers/src/models/modernbert.rs:291-299 | candle-transformers/src/models/nvembed_v2/embedding.rs:275-283 | candle-transformers/src/models/xlm_roberta.rs:519-527 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (9 lines × 3) candle-transformers/src/models/quantized_qwen3.rs:252— candle-transformers/src/models/quantized_qwen3.rs:252-260 | candle-transformers/src/models/qwen3.rs:206-214 | candle-transformers/src/models/z_image/text_encoder.rs:285-293 — before extracting anything, compare `candle-transformers/src/models/quantized_qwen3.rs` and `candle-transformers/src/models/qwen3.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) candle-transformers/src/models/blip.rs:269— candle-transformers/src/models/blip.rs:269-277 | candle-transformers/src/models/quantized_blip.rs:230-238 | candle-transformers/src/models/trocr.rs:415-423 — before extracting anything, compare `candle-transformers/src/models/blip.rs` and `candle-transformers/src/models/quantized_blip.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) candle-nn/src/rotary_emb.rs:200— candle-nn/src/rotary_emb.rs:200-208 | candle-nn/src/rotary_emb.rs:505-513 | candle-nn/src/rotary_emb.rs:779-787 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) candle-metal-kernels/src/kernels/convolution.rs:24— candle-metal-kernels/src/kernels/convolution.rs:24-32 | candle-metal-kernels/src/kernels/convolution.rs:66-74 | candle-metal-kernels/src/kernels/convolution.rs:109-117 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) candle-core/src/quantized/k_quants.rs:958— candle-core/src/quantized/k_quants.rs:958-966 | candle-core/src/quantized/k_quants.rs:1620-1628 | candle-core/src/quantized/k_quants.rs:1901-1909 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) candle-wasm-examples/bert/src/bin/m.rs:73— candle-wasm-examples/bert/src/bin/m.rs:73-81 | candle-wasm-examples/t5/src/bin/m-quantized.rs:160-168 | candle-wasm-examples/t5/src/bin/m.rs:158-166 — before extracting anything, compare `candle-wasm-examples/t5/src/bin/m-quantized.rs` and `candle-wasm-examples/t5/src/bin/m.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) candle-core/src/cuda_backend/mod.rs:738— candle-core/src/cuda_backend/mod.rs:738-742 | candle-core/src/cuda_backend/mod.rs:784-788 | candle-core/src/cuda_backend/mod.rs:855-859 | candle-core/src/cuda_backend/mod.rs:903-907 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 4) candle-core/src/quantized/k_quants.rs:972— candle-core/src/quantized/k_quants.rs:972-976 | candle-core/src/quantized/k_quants.rs:1294-1298 | candle-core/src/quantized/k_quants.rs:1635-1639 | candle-core/src/quantized/k_quants.rs:1916-1920 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 4) candle-core/src/quantized/k_quants.rs:1602— candle-core/src/quantized/k_quants.rs:1602-1606 | candle-core/src/quantized/k_quants.rs:1668-1672 | candle-core/src/quantized/k_quants.rs:1867-1871 | candle-core/src/quantized/k_quants.rs:1949-1953 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 4) candle-core/src/quantized/neon.rs:369— candle-core/src/quantized/neon.rs:369-373 | candle-core/src/quantized/neon.rs:446-450 | candle-core/src/quantized/neon.rs:2827-2831 | candle-core/src/quantized/neon.rs:2859-2863 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 4) candle-core/src/quantized/neon.rs:690— candle-core/src/quantized/neon.rs:690-694 | candle-core/src/quantized/neon.rs:863-867 | candle-core/src/quantized/neon.rs:2981-2985 | candle-core/src/quantized/neon.rs:3123-3127 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 4) candle-transformers/src/models/granite.rs:160— candle-transformers/src/models/granite.rs:160-164 | candle-transformers/src/models/granitemoehybrid.rs:203-207 | candle-transformers/src/models/llama.rs:206-210 | candle-transformers/src/models/voxtral/voxtral_llama.rs:101-105 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) candle-transformers/src/models/quantized_rwkv_v5.rs:153— candle-transformers/src/models/quantized_rwkv_v5.rs:153-157 | candle-transformers/src/models/quantized_rwkv_v6.rs:200-204 | candle-transformers/src/models/rwkv_v5.rs:204-208 | candle-transformers/src/models/rwkv_v6.rs:178-182 — before extracting anything, compare `candle-transformers/src/models/quantized_rwkv_v5.rs` and `candle-transformers/src/models/quantized_rwkv_v6.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) candle-core/src/cuda_backend/mod.rs:753— candle-core/src/cuda_backend/mod.rs:753-757 | candle-core/src/cuda_backend/mod.rs:796-800 | candle-core/src/cuda_backend/mod.rs:867-871 | candle-core/src/cuda_backend/mod.rs:915-919 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 4) candle-nn/src/rotary_emb.rs:300— candle-nn/src/rotary_emb.rs:300-304 | candle-transformers/src/models/llama2_c.rs:159-163 | candle-transformers/src/models/quantized_llama2_c.rs:46-50 | candle-wasm-examples/llama2-c/src/model.rs:82-86 — before extracting anything, compare `candle-transformers/src/models/llama2_c.rs` and `candle-transformers/src/models/quantized_llama2_c.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) candle-transformers/src/models/flux/autoencoder.rs:51— candle-transformers/src/models/flux/autoencoder.rs:51-55 | candle-transformers/src/models/moondream.rs:59-63 | candle-transformers/src/models/quantized_moondream.rs:23-27 | candle-transformers/src/models/z_image/vae.rs:87-91 — before extracting anything, compare `candle-transformers/src/models/moondream.rs` and `candle-transformers/src/models/quantized_moondream.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
ClassTooLong: MetalStorage candle-core/src/metal_backend/mod.rs:78— ClassTooLong — 1655 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 4 methods, 3 blocks, lines 78-2019. The bar is 400 significant lines; this is 1255 over it, 4.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Tensor candle-core/src/tensor.rs:70— ClassTooLong — 1536 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 212 methods, 4 blocks, lines 47-3152. The bar is 400 significant lines; this is 1136 over it, 3.84× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CpuStorage candle-core/src/cpu_backend/mod.rs:23— ClassTooLong — 1074 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 2 methods, 3 blocks, lines 23-3155. The bar is 400 significant lines; this is 674 over it, 2.69× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CudaStorage candle-core/src/cuda_backend/mod.rs:1251— ClassTooLong — 915 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 4 methods, 3 blocks, lines 1251-2539. The bar is 400 significant lines; this is 515 over it, 2.29× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Storage candle-core/src/storage.rs:12— ClassTooLong — 606 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 36 methods, 2 blocks, lines 12-855. The bar is 400 significant lines; this is 206 over it, 1.52× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PaddleOCRVLModel candle-transformers/src/models/paddleocr_vl/mod.rs:47— ClassTooLong — 592 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods, 2 blocks, lines 47-1104. The bar is 400 significant lines; this is 192 over it, 1.48× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PyTensor candle-pyo3/src/lib.rs:34— ClassTooLong — 518 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 65 methods, 2 blocks, lines 36-1129. The bar is 400 significant lines; this is 118 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CudaDevice candle-core/src/cuda_backend/device.rs:59— ClassTooLong — 509 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 6 blocks, lines 59-815. The bar is 400 significant lines; this is 109 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: QTensor candle-core/src/quantized/mod.rs:65— ClassTooLong — 454 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods, 6 blocks, lines 65-1285. The bar is 400 significant lines; this is 54 over it, 1.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×9
Members sharing a duplicated core (6 members, 50+ identical tokens) candle-core/src/cpu/avx.rs:315— candle-core/src/cpu/avx.rs:315-332 | candle-core/src/cpu/avx.rs:355-370 | candle-core/src/cpu/neon.rs:520-537 | candle-core/src/cpu/neon.rs:560-575 | candle-core/src/cpu/simd128.rs:205-222 | candle-core/src/cpu/simd128.rs:243-258 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) candle-core/src/quantized/avx.rs:451— candle-core/src/quantized/avx.rs:451-533 | candle-core/src/quantized/avx.rs:536-646 | candle-core/src/quantized/k_quants.rs:1476-1556 | candle-core/src/quantized/k_quants.rs:1734-1821 | candle-core/src/quantized/neon.rs:3477-3559 | candle-core/src/quantized/simd128.rs:179-266 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) candle-core/src/storage.rs:383— candle-core/src/storage.rs:383-406 | candle-core/src/storage.rs:414-437 | candle-core/src/storage.rs:445-468 | candle-core/src/storage.rs:476-499 | candle-core/src/storage.rs:751-773 | candle-core/src/storage.rs:781-804 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) candle-metal-kernels/src/kernels/reduce.rs:137— candle-metal-kernels/src/kernels/reduce.rs:137-179 | candle-metal-kernels/src/kernels/reduce.rs:195-238 | candle-metal-kernels/src/kernels/reduce.rs:256-301 | candle-metal-kernels/src/kernels/reduce.rs:319-341 | candle-metal-kernels/src/kernels/reduce.rs:361-385 | candle-metal-kernels/src/kernels/reduce.rs:404-427 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) candle-nn/src/ops.rs:337— candle-nn/src/ops.rs:337-387 | candle-nn/src/ops.rs:548-608 | candle-nn/src/ops.rs:785-853 | candle-nn/src/rotary_emb.rs:114-184 | candle-nn/src/rotary_emb.rs:419-489 | candle-nn/src/rotary_emb.rs:693-763 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) candle-transformers/src/models/blip_text.rs:482— candle-transformers/src/models/blip_text.rs:482-492 | candle-transformers/src/models/marian.rs:630-641 | candle-transformers/src/models/quantized_blip_text.rs:478-488 | candle-transformers/src/models/trocr.rs:503-512 | candle-transformers/src/models/whisper/model.rs:316-343 | candle-transformers/src/models/whisper/quantized_model.rs:318-347 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) candle-transformers/src/models/granite.rs:172— candle-transformers/src/models/granite.rs:172-181 | candle-transformers/src/models/granitemoehybrid.rs:215-224 | candle-transformers/src/models/lfm2.rs:188-197 | candle-transformers/src/models/llama.rs:218-227 | candle-transformers/src/models/llama2_c.rs:123-132 | candle-transformers/src/models/voxtral/voxtral_llama.rs:113-122 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) candle-transformers/src/models/marian.rs:212— candle-transformers/src/models/marian.rs:212-232 | candle-transformers/src/models/mixtral.rs:82-100 | candle-transformers/src/models/recurrent_gemma.rs:107-128 | candle-transformers/src/models/stable_lm.rs:92-110 | candle-transformers/src/models/starcoder2.rs:52-70 | candle-transformers/src/models/yi.rs:83-101 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) candle-transformers/src/models/olmo.rs:161— candle-transformers/src/models/olmo.rs:161-221 | candle-transformers/src/models/olmo2.rs:156-209 | candle-transformers/src/models/paddleocr_vl/text.rs:837-884 | candle-transformers/src/models/phi3.rs:205-261 | candle-transformers/src/models/qwen2.rs:160-210 | candle-transformers/src/models/qwen2_moe.rs:167-217 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Duplicated block (23 lines × 2) candle-core/src/metal_backend/mod.rs:1531— candle-core/src/metal_backend/mod.rs:1531-1553 | candle-core/src/metal_backend/mod.rs:1580-1602 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) candle-core/src/quantized/neon.rs:1212— candle-core/src/quantized/neon.rs:1212-1234 | candle-core/src/quantized/neon.rs:1977-1999 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) candle-flash-attn-v3/src/lib.rs:86— candle-flash-attn-v3/src/lib.rs:86-108 | candle-flash-attn-v3/src/lib.rs:520-542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) candle-flash-attn-v3/src/lib.rs:457— candle-flash-attn-v3/src/lib.rs:457-479 | candle-flash-attn/src/lib.rs:477-499 — before extracting anything, compare `candle-flash-attn-v3/src/lib.rs` and `candle-flash-attn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) candle-transformers/src/models/quantized_t5.rs:291— candle-transformers/src/models/quantized_t5.rs:291-313 | candle-transformers/src/models/t5.rs:420-442 — before extracting anything, compare `candle-transformers/src/models/quantized_t5.rs` and `candle-transformers/src/models/t5.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 364 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) candle-transformers/src/models/quantized_t5.rs:712— candle-transformers/src/models/quantized_t5.rs:712-734 | candle-transformers/src/models/t5.rs:862-884 — before extracting anything, compare `candle-transformers/src/models/quantized_t5.rs` and `candle-transformers/src/models/t5.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 364 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) candle-transformers/src/models/qwen3_vl/mod.rs:94— candle-transformers/src/models/qwen3_vl/mod.rs:94-116 | candle-transformers/src/models/qwen3_vl/mod.rs:143-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) candle-transformers/src/models/stable_diffusion/mod.rs:78— candle-transformers/src/models/stable_diffusion/mod.rs:78-100 | candle-transformers/src/models/stable_diffusion/mod.rs:147-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) candle-transformers/src/models/whisper/audio.rs:64— candle-transformers/src/models/whisper/audio.rs:64-86 | candle-wasm-examples/whisper/src/audio.rs:58-80 — before extracting anything, compare `candle-transformers/src/models/whisper/audio.rs` and `candle-wasm-examples/whisper/src/audio.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) candle-core/src/metal_backend/mod.rs:2290— candle-core/src/metal_backend/mod.rs:2290-2308 | candle-core/src/metal_backend/mod.rs:2330-2348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) candle-core/src/quantized/fast_mmq.rs:259— candle-core/src/quantized/fast_mmq.rs:259-277 | candle-core/src/quantized/fast_mmvq.rs:170-188 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (19 lines × 2) candle-onnx/src/eval.rs:1725— candle-onnx/src/eval.rs:1725-1743 | candle-onnx/src/eval.rs:1753-1771 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) candle-transformers/src/models/bert.rs:80— candle-transformers/src/models/bert.rs:80-98 | candle-transformers/src/models/bert.rs:104-122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) candle-transformers/src/models/chinese_clip/text_model.rs:48— candle-transformers/src/models/chinese_clip/text_model.rs:48-66 | candle-transformers/src/models/chinese_clip/text_model.rs:72-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) candle-transformers/src/models/llama2_c_weights.rs:92— candle-transformers/src/models/llama2_c_weights.rs:92-110 | candle-wasm-examples/llama2-c/src/worker.rs:173-191 — before extracting anything, compare `candle-transformers/src/models/llama2_c_weights.rs` and `candle-wasm-examples/llama2-c/src/worker.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) candle-transformers/src/models/quantized_glm4.rs:218— candle-transformers/src/models/quantized_glm4.rs:218-236 | candle-transformers/src/models/quantized_qwen3_moe.rs:137-155 — before extracting anything, compare `candle-transformers/src/models/quantized_glm4.rs` and `candle-transformers/src/models/quantized_qwen3_moe.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) candle-transformers/src/models/quantized_recurrent_gemma.rs:410— candle-transformers/src/models/quantized_recurrent_gemma.rs:410-428 | candle-transformers/src/models/recurrent_gemma.rs:641-659 — before extracting anything, compare `candle-transformers/src/models/quantized_recurrent_gemma.rs` and `candle-transformers/src/models/recurrent_gemma.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) candle-transformers/src/models/stable_diffusion/attention.rs:175— candle-transformers/src/models/stable_diffusion/attention.rs:175-193 | candle-transformers/src/models/wuerstchen/attention_processor.rs:89-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Tensor::backward (cognitive 108) candle-core/src/backprop.rs:165— Tensor::backward has cognitive complexity 108 (threshold 15). Drivers by points: if/else 26 (81 pts), loops 5 (17 pts), match/switch 2 (7 pts), boolean chains 3 (nesting depth added 72). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tensor::cat_contiguous (cognitive 20) candle-core/src/tensor_cat.rs:154— Tensor::cat_contiguous has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tensor::write_bytes (cognitive 19) candle-core/src/convert.rs:102— Tensor::write_bytes has cognitive complexity 19 (threshold 15). Drivers by points: loops 9 (18 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Tensor::fmt_dt (cognitive 18) candle-core/src/display.rs:9— Tensor::fmt_dt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (5 pts), match/switch 2 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Tensor::cat0 (cognitive 17) candle-core/src/tensor_cat.rs:79— Tensor::cat0 has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tensor::sorted_nodes::walk (cognitive 16) candle-core/src/backprop.rs:38— Tensor::sorted_nodes::walk has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tensor::fmt (cognitive 16) candle-core/src/display.rs:454— Tensor::fmt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 3 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tensor::cat (cognitive 16) candle-core/src/tensor_cat.rs:21— Tensor::cat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (20 lines × 2) candle-flash-attn-v3/src/lib.rs:170— candle-flash-attn-v3/src/lib.rs:170-189 | candle-flash-attn/src/lib.rs:147-166 — before extracting anything, compare `candle-flash-attn-v3/src/lib.rs` and `candle-flash-attn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) candle-transformers/src/models/chatglm.rs:35— candle-transformers/src/models/chatglm.rs:35-54 | candle-transformers/src/models/codegeex4_9b.rs:44-63 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) candle-transformers/src/models/falcon.rs:51— candle-transformers/src/models/falcon.rs:51-70 | candle-transformers/src/models/falcon.rs:91-110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) candle-transformers/src/models/flux/model.rs:272— candle-transformers/src/models/flux/model.rs:272-291 | candle-transformers/src/models/flux/quantized_model.rs:111-130 — before extracting anything, compare `candle-transformers/src/models/flux/model.rs` and `candle-transformers/src/models/flux/quantized_model.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) candle-transformers/src/models/quantized_recurrent_gemma.rs:136— candle-transformers/src/models/quantized_recurrent_gemma.rs:136-155 | candle-transformers/src/models/recurrent_gemma.rs:369-388 — before extracting anything, compare `candle-transformers/src/models/quantized_recurrent_gemma.rs` and `candle-transformers/src/models/recurrent_gemma.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) candle-transformers/src/models/quantized_rwkv_v6.rs:137— candle-transformers/src/models/quantized_rwkv_v6.rs:137-156 | candle-transformers/src/models/rwkv_v6.rs:115-134 — before extracting anything, compare `candle-transformers/src/models/quantized_rwkv_v6.rs` and `candle-transformers/src/models/rwkv_v6.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) candle-transformers/src/models/quantized_t5.rs:224— candle-transformers/src/models/quantized_t5.rs:224-243 | candle-transformers/src/models/t5.rs:353-372 — before extracting anything, compare `candle-transformers/src/models/quantized_t5.rs` and `candle-transformers/src/models/t5.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 364 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) candle-transformers/src/object_detection.rs:39— candle-transformers/src/object_detection.rs:39-58 | candle-wasm-examples/yolo/src/model.rs:794-813 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) candle-core/src/cpu/avx.rs:336— candle-core/src/cpu/avx.rs:336-352 | candle-core/src/cpu/simd128.rs:225-241 — before extracting anything, compare `candle-core/src/cpu/avx.rs` and `candle-core/src/cpu/simd128.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) candle-metal-kernels/src/kernels/affine.rs:125— candle-metal-kernels/src/kernels/affine.rs:125-141 | candle-metal-kernels/src/kernels/affine.rs:191-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) candle-transformers/src/models/blip_text.rs:40— candle-transformers/src/models/blip_text.rs:40-56 | candle-transformers/src/models/quantized_blip_text.rs:36-52 — before extracting anything, compare `candle-transformers/src/models/blip_text.rs` and `candle-transformers/src/models/quantized_blip_text.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 215 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) candle-transformers/src/models/gemma3.rs:399— candle-transformers/src/models/gemma3.rs:399-415 | candle-transformers/src/models/gemma4/text.rs:487-503 — before extracting anything, compare `candle-transformers/src/models/gemma3.rs` and `candle-transformers/src/models/gemma4/text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) candle-transformers/src/models/quantized_t5.rs:431— candle-transformers/src/models/quantized_t5.rs:431-447 | candle-transformers/src/models/t5.rs:561-577 — before extracting anything, compare `candle-transformers/src/models/quantized_t5.rs` and `candle-transformers/src/models/t5.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 364 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) candle-metal-kernels/src/kernels/convolution.rs:287— candle-metal-kernels/src/kernels/convolution.rs:287-304 | candle-metal-kernels/src/kernels/indexing.rs:31-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17 lines × 2) candle-metal-kernels/src/kernels/convolution.rs:69— candle-metal-kernels/src/kernels/convolution.rs:69-85 | candle-metal-kernels/src/kernels/convolution.rs:155-171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) candle-wasm-examples/llama2-c/src/app.rs:161— candle-wasm-examples/llama2-c/src/app.rs:161-177 | candle-wasm-examples/yolo/src/app.rs:215-231 — before extracting anything, compare `candle-wasm-examples/llama2-c/src/app.rs` and `candle-wasm-examples/yolo/src/app.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) candle-core/src/cpu/avx.rs:336— candle-core/src/cpu/avx.rs:336-342 | candle-core/src/cpu/avx.rs:375-381 | candle-core/src/cpu/simd128.rs:225-231 | candle-core/src/cpu/simd128.rs:262-268 — before extracting anything, compare `candle-core/src/cpu/avx.rs` and `candle-core/src/cpu/simd128.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) candle-core/src/tensor.rs:676— candle-core/src/tensor.rs:676-682 | candle-core/src/tensor.rs:1974-1980 | candle-core/src/tensor.rs:2005-2011 | candle-core/src/tensor.rs:2046-2052 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) candle-transformers/src/models/convnext.rs:318— candle-transformers/src/models/convnext.rs:318-324 | candle-transformers/src/models/fastvit.rs:486-492 | candle-transformers/src/models/mobileone.rs:312-318 | candle-transformers/src/models/repvgg.rs:292-298 — before extracting anything, compare `candle-transformers/src/models/fastvit.rs` and `candle-transformers/src/models/mobileone.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) candle-transformers/src/models/gemma.rs:172— candle-transformers/src/models/gemma.rs:172-178 | candle-transformers/src/models/gemma2.rs:166-172 | candle-transformers/src/models/gemma3.rs:180-186 | candle-transformers/src/models/helium.rs:169-175 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) candle-transformers/src/models/glm4_new.rs:364— candle-transformers/src/models/glm4_new.rs:364-370 | candle-transformers/src/models/qwen3.rs:479-485 | candle-transformers/src/models/qwen3_moe.rs:334-340 | candle-transformers/src/models/smol/smollm3.rs:429-435 — before extracting anything, compare `candle-transformers/src/models/glm4_new.rs` and `candle-transformers/src/models/qwen3.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) candle-transformers/src/models/quantized_rwkv_v5.rs:142— candle-transformers/src/models/quantized_rwkv_v5.rs:142-148 | candle-transformers/src/models/quantized_rwkv_v6.rs:189-195 | candle-transformers/src/models/rwkv_v5.rs:193-199 | candle-transformers/src/models/rwkv_v6.rs:167-173 — before extracting anything, compare `candle-transformers/src/models/quantized_rwkv_v5.rs` and `candle-transformers/src/models/quantized_rwkv_v6.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) candle-transformers/src/models/glm4_new.rs:372— candle-transformers/src/models/glm4_new.rs:372-378 | candle-transformers/src/models/qwen3.rs:487-493 | candle-transformers/src/models/qwen3_moe.rs:342-348 | candle-transformers/src/models/smol/smollm3.rs:437-444 — before extracting anything, compare `candle-transformers/src/models/glm4_new.rs` and `candle-transformers/src/models/qwen3.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) candle-transformers/src/models/gemma.rs:358— candle-transformers/src/models/gemma.rs:358-364 | candle-transformers/src/models/gemma2.rs:377-383 | candle-transformers/src/models/gemma3.rs:457-463 | candle-transformers/src/models/recurrent_gemma.rs:606-612 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Focus outline removed inline candle-wasm-examples/bert/lib-example.html:308— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline candle-wasm-examples/bert/lib-example.html:328— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline candle-wasm-examples/bert/lib-example.html:354— <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline candle-wasm-examples/llama2-c/lib-example.html:229— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline candle-wasm-examples/moondream/index.html:89— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline REDACTED:432— <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline candle-wasm-examples/t5/index.html:201— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Low contrast Tailwind colour pair (4.4:1) candle-wasm-examples/bert/lib-example.html:349— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (4.4:1) candle-wasm-examples/blip/index.html:355— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (4.4:1) candle-wasm-examples/llama2-c/lib-example.html:339— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (4.4:1) candle-wasm-examples/moondream/index.html:270— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (4.4:1) REDACTED:560— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (4.4:1) candle-wasm-examples/t5/index.html:275— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (4.4:1) candle-wasm-examples/whisper/lib-example.html:341— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×7
Edited copy of a member (19 corresponding lines) candle-transformers/src/models/paddleocr_vl/text.rs:794— candle-transformers/src/models/paddleocr_vl/text.rs:794-826 | candle-transformers/src/models/qwen2.rs:160-210 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) candle-transformers/src/models/paddleocr_vl/text.rs:794— candle-transformers/src/models/paddleocr_vl/text.rs:794-826 | candle-transformers/src/models/qwen2_moe.rs:167-217 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) candle-transformers/src/models/paddleocr_vl/text.rs:794— candle-transformers/src/models/paddleocr_vl/text.rs:794-826 | candle-transformers/src/models/starcoder2.rs:163-210 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) candle-transformers/src/models/paddleocr_vl/text.rs:794— candle-transformers/src/models/paddleocr_vl/text.rs:794-826 | candle-transformers/src/models/yi.rs:199-248 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) candle-transformers/src/models/paddleocr_vl/text.rs:794— candle-transformers/src/models/paddleocr_vl/text.rs:794-826 | candle-transformers/src/models/smol/smollm3.rs:242-298 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) candle-transformers/src/models/paddleocr_vl/text.rs:794— candle-transformers/src/models/paddleocr_vl/text.rs:794-826 | candle-transformers/src/models/qwen3.rs:192-241 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) candle-transformers/src/models/paddleocr_vl/text.rs:794— candle-transformers/src/models/paddleocr_vl/text.rs:794-826 | candle-transformers/src/models/z_image/text_encoder.rs:271-318 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×7
Edited copy of a member (18 corresponding lines) candle-transformers/src/models/rwkv_v5.rs:228— candle-transformers/src/models/rwkv_v5.rs:228-245 | candle-transformers/src/models/rwkv_v6.rs:202-219 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) candle-transformers/src/models/glm4_new.rs:194— candle-transformers/src/models/glm4_new.rs:194-230 | candle-transformers/src/models/paddleocr_vl/text.rs:794-826 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) candle-transformers/src/models/qwen3.rs:192— candle-transformers/src/models/qwen3.rs:192-241 | candle-transformers/src/models/starcoder2.rs:163-210 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) candle-transformers/src/models/qwen3.rs:192— candle-transformers/src/models/qwen3.rs:192-241 | candle-transformers/src/models/yi.rs:199-248 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) candle-transformers/src/models/paddleocr_vl/text.rs:794— candle-transformers/src/models/paddleocr_vl/text.rs:794-826 | candle-transformers/src/models/quantized_qwen3.rs:238-378 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) candle-transformers/src/models/paddleocr_vl/text.rs:794— candle-transformers/src/models/paddleocr_vl/text.rs:794-826 | candle-transformers/src/models/paddleocr_vl/text.rs:893-990 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) candle-transformers/src/models/paddleocr_vl/text.rs:893— candle-transformers/src/models/paddleocr_vl/text.rs:893-990 | candle-transformers/src/models/qwen3.rs:192-241 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (18 lines × 2) candle-core/src/cpu/avx.rs:295— candle-core/src/cpu/avx.rs:295-312 | candle-core/src/cpu/neon.rs:501-518 — before extracting anything, compare `candle-core/src/cpu/avx.rs` and `candle-core/src/cpu/neon.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) candle-core/src/cpu/avx.rs:374— candle-core/src/cpu/avx.rs:374-391 | candle-core/src/cpu/simd128.rs:261-278 — before extracting anything, compare `candle-core/src/cpu/avx.rs` and `candle-core/src/cpu/simd128.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) candle-core/src/cpu_backend/mod.rs:1590— candle-core/src/cpu_backend/mod.rs:1590-1607 | candle-core/src/cpu_backend/mod.rs:1708-1725 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) candle-transformers/src/models/flux/model.rs:422— candle-transformers/src/models/flux/model.rs:422-439 | candle-transformers/src/models/flux/quantized_model.rs:261-278 — before extracting anything, compare `candle-transformers/src/models/flux/model.rs` and `candle-transformers/src/models/flux/quantized_model.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) candle-transformers/src/models/quantized_recurrent_gemma.rs:223— candle-transformers/src/models/quantized_recurrent_gemma.rs:223-240 | candle-transformers/src/models/recurrent_gemma.rs:456-473 — before extracting anything, compare `candle-transformers/src/models/quantized_recurrent_gemma.rs` and `candle-transformers/src/models/recurrent_gemma.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) candle-transformers/src/models/quantized_recurrent_gemma.rs:315— candle-transformers/src/models/quantized_recurrent_gemma.rs:315-332 | candle-transformers/src/models/recurrent_gemma.rs:548-565 — before extracting anything, compare `candle-transformers/src/models/quantized_recurrent_gemma.rs` and `candle-transformers/src/models/recurrent_gemma.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) candle-examples/src/chat_template.rs:337— candle-examples/src/chat_template.rs:337-354 | candle-wasm-examples/chat-template/src/lib.rs:459-476 — before extracting anything, compare `candle-examples/src/chat_template.rs` and `candle-wasm-examples/chat-template/src/lib.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 2) candle-core/src/cuda_backend/mod.rs:1862— candle-core/src/cuda_backend/mod.rs:1862-1871 | candle-core/src/cuda_backend/mod.rs:2045-2055 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) candle-core/src/quantized/k_quants.rs:1477— candle-core/src/quantized/k_quants.rs:1477-1487 | candle-core/src/quantized/simd128.rs:180-189 — before extracting anything, compare `candle-core/src/quantized/k_quants.rs` and `candle-core/src/quantized/simd128.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 2) candle-core/src/quantized/k_quants.rs:1570— candle-core/src/quantized/k_quants.rs:1570-1580 | candle-core/src/quantized/k_quants.rs:1836-1845 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) candle-nn/src/ops.rs:576— candle-nn/src/ops.rs:576-585 | candle-nn/src/ops.rs:819-829 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) candle-transformers/src/models/mobileone.rs:203— candle-transformers/src/models/mobileone.rs:203-212 | candle-transformers/src/models/repvgg.rs:201-211 — before extracting anything, compare `candle-transformers/src/models/mobileone.rs` and `candle-transformers/src/models/repvgg.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 2) candle-transformers/src/models/paddleocr_vl/text.rs:294— candle-transformers/src/models/paddleocr_vl/text.rs:294-303 | candle-transformers/src/models/paddleocr_vl/text.rs:429-439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) candle-transformers/src/models/quantized_gemma3.rs:315— candle-transformers/src/models/quantized_gemma3.rs:315-325 | candle-transformers/src/models/quantized_llama.rs:431-440 — before extracting anything, compare `candle-transformers/src/models/quantized_gemma3.rs` and `candle-transformers/src/models/quantized_llama.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) candle-core/src/quantized/cuda.rs:717— candle-core/src/quantized/cuda.rs:717-725 | candle-core/src/quantized/cuda.rs:745-753 | candle-core/src/quantized/cuda.rs:774-782 | candle-core/src/quantized/cuda.rs:798-806 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) candle-core/src/quantized/k_quants.rs:1582— candle-core/src/quantized/k_quants.rs:1582-1590 | candle-core/src/quantized/k_quants.rs:1649-1657 | candle-core/src/quantized/k_quants.rs:1847-1855 | candle-core/src/quantized/k_quants.rs:1930-1938 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) candle-core/src/quantized/neon.rs:1579— candle-core/src/quantized/neon.rs:1579-1587 | candle-core/src/quantized/neon.rs:1696-1704 | candle-core/src/quantized/neon.rs:2311-2319 | candle-core/src/quantized/neon.rs:2448-2456 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) candle-nn/src/attention/cpu_flash/standard.rs:194— candle-nn/src/attention/cpu_flash/standard.rs:194-202 | candle-nn/src/attention/cpu_flash/standard.rs:295-303 | candle-nn/src/attention/cpu_flash/standard.rs:370-378 | candle-nn/src/attention/cpu_flash/standard.rs:477-485 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) candle-nn/src/ops.rs:798— candle-nn/src/ops.rs:798-806 | candle-nn/src/rotary_emb.rs:122-130 | candle-nn/src/rotary_emb.rs:427-435 | candle-nn/src/rotary_emb.rs:701-709 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 4) candle-transformers/src/models/based.rs:562— candle-transformers/src/models/based.rs:562-570 | candle-transformers/src/models/olmo.rs:321-329 | candle-transformers/src/models/olmo2.rs:316-324 | candle-transformers/src/models/qwen2.rs:316-324 — before extracting anything, compare `candle-transformers/src/models/based.rs` and `candle-transformers/src/models/olmo.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) candle-transformers/src/models/granite.rs:323— candle-transformers/src/models/granite.rs:323-331 | candle-transformers/src/models/granitemoehybrid.rs:373-381 | candle-transformers/src/models/llama.rs:370-378 | candle-transformers/src/models/voxtral/voxtral_llama.rs:294-302 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) candle-nn/src/ops.rs:832— candle-nn/src/ops.rs:832-837 | candle-nn/src/rotary_emb.rs:152-157 | candle-nn/src/rotary_emb.rs:457-462 | candle-nn/src/rotary_emb.rs:731-736 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 4) candle-transformers/src/models/granite.rs:297— candle-transformers/src/models/granite.rs:297-302 | candle-transformers/src/models/granitemoehybrid.rs:347-352 | candle-transformers/src/models/llama2_c.rs:204-209 | candle-transformers/src/models/quantized_llama2_c.rs:91-96 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) candle-transformers/src/models/helium.rs:70— candle-transformers/src/models/helium.rs:70-75 | candle-transformers/src/models/mistral.rs:121-126 | candle-transformers/src/models/nvembed_v2/embedding.rs:21-26 | candle-transformers/src/models/quantized_mistral.rs:36-41 — before extracting anything, compare `candle-transformers/src/models/helium.rs` and `candle-transformers/src/models/mistral.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) candle-transformers/src/models/quantized_qwen3.rs:438— candle-transformers/src/models/quantized_qwen3.rs:438-443 | candle-transformers/src/models/qwen3.rs:387-392 | candle-transformers/src/models/smol/smollm3.rs:338-343 | candle-transformers/src/models/z_image/text_encoder.rs:351-356 — before extracting anything, compare `candle-transformers/src/models/quantized_qwen3.rs` and `candle-transformers/src/models/qwen3.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) candle-transformers/src/models/deepseek2.rs:354— candle-transformers/src/models/deepseek2.rs:354-360 | candle-transformers/src/models/gemma4/text.rs:131-136 | candle-transformers/src/models/paddleocr_vl/text.rs:50-55 | candle-transformers/src/models/qwen3_vl/text.rs:34-39 — before extracting anything, compare `candle-transformers/src/models/deepseek2.rs` and `candle-transformers/src/models/paddleocr_vl/text.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) candle-onnx/src/eval.rs:1320— candle-onnx/src/eval.rs:1320-1325 | candle-onnx/src/eval.rs:1429-1434 | candle-onnx/src/eval.rs:1607-1613 | candle-onnx/src/eval.rs:1640-1646 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 4) candle-core/src/cuda_backend/mod.rs:523— candle-core/src/cuda_backend/mod.rs:523-528 | candle-core/src/cuda_backend/mod.rs:578-583 | candle-core/src/cuda_backend/mod.rs:632-637 | candle-core/src/cuda_backend/mod.rs:684-689 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
AC1 · Text alternatives· <canvas> without a text alternative · ×6
<canvas> without a text alternative candle-wasm-examples/blip/index.html:348— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative candle-wasm-examples/moondream/index.html:261— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative candle-wasm-examples/segment-anything/lib-example.html:532— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative candle-wasm-examples/segment-anything/lib-example.html:533— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative candle-wasm-examples/yolo/lib-example.html:457— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative candle-wasm-examples/yolo/lib-example.html:461— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×6
Members sharing a duplicated core (7 members, 50+ identical tokens) candle-metal-kernels/src/kernels/affine.rs:20— candle-metal-kernels/src/kernels/affine.rs:20-35 | candle-metal-kernels/src/kernels/affine.rs:88-103 | candle-metal-kernels/src/kernels/affine.rs:154-169 | candle-metal-kernels/src/kernels/binary.rs:22-39 | candle-metal-kernels/src/kernels/cast.rs:18-33 | candle-metal-kernels/src/kernels/ternary.rs:26-65 | candle-metal-kernels/src/kernels/unary.rs:25-40 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) candle-nn/src/rotary_emb.rs:583— candle-nn/src/rotary_emb.rs:583-588 | candle-transformers/src/models/mixtral.rs:74-79 | candle-transformers/src/models/paddleocr_vl/vision.rs:278-283 | candle-transformers/src/models/qwen3_vl/vision.rs:83-88 | candle-transformers/src/models/recurrent_gemma.rs:99-104 | candle-transformers/src/models/starcoder2.rs:44-49 | candle-transformers/src/models/yi.rs:75-80 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) candle-transformers/src/models/glm4_new.rs:194— candle-transformers/src/models/glm4_new.rs:194-230 | candle-transformers/src/models/quantized_glm4.rs:211-277 | candle-transformers/src/models/quantized_qwen3.rs:238-378 | candle-transformers/src/models/quantized_qwen3_moe.rs:130-219 | candle-transformers/src/models/qwen3.rs:334-352 | candle-transformers/src/models/smol/smollm3.rs:242-298 | candle-transformers/src/models/z_image/text_encoder.rs:271-318 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) candle-transformers/src/models/granite.rs:315— candle-transformers/src/models/granite.rs:315-338 | candle-transformers/src/models/granitemoehybrid.rs:365-389 | candle-transformers/src/models/llama.rs:362-385 | candle-transformers/src/models/llama2_c.rs:231-248 | candle-transformers/src/models/quantized_llama2_c.rs:118-135 | candle-transformers/src/models/voxtral/voxtral_llama.rs:280-309 | candle-wasm-examples/llama2-c/src/model.rs:145-163 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) candle-transformers/src/models/marian.rs:36— candle-transformers/src/models/marian.rs:36-58 | candle-transformers/src/models/marian.rs:61-83 | candle-transformers/src/models/marian.rs:85-107 | candle-transformers/src/models/marian.rs:109-131 | candle-transformers/src/models/marian.rs:133-155 | candle-transformers/src/models/marian.rs:157-179 | candle-transformers/src/models/marian.rs:181-203 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) candle-transformers/src/models/mistral.rs:218— candle-transformers/src/models/mistral.rs:218-241 | candle-transformers/src/models/mixtral.rs:152-176 | candle-transformers/src/models/nvembed_v2/embedding.rs:101-123 | candle-transformers/src/models/quantized_mistral.rs:117-140 | candle-transformers/src/models/qwen2.rs:130-153 | candle-transformers/src/models/qwen2_moe.rs:137-160 | candle-transformers/src/models/yi.rs:169-192 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Duplicated block (21 lines × 2) candle-core/src/cpu_backend/mod.rs:1554— candle-core/src/cpu_backend/mod.rs:1554-1574 | candle-core/src/cpu_backend/mod.rs:1645-1665 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) candle-core/src/metal_backend/mod.rs:1283— candle-core/src/metal_backend/mod.rs:1283-1303 | candle-core/src/metal_backend/mod.rs:1330-1350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) candle-transformers/src/models/qwen3_vl/mod.rs:118— candle-transformers/src/models/qwen3_vl/mod.rs:118-138 | candle-transformers/src/models/qwen3_vl/mod.rs:167-187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) candle-transformers/src/models/whisper/model.rs:111— candle-transformers/src/models/whisper/model.rs:111-131 | candle-transformers/src/models/whisper/quantized_model.rs:108-128 — before extracting anything, compare `candle-transformers/src/models/whisper/model.rs` and `candle-transformers/src/models/whisper/quantized_model.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) candle-transformers/src/models/whisper/model.rs:241— candle-transformers/src/models/whisper/model.rs:241-261 | candle-transformers/src/models/whisper/quantized_model.rs:237-257 — before extracting anything, compare `candle-transformers/src/models/whisper/model.rs` and `candle-transformers/src/models/whisper/quantized_model.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) candle-metal-kernels/src/kernels/quantized.rs:148— candle-metal-kernels/src/kernels/quantized.rs:148-168 | candle-metal-kernels/src/kernels/quantized.rs:254-275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 5) candle-core/src/cpu_backend/mod.rs:3018— candle-core/src/cpu_backend/mod.rs:3018-3022 | candle-core/src/cpu_backend/mod.rs:3025-3029 | candle-core/src/cpu_backend/mod.rs:3032-3036 | candle-core/src/cpu_backend/mod.rs:3039-3043 | candle-core/src/cpu_backend/mod.rs:3046-3050 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 5) candle-core/src/cuda_backend/mod.rs:153— candle-core/src/cuda_backend/mod.rs:153-157 | candle-core/src/cuda_backend/mod.rs:184-188 | candle-core/src/cuda_backend/mod.rs:315-319 | candle-core/src/cuda_backend/mod.rs:496-500 | candle-core/src/cuda_backend/mod.rs:1129-1133 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 5) candle-nn/src/ops.rs:588— candle-nn/src/ops.rs:588-592 | candle-nn/src/ops.rs:832-836 | candle-nn/src/rotary_emb.rs:152-156 | candle-nn/src/rotary_emb.rs:457-461 | candle-nn/src/rotary_emb.rs:731-735 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 5) candle-transformers/src/models/granite.rs:154— candle-transformers/src/models/granite.rs:154-158 | candle-transformers/src/models/granitemoehybrid.rs:197-201 | candle-transformers/src/models/lfm2.rs:167-171 | candle-transformers/src/models/llama.rs:198-202 | candle-transformers/src/models/voxtral/voxtral_llama.rs:93-97 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 5) candle-transformers/src/models/granite.rs:290— candle-transformers/src/models/granite.rs:290-294 | candle-transformers/src/models/granitemoehybrid.rs:338-342 | candle-transformers/src/models/lfm2.rs:383-387 | candle-transformers/src/models/llama.rs:336-340 | candle-transformers/src/models/voxtral/voxtral_llama.rs:250-254 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 5) candle-transformers/src/models/quantized_lfm2.rs:91— candle-transformers/src/models/quantized_lfm2.rs:91-95 | candle-transformers/src/models/quantized_llama.rs:171-175 | candle-transformers/src/models/quantized_phi.rs:87-91 | candle-transformers/src/models/quantized_phi3.rs:92-96 | candle-transformers/src/models/quantized_qwen2.rs:64-68 — before extracting anything, compare `candle-transformers/src/models/quantized_lfm2.rs` and `candle-transformers/src/models/quantized_llama.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
candle_core::quantized::utils::make_qx_quants (cyclomatic 36) candle-core/src/quantized/utils.rs:62— candle_core::quantized::utils::make_qx_quants has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
candle_core::cuda_backend::gemm_config (cyclomatic 27) candle-core/src/cuda_backend/mod.rs:1402— candle_core::cuda_backend::gemm_config has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
candle_core::quantized::utils::make_qkx3_quants (cyclomatic 21) candle-core/src/quantized/utils.rs:356— candle_core::quantized::utils::make_qkx3_quants has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
candle_core::cpu_backend::conv2d::conv2d_tiled (cyclomatic 19) candle-core/src/cpu_backend/conv2d.rs:126— candle_core::cpu_backend::conv2d::conv2d_tiled has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
candle_core::quantized::repack::try_indexed_gemv (cyclomatic 17) candle-core/src/quantized/repack.rs:989— candle_core::quantized::repack::try_indexed_gemv has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×5
Edited copy of a member (17 corresponding lines) candle-transformers/src/models/flux/model.rs:476— candle-transformers/src/models/flux/model.rs:476-492 | candle-transformers/src/models/flux/quantized_model.rs:315-331 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) candle-transformers/src/models/paddleocr_vl/text.rs:794— candle-transformers/src/models/paddleocr_vl/text.rs:794-826 | candle-transformers/src/models/quantized_stable_lm.rs:117-177 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) candle-transformers/src/models/paddleocr_vl/text.rs:794— candle-transformers/src/models/paddleocr_vl/text.rs:794-826 | candle-transformers/src/models/stable_lm.rs:240-307 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) candle-core/src/cpu/avx.rs:125— candle-core/src/cpu/avx.rs:125-141 | candle-core/src/cpu/avx.rs:202-218 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) candle-transformers/src/models/qwen3.rs:192— candle-transformers/src/models/qwen3.rs:192-241 | candle-transformers/src/models/stable_lm.rs:240-307 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (24 lines × 2) candle-core/src/quantized/cuda.rs:140— candle-core/src/quantized/cuda.rs:140-163 | candle-core/src/quantized/cuda.rs:200-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) candle-core/src/quantized/k_quants.rs:932— candle-core/src/quantized/k_quants.rs:932-955 | candle-core/src/quantized/k_quants.rs:991-1014 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) candle-transformers/src/models/codegeex4_9b.rs:224— candle-transformers/src/models/codegeex4_9b.rs:224-247 | candle-transformers/src/models/glm4.rs:245-268 — before extracting anything, compare `candle-transformers/src/models/codegeex4_9b.rs` and `candle-transformers/src/models/glm4.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 443 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (24 lines × 2) candle-transformers/src/models/gemma2.rs:301— candle-transformers/src/models/gemma2.rs:301-324 | candle-transformers/src/models/gemma3.rs:340-363 — before extracting anything, compare `candle-transformers/src/models/gemma2.rs` and `candle-transformers/src/models/gemma3.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (24 lines × 2) candle-transformers/src/models/quantized_t5.rs:330— candle-transformers/src/models/quantized_t5.rs:330-353 | candle-transformers/src/models/t5.rs:459-482 — before extracting anything, compare `candle-transformers/src/models/quantized_t5.rs` and `candle-transformers/src/models/t5.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 364 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (22 lines × 2) candle-core/src/quantized/neon.rs:1095— candle-core/src/quantized/neon.rs:1095-1116 | candle-core/src/quantized/neon.rs:1549-1570 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) candle-transformers/src/models/blip_text.rs:80— candle-transformers/src/models/blip_text.rs:80-101 | candle-transformers/src/models/quantized_blip_text.rs:76-97 — before extracting anything, compare `candle-transformers/src/models/blip_text.rs` and `candle-transformers/src/models/quantized_blip_text.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 215 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (22 lines × 2) candle-transformers/src/models/codegeex4_9b.rs:169— candle-transformers/src/models/codegeex4_9b.rs:169-190 | candle-transformers/src/models/glm4.rs:190-211 — before extracting anything, compare `candle-transformers/src/models/codegeex4_9b.rs` and `candle-transformers/src/models/glm4.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 443 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (22 lines × 2) candle-transformers/src/models/flux/model.rs:556— candle-transformers/src/models/flux/model.rs:556-577 | candle-transformers/src/models/flux/quantized_model.rs:395-416 — before extracting anything, compare `candle-transformers/src/models/flux/model.rs` and `candle-transformers/src/models/flux/quantized_model.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (22 lines × 2) candle-transformers/src/models/gemma4/text.rs:425— candle-transformers/src/models/gemma4/text.rs:425-446 | candle-transformers/src/models/gemma4/vision.rs:328-349 — before extracting anything, compare `candle-transformers/src/models/gemma4/text.rs` and `candle-transformers/src/models/gemma4/vision.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) candle-core/src/quantized/neon.rs:1087— candle-core/src/quantized/neon.rs:1087-1098 | candle-core/src/quantized/neon.rs:1541-1552 | candle-core/src/quantized/neon.rs:2257-2268 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) candle-transformers/src/models/dinov2.rs:201— candle-transformers/src/models/dinov2.rs:201-212 | candle-transformers/src/models/dinov2reg4.rs:194-205 | candle-transformers/src/models/eva2.rs:234-245 — before extracting anything, compare `candle-transformers/src/models/dinov2.rs` and `candle-transformers/src/models/dinov2reg4.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) candle-transformers/src/models/gemma3.rs:414— candle-transformers/src/models/gemma3.rs:414-425 | candle-transformers/src/models/gemma4/text.rs:502-513 | candle-transformers/src/models/quantized_gemma3.rs:167-178 — before extracting anything, compare `candle-transformers/src/models/gemma3.rs` and `candle-transformers/src/models/gemma4/text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) candle-transformers/src/models/llama2_c.rs:218— candle-transformers/src/models/llama2_c.rs:218-229 | candle-transformers/src/models/quantized_llama2_c.rs:105-116 | candle-wasm-examples/llama2-c/src/model.rs:132-143 — before extracting anything, compare `candle-transformers/src/models/llama2_c.rs` and `candle-transformers/src/models/quantized_llama2_c.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) candle-transformers/src/models/mixtral.rs:445— candle-transformers/src/models/mixtral.rs:445-456 | candle-transformers/src/models/qwen2.rs:304-315 | candle-transformers/src/models/qwen2_moe.rs:440-451 — before extracting anything, compare `candle-transformers/src/models/mixtral.rs` and `candle-transformers/src/models/qwen2.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) candle-nn/src/attention/cpu_flash/causal.rs:227— candle-nn/src/attention/cpu_flash/causal.rs:227-236 | candle-nn/src/attention/cpu_flash/causal.rs:320-329 | candle-nn/src/attention/cpu_flash/causal.rs:614-623 | candle-nn/src/attention/cpu_flash/causal.rs:728-737 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) candle-transformers/src/models/paddleocr_vl/mod.rs:543— candle-transformers/src/models/paddleocr_vl/mod.rs:543-552 | candle-transformers/src/models/paddleocr_vl/mod.rs:604-613 | candle-transformers/src/models/paddleocr_vl/mod.rs:668-677 | candle-transformers/src/models/paddleocr_vl/mod.rs:874-883 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) candle-transformers/src/models/quantized_rwkv_v5.rs:246— candle-transformers/src/models/quantized_rwkv_v5.rs:246-255 | candle-transformers/src/models/quantized_rwkv_v6.rs:293-302 | candle-transformers/src/models/rwkv_v5.rs:293-302 | candle-transformers/src/models/rwkv_v6.rs:267-276 — before extracting anything, compare `candle-transformers/src/models/quantized_rwkv_v5.rs` and `candle-transformers/src/models/quantized_rwkv_v6.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) candle-transformers/src/models/quantized_rwkv_v5.rs:293— candle-transformers/src/models/quantized_rwkv_v5.rs:293-302 | candle-transformers/src/models/quantized_rwkv_v6.rs:340-349 | candle-transformers/src/models/rwkv_v5.rs:340-349 | candle-transformers/src/models/rwkv_v6.rs:314-323 — before extracting anything, compare `candle-transformers/src/models/quantized_rwkv_v5.rs` and `candle-transformers/src/models/quantized_rwkv_v6.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) candle-metal-kernels/src/kernels/convolution.rs:153— candle-metal-kernels/src/kernels/convolution.rs:153-162 | candle-metal-kernels/src/kernels/convolution.rs:194-204 | candle-metal-kernels/src/kernels/convolution.rs:240-249 | candle-metal-kernels/src/kernels/convolution.rs:287-299 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–10 lines × 2) candle-core/src/display.rs:271— candle-core/src/display.rs:271-279 | candle-core/src/display.rs:282-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) candle-transformers/src/models/chinese_clip/vision_model.rs:361— candle-transformers/src/models/chinese_clip/vision_model.rs:361-370 | candle-transformers/src/models/clip/vision_model.rs:148-156 — `candle-transformers/src/models/chinese_clip/vision_model.rs` and `candle-transformers/src/models/clip/vision_model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 32 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9–10 lines × 2) candle-transformers/src/models/mixtral.rs:337— candle-transformers/src/models/mixtral.rs:337-345 | candle-transformers/src/models/quantized_llama.rs:120-129 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9–10 lines × 2) candle-transformers/src/models/paddleocr_vl/vision.rs:523— candle-transformers/src/models/paddleocr_vl/vision.rs:523-532 | candle-transformers/src/models/qwen3_vl/vision.rs:144-152 — `candle-transformers/src/models/paddleocr_vl/vision.rs` and `candle-transformers/src/models/qwen3_vl/vision.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 11 separate duplicated blocks between them, totalling at least 77 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9–10 lines × 2) candle-transformers/src/models/rwkv_v7.rs:933— candle-transformers/src/models/rwkv_v7.rs:933-941 | candle-transformers/src/models/rwkv_v7.rs:993-1002 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 6) candle-core/src/cpu/avx.rs:316— candle-core/src/cpu/avx.rs:316-321 | candle-core/src/cpu/avx.rs:357-361 | candle-core/src/cpu/neon.rs:521-526 | candle-core/src/cpu/neon.rs:562-566 | candle-core/src/cpu/simd128.rs:206-211 | candle-core/src/cpu/simd128.rs:245-249 — before extracting anything, compare `candle-core/src/cpu/avx.rs` and `candle-core/src/cpu/neon.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 6) candle-transformers/src/models/granite.rs:249— candle-transformers/src/models/granite.rs:249-253 | candle-transformers/src/models/granitemoehybrid.rs:298-302 | candle-transformers/src/models/llama.rs:295-299 | candle-transformers/src/models/llama2_c.rs:184-188 | candle-transformers/src/models/quantized_llama2_c.rs:71-75 | candle-transformers/src/models/voxtral/voxtral_llama.rs:209-213 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 6) candle-transformers/src/models/helium.rs:71— candle-transformers/src/models/helium.rs:71-75 | candle-transformers/src/models/mimi/transformer.rs:59-63 | candle-transformers/src/models/mistral.rs:122-126 | candle-transformers/src/models/nvembed_v2/embedding.rs:22-26 | candle-transformers/src/models/quantized_mistral.rs:37-41 | candle-transformers/src/models/qwen3_vl/text.rs:25-29 — before extracting anything, compare `candle-transformers/src/models/helium.rs` and `candle-transformers/src/models/mistral.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 6) candle-transformers/src/models/lfm2.rs:329— candle-transformers/src/models/lfm2.rs:329-333 | candle-transformers/src/models/paddleocr_vl/text.rs:897-902 | candle-transformers/src/models/quantized_glm4.rs:213-217 | candle-transformers/src/models/quantized_qwen3.rs:240-245 | candle-transformers/src/models/quantized_stable_lm.rs:119-123 | candle-transformers/src/models/stable_lm.rs:242-246 — before extracting anything, compare `candle-transformers/src/models/paddleocr_vl/text.rs` and `candle-transformers/src/models/quantized_qwen3.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 6) candle-onnx/src/eval.rs:341— candle-onnx/src/eval.rs:341-345 | candle-onnx/src/eval.rs:347-351 | candle-onnx/src/eval.rs:353-357 | candle-onnx/src/eval.rs:813-818 | candle-onnx/src/eval.rs:821-826 | candle-onnx/src/eval.rs:829-834 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
X15 · Unvalidated length from an untrusted reader· Length read from the parsed input is spent without ever being bounded · ×5
Length read from the parsed input is spent without ever being bounded candle-core/src/pickle.rs:484— `len` is read from the bytes being parsed at line 483 (`read_u32`), then used to size a `vec![…; n]` at line 484 — and nowhere in its scope is `len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded candle-core/src/quantized/ggml_file.rs:111— `len` is read from the bytes being parsed at line 110 (`read_u32`), then used to size a `vec![…; n]` at line 111 — and nowhere in its scope is `len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded candle-core/src/quantized/ggml_file.rs:200— `n_dims` is read from the bytes being parsed at line 196 (`read_u32`), then used to size a `vec![…; n]` at line 200 — and nowhere in its scope is `n_dims` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `n_dims` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded candle-core/src/quantized/ggml_file.rs:205— `name_len` is read from the bytes being parsed at line 197 (`read_u32`), then used to size a `vec![…; n]` at line 205 — and nowhere in its scope is `name_len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `name_len` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded candle-core/src/quantized/imatrix_file.rs:51— `len` is read from the bytes being parsed at line 42 (`read_i32`), then used to size a `vec![…; n]` at line 51 — and nowhere in its scope is `len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` against the bytes actually remaining and a maximum the format allows before allocating.
XxxComment candle-onnx/src/eval.rs:1871— // XXX: depends on layout — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment candle-onnx/src/eval.rs:2081— // XXX: depends on layout — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment candle-core/src/safetensors.rs:125— // XXX: We need to specify `T` here, otherwise the compiler will infer u8 because of the following cast — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment candle-core/src/safetensors.rs:156— // XXX: We need to specify `T` here, otherwise the compiler will infer u8 because of the following cast — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
BlockQ3K::from_float (cognitive 45) candle-core/src/quantized/k_quants.rs:1197— BlockQ3K::from_float has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 9 (21 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlockQ3K::vec_dot_unopt (cognitive 42) candle-core/src/quantized/k_quants.rs:1075— BlockQ3K::vec_dot_unopt has cognitive complexity 42 (threshold 15). Drivers by points: loops 9 (26 pts), if/else 8 (16 pts) (nesting depth added 25). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BlockQ3K::from_float_imatrix (cognitive 38) candle-core/src/quantized/k_quants.rs:1279— BlockQ3K::from_float_imatrix has cognitive complexity 38 (threshold 15). Drivers by points: loops 9 (21 pts), if/else 7 (17 pts) (nesting depth added 22). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BlockQ3K::to_float (cognitive 22) candle-core/src/quantized/k_quants.rs:1378— BlockQ3K::to_float has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 2 (7 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BlockQ5K::vec_dot_unopt (cognitive 36) candle-core/src/quantized/k_quants.rs:1734— BlockQ5K::vec_dot_unopt has cognitive complexity 36 (threshold 15). Drivers by points: loops 10 (26 pts), if/else 4 (10 pts) (nesting depth added 22). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BlockQ5K::from_float (cognitive 36) candle-core/src/quantized/k_quants.rs:1824— BlockQ5K::from_float has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 7 (15 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlockQ5K::from_float_imatrix (cognitive 34) candle-core/src/quantized/k_quants.rs:1900— BlockQ5K::from_float_imatrix has cognitive complexity 34 (threshold 15). Drivers by points: loops 8 (19 pts), if/else 5 (15 pts) (nesting depth added 21). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BlockQ5K::to_float (cognitive 19) candle-core/src/quantized/k_quants.rs:1984— BlockQ5K::to_float has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (9 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyMethods: Tensor candle-core/src/tensor.rs:70— TooManyMethods — 212 methods, declared across 12 files: src/tensor.rs (164), src/custom_op.rs (13), src/conv.rs (9), src/npy.rs (7), +8 more file(s). The bar is 30 methods; this is 182 over it, 7.07× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PyTensor candle-pyo3/src/lib.rs:34— TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Storage candle-core/src/storage.rs:12— TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Module candle-pyo3/py_src/candle/nn/module.py:31— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (26 lines × 2) candle-core/src/quantized/k_quants.rs:1873— candle-core/src/quantized/k_quants.rs:1873-1898 | candle-core/src/quantized/k_quants.rs:1956-1981 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) candle-transformers/src/models/quantized_t5.rs:88— candle-transformers/src/models/quantized_t5.rs:88-113 | candle-transformers/src/models/t5.rs:186-211 — before extracting anything, compare `candle-transformers/src/models/quantized_t5.rs` and `candle-transformers/src/models/t5.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 364 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (26 lines × 2) candle-transformers/src/models/stable_diffusion/unet_2d_blocks.rs:605— candle-transformers/src/models/stable_diffusion/unet_2d_blocks.rs:605-630 | candle-transformers/src/models/stable_diffusion/unet_2d_blocks.rs:812-837 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) candle-transformers/src/models/whisper/model.rs:67— candle-transformers/src/models/whisper/model.rs:67-92 | candle-transformers/src/models/whisper/quantized_model.rs:64-89 — before extracting anything, compare `candle-transformers/src/models/whisper/model.rs` and `candle-transformers/src/models/whisper/quantized_model.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 2) candle-metal-kernels/src/kernels/reduce.rs:40— candle-metal-kernels/src/kernels/reduce.rs:40-64 | candle-metal-kernels/src/kernels/reduce.rs:100-124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2) candle-transformers/src/models/bert.rs:156— candle-transformers/src/models/bert.rs:156-180 | candle-transformers/src/models/xlm_roberta.rs:35-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (25 lines × 2) candle-transformers/src/models/quantized_t5.rs:574— candle-transformers/src/models/quantized_t5.rs:574-598 | candle-transformers/src/models/t5.rs:704-728 — before extracting anything, compare `candle-transformers/src/models/quantized_t5.rs` and `candle-transformers/src/models/t5.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 364 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 2) candle-transformers/src/models/quantized_t5.rs:760— candle-transformers/src/models/quantized_t5.rs:760-784 | candle-transformers/src/models/t5.rs:914-938 — before extracting anything, compare `candle-transformers/src/models/quantized_t5.rs` and `candle-transformers/src/models/t5.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 364 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 3) candle-core/src/quantized/fast_mmvq.rs:237— candle-core/src/quantized/fast_mmvq.rs:237-252 | candle-core/src/quantized/fast_mmvq.rs:271-286 | candle-core/src/quantized/fast_mmvq.rs:305-320 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 3) candle-flash-attn-v3/src/lib.rs:50— candle-flash-attn-v3/src/lib.rs:50-65 | candle-flash-attn-v3/src/lib.rs:484-499 | candle-flash-attn/src/lib.rs:41-56 — before extracting anything, compare `candle-flash-attn-v3/src/lib.rs` and `candle-flash-attn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 3) candle-transformers/src/models/beit.rs:320— candle-transformers/src/models/beit.rs:320-335 | candle-transformers/src/models/dinov2.rs:307-322 | candle-transformers/src/models/eva2.rs:348-363 — before extracting anything, compare `candle-transformers/src/models/beit.rs` and `candle-transformers/src/models/dinov2.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 3) candle-transformers/src/models/mistral.rs:49— candle-transformers/src/models/mistral.rs:49-64 | candle-transformers/src/models/mistral.rs:69-84 | candle-transformers/src/models/mistral.rs:88-103 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) candle-core/src/cpu/avx.rs:223— candle-core/src/cpu/avx.rs:223-236 | candle-core/src/cpu/neon.rs:432-445 | candle-core/src/cpu/simd128.rs:170-183 — before extracting anything, compare `candle-core/src/cpu/avx.rs` and `candle-core/src/cpu/neon.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) candle-core/src/quantized/simd128.rs:308— candle-core/src/quantized/simd128.rs:308-321 | candle-core/src/quantized/simd128.rs:326-339 | candle-core/src/quantized/simd128.rs:345-358 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) candle-nn/src/rotary_emb.rs:171— candle-nn/src/rotary_emb.rs:171-184 | candle-nn/src/rotary_emb.rs:476-489 | candle-nn/src/rotary_emb.rs:750-763 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) candle-metal-kernels/src/kernels/reduce.rs:141— candle-metal-kernels/src/kernels/reduce.rs:141-155 | candle-metal-kernels/src/kernels/reduce.rs:197-210 | candle-metal-kernels/src/kernels/reduce.rs:258-271 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13–14 lines × 2) candle-core/src/quantized/mod.rs:575— candle-core/src/quantized/mod.rs:575-588 | candle-core/src/quantized/mod.rs:619-631 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) candle-transformers/src/models/clip/text_model.rs:116— candle-transformers/src/models/clip/text_model.rs:116-129 | candle-transformers/src/models/stable_diffusion/clip.rs:198-210 — before extracting anything, compare `candle-transformers/src/models/clip/text_model.rs` and `candle-transformers/src/models/stable_diffusion/clip.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 2) candle-transformers/src/models/paddleocr_vl/text.rs:861— candle-transformers/src/models/paddleocr_vl/text.rs:861-873 | candle-transformers/src/models/paddleocr_vl/text.rs:953-966 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) candle-transformers/src/models/quantized_lfm2.rs:158— candle-transformers/src/models/quantized_lfm2.rs:158-170 | candle-transformers/src/models/quantized_qwen2.rs:122-135 — before extracting anything, compare `candle-transformers/src/models/quantized_lfm2.rs` and `candle-transformers/src/models/quantized_qwen2.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–13 lines × 2) candle-core/src/quantized/cuda.rs:416— candle-core/src/quantized/cuda.rs:416-428 | candle-core/src/quantized/cuda.rs:485-496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) candle-nn/src/moe.rs:66— candle-nn/src/moe.rs:66-78 | candle-nn/src/moe.rs:238-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) candle-transformers/src/models/nvembed_v2/embedding.rs:157— candle-transformers/src/models/nvembed_v2/embedding.rs:157-169 | candle-transformers/src/models/starcoder2.rs:197-208 — before extracting anything, compare `candle-transformers/src/models/nvembed_v2/embedding.rs` and `candle-transformers/src/models/starcoder2.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12–13 lines × 2) candle-transformers/src/models/quantized_qwen3.rs:114— candle-transformers/src/models/quantized_qwen3.rs:114-125 | candle-transformers/src/models/smol/quantized_smollm3.rs:188-200 — before extracting anything, compare `candle-transformers/src/models/quantized_qwen3.rs` and `candle-transformers/src/models/smol/quantized_smollm3.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 2) candle-core/src/cpu_backend/conv2d.rs:294— candle-core/src/cpu_backend/conv2d.rs:294-304 | candle-core/src/cpu_backend/mod.rs:1338-1349 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11–12 lines × 2) candle-core/src/quantized/avx.rs:602— candle-core/src/quantized/avx.rs:602-612 | candle-core/src/quantized/avx.rs:615-626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) candle-transformers/src/models/quantized_stable_lm.rs:81— candle-transformers/src/models/quantized_stable_lm.rs:81-91 | candle-transformers/src/models/stable_lm.rs:202-213 — before extracting anything, compare `candle-transformers/src/models/quantized_stable_lm.rs` and `candle-transformers/src/models/stable_lm.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 2) candle-transformers/src/models/segment_anything/image_encoder.rs:301— candle-transformers/src/models/segment_anything/image_encoder.rs:301-312 | candle-transformers/src/models/segment_anything/tiny_vit.rs:416-426 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10–11 lines × 3) candle-core/src/quantized/k_quants.rs:723— candle-core/src/quantized/k_quants.rs:723-733 | candle-core/src/quantized/k_quants.rs:753-763 | candle-core/src/quantized/k_quants.rs:2343-2352 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–11 lines × 3) candle-core/src/tensor.rs:2604— candle-core/src/tensor.rs:2604-2613 | candle-core/src/tensor.rs:2642-2652 | candle-core/src/tensor.rs:2996-3006 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–11 lines × 3) candle-nn/src/var_builder.rs:380— candle-nn/src/var_builder.rs:380-390 | candle-nn/src/var_builder.rs:428-437 | candle-nn/src/var_builder.rs:473-482 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–11 lines × 3) candle-transformers/src/models/gemma4/text.rs:422— candle-transformers/src/models/gemma4/text.rs:422-432 | candle-transformers/src/models/gemma4/vision.rs:326-335 | candle-transformers/src/models/glm4_new.rs:252-261 — before extracting anything, compare `candle-transformers/src/models/gemma4/text.rs` and `candle-transformers/src/models/gemma4/vision.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 2) candle-core/src/backprop.rs:296— candle-core/src/backprop.rs:296-304 | candle-core/src/backprop.rs:326-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) candle-transformers/src/models/lfm2.rs:466— candle-transformers/src/models/lfm2.rs:466-474 | candle-transformers/src/models/quantized_lfm2.rs:207-214 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8–9 lines × 2) candle-transformers/src/models/mixtral.rs:347— candle-transformers/src/models/mixtral.rs:347-354 | candle-transformers/src/models/quantized_llama.rs:131-139 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8–9 lines × 2) candle-transformers/src/models/paddleocr_vl/text.rs:433— candle-transformers/src/models/paddleocr_vl/text.rs:433-440 | candle-transformers/src/models/paddleocr_vl/text.rs:558-566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6–7 lines × 2) candle-core/src/cpu_backend/mod.rs:410— candle-core/src/cpu_backend/mod.rs:410-415 | candle-core/src/cpu_backend/mod.rs:449-455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6–7 lines × 2) candle-core/src/npy.rs:406— candle-core/src/npy.rs:406-411 | candle-core/src/npy.rs:419-425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6–7 lines × 2) candle-core/src/quantized/avx.rs:239— candle-core/src/quantized/avx.rs:239-245 | candle-core/src/quantized/avx.rs:328-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6–7 lines × 2) candle-core/src/sort.rs:33— candle-core/src/sort.rs:33-38 | candle-core/src/sort.rs:48-54 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Tensor::backward (cyclomatic 88) candle-core/src/backprop.rs:165— Tensor::backward has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Tensor::write_bytes (cyclomatic 20) candle-core/src/convert.rs:102— Tensor::write_bytes has cyclomatic complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Tensor::fmt (cyclomatic 20) candle-core/src/display.rs:454— Tensor::fmt has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
candle_metal_kernels::kernels::mlx_gemm::call_mlx_gemv (cyclomatic 41) candle-metal-kernels/src/kernels/mlx_gemm.rs:261— candle_metal_kernels::kernels::mlx_gemm::call_mlx_gemv has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
candle_metal_kernels::kernels::mlx_gemm::call_mlx_gemm (cyclomatic 28) candle-metal-kernels/src/kernels/mlx_gemm.rs:453— candle_metal_kernels::kernels::mlx_gemm::call_mlx_gemm has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
candle_metal_kernels::kernels::mlx_gemm::select_tile_config (cyclomatic 27) candle-metal-kernels/src/kernels/mlx_gemm.rs:59— candle_metal_kernels::kernels::mlx_gemm::select_tile_config has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
candle_metal_kernels::kernels::mlx_gemm::call_mlx_gemv (cognitive 68) candle-metal-kernels/src/kernels/mlx_gemm.rs:261— candle_metal_kernels::kernels::mlx_gemm::call_mlx_gemv has cognitive complexity 68 (threshold 15). Drivers by points: if/else 45 (54 pts), boolean chains 13, match/switch 1 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
candle_metal_kernels::kernels::mlx_gemm::select_tile_config (cognitive 62) candle-metal-kernels/src/kernels/mlx_gemm.rs:59— candle_metal_kernels::kernels::mlx_gemm::select_tile_config has cognitive complexity 62 (threshold 15). Drivers by points: if/else 27 (52 pts), boolean chains 7, match/switch 2 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
candle_metal_kernels::kernels::mlx_gemm::call_mlx_gemm (cognitive 32) candle-metal-kernels/src/kernels/mlx_gemm.rs:453— candle_metal_kernels::kernels::mlx_gemm::call_mlx_gemm has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 13, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
candle_transformers::models::paddleocr_vl::text::compute_mrope_position_ids_multi (cognitive 45) candle-transformers/src/models/paddleocr_vl/text.rs:288— candle_transformers::models::paddleocr_vl::text::compute_mrope_position_ids_multi has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (33 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
candle_transformers::models::paddleocr_vl::text::compute_mrope_position_ids_video (cognitive 38) candle-transformers/src/models/paddleocr_vl/text.rs:541— candle_transformers::models::paddleocr_vl::text::compute_mrope_position_ids_video has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 4 (10 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
candle_transformers::models::whisper::audio::log_mel_spectrogram_w (cognitive 24) candle-transformers/src/models/whisper/audio.rs:90— candle_transformers::models::whisper::audio::log_mel_spectrogram_w has cognitive complexity 24 (threshold 15). Drivers by points: loops 8 (18 pts), if/else 4 (6 pts) (nesting depth added 12). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
BlockQ2K::from_float (cognitive 31) candle-core/src/quantized/k_quants.rs:893— BlockQ2K::from_float has cognitive complexity 31 (threshold 15). Drivers by points: loops 9 (22 pts), if/else 5 (9 pts) (nesting depth added 17). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BlockQ2K::from_float_imatrix (cognitive 21) candle-core/src/quantized/k_quants.rs:957— BlockQ2K::from_float_imatrix has cognitive complexity 21 (threshold 15). Drivers by points: loops 8 (18 pts), if/else 1 (3 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BlockQ2K::vec_dot_unopt (cognitive 16) candle-core/src/quantized/k_quants.rs:840— BlockQ2K::vec_dot_unopt has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (16 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BlockQ4K::from_float (cognitive 29) candle-core/src/quantized/k_quants.rs:1558— BlockQ4K::from_float has cognitive complexity 29 (threshold 15). Drivers by points: loops 7 (16 pts), if/else 7 (13 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BlockQ4K::vec_dot_unopt (cognitive 26) candle-core/src/quantized/k_quants.rs:1476— BlockQ4K::vec_dot_unopt has cognitive complexity 26 (threshold 15). Drivers by points: loops 10 (26 pts) (nesting depth added 16). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BlockQ4K::from_float_imatrix (cognitive 26) candle-core/src/quantized/k_quants.rs:1619— BlockQ4K::from_float_imatrix has cognitive complexity 26 (threshold 15). Drivers by points: loops 8 (19 pts), if/else 3 (7 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BlockQ6K::vec_dot_unopt (cognitive 22) candle-core/src/quantized/k_quants.rs:2072— BlockQ6K::vec_dot_unopt has cognitive complexity 22 (threshold 15). Drivers by points: loops 9 (22 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BlockQ6K::from_float (cognitive 21) candle-core/src/quantized/k_quants.rs:2131— BlockQ6K::from_float has cognitive complexity 21 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 2 (6 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (BlockQ6K::from_float_imatrix) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BlockQ6K::from_float_imatrix (cognitive 21) candle-core/src/quantized/k_quants.rs:2203— BlockQ6K::from_float_imatrix has cognitive complexity 21 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 2 (6 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (BlockQ6K::from_float) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
PaddleOCRVLModel::forward_multi_image_separate (cognitive 19) candle-transformers/src/models/paddleocr_vl/mod.rs:392— PaddleOCRVLModel::forward_multi_image_separate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5 (8 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PaddleOCRVLModel::forward_multi_image (cognitive 18) candle-transformers/src/models/paddleocr_vl/mod.rs:275— PaddleOCRVLModel::forward_multi_image has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PaddleOCRVLModel::forward_video (cognitive 17) candle-transformers/src/models/paddleocr_vl/mod.rs:700— PaddleOCRVLModel::forward_video has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×3
Edited copy of a member (26 corresponding lines) candle-transformers/src/models/flux/model.rs:370— candle-transformers/src/models/flux/model.rs:370-395 | candle-transformers/src/models/flux/quantized_model.rs:209-234 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) candle-transformers/src/models/whisper/model.rs:106— candle-transformers/src/models/whisper/model.rs:106-131 | candle-transformers/src/models/whisper/quantized_model.rs:103-128 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) candle-transformers/src/models/gemma2.rs:298— candle-transformers/src/models/gemma2.rs:298-326 | candle-transformers/src/models/gemma3.rs:325-366 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×3
Edited copy of a member (21 corresponding lines) candle-transformers/src/models/stable_diffusion/attention.rs:173— candle-transformers/src/models/stable_diffusion/attention.rs:173-206 | candle-transformers/src/models/wuerstchen/attention_processor.rs:77-117 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) candle-transformers/src/models/qwen3.rs:192— candle-transformers/src/models/qwen3.rs:192-241 | candle-transformers/src/models/smol/smollm3.rs:242-298 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) candle-transformers/src/models/segment_anything/sam.rs:49— candle-transformers/src/models/segment_anything/sam.rs:49-92 | candle-transformers/src/models/segment_anything/sam.rs:94-123 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (37 lines × 2) candle-core/src/quantized/k_quants.rs:1520— candle-core/src/quantized/k_quants.rs:1520-1556 | candle-core/src/quantized/k_quants.rs:1785-1821 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (37 lines × 2) candle-core/src/quantized/neon.rs:2351— candle-core/src/quantized/neon.rs:2351-2387 | candle-core/src/quantized/neon.rs:2492-2528 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (37 lines × 2) candle-transformers/src/models/quantized_glm4.rs:392— candle-transformers/src/models/quantized_glm4.rs:392-428 | candle-transformers/src/models/quantized_qwen3.rs:500-536 — before extracting anything, compare `candle-transformers/src/models/quantized_glm4.rs` and `candle-transformers/src/models/quantized_qwen3.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (33 lines × 2) candle-core/src/safetensors.rs:233— candle-core/src/safetensors.rs:233-265 | candle-core/src/safetensors.rs:337-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (33 lines × 2) candle-transformers/src/models/stable_diffusion/ddim.rs:75— candle-transformers/src/models/stable_diffusion/ddim.rs:75-107 | candle-transformers/src/models/stable_diffusion/euler_ancestral_discrete.rs:76-108 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (33 lines × 2) candle-wasm-examples/yolo/src/worker.rs:49— candle-wasm-examples/yolo/src/worker.rs:49-81 | candle-wasm-examples/yolo/src/worker.rs:128-160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (28 lines × 2) candle-transformers/src/fused_moe.rs:96— candle-transformers/src/fused_moe.rs:96-123 | candle-transformers/src/fused_moe.rs:233-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (28 lines × 2) candle-transformers/src/models/blip_text.rs:135— candle-transformers/src/models/blip_text.rs:135-162 | candle-transformers/src/models/quantized_blip_text.rs:131-158 — before extracting anything, compare `candle-transformers/src/models/blip_text.rs` and `candle-transformers/src/models/quantized_blip_text.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 215 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (28 lines × 2) candle-examples/src/chat_template.rs:196— candle-examples/src/chat_template.rs:196-223 | candle-wasm-examples/chat-template/src/lib.rs:251-278 — before extracting anything, compare `candle-examples/src/chat_template.rs` and `candle-wasm-examples/chat-template/src/lib.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 3) candle-core/src/cpu/avx.rs:316— candle-core/src/cpu/avx.rs:316-332 | candle-core/src/cpu/neon.rs:521-537 | candle-core/src/cpu/simd128.rs:206-222 — before extracting anything, compare `candle-core/src/cpu/avx.rs` and `candle-core/src/cpu/neon.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 3) candle-transformers/src/models/chatglm.rs:214— candle-transformers/src/models/chatglm.rs:214-230 | candle-transformers/src/models/codegeex4_9b.rs:235-251 | candle-transformers/src/models/glm4.rs:256-272 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 3) candle-transformers/src/models/chatglm.rs:343— candle-transformers/src/models/chatglm.rs:343-359 | candle-transformers/src/models/codegeex4_9b.rs:364-380 | candle-transformers/src/models/glm4.rs:385-401 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 3) candle-core/src/cpu/avx.rs:356— candle-core/src/cpu/avx.rs:356-370 | candle-core/src/cpu/neon.rs:561-575 | candle-core/src/cpu/simd128.rs:244-258 — before extracting anything, compare `candle-core/src/cpu/avx.rs` and `candle-core/src/cpu/neon.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 3) candle-transformers/src/models/chatglm.rs:164— candle-transformers/src/models/chatglm.rs:164-178 | candle-transformers/src/models/codegeex4_9b.rs:182-196 | candle-transformers/src/models/glm4.rs:203-217 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 3) candle-transformers/src/models/granite.rs:408— candle-transformers/src/models/granite.rs:408-422 | candle-transformers/src/models/llama.rs:455-469 | candle-transformers/src/models/voxtral/voxtral_llama.rs:379-393 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/llama.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 297 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 2) candle-core/src/quantized/neon.rs:159— candle-core/src/quantized/neon.rs:159-172 | candle-core/src/quantized/neon.rs:191-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) candle-transformers/src/models/chinese_clip/vision_model.rs:186— candle-transformers/src/models/chinese_clip/vision_model.rs:186-200 | candle-transformers/src/models/clip/text_model.rs:153-166 — before extracting anything, compare `candle-transformers/src/models/chinese_clip/vision_model.rs` and `candle-transformers/src/models/clip/text_model.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 2) candle-transformers/src/models/quantized_t5.rs:736— candle-transformers/src/models/quantized_t5.rs:736-749 | candle-transformers/src/models/t5.rs:889-903 — before extracting anything, compare `candle-transformers/src/models/quantized_t5.rs` and `candle-transformers/src/models/t5.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 364 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 4) candle-transformers/src/models/based.rs:550— candle-transformers/src/models/based.rs:550-562 | candle-transformers/src/models/mistral.rs:403-415 | candle-transformers/src/models/quantized_mistral.rs:292-304 | candle-transformers/src/models/starcoder2.rs:307-319 — before extracting anything, compare `candle-transformers/src/models/based.rs` and `candle-transformers/src/models/mistral.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 4) candle-transformers/src/models/beit.rs:266— candle-transformers/src/models/beit.rs:266-278 | candle-transformers/src/models/dinov2.rs:217-229 | candle-transformers/src/models/dinov2reg4.rs:210-222 | candle-transformers/src/models/eva2.rs:250-262 — before extracting anything, compare `candle-transformers/src/models/beit.rs` and `candle-transformers/src/models/dinov2.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 4) candle-transformers/src/models/quantized_gemma3.rs:210— candle-transformers/src/models/quantized_gemma3.rs:210-222 | candle-transformers/src/models/quantized_lfm2.rs:151-163 | candle-transformers/src/models/quantized_llama.rs:220-232 | candle-transformers/src/models/quantized_qwen2.rs:115-127 — before extracting anything, compare `candle-transformers/src/models/quantized_gemma3.rs` and `candle-transformers/src/models/quantized_llama.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–13 lines × 3) candle-core/src/cuda_backend/mod.rs:2605— candle-core/src/cuda_backend/mod.rs:2605-2617 | candle-core/src/cuda_backend/mod.rs:2665-2676 | candle-core/src/cuda_backend/mod.rs:2724-2735 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 3) candle-core/src/quantized/neon.rs:1062— candle-core/src/quantized/neon.rs:1062-1074 | candle-core/src/quantized/neon.rs:1376-1387 | candle-core/src/quantized/neon.rs:1516-1528 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 3) candle-transformers/src/models/quantized_phi.rs:259— candle-transformers/src/models/quantized_phi.rs:259-270 | candle-transformers/src/models/quantized_phi3.rs:291-302 | candle-transformers/src/models/quantized_qwen2.rs:282-294 — before extracting anything, compare `candle-transformers/src/models/quantized_phi.rs` and `candle-transformers/src/models/quantized_phi3.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–11 lines × 2) candle-core/src/quantized/avx.rs:500— candle-core/src/quantized/avx.rs:500-508 | candle-core/src/quantized/avx.rs:591-601 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–11 lines × 2) candle-transformers/src/models/bert.rs:417— candle-transformers/src/models/bert.rs:417-427 | candle-transformers/src/models/chinese_clip/text_model.rs:402-410 — before extracting anything, compare `candle-transformers/src/models/bert.rs` and `candle-transformers/src/models/chinese_clip/text_model.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9–11 lines × 2) candle-transformers/src/models/paddleocr_vl/vision.rs:910— candle-transformers/src/models/paddleocr_vl/vision.rs:910-920 | candle-transformers/src/models/qwen3_vl/vision.rs:492-500 — `candle-transformers/src/models/paddleocr_vl/vision.rs` and `candle-transformers/src/models/qwen3_vl/vision.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 11 separate duplicated blocks between them, totalling at least 77 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 6) candle-nn/src/attention/cpu_flash/causal.rs:231— candle-nn/src/attention/cpu_flash/causal.rs:231-239 | candle-nn/src/attention/cpu_flash/causal.rs:324-332 | candle-nn/src/attention/cpu_flash/causal.rs:412-420 | candle-nn/src/attention/cpu_flash/causal.rs:484-492 | candle-nn/src/attention/cpu_flash/causal.rs:618-626 | candle-nn/src/attention/cpu_flash/causal.rs:732-740 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 6) candle-transformers/src/models/granite.rs:173— candle-transformers/src/models/granite.rs:173-181 | candle-transformers/src/models/granitemoehybrid.rs:216-224 | candle-transformers/src/models/lfm2.rs:189-197 | candle-transformers/src/models/llama.rs:219-227 | candle-transformers/src/models/llama2_c.rs:124-132 | candle-transformers/src/models/voxtral/voxtral_llama.rs:114-122 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 6) candle-transformers/src/models/helium.rs:77— candle-transformers/src/models/helium.rs:77-85 | candle-transformers/src/models/mistral.rs:128-136 | candle-transformers/src/models/mixformer.rs:157-165 | candle-transformers/src/models/qwen3.rs:51-59 | candle-transformers/src/models/smol/smollm3.rs:81-89 | candle-transformers/src/models/z_image/text_encoder.rs:123-131 — before extracting anything, compare `candle-transformers/src/models/helium.rs` and `candle-transformers/src/models/mistral.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 5) candle-transformers/src/models/mistral.rs:382— candle-transformers/src/models/mistral.rs:382-390 | candle-transformers/src/models/mixtral.rs:423-431 | candle-transformers/src/models/quantized_mistral.rs:272-280 | candle-transformers/src/models/qwen2_moe.rs:418-426 | candle-transformers/src/models/yi.rs:313-321 — before extracting anything, compare `candle-transformers/src/models/mistral.rs` and `candle-transformers/src/models/mixtral.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 5) candle-transformers/src/models/quantized_lfm2.rs:590— candle-transformers/src/models/quantized_lfm2.rs:590-598 | candle-transformers/src/models/quantized_llama.rs:548-556 | candle-transformers/src/models/quantized_phi.rs:273-281 | candle-transformers/src/models/quantized_phi3.rs:305-313 | candle-transformers/src/models/quantized_qwen2.rs:297-305 — before extracting anything, compare `candle-transformers/src/models/quantized_lfm2.rs` and `candle-transformers/src/models/quantized_llama.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 5) candle-transformers/src/models/mixtral.rs:108— candle-transformers/src/models/mixtral.rs:108-116 | candle-transformers/src/models/recurrent_gemma.rs:136-144 | candle-transformers/src/models/stable_lm.rs:118-126 | candle-transformers/src/models/starcoder2.rs:78-86 | candle-transformers/src/models/yi.rs:109-117 — before extracting anything, compare `candle-transformers/src/models/mixtral.rs` and `candle-transformers/src/models/recurrent_gemma.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 3) candle-core/src/quantized/k_quants.rs:1480— candle-core/src/quantized/k_quants.rs:1480-1488 | candle-core/src/quantized/k_quants.rs:1738-1746 | candle-core/src/quantized/simd128.rs:183-190 — before extracting anything, compare `candle-core/src/quantized/k_quants.rs` and `candle-core/src/quantized/simd128.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 3) candle-transformers/src/models/wuerstchen/common.rs:21— candle-transformers/src/models/wuerstchen/common.rs:21-29 | candle-transformers/src/models/wuerstchen/common.rs:51-58 | candle-transformers/src/models/z_image/transformer.rs:693-701 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8–9 lines × 3) candle-wasm-examples/segment-anything/src/bin/m.rs:57— candle-wasm-examples/segment-anything/src/bin/m.rs:57-64 | candle-wasm-examples/yolo/src/worker.rs:72-80 | candle-wasm-examples/yolo/src/worker.rs:151-159 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 13) candle-nn/src/layer_norm.rs:123— candle-nn/src/layer_norm.rs:123-129 | candle-nn/src/ops.rs:662-668 | candle-nn/src/ops.rs:913-919 | candle-transformers/src/models/gemma.rs:61-67 | candle-transformers/src/models/gemma2.rs:54-60 | candle-transformers/src/models/gemma3.rs:49-55 | candle-transformers/src/models/gemma4/audio.rs:28-34 | candle-transformers/src/models/gemma4/text.rs:29-35 | candle-transformers/src/models/gemma4/vision.rs:28-34 | candle-transformers/src/models/recurrent_gemma.rs:78-84 | candle-transformers/src/models/wuerstchen/common.rs:20-27 | candle-transformers/src/models/wuerstchen/common.rs:50-56 | candle-transformers/src/models/z_image/transformer.rs:692-698 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 13) candle-transformers/src/models/based.rs:578— candle-transformers/src/models/based.rs:578-584 | candle-transformers/src/models/helium.rs:379-385 | candle-transformers/src/models/mistral.rs:435-441 | candle-transformers/src/models/mixtral.rs:473-479 | candle-transformers/src/models/olmo.rs:337-343 | candle-transformers/src/models/olmo2.rs:332-338 | candle-transformers/src/models/phi3.rs:412-418 | candle-transformers/src/models/quantized_mistral.rs:320-326 | candle-transformers/src/models/quantized_stable_lm.rs:291-297 | candle-transformers/src/models/qwen2_moe.rs:468-474 | candle-transformers/src/models/stable_lm.rs:423-429 | candle-transformers/src/models/starcoder2.rs:335-341 | candle-transformers/src/models/yi.rs:354-360 — before extracting anything, compare `candle-transformers/src/models/based.rs` and `candle-transformers/src/models/helium.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 13) candle-transformers/src/models/based.rs:581— candle-transformers/src/models/based.rs:581-587 | candle-transformers/src/models/gemma.rs:405-411 | candle-transformers/src/models/helium.rs:382-388 | candle-transformers/src/models/mistral.rs:438-444 | candle-transformers/src/models/mixtral.rs:476-482 | candle-transformers/src/models/olmo.rs:340-346 | candle-transformers/src/models/olmo2.rs:335-341 | candle-transformers/src/models/phi3.rs:415-421 | candle-transformers/src/models/quantized_stable_lm.rs:294-300 | candle-transformers/src/models/qwen2_moe.rs:471-477 | candle-transformers/src/models/stable_lm.rs:426-432 | candle-transformers/src/models/starcoder2.rs:338-344 | candle-transformers/src/models/yi.rs:357-363 — before extracting anything, compare `candle-transformers/src/models/based.rs` and `candle-transformers/src/models/gemma.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 3) candle-transformers/src/models/quantized_gemma3.rs:398— candle-transformers/src/models/quantized_gemma3.rs:398-404 | candle-transformers/src/models/quantized_llama.rs:332-337 | candle-transformers/src/models/quantized_llama.rs:491-496 — before extracting anything, compare `candle-transformers/src/models/quantized_gemma3.rs` and `candle-transformers/src/models/quantized_llama.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 3) candle-transformers/src/models/quantized_llama.rs:331— candle-transformers/src/models/quantized_llama.rs:331-336 | candle-transformers/src/models/quantized_llama.rs:490-495 | candle-transformers/src/models/quantized_qwen2.rs:255-261 — before extracting anything, compare `candle-transformers/src/models/quantized_llama.rs` and `candle-transformers/src/models/quantized_qwen2.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 3) candle-transformers/src/models/quantized_llama.rs:577— candle-transformers/src/models/quantized_llama.rs:577-582 | candle-transformers/src/models/quantized_qwen2.rs:326-331 | candle-transformers/src/models/quantized_qwen3_moe.rs:410-416 — before extracting anything, compare `candle-transformers/src/models/quantized_llama.rs` and `candle-transformers/src/models/quantized_qwen2.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–6 lines × 3) candle-nn/src/rotary_emb.rs:50— candle-nn/src/rotary_emb.rs:50-55 | candle-nn/src/rotary_emb.rs:350-355 | candle-nn/src/rotary_emb.rs:639-641 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–6 lines × 3) candle-transformers/src/models/lfm2.rs:285— candle-transformers/src/models/lfm2.rs:285-287 | candle-transformers/src/models/qwen2.rs:131-136 | candle-transformers/src/models/qwen2_moe.rs:138-143 — before extracting anything, compare `candle-transformers/src/models/qwen2.rs` and `candle-transformers/src/models/qwen2_moe.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 266 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–6 lines × 3) candle-transformers/src/models/vgg.rs:148— candle-transformers/src/models/vgg.rs:148-150 | candle-transformers/src/models/vgg.rs:176-181 | candle-transformers/src/models/vgg.rs:223-228 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 9) candle-transformers/src/models/gemma.rs:298— candle-transformers/src/models/gemma.rs:298-303 | candle-transformers/src/models/gemma2.rs:300-305 | candle-transformers/src/models/gemma3.rs:338-344 | candle-transformers/src/models/helium.rs:276-281 | candle-transformers/src/models/mistral.rs:325-330 | candle-transformers/src/models/nvembed_v2/embedding.rs:185-190 | candle-transformers/src/models/quantized_mistral.rs:216-221 | candle-transformers/src/models/qwen2.rs:228-233 | candle-transformers/src/models/yi.rs:262-266 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 9) candle-transformers/src/models/helium.rs:77— candle-transformers/src/models/helium.rs:77-81 | candle-transformers/src/models/mimi/transformer.rs:65-69 | candle-transformers/src/models/mistral.rs:128-132 | candle-transformers/src/models/mixformer.rs:157-161 | candle-transformers/src/models/quantized_mistral.rs:43-47 | candle-transformers/src/models/quantized_mixformer.rs:69-73 | candle-transformers/src/models/qwen3.rs:51-55 | candle-transformers/src/models/smol/smollm3.rs:81-85 | candle-transformers/src/models/z_image/text_encoder.rs:123-127 — before extracting anything, compare `candle-transformers/src/models/helium.rs` and `candle-transformers/src/models/mistral.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 9) candle-onnx/src/eval.rs:341— candle-onnx/src/eval.rs:341-345 | candle-onnx/src/eval.rs:347-351 | candle-onnx/src/eval.rs:353-357 | candle-onnx/src/eval.rs:377-381 | candle-onnx/src/eval.rs:388-392 | candle-onnx/src/eval.rs:813-818 | candle-onnx/src/eval.rs:821-826 | candle-onnx/src/eval.rs:829-834 | candle-onnx/src/eval.rs:2421-2426 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 8) candle-transformers/src/models/codegeex4_9b.rs:79— candle-transformers/src/models/codegeex4_9b.rs:79-83 | candle-transformers/src/models/flux/model.rs:86-90 | candle-transformers/src/models/gemma3.rs:84-88 | candle-transformers/src/models/gemma4/text.rs:69-73 | candle-transformers/src/models/glm4.rs:101-105 | candle-transformers/src/models/modernbert.rs:62-66 | candle-transformers/src/models/quantized_glm4.rs:114-118 | candle-transformers/src/models/quantized_qwen3.rs:106-110 — before extracting anything, compare `candle-transformers/src/models/codegeex4_9b.rs` and `candle-transformers/src/models/glm4.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 443 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 8) candle-transformers/src/models/deepseek2.rs:348— candle-transformers/src/models/deepseek2.rs:348-352 | candle-transformers/src/models/mimi/transformer.rs:62-66 | candle-transformers/src/models/mixformer.rs:154-158 | candle-transformers/src/models/paddleocr_vl/text.rs:43-49 | candle-transformers/src/models/quantized_mistral.rs:40-44 | candle-transformers/src/models/quantized_mixformer.rs:66-70 | candle-transformers/src/models/qwen3_vl/text.rs:28-32 | candle-transformers/src/models/trocr.rs:111-115 — before extracting anything, compare `candle-transformers/src/models/deepseek2.rs` and `candle-transformers/src/models/paddleocr_vl/text.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 8) candle-transformers/src/models/chatglm.rs:550— candle-transformers/src/models/chatglm.rs:550-554 | candle-transformers/src/models/codegeex4_9b.rs:571-575 | candle-transformers/src/models/glm4.rs:592-596 | candle-transformers/src/models/mpt.rs:287-291 | candle-transformers/src/models/phi.rs:137-141 | candle-transformers/src/models/quantized_mixformer.rs:42-46 | candle-transformers/src/models/quantized_t5.rs:44-48 | candle-transformers/src/models/t5.rs:111-115 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
FlashAttnVarLen::cuda_fwd_t (cyclomatic 58) candle-flash-attn/src/lib.rs:464— FlashAttnVarLen::cuda_fwd_t has cyclomatic complexity 58 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FlashAttnVarLen::cuda_fwd_t (cyclomatic 31) candle-flash-attn-v3/src/lib.rs:444— FlashAttnVarLen::cuda_fwd_t has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
candle_nn::attention::cpu_flash::varlen::flash_attn_varlen_cpu (cyclomatic 54) candle-nn/src/attention/cpu_flash/varlen.rs:27— candle_nn::attention::cpu_flash::varlen::flash_attn_varlen_cpu has cyclomatic complexity 54 (threshold 15). Of this number, 47 points are the body's own statements and 7 belong to 2 function items inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
candle_nn::moe::moe_gemm_gguf::cuda_fwd (cyclomatic 16) candle-nn/src/moe.rs:188— candle_nn::moe::moe_gemm_gguf::cuda_fwd has cyclomatic complexity 16 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
FlashAttn::cuda_fwd_t (cyclomatic 25) candle-flash-attn-v3/src/lib.rs:30— FlashAttn::cuda_fwd_t has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FlashAttn::cuda_fwd_t (cyclomatic 22) candle-flash-attn/src/lib.rs:21— FlashAttn::cuda_fwd_t has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
tensor_tools::run_print (cyclomatic 25) tensor-tools/src/main.rs:171— tensor_tools::run_print has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
tensor_tools::run_ls (cyclomatic 19) tensor-tools/src/main.rs:299— tensor_tools::run_ls has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
PyTensor::__getitem__ (cyclomatic 21) candle-pyo3/src/lib.rs:533— PyTensor::__getitem__ has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (extract_indexer, to_absolute_index). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
PyTensor::to (cyclomatic 17) candle-pyo3/src/lib.rs:984— PyTensor::to has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MatMul::f (cyclomatic 19) candle-core/src/cpu_backend/mod.rs:1625— MatMul::f has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: CpuStorage::to_dtype (cyclomatic 102) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
MatMul::f (cyclomatic 18) candle-core/src/cpu_backend/mod.rs:1534— MatMul::f has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: CpuStorage::to_dtype (cyclomatic 102) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
Value::read (cyclomatic 19) candle-core/src/quantized/gguf_file.rs:319— Value::read has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Value::write (cyclomatic 16) candle-core/src/quantized/gguf_file.rs:376— Value::write has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
candle_transformers::models::paddleocr_vl::text::compute_mrope_position_ids_multi (cyclomatic 19) candle-transformers/src/models/paddleocr_vl/text.rs:288— candle_transformers::models::paddleocr_vl::text::compute_mrope_position_ids_multi has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
candle_transformers::models::paddleocr_vl::text::compute_mrope_position_ids_video (cyclomatic 16) candle-transformers/src/models/paddleocr_vl/text.rs:541— candle_transformers::models::paddleocr_vl::text::compute_mrope_position_ids_video has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WDiffNeXt::forward (cyclomatic 18) candle-transformers/src/models/wuerstchen/diffnext.rs:307— WDiffNeXt::forward has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WDiffNeXt::new (cyclomatic 17) candle-transformers/src/models/wuerstchen/diffnext.rs:92— WDiffNeXt::new has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HackComment candle-onnx/src/eval.rs:364— // HACK: current implementation of broadcast_pow cannot handle negative base, — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment candle-core/src/npy.rs:107— // Hacky parser for the npy header, a typical example would be: — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
FlashAttnVarLen::cuda_fwd_t (cognitive 83) candle-flash-attn/src/lib.rs:464— FlashAttnVarLen::cuda_fwd_t has cognitive complexity 83 (threshold 15). Drivers by points: if/else 47 (59 pts), match/switch 9 (14 pts), boolean chains 10 (nesting depth added 17). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FlashAttnVarLen::cuda_fwd_t (cognitive 36) candle-flash-attn-v3/src/lib.rs:444— FlashAttnVarLen::cuda_fwd_t has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22 (24 pts), match/switch 6 (7 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
tensor_tools::run_print (cognitive 46) tensor-tools/src/main.rs:171— tensor_tools::run_print has cognitive complexity 46 (threshold 15). Drivers by points: match/switch 8 (19 pts), if/else 12 (17 pts), loops 5 (10 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tensor_tools::run_ls (cognitive 30) tensor-tools/src/main.rs:299— tensor_tools::run_ls has cognitive complexity 30 (threshold 15). Drivers by points: loops 7 (15 pts), match/switch 5 (10 pts), if/else 2 (5 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WDiffNeXt::new (cognitive 41) candle-transformers/src/models/wuerstchen/diffnext.rs:92— WDiffNeXt::new has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (32 pts), loops 6 (8 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WDiffNeXt::forward (cognitive 33) candle-transformers/src/models/wuerstchen/diffnext.rs:307— WDiffNeXt::forward has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 4 (8 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlashAttn::cuda_fwd_t (cognitive 30) candle-flash-attn-v3/src/lib.rs:30— FlashAttn::cuda_fwd_t has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (22 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FlashAttn::cuda_fwd_t (cognitive 27) candle-flash-attn/src/lib.rs:21— FlashAttn::cuda_fwd_t has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19 (21 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PyTensor::__getitem__ (cognitive 26) candle-pyo3/src/lib.rs:533— PyTensor::__getitem__ has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 3 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 6). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 2 function items inside it that branch (extract_indexer, to_absolute_index). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
PyTensor::to (cognitive 20) candle-pyo3/src/lib.rs:984— PyTensor::to has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 1, match/switch 1 (nesting depth added 5). Of this number, 17 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Model::generate (cognitive 24) candle-transformers/src/models/parler_tts.rs:383— Model::generate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Model::new (cognitive 17) candle-transformers/src/models/rwkv_v7.rs:844— Model::new has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
T5Attention::forward (cognitive 22) candle-transformers/src/models/quantized_t5.rs:321— T5Attention::forward has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 5 (8 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
T5Attention::forward (cognitive 22) candle-transformers/src/models/t5.rs:450— T5Attention::forward has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 5 (8 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MatMul::f (cognitive 21) candle-core/src/cpu_backend/mod.rs:1625— MatMul::f has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 6, loops 3 (6 pts), match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MatMul::f (cognitive 19) candle-core/src/cpu_backend/mod.rs:1534— MatMul::f has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 6, loops 2 (4 pts), match/switch 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Projector::forward (cognitive 21) candle-transformers/src/models/paddleocr_vl/vision.rs:711— Projector::forward has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (Projector::forward_multi) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Projector::forward_multi (cognitive 21) candle-transformers/src/models/paddleocr_vl/vision.rs:786— Projector::forward_multi has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (Projector::forward) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
MetalStorage::reduce_op (cognitive 19) candle-core/src/metal_backend/mod.rs:298— MetalStorage::reduce_op has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, match/switch 2 (3 pts), loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MetalStorage::copy_strided_src (cognitive 17) candle-core/src/metal_backend/mod.rs:1837— MetalStorage::copy_strided_src has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
candle_datasets::vision::cifar::load_parquet (cognitive 16) candle-datasets/src/vision/cifar.rs:66— candle_datasets::vision::cifar::load_parquet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (7 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
candle_datasets::vision::mnist::load_parquet (cognitive 16) candle-datasets/src/vision/mnist.rs:64— candle_datasets::vision::mnist::load_parquet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (7 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyFunctions: candle_core::mkl candle-core/src/mkl.rs:83— TooManyFunctions — 37 free functions. The bar is 30 free functions; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: candle_core::accelerate candle-core/src/accelerate.rs:169— TooManyFunctions — 36 free functions. The bar is 30 free functions; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Change coupling: lib.rs ↔ test.py candle-pyo3/src/lib.rs:1— `candle-pyo3/src/lib.rs` and `candle-pyo3/test.py` change together 86% of the time (12 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `7bd0faba` Add support for accelerate in the pyo3 bindings. (#1167); `03e19412` Add return types to `*.pyi` stubs (#880); `8658df34` Generate `*.pyi` stubs for PyO3 wrapper (#870) — run `git show` on any of them.
Change coupling: backend.rs ↔ backprop.rs candle-core/src/backend.rs:1— `candle-core/src/backend.rs` and `candle-core/src/backprop.rs` change together 55% of the time (16 of the 29 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `5498dff9` Add bilinear interpolation support (upsample_bilinear2d) (#3237); `38276855` Add the scatter op. (#2921); `be4555c5` Add the conv-transpose1d op. (#1251) — run `git show` on any of them.
D4 · Code Duplication· Near-duplicate member family (13 members, 15 shared lines) · ×2
Near-duplicate member family (13 members, 15 shared lines) candle-transformers/src/models/csm.rs:192— candle-transformers/src/models/csm.rs:192-244 | candle-transformers/src/models/gemma.rs:202-259 | candle-transformers/src/models/helium.rs:199-258 | candle-transformers/src/models/mistral.rs:248-307 | candle-transformers/src/models/mixtral.rs:183-239 | candle-transformers/src/models/nvembed_v2/embedding.rs:130-171 | candle-transformers/src/models/quantized_mistral.rs:147-198 | candle-transformers/src/models/quantized_stable_lm.rs:117-177 | candle-transformers/src/models/qwen2.rs:160-210 | candle-transformers/src/models/qwen2_moe.rs:167-217 | candle-transformers/src/models/stable_lm.rs:240-307 | candle-transformers/src/models/starcoder2.rs:163-210 | candle-transformers/src/models/yi.rs:199-248 — These 13 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 13 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 13 times.
Near-duplicate member family (13 members, 15 shared lines) candle-transformers/src/models/gemma.rs:202— candle-transformers/src/models/gemma.rs:202-259 | candle-transformers/src/models/gemma2.rs:197-259 | candle-transformers/src/models/mixtral.rs:183-239 | candle-transformers/src/models/olmo.rs:161-221 | candle-transformers/src/models/olmo2.rs:156-209 | candle-transformers/src/models/phi.rs:190-263 | candle-transformers/src/models/phi3.rs:205-261 | candle-transformers/src/models/quantized_stable_lm.rs:117-177 | candle-transformers/src/models/qwen2.rs:160-210 | candle-transformers/src/models/qwen2_moe.rs:167-217 | candle-transformers/src/models/stable_lm.rs:240-307 | candle-transformers/src/models/starcoder2.rs:163-210 | candle-transformers/src/models/yi.rs:199-248 — These 13 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 13 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 13 times.
D4 · Code Duplication· Near-duplicate member family (13 members, 14 shared lines) · ×2
Near-duplicate member family (13 members, 14 shared lines) candle-transformers/src/models/csm.rs:192— candle-transformers/src/models/csm.rs:192-244 | candle-transformers/src/models/gemma.rs:202-259 | candle-transformers/src/models/gemma2.rs:197-259 | candle-transformers/src/models/helium.rs:199-258 | candle-transformers/src/models/mistral.rs:248-307 | candle-transformers/src/models/mixtral.rs:183-239 | candle-transformers/src/models/quantized_mistral.rs:147-198 | candle-transformers/src/models/quantized_stable_lm.rs:117-177 | candle-transformers/src/models/qwen2.rs:160-210 | candle-transformers/src/models/qwen2_moe.rs:167-217 | candle-transformers/src/models/stable_lm.rs:240-307 | candle-transformers/src/models/starcoder2.rs:163-210 | candle-transformers/src/models/yi.rs:199-248 — These 13 members are variants of one another: a block of 14 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 13 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 13 times.
Near-duplicate member family (13 members, 14 shared lines) candle-transformers/src/models/gemma.rs:202— candle-transformers/src/models/gemma.rs:202-259 | candle-transformers/src/models/gemma2.rs:197-259 | candle-transformers/src/models/gemma3.rs:223-282 | candle-transformers/src/models/gemma4/text.rs:309-376 | candle-transformers/src/models/mixtral.rs:183-239 | candle-transformers/src/models/olmo.rs:161-221 | candle-transformers/src/models/olmo2.rs:156-209 | candle-transformers/src/models/phi3.rs:205-261 | candle-transformers/src/models/quantized_stable_lm.rs:117-177 | candle-transformers/src/models/qwen2.rs:160-210 | candle-transformers/src/models/qwen2_moe.rs:167-217 | candle-transformers/src/models/stable_lm.rs:240-307 | candle-transformers/src/models/yi.rs:199-248 — These 13 members are variants of one another: a block of 14 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 13 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 13 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 10 shared lines) · ×2
Near-duplicate member family (4 members, 10 shared lines) candle-core/src/cuda_backend/mod.rs:734— candle-core/src/cuda_backend/mod.rs:734-766 | candle-core/src/cuda_backend/mod.rs:778-809 | candle-core/src/cuda_backend/mod.rs:849-885 | candle-core/src/cuda_backend/mod.rs:897-934 — These 4 members are variants of one another: a block of 10 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Near-duplicate member family (4 members, 10 shared lines) candle-transformers/src/models/helium.rs:67— candle-transformers/src/models/helium.rs:67-85 | candle-transformers/src/models/mimi/transformer.rs:58-74 | candle-transformers/src/models/mistral.rs:118-136 | candle-transformers/src/models/quantized_mistral.rs:33-51 — These 4 members are variants of one another: a block of 10 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 15 shared lines) · ×2
Near-duplicate member family (3 members, 15 shared lines) candle-transformers/src/models/chatglm.rs:82— candle-transformers/src/models/chatglm.rs:82-106 | candle-transformers/src/models/codegeex4_9b.rs:94-118 | candle-transformers/src/models/glm4.rs:115-139 — These 3 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member family (3 members, 15 shared lines) candle-transformers/src/models/granite.rs:405— candle-transformers/src/models/granite.rs:405-422 | candle-transformers/src/models/llama.rs:452-469 | candle-transformers/src/models/voxtral/voxtral_llama.rs:376-393 — These 3 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (29 shared lines) candle-core/src/cuda_backend/mod.rs:1888— candle-core/src/cuda_backend/mod.rs:1888-1950 | candle-core/src/cuda_backend/mod.rs:2074-2136 — These two members are variants of one another: 29 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (29 shared lines) candle-transformers/src/models/whisper/audio.rs:177— candle-transformers/src/models/whisper/audio.rs:177-266 | candle-wasm-examples/whisper/src/audio.rs:156-199 — These two members are variants of one another: 29 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×2
Edited copy of a member (22 corresponding lines) candle-transformers/src/models/blip.rs:147— candle-transformers/src/models/blip.rs:147-168 | candle-transformers/src/models/quantized_blip.rs:108-129 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) candle-transformers/src/models/quantized_rwkv_v5.rs:177— candle-transformers/src/models/quantized_rwkv_v5.rs:177-198 | candle-transformers/src/models/quantized_rwkv_v6.rs:224-245 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×2
Edited copy of a member (16 corresponding lines) candle-transformers/src/models/dinov2.rs:84— candle-transformers/src/models/dinov2.rs:84-99 | candle-transformers/src/models/dinov2reg4.rs:77-92 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) candle-transformers/src/models/segment_anything/transformer.rs:47— candle-transformers/src/models/segment_anything/transformer.rs:47-62 | candle-transformers/src/models/siglip.rs:332-347 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (13 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (13 members, 50+ identical tokens) candle-nn/src/layer_norm.rs:117— candle-nn/src/layer_norm.rs:117-143 | candle-nn/src/ops.rs:661-672 | candle-nn/src/ops.rs:912-930 | candle-transformers/src/models/gemma.rs:60-73 | candle-transformers/src/models/gemma2.rs:53-66 | candle-transformers/src/models/gemma3.rs:48-61 | candle-transformers/src/models/gemma4/audio.rs:27-38 | candle-transformers/src/models/gemma4/text.rs:28-41 | candle-transformers/src/models/gemma4/vision.rs:27-40 | candle-transformers/src/models/recurrent_gemma.rs:77-90 | candle-transformers/src/models/wuerstchen/common.rs:17-34 | candle-transformers/src/models/wuerstchen/common.rs:49-62 | candle-transformers/src/models/z_image/transformer.rs:691-706 — These 13 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 13 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 13 times.
Members sharing a duplicated core (13 members, 50+ identical tokens) candle-transformers/src/models/gemma.rs:319— candle-transformers/src/models/gemma.rs:319-327 | candle-transformers/src/models/helium.rs:297-305 | candle-transformers/src/models/mistral.rs:346-354 | candle-transformers/src/models/mixtral.rs:389-399 | candle-transformers/src/models/nvembed_v2/embedding.rs:206-216 | candle-transformers/src/models/olmo.rs:256-264 | candle-transformers/src/models/phi3.rs:333-341 | candle-transformers/src/models/quantized_mistral.rs:237-245 | candle-transformers/src/models/quantized_stable_lm.rs:217-226 | candle-transformers/src/models/qwen2.rs:249-257 | candle-transformers/src/models/qwen2_moe.rs:382-390 | candle-transformers/src/models/stable_lm.rs:347-356 | candle-transformers/src/models/starcoder2.rs:249-257 — These 13 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 13 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 13 times.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (8 members, 50+ identical tokens) candle-transformers/src/models/chatglm.rs:549— candle-transformers/src/models/chatglm.rs:549-554 | candle-transformers/src/models/codegeex4_9b.rs:570-575 | candle-transformers/src/models/glm4.rs:591-596 | candle-transformers/src/models/mpt.rs:286-291 | candle-transformers/src/models/phi.rs:136-141 | candle-transformers/src/models/quantized_mixformer.rs:41-46 | candle-transformers/src/models/quantized_t5.rs:43-48 | candle-transformers/src/models/t5.rs:110-115 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) candle-transformers/src/models/codegeex4_9b.rs:75— candle-transformers/src/models/codegeex4_9b.rs:75-92 | candle-transformers/src/models/flux/model.rs:80-99 | candle-transformers/src/models/gemma3.rs:76-98 | candle-transformers/src/models/gemma4/text.rs:68-83 | candle-transformers/src/models/glm4.rs:97-113 | candle-transformers/src/models/modernbert.rs:60-77 | candle-transformers/src/models/quantized_glm4.rs:107-129 | candle-transformers/src/models/quantized_qwen3.rs:103-133 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Duplicated block (69 lines × 2) candle-transformers/src/models/paddleocr_vl/mod.rs:307— candle-transformers/src/models/paddleocr_vl/mod.rs:307-375 | candle-transformers/src/models/paddleocr_vl/mod.rs:425-493 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (69 lines × 2) candle-wasm-examples/t5/src/bin/m-quantized.rs:51— candle-wasm-examples/t5/src/bin/m-quantized.rs:51-119 | candle-wasm-examples/t5/src/bin/m.rs:48-116 — before extracting anything, compare `candle-wasm-examples/t5/src/bin/m-quantized.rs` and `candle-wasm-examples/t5/src/bin/m.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (35 lines × 2) candle-core/src/cuda_backend/cudnn.rs:90— candle-core/src/cuda_backend/cudnn.rs:90-124 | candle-core/src/cuda_backend/cudnn.rs:191-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (35 lines × 2) candle-core/src/quantized/k_quants.rs:1243— candle-core/src/quantized/k_quants.rs:1243-1277 | candle-core/src/quantized/k_quants.rs:1341-1375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31 lines × 2) candle-core/src/cpu/avx.rs:261— candle-core/src/cpu/avx.rs:261-291 | candle-core/src/cpu/neon.rs:468-498 — before extracting anything, compare `candle-core/src/cpu/avx.rs` and `candle-core/src/cpu/neon.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (31 lines × 2) candle-transformers/src/models/encodec.rs:192— candle-transformers/src/models/encodec.rs:192-222 | candle-transformers/src/models/mimi/quantization.rs:22-52 — before extracting anything, compare `candle-transformers/src/models/encodec.rs` and `candle-transformers/src/models/mimi/quantization.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 4) candle-core/src/quantized/neon.rs:603— candle-core/src/quantized/neon.rs:603-623 | candle-core/src/quantized/neon.rs:764-784 | candle-core/src/quantized/neon.rs:2765-2785 | candle-core/src/quantized/neon.rs:3054-3074 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21 lines × 4) candle-transformers/src/models/granite.rs:232— candle-transformers/src/models/granite.rs:232-252 | candle-transformers/src/models/granitemoehybrid.rs:281-301 | candle-transformers/src/models/llama.rs:278-298 | candle-transformers/src/models/voxtral/voxtral_llama.rs:192-212 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19–20 lines × 2) candle-core/src/quantized/k_quants.rs:345— candle-core/src/quantized/k_quants.rs:345-364 | candle-core/src/quantized/k_quants.rs:556-574 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–20 lines × 2) candle-flash-attn-v3/src/lib.rs:614— candle-flash-attn-v3/src/lib.rs:614-632 | candle-flash-attn/src/lib.rs:710-729 — before extracting anything, compare `candle-flash-attn-v3/src/lib.rs` and `candle-flash-attn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16–18 lines × 2) candle-transformers/src/models/fastvit.rs:260— candle-transformers/src/models/fastvit.rs:260-275 | candle-transformers/src/models/mobileone.rs:191-208 — before extracting anything, compare `candle-transformers/src/models/fastvit.rs` and `candle-transformers/src/models/mobileone.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16–18 lines × 2) candle-transformers/src/models/quantized_glm4.rs:438— candle-transformers/src/models/quantized_glm4.rs:438-455 | candle-transformers/src/models/quantized_qwen3.rs:546-561 — before extracting anything, compare `candle-transformers/src/models/quantized_glm4.rs` and `candle-transformers/src/models/quantized_qwen3.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 4) candle-transformers/src/models/quantized_rwkv_v5.rs:227— candle-transformers/src/models/quantized_rwkv_v5.rs:227-243 | candle-transformers/src/models/quantized_rwkv_v6.rs:274-290 | candle-transformers/src/models/rwkv_v5.rs:274-290 | candle-transformers/src/models/rwkv_v6.rs:248-264 — before extracting anything, compare `candle-transformers/src/models/quantized_rwkv_v5.rs` and `candle-transformers/src/models/quantized_rwkv_v6.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 4) candle-transformers/src/models/quantized_rwkv_v5.rs:272— candle-transformers/src/models/quantized_rwkv_v5.rs:272-288 | candle-transformers/src/models/quantized_rwkv_v6.rs:319-335 | candle-transformers/src/models/rwkv_v5.rs:319-335 | candle-transformers/src/models/rwkv_v6.rs:293-309 — before extracting anything, compare `candle-transformers/src/models/quantized_rwkv_v5.rs` and `candle-transformers/src/models/quantized_rwkv_v6.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (2–16 lines × 4) candle-transformers/src/models/quantized_rwkv_v5.rs:132— candle-transformers/src/models/quantized_rwkv_v5.rs:132-147 | candle-transformers/src/models/quantized_rwkv_v6.rs:183-184 | candle-transformers/src/models/rwkv_v5.rs:183-198 | candle-transformers/src/models/rwkv_v6.rs:161-162 — before extracting anything, compare `candle-transformers/src/models/quantized_rwkv_v5.rs` and `candle-transformers/src/models/quantized_rwkv_v6.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (2–16 lines × 4) candle-transformers/src/models/quantized_rwkv_v5.rs:183— candle-transformers/src/models/quantized_rwkv_v5.rs:183-198 | candle-transformers/src/models/quantized_rwkv_v6.rs:230-245 | candle-transformers/src/models/rwkv_v5.rs:233-234 | candle-transformers/src/models/rwkv_v6.rs:207-208 — before extracting anything, compare `candle-transformers/src/models/quantized_rwkv_v5.rs` and `candle-transformers/src/models/quantized_rwkv_v6.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 5) candle-transformers/src/models/csm.rs:196— candle-transformers/src/models/csm.rs:196-208 | candle-transformers/src/models/helium.rs:203-215 | candle-transformers/src/models/mistral.rs:252-264 | candle-transformers/src/models/nvembed_v2/embedding.rs:134-147 | candle-transformers/src/models/quantized_mistral.rs:151-163 — before extracting anything, compare `candle-transformers/src/models/csm.rs` and `candle-transformers/src/models/helium.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 5) candle-transformers/src/models/glm4_new.rs:337— candle-transformers/src/models/glm4_new.rs:337-350 | candle-transformers/src/models/quantized_glm4.rs:436-449 | candle-transformers/src/models/quantized_qwen3.rs:544-556 | candle-transformers/src/models/qwen3_moe.rs:307-320 | candle-transformers/src/models/smol/smollm3.rs:402-415 — before extracting anything, compare `candle-transformers/src/models/glm4_new.rs` and `candle-transformers/src/models/quantized_glm4.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 3) candle-transformers/src/models/chinese_clip/vision_model.rs:178— candle-transformers/src/models/chinese_clip/vision_model.rs:178-191 | candle-transformers/src/models/clip/text_model.rs:145-157 | candle-transformers/src/models/stable_diffusion/clip.rs:225-237 — before extracting anything, compare `candle-transformers/src/models/chinese_clip/vision_model.rs` and `candle-transformers/src/models/clip/text_model.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 3) candle-wasm-examples/llama2-c/src/app.rs:11— candle-wasm-examples/llama2-c/src/app.rs:11-23 | candle-wasm-examples/whisper/src/app.rs:20-32 | candle-wasm-examples/yolo/src/app.rs:10-23 — before extracting anything, compare `candle-wasm-examples/llama2-c/src/app.rs` and `candle-wasm-examples/whisper/src/app.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 5) candle-transformers/src/models/mixtral.rs:161— candle-transformers/src/models/mixtral.rs:161-173 | candle-transformers/src/models/quantized_mistral.rs:126-138 | candle-transformers/src/models/qwen2.rs:139-151 | candle-transformers/src/models/qwen2_moe.rs:146-158 | candle-transformers/src/models/yi.rs:178-190 — before extracting anything, compare `candle-transformers/src/models/mixtral.rs` and `candle-transformers/src/models/quantized_mistral.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 190 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 5) candle-transformers/src/models/stable_diffusion/mod.rs:111— candle-transformers/src/models/stable_diffusion/mod.rs:111-123 | candle-transformers/src/models/stable_diffusion/mod.rs:186-198 | candle-transformers/src/models/stable_diffusion/mod.rs:269-281 | candle-transformers/src/models/stable_diffusion/mod.rs:341-353 | candle-transformers/src/models/stable_diffusion/mod.rs:436-448 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) candle-transformers/src/models/chatglm.rs:200— candle-transformers/src/models/chatglm.rs:200-212 | candle-transformers/src/models/codegeex4_9b.rs:221-233 | candle-transformers/src/models/glm4.rs:242-254 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) candle-transformers/src/models/granite.rs:324— candle-transformers/src/models/granite.rs:324-336 | candle-transformers/src/models/granitemoehybrid.rs:374-386 | candle-transformers/src/models/llama.rs:371-383 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–13 lines × 2) candle-transformers/src/models/quantized_gemma3.rs:417— candle-transformers/src/models/quantized_gemma3.rs:417-429 | candle-transformers/src/models/quantized_phi.rs:252-262 — before extracting anything, compare `candle-transformers/src/models/quantized_gemma3.rs` and `candle-transformers/src/models/quantized_phi.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–13 lines × 2) candle-transformers/src/models/quantized_rwkv_v5.rs:65— candle-transformers/src/models/quantized_rwkv_v5.rs:65-77 | candle-transformers/src/models/quantized_rwkv_v6.rs:80-90 — before extracting anything, compare `candle-transformers/src/models/quantized_rwkv_v5.rs` and `candle-transformers/src/models/quantized_rwkv_v6.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 4) candle-transformers/src/models/granite.rs:290— candle-transformers/src/models/granite.rs:290-301 | candle-transformers/src/models/lfm2.rs:383-394 | candle-transformers/src/models/llama.rs:336-347 | candle-transformers/src/models/voxtral/voxtral_llama.rs:250-261 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/lfm2.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 4) candle-transformers/src/models/paddleocr_vl/mod.rs:526— candle-transformers/src/models/paddleocr_vl/mod.rs:526-537 | candle-transformers/src/models/paddleocr_vl/mod.rs:586-597 | candle-transformers/src/models/paddleocr_vl/mod.rs:651-662 | candle-transformers/src/models/paddleocr_vl/mod.rs:856-867 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–12 lines × 4) candle-transformers/src/models/llama2_c.rs:200— candle-transformers/src/models/llama2_c.rs:200-211 | candle-transformers/src/models/quantized_llama2_c.rs:87-98 | candle-wasm-examples/llama2-c/src/model.rs:118-120 | candle-wasm-examples/llama2-c/src/model.rs:125-127 — before extracting anything, compare `candle-transformers/src/models/llama2_c.rs` and `candle-transformers/src/models/quantized_llama2_c.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–12 lines × 4) candle-transformers/src/models/quantized_rwkv_v5.rs:123— candle-transformers/src/models/quantized_rwkv_v5.rs:123-125 | candle-transformers/src/models/quantized_rwkv_v6.rs:164-175 | candle-transformers/src/models/rwkv_v5.rs:174-176 | candle-transformers/src/models/rwkv_v6.rs:142-153 — before extracting anything, compare `candle-transformers/src/models/quantized_rwkv_v5.rs` and `candle-transformers/src/models/quantized_rwkv_v6.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 5) candle-nn/src/attention/cpu_flash/causal.rs:283— candle-nn/src/attention/cpu_flash/causal.rs:283-292 | candle-nn/src/attention/cpu_flash/causal.rs:369-378 | candle-nn/src/attention/cpu_flash/causal.rs:449-458 | candle-nn/src/attention/cpu_flash/causal.rs:688-697 | candle-nn/src/attention/cpu_flash/causal.rs:785-794 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 5) candle-transformers/src/models/gemma.rs:250— candle-transformers/src/models/gemma.rs:250-259 | candle-transformers/src/models/gemma2.rs:250-259 | candle-transformers/src/models/gemma3.rs:273-282 | candle-transformers/src/models/gemma4/text.rs:367-376 | candle-transformers/src/models/phi3.rs:252-261 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–8 lines × 4) candle-core/src/quantized/avx.rs:166— candle-core/src/quantized/avx.rs:166-171 | candle-core/src/quantized/avx.rs:188-193 | candle-core/src/quantized/avx.rs:271-278 | candle-core/src/quantized/avx.rs:399-404 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6–8 lines × 4) candle-transformers/src/models/gemma3.rs:417— candle-transformers/src/models/gemma3.rs:417-422 | candle-transformers/src/models/gemma4/text.rs:505-510 | candle-transformers/src/models/quantized_gemma3.rs:170-175 | candle-transformers/src/models/qwen3_vl/mod.rs:41-48 — before extracting anything, compare `candle-transformers/src/models/gemma3.rs` and `candle-transformers/src/models/gemma4/text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7–8 lines × 2) candle-transformers/src/models/pixtral/vision_model.rs:122— candle-transformers/src/models/pixtral/vision_model.rs:122-129 | candle-transformers/src/models/siglip.rs:426-432 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7–8 lines × 2) candle-transformers/src/models/resnet.rs:47— candle-transformers/src/models/resnet.rs:47-53 | candle-transformers/src/models/resnet.rs:156-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 5) candle-core/src/quantized/repack.rs:460— candle-core/src/quantized/repack.rs:460-465 | candle-core/src/quantized/repack.rs:496-501 | candle-core/src/quantized/repack.rs:540-545 | candle-core/src/quantized/repack.rs:631-636 | candle-core/src/quantized/repack.rs:665-670 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 5) candle-transformers/src/models/granite.rs:296— candle-transformers/src/models/granite.rs:296-301 | candle-transformers/src/models/granitemoehybrid.rs:346-351 | candle-transformers/src/models/lfm2.rs:389-394 | candle-transformers/src/models/llama.rs:342-347 | candle-transformers/src/models/voxtral/voxtral_llama.rs:256-261 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–5 lines × 5) candle-transformers/src/models/marian.rs:217— candle-transformers/src/models/marian.rs:217-221 | candle-transformers/src/models/mixformer.rs:151-155 | candle-transformers/src/models/mixtral.rs:88-91 | candle-transformers/src/models/quantized_mixformer.rs:63-67 | candle-transformers/src/models/yi.rs:86-90 — before extracting anything, compare `candle-transformers/src/models/mixformer.rs` and `candle-transformers/src/models/quantized_mixformer.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–5 lines × 5) candle-transformers/src/models/granite.rs:396— candle-transformers/src/models/granite.rs:396-400 | candle-transformers/src/models/llama.rs:443-447 | candle-transformers/src/models/llama2_c.rs:314-317 | candle-transformers/src/models/quantized_llama2_c.rs:201-204 | candle-transformers/src/models/voxtral/voxtral_llama.rs:367-371 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/llama.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 297 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–5 lines × 3) candle-core/src/quantized/k_quants.rs:902— candle-core/src/quantized/k_quants.rs:902-905 | candle-core/src/quantized/k_quants.rs:1565-1569 | candle-core/src/quantized/k_quants.rs:1831-1835 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (4–5 lines × 3) candle-core/src/quantized/neon.rs:1296— candle-core/src/quantized/neon.rs:1296-1299 | candle-core/src/quantized/neon.rs:1604-1608 | candle-core/src/quantized/neon.rs:1722-1726 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 6) candle-metal-kernels/src/kernels/reduce.rs:141— candle-metal-kernels/src/kernels/reduce.rs:141-153 | candle-metal-kernels/src/kernels/reduce.rs:197-209 | candle-metal-kernels/src/kernels/reduce.rs:258-270 | candle-metal-kernels/src/kernels/reduce.rs:321-330 | candle-metal-kernels/src/kernels/reduce.rs:363-372 | candle-metal-kernels/src/kernels/reduce.rs:406-415 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 6) candle-core/src/storage.rs:397— candle-core/src/storage.rs:397-406 | candle-core/src/storage.rs:428-437 | candle-core/src/storage.rs:459-468 | candle-core/src/storage.rs:490-499 | candle-core/src/storage.rs:764-773 | candle-core/src/storage.rs:795-804 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–5 lines × 4) candle-core/src/cuda_backend/mod.rs:544— candle-core/src/cuda_backend/mod.rs:544-546 | candle-core/src/cuda_backend/mod.rs:597-601 | candle-core/src/cuda_backend/mod.rs:651-655 | candle-core/src/cuda_backend/mod.rs:703-707 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–5 lines × 4) candle-core/src/cpu_backend/mod.rs:1425— candle-core/src/cpu_backend/mod.rs:1425-1429 | candle-core/src/cpu_backend/mod.rs:1433-1437 | candle-core/src/cuda_backend/mod.rs:1462-1464 | candle-core/src/cuda_backend/mod.rs:1474-1476 — `candle-core/src/cpu_backend/mod.rs` and `candle-core/src/cuda_backend/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
AC3 · Page structure· Page without a main landmark · ×1
Page without a main landmark candle-wasm-examples/quant-qwen3/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC3 · Page structure· Heading level jumps from h1 to h3 · ×1
Heading level jumps from h1 to h3 candle-wasm-examples/quant-qwen3/index.html:307— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 13 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
candle_onnx::eval::simple_eval_ (cyclomatic 345) candle-onnx/src/eval.rs:250— candle_onnx::eval::simple_eval_ has cyclomatic complexity 345 (threshold 15). Of this number, 344 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MetalStorage::reduce_op (cyclomatic 72) candle-core/src/metal_backend/mod.rs:298— MetalStorage::reduce_op has cyclomatic complexity 72 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: MetalStorage::unary_impl (cyclomatic 111) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
Stack::read (cyclomatic 44) candle-core/src/pickle.rs:437— Stack::read has cyclomatic complexity 44 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Header::parse (cyclomatic 30) candle-core/src/npy.rs:109— Header::parse has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
CpuStorage::concat (cyclomatic 28) candle-core/src/cpu_backend/mod.rs:1756— CpuStorage::concat has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: CpuStorage::to_dtype (cyclomatic 102) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
Sdpa::metal_fwd (cyclomatic 28) candle-nn/src/ops.rs:1033— Sdpa::metal_fwd has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VoxtralForConditionalGeneration::generate (cyclomatic 26) candle-transformers/src/models/voxtral/model.rs:873— VoxtralForConditionalGeneration::generate has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TensorFormatter::fmt_tensor (cyclomatic 24) candle-core/src/display.rs:203— TensorFormatter::fmt_tensor has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Qwen3VLModel::forward (cyclomatic 24) candle-transformers/src/models/qwen3_vl/mod.rs:57— Qwen3VLModel::forward has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CudaStorage::copy_strided_src (cyclomatic 22) candle-core/src/cuda_backend/mod.rs:2362— CudaStorage::copy_strided_src has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Tokenizer::from_gguf (cyclomatic 20) candle-core/src/quantized/tokenizer.rs:203— Tokenizer::from_gguf has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PackedKind::select (cyclomatic 19) candle-core/src/quantized/repack.rs:287— PackedKind::select has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
stub.pyi_file (cyclomatic 18) candle-pyo3/stub.py:87— stub.pyi_file has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UpsampleBilinear2D::f (cyclomatic 17) candle-core/src/cpu_backend/mod.rs:551— UpsampleBilinear2D::f has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: CpuStorage::to_dtype (cyclomatic 102) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
BlockQ3K::from_float (cyclomatic 17) candle-core/src/quantized/k_quants.rs:1197— BlockQ3K::from_float has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RotaryEmb::cpu_fwd (cyclomatic 16) candle-nn/src/rotary_emb.rs:319— RotaryEmb::cpu_fwd has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (inner). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
LLaVA::prepare_inputs_labels_for_multimodal (cyclomatic 16) candle-transformers/src/models/llava/mod.rs:238— LLaVA::prepare_inputs_labels_for_multimodal has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Quantile::add (cyclomatic 16) candle-transformers/src/models/stable_diffusion/uni_pc.rs:815— Quantile::add has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Hotspot: candle-onnx/src/eval.rs candle-onnx/src/eval.rs:250— candle-onnx/src/eval.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 345 in candle_onnx::eval::simple_eval_ at line 250. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-16..2026-10-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-16 13:15:45 +02:00' --until='2026-10-14 13:15:45 +02:00' --full-history --no-merges -- candle-onnx/src/eval.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
FixmeComment candle-nn/src/ops.rs:63— // FIXME: using `candle::map_dtype` causes compilation errors. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
candle_onnx::eval::simple_eval_ (cognitive 754) candle-onnx/src/eval.rs:250— candle_onnx::eval::simple_eval_ has cognitive complexity 754 (threshold 15). Drivers by points: if/else 198 (513 pts), match/switch 54 (144 pts), loops 27 (83 pts), boolean chains 14 (nesting depth added 461). Of this number, 751 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
VoxtralForConditionalGeneration::generate (cognitive 68) candle-transformers/src/models/voxtral/model.rs:873— VoxtralForConditionalGeneration::generate has cognitive complexity 68 (threshold 15). Drivers by points: if/else 23 (40 pts), match/switch 6 (22 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TensorFormatter::fmt_tensor (cognitive 56) candle-core/src/display.rs:203— TensorFormatter::fmt_tensor has cognitive complexity 56 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 6 (18 pts), match/switch 4 (7 pts), boolean chains 2 (nesting depth added 33). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Qwen3VLModel::forward (cognitive 44) candle-transformers/src/models/qwen3_vl/mod.rs:57— Qwen3VLModel::forward has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 7 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConvTranspose2D::f (cognitive 39) candle-core/src/cpu_backend/mod.rs:1318— ConvTranspose2D::f has cognitive complexity 39 (threshold 15). Drivers by points: loops 9 (25 pts), if/else 2 (12 pts), boolean chains 2 (nesting depth added 26). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Im2Col::f (cognitive 38) candle-core/src/cpu_backend/mod.rs:1159— Im2Col::f has cognitive complexity 38 (threshold 15). Drivers by points: loops 6 (21 pts), if/else 2 (13 pts), boolean chains 4 (nesting depth added 26). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ScatteredCacheBuilder::indices_and_mask (cognitive 38) candle-nn/src/kv_cache.rs:503— ScatteredCacheBuilder::indices_and_mask has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 5 (15 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Sdpa::metal_fwd (cognitive 38) candle-nn/src/ops.rs:1033— Sdpa::metal_fwd has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (24 pts), match/switch 3 (7 pts), boolean chains 6, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReduceIndex::fold_impl (cognitive 37) candle-core/src/cpu_backend/mod.rs:204— ReduceIndex::fold_impl has cognitive complexity 37 (threshold 15). Drivers by points: loops 6 (19 pts), if/else 5 (17 pts), match/switch 1 (nesting depth added 25). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LLaVA::prepare_inputs_labels_for_multimodal (cognitive 37) candle-transformers/src/models/llava/mod.rs:238— LLaVA::prepare_inputs_labels_for_multimodal has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (32 pts), loops 4 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpsampleBilinear2D::f (cognitive 34) candle-core/src/cpu_backend/mod.rs:551— UpsampleBilinear2D::f has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (21 pts), loops 6 (12 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Tokenizer::from_gguf (cognitive 33) candle-core/src/quantized/tokenizer.rs:203— Tokenizer::from_gguf has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (29 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CudaStorage::copy_strided_src (cognitive 32) candle-core/src/cuda_backend/mod.rs:2362— CudaStorage::copy_strided_src has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21 (31 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NdIter::new (cognitive 32) candle-core/src/nditer.rs:46— NdIter::new has cognitive complexity 32 (threshold 15). Drivers by points: loops 8 (17 pts), if/else 8 (15 pts) (nesting depth added 16). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CpuStorage::concat (cognitive 29) candle-core/src/cpu_backend/mod.rs:1756— CpuStorage::concat has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 15 (29 pts) (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
IndexAdd::f (cognitive 29) candle-core/src/cpu_backend/mod.rs:886— IndexAdd::f has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 5 (14 pts), match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stub.pyi_file (cognitive 29) candle-pyo3/stub.py:87— stub.pyi_file has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (10 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MaxPool2D::f (cognitive 28) candle-core/src/cpu_backend/mod.rs:436— MaxPool2D::f has cognitive complexity 28 (threshold 15). Drivers by points: loops 6 (21 pts), if/else 1 (7 pts) (nesting depth added 21). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Header::parse (cognitive 28) candle-core/src/npy.rs:109— Header::parse has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 7 (12 pts), if/else 5 (9 pts), boolean chains 5, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Stack::read (cognitive 28) candle-core/src/pickle.rs:437— Stack::read has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3 (7 pts), match/switch 2 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AttentionWeights::forward (cognitive 28) candle-transformers/src/models/quantized_qwen3.rs:238— AttentionWeights::forward has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 5 (15 pts), if/else 7 (11 pts), boolean chains 2 (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
BarrierPool::new (cognitive 27) candle-core/src/utils.rs:115— BarrierPool::new has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 5 (10 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FloatFormatter::new (cognitive 26) candle-core/src/display.rs:310— FloatFormatter::new has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
RotaryEmb::cpu_fwd::inner (cognitive 26) candle-nn/src/rotary_emb.rs:328— RotaryEmb::cpu_fwd::inner has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (10 pts), match/switch 3, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuantizedAttention::forward (cognitive 25) candle-transformers/src/models/smol/quantized_smollm3.rs:391— QuantizedAttention::forward has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 6 (12 pts), if/else 8 (11 pts), boolean chains 2 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Quantile::add (cognitive 25) candle-transformers/src/models/stable_diffusion/uni_pc.rs:815— Quantile::add has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Module._load_from_state_dict (cognitive 25) candle-pyo3/py_src/candle/nn/module.py:391— Module._load_from_state_dict has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RotaryEmbI::cpu_fwd::inner (cognitive 22) candle-nn/src/rotary_emb.rs:28— RotaryEmbI::cpu_fwd::inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (7 pts), match/switch 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AvgPool2D::f (cognitive 21) candle-core/src/cpu_backend/mod.rs:395— AvgPool2D::f has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ConformerAttention::forward (cognitive 21) candle-transformers/src/models/gemma4/audio.rs:500— ConformerAttention::forward has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18 (21 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ConvTranspose1D::f (cognitive 20) candle-core/src/cpu_backend/mod.rs:1249— ConvTranspose1D::f has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 2 (8 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
VoxtralEncoder::forward_with_training (cognitive 20) candle-transformers/src/models/voxtral/model.rs:501— VoxtralEncoder::forward_with_training has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (19 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BlockQ8K::from_float (cognitive 19) candle-core/src/quantized/k_quants.rs:2359— BlockQ8K::from_float has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 3 (6 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Gather::f (cognitive 18) candle-core/src/cpu_backend/mod.rs:668— Gather::f has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (6 pts), match/switch 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Qwen3VLVisionModel::rot_pos_emb (cognitive 18) candle-transformers/src/models/qwen3_vl/vision.rs:491— Qwen3VLVisionModel::rot_pos_emb has cognitive complexity 18 (threshold 15). Drivers by points: loops 7 (18 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
UNet2DConditionModel::forward_with_additional_residuals (cognitive 18) candle-transformers/src/models/stable_diffusion/unet_2d.rs:309— UNet2DConditionModel::forward_with_additional_residuals has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (6 pts), match/switch 4 (6 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Module.to (cognitive 18) candle-pyo3/py_src/candle/nn/module.py:592— Module.to has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scatter::f (cognitive 17) candle-core/src/cpu_backend/mod.rs:816— Scatter::f has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (8 pts), loops 3 (6 pts), match/switch 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Conv1D::f (cognitive 17) candle-core/src/cpu_backend/mod.rs:1025— Conv1D::f has cognitive complexity 17 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 1 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Im2Col1D::f (cognitive 17) candle-core/src/cpu_backend/mod.rs:1097— Im2Col1D::f has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 1 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
DebertaV2Embeddings::forward (cognitive 17) candle-transformers/src/models/debertav2.rs:197— DebertaV2Embeddings::forward has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReduceSum::fold_impl (cognitive 16) candle-core/src/cpu_backend/mod.rs:312— ReduceSum::fold_impl has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 1 (2 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
QTensor::indexed_gemv (cognitive 16) candle-core/src/quantized/mod.rs:1053— QTensor::indexed_gemv has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MMProjector::load (cognitive 16) candle-transformers/src/models/llava/mod.rs:73— MMProjector::load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (6 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BPE::from_json (cognitive 16) candle-transformers/src/models/metavoice.rs:194— BPE::from_json has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 8 (12 pts), if/else 1 (2 pts), loops 2 (nesting depth added 5). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ShortConvLayer::forward (cognitive 16) candle-transformers/src/models/quantized_lfm2.rs:185— ShortConvLayer::forward has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyFields: Config candle-transformers/src/models/debertav2.rs:46— TooManyFields — 31 stored fields. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication· Near-duplicate member family (15 members, 15 shared lines) · ×1
Near-duplicate member family (15 members, 15 shared lines) candle-transformers/src/models/csm.rs:192— candle-transformers/src/models/csm.rs:192-244 | candle-transformers/src/models/gemma.rs:202-259 | candle-transformers/src/models/gemma2.rs:197-259 | candle-transformers/src/models/helium.rs:199-258 | candle-transformers/src/models/mistral.rs:248-307 | candle-transformers/src/models/mixtral.rs:183-239 | candle-transformers/src/models/olmo.rs:161-221 | candle-transformers/src/models/olmo2.rs:156-209 | candle-transformers/src/models/phi3.rs:205-261 | candle-transformers/src/models/quantized_mistral.rs:147-198 | candle-transformers/src/models/quantized_stable_lm.rs:117-177 | candle-transformers/src/models/qwen2.rs:160-210 | candle-transformers/src/models/qwen2_moe.rs:167-217 | candle-transformers/src/models/stable_lm.rs:240-307 | candle-transformers/src/models/yi.rs:199-248 — These 15 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 15 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 15 times.
D4 · Code Duplication· Near-duplicate member family (14 members, 20 shared lines) · ×1
Near-duplicate member family (14 members, 20 shared lines) candle-transformers/src/models/based.rs:384— candle-transformers/src/models/based.rs:384-433 | candle-transformers/src/models/csm.rs:192-244 | candle-transformers/src/models/gemma.rs:202-259 | candle-transformers/src/models/helium.rs:199-258 | candle-transformers/src/models/mistral.rs:248-307 | candle-transformers/src/models/mixtral.rs:183-239 | candle-transformers/src/models/olmo.rs:161-221 | candle-transformers/src/models/olmo2.rs:156-209 | candle-transformers/src/models/phi3.rs:205-261 | candle-transformers/src/models/quantized_mistral.rs:147-198 | candle-transformers/src/models/qwen2.rs:160-210 | candle-transformers/src/models/qwen2_moe.rs:167-217 | candle-transformers/src/models/starcoder2.rs:163-210 | candle-transformers/src/models/yi.rs:199-248 — These 14 members are variants of one another: a block of 20 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 14 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 14 times.
D4 · Code Duplication· Near-duplicate member family (13 members, 17 shared lines) · ×1
Near-duplicate member family (13 members, 17 shared lines) candle-transformers/src/models/csm.rs:192— candle-transformers/src/models/csm.rs:192-244 | candle-transformers/src/models/gemma.rs:202-259 | candle-transformers/src/models/gemma2.rs:197-259 | candle-transformers/src/models/gemma3.rs:223-282 | candle-transformers/src/models/helium.rs:199-258 | candle-transformers/src/models/mistral.rs:248-307 | candle-transformers/src/models/mixtral.rs:183-239 | candle-transformers/src/models/quantized_mistral.rs:147-198 | candle-transformers/src/models/quantized_stable_lm.rs:117-177 | candle-transformers/src/models/qwen2.rs:160-210 | candle-transformers/src/models/qwen2_moe.rs:167-217 | candle-transformers/src/models/stable_lm.rs:240-307 | candle-transformers/src/models/yi.rs:199-248 — These 13 members are variants of one another: a block of 17 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 13 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 13 times.
D4 · Code Duplication· Near-duplicate member family (12 members, 10 shared lines) · ×1
Near-duplicate member family (12 members, 10 shared lines) candle-transformers/src/models/based.rs:572— candle-transformers/src/models/based.rs:572-587 | candle-transformers/src/models/helium.rs:373-388 | candle-transformers/src/models/mistral.rs:429-444 | candle-transformers/src/models/mixtral.rs:467-482 | candle-transformers/src/models/olmo.rs:331-346 | candle-transformers/src/models/olmo2.rs:326-341 | candle-transformers/src/models/phi3.rs:406-421 | candle-transformers/src/models/quantized_stable_lm.rs:284-300 | candle-transformers/src/models/qwen2_moe.rs:462-477 | candle-transformers/src/models/stable_lm.rs:416-432 | candle-transformers/src/models/starcoder2.rs:329-344 | candle-transformers/src/models/yi.rs:348-363 — These 12 members are variants of one another: a block of 10 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 12 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 12 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 18 shared lines) · ×1
Near-duplicate member family (5 members, 18 shared lines) candle-transformers/src/models/granite.rs:230— candle-transformers/src/models/granite.rs:230-309 | candle-transformers/src/models/granitemoehybrid.rs:279-359 | candle-transformers/src/models/lfm2.rs:327-405 | candle-transformers/src/models/llama.rs:276-356 | candle-transformers/src/models/voxtral/voxtral_llama.rs:190-274 — These 5 members are variants of one another: a block of 18 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 42 shared lines) · ×1
Near-duplicate member family (4 members, 42 shared lines) candle-flash-attn-v3/src/lib.rs:41— candle-flash-attn-v3/src/lib.rs:41-240 | candle-flash-attn-v3/src/lib.rs:455-685 | candle-flash-attn/src/lib.rs:32-220 | candle-flash-attn/src/lib.rs:475-821 — These 4 members are variants of one another: a block of 42 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 25 shared lines) · ×1
Near-duplicate member family (4 members, 25 shared lines) candle-transformers/src/models/quantized_rwkv_v5.rs:104— candle-transformers/src/models/quantized_rwkv_v5.rs:104-163 | candle-transformers/src/models/quantized_rwkv_v6.rs:135-210 | candle-transformers/src/models/rwkv_v5.rs:155-214 | candle-transformers/src/models/rwkv_v6.rs:113-188 — These 4 members are variants of one another: a block of 25 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 24 shared lines) · ×1
Near-duplicate member family (4 members, 24 shared lines) candle-core/src/quantized/neon.rs:596— candle-core/src/quantized/neon.rs:596-668 | candle-core/src/quantized/neon.rs:757-844 | candle-core/src/quantized/neon.rs:2759-2820 | candle-core/src/quantized/neon.rs:3048-3104 — These 4 members are variants of one another: a block of 24 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 22 shared lines) · ×1
Near-duplicate member family (4 members, 22 shared lines) candle-transformers/src/models/paddleocr_vl/mod.rs:518— candle-transformers/src/models/paddleocr_vl/mod.rs:518-558 | candle-transformers/src/models/paddleocr_vl/mod.rs:578-619 | candle-transformers/src/models/paddleocr_vl/mod.rs:642-683 | candle-transformers/src/models/paddleocr_vl/mod.rs:819-889 — These 4 members are variants of one another: a block of 22 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 14 shared lines) · ×1
Near-duplicate member family (4 members, 14 shared lines) candle-core/src/quantized/k_quants.rs:1558— candle-core/src/quantized/k_quants.rs:1558-1617 | candle-core/src/quantized/k_quants.rs:1619-1683 | candle-core/src/quantized/k_quants.rs:1824-1898 | candle-core/src/quantized/k_quants.rs:1900-1981 — These 4 members are variants of one another: a block of 14 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 9 shared lines) · ×1
Near-duplicate member family (4 members, 9 shared lines) candle-core/src/cuda_backend/mod.rs:521— candle-core/src/cuda_backend/mod.rs:521-564 | candle-core/src/cuda_backend/mod.rs:576-618 | candle-core/src/cuda_backend/mod.rs:630-670 | candle-core/src/cuda_backend/mod.rs:682-722 — These 4 members are variants of one another: a block of 9 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 39 shared lines) · ×1
Near-duplicate member family (3 members, 39 shared lines) candle-nn/src/rotary_emb.rs:27— candle-nn/src/rotary_emb.rs:27-103 | candle-nn/src/rotary_emb.rs:327-408 | candle-nn/src/rotary_emb.rs:618-682 — These 3 members are variants of one another: a block of 39 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 21 shared lines) · ×1
Near-duplicate member family (3 members, 21 shared lines) candle-transformers/src/models/quantized_lfm2.rs:126— candle-transformers/src/models/quantized_lfm2.rs:126-181 | candle-transformers/src/models/quantized_llama.rs:196-266 | candle-transformers/src/models/quantized_qwen2.rs:84-147 — These 3 members are variants of one another: a block of 21 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 4 shared lines) · ×1
Near-duplicate member family (3 members, 4 shared lines) candle-transformers/src/models/gemma.rs:346— candle-transformers/src/models/gemma.rs:346-369 | candle-transformers/src/models/gemma2.rs:365-390 | candle-transformers/src/models/nvembed_v2/embedding.rs:228-245 — These 3 members are variants of one another: a block of 4 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (97 shared lines) candle-transformers/src/models/quantized_t5.rs:327— candle-transformers/src/models/quantized_t5.rs:327-447 | candle-transformers/src/models/t5.rs:456-577 — These two members are variants of one another: 97 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (74 shared lines) candle-core/src/cpu_backend/mod.rs:1540— candle-core/src/cpu_backend/mod.rs:1540-1622 | candle-core/src/cpu_backend/mod.rs:1631-1740 — These two members are variants of one another: 74 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (61 shared lines) candle-core/src/quantized/neon.rs:2310— candle-core/src/quantized/neon.rs:2310-2443 | candle-core/src/quantized/neon.rs:2447-2580 — These two members are variants of one another: 61 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (59 shared lines) candle-core/src/cuda_backend/cudnn.rs:37— candle-core/src/cuda_backend/cudnn.rs:37-124 | candle-core/src/cuda_backend/cudnn.rs:136-225 — These two members are variants of one another: 59 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (54 shared lines) candle-core/src/quantized/k_quants.rs:2131— candle-core/src/quantized/k_quants.rs:2131-2201 | candle-core/src/quantized/k_quants.rs:2203-2281 — These two members are variants of one another: 54 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (49 shared lines) candle-core/src/quantized/k_quants.rs:1197— candle-core/src/quantized/k_quants.rs:1197-1277 | candle-core/src/quantized/k_quants.rs:1279-1375 — These two members are variants of one another: 49 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (46 shared lines) candle-transformers/src/models/mpt.rs:87— candle-transformers/src/models/mpt.rs:87-142 | candle-transformers/src/models/quantized_mpt.rs:64-119 — These two members are variants of one another: 46 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (42 shared lines) candle-core/src/quantized/neon.rs:1578— candle-core/src/quantized/neon.rs:1578-1691 | candle-core/src/quantized/neon.rs:1695-1794 — These two members are variants of one another: 42 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (37 shared lines) candle-core/src/metal_backend/mod.rs:186— candle-core/src/metal_backend/mod.rs:186-240 | candle-core/src/metal_backend/mod.rs:242-296 — These two members are variants of one another: 37 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (35 shared lines) candle-transformers/src/models/llama2_c.rs:174— candle-transformers/src/models/llama2_c.rs:174-215 | candle-transformers/src/models/quantized_llama2_c.rs:61-102 — These two members are variants of one another: 35 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (33 shared lines) candle-transformers/src/models/metavoice.rs:789— candle-transformers/src/models/metavoice.rs:789-831 | candle-transformers/src/models/quantized_metavoice.rs:92-134 — These two members are variants of one another: 33 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (32 shared lines) candle-transformers/src/models/mixformer.rs:283— candle-transformers/src/models/mixformer.rs:283-337 | candle-transformers/src/models/quantized_mixformer.rs:203-252 — These two members are variants of one another: 32 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (24 shared lines) candle-transformers/src/models/paddleocr_vl/vision.rs:478— candle-transformers/src/models/paddleocr_vl/vision.rs:478-565 | candle-transformers/src/models/qwen3_vl/vision.rs:127-175 — These two members are variants of one another: 24 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (55 corresponding lines) · ×1
Edited copy of a member (55 corresponding lines) candle-transformers/src/models/quantized_recurrent_gemma.rs:220— candle-transformers/src/models/quantized_recurrent_gemma.rs:220-274 | candle-transformers/src/models/recurrent_gemma.rs:453-507 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (45 corresponding lines) · ×1
Edited copy of a member (45 corresponding lines) candle-transformers/src/models/marian.rs:297— candle-transformers/src/models/marian.rs:297-341 | candle-transformers/src/models/trocr.rs:211-255 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (48 corresponding lines) · ×1
Edited copy of a member (48 corresponding lines) candle-transformers/src/models/codegeex4_9b.rs:157— candle-transformers/src/models/codegeex4_9b.rs:157-204 | candle-transformers/src/models/glm4.rs:178-225 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) candle-transformers/src/models/flux/model.rs:403— candle-transformers/src/models/flux/model.rs:403-439 | candle-transformers/src/models/flux/quantized_model.rs:242-278 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) candle-transformers/src/models/llama2_c_weights.rs:80— candle-transformers/src/models/llama2_c_weights.rs:80-110 | candle-wasm-examples/llama2-c/src/worker.rs:161-191 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×1
Edited copy of a member (32 corresponding lines) candle-transformers/src/models/qwen3.rs:192— candle-transformers/src/models/qwen3.rs:192-241 | candle-transformers/src/models/z_image/text_encoder.rs:271-318 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) candle-transformers/src/models/quantized_qwen3.rs:238— candle-transformers/src/models/quantized_qwen3.rs:238-378 | candle-transformers/src/models/qwen3.rs:192-241 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×1
Edited copy of a member (13 corresponding lines) candle-transformers/src/models/glm4_new.rs:65— candle-transformers/src/models/glm4_new.rs:65-77 | candle-transformers/src/models/quantized_glm4.rs:131-143 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×1
Edited copy of a member (11 corresponding lines) candle-transformers/src/models/flux/model.rs:316— candle-transformers/src/models/flux/model.rs:316-326 | candle-transformers/src/models/flux/quantized_model.rs:155-165 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×1
Edited copy of a member (14 corresponding lines) candle-core/src/safetensors.rs:442— candle-core/src/safetensors.rs:442-460 | candle-core/src/safetensors.rs:469-495 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×1
Edited copy of a member (15 corresponding lines) candle-transformers/src/models/moondream.rs:136— candle-transformers/src/models/moondream.rs:136-152 | candle-transformers/src/models/quantized_moondream.rs:69-84 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×1
Edited copy of a member (12 corresponding lines) candle-core/src/cpu/neon.rs:539— candle-core/src/cpu/neon.rs:539-558 | candle-core/src/cpu/neon.rs:596-611 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×1
Edited copy of a member (20 corresponding lines) candle-transformers/src/models/encodec.rs:493— candle-transformers/src/models/encodec.rs:493-519 | candle-transformers/src/models/mimi/conv.rs:289-312 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (15 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (15 members, 50+ identical tokens) candle-transformers/src/models/based.rs:314— candle-transformers/src/models/based.rs:314-331 | candle-transformers/src/models/gemma.rs:83-100 | candle-transformers/src/models/gemma2.rs:76-93 | candle-transformers/src/models/glm4_new.rs:38-63 | candle-transformers/src/models/olmo.rs:44-61 | candle-transformers/src/models/olmo2.rs:36-53 | candle-transformers/src/models/qwen2.rs:47-64 | candle-transformers/src/models/qwen2_moe.rs:55-72 | candle-transformers/src/models/qwen3.rs:42-59 | candle-transformers/src/models/recurrent_gemma.rs:107-128 | candle-transformers/src/models/smol/quantized_smollm3.rs:177-210 | candle-transformers/src/models/smol/smollm3.rs:72-89 | candle-transformers/src/models/stable_lm.rs:92-110 | candle-transformers/src/models/starcoder2.rs:52-70 | candle-transformers/src/models/z_image/text_encoder.rs:114-131 — These 15 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 15 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 15 times.
D4 · Code Duplication· Members sharing a duplicated core (14 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (14 members, 50+ identical tokens) candle-transformers/src/models/based.rs:314— candle-transformers/src/models/based.rs:314-331 | candle-transformers/src/models/gemma.rs:83-100 | candle-transformers/src/models/gemma2.rs:76-93 | candle-transformers/src/models/gemma3.rs:76-98 | candle-transformers/src/models/gemma4/text.rs:68-83 | candle-transformers/src/models/glm4_new.rs:38-63 | candle-transformers/src/models/modernbert.rs:60-77 | candle-transformers/src/models/nvembed_v2/embedding.rs:18-36 | candle-transformers/src/models/olmo.rs:44-61 | candle-transformers/src/models/olmo2.rs:36-53 | candle-transformers/src/models/quantized_glm4.rs:107-129 | candle-transformers/src/models/qwen2.rs:47-64 | candle-transformers/src/models/qwen2_moe.rs:55-72 | candle-transformers/src/models/stella_en_v5.rs:144-189 — These 14 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 14 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 14 times.
D4 · Code Duplication· Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (10 members, 50+ identical tokens) candle-transformers/src/models/mistral.rs:163— candle-transformers/src/models/mistral.rs:163-175 | candle-transformers/src/models/nvembed_v2/embedding.rs:63-75 | candle-transformers/src/models/olmo.rs:88-100 | candle-transformers/src/models/olmo2.rs:80-92 | candle-transformers/src/models/quantized_mistral.rs:78-90 | candle-transformers/src/models/quantized_stable_lm.rs:36-49 | candle-transformers/src/models/qwen2.rs:91-103 | candle-transformers/src/models/qwen2_moe.rs:99-110 | candle-transformers/src/models/stable_lm.rs:140-153 | candle-transformers/src/models/yi.rs:130-142 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
Duplicated block (55 lines × 2) candle-onnx/src/eval.rs:1326— candle-onnx/src/eval.rs:1326-1380 | candle-onnx/src/eval.rs:1435-1489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (38–52 lines × 4) candle-transformers/src/models/mobilenetv4.rs:97— candle-transformers/src/models/mobilenetv4.rs:97-134 | candle-transformers/src/models/mobilenetv4.rs:140-186 | candle-transformers/src/models/mobilenetv4.rs:192-233 | candle-transformers/src/models/mobilenetv4.rs:239-290 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (49 lines × 3) candle-transformers/src/models/chatglm.rs:242— candle-transformers/src/models/chatglm.rs:242-290 | candle-transformers/src/models/codegeex4_9b.rs:263-311 | candle-transformers/src/models/glm4.rs:284-332 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (48 lines × 2) candle-transformers/src/models/quantized_t5.rs:355— candle-transformers/src/models/quantized_t5.rs:355-402 | candle-transformers/src/models/t5.rs:484-531 — before extracting anything, compare `candle-transformers/src/models/quantized_t5.rs` and `candle-transformers/src/models/t5.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 364 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (46 lines × 3) candle-transformers/src/models/beit.rs:345— candle-transformers/src/models/beit.rs:345-390 | candle-transformers/src/models/dinov2.rs:332-377 | candle-transformers/src/models/eva2.rs:373-418 — before extracting anything, compare `candle-transformers/src/models/beit.rs` and `candle-transformers/src/models/dinov2.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (40–43 lines × 2) candle-transformers/src/models/paddleocr_vl/vision.rs:718— candle-transformers/src/models/paddleocr_vl/vision.rs:718-760 | candle-transformers/src/models/paddleocr_vl/vision.rs:793-832 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (40 lines × 3) candle-transformers/src/models/chatglm.rs:292— candle-transformers/src/models/chatglm.rs:292-331 | candle-transformers/src/models/codegeex4_9b.rs:313-352 | candle-transformers/src/models/glm4.rs:334-373 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (39 lines × 2) candle-transformers/src/models/marian.rs:303— candle-transformers/src/models/marian.rs:303-341 | candle-transformers/src/models/trocr.rs:217-255 — before extracting anything, compare `candle-transformers/src/models/marian.rs` and `candle-transformers/src/models/trocr.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (38 lines × 3) candle-transformers/src/models/chatglm.rs:381— candle-transformers/src/models/chatglm.rs:381-418 | candle-transformers/src/models/codegeex4_9b.rs:402-439 | candle-transformers/src/models/glm4.rs:423-460 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (37–38 lines × 2) candle-core/src/cpu_backend/mod.rs:2888— candle-core/src/cpu_backend/mod.rs:2888-2925 | candle-core/src/cuda_backend/mod.rs:1967-2003 — `candle-core/src/cpu_backend/mod.rs` and `candle-core/src/cuda_backend/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (38 lines × 2) candle-onnx/src/eval.rs:1876— candle-onnx/src/eval.rs:1876-1913 | candle-onnx/src/eval.rs:2086-2123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (36 lines × 2) candle-transformers/src/models/whisper/audio.rs:18— candle-transformers/src/models/whisper/audio.rs:18-53 | candle-wasm-examples/whisper/src/audio.rs:12-47 — before extracting anything, compare `candle-transformers/src/models/whisper/audio.rs` and `candle-wasm-examples/whisper/src/audio.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (4–35 lines × 3) candle-core/src/quantized/neon.rs:1046— candle-core/src/quantized/neon.rs:1046-1080 | candle-core/src/quantized/neon.rs:1500-1534 | candle-core/src/quantized/neon.rs:2239-2242 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (34–35 lines × 2) candle-transformers/src/models/qwen3.rs:130— candle-transformers/src/models/qwen3.rs:130-164 | candle-transformers/src/models/z_image/text_encoder.rs:220-253 — before extracting anything, compare `candle-transformers/src/models/qwen3.rs` and `candle-transformers/src/models/z_image/text_encoder.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 181 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (33–34 lines × 3) candle-transformers/src/models/paddleocr_vl/mod.rs:526— candle-transformers/src/models/paddleocr_vl/mod.rs:526-558 | candle-transformers/src/models/paddleocr_vl/mod.rs:586-619 | candle-transformers/src/models/paddleocr_vl/mod.rs:651-683 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (33 lines × 4) candle-transformers/src/models/granite.rs:255— candle-transformers/src/models/granite.rs:255-287 | candle-transformers/src/models/granitemoehybrid.rs:304-336 | candle-transformers/src/models/llama.rs:301-333 | candle-transformers/src/models/voxtral/voxtral_llama.rs:215-247 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (33 lines × 3) candle-transformers/src/models/granite.rs:126— candle-transformers/src/models/granite.rs:126-158 | candle-transformers/src/models/granitemoehybrid.rs:169-201 | candle-transformers/src/models/llama.rs:170-202 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (32–33 lines × 2) candle-core/src/quantized/k_quants.rs:2151— candle-core/src/quantized/k_quants.rs:2151-2182 | candle-core/src/quantized/k_quants.rs:2230-2262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (32 lines × 3) candle-transformers/src/models/chatglm.rs:460— candle-transformers/src/models/chatglm.rs:460-491 | candle-transformers/src/models/codegeex4_9b.rs:481-512 | candle-transformers/src/models/glm4.rs:502-533 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (30–32 lines × 2) candle-transformers/src/models/qwen2_moe.rs:281— candle-transformers/src/models/qwen2_moe.rs:281-312 | candle-transformers/src/models/qwen3_moe.rs:141-170 — before extracting anything, compare `candle-transformers/src/models/qwen2_moe.rs` and `candle-transformers/src/models/qwen3_moe.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (32 lines × 2) candle-transformers/src/models/stable_diffusion/mod.rs:171— candle-transformers/src/models/stable_diffusion/mod.rs:171-202 | candle-transformers/src/models/stable_diffusion/mod.rs:254-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31 lines × 4) candle-flash-attn-v3/src/lib.rs:116— candle-flash-attn-v3/src/lib.rs:116-146 | candle-flash-attn-v3/src/lib.rs:561-591 | candle-flash-attn/src/lib.rs:96-126 | candle-flash-attn/src/lib.rs:656-686 — before extracting anything, compare `candle-flash-attn-v3/src/lib.rs` and `candle-flash-attn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (30 lines × 2) candle-transformers/src/models/stable_diffusion/uni_pc.rs:412— candle-transformers/src/models/stable_diffusion/uni_pc.rs:412-441 | candle-transformers/src/models/stable_diffusion/uni_pc.rs:525-554 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 3) candle-nn/src/rotary_emb.rs:115— candle-nn/src/rotary_emb.rs:115-141 | candle-nn/src/rotary_emb.rs:420-446 | candle-nn/src/rotary_emb.rs:694-720 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (20–27 lines × 2) candle-core/src/quantized/avx.rs:191— candle-core/src/quantized/avx.rs:191-210 | candle-core/src/quantized/avx.rs:402-428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2) candle-transformers/src/models/quantized_recurrent_gemma.rs:248— candle-transformers/src/models/quantized_recurrent_gemma.rs:248-274 | candle-transformers/src/models/recurrent_gemma.rs:481-507 — before extracting anything, compare `candle-transformers/src/models/quantized_recurrent_gemma.rs` and `candle-transformers/src/models/recurrent_gemma.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (26 lines × 3) candle-transformers/src/models/stable_diffusion/mod.rs:231— candle-transformers/src/models/stable_diffusion/mod.rs:231-256 | candle-transformers/src/models/stable_diffusion/mod.rs:300-325 | candle-transformers/src/models/stable_diffusion/mod.rs:399-424 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (25–26 lines × 2) candle-transformers/src/models/wuerstchen/diffnext.rs:167— candle-transformers/src/models/wuerstchen/diffnext.rs:167-191 | candle-transformers/src/models/wuerstchen/diffnext.rs:211-236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (3–25 lines × 4) candle-core/src/quantized/neon.rs:642— candle-core/src/quantized/neon.rs:642-666 | candle-core/src/quantized/neon.rs:818-842 | candle-core/src/quantized/neon.rs:2818-2820 | candle-core/src/quantized/neon.rs:3102-3104 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (23–25 lines × 2) candle-nn/src/ops.rs:458— candle-nn/src/ops.rs:458-480 | candle-nn/src/ops.rs:706-730 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 3) candle-nn/src/rotary_emb.rs:263— candle-nn/src/rotary_emb.rs:263-286 | candle-nn/src/rotary_emb.rs:556-579 | candle-nn/src/rotary_emb.rs:831-854 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21–24 lines × 2) candle-transformers/src/models/gemma3.rs:478— candle-transformers/src/models/gemma3.rs:478-501 | candle-transformers/src/models/gemma4/text.rs:589-609 — before extracting anything, compare `candle-transformers/src/models/gemma3.rs` and `candle-transformers/src/models/gemma4/text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (22–23 lines × 4) candle-transformers/src/models/stable_diffusion/mod.rs:159— candle-transformers/src/models/stable_diffusion/mod.rs:159-180 | candle-transformers/src/models/stable_diffusion/mod.rs:242-263 | candle-transformers/src/models/stable_diffusion/mod.rs:311-333 | candle-transformers/src/models/stable_diffusion/mod.rs:410-431 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16–22 lines × 2) candle-core/src/quantized/neon.rs:3859— candle-core/src/quantized/neon.rs:3859-3874 | candle-core/src/quantized/neon.rs:3885-3906 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 3) candle-metal-kernels/src/kernels/reduce.rs:159— candle-metal-kernels/src/kernels/reduce.rs:159-179 | candle-metal-kernels/src/kernels/reduce.rs:218-238 | candle-metal-kernels/src/kernels/reduce.rs:281-301 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (20–21 lines × 3) candle-transformers/src/models/glm4_new.rs:333— candle-transformers/src/models/glm4_new.rs:333-352 | candle-transformers/src/models/qwen3_moe.rs:303-322 | candle-transformers/src/models/smol/smollm3.rs:397-417 — before extracting anything, compare `candle-transformers/src/models/glm4_new.rs` and `candle-transformers/src/models/qwen3_moe.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 7) candle-transformers/src/models/marian.rs:39— candle-transformers/src/models/marian.rs:39-58 | candle-transformers/src/models/marian.rs:64-83 | candle-transformers/src/models/marian.rs:88-107 | candle-transformers/src/models/marian.rs:112-131 | candle-transformers/src/models/marian.rs:136-155 | candle-transformers/src/models/marian.rs:160-179 | candle-transformers/src/models/marian.rs:184-203 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (20 lines × 3) candle-nn/src/rotary_emb.rs:28— candle-nn/src/rotary_emb.rs:28-47 | candle-nn/src/rotary_emb.rs:328-347 | candle-nn/src/rotary_emb.rs:619-638 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (2–20 lines × 6) candle-core/src/quantized/avx.rs:475— candle-core/src/quantized/avx.rs:475-494 | candle-core/src/quantized/avx.rs:562-581 | candle-core/src/quantized/k_quants.rs:1518-1519 | candle-core/src/quantized/k_quants.rs:1783-1784 | candle-core/src/quantized/neon.rs:3505-3508 | candle-core/src/quantized/simd128.rs:223-224 — before extracting anything, compare `candle-core/src/quantized/k_quants.rs` and `candle-core/src/quantized/simd128.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–20 lines × 2) candle-core/src/quantized/repack_x86.rs:101— candle-core/src/quantized/repack_x86.rs:101-120 | candle-core/src/quantized/repack_x86.rs:628-645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 3) candle-transformers/src/models/chatglm.rs:430— candle-transformers/src/models/chatglm.rs:430-448 | candle-transformers/src/models/codegeex4_9b.rs:451-469 | candle-transformers/src/models/glm4.rs:472-490 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–19 lines × 3) candle-transformers/src/models/stable_diffusion/ddim.rs:100— candle-transformers/src/models/stable_diffusion/ddim.rs:100-117 | candle-transformers/src/models/stable_diffusion/ddpm.rs:56-74 | candle-transformers/src/models/stable_diffusion/euler_ancestral_discrete.rs:101-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (17–18 lines × 3) candle-transformers/src/models/vgg.rs:154— candle-transformers/src/models/vgg.rs:154-170 | candle-transformers/src/models/vgg.rs:200-217 | candle-transformers/src/models/vgg.rs:250-267 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–18 lines × 4) candle-transformers/src/models/gemma.rs:242— candle-transformers/src/models/gemma.rs:242-244 | candle-transformers/src/models/gemma2.rs:239-256 | candle-transformers/src/models/gemma3.rs:262-279 | candle-transformers/src/models/gemma4/text.rs:359-361 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–18 lines × 2) candle-transformers/src/models/segment_anything/sam.rs:66— candle-transformers/src/models/segment_anything/sam.rs:66-83 | candle-transformers/src/models/segment_anything/sam.rs:98-114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 4) candle-transformers/src/models/glm4_new.rs:333— candle-transformers/src/models/glm4_new.rs:333-348 | candle-transformers/src/models/quantized_glm4.rs:432-447 | candle-transformers/src/models/qwen3_moe.rs:303-318 | candle-transformers/src/models/smol/smollm3.rs:397-413 — before extracting anything, compare `candle-transformers/src/models/glm4_new.rs` and `candle-transformers/src/models/quantized_glm4.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 3) candle-transformers/src/models/chatglm.rs:558— candle-transformers/src/models/chatglm.rs:558-572 | candle-transformers/src/models/codegeex4_9b.rs:579-594 | candle-transformers/src/models/glm4.rs:600-615 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 2) candle-metal-kernels/src/kernels/sdpa.rs:316— candle-metal-kernels/src/kernels/sdpa.rs:316-330 | candle-metal-kernels/src/kernels/sdpa.rs:433-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–16 lines × 2) candle-transformers/src/models/paddleocr_vl/vision.rs:101— candle-transformers/src/models/paddleocr_vl/vision.rs:101-116 | candle-transformers/src/models/siglip.rs:544-555 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (4–16 lines × 3) candle-transformers/src/models/mixtral.rs:300— candle-transformers/src/models/mixtral.rs:300-303 | candle-transformers/src/models/qwen2_moe.rs:264-279 | candle-transformers/src/models/qwen3_moe.rs:126-139 — before extracting anything, compare `candle-transformers/src/models/mixtral.rs` and `candle-transformers/src/models/qwen2_moe.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 275 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 4) candle-transformers/src/models/quantized_mistral.rs:126— candle-transformers/src/models/quantized_mistral.rs:126-140 | candle-transformers/src/models/qwen2.rs:139-153 | candle-transformers/src/models/qwen2_moe.rs:146-160 | candle-transformers/src/models/yi.rs:178-192 — before extracting anything, compare `candle-transformers/src/models/quantized_mistral.rs` and `candle-transformers/src/models/qwen2.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 4) candle-transformers/src/models/mixformer.rs:36— candle-transformers/src/models/mixformer.rs:36-49 | candle-transformers/src/models/mixformer.rs:52-65 | candle-transformers/src/models/mixformer.rs:68-81 | candle-transformers/src/models/mixformer.rs:85-98 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–14 lines × 2) candle-transformers/src/models/paddleocr_vl/mod.rs:196— candle-transformers/src/models/paddleocr_vl/mod.rs:196-209 | candle-transformers/src/models/paddleocr_vl/mod.rs:935-945 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 14) candle-transformers/src/models/gemma.rs:300— candle-transformers/src/models/gemma.rs:300-312 | candle-transformers/src/models/helium.rs:278-290 | candle-transformers/src/models/mistral.rs:327-339 | candle-transformers/src/models/mixtral.rs:370-382 | candle-transformers/src/models/nvembed_v2/embedding.rs:187-199 | candle-transformers/src/models/phi3.rs:314-326 | candle-transformers/src/models/quantized_mistral.rs:218-230 | candle-transformers/src/models/qwen2.rs:230-242 | candle-transformers/src/models/qwen2_moe.rs:363-375 | candle-transformers/src/models/qwen3.rs:372-383 | candle-transformers/src/models/qwen3_moe.rs:236-248 | candle-transformers/src/models/smol/smollm3.rs:323-334 | candle-transformers/src/models/yi.rs:264-275 | candle-transformers/src/models/z_image/text_encoder.rs:336-347 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/helium.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–13 lines × 2) candle-core/src/backprop.rs:672— candle-core/src/backprop.rs:672-680 | candle-core/src/backprop.rs:684-696 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (2–13 lines × 3) candle-transformers/src/models/olmo.rs:138— candle-transformers/src/models/olmo.rs:138-150 | candle-transformers/src/models/olmo2.rs:129-130 | candle-transformers/src/models/starcoder2.rs:141-153 — before extracting anything, compare `candle-transformers/src/models/olmo.rs` and `candle-transformers/src/models/olmo2.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 18) candle-transformers/src/models/gemma.rs:299— candle-transformers/src/models/gemma.rs:299-310 | candle-transformers/src/models/granite.rs:409-419 | candle-transformers/src/models/granitemoehybrid.rs:474-484 | candle-transformers/src/models/helium.rs:277-288 | candle-transformers/src/models/llama.rs:456-466 | candle-transformers/src/models/mistral.rs:326-337 | candle-transformers/src/models/mixtral.rs:369-380 | candle-transformers/src/models/nvembed_v2/embedding.rs:186-197 | candle-transformers/src/models/phi3.rs:313-324 | candle-transformers/src/models/quantized_mistral.rs:217-228 | candle-transformers/src/models/qwen2.rs:229-240 | candle-transformers/src/models/qwen2_moe.rs:362-373 | candle-transformers/src/models/qwen3.rs:371-381 | candle-transformers/src/models/qwen3_moe.rs:235-246 | candle-transformers/src/models/smol/smollm3.rs:322-332 | candle-transformers/src/models/voxtral/voxtral_llama.rs:380-390 | candle-transformers/src/models/yi.rs:263-273 | candle-transformers/src/models/z_image/text_encoder.rs:335-345 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/helium.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–12 lines × 10) candle-transformers/src/models/mixtral.rs:230— candle-transformers/src/models/mixtral.rs:230-239 | candle-transformers/src/models/olmo.rs:212-221 | candle-transformers/src/models/olmo2.rs:200-209 | candle-transformers/src/models/quantized_mistral.rs:189-198 | candle-transformers/src/models/quantized_stable_lm.rs:168-177 | candle-transformers/src/models/qwen2.rs:201-210 | candle-transformers/src/models/qwen2_moe.rs:208-217 | candle-transformers/src/models/stable_lm.rs:298-307 | candle-transformers/src/models/stella_en_v5.rs:412-423 | candle-transformers/src/models/yi.rs:239-248 — before extracting anything, compare `candle-transformers/src/models/mixtral.rs` and `candle-transformers/src/models/olmo.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 6) candle-transformers/src/models/mixtral.rs:161— candle-transformers/src/models/mixtral.rs:161-172 | candle-transformers/src/models/nvembed_v2/embedding.rs:110-121 | candle-transformers/src/models/quantized_mistral.rs:126-137 | candle-transformers/src/models/qwen2.rs:139-150 | candle-transformers/src/models/qwen2_moe.rs:146-157 | candle-transformers/src/models/yi.rs:178-189 — before extracting anything, compare `candle-transformers/src/models/mixtral.rs` and `candle-transformers/src/models/nvembed_v2/embedding.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 4) candle-nn/src/attention/cpu_flash/causal.rs:210— candle-nn/src/attention/cpu_flash/causal.rs:210-221 | candle-nn/src/attention/cpu_flash/causal.rs:595-606 | candle-nn/src/attention/cpu_flash/causal.rs:815-825 | candle-nn/src/attention/cpu_flash/causal.rs:896-906 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–12 lines × 4) candle-transformers/src/models/quantized_gemma3.rs:420— candle-transformers/src/models/quantized_gemma3.rs:420-431 | candle-transformers/src/models/quantized_llama.rs:508-518 | candle-transformers/src/models/quantized_phi.rs:255-264 | candle-transformers/src/models/quantized_phi3.rs:286-296 — before extracting anything, compare `candle-transformers/src/models/quantized_gemma3.rs` and `candle-transformers/src/models/quantized_llama.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 3) candle-core/src/cpu/avx.rs:244— candle-core/src/cpu/avx.rs:244-255 | candle-core/src/cpu/neon.rs:452-463 | candle-core/src/cpu/simd128.rs:190-200 — before extracting anything, compare `candle-core/src/cpu/avx.rs` and `candle-core/src/cpu/neon.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–12 lines × 4) candle-core/src/quantized/k_quants.rs:1107— candle-core/src/quantized/k_quants.rs:1107-1118 | candle-core/src/quantized/k_quants.rs:1120-1131 | candle-core/src/quantized/k_quants.rs:1133-1144 | candle-core/src/quantized/k_quants.rs:1145-1153 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–12 lines × 2) candle-core/src/display.rs:13— candle-core/src/display.rs:13-21 | candle-core/src/display.rs:540-551 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–12 lines × 2) candle-core/src/quantized/k_quants.rs:1587— candle-core/src/quantized/k_quants.rs:1587-1598 | candle-core/src/quantized/k_quants.rs:1852-1861 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (3–12 lines × 6) candle-transformers/src/models/blip_text.rs:484— candle-transformers/src/models/blip_text.rs:484-486 | candle-transformers/src/models/marian.rs:632-634 | candle-transformers/src/models/quantized_blip_text.rs:480-482 | candle-transformers/src/models/trocr.rs:505-507 | candle-transformers/src/models/whisper/model.rs:332-343 | candle-transformers/src/models/whisper/quantized_model.rs:336-347 — before extracting anything, compare `candle-transformers/src/models/blip_text.rs` and `candle-transformers/src/models/quantized_blip_text.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 215 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 15) candle-transformers/src/models/csm.rs:230— candle-transformers/src/models/csm.rs:230-240 | candle-transformers/src/models/gemma.rs:245-255 | candle-transformers/src/models/gemma4/text.rs:362-372 | candle-transformers/src/models/helium.rs:244-254 | candle-transformers/src/models/mistral.rs:293-303 | candle-transformers/src/models/mixtral.rs:225-235 | candle-transformers/src/models/olmo.rs:207-217 | candle-transformers/src/models/olmo2.rs:195-205 | candle-transformers/src/models/phi3.rs:247-257 | candle-transformers/src/models/quantized_mistral.rs:184-194 | candle-transformers/src/models/quantized_stable_lm.rs:163-173 | candle-transformers/src/models/qwen2.rs:196-206 | candle-transformers/src/models/qwen2_moe.rs:203-213 | candle-transformers/src/models/stable_lm.rs:293-303 | candle-transformers/src/models/yi.rs:234-244 — before extracting anything, compare `candle-transformers/src/models/csm.rs` and `candle-transformers/src/models/gemma.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–11 lines × 14) candle-transformers/src/models/based.rs:323— candle-transformers/src/models/based.rs:323-329 | candle-transformers/src/models/gemma.rs:92-98 | candle-transformers/src/models/gemma2.rs:85-91 | candle-transformers/src/models/gemma3.rs:90-96 | candle-transformers/src/models/gemma4/text.rs:75-81 | candle-transformers/src/models/glm4_new.rs:54-60 | candle-transformers/src/models/modernbert.rs:69-75 | candle-transformers/src/models/nvembed_v2/embedding.rs:28-34 | candle-transformers/src/models/olmo.rs:53-59 | candle-transformers/src/models/olmo2.rs:45-51 | candle-transformers/src/models/quantized_glm4.rs:120-126 | candle-transformers/src/models/qwen2.rs:56-62 | candle-transformers/src/models/qwen2_moe.rs:64-70 | candle-transformers/src/models/stella_en_v5.rs:177-187 — before extracting anything, compare `candle-transformers/src/models/based.rs` and `candle-transformers/src/models/gemma.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 10) candle-transformers/src/models/based.rs:573— candle-transformers/src/models/based.rs:573-583 | candle-transformers/src/models/mixtral.rs:468-478 | candle-transformers/src/models/olmo.rs:332-342 | candle-transformers/src/models/olmo2.rs:327-337 | candle-transformers/src/models/phi3.rs:407-417 | candle-transformers/src/models/quantized_stable_lm.rs:286-296 | candle-transformers/src/models/qwen2_moe.rs:463-473 | candle-transformers/src/models/stable_lm.rs:418-428 | candle-transformers/src/models/starcoder2.rs:330-340 | candle-transformers/src/models/yi.rs:349-359 — before extracting anything, compare `candle-transformers/src/models/based.rs` and `candle-transformers/src/models/mixtral.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 5) candle-transformers/src/models/mistral.rs:226— candle-transformers/src/models/mistral.rs:226-236 | candle-transformers/src/models/mixtral.rs:160-170 | candle-transformers/src/models/nvembed_v2/embedding.rs:109-119 | candle-transformers/src/models/quantized_mistral.rs:125-135 | candle-transformers/src/models/yi.rs:177-187 — before extracting anything, compare `candle-transformers/src/models/mistral.rs` and `candle-transformers/src/models/mixtral.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) candle-flash-attn-v3/src/lib.rs:67— candle-flash-attn-v3/src/lib.rs:67-77 | candle-flash-attn-v3/src/lib.rs:501-511 | candle-flash-attn/src/lib.rs:58-68 | candle-flash-attn/src/lib.rs:546-556 — before extracting anything, compare `candle-flash-attn-v3/src/lib.rs` and `candle-flash-attn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 4) candle-transformers/src/models/glm4_new.rs:221— candle-transformers/src/models/glm4_new.rs:221-230 | candle-transformers/src/models/qwen3.rs:342-352 | candle-transformers/src/models/smol/smollm3.rs:288-298 | candle-transformers/src/models/z_image/text_encoder.rs:308-318 — before extracting anything, compare `candle-transformers/src/models/glm4_new.rs` and `candle-transformers/src/models/qwen3.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–11 lines × 3) candle-core/src/quantized/avx.rs:192— candle-core/src/quantized/avx.rs:192-198 | candle-core/src/quantized/avx.rs:403-413 | candle-core/src/quantized/avx.rs:628-634 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (2–11 lines × 4) candle-transformers/src/models/gemma.rs:180— candle-transformers/src/models/gemma.rs:180-190 | candle-transformers/src/models/gemma2.rs:174-184 | candle-transformers/src/models/gemma3.rs:187-188 | candle-transformers/src/models/helium.rs:177-187 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–11 lines × 3) candle-core/src/safetensors.rs:445— candle-core/src/safetensors.rs:445-455 | candle-core/src/safetensors.rs:475-485 | candle-core/src/safetensors.rs:593-596 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–11 lines × 2) candle-transformers/src/models/quantized_qwen3.rs:367— candle-transformers/src/models/quantized_qwen3.rs:367-374 | candle-transformers/src/models/quantized_qwen3_moe.rs:205-215 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8–10 lines × 17) candle-transformers/src/models/gemma.rs:206— candle-transformers/src/models/gemma.rs:206-213 | candle-transformers/src/models/gemma2.rs:201-208 | candle-transformers/src/models/gemma3.rs:227-234 | candle-transformers/src/models/glm4_new.rs:198-205 | candle-transformers/src/models/mixtral.rs:187-194 | candle-transformers/src/models/paddleocr_vl/text.rs:798-805 | candle-transformers/src/models/paddleocr_vl/text.rs:901-910 | candle-transformers/src/models/quantized_qwen3.rs:244-251 | candle-transformers/src/models/quantized_stable_lm.rs:122-129 | candle-transformers/src/models/qwen2.rs:164-171 | candle-transformers/src/models/qwen2_moe.rs:171-178 | candle-transformers/src/models/qwen3.rs:197-205 | candle-transformers/src/models/smol/smollm3.rs:247-255 | candle-transformers/src/models/stable_lm.rs:245-252 | candle-transformers/src/models/starcoder2.rs:167-174 | candle-transformers/src/models/yi.rs:203-210 | candle-transformers/src/models/z_image/text_encoder.rs:276-284 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 10) candle-core/src/cuda_backend/mod.rs:2379— candle-core/src/cuda_backend/mod.rs:2379-2388 | candle-core/src/cuda_backend/mod.rs:2395-2404 | candle-core/src/cuda_backend/mod.rs:2411-2420 | candle-core/src/cuda_backend/mod.rs:2427-2436 | candle-core/src/cuda_backend/mod.rs:2443-2452 | candle-core/src/cuda_backend/mod.rs:2459-2468 | candle-core/src/cuda_backend/mod.rs:2475-2484 | candle-core/src/cuda_backend/mod.rs:2491-2500 | candle-core/src/cuda_backend/mod.rs:2507-2516 | candle-core/src/cuda_backend/mod.rs:2523-2532 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–10 lines × 5) candle-transformers/src/models/quantized_lfm2.rs:601— candle-transformers/src/models/quantized_lfm2.rs:601-610 | candle-transformers/src/models/quantized_llama.rs:569-577 | candle-transformers/src/models/quantized_phi.rs:284-292 | candle-transformers/src/models/quantized_phi3.rs:316-324 | candle-transformers/src/models/quantized_qwen2.rs:318-326 — before extracting anything, compare `candle-transformers/src/models/quantized_lfm2.rs` and `candle-transformers/src/models/quantized_llama.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 4) candle-core/src/quantized/mod.rs:548— candle-core/src/quantized/mod.rs:548-557 | candle-core/src/quantized/mod.rs:584-592 | candle-core/src/quantized/mod.rs:627-636 | candle-core/src/quantized/mod.rs:656-665 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–10 lines × 4) candle-transformers/src/models/quantized_gemma3.rs:193— candle-transformers/src/models/quantized_gemma3.rs:193-200 | candle-transformers/src/models/quantized_lfm2.rs:134-141 | candle-transformers/src/models/quantized_llama.rs:203-210 | candle-transformers/src/models/quantized_phi3.rs:124-133 — before extracting anything, compare `candle-transformers/src/models/quantized_gemma3.rs` and `candle-transformers/src/models/quantized_llama.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 3) candle-transformers/src/models/gemma.rs:356— candle-transformers/src/models/gemma.rs:356-364 | candle-transformers/src/models/gemma2.rs:375-383 | candle-transformers/src/models/gemma3.rs:454-463 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–10 lines × 4) candle-transformers/src/models/nomic_bert.rs:96— candle-transformers/src/models/nomic_bert.rs:96-99 | candle-transformers/src/models/quantized_lfm2.rs:106-115 | candle-transformers/src/models/quantized_phi3.rs:211-220 | candle-transformers/src/models/quantized_qwen2.rs:169-178 — before extracting anything, compare `candle-transformers/src/models/quantized_lfm2.rs` and `candle-transformers/src/models/quantized_phi3.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–10 lines × 4) candle-core/src/cpu_backend/mod.rs:214— candle-core/src/cpu_backend/mod.rs:214-216 | candle-core/src/cpu_backend/utils.rs:287-290 | candle-core/src/cpu_backend/utils.rs:308-317 | candle-core/src/cpu_backend/utils.rs:341-350 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 18) candle-transformers/src/models/csm.rs:233— candle-transformers/src/models/csm.rs:233-241 | candle-transformers/src/models/gemma.rs:248-256 | candle-transformers/src/models/gemma2.rs:248-256 | candle-transformers/src/models/gemma3.rs:271-279 | candle-transformers/src/models/gemma4/text.rs:365-373 | candle-transformers/src/models/helium.rs:247-255 | candle-transformers/src/models/mistral.rs:296-304 | candle-transformers/src/models/mixtral.rs:228-236 | candle-transformers/src/models/olmo.rs:210-218 | candle-transformers/src/models/olmo2.rs:198-206 | candle-transformers/src/models/phi3.rs:250-258 | candle-transformers/src/models/quantized_mistral.rs:187-195 | candle-transformers/src/models/quantized_stable_lm.rs:166-174 | candle-transformers/src/models/qwen2.rs:199-207 | candle-transformers/src/models/qwen2_moe.rs:206-214 | candle-transformers/src/models/stable_lm.rs:296-304 | candle-transformers/src/models/stella_en_v5.rs:410-420 | candle-transformers/src/models/yi.rs:237-245 — before extracting anything, compare `candle-transformers/src/models/csm.rs` and `candle-transformers/src/models/gemma.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 12) candle-transformers/src/models/based.rs:402— candle-transformers/src/models/based.rs:402-410 | candle-transformers/src/models/gemma.rs:217-225 | candle-transformers/src/models/gemma2.rs:212-220 | candle-transformers/src/models/mixtral.rs:198-206 | candle-transformers/src/models/olmo.rs:186-194 | candle-transformers/src/models/olmo2.rs:174-182 | candle-transformers/src/models/phi3.rs:226-234 | candle-transformers/src/models/quantized_mistral.rs:164-172 | candle-transformers/src/models/qwen2.rs:175-183 | candle-transformers/src/models/qwen2_moe.rs:182-190 | candle-transformers/src/models/starcoder2.rs:178-186 | candle-transformers/src/models/yi.rs:214-222 — before extracting anything, compare `candle-transformers/src/models/based.rs` and `candle-transformers/src/models/gemma.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 8) candle-transformers/src/models/mistral.rs:167— candle-transformers/src/models/mistral.rs:167-175 | candle-transformers/src/models/nvembed_v2/embedding.rs:67-75 | candle-transformers/src/models/olmo.rs:92-100 | candle-transformers/src/models/olmo2.rs:84-92 | candle-transformers/src/models/quantized_mistral.rs:82-90 | candle-transformers/src/models/qwen2.rs:95-103 | candle-transformers/src/models/qwen2_moe.rs:102-110 | candle-transformers/src/models/yi.rs:134-142 — before extracting anything, compare `candle-transformers/src/models/mistral.rs` and `candle-transformers/src/models/nvembed_v2/embedding.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 153 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (4–9 lines × 6) candle-transformers/src/models/marian.rs:223— candle-transformers/src/models/marian.rs:223-226 | candle-transformers/src/models/mixtral.rs:92-100 | candle-transformers/src/models/recurrent_gemma.rs:120-128 | candle-transformers/src/models/stable_lm.rs:102-110 | candle-transformers/src/models/starcoder2.rs:62-70 | candle-transformers/src/models/yi.rs:93-101 — before extracting anything, compare `candle-transformers/src/models/mixtral.rs` and `candle-transformers/src/models/recurrent_gemma.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 4) candle-nn/src/ops.rs:426— candle-nn/src/ops.rs:426-434 | candle-nn/src/rotary_emb.rs:239-246 | candle-nn/src/rotary_emb.rs:545-552 | candle-nn/src/rotary_emb.rs:820-827 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (3–9 lines × 5) candle-transformers/src/models/gemma.rs:233— candle-transformers/src/models/gemma.rs:233-241 | candle-transformers/src/models/gemma2.rs:228-236 | candle-transformers/src/models/gemma3.rs:251-259 | candle-transformers/src/models/gemma4/text.rs:357-359 | candle-transformers/src/models/stable_lm.rs:281-289 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–9 lines × 4) candle-transformers/src/models/paddleocr_vl/mod.rs:223— candle-transformers/src/models/paddleocr_vl/mod.rs:223-231 | candle-transformers/src/models/paddleocr_vl/mod.rs:370-376 | candle-transformers/src/models/paddleocr_vl/mod.rs:488-494 | candle-transformers/src/models/paddleocr_vl/mod.rs:786-793 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (4–9 lines × 4) candle-transformers/src/models/beit.rs:297— candle-transformers/src/models/beit.rs:297-305 | candle-transformers/src/models/dinov2.rs:255-263 | candle-transformers/src/models/dinov2reg4.rs:246-254 | candle-transformers/src/models/eva2.rs:282-285 — before extracting anything, compare `candle-transformers/src/models/beit.rs` and `candle-transformers/src/models/dinov2.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–9 lines × 3) candle-transformers/src/models/chatglm.rs:124— candle-transformers/src/models/chatglm.rs:124-130 | candle-transformers/src/models/codegeex4_9b.rs:137-145 | candle-transformers/src/models/glm4.rs:158-166 — before extracting anything, compare `candle-transformers/src/models/chatglm.rs` and `candle-transformers/src/models/codegeex4_9b.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 387 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–9 lines × 3) candle-core/src/quantized/neon.rs:798— candle-core/src/quantized/neon.rs:798-800 | candle-core/src/quantized/neon.rs:807-815 | candle-core/src/quantized/neon.rs:3083-3091 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5–8 lines × 29) candle-transformers/src/models/based.rs:412— candle-transformers/src/models/based.rs:412-416 | candle-transformers/src/models/chatglm.rs:292-299 | candle-transformers/src/models/codegeex4_9b.rs:313-320 | candle-transformers/src/models/csm.rs:220-224 | candle-transformers/src/models/deepseek2.rs:669-673 | candle-transformers/src/models/gemma.rs:227-231 | candle-transformers/src/models/gemma2.rs:222-226 | candle-transformers/src/models/glm4.rs:334-341 | candle-transformers/src/models/helium.rs:227-231 | candle-transformers/src/models/metavoice.rs:812-816 | candle-transformers/src/models/mistral.rs:276-280 | candle-transformers/src/models/mixformer.rs:303-307 | candle-transformers/src/models/mixtral.rs:208-212 | candle-transformers/src/models/mpt.rs:109-113 | candle-transformers/src/models/olmo.rs:196-200 | candle-transformers/src/models/olmo2.rs:184-188 | candle-transformers/src/models/paddleocr_vl/text.rs:843-847 | candle-transformers/src/models/phi.rs:233-237 | candle-transformers/src/models/phi3.rs:236-240 | candle-transformers/src/models/quantized_metavoice.rs:115-119 | candle-transformers/src/models/quantized_mistral.rs:174-178 | candle-transformers/src/models/quantized_mixformer.rs:220-224 | candle-transformers/src/models/quantized_mpt.rs:86-90 | candle-transformers/src/models/quantized_recurrent_gemma.rs:248-252 | candle-transformers/src/models/qwen2.rs:185-189 | candle-transformers/src/models/qwen2_moe.rs:192-196 | candle-transformers/src/models/recurrent_gemma.rs:481-485 | candle-transformers/src/models/starcoder2.rs:188-192 | candle-transformers/src/models/yi.rs:224-228 — before extracting anything, compare `candle-transformers/src/models/based.rs` and `candle-transformers/src/models/gemma.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–8 lines × 22) candle-transformers/src/models/csm.rs:195— candle-transformers/src/models/csm.rs:195-201 | candle-transformers/src/models/gemma.rs:205-210 | candle-transformers/src/models/gemma2.rs:200-205 | candle-transformers/src/models/gemma3.rs:226-231 | candle-transformers/src/models/glm4_new.rs:197-202 | candle-transformers/src/models/helium.rs:202-208 | candle-transformers/src/models/mistral.rs:251-257 | candle-transformers/src/models/mixtral.rs:186-191 | candle-transformers/src/models/nvembed_v2/embedding.rs:133-139 | candle-transformers/src/models/paddleocr_vl/text.rs:797-802 | candle-transformers/src/models/paddleocr_vl/text.rs:900-907 | candle-transformers/src/models/quantized_mistral.rs:150-156 | candle-transformers/src/models/quantized_qwen3.rs:243-248 | candle-transformers/src/models/quantized_stable_lm.rs:121-126 | candle-transformers/src/models/qwen2.rs:163-168 | candle-transformers/src/models/qwen2_moe.rs:170-175 | candle-transformers/src/models/qwen3.rs:196-202 | candle-transformers/src/models/smol/smollm3.rs:246-252 | candle-transformers/src/models/stable_lm.rs:244-249 | candle-transformers/src/models/starcoder2.rs:166-171 | candle-transformers/src/models/yi.rs:202-207 | candle-transformers/src/models/z_image/text_encoder.rs:275-281 — before extracting anything, compare `candle-transformers/src/models/csm.rs` and `candle-transformers/src/models/gemma.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 22) candle-transformers/src/models/gemma.rs:209— candle-transformers/src/models/gemma.rs:209-216 | candle-transformers/src/models/gemma2.rs:204-211 | candle-transformers/src/models/gemma3.rs:230-237 | candle-transformers/src/models/glm4_new.rs:201-208 | candle-transformers/src/models/mixtral.rs:190-197 | candle-transformers/src/models/olmo.rs:178-185 | candle-transformers/src/models/olmo2.rs:166-173 | candle-transformers/src/models/paddleocr_vl/text.rs:801-808 | candle-transformers/src/models/paddleocr_vl/text.rs:906-913 | candle-transformers/src/models/phi.rs:206-213 | candle-transformers/src/models/phi3.rs:218-225 | candle-transformers/src/models/quantized_glm4.rs:236-243 | candle-transformers/src/models/quantized_qwen3.rs:247-254 | candle-transformers/src/models/quantized_stable_lm.rs:125-132 | candle-transformers/src/models/qwen2.rs:167-174 | candle-transformers/src/models/qwen2_moe.rs:174-181 | candle-transformers/src/models/qwen3.rs:201-208 | candle-transformers/src/models/smol/smollm3.rs:251-258 | candle-transformers/src/models/stable_lm.rs:248-255 | candle-transformers/src/models/starcoder2.rs:170-177 | candle-transformers/src/models/yi.rs:206-213 | candle-transformers/src/models/z_image/text_encoder.rs:280-287 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 10) candle-transformers/src/models/mistral.rs:166— candle-transformers/src/models/mistral.rs:166-173 | candle-transformers/src/models/nvembed_v2/embedding.rs:66-73 | candle-transformers/src/models/olmo.rs:91-98 | candle-transformers/src/models/olmo2.rs:83-90 | candle-transformers/src/models/quantized_mistral.rs:81-88 | candle-transformers/src/models/quantized_stable_lm.rs:39-46 | candle-transformers/src/models/qwen2.rs:94-101 | candle-transformers/src/models/qwen2_moe.rs:101-108 | candle-transformers/src/models/stable_lm.rs:143-150 | candle-transformers/src/models/yi.rs:133-140 — before extracting anything, compare `candle-transformers/src/models/mistral.rs` and `candle-transformers/src/models/nvembed_v2/embedding.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 153 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 7) candle-transformers/src/models/granite.rs:322— candle-transformers/src/models/granite.rs:322-329 | candle-transformers/src/models/granitemoehybrid.rs:372-379 | candle-transformers/src/models/llama.rs:369-376 | candle-transformers/src/models/llama2_c.rs:236-243 | candle-transformers/src/models/quantized_llama2_c.rs:123-130 | candle-transformers/src/models/voxtral/voxtral_llama.rs:293-300 | candle-wasm-examples/llama2-c/src/model.rs:150-157 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5–8 lines × 6) candle-transformers/src/models/olmo.rs:202— candle-transformers/src/models/olmo.rs:202-206 | candle-transformers/src/models/olmo2.rs:190-194 | candle-transformers/src/models/paddleocr_vl/text.rs:850-857 | candle-transformers/src/models/phi3.rs:242-246 | candle-transformers/src/models/qwen2.rs:191-195 | candle-transformers/src/models/qwen2_moe.rs:198-202 — before extracting anything, compare `candle-transformers/src/models/olmo.rs` and `candle-transformers/src/models/olmo2.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 5) candle-transformers/src/models/quantized_lfm2.rs:169— candle-transformers/src/models/quantized_lfm2.rs:169-176 | candle-transformers/src/models/quantized_llama.rs:251-258 | candle-transformers/src/models/quantized_phi.rs:147-154 | candle-transformers/src/models/quantized_phi3.rs:158-165 | candle-transformers/src/models/quantized_qwen2.rs:134-141 — before extracting anything, compare `candle-transformers/src/models/quantized_lfm2.rs` and `candle-transformers/src/models/quantized_llama.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) candle-transformers/src/models/glm4_new.rs:317— candle-transformers/src/models/glm4_new.rs:317-324 | candle-transformers/src/models/qwen3.rs:426-433 | candle-transformers/src/models/qwen3_moe.rs:287-294 | candle-transformers/src/models/smol/smollm3.rs:381-388 — before extracting anything, compare `candle-transformers/src/models/glm4_new.rs` and `candle-transformers/src/models/qwen3.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–8 lines × 4) candle-core/src/cuda_backend/mod.rs:607— candle-core/src/cuda_backend/mod.rs:607-610 | candle-core/src/cuda_backend/mod.rs:611-618 | candle-core/src/cuda_backend/mod.rs:663-670 | candle-core/src/cuda_backend/mod.rs:715-722 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–8 lines × 4) candle-transformers/src/models/quantized_rwkv_v5.rs:50— candle-transformers/src/models/quantized_rwkv_v5.rs:50-52 | candle-transformers/src/models/quantized_rwkv_v6.rs:57-59 | candle-transformers/src/models/rwkv_v5.rs:122-129 | candle-transformers/src/models/rwkv_v6.rs:67-74 — before extracting anything, compare `candle-transformers/src/models/quantized_rwkv_v5.rs` and `candle-transformers/src/models/quantized_rwkv_v6.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 23) candle-transformers/src/models/csm.rs:193— candle-transformers/src/models/csm.rs:193-199 | candle-transformers/src/models/gemma.rs:203-209 | candle-transformers/src/models/gemma2.rs:198-204 | candle-transformers/src/models/gemma3.rs:224-230 | candle-transformers/src/models/glm4_new.rs:195-201 | candle-transformers/src/models/helium.rs:200-206 | candle-transformers/src/models/lfm2.rs:329-336 | candle-transformers/src/models/mistral.rs:249-255 | candle-transformers/src/models/mixtral.rs:184-190 | candle-transformers/src/models/nvembed_v2/embedding.rs:131-137 | candle-transformers/src/models/paddleocr_vl/text.rs:795-801 | candle-transformers/src/models/paddleocr_vl/text.rs:897-906 | candle-transformers/src/models/quantized_mistral.rs:148-154 | candle-transformers/src/models/quantized_qwen3.rs:240-247 | candle-transformers/src/models/quantized_stable_lm.rs:119-125 | candle-transformers/src/models/qwen2.rs:161-167 | candle-transformers/src/models/qwen2_moe.rs:168-174 | candle-transformers/src/models/qwen3.rs:193-201 | candle-transformers/src/models/smol/smollm3.rs:243-251 | candle-transformers/src/models/stable_lm.rs:242-248 | candle-transformers/src/models/starcoder2.rs:164-170 | candle-transformers/src/models/yi.rs:200-206 | candle-transformers/src/models/z_image/text_encoder.rs:272-280 — before extracting anything, compare `candle-transformers/src/models/csm.rs` and `candle-transformers/src/models/gemma.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 18) candle-transformers/src/models/based.rs:418— candle-transformers/src/models/based.rs:418-424 | candle-transformers/src/models/csm.rs:230-236 | candle-transformers/src/models/gemma.rs:245-251 | candle-transformers/src/models/gemma4/text.rs:362-368 | candle-transformers/src/models/helium.rs:244-250 | candle-transformers/src/models/mistral.rs:293-299 | candle-transformers/src/models/mixtral.rs:225-231 | candle-transformers/src/models/nvembed_v2/embedding.rs:157-163 | candle-transformers/src/models/olmo.rs:207-213 | candle-transformers/src/models/olmo2.rs:195-201 | candle-transformers/src/models/phi3.rs:247-253 | candle-transformers/src/models/quantized_mistral.rs:184-190 | candle-transformers/src/models/quantized_stable_lm.rs:163-169 | candle-transformers/src/models/qwen2.rs:196-202 | candle-transformers/src/models/qwen2_moe.rs:203-209 | candle-transformers/src/models/stable_lm.rs:293-299 | candle-transformers/src/models/starcoder2.rs:197-203 | candle-transformers/src/models/yi.rs:234-240 — before extracting anything, compare `candle-transformers/src/models/based.rs` and `candle-transformers/src/models/gemma.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 15) candle-transformers/src/models/based.rs:404— candle-transformers/src/models/based.rs:404-410 | candle-transformers/src/models/csm.rs:212-218 | candle-transformers/src/models/gemma.rs:219-225 | candle-transformers/src/models/gemma2.rs:214-220 | candle-transformers/src/models/helium.rs:219-225 | candle-transformers/src/models/mistral.rs:268-274 | candle-transformers/src/models/mixtral.rs:200-206 | candle-transformers/src/models/olmo.rs:188-194 | candle-transformers/src/models/olmo2.rs:176-182 | candle-transformers/src/models/phi3.rs:228-234 | candle-transformers/src/models/quantized_mistral.rs:166-172 | candle-transformers/src/models/qwen2.rs:177-183 | candle-transformers/src/models/qwen2_moe.rs:184-190 | candle-transformers/src/models/starcoder2.rs:180-186 | candle-transformers/src/models/yi.rs:216-222 — before extracting anything, compare `candle-transformers/src/models/based.rs` and `candle-transformers/src/models/gemma.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 12) candle-transformers/src/models/gemma.rs:322— candle-transformers/src/models/gemma.rs:322-327 | candle-transformers/src/models/helium.rs:300-305 | candle-transformers/src/models/mistral.rs:349-354 | candle-transformers/src/models/nvembed_v2/embedding.rs:210-216 | candle-transformers/src/models/olmo.rs:259-264 | candle-transformers/src/models/phi3.rs:336-341 | candle-transformers/src/models/quantized_mistral.rs:240-245 | candle-transformers/src/models/quantized_stable_lm.rs:221-226 | candle-transformers/src/models/qwen2.rs:252-257 | candle-transformers/src/models/qwen2_moe.rs:385-390 | candle-transformers/src/models/stable_lm.rs:351-356 | candle-transformers/src/models/starcoder2.rs:252-257 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/helium.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 11) candle-transformers/src/models/deepseek2.rs:1035— candle-transformers/src/models/deepseek2.rs:1035-1041 | candle-transformers/src/models/gemma.rs:387-393 | candle-transformers/src/models/gemma2.rs:417-423 | candle-transformers/src/models/mixtral.rs:459-465 | candle-transformers/src/models/paddleocr_vl/text.rs:1160-1166 | candle-transformers/src/models/phi3.rs:398-404 | candle-transformers/src/models/qwen2_moe.rs:454-460 | candle-transformers/src/models/recurrent_gemma.rs:632-638 | candle-transformers/src/models/stable_lm.rs:408-414 | candle-transformers/src/models/starcoder2.rs:321-327 | candle-transformers/src/models/yi.rs:340-346 — before extracting anything, compare `candle-transformers/src/models/deepseek2.rs` and `candle-transformers/src/models/paddleocr_vl/text.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 8) candle-core/src/cuda_backend/mod.rs:1606— candle-core/src/cuda_backend/mod.rs:1606-1612 | candle-core/src/cuda_backend/mod.rs:1617-1623 | candle-core/src/cuda_backend/mod.rs:1628-1634 | candle-core/src/cuda_backend/mod.rs:1639-1645 | candle-core/src/cuda_backend/mod.rs:1650-1656 | candle-core/src/cuda_backend/mod.rs:1661-1667 | candle-core/src/cuda_backend/mod.rs:1672-1678 | candle-core/src/cuda_backend/mod.rs:1683-1689 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 5) candle-transformers/src/models/granite.rs:233— candle-transformers/src/models/granite.rs:233-239 | candle-transformers/src/models/granitemoehybrid.rs:282-288 | candle-transformers/src/models/lfm2.rs:331-337 | candle-transformers/src/models/llama.rs:279-285 | candle-transformers/src/models/voxtral/voxtral_llama.rs:193-199 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 4) candle-transformers/src/models/mixtral.rs:335— candle-transformers/src/models/mixtral.rs:335-340 | candle-transformers/src/models/quantized_llama.rs:118-124 | candle-transformers/src/models/qwen2_moe.rs:297-303 | candle-transformers/src/models/qwen3_moe.rs:158-164 — before extracting anything, compare `candle-transformers/src/models/mixtral.rs` and `candle-transformers/src/models/qwen2_moe.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 275 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–7 lines × 3) candle-core/src/quantized/k_quants.rs:1084— candle-core/src/quantized/k_quants.rs:1084-1086 | candle-core/src/quantized/k_quants.rs:1491-1497 | candle-core/src/quantized/k_quants.rs:1749-1755 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–7 lines × 4) candle-transformers/src/models/paddleocr_vl/vision.rs:1017— candle-transformers/src/models/paddleocr_vl/vision.rs:1017-1023 | candle-transformers/src/models/paddleocr_vl/vision.rs:1089-1095 | candle-transformers/src/models/paddleocr_vl/vision.rs:1171-1173 | candle-transformers/src/models/qwen3_vl/vision.rs:566-568 — `candle-transformers/src/models/paddleocr_vl/vision.rs` and `candle-transformers/src/models/qwen3_vl/vision.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 11 separate duplicated blocks between them, totalling at least 77 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 36) candle-transformers/src/models/based.rs:410— candle-transformers/src/models/based.rs:410-415 | candle-transformers/src/models/blip_text.rs:133-138 | candle-transformers/src/models/chatglm.rs:290-295 | candle-transformers/src/models/codegeex4_9b.rs:311-316 | candle-transformers/src/models/csm.rs:218-223 | candle-transformers/src/models/deepseek2.rs:667-672 | candle-transformers/src/models/gemma.rs:225-230 | candle-transformers/src/models/gemma2.rs:220-225 | candle-transformers/src/models/glm4.rs:332-337 | candle-transformers/src/models/helium.rs:225-230 | candle-transformers/src/models/marian.rs:307-312 | candle-transformers/src/models/metavoice.rs:810-815 | candle-transformers/src/models/mistral.rs:274-279 | candle-transformers/src/models/mixformer.rs:301-306 | candle-transformers/src/models/mixtral.rs:206-211 | candle-transformers/src/models/mpt.rs:107-112 | candle-transformers/src/models/olmo.rs:194-199 | candle-transformers/src/models/olmo2.rs:182-187 | candle-transformers/src/models/paddleocr_vl/text.rs:841-846 | candle-transformers/src/models/parler_tts.rs:131-136 | candle-transformers/src/models/phi.rs:231-236 | candle-transformers/src/models/phi3.rs:234-239 | candle-transformers/src/models/quantized_blip_text.rs:129-134 | candle-transformers/src/models/quantized_metavoice.rs:113-118 | candle-transformers/src/models/quantized_mistral.rs:172-177 | candle-transformers/src/models/quantized_mixformer.rs:218-223 | candle-transformers/src/models/quantized_mpt.rs:84-89 | candle-transformers/src/models/quantized_recurrent_gemma.rs:246-251 | candle-transformers/src/models/quantized_stable_lm.rs:148-153 | candle-transformers/src/models/qwen2.rs:183-188 | candle-transformers/src/models/qwen2_moe.rs:190-195 | candle-transformers/src/models/recurrent_gemma.rs:479-484 | candle-transformers/src/models/stable_lm.rs:271-276 | candle-transformers/src/models/starcoder2.rs:186-191 | candle-transformers/src/models/trocr.rs:221-226 | candle-transformers/src/models/yi.rs:222-227 — before extracting anything, compare `candle-transformers/src/models/based.rs` and `candle-transformers/src/models/gemma.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 17) candle-transformers/src/models/csm.rs:358— candle-transformers/src/models/csm.rs:358-363 | candle-transformers/src/models/deepseek2.rs:1033-1038 | candle-transformers/src/models/gemma.rs:385-390 | candle-transformers/src/models/gemma2.rs:415-420 | candle-transformers/src/models/helium.rs:359-364 | candle-transformers/src/models/mistral.rs:415-420 | candle-transformers/src/models/mixtral.rs:457-462 | candle-transformers/src/models/paddleocr_vl/text.rs:1158-1163 | candle-transformers/src/models/phi3.rs:396-401 | candle-transformers/src/models/quantized_mistral.rs:304-309 | candle-transformers/src/models/quantized_recurrent_gemma.rs:399-404 | candle-transformers/src/models/quantized_stable_lm.rs:274-279 | candle-transformers/src/models/qwen2_moe.rs:452-457 | candle-transformers/src/models/recurrent_gemma.rs:630-635 | candle-transformers/src/models/stable_lm.rs:406-411 | candle-transformers/src/models/starcoder2.rs:319-324 | candle-transformers/src/models/yi.rs:338-343 — before extracting anything, compare `candle-transformers/src/models/csm.rs` and `candle-transformers/src/models/gemma.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 13) candle-transformers/src/models/gemma.rs:85— candle-transformers/src/models/gemma.rs:85-90 | candle-transformers/src/models/gemma2.rs:78-83 | candle-transformers/src/models/glm4_new.rs:47-52 | candle-transformers/src/models/olmo.rs:46-51 | candle-transformers/src/models/olmo2.rs:38-43 | candle-transformers/src/models/qwen2.rs:49-54 | candle-transformers/src/models/qwen2_moe.rs:57-62 | candle-transformers/src/models/qwen3.rs:44-49 | candle-transformers/src/models/smol/quantized_smollm3.rs:179-184 | candle-transformers/src/models/smol/smollm3.rs:74-79 | candle-transformers/src/models/stable_lm.rs:94-99 | candle-transformers/src/models/starcoder2.rs:54-59 | candle-transformers/src/models/z_image/text_encoder.rs:116-121 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (2–6 lines × 14) candle-transformers/src/models/gemma.rs:299— candle-transformers/src/models/gemma.rs:299-305 | candle-transformers/src/models/gemma4/vision.rs:326-332 | candle-transformers/src/models/glm4_new.rs:252-258 | candle-transformers/src/models/helium.rs:277-283 | candle-transformers/src/models/mistral.rs:326-332 | candle-transformers/src/models/nvembed_v2/embedding.rs:186-192 | candle-transformers/src/models/phi3.rs:313-319 | candle-transformers/src/models/quantized_mistral.rs:217-223 | candle-transformers/src/models/qwen2.rs:229-235 | candle-transformers/src/models/qwen3.rs:371-376 | candle-transformers/src/models/smol/smollm3.rs:322-327 | candle-transformers/src/models/yi.rs:263-268 | candle-transformers/src/models/z_image/text_encoder.rs:333-334 | candle-transformers/src/models/z_image/text_encoder.rs:335-340 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/glm4_new.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 7) candle-metal-kernels/src/kernels/affine.rs:30— candle-metal-kernels/src/kernels/affine.rs:30-35 | candle-metal-kernels/src/kernels/affine.rs:98-103 | candle-metal-kernels/src/kernels/affine.rs:164-169 | candle-metal-kernels/src/kernels/binary.rs:33-39 | candle-metal-kernels/src/kernels/cast.rs:28-33 | candle-metal-kernels/src/kernels/ternary.rs:54-65 | candle-metal-kernels/src/kernels/unary.rs:35-40 — there are 7 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (2–6 lines × 7) candle-transformers/src/models/glm4_new.rs:220— candle-transformers/src/models/glm4_new.rs:220-225 | candle-transformers/src/models/quantized_glm4.rs:267-272 | candle-transformers/src/models/quantized_qwen3.rs:362-363 | candle-transformers/src/models/quantized_qwen3_moe.rs:198-199 | candle-transformers/src/models/qwen3.rs:341-346 | candle-transformers/src/models/smol/smollm3.rs:287-292 | candle-transformers/src/models/z_image/text_encoder.rs:307-312 — before extracting anything, compare `candle-transformers/src/models/glm4_new.rs` and `candle-transformers/src/models/quantized_glm4.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (2–6 lines × 5) candle-transformers/src/models/mistral.rs:224— candle-transformers/src/models/mistral.rs:224-225 | candle-transformers/src/models/mixtral.rs:153-158 | candle-transformers/src/models/nvembed_v2/embedding.rs:102-107 | candle-transformers/src/models/quantized_mistral.rs:118-123 | candle-transformers/src/models/yi.rs:170-175 — before extracting anything, compare `candle-transformers/src/models/mistral.rs` and `candle-transformers/src/models/mixtral.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–6 lines × 4) candle-core/src/quantized/neon.rs:3267— candle-core/src/quantized/neon.rs:3267-3269 | candle-core/src/quantized/neon.rs:3270-3275 | candle-core/src/quantized/neon.rs:3296-3298 | candle-core/src/quantized/neon.rs:3299-3304 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (4–6 lines × 5) candle-transformers/src/models/granite.rs:436— candle-transformers/src/models/granite.rs:436-439 | candle-transformers/src/models/llama.rs:505-508 | candle-transformers/src/models/llama2_c.rs:351-356 | candle-transformers/src/models/quantized_llama2_c.rs:238-243 | candle-transformers/src/models/voxtral/voxtral_llama.rs:440-443 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/llama.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 297 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–6 lines × 17) candle-nn/src/attention/cpu_flash/causal.rs:86— candle-nn/src/attention/cpu_flash/causal.rs:86-88 | candle-nn/src/attention/cpu_flash/causal.rs:91-93 | candle-nn/src/attention/cpu_flash/causal.rs:96-98 | candle-nn/src/attention/cpu_flash/varlen.rs:185-187 | candle-nn/src/attention/cpu_flash/varlen.rs:191-193 | candle-nn/src/attention/cpu_flash/varlen.rs:197-199 | candle-transformers/src/models/quantized_qwen3.rs:274-276 | candle-transformers/src/models/quantized_qwen3.rs:278-283 | candle-transformers/src/models/quantized_qwen3.rs:285-290 | candle-transformers/src/models/quantized_qwen3.rs:291-296 | candle-transformers/src/models/quantized_qwen3.rs:323-325 | candle-transformers/src/models/quantized_qwen3.rs:328-330 | candle-transformers/src/models/smol/quantized_smollm3.rs:407-409 | candle-transformers/src/models/smol/quantized_smollm3.rs:412-414 | candle-transformers/src/models/smol/quantized_smollm3.rs:417-419 | candle-transformers/src/models/smol/quantized_smollm3.rs:506-508 | candle-transformers/src/models/smol/quantized_smollm3.rs:511-513 — before extracting anything, compare `candle-transformers/src/models/quantized_qwen3.rs` and `candle-transformers/src/models/smol/quantized_smollm3.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 23) candle-transformers/src/models/gemma.rs:213— candle-transformers/src/models/gemma.rs:213-217 | candle-transformers/src/models/gemma2.rs:208-212 | candle-transformers/src/models/gemma3.rs:234-238 | candle-transformers/src/models/gemma4/text.rs:320-324 | candle-transformers/src/models/glm4_new.rs:205-209 | candle-transformers/src/models/mixtral.rs:194-198 | candle-transformers/src/models/olmo.rs:182-186 | candle-transformers/src/models/olmo2.rs:170-174 | candle-transformers/src/models/paddleocr_vl/text.rs:805-809 | candle-transformers/src/models/paddleocr_vl/text.rs:910-914 | candle-transformers/src/models/phi.rs:210-214 | candle-transformers/src/models/phi3.rs:222-226 | candle-transformers/src/models/quantized_glm4.rs:240-244 | candle-transformers/src/models/quantized_qwen3.rs:251-255 | candle-transformers/src/models/quantized_stable_lm.rs:129-133 | candle-transformers/src/models/qwen2.rs:171-175 | candle-transformers/src/models/qwen2_moe.rs:178-182 | candle-transformers/src/models/qwen3.rs:205-209 | candle-transformers/src/models/smol/smollm3.rs:255-259 | candle-transformers/src/models/stable_lm.rs:252-256 | candle-transformers/src/models/starcoder2.rs:174-178 | candle-transformers/src/models/yi.rs:210-214 | candle-transformers/src/models/z_image/text_encoder.rs:284-288 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 15) candle-transformers/src/models/based.rs:317— candle-transformers/src/models/based.rs:317-321 | candle-transformers/src/models/gemma.rs:86-90 | candle-transformers/src/models/gemma2.rs:79-83 | candle-transformers/src/models/glm4_new.rs:48-52 | candle-transformers/src/models/olmo.rs:47-51 | candle-transformers/src/models/olmo2.rs:39-43 | candle-transformers/src/models/qwen2.rs:50-54 | candle-transformers/src/models/qwen2_moe.rs:58-62 | candle-transformers/src/models/qwen3.rs:45-49 | candle-transformers/src/models/recurrent_gemma.rs:113-117 | candle-transformers/src/models/smol/quantized_smollm3.rs:180-184 | candle-transformers/src/models/smol/smollm3.rs:75-79 | candle-transformers/src/models/stable_lm.rs:95-99 | candle-transformers/src/models/starcoder2.rs:55-59 | candle-transformers/src/models/z_image/text_encoder.rs:117-121 — before extracting anything, compare `candle-transformers/src/models/based.rs` and `candle-transformers/src/models/gemma.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 13) candle-transformers/src/models/gemma.rs:320— candle-transformers/src/models/gemma.rs:320-324 | candle-transformers/src/models/helium.rs:298-302 | candle-transformers/src/models/mistral.rs:347-351 | candle-transformers/src/models/mixtral.rs:390-395 | candle-transformers/src/models/nvembed_v2/embedding.rs:207-213 | candle-transformers/src/models/olmo.rs:257-261 | candle-transformers/src/models/phi3.rs:334-338 | candle-transformers/src/models/quantized_mistral.rs:238-242 | candle-transformers/src/models/quantized_stable_lm.rs:219-223 | candle-transformers/src/models/qwen2.rs:250-254 | candle-transformers/src/models/qwen2_moe.rs:383-387 | candle-transformers/src/models/stable_lm.rs:349-353 | candle-transformers/src/models/starcoder2.rs:250-254 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/helium.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–5 lines × 17) candle-transformers/src/models/gemma.rs:350— candle-transformers/src/models/gemma.rs:350-353 | candle-transformers/src/models/gemma2.rs:369-372 | candle-transformers/src/models/helium.rs:329-333 | candle-transformers/src/models/mistral.rs:379-383 | candle-transformers/src/models/mixtral.rs:420-424 | candle-transformers/src/models/nvembed_v2/embedding.rs:233-237 | candle-transformers/src/models/olmo.rs:288-292 | candle-transformers/src/models/olmo2.rs:284-288 | candle-transformers/src/models/paddleocr_vl/text.rs:1116-1118 | candle-transformers/src/models/phi3.rs:365-369 | candle-transformers/src/models/quantized_mistral.rs:269-273 | candle-transformers/src/models/quantized_stable_lm.rs:246-250 | candle-transformers/src/models/qwen2.rs:281-285 | candle-transformers/src/models/qwen2_moe.rs:413-416 | candle-transformers/src/models/stable_lm.rs:377-381 | candle-transformers/src/models/starcoder2.rs:282-286 | candle-transformers/src/models/yi.rs:310-314 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (2–5 lines × 7) candle-transformers/src/models/gemma.rs:69— candle-transformers/src/models/gemma.rs:69-73 | candle-transformers/src/models/gemma2.rs:62-66 | candle-transformers/src/models/gemma3.rs:57-61 | candle-transformers/src/models/gemma4/audio.rs:35-36 | candle-transformers/src/models/gemma4/text.rs:37-41 | candle-transformers/src/models/gemma4/vision.rs:36-40 | candle-transformers/src/models/recurrent_gemma.rs:86-90 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–5 lines × 4) candle-core/src/cpu/neon.rs:62— candle-core/src/cpu/neon.rs:62-65 | candle-core/src/cpu/neon.rs:130-134 | candle-core/src/cpu/neon.rs:329-333 | candle-core/src/cpu/neon.rs:410-414 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–5 lines × 6) candle-core/src/cpu_backend/mod.rs:2852— candle-core/src/cpu_backend/mod.rs:2852-2856 | candle-core/src/cpu_backend/mod.rs:2866-2868 | candle-core/src/metal_backend/mod.rs:964-968 | candle-core/src/metal_backend/mod.rs:975-977 | candle-core/src/metal_backend/mod.rs:1168-1171 | candle-core/src/metal_backend/mod.rs:1178-1180 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (3–5 lines × 3) candle-nn/src/attention/cpu_flash/varlen.rs:277— candle-nn/src/attention/cpu_flash/varlen.rs:277-279 | candle-nn/src/attention/cpu_flash/varlen.rs:281-285 | candle-nn/src/attention/cpu_flash/varlen.rs:287-291 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 16) candle-transformers/src/models/chatglm.rs:115— candle-transformers/src/models/chatglm.rs:115-120 | candle-transformers/src/models/deepseek2.rs:211-216 | candle-transformers/src/models/distilbert.rs:13-18 | candle-transformers/src/models/granite.rs:341-346 | candle-transformers/src/models/granitemoehybrid.rs:393-398 | candle-transformers/src/models/lfm2.rs:205-210 | candle-transformers/src/models/llama.rs:388-393 | candle-transformers/src/models/llama2_c.rs:251-256 | candle-transformers/src/models/mpt.rs:293-298 | candle-transformers/src/models/phi.rs:143-148 | candle-transformers/src/models/quantized_llama2_c.rs:138-143 | candle-transformers/src/models/quantized_mixformer.rs:48-53 | candle-transformers/src/models/quantized_t5.rs:50-55 | candle-transformers/src/models/t5.rs:117-122 | candle-transformers/src/models/voxtral/voxtral_llama.rs:312-317 | candle-wasm-examples/llama2-c/src/model.rs:166-171 — before extracting anything, compare `candle-transformers/src/models/granite.rs` and `candle-transformers/src/models/granitemoehybrid.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 17) candle-transformers/src/models/gemma.rs:143— candle-transformers/src/models/gemma.rs:143-147 | candle-transformers/src/models/gemma2.rs:136-140 | candle-transformers/src/models/gemma3.rs:141-145 | candle-transformers/src/models/gemma4/text.rs:185-189 | candle-transformers/src/models/helium.rs:129-133 | candle-transformers/src/models/mistral.rs:179-183 | candle-transformers/src/models/nvembed_v2/embedding.rs:79-83 | candle-transformers/src/models/olmo.rs:104-108 | candle-transformers/src/models/olmo2.rs:96-100 | candle-transformers/src/models/quantized_mistral.rs:94-98 | candle-transformers/src/models/qwen2.rs:107-111 | candle-transformers/src/models/qwen2_moe.rs:114-118 | candle-transformers/src/models/qwen3.rs:92-96 | candle-transformers/src/models/qwen3_moe.rs:89-93 | candle-transformers/src/models/smol/smollm3.rs:138-142 | candle-transformers/src/models/yi.rs:146-150 | candle-transformers/src/models/z_image/text_encoder.rs:178-182 — before extracting anything, compare `candle-transformers/src/models/gemma.rs` and `candle-transformers/src/models/gemma2.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–6 lines × 3) candle-transformers/src/models/quantized_glm4.rs:369— candle-transformers/src/models/quantized_glm4.rs:369-374 | candle-transformers/src/models/quantized_qwen3.rs:469-474 | candle-transformers/src/models/quantized_qwen3_moe.rs:251-254 — before extracting anything, compare `candle-transformers/src/models/quantized_glm4.rs` and `candle-transformers/src/models/quantized_qwen3.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 10) candle-core/src/cuda_backend/mod.rs:2374— candle-core/src/cuda_backend/mod.rs:2374-2378 | candle-core/src/cuda_backend/mod.rs:2390-2394 | candle-core/src/cuda_backend/mod.rs:2406-2410 | candle-core/src/cuda_backend/mod.rs:2422-2426 | candle-core/src/cuda_backend/mod.rs:2438-2442 | candle-core/src/cuda_backend/mod.rs:2454-2458 | candle-core/src/cuda_backend/mod.rs:2470-2474 | candle-core/src/cuda_backend/mod.rs:2486-2490 | candle-core/src/cuda_backend/mod.rs:2502-2506 | candle-core/src/cuda_backend/mod.rs:2518-2522 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 7) candle-nn/src/rotary_emb.rs:584— candle-nn/src/rotary_emb.rs:584-588 | candle-transformers/src/models/mixtral.rs:75-79 | candle-transformers/src/models/paddleocr_vl/vision.rs:279-283 | candle-transformers/src/models/qwen3_vl/vision.rs:84-88 | candle-transformers/src/models/recurrent_gemma.rs:100-104 | candle-transformers/src/models/starcoder2.rs:45-49 | candle-transformers/src/models/yi.rs:76-80 — before extracting anything, compare `candle-transformers/src/models/mixtral.rs` and `candle-transformers/src/models/recurrent_gemma.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Near-duplicate member pair (34 shared lines) candle-wasm-examples/llama2-c/src/app.rs:107— candle-wasm-examples/llama2-c/src/app.rs:107-177 | candle-wasm-examples/yolo/src/app.rs:146-231 — These two members are variants of one another: 34 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Duplicated block (34 lines × 2) candle-wasm-examples/t5/src/bin/m-quantized.rs:143— candle-wasm-examples/t5/src/bin/m-quantized.rs:143-176 | candle-wasm-examples/t5/src/bin/m.rs:141-174 — before extracting anything, compare `candle-wasm-examples/t5/src/bin/m-quantized.rs` and `candle-wasm-examples/t5/src/bin/m.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–19 lines × 2) candle-examples/src/chat_template.rs:167— candle-examples/src/chat_template.rs:167-184 | candle-wasm-examples/chat-template/src/lib.rs:227-245 — before extracting anything, compare `candle-examples/src/chat_template.rs` and `candle-wasm-examples/chat-template/src/lib.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7–8 lines × 4) candle-wasm-examples/t5/src/bin/m-quantized.rs:69— candle-wasm-examples/t5/src/bin/m-quantized.rs:69-76 | candle-wasm-examples/t5/src/bin/m-quantized.rs:152-158 | candle-wasm-examples/t5/src/bin/m.rs:66-73 | candle-wasm-examples/t5/src/bin/m.rs:150-156 — before extracting anything, compare `candle-wasm-examples/t5/src/bin/m-quantized.rs` and `candle-wasm-examples/t5/src/bin/m.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Low cohesion: Tensor (LCOM4 8) candle-core/src/tensor.rs:70— Tensor's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Duplication concentrated across 9 sibling directories (12 clone groups) candle-wasm-examples/moondream/moondreamWorker.js:6— 12 duplicated blocks under candle-wasm-examples/ have copies in at least two of the sibling directories bert, blip, llama2-c, moondream, phi, segment-anything (+3 more sibling(s) not listed) — 11 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 12 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 12 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 12 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication· Duplicated block with local edits (114 matched lines × 2 locations) · ×1
Duplicated block with local edits (114 matched lines × 2 locations) candle-wasm-examples/moondream/moondreamWorker.js:6— candle-wasm-examples/moondream/moondreamWorker.js:6 · candle-wasm-examples/phi/phiWorker.js:4 — the two spans are one implementation copied and then locally edited — 652 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (47 lines × 2 locations) candle-wasm-examples/t5/T5ModelConditionalGeneration.js:2— candle-wasm-examples/t5/T5ModelConditionalGeneration.js:2 · candle-wasm-examples/t5/T5ModelEncoderWorker.js:2 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (44 lines × 2 locations) candle-wasm-examples/bert/bertWorker.js:20— candle-wasm-examples/bert/bertWorker.js:20 · candle-wasm-examples/t5/T5ModelEncoderWorker.js:27 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (29 lines × 2 locations) candle-wasm-examples/moondream/moondreamWorker.js:59— candle-wasm-examples/moondream/moondreamWorker.js:59 · candle-wasm-examples/segment-anything/samWorker.js:39 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (25 lines × 2 locations) candle-wasm-examples/llama2-c/llama2cWorker.js:30— candle-wasm-examples/llama2-c/llama2cWorker.js:30 · candle-wasm-examples/phi/phiWorker.js:54 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (25 lines × 3 locations) candle-wasm-examples/llama2-c/llama2cWorker.js:88— candle-wasm-examples/llama2-c/llama2cWorker.js:88 · candle-wasm-examples/moondream/moondreamWorker.js:176 · candle-wasm-examples/phi/phiWorker.js:130 — the 3 copies are spread across 3 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
Duplicated block (23 lines × 2 locations) candle-wasm-examples/blip/blipWorker.js:26— candle-wasm-examples/blip/blipWorker.js:26 · candle-wasm-examples/t5/T5ModelConditionalGeneration.js:29 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (20 lines × 3 locations) candle-wasm-examples/bert/utils.js:12— candle-wasm-examples/bert/utils.js:12 · candle-wasm-examples/t5/utils.js:14 · candle-wasm-examples/t5/utils.js:48 — the 3 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (16 lines × 2 locations) candle-wasm-examples/llama2-c/llama2cWorker.js:71— candle-wasm-examples/llama2-c/llama2cWorker.js:71 · candle-wasm-examples/phi/phiWorker.js:105 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (14 lines × 8 locations) candle-wasm-examples/bert/bertWorker.js:5— candle-wasm-examples/bert/bertWorker.js:5 · candle-wasm-examples/blip/blipWorker.js:5 · candle-wasm-examples/llama2-c/llama2cWorker.js:4 · candle-wasm-examples/segment-anything/samWorker.js:7 · +4 more site(s) not listed — the 8 copies are spread across 7 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 8 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
Duplicated block (14 lines × 2 locations) candle-wasm-examples/t5/utils.js:10— candle-wasm-examples/t5/utils.js:10 · candle-wasm-examples/t5/utils.js:44 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (12 lines × 2 locations) candle-wasm-examples/llama2-c/llama2cWorker.js:3— candle-wasm-examples/llama2-c/llama2cWorker.js:3 · candle-wasm-examples/yolo/yoloWorker.js:4 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (5 lines × 2 locations) candle-wasm-examples/moondream/moondreamWorker.js:128— candle-wasm-examples/moondream/moondreamWorker.js:128 · candle-wasm-examples/segment-anything/samWorker.js:127 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Third-party script without Subresource Integrity candle-wasm-examples/bert/lib-example.html:21— `https://cdn.tailwindcss.com` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. 10 such include(s) across the repository's markup.
Orphaned file candle-transformers/src/models/metavoice.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/rwkv_v7.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/z_image/transformer.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/mobilenetv4.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/stable_diffusion/uni_pc.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/t5.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-examples/src/imagenet.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-core/src/pickle.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-pyo3/py_src/candle/nn/module.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/quantized_t5.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/stable_diffusion/unet_2d_blocks.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-wasm-examples/yolo/src/model.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/siglip.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/encodec.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-wasm-examples/chat-template/src/lib.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/snac.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/recurrent_gemma.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/segformer.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/mamba2.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/quantized_lfm2.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/mimi/conv.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/marian.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-wasm-examples/quant-qwen3/src/m.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/glm4.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file candle-transformers/src/models/granitemoehybrid.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Duplicated predicate candle-wasm-examples/moondream/moondreamWorker.js:70— `this.imageArrayHash[this.currentModelID] === imageArrayHash && this.instance[this.currentModelID]` appears character-identically in 2 files — candle-wasm-examples/moondream/moondreamWorker.js, candle-wasm-examples/segment-anything/samWorker.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate candle-core/src/cpu_backend/mod.rs:1564— `(lhs_m1 == 1 || k == 1) && (lhs_m2 == k || m == 1)` appears character-identically in 3 files — candle-core/src/cpu_backend/mod.rs, candle-core/src/cuda_backend/mod.rs, candle-metal-kernels/src/kernels/mlx_gemm.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate candle-core/src/cuda_backend/mod.rs:1437— `(lhs_m1 == m || k == 1) && (lhs_m2 == 1 || m == 1)` appears character-identically in 2 files — candle-core/src/cuda_backend/mod.rs, candle-metal-kernels/src/kernels/mlx_gemm.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate candle-core/src/cpu_backend/mod.rs:1556— `(rhs_m1 == 1 || n == 1) && (rhs_m2 == n || k == 1)` appears character-identically in 3 files — candle-core/src/cpu_backend/mod.rs, candle-core/src/cuda_backend/mod.rs, candle-metal-kernels/src/kernels/mlx_gemm.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate candle-core/src/cuda_backend/mod.rs:1423— `(rhs_m1 == k || n == 1) && (rhs_m2 == 1 || k == 1)` appears character-identically in 2 files — candle-core/src/cuda_backend/mod.rs, candle-metal-kernels/src/kernels/mlx_gemm.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate candle-transformers/src/models/qwen2_moe.rs:356— `cfg.num_experts > 0 && (layer_idx + 1).is_multiple_of(cfg.decoder_sparse_step)` appears character-identically in 2 files — candle-transformers/src/models/qwen2_moe.rs, candle-transformers/src/models/qwen3_moe.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate candle-core/src/cuda_backend/mod.rs:392— `check_empty && layout.shape().elem_count() == 0` appears character-identically in 2 files — candle-core/src/cuda_backend/mod.rs, candle-core/src/metal_backend/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate candle-core/src/cpu_backend/mod.rs:557— `height_in == height_out && width_in == width_out` appears character-identically in 2 files — candle-core/src/cpu_backend/mod.rs, candle-core/src/tensor.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate candle-core/src/cpu_backend/mod.rs:2884— `kernel_l.is_contiguous() && params.dilation == 1 && params.padding == 0 && params.output_padding == 0` appears character-identically in 2 files — candle-core/src/cpu_backend/mod.rs, candle-core/src/cuda_backend/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate candle-flash-attn-v3/src/lib.rs:64— `q_rank != 4 || k_rank != 4 || v_rank != 4` appears character-identically in 2 files — candle-flash-attn-v3/src/lib.rs, candle-flash-attn/src/lib.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate candle-transformers/src/models/quantized_rwkv_v5.rs:295— `self.layers_are_rescaled && (block_idx + 1) % self.rescale_every == 0` appears character-identically in 4 files — candle-transformers/src/models/quantized_rwkv_v5.rs, candle-transformers/src/models/quantized_rwkv_v6.rs, candle-transformers/src/models/rwkv_v5.rs, candle-transformers/src/models/rwkv_v6.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate candle-transformers/src/models/quantized_t5.rs:351— `self.use_cache && key_value_states.is_none()` appears character-identically in 2 files — candle-transformers/src/models/quantized_t5.rs, candle-transformers/src/models/t5.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate candle-flash-attn-v3/src/lib.rs:174— `window_size_left < 0 && window_size_right == 0` appears character-identically in 2 files — candle-flash-attn-v3/src/lib.rs, candle-flash-attn/src/lib.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate candle-flash-attn-v3/src/lib.rs:179— `window_size_left < 0 && window_size_right >= 0` appears character-identically in 2 files — candle-flash-attn-v3/src/lib.rs, candle-flash-attn/src/lib.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate candle-flash-attn-v3/src/lib.rs:182— `window_size_left >= 0 && window_size_right < 0` appears character-identically in 2 files — candle-flash-attn-v3/src/lib.rs, candle-flash-attn/src/lib.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D34 · Knowledge Freshness· Most significant orphaned file · ×3
Most significant orphaned file candle-transformers/src/models/debertav2.rs:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
Most significant orphaned file candle-transformers/src/models/paddleocr_vl/text.rs:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
Most significant orphaned file candle-transformers/src/models/paddleocr_vl/vision.rs:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
Interpolated log message defeats structured logging candle-pyo3/py_src/candle/__init__.py:18— `warning` at line 18 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging candle-pyo3/py_src/candle/__init__.py:24— `warning` at line 24 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging candle-pyo3/py_src/candle/__init__.py:40— `warning` at line 40 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 7 significant file(s) lose their only recent owner: candle-core/src/quantized/repack.rs, candle-transformers/src/models/gemma4/audio.rs, candle-nn/src/moe/cutile.rs, candle-transformers/src/models/qwen3_vl/text.rs, candle-core/src/cuda_backend/cutile.rs, candle-transformers/src/models/gemma4/mod.rs, candle-transformers/src/models/qwen3_vl/config.rs. Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 3 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (12 single-owned of 342 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 342 of the 417 production source files in this repository met that bar). They are anonymized user #2 (2 file(s)), anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: candle-metal-kernels/src/metal/library.rs, candle-metal-kernels/src/metal/command_buffer.rs, candle-transformers/src/models/mimi/transformer.rs, candle-transformers/src/models/lfm2.rs.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 2 of 12 project(s) overshoot their size bounds, lowering Project Cohesion to 6.7/10. The most over is `candle-transformers` (75370 LoC, 765 module-visible types across 22 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Concentrated knowledge decay — 220 of 342 significant files have no living knowledge, while the repository is still being changed at a low rate (61 commit(s) in the last 90 days) — so this is one repo-wide knowledge-decay state, not 220 separate risks. Counted over 342 of the 417 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. The code moved on without the people who understood these files: document them or schedule a read-through before the next change lands in them.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Logging is not universal — Only 6/14 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `candle-wasm-examples/bert`, `candle-wasm-examples/blip`, `candle-wasm-examples/moondream`, `candle-wasm-examples/phi` and 3 more.
Silent fallback default on Err candle-wasm-examples/chat-template/src/lib.rs:601— `to_json` turns every `Err` into `"[]".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Outdated: js-sys — `js-sys` is locked at 0.3.104 but 0.3.106 is the current stable release on crates.io, and it already satisfies the `"0.3.64"` requirement declared in candle-wasm-examples/bert/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p js-sys` and commit the updated Cargo.lock.
Outdated: wasm-bindgen — `wasm-bindgen` is locked at 0.2.127 but 0.2.129 is the current stable release on crates.io, and it already satisfies the `"0.2.87"` requirement declared in candle-wasm-examples/bert/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p wasm-bindgen` and commit the updated Cargo.lock.
Outdated: wasm-bindgen-futures — `wasm-bindgen-futures` is locked at 0.4.77 but 0.4.79 is the current stable release on crates.io, and it already satisfies the `"0.4.37"` requirement declared in candle-wasm-examples/llama2-c/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p wasm-bindgen-futures` and commit the updated Cargo.lock.
Outdated: web-sys — `web-sys` is locked at 0.3.104 but 0.3.106 is the current stable release on crates.io, and it already satisfies the `"0.3.70"` requirement declared in candle-wasm-examples/llama2-c/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p web-sys` and commit the updated Cargo.lock.
Off the main sequence: candle-kernels — candle-kernels: abstractness 0.00, instability 0.00, distance 1.00 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: candle-metal-kernels — candle-metal-kernels: abstractness 0.06, instability 0.00, distance 0.94 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest and a Python pyproject.toml/requirements.txt (pip/uv/Poetry) — not scanned yet).
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest and a Python pyproject.toml/requirements.txt (pip/uv/Poetry) — not scanned yet).
0
—
Run 01a1766c-424d-79b4-90b1-b484bd6a7cea · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 38 · Warnings: 1740 · Recommendations: 249 · Info: 6 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 26-10-2026 @ 04:16 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.