Public report of jax-ml/jax, published 14 November 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.11.4). Assert 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, 14 November 2026, 04:06 UTC · Survey ID cd_49ba5fe11aa5463faa88cc087ac431b1
jax-ml/jax
Measured 14 November 2026, 04:04 UTC, at code version 75ce266
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Up 2 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: 310,566 lines of product code in 268 projects, tests not counted · Estimated rebuild effort: about 4.2 person-years · Weakest lens: Accessibility, 49
Findings by how serious they are
48 critical3352 serious99 minor
14 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look 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
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 04:04 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 the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work 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 ▸
61of 61 dimensions measured by tools.
3447of 3499 findings point to an exact file and line, so you can open each one in the code. The other 52 concern the repository as a whole, such as missing documentation.
61dimensions across 7 lenses, read from 310,566 lines of product code in 268 projects.
jax-ml/jax falls short of our standard for a preview release, held back most by its Accessibility lens, the interface's usability with a keyboard or assistive technology. It scores 58 out of 100 and is rated Adequate, and 31 of its 48 critical findings are security problems.
Accessibility, at 49, is the weakest lens and counts most in the score. The best first step is fixing focus, motion and contrast, worth about 9 points. Naming the access rules comes next, worth about 3 points. Raising Accessibility to 65 would lift the score to about 64.
Fifteen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Eleven settings leave the servers or containers unsafe, and seventeen parts of the code are no longer understood by anyone working on it. Pinning each tool to an exact version, correcting the unsafe settings and having someone learn the forgotten files would close these risks. The two passwords or keys in the code's history need replacing, with the old ones switched off. The two pipeline steps that run downloads without checking them need each download checked against a known checksum first.
The product code is 310,566 lines, about €600,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.
If Accessibility rose from 49 to 65, the lowest score rated Strong, the score would rise from 58 to about 64.
Code composition: what the lines of code are
Product code 54%Tests 46%
New since the last survey: 489 findings
These 489 critical or serious findings weren't in the previous survey, on 25 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · FileTooLong: scipy/bessel.py jax/_src/scipy/bessel.py
God Classes · FileTooLong: _src/lax_reference.py jax/_src/lax_reference.py
God Classes · FileTooLong: scipy/betaln.py jax/_src/scipy/betaln.py
Code Duplication · Near-duplicate member pair (83 shared lines) jax/experimental/pallas/ops/tpu/flash_attention.py
Code Duplication · Near-duplicate member pair (79 shared lines) jax/experimental/pallas/ops/gpu/all_gather_mgpu.py
Code Duplication · Edited copy of a member (9 corresponding lines) jax/_src/scipy/linalg.py
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) jax/_src/random/core.py
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) jax/_src/compute_on.py
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) jax/_src/lax/slicing.py
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) jax/_src/pallas/mosaic/lowering.py
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) jax/_src/pallas/mosaic_gpu/primitives.py
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) jax/_src/scipy/fft.py
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) jax/experimental/sparse/_lowerings.py
Code Duplication · Edited copy of a member (118 corresponding lines) jax/experimental/pallas/ops/tpu/flash_attention.py
Code Duplication · Edited copy of a member (75 corresponding lines) jax/experimental/pallas/ops/gpu/ragged_dot_mgpu.py
Code Duplication · Edited copy of a member (55 corresponding lines) jax/_src/scipy/bessel.py
Code Duplication · Edited copy of a member (79 corresponding lines) jax/_src/cudnn/fused_attention_stablehlo.py
Code Duplication · Edited copies of one member (3 members, 57+ corresponding lines) jax/experimental/pallas/ops/gpu/blackwell_ragged_dot_mgpu.py
Code Duplication · Edited copy of a member (44 corresponding lines) jax/_src/interpreters/partial_eval.py
Code Duplication · Edited copy of a member (58 corresponding lines) jax/_src/pallas/triton/lowering.py
Code Duplication · Edited copy of a member (26 corresponding lines) jax/_src/interpreters/ad.py
Code Duplication · Edited copy of a member (27 corresponding lines) jax/_src/interpreters/ad.py
Code Duplication · Edited copy of a member (37 corresponding lines) jax/_src/pallas/primitives.py
Code Duplication · Edited copy of a member (36 corresponding lines) jax/_src/pallas/mosaic_gpu/primitives.py
Code Duplication · Edited copy of a member (91 corresponding lines) jax/_src/pallas/mosaic/sc_lowering.py
Code Duplication · Edited copy of a member (69 corresponding lines) jax/_src/pmap.py
Code Duplication · Edited copy of a member (56 corresponding lines) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py
Code Duplication · Edited copy of a member (38 corresponding lines) jax/_src/interpreters/partial_eval.py
Code Duplication · Edited copy of a member (23 corresponding lines) jax/_src/interpreters/partial_eval.py
Code Duplication · Edited copy of a member (62 corresponding lines) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py
Code Duplication · Edited copy of a member (40 corresponding lines) jax/_src/pallas/mosaic/interpret/utils.py
Code Duplication · Edited copy of a member (30 corresponding lines) jax/_src/lax/lax.py
Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) jax/_src/lax/special.py
Code Duplication · Edited copy of a member (19 corresponding lines) jax/_src/lax/convolution.py
Code Duplication · Edited copy of a member (21 corresponding lines) jax/_src/ad_checkpoint.py
Code Duplication · Edited copy of a member (17 corresponding lines) jax/_src/lax/other.py
Code Duplication · Edited copy of a member (28 corresponding lines) jax/_src/pallas/triton/lowering.py
Code Duplication · Edited copy of a member (20 corresponding lines) jax/_src/interpreters/partial_eval.py
Code Duplication · Edited copy of a member (44 corresponding lines) jax/_src/lax/lax.py
Code Duplication · Edited copy of a member (22 corresponding lines) jax/_src/cudnn/fused_attention_stablehlo.py
Code Duplication · Edited copy of a member (16 corresponding lines) jax/_src/checkify.py
Code Duplication · Edited copy of a member (31 corresponding lines) jax/_src/lax/parallel.py
Code Duplication · Edited copy of a member (29 corresponding lines) jax/experimental/mosaic/gpu/launch_context.py
Code Duplication · Edited copy of a member (25 corresponding lines) jax/_src/config.py
Code Duplication · Edited copy of a member (15 corresponding lines) docs/autodidax.py
Code Duplication · Edited copies of one member (5 members, 39+ corresponding lines) jax/_src/config.py
Code Duplication · Edited copy of a member (31 corresponding lines) jax/_src/scipy/special.py
Code Duplication · Edited copy of a member (19 corresponding lines) jax/experimental/pallas/ops/tpu/random/philox.py
Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) jax/_src/ad_checkpoint.py
Code Duplication · Edited copy of a member (15 corresponding lines) jax/experimental/sparse/bcoo.py
Code Duplication · Edited copy of a member (23 corresponding lines) jax/experimental/sparse/coo.py
Code Duplication · Edited copy of a member (23 corresponding lines) jax/_src/lax/ann.py
Code Duplication · Edited copy of a member (16 corresponding lines) jax/_src/ad_checkpoint.py
We compare 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: 147 findings
These 147 critical or serious findings were in the previous survey, on 25 October 2026, and are gone from this one. The first 100 are listed here.
€200,000 to €1,000,000, for 3,346 to 10,615 hours of work, about 4.2 person-years for 2 to 8 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.8 at a score of 58. 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: 310,566 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: We price 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
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.
Name the access rules — DRF permission classes, django-guardian or django-rules permissions, a casbin or oso policy, or roles and permissions declared once — and consult them where access is checked (permission_classes, @permission_required, Depends), so the rule set is reviewable and testable on its own.
Raises the score by about 3 points · Medium effort · Access Controls
3
Resolve the 1 No network policy finding(s) in Network Egress Confinement.
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 €600,000 to build again, about 4.2 person-years of work. Its weakest lens is Accessibility, at 49 (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
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. Of all the actions in this report, it raises the score most for the work it takes: about 9 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.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 7% on every change. The history of the code shows how much it changes: about 220,915 lines over the last 90 days, which is about 895,933 lines a year. At that pace, the extra work comes to an estimated 69.9 to 419.2 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 our 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.
328 modules, with 236 dependencies between them. Every module uses only modules listed above it, so there are no loops.
The table shows the 40 modules with the most connections; 288 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.
jax._src.core uses jax._src.basearray, so a change to jax._src.basearray can break jax._src.core, while a change to jax._src.core can't break jax._src.basearray.
Position
Below the diagonal: jax._src.core uses a module listed above it, which is the healthy direction.
jax._src.core uses jax._src.dtypes, so a change to jax._src.dtypes can break jax._src.core, while a change to jax._src.core can't break jax._src.dtypes.
Position
Below the diagonal: jax._src.core uses a module listed above it, which is the healthy direction.
jax._src.core uses jax._src.effects, so a change to jax._src.effects can break jax._src.core, while a change to jax._src.core can't break jax._src.effects.
Position
Below the diagonal: jax._src.core uses a module listed above it, which is the healthy direction.
jax._src.core uses jax._src.pretty_printer, so a change to jax._src.pretty_printer can break jax._src.core, while a change to jax._src.core can't break jax._src.pretty_printer.
Position
Below the diagonal: jax._src.core uses a module listed above it, which is the healthy direction.
jax._src.core uses jax._src.source_info_util, so a change to jax._src.source_info_util can break jax._src.core, while a change to jax._src.core can't break jax._src.source_info_util.
Position
Below the diagonal: jax._src.core uses a module listed above it, which is the healthy direction.
jax._src.named_sharding uses jax._src.mesh, so a change to jax._src.mesh can break jax._src.named_sharding, while a change to jax._src.named_sharding can't break jax._src.mesh.
Position
Below the diagonal: jax._src.named_sharding uses a module listed above it, which is the healthy direction.
jax._src.named_sharding uses jax._src.sharding, so a change to jax._src.sharding can break jax._src.named_sharding, while a change to jax._src.named_sharding can't break jax._src.sharding.
Position
Below the diagonal: jax._src.named_sharding uses a module listed above it, which is the healthy direction.
jax._src.numpy uses jax._src.basearray, so a change to jax._src.basearray can break jax._src.numpy, while a change to jax._src.numpy can't break jax._src.basearray.
Position
Below the diagonal: jax._src.numpy uses a module listed above it, which is the healthy direction.
jax._src.pallas.fuser.fusible_dtype uses jax._src.dtypes, so a change to jax._src.dtypes can break jax._src.pallas.fuser.fusible_dtype, while a change to jax._src.pallas.fuser.fusible_dtype can't break jax._src.dtypes.
Position
Below the diagonal: jax._src.pallas.fuser.fusible_dtype uses a module listed above it, which is the healthy direction.
jax._src.array uses jax._src.basearray, so a change to jax._src.basearray can break jax._src.array, while a change to jax._src.array can't break jax._src.basearray.
Position
Below the diagonal: jax._src.array uses a module listed above it, which is the healthy direction.
jax._src.array uses jax._src.sharding, so a change to jax._src.sharding can break jax._src.array, while a change to jax._src.array can't break jax._src.sharding.
Position
Below the diagonal: jax._src.array uses a module listed above it, which is the healthy direction.
jax._src.export.serialization uses jax._src.core, so a change to jax._src.core can break jax._src.export.serialization, while a change to jax._src.export.serialization can't break jax._src.core.
Position
Below the diagonal: jax._src.export.serialization uses a module listed above it, which is the healthy direction.
jax._src.export.shape_poly uses jax._src.effects, so a change to jax._src.effects can break jax._src.export.shape_poly, while a change to jax._src.export.shape_poly can't break jax._src.effects.
Position
Below the diagonal: jax._src.export.shape_poly uses a module listed above it, which is the healthy direction.
jax._src.export.shape_poly uses jax._src.core, so a change to jax._src.core can break jax._src.export.shape_poly, while a change to jax._src.export.shape_poly can't break jax._src.core.
Position
Below the diagonal: jax._src.export.shape_poly uses a module listed above it, which is the healthy direction.
jax._src.interpreters.mlir uses jax._src.source_info_util, so a change to jax._src.source_info_util can break jax._src.interpreters.mlir, while a change to jax._src.interpreters.mlir can't break jax._src.source_info_util.
Position
Below the diagonal: jax._src.interpreters.mlir uses a module listed above it, which is the healthy direction.
jax._src.interpreters.mlir uses jax._src.core, so a change to jax._src.core can break jax._src.interpreters.mlir, while a change to jax._src.interpreters.mlir can't break jax._src.core.
Position
Below the diagonal: jax._src.interpreters.mlir uses a module listed above it, which is the healthy direction.
jax._src.interpreters.partial_eval uses jax._src.linear_util, so a change to jax._src.linear_util can break jax._src.interpreters.partial_eval, while a change to jax._src.interpreters.partial_eval can't break jax._src.linear_util.
Position
Below the diagonal: jax._src.interpreters.partial_eval uses a module listed above it, which is the healthy direction.
jax._src.interpreters.partial_eval uses jax._src.source_info_util, so a change to jax._src.source_info_util can break jax._src.interpreters.partial_eval, while a change to jax._src.interpreters.partial_eval can't break jax._src.source_info_util.
Position
Below the diagonal: jax._src.interpreters.partial_eval uses a module listed above it, which is the healthy direction.
jax._src.interpreters.partial_eval uses jax._src.core, so a change to jax._src.core can break jax._src.interpreters.partial_eval, while a change to jax._src.interpreters.partial_eval can't break jax._src.core.
Position
Below the diagonal: jax._src.interpreters.partial_eval uses a module listed above it, which is the healthy direction.
jax._src.pallas.core uses jax._src.basearray, so a change to jax._src.basearray can break jax._src.pallas.core, while a change to jax._src.pallas.core can't break jax._src.basearray.
Position
Below the diagonal: jax._src.pallas.core uses a module listed above it, which is the healthy direction.
jax._src.pallas.core uses jax._src.dtypes, so a change to jax._src.dtypes can break jax._src.pallas.core, while a change to jax._src.pallas.core can't break jax._src.dtypes.
Position
Below the diagonal: jax._src.pallas.core uses a module listed above it, which is the healthy direction.
jax._src.pallas.core uses jax._src.effects, so a change to jax._src.effects can break jax._src.pallas.core, while a change to jax._src.pallas.core can't break jax._src.effects.
Position
Below the diagonal: jax._src.pallas.core uses a module listed above it, which is the healthy direction.
jax._src.pallas.core uses jax._src.pretty_printer, so a change to jax._src.pretty_printer can break jax._src.pallas.core, while a change to jax._src.pallas.core can't break jax._src.pretty_printer.
Position
Below the diagonal: jax._src.pallas.core uses a module listed above it, which is the healthy direction.
jax._src.pallas.core uses jax._src.state.types, so a change to jax._src.state.types can break jax._src.pallas.core, while a change to jax._src.pallas.core can't break jax._src.state.types.
Position
Below the diagonal: jax._src.pallas.core uses a module listed above it, which is the healthy direction.
jax._src.pallas.core uses jax._src.core, so a change to jax._src.core can break jax._src.pallas.core, while a change to jax._src.pallas.core can't break jax._src.core.
Position
Below the diagonal: jax._src.pallas.core uses a module listed above it, which is the healthy direction.
docs.hijax_types uses jax._src.basearray, so a change to jax._src.basearray can break docs.hijax_types, while a change to docs.hijax_types can't break jax._src.basearray.
Position
Below the diagonal: docs.hijax_types uses a module listed above it, which is the healthy direction.
docs.hijax_types uses jax._src.named_sharding, so a change to jax._src.named_sharding can break docs.hijax_types, while a change to docs.hijax_types can't break jax._src.named_sharding.
Position
Below the diagonal: docs.hijax_types uses a module listed above it, which is the healthy direction.
docs.hijax_types uses jax._src.hijax, so a change to jax._src.hijax can break docs.hijax_types, while a change to docs.hijax_types can't break jax._src.hijax.
Position
Below the diagonal: docs.hijax_types uses a module listed above it, which is the healthy direction.
jax._src uses jax._src.linear_util, so a change to jax._src.linear_util can break jax._src, while a change to jax._src can't break jax._src.linear_util.
Position
Below the diagonal: jax._src uses a module listed above it, which is the healthy direction.
jax._src uses jax._src.pretty_printer, so a change to jax._src.pretty_printer can break jax._src, while a change to jax._src can't break jax._src.pretty_printer.
Position
Below the diagonal: jax._src uses a module listed above it, which is the healthy direction.
jax._src uses jax._src.source_info_util, so a change to jax._src.source_info_util can break jax._src, while a change to jax._src can't break jax._src.source_info_util.
Position
Below the diagonal: jax._src uses a module listed above it, which is the healthy direction.
28 pairs of types, where a type in jax._src uses a type in jax._src.core. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
jax._src uses jax._src.named_sharding, so a change to jax._src.named_sharding can break jax._src, while a change to jax._src can't break jax._src.named_sharding.
Position
Below the diagonal: jax._src uses a module listed above it, which is the healthy direction.
jax._src uses jax._src.interpreters.mlir, so a change to jax._src.interpreters.mlir can break jax._src, while a change to jax._src can't break jax._src.interpreters.mlir.
Position
Below the diagonal: jax._src uses a module listed above it, which is the healthy direction.
jax._src uses jax._src.interpreters.partial_eval, so a change to jax._src.interpreters.partial_eval can break jax._src, while a change to jax._src can't break jax._src.interpreters.partial_eval.
Position
Below the diagonal: jax._src uses a module listed above it, which is the healthy direction.
jax._src.export uses jax._src.basearray, so a change to jax._src.basearray can break jax._src.export, while a change to jax._src.export can't break jax._src.basearray.
Position
Below the diagonal: jax._src.export uses a module listed above it, which is the healthy direction.
jax._src.export uses jax._src.mesh, so a change to jax._src.mesh can break jax._src.export, while a change to jax._src.export can't break jax._src.mesh.
Position
Below the diagonal: jax._src.export uses a module listed above it, which is the healthy direction.
jax._src.export uses jax._src.core, so a change to jax._src.core can break jax._src.export, while a change to jax._src.export can't break jax._src.core.
Position
Below the diagonal: jax._src.export uses a module listed above it, which is the healthy direction.
jax._src.export uses jax._src.named_sharding, so a change to jax._src.named_sharding can break jax._src.export, while a change to jax._src.export can't break jax._src.named_sharding.
Position
Below the diagonal: jax._src.export uses a module listed above it, which is the healthy direction.
jax._src.export uses jax._src.export.serialization, so a change to jax._src.export.serialization can break jax._src.export, while a change to jax._src.export can't break jax._src.export.serialization.
Position
Below the diagonal: jax._src.export uses a module listed above it, which is the healthy direction.
jax._src.export uses jax._src.export.shape_poly, so a change to jax._src.export.shape_poly can break jax._src.export, while a change to jax._src.export can't break jax._src.export.shape_poly.
Position
Below the diagonal: jax._src.export uses a module listed above it, which is the healthy direction.
jax._src.export uses jax._src.interpreters.mlir, so a change to jax._src.interpreters.mlir can break jax._src.export, while a change to jax._src.export can't break jax._src.interpreters.mlir.
Position
Below the diagonal: jax._src.export uses a module listed above it, which is the healthy direction.
jax._src.interpreters uses jax._src.basearray, so a change to jax._src.basearray can break jax._src.interpreters, while a change to jax._src.interpreters can't break jax._src.basearray.
Position
Below the diagonal: jax._src.interpreters uses a module listed above it, which is the healthy direction.
jax._src.interpreters uses jax._src.flattree, so a change to jax._src.flattree can break jax._src.interpreters, while a change to jax._src.interpreters can't break jax._src.flattree.
Position
Below the diagonal: jax._src.interpreters uses a module listed above it, which is the healthy direction.
jax._src.interpreters uses jax._src.linear_util, so a change to jax._src.linear_util can break jax._src.interpreters, while a change to jax._src.interpreters can't break jax._src.linear_util.
Position
Below the diagonal: jax._src.interpreters uses a module listed above it, which is the healthy direction.
jax._src.interpreters uses jax._src.pretty_printer, so a change to jax._src.pretty_printer can break jax._src.interpreters, while a change to jax._src.interpreters can't break jax._src.pretty_printer.
Position
Below the diagonal: jax._src.interpreters uses a module listed above it, which is the healthy direction.
jax._src.interpreters uses jax._src.sharding, so a change to jax._src.sharding can break jax._src.interpreters, while a change to jax._src.interpreters can't break jax._src.sharding.
Position
Below the diagonal: jax._src.interpreters uses a module listed above it, which is the healthy direction.
jax._src.interpreters uses jax._src.source_info_util, so a change to jax._src.source_info_util can break jax._src.interpreters, while a change to jax._src.interpreters can't break jax._src.source_info_util.
Position
Below the diagonal: jax._src.interpreters uses a module listed above it, which is the healthy direction.
jax._src.interpreters uses jax._src.core, so a change to jax._src.core can break jax._src.interpreters, while a change to jax._src.interpreters can't break jax._src.core.
Position
Below the diagonal: jax._src.interpreters uses a module listed above it, which is the healthy direction.
jax._src.interpreters uses jax._src.named_sharding, so a change to jax._src.named_sharding can break jax._src.interpreters, while a change to jax._src.interpreters can't break jax._src.named_sharding.
Position
Below the diagonal: jax._src.interpreters uses a module listed above it, which is the healthy direction.
jax._src.interpreters uses jax._src.interpreters.mlir, so a change to jax._src.interpreters.mlir can break jax._src.interpreters, while a change to jax._src.interpreters can't break jax._src.interpreters.mlir.
Position
Below the diagonal: jax._src.interpreters uses a module listed above it, which is the healthy direction.
jax._src.interpreters uses jax._src.interpreters.partial_eval, so a change to jax._src.interpreters.partial_eval can break jax._src.interpreters, while a change to jax._src.interpreters can't break jax._src.interpreters.partial_eval.
Position
Below the diagonal: jax._src.interpreters uses a module listed above it, which is the healthy direction.
jax._src.interpreters.ad uses jax._src.linear_util, so a change to jax._src.linear_util can break jax._src.interpreters.ad, while a change to jax._src.interpreters.ad can't break jax._src.linear_util.
Position
Below the diagonal: jax._src.interpreters.ad uses a module listed above it, which is the healthy direction.
jax._src.interpreters.ad uses jax._src.core, so a change to jax._src.core can break jax._src.interpreters.ad, while a change to jax._src.interpreters.ad can't break jax._src.core.
Position
Below the diagonal: jax._src.interpreters.ad uses a module listed above it, which is the healthy direction.
jax._src.interpreters.ad uses jax._src.interpreters.partial_eval, so a change to jax._src.interpreters.partial_eval can break jax._src.interpreters.ad, while a change to jax._src.interpreters.ad can't break jax._src.interpreters.partial_eval.
Position
Below the diagonal: jax._src.interpreters.ad uses a module listed above it, which is the healthy direction.
jax._src.lax uses jax._src.basearray, so a change to jax._src.basearray can break jax._src.lax, while a change to jax._src.lax can't break jax._src.basearray.
Position
Below the diagonal: jax._src.lax uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in jax._src.lax uses a type in jax._src.pretty_printer.
The types involved
jax._src.lax.lax → jax._src.pretty_printer.Doc
Direction
jax._src.lax uses jax._src.pretty_printer, so a change to jax._src.pretty_printer can break jax._src.lax, while a change to jax._src.lax can't break jax._src.pretty_printer.
Position
Below the diagonal: jax._src.lax uses a module listed above it, which is the healthy direction.
jax._src.lax uses jax._src.interpreters.mlir, so a change to jax._src.interpreters.mlir can break jax._src.lax, while a change to jax._src.lax can't break jax._src.interpreters.mlir.
Position
Below the diagonal: jax._src.lax uses a module listed above it, which is the healthy direction.
jax._src.lax.control_flow uses jax._src.basearray, so a change to jax._src.basearray can break jax._src.lax.control_flow, while a change to jax._src.lax.control_flow can't break jax._src.basearray.
Position
Below the diagonal: jax._src.lax.control_flow uses a module listed above it, which is the healthy direction.
jax._src.lax.control_flow uses jax._src.flattree, so a change to jax._src.flattree can break jax._src.lax.control_flow, while a change to jax._src.lax.control_flow can't break jax._src.flattree.
Position
Below the diagonal: jax._src.lax.control_flow uses a module listed above it, which is the healthy direction.
jax._src.lax.control_flow uses jax._src.core, so a change to jax._src.core can break jax._src.lax.control_flow, while a change to jax._src.lax.control_flow can't break jax._src.core.
Position
Below the diagonal: jax._src.lax.control_flow uses a module listed above it, which is the healthy direction.
jax._src.lax.control_flow uses jax._src.interpreters.mlir, so a change to jax._src.interpreters.mlir can break jax._src.lax.control_flow, while a change to jax._src.lax.control_flow can't break jax._src.interpreters.mlir.
Position
Below the diagonal: jax._src.lax.control_flow uses a module listed above it, which is the healthy direction.
jax._src.lax.control_flow uses jax._src.interpreters.partial_eval, so a change to jax._src.interpreters.partial_eval can break jax._src.lax.control_flow, while a change to jax._src.lax.control_flow can't break jax._src.interpreters.partial_eval.
Position
Below the diagonal: jax._src.lax.control_flow uses a module listed above it, which is the healthy direction.
jax._src.numpy.hijax uses jax._src.basearray, so a change to jax._src.basearray can break jax._src.numpy.hijax, while a change to jax._src.numpy.hijax can't break jax._src.basearray.
Position
Below the diagonal: jax._src.numpy.hijax uses a module listed above it, which is the healthy direction.
jax._src.numpy.hijax uses jax._src.core, so a change to jax._src.core can break jax._src.numpy.hijax, while a change to jax._src.numpy.hijax can't break jax._src.core.
Position
Below the diagonal: jax._src.numpy.hijax uses a module listed above it, which is the healthy direction.
jax._src.numpy.hijax uses jax._src.hijax, so a change to jax._src.hijax can break jax._src.numpy.hijax, while a change to jax._src.numpy.hijax can't break jax._src.hijax.
Position
Below the diagonal: jax._src.numpy.hijax uses a module listed above it, which is the healthy direction.
jax._src.pallas.einshape uses jax._src.basearray, so a change to jax._src.basearray can break jax._src.pallas.einshape, while a change to jax._src.pallas.einshape can't break jax._src.basearray.
Position
Below the diagonal: jax._src.pallas.einshape uses a module listed above it, which is the healthy direction.
jax._src.pallas.einshape uses jax._src.core, so a change to jax._src.core can break jax._src.pallas.einshape, while a change to jax._src.pallas.einshape can't break jax._src.core.
Position
Below the diagonal: jax._src.pallas.einshape uses a module listed above it, which is the healthy direction.
jax._src.pallas.einshape uses jax._src.hijax, so a change to jax._src.hijax can break jax._src.pallas.einshape, while a change to jax._src.pallas.einshape can't break jax._src.hijax.
Position
Below the diagonal: jax._src.pallas.einshape uses a module listed above it, which is the healthy direction.
jax._src.pallas.fuser uses jax._src.basearray, so a change to jax._src.basearray can break jax._src.pallas.fuser, while a change to jax._src.pallas.fuser can't break jax._src.basearray.
Position
Below the diagonal: jax._src.pallas.fuser uses a module listed above it, which is the healthy direction.
jax._src.pallas.fuser uses jax._src.mesh, so a change to jax._src.mesh can break jax._src.pallas.fuser, while a change to jax._src.pallas.fuser can't break jax._src.mesh.
Position
Below the diagonal: jax._src.pallas.fuser uses a module listed above it, which is the healthy direction.
jax._src.pallas.fuser uses jax._src.sharding, so a change to jax._src.sharding can break jax._src.pallas.fuser, while a change to jax._src.pallas.fuser can't break jax._src.sharding.
Position
Below the diagonal: jax._src.pallas.fuser uses a module listed above it, which is the healthy direction.
jax._src.pallas.fuser uses jax._src.core, so a change to jax._src.core can break jax._src.pallas.fuser, while a change to jax._src.pallas.fuser can't break jax._src.core.
Position
Below the diagonal: jax._src.pallas.fuser uses a module listed above it, which is the healthy direction.
jax._src.pallas.fuser uses jax._src.pallas.fuser.fusible_dtype, so a change to jax._src.pallas.fuser.fusible_dtype can break jax._src.pallas.fuser, while a change to jax._src.pallas.fuser can't break jax._src.pallas.fuser.fusible_dtype.
Position
Below the diagonal: jax._src.pallas.fuser uses a module listed above it, which is the healthy direction.
jax._src.pallas.fuser uses jax._src.hijax, so a change to jax._src.hijax can break jax._src.pallas.fuser, while a change to jax._src.pallas.fuser can't break jax._src.hijax.
Position
Below the diagonal: jax._src.pallas.fuser uses a module listed above it, which is the healthy direction.
jax._src.pallas.fuser uses jax._src.pallas.core, so a change to jax._src.pallas.core can break jax._src.pallas.fuser, while a change to jax._src.pallas.fuser can't break jax._src.pallas.core.
Position
Below the diagonal: jax._src.pallas.fuser uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.core uses jax._src.pretty_printer, so a change to jax._src.pretty_printer can break jax._src.pallas.mosaic.core, while a change to jax._src.pallas.mosaic.core can't break jax._src.pretty_printer.
Position
Below the diagonal: jax._src.pallas.mosaic.core uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.core uses jax._src.state.types, so a change to jax._src.state.types can break jax._src.pallas.mosaic.core, while a change to jax._src.pallas.mosaic.core can't break jax._src.state.types.
Position
Below the diagonal: jax._src.pallas.mosaic.core uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.core uses jax._src.core, so a change to jax._src.core can break jax._src.pallas.mosaic.core, while a change to jax._src.pallas.mosaic.core can't break jax._src.core.
Position
Below the diagonal: jax._src.pallas.mosaic.core uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.core uses jax._src.pallas.core, so a change to jax._src.pallas.core can break jax._src.pallas.mosaic.core, while a change to jax._src.pallas.mosaic.core can't break jax._src.pallas.core.
Position
Below the diagonal: jax._src.pallas.mosaic.core uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.interpret.interpret_pallas_call uses jax._src.pallas.core, so a change to jax._src.pallas.core can break jax._src.pallas.mosaic.interpret.interpret_pallas_call, while a change to jax._src.pallas.mosaic.interpret.interpret_pallas_call can't break jax._src.pallas.core.
Position
Below the diagonal: jax._src.pallas.mosaic.interpret.interpret_pallas_call uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.interpret.interpret_pallas_call uses jax._src.pallas.mosaic.core, so a change to jax._src.pallas.mosaic.core can break jax._src.pallas.mosaic.interpret.interpret_pallas_call, while a change to jax._src.pallas.mosaic.interpret.interpret_pallas_call can't break jax._src.pallas.mosaic.core.
Position
Below the diagonal: jax._src.pallas.mosaic.interpret.interpret_pallas_call uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.lowering uses jax._src.source_info_util, so a change to jax._src.source_info_util can break jax._src.pallas.mosaic.lowering, while a change to jax._src.pallas.mosaic.lowering can't break jax._src.source_info_util.
Position
Below the diagonal: jax._src.pallas.mosaic.lowering uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.lowering uses jax._src.state.types, so a change to jax._src.state.types can break jax._src.pallas.mosaic.lowering, while a change to jax._src.pallas.mosaic.lowering can't break jax._src.state.types.
Position
Below the diagonal: jax._src.pallas.mosaic.lowering uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.lowering uses jax._src.core, so a change to jax._src.core can break jax._src.pallas.mosaic.lowering, while a change to jax._src.pallas.mosaic.lowering can't break jax._src.core.
Position
Below the diagonal: jax._src.pallas.mosaic.lowering uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.lowering uses jax._src.interpreters.mlir, so a change to jax._src.interpreters.mlir can break jax._src.pallas.mosaic.lowering, while a change to jax._src.pallas.mosaic.lowering can't break jax._src.interpreters.mlir.
Position
Below the diagonal: jax._src.pallas.mosaic.lowering uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.lowering uses jax._src.pallas.core, so a change to jax._src.pallas.core can break jax._src.pallas.mosaic.lowering, while a change to jax._src.pallas.mosaic.lowering can't break jax._src.pallas.core.
Position
Below the diagonal: jax._src.pallas.mosaic.lowering uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.lowering uses jax._src.pallas.mosaic.core, so a change to jax._src.pallas.mosaic.core can break jax._src.pallas.mosaic.lowering, while a change to jax._src.pallas.mosaic.lowering can't break jax._src.pallas.mosaic.core.
Position
Below the diagonal: jax._src.pallas.mosaic.lowering uses a module listed above it, which is the healthy direction.
jax._src.pallas uses jax._src.basearray, so a change to jax._src.basearray can break jax._src.pallas, while a change to jax._src.pallas can't break jax._src.basearray.
Position
Below the diagonal: jax._src.pallas uses a module listed above it, which is the healthy direction.
jax._src.pallas uses jax._src.state.types, so a change to jax._src.state.types can break jax._src.pallas, while a change to jax._src.pallas can't break jax._src.state.types.
Position
Below the diagonal: jax._src.pallas uses a module listed above it, which is the healthy direction.
jax._src.pallas uses jax._src.core, so a change to jax._src.core can break jax._src.pallas, while a change to jax._src.pallas can't break jax._src.core.
Position
Below the diagonal: jax._src.pallas uses a module listed above it, which is the healthy direction.
jax._src.pallas uses jax._src.interpreters.mlir, so a change to jax._src.interpreters.mlir can break jax._src.pallas, while a change to jax._src.pallas can't break jax._src.interpreters.mlir.
Position
Below the diagonal: jax._src.pallas uses a module listed above it, which is the healthy direction.
jax._src.pallas uses jax._src.pallas.core, so a change to jax._src.pallas.core can break jax._src.pallas, while a change to jax._src.pallas can't break jax._src.pallas.core.
Position
Below the diagonal: jax._src.pallas uses a module listed above it, which is the healthy direction.
jax._src.pallas uses jax._src.pallas.mosaic.lowering, so a change to jax._src.pallas.mosaic.lowering can break jax._src.pallas, while a change to jax._src.pallas can't break jax._src.pallas.mosaic.lowering.
Position
Below the diagonal: jax._src.pallas uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic uses jax._src.basearray, so a change to jax._src.basearray can break jax._src.pallas.mosaic, while a change to jax._src.pallas.mosaic can't break jax._src.basearray.
Position
Below the diagonal: jax._src.pallas.mosaic uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic uses jax._src.state.types, so a change to jax._src.state.types can break jax._src.pallas.mosaic, while a change to jax._src.pallas.mosaic can't break jax._src.state.types.
Position
Below the diagonal: jax._src.pallas.mosaic uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic uses jax._src.core, so a change to jax._src.core can break jax._src.pallas.mosaic, while a change to jax._src.pallas.mosaic can't break jax._src.core.
Position
Below the diagonal: jax._src.pallas.mosaic uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic uses jax._src.interpreters.mlir, so a change to jax._src.interpreters.mlir can break jax._src.pallas.mosaic, while a change to jax._src.pallas.mosaic can't break jax._src.interpreters.mlir.
Position
Below the diagonal: jax._src.pallas.mosaic uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic uses jax._src.pallas.core, so a change to jax._src.pallas.core can break jax._src.pallas.mosaic, while a change to jax._src.pallas.mosaic can't break jax._src.pallas.core.
Position
Below the diagonal: jax._src.pallas.mosaic uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic uses jax._src.pallas.mosaic.core, so a change to jax._src.pallas.mosaic.core can break jax._src.pallas.mosaic, while a change to jax._src.pallas.mosaic can't break jax._src.pallas.mosaic.core.
Position
Below the diagonal: jax._src.pallas.mosaic uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic uses jax._src.pallas.mosaic.lowering, so a change to jax._src.pallas.mosaic.lowering can break jax._src.pallas.mosaic, while a change to jax._src.pallas.mosaic can't break jax._src.pallas.mosaic.lowering.
Position
Below the diagonal: jax._src.pallas.mosaic uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.interpret uses jax._src.basearray, so a change to jax._src.basearray can break jax._src.pallas.mosaic.interpret, while a change to jax._src.pallas.mosaic.interpret can't break jax._src.basearray.
Position
Below the diagonal: jax._src.pallas.mosaic.interpret uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.interpret uses jax._src.core, so a change to jax._src.core can break jax._src.pallas.mosaic.interpret, while a change to jax._src.pallas.mosaic.interpret can't break jax._src.core.
Position
Below the diagonal: jax._src.pallas.mosaic.interpret uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.interpret uses jax._src.pallas.core, so a change to jax._src.pallas.core can break jax._src.pallas.mosaic.interpret, while a change to jax._src.pallas.mosaic.interpret can't break jax._src.pallas.core.
Position
Below the diagonal: jax._src.pallas.mosaic.interpret uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.interpret uses jax._src.pallas.mosaic.core, so a change to jax._src.pallas.mosaic.core can break jax._src.pallas.mosaic.interpret, while a change to jax._src.pallas.mosaic.interpret can't break jax._src.pallas.mosaic.core.
Position
Below the diagonal: jax._src.pallas.mosaic.interpret uses a module listed above it, which is the healthy direction.
jax._src.pallas.mosaic.interpret uses jax._src.pallas.mosaic.interpret.interpret_pallas_call, so a change to jax._src.pallas.mosaic.interpret.interpret_pallas_call can break jax._src.pallas.mosaic.interpret, while a change to jax._src.pallas.mosaic.interpret can't break jax._src.pallas.mosaic.interpret.interpret_pallas_call.
Position
Below the diagonal: jax._src.pallas.mosaic.interpret uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 71% · Adequate · gated by D2 ·
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
A02:2025 — Security Misconfiguration
50
High / Critical
A05:2025 — Injection
27
High / Critical
A03:2025 — Software Supply Chain Failures
6
Medium
A07:2025 — Authentication Failures
3
High / Critical
Roadmap
Top priorities: 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; Name the access rules — DRF permission classes, django-guardian or django-rules permissions, a casbin or oso policy, or roles and permissions declared once — and consult them where access is checked (permission_classes, @permission_required, Depends), so the rule set is reviewable and testable on its own; Resolve the 15 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2), REDACTED (2).
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
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.
Name the access rules — DRF permission classes, django-guardian or django-rules permissions, a casbin or oso policy, or roles and permissions declared once — and consult them where access is checked (permission_classes, @permission_required, Depends), so the rule set is reviewable and testable on its own.
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 — 48
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 — 3352
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 — 99
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 14
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
This survey 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. All 61 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two 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. 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.
What we checked — 61 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, 3447 of 3499 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 or a scanner, 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.
D4 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. The 358 duplicated block group(s) on this row were found in the languages this pass could tokenize, and they do NOT cover all of this repository's production source: .cc (49,723 lines, 13% of production source), .c (11,063 lines, 3% of production source) went unread, because no language model this pass could load exposed a clone-unit token stream for those file kinds. Duplication in that source is UNMEASURED — its absence from the count above is a gap in this analyzer's language coverage, not a finding that the code is free of duplication.
D8 Code Coverage — not measured this run — We 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 (.py) 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.
D11 Test Reliability — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. 2 of 3 Python distribution(s) were not re-run: its dependency install failed (pip exit 1: Failed building wheel for jax_ffi_example), so its suite was not run against dependencies it does not declare. The 1 that were re-run are measured above and their result stands; nothing here is a statement about the suite of the ones not re-run.
D12 Dependency Hygiene — 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. This repository's 3 shipped Python distribution(s) across 8 manifest(s) WERE read; what went unanswered is the currency half, because it grades an EXACT pin against the newest release and every declaration here is a floor or a range — which installs the newest release it admits and so cannot be behind one. So pypi.org was never asked. This is a true statement about the repository, and the healthy one, NOT a gap on our side: no reader we could write would find a currency question here.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we 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.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — not measured this run — We 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We 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 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (pyproject.toml), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
D24 Comment Value — not measured this run — We 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. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D26 Project Cohesion — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. Project size and spread are measured over build units whose source a code model reads. This repository's .cc, .c source is a material share of its production lines and was read by none, so the score is a verdict about the units that were read. Not a finding that the unread source is cohesive — it is unmeasured.
D27 Navigability — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. Tracing effort is measured over resolved call sites, and all 957 sampled here came from .py files. This repository's .cc, .c source is a material share of its production lines and contributed none, so the score above is a verdict about the part that was read. Not a finding that the unread half navigates well — it is unmeasured.
D32 Data Compliance (PII/GDPR) — not measured this run — We 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. `jax/_src/ad_util.py`, `jax/_src/api.py`, `jax/_src/checkify.py`, `jax/_src/config.py`, `jax/_src/core.py`, … (+44 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D41 Kernel & Syscall Confinement — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. Ci/k8s/jobset.yaml:2 did not read as a pod spec (a templated manifest such as Helm's that is not YAML until rendered, or a workload whose pod spec this check does not locate), so the seccomp/AppArmor profile in force there was not judged and no row about them can appear on this card.
AX1 Captive dependencies — not measured this run — We 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 Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in jax/_src/core.py, whose lifetimes are not modelled 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.
AX6 Interface segregation — not measured this run — We 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.
AXR1 Runtime accessibility — not measured this run — We 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. Render strategy: boot via Dockerfile (REDACTED). docker build failed (exit 1) — 95 | >>> ls -lah /wheelhouse && \ 96 | >>> pip3 install wheelhouse/*none*.whl wheelhouse/*jaxlib*.whl && \ 97 | >>> pip3 install wheelhouse/*rocm60*.whl 98 | -------------------- ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref c1dd22cf-f24f-4e51-950b-89346cd18b87::b1vnjw9ue79nc2d4l5xppcdb4: "/wheelhouse": not found; runtime evidence skipped.
C1 Data Protection — not measured this run — We 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. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
GD1 Unfinished & placeholder code — not measured this run — We 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 this repository's Python, c, cpp is most of its product and 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 — We 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 this repository's Python, c, cpp is most of its product and 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 — We measured this, but not all of it. What we 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), and artefact counts an order of magnitude off. 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.
S1 Web-Security Posture — not measured this run — We 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. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X10 Duplicated predicate — not measured this run — We 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. 14 further occurrence(s) are not listed individually; the score already reflects all 54.
X16 Unfloored truncation loop — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X29 Per-element action decided by a fixed element — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X5 Nullable reference types — not measured this run — We 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 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
We assess the repository exactly as committed, and only the repository. By design we do 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.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
D13 REDACTED Scanning: REDACTED 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").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
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 checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
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.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
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").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
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.
D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
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.
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.
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.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
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.
218 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was tcgen05.mma at 128. A further 4 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 JaxprInterpreter.interpret at 39 — they are counted neither in the figure above nor in this dimension's score. 2 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: jax/_src/pallas/mosaic_gpu/interpret/jaxpr_interpret.py (JaxprInterpreter.interpret at 39), jax/_src/pallas/mosaic_gpu/core.py (Layout.to_mgpu at 23). 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.
+ 213 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 6 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with tcgen05.mma (cyclomatic 128), LaunchContext.async_copy (cyclomatic 110), FragmentedArray.astype (cyclomatic 106). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 6 together lifts Cyclomatic Complexity from 5.8 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
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.
+ 424 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 5 bodies over 120 down to 120 or less in Cognitive Complexity — start with LaunchContext.async_copy (cognitive 225), tcgen05.mma (cognitive 194), mlir.lower_jaxpr_to_fun (cognitive 184). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 5 together lifts Cognitive Complexity from 3.9 to about 4.9/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.3 / 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.
Resolve the 106 FileTooLong finding(s) in God Classes — start with core.py (5), primitives.py (4), lowering.py (3). — One of this dimension's main actionable groups (106 warning-level).
Resolve the 4 TooManyMethods finding(s) in God Classes — start with shape_poly.py, core.py, shared_memory.py. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
358 duplicated block group(s) detected. 6.2 % of the production lines (19,188 of 310,566) are in a reported copy. A further 358 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 18 of the 716 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. Measured on part of this repository only: .cc, .c (16% of production source) was not exposed to the token comparison, so duplication there is unmeasured and is not in this count.
Edited copy of a member (8 corresponding lines) · ×26jax/_src/lax/lax.py:5218
Edited copy of a member (11 corresponding lines) · ×25docs/autodidax.py:2001
+ 204 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 34 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with core.py (6), compute_on.py (3), linalg.py (3). — One of this dimension's main actionable groups (34 warning-level).
Resolve the 32 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with custom_derivatives.py (2), ad.py (2), lowering.py (2). — One of this dimension's main actionable groups (32 warning-level).
Resolve the 31 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with ad_checkpoint.py (2), partial_eval.py (2), special.py (2). — One of this dimension's main actionable groups (31 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.7 / 10Strong✓ 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.
268 production modules (Python+CMake+Bazel), 0 dependency cycle(s), 36 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence, with abstractness counted on 3 of the 268 (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).
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 12 Unstable project //jax/_src finding(s) in Coupling. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 5 Unstable project //jax/_src/pallas/mosaic finding(s) in Coupling. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 4 Unstable project //jax/_src/pallas/mosaic_gpu finding(s) in Coupling. — One of this dimension's main actionable groups (4 warning-level).
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 3 Low cohesion finding(s) in Cohesion (LCOM4) — start with core.py, shape_poly.py, mesh.py. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
Detailed fixes: d7_recommendation.md.
Do you agree with this assessment?
D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests pass reliably, with no flakiness.
Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.
0 flaky across 1 measured tier(s). Python (3 distributions): measured (0 flaky). 2 of 3 Python distribution(s) were not re-run: its dependency install failed (pip exit 1: Failed building wheel for jax_ffi_example), so its suite was not run against dependencies it does not declare. The 1 that were re-run are measured above and their result stands; nothing here is a statement about the suite of the ones not re-run.
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: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 3 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 3 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (0 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 1 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged.
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 43 Hotspot finding(s) in Churn × Complexity Hotspots — start with lowering.py (2), primitives.py (2), core.py (2). — One of this dimension's main actionable groups (43 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.6 / 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.
19 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is jax/_src/lax/erf.py. Counted over 458 of the 682 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 · ×3
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.
Do you agree with this assessment?
D17 · Explicit Debt8.9 / 10Strong✓ Tool-verified
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.
1699 deducted task-comment markers across 310566 LoC (0.5/KLoC) → score 8.9. 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 1695 TodoComment finding(s) in Explicit Debt — start with core.py (129), lowering.py (61), interpret_pallas_call.py (46). — One of this dimension's main actionable groups (1695 warning-level).
Resolve the 2 HackComment finding(s) in Explicit Debt — start with indexing_test.py, core.py. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 XxxComment finding(s) in Explicit Debt — start with fragmented_array.py, partial_eval.py. — One of this dimension's main actionable groups (2 warning-level).
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.
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
0 of 6 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.
1 of 7 build units (Python) flagged as possibly oversized/incoherent. This repository's .cc, .c source was read by no build unit, so this covers part of the tree, not all of it.
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.
Do you agree with this assessment?
D27 · Navigability8.9 / 10Strong✓ Tool-verified
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
99 % of calls cross a namespace and 0 % go through an interface, but 79 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated. Measured over the .py source only — this repository's .cc, .c was not sampled for call sites, so this score covers part of the tree, not all of it.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED 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.
4 finding(s): 0 critical, 4 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
27 finding(s): 0 critical, 18 high, 6 medium, 3 low. semgrep hit a parse error in 61 file(s) — `docs/_templates/layout.html` (lines 1–5, lines 11–12), `docs/notebooks/Common_Gotchas_in_JAX.ipynb`, `jax/_src/ad_util.py` (line 112, lines 116–118), `jax/_src/api.py`, `jax/_src/checkify.py` (lines 14–1498), … (+56 more) — 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. Separately, one or more rules could not re-parse an embedded snippet in 7 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 15 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (15 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — 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).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 34 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (21), REDACTED (4), REDACTED (4). — One of this dimension's main actionable groups (34 warning-level).
Resolve the 11 High IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED (3), REDACTED (3). — One of this dimension's main actionable groups (11 issue-level).
Resolve the 5 Low IaC finding(s) in IaC & Container Security — start with REDACTED (5). — One of this dimension's main actionable groups (5 recommendation-level).
Detailed fixes: d31_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.
33 of 458 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is jax/_src/internal_test_util/export_back_compat_test_data/rocm_eigh_hipsolver_syev.py. Counted over 458 of the 682 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 17 Orphaned knowledge finding(s) in Knowledge Freshness — start with rocm_eigh_hipsolver_syev.py, cpu_lu_lapack_getrf.py, cuda_svd_cusolver_gesvd.py. — One of this dimension's main actionable groups (17 issue-level).
Resolve the 16 Orphaned file finding(s) in Knowledge Freshness — start with tpu_Sharding.py, gumbel_r.py, gumbel_l.py. — One of this dimension's main actionable groups (16 recommendation-level).
Resolve the 1 Further orphaned files (smaller) 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 5 Change coupling finding(s) in Change Coupling — start with sc_core.py, jet.py, conditionals.py. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 1 Change coupling clique finding(s) in Change Coupling — start with serialization.py. — One of this dimension's main actionable groups (1 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 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-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.
What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.
What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.
0/1 workload(s) run every container under a seccomp profile; 0/1 declare an AppArmor/SELinux profile.
No seccomp profileREDACTED:12
What to do
Resolve the 1 No seccomp profile finding(s) in Kernel & Syscall Confinement — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d41_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 3 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC2 · Forms & labels10.0 / 10Exemplary○ Nothing flagged
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.
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.
`.p0_to_pserver` moves (`animation-name: p0_to_pserver_keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/_static/fault_tolerance/fault_tolerance.css:107
`.p1_to_pserver` moves (`animation-name: p1_to_pserver_keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/_static/fault_tolerance/fault_tolerance.css:112
`.p2_to_pserver` moves (`animation-name: p2_to_pserver_keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/_static/fault_tolerance/fault_tolerance.css:117
`.pserver_to_p0` moves (`animation-name: pserver_to_p0_keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/_static/fault_tolerance/fault_tolerance.css:122
`.pserver_to_p1` moves (`animation-name: pserver_to_p1_keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/_static/fault_tolerance/fault_tolerance.css:127
`.pserver_to_p2` moves (`animation-name: pserver_to_p2_keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/_static/fault_tolerance/fault_tolerance.css:132
`.p0_to_pserver_tall` moves (`animation-name: p0_to_pserver_keyframes_tall`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/_static/fault_tolerance/fault_tolerance.css:167
`.p1_to_pserver_tall` moves (`animation-name: p1_to_pserver_keyframes_tall`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/_static/fault_tolerance/fault_tolerance.css:172
`.p2_to_pserver_tall` moves (`animation-name: p2_to_pserver_keyframes_tall`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/_static/fault_tolerance/fault_tolerance.css:177
`.pserver_to_p0_tall` moves (`animation-name: pserver_to_p0_keyframes_tall`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/_static/fault_tolerance/fault_tolerance.css:182
`.pserver_to_p1_tall` moves (`animation-name: pserver_to_p1_keyframes_tall`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/_static/fault_tolerance/fault_tolerance.css:187
`.pserver_to_p2_tall` moves (`animation-name: pserver_to_p2_keyframes_tall`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/_static/fault_tolerance/fault_tolerance.css:192
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.
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.
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.
Do you agree with this assessment?
C2 · Access Controls7.0 / 10Strong✓ Tool-verified
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
What to do
Name the access rules — DRF permission classes, django-guardian or django-rules permissions, a casbin or oso policy, or roles and permissions declared once — and consult them where access is checked (permission_classes, @permission_required, Depends), so the rule set is reviewable and testable on its own.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
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
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Most of the production code is in directories of its own, but 1 application file(s) sit at the repository root beside the build and tooling files (`build_wheel.py`).
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
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's code 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 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
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.
No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 35 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — .github/workflows/asan.yaml:24
What to do
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Deployment automation exists but no readiness/liveness probes, rolling-update strategy, lifecycle hooks or migration job were evidenced — a bad release is harder to detect and reverse.
What to do
Add readiness/liveness probes and a rolling-update (or blue/green) strategy so a bad release is caught and rolled back automatically.
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 each language's code 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.
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.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document2.7 / 10Weak✓ Tool-verified
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.
`apply_transform` is public and takes `ref_or_view: Any` from its caller, and it calls itself at line 316 (`apply_transform`) with a piece of `ref_or_view` — and nowhere in `apply_transform` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `apply_transform` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — jax/_src/state/types.py:316
`array` is public and takes `object: Any` from its caller, and it calls itself at line 307 (`array`) with a piece of `object` — and nowhere in `array` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `array` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — jax/_src/numpy/array_constructors.py:307
`dot_general` is public, takes a document from its caller (line 42) and hands it to `_eval_dot`, which calls itself at line 133 (`_eval_dot`) with a piece of `out_s` — and nowhere in `_eval_dot` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_eval_dot` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — jax/_src/lax/_reduction_order.py:133
`ragged_dot_general` is public, takes a document from its caller (line 375) and hands it to `_eval_ragged_dot`, which calls itself at line 424 (`_eval_ragged_dot`) with a piece of `out_s` — and nowhere in `_eval_ragged_dot` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_eval_ragged_dot` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — jax/_src/lax/_reduction_order.py:424
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
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 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.
`debug` at line 89 is called with an argument built by `"…".join(e.__name__ for e in cls._cluster_types)` (line 90), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — jax/_src/clusters/cluster.py:89
What to do
In Python, put the construction behind the logger's own check (`if logger.isEnabledFor(logging.DEBUG):`), or pass the collection itself with a `%s` placeholder (`logger.debug("Items %s", items)`) so the logging module renders it only when the record is emitted. The placeholder alone is not the fix when the argument is still built first: it defers the formatting, not a `json.dumps`, a `join` or a comprehension in the argument, and an f-string defers nothing at all.
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.
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 `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.
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.
`except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×16) — jax/version.py:63, jax/experimental/sparse/_base.py:63, jax/experimental/sparse/bcoo.py:2539, …
`except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×5) — jax/tools/evaluate_sampler_bias.py:251, jax/tools/evaluate_sampler_bias.py:272, jax/experimental/sparse/bcsr.py:892, …
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×11) — jax/experimental/mosaic/gpu/layout_inference.py:2637, jax/_src/api.py:2920, jax/_src/core.py:3673, …
What to do
Swallowed exception (caught, then discarded)
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 284 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. — jax_plugins/cuda/__init__.py:284
`debug` at line 359 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.debug("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.debug("order moved", order_id=order_id, status=status)` with structlog. — jax_plugins/cuda/__init__.py:359
`info` at line 593 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.info("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.info("order moved", order_id=order_id, status=status)` with structlog. — jax/_src/compiler.py:593
`debug` at line 105 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.debug("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.debug("order moved", order_id=order_id, status=status)` with structlog. — jax/_src/lru_cache.py:105
`debug` at line 108 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.debug("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.debug("order moved", order_id=order_id, status=status)` with structlog. — jax/_src/lru_cache.py:108
`warning` at line 788 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. — jax/_src/tpu_custom_call.py:788
`warning` at line 903 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. — jax/_src/xla_bridge.py:903
`warning` at line 907 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. — jax/_src/xla_bridge.py:907
`warning` at line 932 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. — jax/_src/xla_bridge.py:932
`error` at line 59 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog. — jax/_src/clusters/cluster.py:59
`error` at line 62 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog. — jax/_src/clusters/cluster.py:62
`debug` at line 43 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.debug("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.debug("order moved", order_id=order_id, status=status)` with structlog. — jax/_src/clusters/k8s_cluster.py:43
`debug` at line 53 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.debug("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.debug("order moved", order_id=order_id, status=status)` with structlog. — jax/_src/clusters/k8s_cluster.py:53
`debug` at line 272 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.debug("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.debug("order moved", order_id=order_id, status=status)` with structlog. — build/tools/utils.py:272
`error` at line 241 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog. — build/rocm/tools/build_wheels.py:241
`error` at line 244 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog. — build/rocm/tools/build_wheels.py:244
Statically assessed 5 of 55 WCAG 2.2 Level A/AA success criteria (9%; ≈10% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 50 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 — 40 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 — 1 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.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 53 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.
AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
AC3 Page structure — No structural check found in the parsed markup — AC3 not applicable here.
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 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
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. 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
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — docker build failed (exit 1) — 95 | >>> ls -lah /wheelhouse && \ 96 | >>> pip3 install wheelhouse/*none*.whl wheelhouse/*jaxlib*.whl && \ 97 | >>> pip3 install wheelhouse/*rocm60*.whl 98 | -------------------- ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref c1dd22cf-f24f-4e51-950b-89346cd18b87::b1vnjw9ue79nc2d4l5xppcdb4: "/wheelhouse": not found; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
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 Django, SQLAlchemy, SQLModel, Peewee, Tortoise or MongoEngine model, a migration or a SQL schema — and no database or data-store client (Django ORM, SQLAlchemy, psycopg, PyMongo, …) 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 on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported 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 on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D10 Test Quality — ~266523 lines of test source are present (.py) 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.
D12 Dependency Hygiene — Dependency currency not established — no declaration carries an exact pin to grade
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 — D21 withholds its case and prefix conventions rows: 7 candidate(s) found and not reported.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
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+ sibling projects each declaring an entity of their own or taking another project's integration events. 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#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .py source were not judged.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D32 Data Compliance (PII/GDPR) — 49 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
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.
D42 Runtime Threat Enforcement — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
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 (382 value object(s))
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
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 JavaScript/TypeScript, Python 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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — X16 reached only 0% of this repository's production lines — python (310,566 lines), cpp (49,723 lines), c (12,059 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — no C# was loaded; this repository's Python was 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
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.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — X29 reached only 0% of this repository's production lines — python (310,566 lines), cpp (49,723 lines), c (12,059 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/rocm_eigh_hipsolver_syev.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/cpu_lu_lapack_getrf.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/cuda_svd_cusolver_gesvd.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/cpu_tridiagonal_lapack_sytrd_hetrd.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/cpu_eigh_lapack_syev.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/cpu_cholesky_lapack_potrf.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/cpu_svd_lapack_gesdd.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/cuda_eigh_cusolver_syev.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/cuda_tridiagonal_cusolver_sytrd.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/cpu_hessenberg_lapack_gehrd.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/cpu_eig_lapack_geev.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/cpu_tridiagonal_solve_lapack_gtsv.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/cuda_qr_cusolver_geqrf.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/cuda_lu_cusolver_getrf.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/cpu_qr_lapack_geqrf.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/_src/internal_test_util/export_back_compat_test_data/cpu_schur_lapack_gees.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge jax/example_libraries/optimizers.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
TodoComment setup.py:136— # TODO(gulsumgudukbay): add a rocm8 extra once those wheels ship. — 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 tests/ann_test.py:61— # TODO(b/258315194) Investigate probability property when input is around — 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 tests/api_test.py:1006— # TODO(frostig): remove `wrap` once we always enable_custom_prng — 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 tests/api_test.py:1155— # TODO(zhangqiaorjc): Test pruning constants after DCE pass prunes primitive — 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 tests/api_test.py:1346— # TODO(b/261771737): add support for uncompiled cost analysis in C API. — 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 tests/api_test.py:3415— # TODO(phawkins): merge these tests with the `xla_computation` tests. — 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 tests/api_test.py:4068— # TODO(dougalm): rethink what this should do under stackless — 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 tests/api_test.py:4166— # TODO(jakevdp): re-enable this if possible. — 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 tests/api_test.py:4426— # TODO(mattjj): full test msg below fails (harmlessly) on CI, investigate — 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 tests/api_test.py:5864— # TODO(dougalm): figure out with Matt what to do with this feature — 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 tests/api_test.py:6166— # TODO(mattjj,phawkins): we broke this on purpose, as it probably isn't — 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 tests/api_test.py:6180— # TODO(mattjj,dougalm): this test was flakey on CI; figure out how to enable? — 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 tests/api_test.py:6239— # TODO(mattjj,dougalm): re-enable if we set auto_dce=True by default — 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 tests/api_test.py:10281— # TODO(mattjj): Raise an error message. — 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 tests/api_test.py:10495— # TODO(dougalm): shoud be able to get this down to 2 or 3 — 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 tests/api_test.py:10505— # TODO(dougalm): improve this — 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 tests/api_test.py:10516— # TODO(dougalm): improve this — 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 tests/api_test.py:10527— # TODO(dougalm): improve this — 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 tests/array_api_test.py:338— # TODO(micky774): Remove when jnp.clip deprecation is completed — 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 tests/array_extensibility_test.py:241— # TODO(jakevdp): commented APIs are ones which do not yet 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 tests/array_interoperability_test.py:63— # TODO(b/470156950): Remove this once a proper fix is in place — 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 jax/experimental/jax2tf/tests/jax2tf_test.py:41— # TODO(b/470156950): Remove this once a proper fix is in place — 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 jax/experimental/jax2tf/tests/sharding_test.py:50— # TODO(b/470156950): Remove this once a proper fix is in place — 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 jax/experimental/jax2tf/tests/multiprocess/jax2tf_multiprocess_test.py:30— # TODO(b/470156950): Remove this once a proper fix is in place — 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 tests/array_interoperability_test.py:213— # TODO(parkers): Remove after setting 'stream' properly below. — 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.
FileTooLong: lax/lax.py jax/_src/lax/lax.py— FileTooLong — 7611 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 7111 over it, 15.22× 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: mosaic/lowering.py jax/_src/pallas/mosaic/lowering.py— FileTooLong — 4939 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4439 over it, 9.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: numpy/lax_numpy.py jax/_src/numpy/lax_numpy.py— FileTooLong — 4431 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3931 over it, 8.86× 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: mosaic_gpu/primitives.py jax/_src/pallas/mosaic_gpu/primitives.py— FileTooLong — 4198 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3698 over it, 8.40× 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: mosaic_gpu/lowering.py jax/_src/pallas/mosaic_gpu/lowering.py— FileTooLong — 3630 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3130 over it, 7.26× 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: gpu/fragmented_array.py jax/experimental/mosaic/gpu/fragmented_array.py— FileTooLong — 3495 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2995 over it, 6.99× 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/core.py jax/_src/core.py— FileTooLong — 3047 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2547 over it, 6.09× 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: interpreters/mlir.py jax/_src/interpreters/mlir.py— FileTooLong — 2659 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2159 over it, 5.32× 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/pjit.py jax/_src/pjit.py— FileTooLong — 2569 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2069 over it, 5.14× 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: lax/slicing.py jax/_src/lax/slicing.py— FileTooLong — 2407 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1907 over it, 4.81× 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: triton/lowering.py jax/_src/pallas/triton/lowering.py— FileTooLong — 2407 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1907 over it, 4.81× 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: control_flow/loops.py jax/_src/lax/control_flow/loops.py— FileTooLong — 2309 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1809 over it, 4.62× 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: lax/parallel.py jax/_src/lax/parallel.py— FileTooLong — 2309 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1809 over it, 4.62× 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: gpu/dialect_lowering.py jax/experimental/mosaic/gpu/dialect_lowering.py— FileTooLong — 2256 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1756 over it, 4.51× 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: mosaic/pipeline.py jax/_src/pallas/mosaic/pipeline.py— FileTooLong — 2159 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1659 over it, 4.32× 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: lax/linalg.py jax/_src/lax/linalg.py— FileTooLong — 2156 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1656 over it, 4.31× 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: gpu/layout_inference.py jax/experimental/mosaic/gpu/layout_inference.py— FileTooLong — 2123 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1623 over it, 4.25× 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: splash_attention/splash_attention_kernel.py jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py— FileTooLong — 2060 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1560 over it, 4.12× 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: interpreters/partial_eval.py jax/_src/interpreters/partial_eval.py— FileTooLong — 2001 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1501 over it, 4.00× 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/shard_map.py jax/_src/shard_map.py— FileTooLong — 1970 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1470 over it, 3.94× 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: random/core.py jax/_src/random/core.py— FileTooLong — 1925 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1425 over it, 3.85× 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: gpu/utils.py jax/experimental/mosaic/gpu/utils.py— FileTooLong — 1880 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1380 over it, 3.76× 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: interpret/interpret_pallas_call.py jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py— FileTooLong — 1829 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1329 over it, 3.66× 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: numpy/ufuncs.py jax/_src/numpy/ufuncs.py— FileTooLong — 1819 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1319 over it, 3.64× 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/config.py jax/_src/config.py— FileTooLong — 1783 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1283 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.
Hotspot: jax/_src/interpreters/mlir.py jax/_src/interpreters/mlir.py:1779— jax/_src/interpreters/mlir.py changed 47 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 103 in mlir.lower_jaxpr_to_fun at line 1779. 2 of those changes were fix/bug commits, and the other 45 changed it for other reasons — this file is under both repair and feature pressure. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/interpreters/mlir.py`: 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.
Hotspot: jax/_src/lax/lax.py jax/_src/lax/lax.py:7166— jax/_src/lax/lax.py changed 137 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in lax._dot_general_layout_rule at line 7166. 19 of those changes were fix/bug commits, and the other 118 changed it for other reasons — this file is under both repair and feature pressure. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/lax/lax.py`: 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.
Hotspot: jax/experimental/mosaic/gpu/tcgen05.py jax/experimental/mosaic/gpu/tcgen05.py:216— jax/experimental/mosaic/gpu/tcgen05.py changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 128 in tcgen05.mma at line 216. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/experimental/mosaic/gpu/tcgen05.py`: 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.
Hotspot: jax/_src/pallas/mosaic/lowering.py jax/_src/pallas/mosaic/lowering.py:1104— jax/_src/pallas/mosaic/lowering.py changed 71 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in lowering.lower_jaxpr_into_pipelined_module at line 1104. 3 of those changes were fix/bug commits, and the other 68 changed it for other reasons — this file is under both repair and feature pressure. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/pallas/mosaic/lowering.py`: 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.
Hotspot: jax/experimental/mosaic/gpu/launch_context.py jax/experimental/mosaic/gpu/launch_context.py:1473— jax/experimental/mosaic/gpu/launch_context.py changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 110 in LaunchContext.async_copy at line 1473. 1 of those changes was a fix/bug commit, and the other 22 changed it for other reasons — this file is under both repair and feature pressure. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/experimental/mosaic/gpu/launch_context.py`: 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.
Hotspot: jax/experimental/mosaic/gpu/fragmented_array.py jax/experimental/mosaic/gpu/fragmented_array.py:2507— jax/experimental/mosaic/gpu/fragmented_array.py changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 106 in FragmentedArray.astype at line 2507. 3 of those changes were fix/bug commits, and the other 19 changed it for other reasons — this file is under both repair and feature pressure. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/experimental/mosaic/gpu/fragmented_array.py`: 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.
Hotspot: jax/_src/pallas/mosaic_gpu/primitives.py jax/_src/pallas/mosaic_gpu/primitives.py:975— jax/_src/pallas/mosaic_gpu/primitives.py changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in primitives._copy_gmem_to_smem_lowering at line 975. 3 of those changes were fix/bug commits, and the other 38 changed it for other reasons — this file is under both repair and feature pressure. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/pallas/mosaic_gpu/primitives.py`: 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.
Hotspot: jax/experimental/mosaic/gpu/utils.py jax/experimental/mosaic/gpu/utils.py:1086— jax/experimental/mosaic/gpu/utils.py changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in utils.parse_indices at line 1086. 3 of those changes were fix/bug commits, and the other 34 changed it for other reasons — this file is under both repair and feature pressure. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/experimental/mosaic/gpu/utils.py`: 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.
Hotspot: jax/_src/pallas/mosaic_gpu/lowering.py jax/_src/pallas/mosaic_gpu/lowering.py:2004— jax/_src/pallas/mosaic_gpu/lowering.py changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in lowering._swap_lowering_rule at line 2004. 2 of those changes were fix/bug commits, and the other 37 changed it for other reasons — this file is under both repair and feature pressure. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/pallas/mosaic_gpu/lowering.py`: 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.
Hotspot: jax/experimental/mosaic/gpu/core.py jax/experimental/mosaic/gpu/core.py:751— jax/experimental/mosaic/gpu/core.py changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in core._launch at line 751. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/experimental/mosaic/gpu/core.py`: 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.
Hotspot: jax/_src/tpu_custom_call.py jax/_src/tpu_custom_call.py:251— jax/_src/tpu_custom_call.py changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in CustomCallBackendConfig.to_json at line 251. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/tpu_custom_call.py`: 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.
Hotspot: jax/_src/pallas/mosaic/pipeline.py jax/_src/pallas/mosaic/pipeline.py:648— jax/_src/pallas/mosaic/pipeline.py changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in BufferedRef.create at line 648. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/pallas/mosaic/pipeline.py`: 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.
Hotspot: jax/_src/numpy/reductions.py jax/_src/numpy/reductions.py:2720— jax/_src/numpy/reductions.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in reductions._quantile at line 2720. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/numpy/reductions.py`: 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.
Hotspot: jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1349— jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in interpret_pallas_call._interpret_jaxpr at line 1349. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py`: 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.
Hotspot: jax/_src/lax/control_flow/loops.py jax/_src/lax/control_flow/loops.py:1677— jax/_src/lax/control_flow/loops.py changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in loops.while_loop at line 1677. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/lax/control_flow/loops.py`: 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.
Hotspot: jax/_src/random/core.py jax/_src/random/core.py:1544— jax/_src/random/core.py changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in core._multivariate_normal at line 1544. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/random/core.py`: 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.
Hotspot: jax/_src/shard_map.py jax/_src/shard_map.py:371— jax/_src/shard_map.py changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in shard_map._shmap_checks at line 371. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/shard_map.py`: 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.
Hotspot: jax/_src/pallas/mosaic/sc_lowering.py jax/_src/pallas/mosaic/sc_lowering.py:258— jax/_src/pallas/mosaic/sc_lowering.py changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in sc_lowering._store_lowering_rule at line 258. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/pallas/mosaic/sc_lowering.py`: 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.
Hotspot: jax/_src/lax/slicing.py jax/_src/lax/slicing.py:2590— jax/_src/lax/slicing.py changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in slicing._gather_collective_rule at line 2590. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/lax/slicing.py`: 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.
Hotspot: jax/_src/export/_export.py jax/_src/export/_export.py:698— jax/_src/export/_export.py changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in _export._export_lowered at line 698. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/export/_export.py`: 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.
Hotspot: jax/_src/custom_derivatives.py jax/_src/custom_derivatives.py:806— jax/_src/custom_derivatives.py changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in custom_vjp.__call__ at line 806. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/custom_derivatives.py`: 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.
Hotspot: jax/_src/lax/control_flow/conditionals.py jax/_src/lax/control_flow/conditionals.py:195— jax/_src/lax/control_flow/conditionals.py changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in conditionals.cond at line 195. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/lax/control_flow/conditionals.py`: 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.
Hotspot: jax/_src/pallas/mpmd.py jax/_src/pallas/mpmd.py:91— jax/_src/pallas/mpmd.py changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in mpmd._mpmd_map_abstract_eval at line 91. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/pallas/mpmd.py`: 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.
Hotspot: jax/_src/pallas/mosaic/primitives.py jax/_src/pallas/mosaic/primitives.py:508— jax/_src/pallas/mosaic/primitives.py changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in primitives.dma_start_discharge_rule at line 508. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/pallas/mosaic/primitives.py`: 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.
Hotspot: jax/_src/numpy/indexing.py jax/_src/numpy/indexing.py:1405— jax/_src/numpy/indexing.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in indexing._index_to_gather at line 1405. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 16:26:16 -08:00' --until='2026-11-13 16:26:16 -08:00' --full-history --no-merges -- jax/_src/numpy/indexing.py`: 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.
Duplicated block (7 lines × 2) docs/autodidax.py:2003— docs/autodidax.py:2003-2009 | docs/autodidax.py:2523-2529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `docs/autodidax.py:2522` calls `split_half` and `docs/autodidax.py:2002` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) jax/_src/compute_on.py:135— jax/_src/compute_on.py:135-141 | jax/_src/xla_metadata.py:336-342 — 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 (7 lines × 2) jax/_src/compute_on.py:309— jax/_src/compute_on.py:309-315 | jax/_src/pjit.py:1856-1862 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/compute_on.py:309` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (7 lines × 2) jax/_src/compute_on.py:424— jax/_src/compute_on.py:424-430 | jax/_src/xla_metadata.py:530-536 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (7 lines × 2) jax/_src/core.py:202— jax/_src/core.py:202-208 | jax/_src/core.py:255-261 — both copies are in the same file, so extract the block into 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) jax/_src/interpreters/partial_eval.py:1876— jax/_src/interpreters/partial_eval.py:1876-1882 | jax/_src/interpreters/partial_eval.py:1920-1926 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/interpreters/partial_eval.py:1876` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) jax/_src/lax/convolution.py:684— jax/_src/lax/convolution.py:684-690 | jax/_src/lax/convolution.py:710-717 — both copies are in the same file, so extract the block into 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) jax/_src/lax/double_word.py:391— jax/_src/lax/double_word.py:391-397 | jax/_src/lax/double_word.py:399-406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/lax/double_word.py:391` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) jax/_src/lax/linalg.py:1482— jax/_src/lax/linalg.py:1482-1488 | jax/_src/lax/linalg.py:1614-1620 — both copies are in the same file, so extract the block into 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) jax/_src/lax/linalg.py:2175— jax/_src/lax/linalg.py:2175-2181 | jax/_src/lax/linalg.py:2215-2221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) jax/_src/lax/slicing.py:3759— jax/_src/lax/slicing.py:3759-3765 | jax/_src/lax/slicing.py:3878-3884 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/lax/slicing.py:3759` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) jax/_src/pallas/fuser/jaxpr_fusion.py:397— jax/_src/pallas/fuser/jaxpr_fusion.py:397-403 | jax/_src/pallas/fuser/jaxpr_fusion.py:407-413 — both copies are in the same file, so extract the block into 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) jax/_src/pallas/hlo_interpreter.py:113— jax/_src/pallas/hlo_interpreter.py:113-119 | jax/_src/pallas/mosaic/interpret/utils.py:492-498 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (7 lines × 2) jax/_src/pallas/mosaic/interpret/shared_memory.py:613— jax/_src/pallas/mosaic/interpret/shared_memory.py:613-619 | jax/_src/pallas/mosaic/interpret/shared_memory.py:771-777 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic/interpret/shared_memory.py:613` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) jax/_src/pallas/mosaic/sc_lowering.py:231— jax/_src/pallas/mosaic/sc_lowering.py:231-237 | jax/_src/pallas/mosaic/sc_lowering.py:376-383 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic/sc_lowering.py:376` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) jax/_src/pallas/mosaic_gpu/core.py:1720— jax/_src/pallas/mosaic_gpu/core.py:1720-1726 | jax/_src/pallas/mosaic_gpu/core.py:1745-1751 — both copies are in the same file, so extract the block into 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) jax/_src/pallas/mosaic_gpu/primitives.py:5338— jax/_src/pallas/mosaic_gpu/primitives.py:5338-5345 | jax/_src/pallas/triton/primitives.py:336-342 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic_gpu/primitives.py:5338` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) jax/_src/pmap.py:823— jax/_src/pmap.py:823-829 | jax/_src/pmap.py:908-914 — both copies are in the same file, so extract the block into 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) jax/_src/random/core.py:741— jax/_src/random/core.py:741-747 | jax/_src/random/core.py:1718-1724 — both copies are in the same file, so extract the block into 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) jax/_src/random/core.py:2467— jax/_src/random/core.py:2467-2473 | jax/_src/random/core.py:2980-2986 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) jax/_src/scipy/bessel.py:853— jax/_src/scipy/bessel.py:853-859 | jax/_src/scipy/bessel.py:1839-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 (7 lines × 2) jax/_src/scipy/sparse/linalg.py:568— jax/_src/scipy/sparse/linalg.py:568-574 | jax/_src/scipy/sparse/linalg.py:618-624 — both copies are in the same file, so extract the block into 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) jax/experimental/mosaic/gpu/utils.py:1772— jax/experimental/mosaic/gpu/utils.py:1772-1778 | jax/experimental/mosaic/gpu/utils.py:1788-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 (7 lines × 2) jax/experimental/pallas/ops/tpu/ragged_paged_attention/kernel.py:123— jax/experimental/pallas/ops/tpu/ragged_paged_attention/kernel.py:123-129 | jax/experimental/pallas/ops/tpu/ragged_paged_attention/kernel.py:630-637 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/ragged_paged_attention/kernel.py:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) jax/experimental/roofline/rooflines.py:82— jax/experimental/roofline/rooflines.py:82-88 | jax/experimental/roofline/rooflines.py:798-805 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) jax/_src/ad_checkpoint.py:1226— jax/_src/ad_checkpoint.py:1226-1230 | jax/_src/ad_checkpoint.py:1279-1283 — both copies are in the same file, so extract the block into 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) jax/_src/custom_derivatives.py:514— jax/_src/custom_derivatives.py:514-518 | jax/_src/custom_derivatives.py:1325-1329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jax/_src/custom_derivatives.py:1323` calls `pop` and `jax/_src/custom_derivatives.py:513` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) jax/_src/export/_export.py:1615— jax/_src/export/_export.py:1615-1619 | jax/_src/interpreters/mlir.py:2778-2782 — 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 (5 lines × 2) jax/_src/interpreters/ad.py:751— jax/_src/interpreters/ad.py:751-755 | jax/_src/interpreters/ad.py:781-785 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/interpreters/ad.py:751` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) jax/_src/interpreters/partial_eval.py:1065— jax/_src/interpreters/partial_eval.py:1065-1069 | jax/_src/interpreters/partial_eval.py:1114-1118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/interpreters/partial_eval.py:1065` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) jax/_src/lax/control_flow/loops.py:788— jax/_src/lax/control_flow/loops.py:788-792 | jax/_src/lax/control_flow/loops.py:928-937 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/lax/control_flow/loops.py:788` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) jax/_src/lax/slicing.py:3769— jax/_src/lax/slicing.py:3769-3773 | jax/_src/lax/slicing.py:3892-3898 — both copies are in the same file, so extract the block into 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) jax/_src/lax/special.py:404— jax/_src/lax/special.py:404-408 | jax/_src/lax/special.py:538-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 (5 lines × 2) jax/_src/lib/__init__.py:53— jax/_src/lib/__init__.py:53-57 | jaxlib/plugin_support.py:90-95 — 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 (5 lines × 2) jax/_src/pallas/hlo_interpreter.py:372— jax/_src/pallas/hlo_interpreter.py:372-376 | jax/_src/pallas/hlo_interpreter.py:500-504 — both copies are in the same file, so extract the block into 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) jax/_src/pallas/mosaic/lowering.py:3645— jax/_src/pallas/mosaic/lowering.py:3645-3649 | jax/_src/pallas/mosaic/lowering.py:3987-3996 — both copies are in the same file, so extract the block into 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) jax/_src/scipy/bessel.py:519— jax/_src/scipy/bessel.py:519-525 | jax/_src/scipy/bessel.py:548-552 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/scipy/bessel.py:519` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) jax/_src/scipy/bessel.py:694— jax/_src/scipy/bessel.py:694-700 | jax/_src/scipy/bessel.py:1733-1737 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/scipy/bessel.py:694` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) jax/_src/shard_map.py:1707— jax/_src/shard_map.py:1707-1711 | jax/_src/shard_map.py:1759-1763 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/shard_map.py:1707` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) jax/experimental/mosaic/gpu/tcgen05.py:2077— jax/experimental/mosaic/gpu/tcgen05.py:2077-2081 | jax/experimental/mosaic/gpu/tcgen05.py:2122-2126 — both copies are in the same file, so extract the block into 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) jax/experimental/pallas/ops/gpu/blackwell_matmul_mgpu.py:272— jax/experimental/pallas/ops/gpu/blackwell_matmul_mgpu.py:272-276 | jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:276-280 — 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) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:324— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:324-328 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:2356-2360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:324` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) jax/experimental/sparse/csr.py:125— jax/experimental/sparse/csr.py:125-129 | jax/experimental/sparse/csr.py:198-203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/sparse/csr.py:198` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) jax/_src/checkify.py:635— jax/_src/checkify.py:635-639 | jax/_src/checkify.py:653-657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 2) jax/_src/cudnn/fused_attention_stablehlo.py:415— jax/_src/cudnn/fused_attention_stablehlo.py:415-419 | jax/_src/cudnn/fused_attention_stablehlo.py:423-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) jax/_src/custom_derivatives.py:275— jax/_src/custom_derivatives.py:275-279 | jax/_src/custom_derivatives.py:850-854 — both copies are in the same file, so extract the block into 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) jax/_src/hijax.py:735— jax/_src/hijax.py:735-739 | jax/_src/hijax.py:752-756 — both copies are in the same file, so extract the block into 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) jax/_src/interpreters/ad.py:572— jax/_src/interpreters/ad.py:572-576 | jax/_src/interpreters/ad.py:591-595 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/interpreters/ad.py:572` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) jax/_src/interpreters/pxla.py:195— jax/_src/interpreters/pxla.py:195-199 | jax/_src/interpreters/pxla.py:205-209 — both copies are in the same file, so extract the block into 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) jax/_src/lax/eval_jaxpr.py:44— jax/_src/lax/eval_jaxpr.py:44-48 | jax/_src/program_order.py:243-247 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) docs/_static/fault_tolerance/cancel_collectives.py:51— docs/_static/fault_tolerance/cancel_collectives.py:51-56 | docs/_static/fault_tolerance/collectives.py:41-46 — before extracting anything, compare `docs/_static/fault_tolerance/cancel_collectives.py` and `docs/_static/fault_tolerance/collectives.py` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `docs/_static/fault_tolerance/cancel_collectives.py:49` calls `_live_devices`, `devices` and `docs/_static/fault_tolerance/collectives.py:39` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) docs/autodidax.py:1308— docs/autodidax.py:1308-1313 | docs/autodidax.py:1425-1430 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `docs/autodidax.py:1424` calls `new_dynamic` and `docs/autodidax.py:1307` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) jax/_src/ad_checkpoint.py:948— jax/_src/ad_checkpoint.py:948-954 | jax/_src/shard_map.py:2271-2276 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/ad_checkpoint.py:948` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) jax/_src/ad_checkpoint.py:1102— jax/_src/ad_checkpoint.py:1102-1107 | jax/_src/ad_checkpoint.py:1157-1162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) jax/_src/compute_on.py:287— jax/_src/compute_on.py:287-292 | jax/_src/pjit.py:1813-1818 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/compute_on.py:287` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) jax/_src/config.py:753— jax/_src/config.py:753-758 | jax/_src/config.py:806-811 — both copies are in the same file, so extract the block into 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) jax/_src/lax/lgamma.py:649— jax/_src/lax/lgamma.py:649-654 | jax/_src/lax/lgamma.py:1312-1317 — both copies are in the same file, so extract the block into 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) jax/_src/lax/trig.py:407— jax/_src/lax/trig.py:407-412 | jax/_src/lax/trig.py:460-465 — both copies are in the same file, so extract the block into 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) jax/_src/lax_reference.py:58— jax/_src/lax_reference.py:58-63 | jax/_src/lax_reference.py:69-74 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/lax_reference.py:58` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) jax/_src/numpy/ufuncs.py:3773— jax/_src/numpy/ufuncs.py:3773-3778 | jax/_src/numpy/ufuncs.py:3792-3797 — both copies are in the same file, so extract the block into 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) jax/_src/random/threefry4x32.py:251— jax/_src/random/threefry4x32.py:251-256 | jax/_src/random/threefry4x32.py:303-308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `shape` to `prng.Shape` in one and `tuple[int, ...]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) jax/_src/scipy/bessel.py:2113— jax/_src/scipy/bessel.py:2113-2121 | jax/_src/scipy/bessel.py:2339-2344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/scipy/bessel.py:2339` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jax/_src/scipy/bessel.py:2111` calls `zeros_like`, `ones_like` and `jax/_src/scipy/bessel.py:2339` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) jax/_src/scipy/fft.py:117— jax/_src/scipy/fft.py:117-122 | jax/_src/scipy/fft.py:348-353 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/scipy/fft.py:117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `jax/_src/scipy/fft.py:126` calls `_dct_interleave` and `jax/_src/scipy/fft.py:358` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) jax/experimental/mosaic/gpu/fragmented_array.py:4909— jax/experimental/mosaic/gpu/fragmented_array.py:4909-4915 | jax/experimental/mosaic/gpu/fragmented_array.py:5603-5608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/mosaic/gpu/fragmented_array.py:4909` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) jax/experimental/multihost_utils.py:264— jax/experimental/multihost_utils.py:264-269 | jax/experimental/multihost_utils.py:427-432 — both copies are in the same file, so extract the block into 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) jax/experimental/pallas/ops/gpu/collective_matmul_mgpu.py:80— jax/experimental/pallas/ops/gpu/collective_matmul_mgpu.py:80-85 | jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py:89-94 — 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) jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:106— jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:106-111 | jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py:134-166 — before extracting anything, compare `jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py` and `jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1008— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1008-1013 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1016-1021 — both copies are in the same file, so extract the block into 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) jax/experimental/sparse/_lowerings.py:83— jax/experimental/sparse/_lowerings.py:83-88 | jax/experimental/sparse/_lowerings.py:209-214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) jax/_src/cudnn/fused_attention_stablehlo.py:889— jax/_src/cudnn/fused_attention_stablehlo.py:889-894 | jax/_src/cudnn/fused_attention_stablehlo.py:953-958 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `jax/_src/cudnn/fused_attention_stablehlo.py:959` calls `any` and `jax/_src/cudnn/fused_attention_stablehlo.py:895` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) jax/_src/image/scale.py:152— jax/_src/image/scale.py:152-157 | jax/_src/image/scale.py:161-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 (6 lines × 2) jax/_src/interpreters/partial_eval.py:2498— jax/_src/interpreters/partial_eval.py:2498-2503 | jax/_src/program_order.py:323-328 — 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) jax/_src/lax/slicing.py:1609— jax/_src/lax/slicing.py:1609-1614 | jax/_src/lax/slicing.py:1800-1805 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) jax/_src/lax/special.py:628— jax/_src/lax/special.py:628-633 | jax/_src/lax/special.py:650-655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/lax/special.py:628` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) jax/_src/shard_map.py:1296— jax/_src/shard_map.py:1296-1301 | jax/_src/shard_map.py:1307-1312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
+ 6 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×26
Edited copy of a member (8 corresponding lines) jax/_src/lax/lax.py:5218— jax/_src/lax/lax.py:5218-5226 | jax/_src/lax/lax.py:5249-5256 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/experimental/sparse/bcoo.py:134— jax/experimental/sparse/bcoo.py:134-141 | jax/experimental/sparse/bcsr.py:124-135 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/lax_reference.py:108— jax/_src/lax_reference.py:108-115 | jax/_src/lax_reference.py:119-126 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) docs/hijax_types.py:928— docs/hijax_types.py:928-935 | docs/hijax_types.py:959-968 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/scipy/linalg.py:2556— jax/_src/scipy/linalg.py:2556-2563 | jax/_src/scipy/linalg.py:2620-2627 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/numpy/util.py:225— jax/_src/numpy/util.py:225-237 | jax/_src/numpy/util.py:241-248 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) docs/_static/fault_tolerance/data_parallelism_with_recovery.py:70— docs/_static/fault_tolerance/data_parallelism_with_recovery.py:70-77 | docs/_static/fault_tolerance/data_parallelism_with_recovery.py:81-90 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/interpreters/remat.py:119— jax/_src/interpreters/remat.py:119-126 | jax/_src/interpreters/remat.py:129-136 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/pallas/mosaic/sc_primitives.py:535— jax/_src/pallas/mosaic/sc_primitives.py:535-542 | jax/_src/pallas/mosaic/sc_primitives.py:586-593 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask.py:272— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask.py:272-285 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask.py:544-551 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/tree_util.py:415— jax/_src/tree_util.py:415-422 | jax/_src/tree_util.py:1320-1330 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/pallas/triton/lowering.py:1178— jax/_src/pallas/triton/lowering.py:1178-1186 | jax/_src/pallas/triton/lowering.py:1236-1243 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/lax/erf.py:78— jax/_src/lax/erf.py:78-85 | jax/_src/lax/erf.py:105-114 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/experimental/sparse/bcoo.py:2734— jax/experimental/sparse/bcoo.py:2734-2741 | jax/experimental/sparse/bcoo.py:2744-2751 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/lax_reference.py:58— jax/_src/lax_reference.py:58-65 | jax/_src/lax_reference.py:69-76 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/custom_derivatives.py:511— jax/_src/custom_derivatives.py:511-518 | jax/_src/custom_derivatives.py:1320-1329 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/core.py:3450— jax/_src/core.py:3450-3457 | jax/_src/core.py:3465-3472 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/numpy/array_methods.py:1520— jax/_src/numpy/array_methods.py:1520-1527 | jax/_src/numpy/array_methods.py:1585-1593 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/lax/erf.py:90— jax/_src/lax/erf.py:90-100 | jax/_src/lax/erf.py:119-126 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/pallas/triton/lowering.py:2686— jax/_src/pallas/triton/lowering.py:2686-2693 | jax/_src/pallas/triton/lowering.py:2702-2709 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/pjit.py:2585— jax/_src/pjit.py:2585-2595 | jax/_src/pjit.py:3215-3222 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/experimental/mosaic/gpu/dialect_lowering.py:682— jax/experimental/mosaic/gpu/dialect_lowering.py:682-692 | jax/experimental/mosaic/gpu/dialect_lowering.py:699-706 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/blocked_sampler.py:35— jax/_src/blocked_sampler.py:35-42 | jax/experimental/pallas/ops/tpu/random/prng_utils.py:48-55 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) docs/autodidax.py:650— docs/autodidax.py:650-657 | docs/autodidax.py:910-917 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) jax/_src/random/prng.py:426— jax/_src/random/prng.py:426-433 | jax/_src/random/prng.py:437-444 — These two members are one piece of code written twice and then edited apart: 8 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.
+ 1 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×25
Edited copy of a member (11 corresponding lines) docs/autodidax.py:2001— docs/autodidax.py:2001-2011 | docs/autodidax.py:2520-2532 — 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.
Edited copy of a member (11 corresponding lines) jax/_src/pallas/mosaic/lowering.py:1994— jax/_src/pallas/mosaic/lowering.py:1994-2004 | jax/_src/pallas/mosaic/lowering.py:2015-2030 — 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.
Edited copy of a member (11 corresponding lines) jax/_src/pallas/triton/lowering.py:1146— jax/_src/pallas/triton/lowering.py:1146-1160 | jax/_src/pallas/triton/lowering.py:1164-1174 — 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.
Edited copy of a member (11 corresponding lines) jax/_src/lax/linalg.py:913— jax/_src/lax/linalg.py:913-923 | jax/_src/lax/linalg.py:927-937 — 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.
Edited copy of a member (11 corresponding lines) docs/notebooks/shard_map.py:1134— docs/notebooks/shard_map.py:1134-1146 | docs/notebooks/shard_map.py:1246-1256 — 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.
Edited copy of a member (11 corresponding lines) jax/_src/pallas/mosaic_gpu/core.py:1507— jax/_src/pallas/mosaic_gpu/core.py:1507-1517 | jax/_src/pallas/mosaic_gpu/core.py:1538-1556 — 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.
Edited copy of a member (11 corresponding lines) docs/autodidax.py:1303— docs/autodidax.py:1303-1313 | docs/autodidax.py:1419-1430 — 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.
Edited copy of a member (11 corresponding lines) jax/experimental/sparse/bcoo.py:659— jax/experimental/sparse/bcoo.py:659-669 | jax/experimental/sparse/bcsr.py:507-517 — 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.
Edited copy of a member (11 corresponding lines) jax/experimental/sparse/bcoo.py:912— jax/experimental/sparse/bcoo.py:912-922 | jax/experimental/sparse/bcsr.py:590-600 — 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.
Edited copy of a member (11 corresponding lines) jax/_src/pallas/triton/lowering.py:515— jax/_src/pallas/triton/lowering.py:515-525 | jax/_src/pallas/triton/primitives.py:665-681 — 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.
Edited copy of a member (11 corresponding lines) jax/experimental/mosaic/gpu/layout_inference.py:1880— jax/experimental/mosaic/gpu/layout_inference.py:1880-1896 | jax/experimental/mosaic/gpu/layout_inference.py:1925-1935 — 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.
Edited copy of a member (11 corresponding lines) jax/experimental/mosaic/gpu/utils.py:1388— jax/experimental/mosaic/gpu/utils.py:1388-1405 | jax/experimental/mosaic/gpu/utils.py:1410-1420 — 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.
Edited copy of a member (11 corresponding lines) docs/autodidax.py:2816— docs/autodidax.py:2816-2826 | docs/autodidax.py:2834-2844 — 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.
Edited copy of a member (11 corresponding lines) jax/_src/state/types.py:124— jax/_src/state/types.py:124-135 | jax/_src/state/types.py:180-190 — 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.
Edited copy of a member (11 corresponding lines) jax/experimental/mosaic/gpu/fragmented_array.py:1904— jax/experimental/mosaic/gpu/fragmented_array.py:1904-1914 | jax/experimental/mosaic/gpu/fragmented_array.py:1927-1937 — 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.
Edited copy of a member (11 corresponding lines) jax/_src/numpy/lax_numpy.py:8367— jax/_src/numpy/lax_numpy.py:8367-8377 | jax/_src/numpy/lax_numpy.py:8428-8438 — 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.
Edited copy of a member (11 corresponding lines) jax/_src/lax/parallel.py:1922— jax/_src/lax/parallel.py:1922-1933 | jax/_src/lax/slicing.py:1808-1818 — 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.
Edited copy of a member (11 corresponding lines) jax/_src/custom_derivatives.py:207— jax/_src/custom_derivatives.py:207-246 | jax/_src/hijax.py:1502-1512 — 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.
Edited copy of a member (11 corresponding lines) jax/_src/lax/trig.py:277— jax/_src/lax/trig.py:277-288 | jax/_src/lax/trig.py:292-302 — 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.
Edited copy of a member (11 corresponding lines) jax/_src/state/primitives.py:429— jax/_src/state/primitives.py:429-441 | jax/_src/state/primitives.py:444-454 — 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.
Edited copy of a member (11 corresponding lines) jax/_src/thunky/thunky.py:944— jax/_src/thunky/thunky.py:944-954 | jax/_src/thunky/thunky.py:1176-1188 — 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.
Edited copy of a member (11 corresponding lines) docs/autodidax.py:2014— docs/autodidax.py:2014-2025 | docs/autodidax.py:2535-2545 — 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.
Edited copy of a member (11 corresponding lines) jax/_src/numpy/util.py:112— jax/_src/numpy/util.py:112-122 | jax/_src/numpy/util.py:128-138 — 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.
Edited copy of a member (11 corresponding lines) jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:1449— jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:1449-1459 | jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:1462-1472 — 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.
Edited copy of a member (11 corresponding lines) jax/experimental/pallas/ops/tpu/flash_attention.py:1565— jax/experimental/pallas/ops/tpu/flash_attention.py:1565-1575 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:224-235 — 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 (10 corresponding lines) · ×21
Edited copy of a member (10 corresponding lines) jax/experimental/jet.py:552— jax/experimental/jet.py:552-562 | jax/experimental/jet.py:648-657 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/experimental/sparse/bcoo.py:2585— jax/experimental/sparse/bcoo.py:2585-2594 | jax/experimental/sparse/bcsr.py:921-934 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/_src/hijax.py:730— jax/_src/hijax.py:730-739 | jax/_src/hijax.py:747-756 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/_src/lax/eval_jaxpr.py:83— jax/_src/lax/eval_jaxpr.py:83-92 | jax/_src/xla_metadata.py:463-477 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/experimental/sparse/csr.py:125— jax/experimental/sparse/csr.py:125-134 | jax/experimental/sparse/csr.py:198-209 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/experimental/sparse/csr.py:487— jax/experimental/sparse/csr.py:487-496 | jax/experimental/sparse/csr.py:600-609 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/_src/pallas/triton/lowering.py:1190— jax/_src/pallas/triton/lowering.py:1190-1199 | jax/_src/pallas/triton/lowering.py:1215-1224 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/_src/core.py:2706— jax/_src/core.py:2706-2721 | jax/_src/core.py:2729-2738 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/_src/nn/initializers.py:270— jax/_src/nn/initializers.py:270-279 | jax/_src/nn/initializers.py:284-296 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/_src/cudnn/fused_attention_stablehlo.py:1284— jax/_src/cudnn/fused_attention_stablehlo.py:1284-1293 | jax/_src/cudnn/fused_attention_stablehlo.py:1296-1305 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/_src/random/core.py:4278— jax/_src/random/core.py:4278-4287 | jax/_src/random/core.py:4406-4419 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/_src/ad_checkpoint.py:943— jax/_src/ad_checkpoint.py:943-954 | jax/_src/state/discharge.py:1036-1045 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/_src/pallas/primitives.py:1113— jax/_src/pallas/primitives.py:1113-1124 | jax/_src/pallas/primitives.py:1190-1199 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/_src/random/philox4x32.py:185— jax/_src/random/philox4x32.py:185-194 | jax/_src/random/threefry4x32.py:247-258 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jaxlib/backport_stubs.py:43— jaxlib/backport_stubs.py:43-52 | jaxlib/mlir/_mlir_libs/normalize_stubs.py:83-97 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/_src/interpreters/mlir.py:3118— jax/_src/interpreters/mlir.py:3118-3127 | jax/_src/interpreters/mlir.py:3224-3234 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/_src/pallas/mosaic_gpu/lowering.py:4372— jax/_src/pallas/mosaic_gpu/lowering.py:4372-4381 | jax/_src/pallas/triton/lowering.py:3051-3060 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) docs/hijax_custom_derivatives.py:454— docs/hijax_custom_derivatives.py:454-463 | docs/hijax_custom_derivatives.py:550-559 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/_src/pallas/primitives.py:76— jax/_src/pallas/primitives.py:76-85 | jax/_src/pallas/primitives.py:100-111 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/_src/pallas/triton/lowering.py:2050— jax/_src/pallas/triton/lowering.py:2050-2062 | jax/_src/pallas/triton/lowering.py:2301-2310 — These two members are one piece of code written twice and then edited apart: 10 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 (10 corresponding lines) jax/_src/lax/lax.py:4026— jax/_src/lax/lax.py:4026-4035 | jax/_src/numpy/array_creation.py:653-717 — These two members are one piece of code written twice and then edited apart: 10 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 (9 lines × 2) jax/_src/config.py:461— jax/_src/config.py:461-469 | jax/_src/config.py:500-508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/config.py:461` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) jax/_src/core.py:2706— jax/_src/core.py:2706-2714 | jax/_src/core.py:2729-2737 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) jax/_src/interpreters/mlir.py:1925— jax/_src/interpreters/mlir.py:1925-1933 | jax/_src/interpreters/mlir.py:1937-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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/interpreters/mlir.py:1925` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) jax/_src/lax/convolution.py:766— jax/_src/lax/convolution.py:766-774 | jax/_src/lax/lax.py:7315-7323 — 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) jax/_src/pallas/mosaic/interpret/utils.py:174— jax/_src/pallas/mosaic/interpret/utils.py:174-182 | jax/_src/pallas/primitives.py:1230-1238 — 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 (9 lines × 2) jax/_src/pallas/mosaic/primitives.py:596— jax/_src/pallas/mosaic/primitives.py:596-606 | jax/_src/pallas/mosaic/primitives.py:609-617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic/primitives.py:596` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) jax/_src/pallas/mosaic/sc_primitives.py:62— jax/_src/pallas/mosaic/sc_primitives.py:62-70 | jax/_src/pallas/mosaic/sc_primitives.py:123-131 — both copies are in the same file, so extract the block into 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) jax/_src/pallas/triton/lowering.py:2881— jax/_src/pallas/triton/lowering.py:2881-2889 | jax/_src/pallas/utils.py:213-221 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) jax/_src/random/core.py:2418— jax/_src/random/core.py:2418-2426 | jax/_src/random/core.py:2937-2945 — both copies are in the same file, so extract the block into 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) jax/_src/scipy/special.py:4195— jax/_src/scipy/special.py:4195-4203 | jax/_src/scipy/special.py:4547-4555 — both copies are in the same file, so extract the block into 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) jax/_src/thunky/thunky.py:995— jax/_src/thunky/thunky.py:995-1003 | jax/_src/thunky/thunky.py:1043-1051 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) jax/_src/tpu_info.py:430— jax/_src/tpu_info.py:430-438 | jax/_src/tpu_info.py:538-546 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/tpu_info.py:430` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) jax/experimental/mosaic/gpu/launch_context.py:2430— jax/experimental/mosaic/gpu/launch_context.py:2430-2438 | jax/experimental/mosaic/gpu/launch_context.py:2455-2463 — both copies are in the same file, so extract the block into 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) jax/experimental/pallas/ops/tpu/flash_attention.py:819— jax/experimental/pallas/ops/tpu/flash_attention.py:819-827 | jax/experimental/pallas/ops/tpu/flash_attention.py:1167-1175 — both copies are in the same file, so extract the block into 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) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1398— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1398-1406 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1812-1820 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1398` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1497— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1497-1505 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1511-1519 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1497` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1985— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1985-1993 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1997-2005 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1985` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) jax/experimental/rnn.py:225— jax/experimental/rnn.py:225-233 | jax/experimental/rnn.py:235-243 — both copies are in the same file, so extract the block into 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) jax/experimental/sparse/bcoo.py:2540— jax/experimental/sparse/bcoo.py:2540-2548 | jax/experimental/sparse/bcsr.py:893-901 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) docs/notebooks/shard_map.py:1168— docs/notebooks/shard_map.py:1168-1176 | docs/notebooks/shard_map.py:1269-1277 — both copies are in the same file, so extract the block into 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) jax/experimental/mosaic/gpu/examples/flash_attention.py:230— jax/experimental/mosaic/gpu/examples/flash_attention.py:230-238 | jax/experimental/mosaic/gpu/examples/flash_attention.py:463-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jax/experimental/mosaic/gpu/examples/flash_attention.py:229` calls `arrive` and `jax/experimental/mosaic/gpu/examples/flash_attention.py:462` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Swallowed exception (caught, then discarded) jax/version.py:63— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/tools/evaluate_sampler_bias.py:251— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/tools/evaluate_sampler_bias.py:272— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/experimental/sparse/_base.py:63— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/experimental/sparse/bcoo.py:2539— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/experimental/sparse/bcsr.py:892— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/experimental/mosaic/gpu/core.py:1096— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/experimental/jax2tf/jax2tf.py:83— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/_src/api.py:1966— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/_src/api_util.py:713— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/_src/compiler.py:124— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/_src/core.py:3200— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/_src/core.py:3331— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/_src/environment_info.py:30— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/_src/mesh_utils.py:810— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/_src/tree_util.py:823— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/_src/tree_util.py:1385— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/_src/util.py:658— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/_src/lax/control_flow/loops.py:546— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/_src/interpreters/pxla.py:1283— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jax/_src/export/shape_poly.py:1245— `except` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Duplicated block (10 lines × 2) jax/_src/compute_on.py:226— jax/_src/compute_on.py:226-235 | jax/_src/xla_metadata.py:411-420 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `jax/_src/compute_on.py:236` calls `_filter_zeros` and `jax/_src/xla_metadata.py:421` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) jax/_src/cudnn/fused_attention_stablehlo.py:830— jax/_src/cudnn/fused_attention_stablehlo.py:830-839 | jax/_src/cudnn/fused_attention_stablehlo.py:1692-1701 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/cudnn/fused_attention_stablehlo.py:830` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) jax/_src/interpreters/partial_eval.py:230— jax/_src/interpreters/partial_eval.py:230-239 | jax/_src/interpreters/partial_eval.py:277-286 — both copies are in the same file, so extract the block into 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) jax/_src/interpreters/pxla.py:1460— jax/_src/interpreters/pxla.py:1460-1469 | jax/_src/interpreters/pxla.py:1471-1480 — both copies are in the same file, so extract the block into 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) jax/_src/interpreters/pxla.py:1969— jax/_src/interpreters/pxla.py:1969-1978 | jax/_src/pjit.py:225-234 — 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) jax/_src/lax/exp_log.py:436— jax/_src/lax/exp_log.py:436-445 | jax/_src/lax/trig.py:577-586 — 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 lines × 2) jax/_src/lax/parallel.py:2256— jax/_src/lax/parallel.py:2256-2265 | jax/_src/lax/parallel.py:2506-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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/lax/parallel.py:2256` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) jax/_src/lax/slicing.py:3183— jax/_src/lax/slicing.py:3183-3192 | jax/_src/lax/slicing.py:3226-3235 — both copies are in the same file, so extract the block into 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) jax/_src/numpy/lax_numpy.py:4135— jax/_src/numpy/lax_numpy.py:4135-4144 | jax/_src/numpy/lax_numpy.py:4145-4154 — both copies are in the same file, so extract the block into 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) jax/_src/pallas/mosaic_gpu/primitives.py:5011— jax/_src/pallas/mosaic_gpu/primitives.py:5011-5020 | jax/_src/pallas/mosaic_gpu/primitives.py:5961-5970 — both copies are in the same file, so extract the block into 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) jax/experimental/pallas/ops/gpu/blackwell_matmul_mgpu.py:162— jax/experimental/pallas/ops/gpu/blackwell_matmul_mgpu.py:162-171 | jax/experimental/pallas/ops/gpu/blackwell_ragged_dot_mgpu.py:128-137 — before extracting anything, compare `jax/experimental/pallas/ops/gpu/blackwell_matmul_mgpu.py` and `jax/experimental/pallas/ops/gpu/blackwell_ragged_dot_mgpu.py` 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/gpu/blackwell_matmul_mgpu.py:162` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `jax/experimental/pallas/ops/gpu/blackwell_ragged_dot_mgpu.py:139` calls `barrier_wait` and `jax/experimental/pallas/ops/gpu/blackwell_matmul_mgpu.py:174` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) jax/experimental/pallas/ops/tpu/flash_attention.py:1013— jax/experimental/pallas/ops/tpu/flash_attention.py:1013-1022 | jax/experimental/pallas/ops/tpu/flash_attention.py:1352-1361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) jax/experimental/serialize_executable.py:82— jax/experimental/serialize_executable.py:82-91 | jax/experimental/serialize_executable.py:137-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 (10 lines × 2) jax/experimental/source_mapper/hlo.py:86— jax/experimental/source_mapper/hlo.py:86-95 | jax/experimental/source_mapper/hlo.py:101-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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/source_mapper/hlo.py:86` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) jax/experimental/sparse/coo.py:466— jax/experimental/sparse/coo.py:466-475 | jax/experimental/sparse/coo.py:587-596 — both copies are in the same file, so extract the block into 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) jax/_src/checkify.py:1142— jax/_src/checkify.py:1142-1151 | jax/_src/custom_derivatives.py:414-423 — 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 lines × 2) docs/401/cute_dsl_jax/cute_dsl_jax_kernels.py:60— docs/401/cute_dsl_jax/cute_dsl_jax_kernels.py:60-69 | docs/401/cute_dsl_jax/cute_dsl_jax_kernels.py:91-100 — both copies are in the same file, so extract the block into 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) jax/example_libraries/stax.py:68— jax/example_libraries/stax.py:68-77 | jax/example_libraries/stax.py:95-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×17
Edited copy of a member (7 corresponding lines) docs/autodidax.py:1920— docs/autodidax.py:1920-1926 | docs/autodidax.py:3036-3044 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) jax/_src/lax/lax.py:10952— jax/_src/lax/lax.py:10952-10958 | jax/_src/lax/lax.py:10963-10969 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) jax/experimental/sparse/coo.py:445— jax/experimental/sparse/coo.py:445-452 | jax/experimental/sparse/coo.py:568-574 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) jax/_src/scipy/linalg.py:1562— jax/_src/scipy/linalg.py:1562-1568 | jax/_src/scipy/linalg.py:1571-1578 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) jax/_src/pallas/mosaic/pipeline.py:1256— jax/_src/pallas/mosaic/pipeline.py:1256-1262 | jax/_src/pallas/mosaic_gpu/pipeline.py:227-235 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) jax/_src/lax/parallel.py:3285— jax/_src/lax/parallel.py:3285-3291 | jax/_src/lax/parallel.py:3319-3325 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) jax/_src/lax/slicing.py:1608— jax/_src/lax/slicing.py:1608-1614 | jax/_src/lax/slicing.py:1799-1805 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) jax/experimental/sparse/coo.py:372— jax/experimental/sparse/coo.py:372-378 | jax/experimental/sparse/csr.py:404-410 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) jax/_src/numpy/reductions.py:1442— jax/_src/numpy/reductions.py:1442-1450 | jax/_src/numpy/reductions.py:2209-2215 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) docs/autodidax.py:569— docs/autodidax.py:569-575 | docs/autodidax.py:637-643 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) jax/_src/random/philox4x32.py:205— jax/_src/random/philox4x32.py:205-211 | jax/_src/random/threefry4x32.py:276-282 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) jax/experimental/mosaic/gpu/fragmented_array.py:2147— jax/experimental/mosaic/gpu/fragmented_array.py:2147-2158 | jax/experimental/mosaic/gpu/fragmented_array.py:2173-2179 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) jax/experimental/mosaic/gpu/fragmented_array.py:2161— jax/experimental/mosaic/gpu/fragmented_array.py:2161-2170 | jax/experimental/mosaic/gpu/fragmented_array.py:2182-2188 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) jax/_src/hijax.py:841— jax/_src/hijax.py:841-849 | jax/_src/lax/control_flow/solves.py:120-126 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) jax/_src/pallas/mosaic/lowering.py:1771— jax/_src/pallas/mosaic/lowering.py:1771-1787 | jax/_src/pallas/mosaic_gpu/lowering.py:1040-1046 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) jax/_src/pallas/primitives.py:437— jax/_src/pallas/primitives.py:437-463 | jax/_src/pallas/triton/primitives.py:383-389 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) examples/ffi/src/jax_ffi_example/cuda_examples.py:39— examples/ffi/src/jax_ffi_example/cuda_examples.py:39-45 | examples/ffi/src/jax_ffi_example/cuda_examples.py:49-58 — These two members are one piece of code written twice and then edited apart: 7 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 (9 corresponding lines) · ×16
Edited copy of a member (9 corresponding lines) jax/_src/scipy/linalg.py:1581— jax/_src/scipy/linalg.py:1581-1589 | jax/_src/scipy/linalg.py:1592-1602 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) jax/experimental/sparse/csr.py:473— jax/experimental/sparse/csr.py:473-481 | jax/experimental/sparse/csr.py:585-594 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) jax/experimental/sparse/bcoo.py:342— jax/experimental/sparse/bcoo.py:342-350 | jax/experimental/sparse/bcsr.py:286-296 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) jax/_src/lax/lax.py:3542— jax/_src/lax/lax.py:3542-3550 | jax/_src/lax/lax.py:3553-3561 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) jax/_src/interpreters/batching.py:363— jax/_src/interpreters/batching.py:363-371 | jax/_src/interpreters/batching.py:375-384 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) jax/experimental/jet.py:578— jax/experimental/jet.py:578-586 | jax/experimental/jet.py:606-616 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) jax/_src/interpreters/partial_eval.py:2521— jax/_src/interpreters/partial_eval.py:2521-2529 | jax/_src/lax/control_flow/conditionals.py:1113-1123 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) jax/_src/shard_map.py:1296— jax/_src/shard_map.py:1296-1304 | jax/_src/shard_map.py:1307-1315 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) jax/_src/lax/linalg.py:1481— jax/_src/lax/linalg.py:1481-1489 | jax/_src/lax/linalg.py:1613-1621 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) jax/_src/lax/erf.py:737— jax/_src/lax/erf.py:737-745 | jax/_src/lax/erf.py:749-757 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) docs/401/cute_dsl_jax/cute_dsl_jax_kernels.py:123— docs/401/cute_dsl_jax/cute_dsl_jax_kernels.py:123-131 | docs/401/cute_dsl_jax/cute_dsl_jax_kernels.py:156-165 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) jax/_src/core.py:3479— jax/_src/core.py:3479-3487 | jax/_src/core.py:3492-3503 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) jax/_src/custom_derivatives.py:399— jax/_src/custom_derivatives.py:399-407 | jax/_src/custom_derivatives.py:1195-1205 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) jax/experimental/mosaic/gpu/dialect_lowering.py:1332— jax/experimental/mosaic/gpu/dialect_lowering.py:1332-1340 | jax/experimental/mosaic/gpu/dialect_lowering.py:1349-1357 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) jax/experimental/sparse/bcoo.py:944— jax/experimental/sparse/bcoo.py:944-963 | jax/experimental/sparse/bcoo.py:1100-1108 — These two members are one piece of code written twice and then edited apart: 9 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 (9 corresponding lines) jax/experimental/mosaic/gpu/constraints.py:643— jax/experimental/mosaic/gpu/constraints.py:643-652 | jax/experimental/mosaic/gpu/constraints.py:720-728 — These two members are one piece of code written twice and then edited apart: 9 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 (11 lines × 2) docs/_static/fault_tolerance/dont_fail.py:31— docs/_static/fault_tolerance/dont_fail.py:31-41 | docs/_static/fault_tolerance/while_loop.py:27-37 — before extracting anything, compare `docs/_static/fault_tolerance/dont_fail.py` and `docs/_static/fault_tolerance/while_loop.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `docs/_static/fault_tolerance/dont_fail.py:31` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `docs/_static/fault_tolerance/dont_fail.py:29` calls `update` and `docs/_static/fault_tolerance/while_loop.py:25` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) jax/_src/custom_derivatives.py:331— jax/_src/custom_derivatives.py:331-341 | jax/_src/hijax.py:1423-1433 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/custom_derivatives.py:331` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) jax/_src/interpreters/mlir.py:2004— jax/_src/interpreters/mlir.py:2004-2014 | jax/_src/interpreters/mlir.py:2076-2086 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) jax/_src/lax/windowed_reductions.py:221— jax/_src/lax/windowed_reductions.py:221-231 | jax/_src/lax/windowed_reductions.py:271-281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 2) jax/_src/pallas/mosaic/primitives.py:419— jax/_src/pallas/mosaic/primitives.py:419-429 | jax/_src/pallas/mosaic/primitives.py:664-674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jax/_src/pallas/mosaic/primitives.py:662` calls `NotImplementedError` and `jax/_src/pallas/mosaic/primitives.py:418` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) jax/_src/pallas/mosaic_gpu/lowering.py:1901— jax/_src/pallas/mosaic_gpu/lowering.py:1901-1911 | jax/_src/pallas/mosaic_gpu/lowering.py:2059-2069 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic_gpu/lowering.py:1901` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) jax/_src/scipy/optimize/line_search.py:375— jax/_src/scipy/optimize/line_search.py:375-385 | jax/_src/scipy/optimize/line_search.py:397-407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/scipy/optimize/line_search.py:375` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) jax/_src/thunky/thunky.py:2067— jax/_src/thunky/thunky.py:2067-2077 | jax/_src/thunky/thunky.py:2174-2184 — both copies are in the same file, so extract the block into 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) jax/experimental/jet.py:810— jax/experimental/jet.py:810-820 | jax/experimental/jet.py:826-836 — both copies are in the same file, so extract the block into 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) jax/experimental/pallas/ops/gpu/blackwell_matmul_mgpu.py:133— jax/experimental/pallas/ops/gpu/blackwell_matmul_mgpu.py:133-143 | jax/experimental/pallas/ops/gpu/blackwell_ragged_dot_mgpu.py:99-109 — before extracting anything, compare `jax/experimental/pallas/ops/gpu/blackwell_matmul_mgpu.py` and `jax/experimental/pallas/ops/gpu/blackwell_ragged_dot_mgpu.py` 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 (11 lines × 2) jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:132— jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:132-142 | jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py:135-168 — before extracting anything, compare `jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py` and `jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) jax/experimental/pallas/ops/gpu/ragged_dot_mgpu.py:255— jax/experimental/pallas/ops/gpu/ragged_dot_mgpu.py:255-265 | jax/experimental/pallas/ops/gpu/transposed_ragged_dot_mgpu.py:231-241 — 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) jax/experimental/pallas/ops/tpu/flash_attention.py:1025— jax/experimental/pallas/ops/tpu/flash_attention.py:1025-1037 | jax/experimental/pallas/ops/tpu/flash_attention.py:1364-1374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/flash_attention.py:1025` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) jax/experimental/mosaic/gpu/examples/flash_attention.py:260— jax/experimental/mosaic/gpu/examples/flash_attention.py:260-270 | jax/experimental/mosaic/gpu/examples/flash_attention.py:485-495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `jax/experimental/mosaic/gpu/examples/flash_attention.py:271` calls `arrive` and `jax/experimental/mosaic/gpu/examples/flash_attention.py:496` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) jax/experimental/mosaic/gpu/examples/flash_attention.py:213— jax/experimental/mosaic/gpu/examples/flash_attention.py:213-223 | jax/experimental/mosaic/gpu/examples/flash_attention.py:435-445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jax/experimental/mosaic/gpu/examples/flash_attention.py:432` calls `only_wg`, `c`, `wait` and `jax/experimental/mosaic/gpu/examples/flash_attention.py:211` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) jax/_src/compute_on.py:412— jax/_src/compute_on.py:412-419 | jax/_src/pjit.py:2003-2010 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `eqn` to `pe.JaxprEqn` in one and `core.JaxprEqn` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 2) jax/_src/cudnn/scaled_matmul_stablehlo.py:741— jax/_src/cudnn/scaled_matmul_stablehlo.py:741-748 | jax/_src/lax/lax.py:6997-7004 — 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 (8 lines × 2) jax/_src/interpreters/mlir.py:1248— jax/_src/interpreters/mlir.py:1248-1255 | jax/_src/interpreters/mlir.py:1265-1272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/interpreters/mlir.py:1248` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) jax/_src/interpreters/partial_eval.py:236— jax/_src/interpreters/partial_eval.py:236-243 | jax/_src/interpreters/partial_eval.py:1892-1899 — both copies are in the same file, so extract the block into 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) jax/_src/interpreters/partial_eval.py:971— jax/_src/interpreters/partial_eval.py:971-979 | jax/_src/interpreters/partial_eval.py:984-991 — both copies are in the same file, so extract the block into 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) jax/_src/lax/convolution.py:697— jax/_src/lax/convolution.py:697-704 | jax/_src/lax/convolution.py:709-716 — both copies are in the same file, so extract the block into 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) jax/_src/lax/slicing.py:3130— jax/_src/lax/slicing.py:3130-3137 | jax/_src/lax/slicing.py:3607-3614 — both copies are in the same file, so extract the block into 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) jax/_src/pallas/mosaic/pipeline.py:2515— jax/_src/pallas/mosaic/pipeline.py:2515-2522 | jax/_src/pallas/mosaic/pipeline.py:2581-2588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) jax/experimental/mosaic/gpu/fragmented_array.py:3254— jax/experimental/mosaic/gpu/fragmented_array.py:3254-3261 | jax/experimental/mosaic/gpu/fragmented_array.py:3285-3292 — both copies are in the same file, so extract the block into 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) jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:162— jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:162-169 | jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py:181-188 — before extracting anything, compare `jax/experimental/pallas/ops/gpu/all_gather_mgpu.py` and `jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) jax/experimental/pallas/ops/tpu/paged_attention/paged_attention_kernel.py:434— jax/experimental/pallas/ops/tpu/paged_attention/paged_attention_kernel.py:434-441 | jax/experimental/pallas/ops/tpu/paged_attention/paged_attention_kernel.py:442-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 (8 lines × 2) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1098— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1098-1105 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1603-1610 — both copies are in the same file, so extract the block into 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) jax/experimental/sparse/csr.py:85— jax/experimental/sparse/csr.py:85-92 | jax/experimental/sparse/csr.py:177-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) jax/experimental/pallas/ops/gpu/attention_mgpu.py:182— jax/experimental/pallas/ops/gpu/attention_mgpu.py:182-189 | jax/experimental/pallas/ops/gpu/attention_mgpu.py:746-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 (8 lines × 2) examples/mnist_classifier_fromscratch.py:36— examples/mnist_classifier_fromscratch.py:36-43 | examples/spmd_mnist_classifier_fromscratch.py:36-43 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×12
Animation without a prefers-reduced-motion guard docs/_static/fault_tolerance/fault_tolerance.css:107— `.p0_to_pserver` moves (`animation-name: p0_to_pserver_keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard docs/_static/fault_tolerance/fault_tolerance.css:112— `.p1_to_pserver` moves (`animation-name: p1_to_pserver_keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard docs/_static/fault_tolerance/fault_tolerance.css:117— `.p2_to_pserver` moves (`animation-name: p2_to_pserver_keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard docs/_static/fault_tolerance/fault_tolerance.css:122— `.pserver_to_p0` moves (`animation-name: pserver_to_p0_keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard docs/_static/fault_tolerance/fault_tolerance.css:127— `.pserver_to_p1` moves (`animation-name: pserver_to_p1_keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard docs/_static/fault_tolerance/fault_tolerance.css:132— `.pserver_to_p2` moves (`animation-name: pserver_to_p2_keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard docs/_static/fault_tolerance/fault_tolerance.css:167— `.p0_to_pserver_tall` moves (`animation-name: p0_to_pserver_keyframes_tall`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard docs/_static/fault_tolerance/fault_tolerance.css:172— `.p1_to_pserver_tall` moves (`animation-name: p1_to_pserver_keyframes_tall`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard docs/_static/fault_tolerance/fault_tolerance.css:177— `.p2_to_pserver_tall` moves (`animation-name: p2_to_pserver_keyframes_tall`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard docs/_static/fault_tolerance/fault_tolerance.css:182— `.pserver_to_p0_tall` moves (`animation-name: pserver_to_p0_keyframes_tall`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard docs/_static/fault_tolerance/fault_tolerance.css:187— `.pserver_to_p1_tall` moves (`animation-name: pserver_to_p1_keyframes_tall`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard docs/_static/fault_tolerance/fault_tolerance.css:192— `.pserver_to_p2_tall` moves (`animation-name: pserver_to_p2_keyframes_tall`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×12
Edited copy of a member (15 corresponding lines) docs/autodidax.py:2358— docs/autodidax.py:2358-2372 | docs/autodidax.py:2927-2948 — 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.
Edited copy of a member (15 corresponding lines) jax/experimental/sparse/bcoo.py:63— jax/experimental/sparse/bcoo.py:63-77 | jax/experimental/sparse/bcsr.py:74-88 — 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.
Edited copy of a member (15 corresponding lines) jax/experimental/mosaic/gpu/dialect_lowering.py:726— jax/experimental/mosaic/gpu/dialect_lowering.py:726-743 | jax/experimental/mosaic/gpu/dialect_lowering.py:775-789 — 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.
Edited copy of a member (15 corresponding lines) jax/_src/scipy/spatial/transform.py:74— jax/_src/scipy/spatial/transform.py:74-89 | jax/_src/scipy/spatial/transform.py:146-160 — 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.
Edited copy of a member (15 corresponding lines) jax/experimental/mosaic/gpu/utils.py:1249— jax/experimental/mosaic/gpu/utils.py:1249-1263 | jax/experimental/mosaic/gpu/utils.py:1719-1733 — 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.
Edited copy of a member (15 corresponding lines) jax/experimental/mosaic/gpu/tcgen05.py:1189— jax/experimental/mosaic/gpu/tcgen05.py:1189-1203 | jax/experimental/mosaic/gpu/tcgen05.py:1207-1221 — 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.
Edited copy of a member (15 corresponding lines) jax/_src/pallas/primitives.py:196— jax/_src/pallas/primitives.py:196-213 | jax/_src/pallas/primitives.py:366-380 — 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.
Edited copy of a member (15 corresponding lines) jax/_src/interpreters/partial_eval.py:846— jax/_src/interpreters/partial_eval.py:846-860 | jax/_src/interpreters/partial_eval.py:1244-1270 — 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.
Edited copy of a member (15 corresponding lines) jax/_src/lax/special.py:681— jax/_src/lax/special.py:681-695 | jax/_src/lax/special.py:768-786 — 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.
Edited copy of a member (15 corresponding lines) jax/_src/pallas/mosaic/pipeline.py:1031— jax/_src/pallas/mosaic/pipeline.py:1031-1045 | jax/_src/pallas/mosaic/pipeline.py:1073-1089 — 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.
Edited copy of a member (15 corresponding lines) jax/experimental/sparse/coo.py:288— jax/experimental/sparse/coo.py:288-303 | jax/experimental/sparse/csr.py:316-330 — 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.
Edited copy of a member (15 corresponding lines) jax/experimental/sparse/coo.py:306— jax/experimental/sparse/coo.py:306-320 | jax/experimental/sparse/csr.py:333-347 — 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.
Duplicated block (13 lines × 2) jax/_src/compute_on.py:210— jax/_src/compute_on.py:210-222 | jax/_src/xla_metadata.py:394-406 — 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 (13 lines × 2) jax/_src/lax/control_flow/loops.py:186— jax/_src/lax/control_flow/loops.py:186-198 | jax/_src/lax/control_flow/loops.py:410-422 — both copies are in the same file, so extract the block into 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) jax/_src/lax/control_flow/loops.py:839— jax/_src/lax/control_flow/loops.py:839-851 | jax/_src/lax/control_flow/loops.py:972-984 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/lax/control_flow/loops.py:839` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) jax/_src/lax/lax.py:9484— jax/_src/lax/lax.py:9484-9496 | jax/_src/lax/lax.py:9529-9541 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13 lines × 2) jax/_src/pallas/mosaic_gpu/primitives.py:1522— jax/_src/pallas/mosaic_gpu/primitives.py:1522-1534 | jax/_src/pallas/mosaic_gpu/primitives.py:1720-1732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) jax/_src/pallas/mosaic_gpu/primitives.py:4346— jax/_src/pallas/mosaic_gpu/primitives.py:4346-4358 | jax/_src/pallas/mosaic_gpu/primitives.py:4494-4506 — both copies are in the same file, so extract the block into 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) jax/_src/scipy/bessel.py:585— jax/_src/scipy/bessel.py:585-597 | jax/_src/scipy/bessel.py:1201-1213 — both copies are in the same file, so extract the block into 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) jax/_src/scipy/special.py:3713— jax/_src/scipy/special.py:3713-3725 | jax/_src/scipy/special.py:3780-3792 — both copies are in the same file, so extract the block into 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) jax/_src/state/primitives.py:1049— jax/_src/state/primitives.py:1049-1061 | jax/_src/state/primitives.py:1140-1152 — both copies are in the same file, so extract the block into 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) jax/experimental/sparse/coo.py:128— jax/experimental/sparse/coo.py:128-140 | jax/experimental/sparse/csr.py:96-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) jax/experimental/mosaic/gpu/dialect_lowering.py:1144— jax/experimental/mosaic/gpu/dialect_lowering.py:1144-1156 | jax/experimental/mosaic/gpu/dialect_lowering.py:1275-1287 — both copies are in the same file, so extract the block into 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) jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:81— jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:81-93 | jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py:118-130 — before extracting anything, compare `jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py` and `jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) jax/_src/cudnn/fused_attention_stablehlo.py:712— jax/_src/cudnn/fused_attention_stablehlo.py:712-723 | jax/_src/cudnn/fused_attention_stablehlo.py:799-810 — both copies are in the same file, so extract the block into 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) jax/_src/lax/windowed_reductions.py:762— jax/_src/lax/windowed_reductions.py:762-773 | jax/_src/lax/windowed_reductions.py:775-786 — both copies are in the same file, so extract the block into 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) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1591— jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1591-1602 | jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1614-1625 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1591` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) jax/_src/pallas/mosaic/lowering.py:4809— jax/_src/pallas/mosaic/lowering.py:4809-4820 | jax/_src/pallas/mosaic_gpu/lowering.py:3831-3844 — 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 (12 lines × 2) jax/_src/pallas/mosaic_gpu/torch.py:270— jax/_src/pallas/mosaic_gpu/torch.py:270-281 | jax/experimental/mosaic/gpu/core.py:1452-1463 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic_gpu/torch.py:270` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) jax/_src/scipy/linalg.py:166— jax/_src/scipy/linalg.py:166-177 | jax/_src/scipy/linalg.py:1343-1354 — both copies are in the same file, so extract the block into 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) jax/experimental/mosaic/gpu/layout_inference.py:810— jax/experimental/mosaic/gpu/layout_inference.py:810-821 | jax/experimental/mosaic/gpu/layout_inference.py:857-868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:1017— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:1017-1028 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:1082-1093 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) jax/_src/tpu/linalg/eigh.py:68— jax/_src/tpu/linalg/eigh.py:68-79 | jax/_src/tpu/linalg/qdwh.py:46-57 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) docs/_static/fault_tolerance/data_parallelism.py:53— docs/_static/fault_tolerance/data_parallelism.py:53-64 | docs/_static/fault_tolerance/data_parallelism_with_recovery.py:55-66 — before extracting anything, compare `docs/_static/fault_tolerance/data_parallelism.py` and `docs/_static/fault_tolerance/data_parallelism_with_recovery.py` as WHOLE FILES: this scan already matched 4 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) jax/_src/compute_on.py:350— jax/_src/compute_on.py:350-361 | jax/_src/pjit.py:1971-1982 — 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) jaxlib/tools/build_gpu_kernels_wheel.py:87— jaxlib/tools/build_gpu_kernels_wheel.py:87-98 | jaxlib/tools/build_gpu_plugin_wheel.py:90-102 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jaxlib/tools/build_gpu_kernels_wheel.py:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jaxlib/tools/build_gpu_kernels_wheel.py:83` calls `is_windows` and `jaxlib/tools/build_gpu_plugin_wheel.py:86` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Swallowed exception (empty catch) jax/experimental/mosaic/gpu/layout_inference.py:2637— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) jax/_src/api.py:2920— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) jax/_src/core.py:3673— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) jax/_src/dtypes.py:44— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) jax/_src/util.py:515— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:95— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:100— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) jax/_src/export/shape_poly.py:1769— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) jax/_src/export/shape_poly.py:1774— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) jax/_src/export/shape_poly.py:1782— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) jax/_src/export/shape_poly.py:1787— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×10
Edited copy of a member (17 corresponding lines) jax/_src/lax/other.py:257— jax/_src/lax/other.py:257-273 | jax/_src/lax/other.py:290-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) jax/_src/scipy/special.py:1203— jax/_src/scipy/special.py:1203-1219 | jax/_src/scipy/special.py:2327-2344 — 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) jax/_src/lax/slicing.py:2515— jax/_src/lax/slicing.py:2515-2531 | jax/_src/lax/slicing.py:3716-3733 — 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) jax/experimental/sparse/bcoo.py:2532— jax/experimental/sparse/bcoo.py:2532-2548 | jax/experimental/sparse/bcsr.py:885-901 — 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) jax/_src/export/shape_poly.py:343— jax/_src/export/shape_poly.py:343-359 | jax/_src/export/shape_poly.py:656-672 — 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) jax/_src/pallas/mosaic_gpu/interpret/jaxpr_interpret.py:377— jax/_src/pallas/mosaic_gpu/interpret/jaxpr_interpret.py:377-393 | jax/_src/pallas/mosaic_gpu/interpret/jaxpr_interpret.py:398-422 — 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) jax/_src/pallas/mosaic_gpu/core.py:1129— jax/_src/pallas/mosaic_gpu/core.py:1129-1147 | jax/_src/pallas/mosaic_gpu/core.py:1192-1208 — 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) jax/_src/lax/parallel.py:138— jax/_src/lax/parallel.py:138-154 | jax/_src/lax/parallel.py:2621-2639 — 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) jax/_src/pallas/mosaic/pipeline.py:1524— jax/_src/pallas/mosaic/pipeline.py:1524-1541 | jax/_src/pallas/mosaic/pipeline.py:1557-1573 — 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) jax/_src/numpy/indexing.py:1245— jax/_src/numpy/indexing.py:1245-1261 | jax/_src/numpy/indexing.py:1265-1284 — 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.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×10
Edited copy of a member (13 corresponding lines) jax/_src/core.py:2179— jax/_src/core.py:2179-2195 | jax/_src/named_sharding.py:404-416 — 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.
Edited copy of a member (13 corresponding lines) jax/_src/random/core.py:2337— jax/_src/random/core.py:2337-2349 | jax/_src/random/core.py:2895-2907 — 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.
Edited copy of a member (13 corresponding lines) jax/_src/random/prng.py:692— jax/_src/random/prng.py:692-705 | jax/_src/random/prng.py:965-977 — 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.
Edited copy of a member (13 corresponding lines) jax/_src/checkify.py:627— jax/_src/checkify.py:627-639 | jax/_src/checkify.py:645-657 — 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.
Edited copy of a member (13 corresponding lines) jax/_src/pallas/triton/lowering.py:1441— jax/_src/pallas/triton/lowering.py:1441-1453 | jax/_src/pallas/triton/lowering.py:1459-1471 — 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.
Edited copy of a member (13 corresponding lines) jax/_src/lax/windowed_reductions.py:219— jax/_src/lax/windowed_reductions.py:219-231 | jax/_src/lax/windowed_reductions.py:269-281 — 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.
Edited copy of a member (13 corresponding lines) jax/_src/lax/windowed_reductions.py:833— jax/_src/lax/windowed_reductions.py:833-845 | jax/_src/lax/windowed_reductions.py:981-995 — 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.
Edited copy of a member (13 corresponding lines) jax/experimental/jet.py:807— jax/experimental/jet.py:807-820 | jax/experimental/jet.py:824-836 — 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.
Edited copy of a member (13 corresponding lines) jax/experimental/mosaic/gpu/constraints.py:1278— jax/experimental/mosaic/gpu/constraints.py:1278-1290 | jax/experimental/mosaic/gpu/constraints.py:1296-1310 — 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.
Edited copy of a member (13 corresponding lines) jax/_src/lax/windowed_reductions.py:805— jax/_src/lax/windowed_reductions.py:805-817 | jax/_src/lax/windowed_reductions.py:939-951 — 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 (16 corresponding lines) · ×9
Edited copy of a member (16 corresponding lines) jax/_src/checkify.py:1138— jax/_src/checkify.py:1138-1155 | jax/_src/custom_derivatives.py:410-425 — 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) jax/_src/ad_checkpoint.py:1224— jax/_src/ad_checkpoint.py:1224-1242 | jax/_src/ad_checkpoint.py:1277-1292 — 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) jax/experimental/sparse/coo.py:128— jax/experimental/sparse/coo.py:128-143 | jax/experimental/sparse/csr.py:96-115 — 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) jax/_src/pallas/mosaic_gpu/lowering.py:2593— jax/_src/pallas/mosaic_gpu/lowering.py:2593-2611 | jax/_src/pallas/mosaic_gpu/lowering.py:2679-2694 — 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) jax/_src/pallas/mosaic_gpu/lowering.py:3218— jax/_src/pallas/mosaic_gpu/lowering.py:3218-3233 | jax/_src/pallas/mosaic_gpu/lowering.py:3245-3260 — 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) jax/_src/hijax.py:1418— jax/_src/hijax.py:1418-1433 | jax/_src/hijax.py:1436-1453 — 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) jax/_src/lax/lax.py:8340— jax/_src/lax/lax.py:8340-8356 | jax/_src/lax/lax.py:9716-9731 — 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) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:250— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:250-265 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1285-1314 — 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) jax/experimental/mosaic/gpu/dialect_lowering.py:2360— jax/experimental/mosaic/gpu/dialect_lowering.py:2360-2375 | jax/experimental/mosaic/gpu/dialect_lowering.py:2382-2398 — 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· Edited copy of a member (5 corresponding lines) · ×9
Edited copy of a member (5 corresponding lines) jax/experimental/sparse/bcoo.py:353— jax/experimental/sparse/bcoo.py:353-357 | jax/experimental/sparse/bcsr.py:261-265 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) jax/_src/lax/lax.py:8971— jax/_src/lax/lax.py:8971-8975 | jax/_src/lax/lax.py:9056-9061 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) jax/_src/lax/ann.py:295— jax/_src/lax/ann.py:295-299 | jax/_src/lax/lax.py:11126-11130 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) jax/experimental/mosaic/gpu/fragmented_array.py:159— jax/experimental/mosaic/gpu/fragmented_array.py:159-163 | jax/experimental/mosaic/gpu/fragmented_array.py:253-260 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) jax/_src/random/philox2x32.py:199— jax/_src/random/philox2x32.py:199-205 | jax/_src/random/threefry2x32.py:363-367 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) jax/experimental/sparse/bcsr.py:878— jax/experimental/sparse/bcsr.py:878-882 | jax/experimental/sparse/bcoo.py:2497-2501 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) jax/_src/earray.py:115— jax/_src/earray.py:115-119 | jax/_src/random/prng.py:505-509 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) jax/_src/pallas/mosaic/interpret/shared_memory.py:437— jax/_src/pallas/mosaic/interpret/shared_memory.py:437-441 | jax/_src/pallas/mosaic_gpu/interpret/shared_memory.py:913-917 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) jax/_src/api_util.py:74— jax/_src/api_util.py:74-78 | jax/_src/interpreters/batching.py:122-126 — These two members are one piece of code written twice and then edited apart: 5 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 (4 members, 50+ identical tokens) · ×8
Members sharing a duplicated core (4 members, 50+ identical tokens) jax/_src/compute_on.py:210— jax/_src/compute_on.py:210-258 | jax/_src/lax/eval_jaxpr.py:56-80 | jax/_src/program_order.py:253-282 | jax/_src/xla_metadata.py:394-440 — 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) jax/_src/cudnn/fused_attention_stablehlo.py:883— jax/_src/cudnn/fused_attention_stablehlo.py:883-941 | jax/_src/cudnn/fused_attention_stablehlo.py:946-1028 | jax/_src/cudnn/fused_attention_stablehlo.py:1722-1763 | jax/_src/cudnn/fused_attention_stablehlo.py:1767-1809 — 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) jax/_src/lax/slicing.py:3183— jax/_src/lax/slicing.py:3183-3220 | jax/_src/lax/slicing.py:3226-3267 | jax/_src/lax/slicing.py:3394-3517 | jax/_src/lax/slicing.py:3646-3693 — 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) jax/_src/pallas/mosaic/lowering.py:3695— jax/_src/pallas/mosaic/lowering.py:3695-3710 | jax/_src/pallas/mosaic/lowering.py:3717-3732 | jax/_src/pallas/mosaic/lowering.py:4053-4068 | jax/_src/pallas/mosaic/lowering.py:4075-4090 — 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) jax/_src/pallas/mosaic_gpu/primitives.py:4311— jax/_src/pallas/mosaic_gpu/primitives.py:4311-4330 | jax/_src/pallas/mosaic_gpu/primitives.py:4343-4381 | jax/_src/pallas/mosaic_gpu/primitives.py:4446-4476 | jax/_src/pallas/mosaic_gpu/primitives.py:4489-4531 — 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) jax/_src/scipy/fft.py:53— jax/_src/scipy/fft.py:53-140 | jax/_src/scipy/fft.py:163-270 | jax/_src/scipy/fft.py:275-377 | jax/_src/scipy/fft.py:384-495 — 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) jax/experimental/sparse/_lowerings.py:64— jax/experimental/sparse/_lowerings.py:64-79 | jax/experimental/sparse/_lowerings.py:117-132 | jax/experimental/sparse/_lowerings.py:190-205 | jax/experimental/sparse/_lowerings.py:242-257 — 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) jax/experimental/sparse/ad.py:82— jax/experimental/sparse/ad.py:82-105 | jax/experimental/sparse/ad.py:110-135 | jax/experimental/sparse/ad.py:140-158 | jax/experimental/sparse/ad.py:163-181 — 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.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×8
Edited copy of a member (14 corresponding lines) jax/_src/cudnn/fused_attention_stablehlo.py:436— jax/_src/cudnn/fused_attention_stablehlo.py:436-449 | jax/_src/cudnn/fused_attention_stablehlo.py:457-471 — 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.
Edited copy of a member (14 corresponding lines) jax/_src/lax/slicing.py:1592— jax/_src/lax/slicing.py:1592-1605 | jax/_src/lax/slicing.py:1782-1796 — 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.
Edited copy of a member (14 corresponding lines) jax/_src/scipy/stats/poisson.py:215— jax/_src/scipy/stats/poisson.py:215-231 | jax/_src/scipy/stats/poisson.py:234-247 — 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.
Edited copy of a member (14 corresponding lines) jax/experimental/mosaic/gpu/constraints.py:1316— jax/experimental/mosaic/gpu/constraints.py:1316-1332 | jax/experimental/mosaic/gpu/constraints.py:1347-1360 — 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.
Edited copy of a member (14 corresponding lines) jax/_src/pallas/mosaic/lowering.py:4243— jax/_src/pallas/mosaic/lowering.py:4243-4259 | jax/_src/pallas/mosaic/lowering.py:4324-4337 — 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.
Edited copy of a member (14 corresponding lines) jax/_src/pallas/mosaic/primitives.py:486— jax/_src/pallas/mosaic/primitives.py:486-503 | jax/_src/pallas/mosaic/primitives.py:724-737 — 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.
Edited copy of a member (14 corresponding lines) jax/_src/pallas/mosaic_gpu/interpret/jaxpr_interpret.py:1252— jax/_src/pallas/mosaic_gpu/interpret/jaxpr_interpret.py:1252-1265 | jax/_src/pallas/mosaic_gpu/interpret/jaxpr_interpret.py:1343-1357 — 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.
Edited copy of a member (14 corresponding lines) jax/_src/pallas/mosaic/primitives.py:1493— jax/_src/pallas/mosaic/primitives.py:1493-1514 | jax/_src/pallas/mosaic_gpu/primitives.py:1948-1961 — 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 (6 corresponding lines) · ×8
Edited copy of a member (6 corresponding lines) jax/_src/lax/lax.py:5881— jax/_src/lax/lax.py:5881-5886 | jax/_src/lax/lax.py:5938-5943 — These two members are one piece of code written twice and then edited apart: 6 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 (6 corresponding lines) jax/_src/numpy/lax_numpy.py:8501— jax/_src/numpy/lax_numpy.py:8501-8506 | jax/_src/numpy/lax_numpy.py:8562-8567 — These two members are one piece of code written twice and then edited apart: 6 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 (6 corresponding lines) jax/_src/cudnn/fused_attention_stablehlo.py:415— jax/_src/cudnn/fused_attention_stablehlo.py:415-420 | jax/_src/cudnn/fused_attention_stablehlo.py:423-428 — These two members are one piece of code written twice and then edited apart: 6 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 (6 corresponding lines) jax/_src/numpy/index_tricks.py:85— jax/_src/numpy/index_tricks.py:85-93 | jax/_src/numpy/index_tricks.py:130-135 — These two members are one piece of code written twice and then edited apart: 6 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 (6 corresponding lines) jax/_src/core.py:4459— jax/_src/core.py:4459-4464 | jax/_src/core.py:4468-4473 — These two members are one piece of code written twice and then edited apart: 6 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 (6 corresponding lines) jax/experimental/sparse/coo.py:436— jax/experimental/sparse/coo.py:436-441 | jax/experimental/sparse/coo.py:559-564 — These two members are one piece of code written twice and then edited apart: 6 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 (6 corresponding lines) docs/notebooks/shard_map.py:1434— docs/notebooks/shard_map.py:1434-1439 | docs/notebooks/shard_map.py:1519-1526 — These two members are one piece of code written twice and then edited apart: 6 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 (6 corresponding lines) jax/_src/numpy/ufuncs.py:1246— jax/_src/numpy/ufuncs.py:1246-1251 | jax/_src/numpy/ufuncs.py:1295-1301 — These two members are one piece of code written twice and then edited apart: 6 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 (4 corresponding lines) · ×8
Edited copy of a member (4 corresponding lines) jax/_src/interpreters/ad.py:980— jax/_src/interpreters/ad.py:980-983 | jax/_src/interpreters/ad.py:991-995 — These two members are one piece of code written twice and then edited apart: 4 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 (4 corresponding lines) jax/_src/interpreters/partial_eval.py:2479— jax/_src/interpreters/partial_eval.py:2479-2482 | jax/_src/stages.py:1017-1020 — These two members are one piece of code written twice and then edited apart: 4 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 (4 corresponding lines) jax/_src/lax/lax.py:9234— jax/_src/lax/lax.py:9234-9237 | jax/_src/pjit.py:3105-3108 — These two members are one piece of code written twice and then edited apart: 4 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 (4 corresponding lines) jax/_src/lax/control_flow/loops.py:3234— jax/_src/lax/control_flow/loops.py:3234-3237 | jax/_src/lax/lax.py:10285-10288 — These two members are one piece of code written twice and then edited apart: 4 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 (4 corresponding lines) jax/_src/lax/lax.py:8429— jax/_src/lax/lax.py:8429-8432 | jax/_src/lax/slicing.py:1713-1716 — These two members are one piece of code written twice and then edited apart: 4 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 (4 corresponding lines) jax/_src/callback.py:674— jax/_src/callback.py:674-677 | jax/_src/interpreters/pxla.py:266-284 — These two members are one piece of code written twice and then edited apart: 4 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 (4 corresponding lines) jax/_src/lax/lax.py:11616— jax/_src/lax/lax.py:11616-11619 | jax/_src/lax/slicing.py:1882-1885 — These two members are one piece of code written twice and then edited apart: 4 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 (4 corresponding lines) jax/_src/pallas/mpmd.py:658— jax/_src/pallas/mpmd.py:658-661 | jax/_src/pallas/pallas_call.py:146-149 — These two members are one piece of code written twice and then edited apart: 4 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 (14 lines × 2) docs/_static/fault_tolerance/data_parallelism.py:36— docs/_static/fault_tolerance/data_parallelism.py:36-49 | docs/_static/fault_tolerance/data_parallelism_with_recovery.py:38-51 — before extracting anything, compare `docs/_static/fault_tolerance/data_parallelism.py` and `docs/_static/fault_tolerance/data_parallelism_with_recovery.py` as WHOLE FILES: this scan already matched 4 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14 lines × 2) jax/_src/pallas/mosaic/lowering.py:6181— jax/_src/pallas/mosaic/lowering.py:6181-6194 | jax/_src/pallas/mosaic_gpu/lowering.py:4545-4558 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) jax/_src/pallas/mosaic_gpu/pipeline.py:821— jax/_src/pallas/mosaic_gpu/pipeline.py:821-834 | jax/_src/pallas/mosaic_gpu/pipeline.py:906-919 — both copies are in the same file, so extract the block into 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) jax/_src/pallas/mosaic_gpu/primitives.py:217— jax/_src/pallas/mosaic_gpu/primitives.py:217-230 | jax/_src/pallas/mosaic_gpu/primitives.py:842-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 (14 lines × 2) jax/_src/shard_map.py:586— jax/_src/shard_map.py:586-599 | jax/_src/shard_map.py:629-642 — both copies are in the same file, so extract the block into 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) jax/experimental/pallas/ops/tpu/flash_attention.py:405— jax/experimental/pallas/ops/tpu/flash_attention.py:405-418 | jax/experimental/pallas/ops/tpu/flash_attention.py:1193-1207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/flash_attention.py:405` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) jax/experimental/mosaic/gpu/examples/flash_attention.py:164— jax/experimental/mosaic/gpu/examples/flash_attention.py:164-177 | jax/experimental/mosaic/gpu/examples/flash_attention.py:365-378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jax/experimental/mosaic/gpu/examples/flash_attention.py:364` calls `get_signless` and `jax/experimental/mosaic/gpu/examples/flash_attention.py:163` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) jax/experimental/mosaic/gpu/examples/flash_attention.py:272— jax/experimental/mosaic/gpu/examples/flash_attention.py:272-285 | jax/experimental/mosaic/gpu/examples/flash_attention.py:496-509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jax/experimental/mosaic/gpu/examples/flash_attention.py:271` calls `arrive` and `jax/experimental/mosaic/gpu/examples/flash_attention.py:495` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×7
Edited copy of a member (12 corresponding lines) docs/401/cute_dsl_jax/cute_dsl_jax_kernels.py:60— docs/401/cute_dsl_jax/cute_dsl_jax_kernels.py:60-71 | docs/401/cute_dsl_jax/cute_dsl_jax_kernels.py:91-102 — 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.
Edited copy of a member (12 corresponding lines) jax/_src/ad_checkpoint.py:569— jax/_src/ad_checkpoint.py:569-584 | jax/_src/program_order.py:236-247 — 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.
Edited copy of a member (12 corresponding lines) jax/_src/random/philox2x32.py:142— jax/_src/random/philox2x32.py:142-156 | jax/_src/random/threefry2x32.py:63-74 — 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.
Edited copy of a member (12 corresponding lines) jax/_src/lax/lax.py:8978— jax/_src/lax/lax.py:8978-8999 | jax/_src/lax/lax.py:9071-9082 — 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.
Edited copy of a member (12 corresponding lines) jax/_src/random/philox4x32.py:227— jax/_src/random/philox4x32.py:227-238 | jax/_src/random/threefry4x32.py:298-309 — 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.
Edited copy of a member (12 corresponding lines) jax/_src/interpreters/mlir.py:1244— jax/_src/interpreters/mlir.py:1244-1255 | jax/_src/interpreters/mlir.py:1261-1272 — 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.
Edited copy of a member (12 corresponding lines) jax/_src/mesh_utils.py:484— jax/_src/mesh_utils.py:484-495 | jax/experimental/mosaic/gpu/layout_inference.py:1006-1022 — 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 (24 corresponding lines) · ×7
Edited copy of a member (24 corresponding lines) jax/experimental/array_serialization/pytree_serialization.py:203— jax/experimental/array_serialization/pytree_serialization.py:203-227 | jax/experimental/array_serialization/pytree_serialization.py:360-383 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) jax/_src/callback.py:606— jax/_src/callback.py:606-629 | jax/_src/callback.py:641-670 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) jax/_src/pjit.py:773— jax/_src/pjit.py:773-797 | jax/_src/pjit.py:805-828 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) jax/_src/scipy/special.py:4123— jax/_src/scipy/special.py:4123-4146 | jax/_src/scipy/special.py:4150-4174 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) jax/_src/state/primitives.py:725— jax/_src/state/primitives.py:725-751 | jax/_src/state/primitives.py:756-779 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) jax/_src/pallas/mosaic_gpu/primitives.py:5881— jax/_src/pallas/mosaic_gpu/primitives.py:5881-5904 | jax/_src/pallas/primitives.py:981-1016 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) jax/_src/numpy/linalg.py:1036— jax/_src/numpy/linalg.py:1036-1083 | jax/_src/random/core.py:244-267 — These two members are one piece of code written twice and then edited apart: 24 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 (23 corresponding lines) · ×6
Edited copy of a member (23 corresponding lines) jax/_src/interpreters/partial_eval.py:2491— jax/_src/interpreters/partial_eval.py:2491-2513 | jax/_src/program_order.py:311-343 — These two members are one piece of code written twice and then edited apart: 23 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 (23 corresponding lines) jax/experimental/sparse/coo.py:459— jax/experimental/sparse/coo.py:459-481 | jax/experimental/sparse/coo.py:580-602 — These two members are one piece of code written twice and then edited apart: 23 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 (23 corresponding lines) jax/_src/lax/ann.py:423— jax/_src/lax/ann.py:423-454 | jax/_src/lax/lax.py:11133-11155 — These two members are one piece of code written twice and then edited apart: 23 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 (23 corresponding lines) jax/_src/pallas/mosaic/primitives.py:418— jax/_src/pallas/mosaic/primitives.py:418-440 | jax/_src/pallas/mosaic/primitives.py:660-684 — These two members are one piece of code written twice and then edited apart: 23 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 (23 corresponding lines) jax/_src/pallas/mosaic/lowering.py:6179— jax/_src/pallas/mosaic/lowering.py:6179-6202 | jax/_src/pallas/mosaic_gpu/lowering.py:4545-4567 — These two members are one piece of code written twice and then edited apart: 23 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 (23 corresponding lines) jax/_src/numpy/lax_numpy.py:6177— jax/_src/numpy/lax_numpy.py:6177-6211 | jax/_src/scipy/special.py:2601-2623 — These two members are one piece of code written twice and then edited apart: 23 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 (17 lines × 2) jax/_src/pallas/mosaic/lowering.py:3033— jax/_src/pallas/mosaic/lowering.py:3033-3049 | jax/_src/pallas/mosaic/lowering.py:3244-3260 — both copies are in the same file, so extract the block into 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) jax/_src/pallas/mosaic/sc_lowering.py:669— jax/_src/pallas/mosaic/sc_lowering.py:669-685 | jax/_src/pallas/mosaic/sc_lowering.py:785-801 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic/sc_lowering.py:669` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) jax/_src/pallas/mosaic/sc_primitives.py:426— jax/_src/pallas/mosaic/sc_primitives.py:426-442 | jax/_src/pallas/mosaic/sc_primitives.py:454-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 (17 lines × 2) jax/_src/pallas/pallas_call.py:619— jax/_src/pallas/pallas_call.py:619-635 | jax/_src/pallas/pallas_call.py:657-673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:364— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:364-380 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:563-579 — both copies are in the same file, so extract the block into 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) jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:205— jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:205-221 | jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py:227-243 — before extracting anything, compare `jax/experimental/pallas/ops/gpu/all_gather_mgpu.py` and `jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) jax/_src/config.py:563— jax/_src/config.py:563-578 | jax/_src/config.py:706-721 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/config.py:563` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) jax/_src/custom_derivatives.py:135— jax/_src/custom_derivatives.py:135-150 | jax/_src/custom_derivatives.py:564-579 — both copies are in the same file, so extract the block into 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) jax/_src/pallas/hlo_interpreter.py:123— jax/_src/pallas/hlo_interpreter.py:123-138 | jax/_src/pallas/mosaic/interpret/utils.py:61-78 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/hlo_interpreter.py:123` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) jax/_src/state/primitives.py:982— jax/_src/state/primitives.py:982-997 | jax/_src/state/primitives.py:1076-1091 — both copies are in the same file, so extract the block into 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) jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:182— jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:182-197 | jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py:203-218 — before extracting anything, compare `jax/experimental/pallas/ops/gpu/all_gather_mgpu.py` and `jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) jax/experimental/pallas/ops/gpu/attention_mgpu.py:242— jax/experimental/pallas/ops/gpu/attention_mgpu.py:242-257 | jax/experimental/pallas/ops/gpu/attention_mgpu.py:715-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 (10–11 lines × 2) jax/_src/cudnn/fused_attention_stablehlo.py:552— jax/_src/cudnn/fused_attention_stablehlo.py:552-561 | jax/_src/cudnn/fused_attention_stablehlo.py:580-590 — both copies are in the same file, so extract the block into 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) jax/_src/custom_derivatives.py:345— jax/_src/custom_derivatives.py:345-354 | jax/_src/hijax.py:1443-1453 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/custom_derivatives.py:345` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) jax/_src/custom_partitioning.py:537— jax/_src/custom_partitioning.py:537-546 | jax/_src/debugging.py:773-783 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/custom_partitioning.py:537` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) jax/_src/lax/convolution.py:692— jax/_src/lax/convolution.py:692-702 | jax/_src/lax/convolution.py:728-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 (10–11 lines × 2) jax/_src/lax/parallel.py:2312— jax/_src/lax/parallel.py:2312-2321 | jax/_src/lax/parallel.py:2902-2912 — both copies are in the same file, so extract the block into 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) jax/_src/lax/slicing.py:3162— jax/_src/lax/slicing.py:3162-3171 | jax/_src/lax/slicing.py:3400-3410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Change coupling: sc_core.py ↔ tpu_sc.py jax/_src/pallas/mosaic/sc_core.py:1— `jax/_src/pallas/mosaic/sc_core.py` and `jax/experimental/pallas/tpu_sc.py` change together 69% of the time (11 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `6ee8c036` [Pallas SC] Add slice_subcore_vmem_from_shared.; `23e25acb` [pallas:sc] Allow specifying sem=None and wait_write() for streams on…; `22b253fa` [pallas:sc] Removed unused `plsc.MemoryRef` — run `git show` on any of them.
Change coupling: jet.py ↔ transform.py jax/experimental/jet.py:1— `jax/experimental/jet.py` and `jax/experimental/sparse/transform.py` change together 61% of the time (11 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `1bd05a49` Add jax.lax.exp2m1 and log2p1.; `a194ad53` Add jax.lax.asinpi, acospi, atanpi, and atan2pi.; `a024fff0` Add jax.lax.sinpi, cospi, and tanpi. — run `git show` on any of them.
Change coupling: conditionals.py ↔ fuser_utils.py jax/_src/lax/control_flow/conditionals.py:1— `jax/_src/lax/control_flow/conditionals.py` and `jax/_src/pallas/fuser/fuser_utils.py` change together 57% of the time (8 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `fefdef27` Explicitly propagate and specify strip_memory_space in state discharg…; `ed98c34b` Remove Jaxpr._num_consts; `10ae8c8b` rollback of rollback of ClosedJaxpr/Jaxpr merge — run `git show` on any of them.
Change coupling: lowering.py ↔ torch.py jax/_src/pallas/mosaic_gpu/lowering.py:1— `jax/_src/pallas/mosaic_gpu/lowering.py` and `jax/_src/pallas/mosaic_gpu/torch.py` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 6 shared commits counted here, the most recent 3 are `efd5e0f5` Removed the now-obsolete workarounds for pytype; `0e99acff` Removed more leftover pytype suppressions; `dd118091` Even more Pyrefly fixes — run `git show` on any of them.
Change coupling: abstract_arrays.py ↔ mlir.py jax/_src/abstract_arrays.py:1— `jax/_src/abstract_arrays.py` and `jax/_src/interpreters/mlir.py` change together 52% of the time (11 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `b48ff81c` Add complex32 and bcomplex32 dtypes to JAX.; `bf18f5e1` Add avals to TypedNdArray and TypedInt/TypedFloat/TypedComplex.; `e78a6714` Remove stale version guards following JAX 0.9.2 release. — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×5
Edited copy of a member (18 corresponding lines) jax/_src/lax/parallel.py:1308— jax/_src/lax/parallel.py:1308-1326 | jax/_src/lax/parallel.py:1444-1461 — 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) jax/_src/lax/fft.py:247— jax/_src/lax/fft.py:247-264 | jax/_src/lax/fft.py:271-288 — 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) jax/_src/lax/erf.py:761— jax/_src/lax/erf.py:761-788 | jax/_src/lax/erf.py:792-809 — 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) jax/experimental/mosaic/gpu/layout_inference.py:1426— jax/experimental/mosaic/gpu/layout_inference.py:1426-1443 | jax/experimental/mosaic/gpu/layout_inference.py:1482-1502 — 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) jax/_src/pallas/mosaic/sc_primitives.py:426— jax/_src/pallas/mosaic/sc_primitives.py:426-444 | jax/_src/pallas/mosaic/sc_primitives.py:454-471 — 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.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×5
Edited copies of one member (3 members, 9+ corresponding lines) jax/_src/lax/eval_jaxpr.py:119— jax/_src/lax/eval_jaxpr.py:119-127 | jax/_src/pjit.py:1707-1717 | jax/_src/program_order.py:380-391 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) jax/_src/pallas/mosaic/lowering.py:3645— jax/_src/pallas/mosaic/lowering.py:3645-3653 | jax/_src/pallas/mosaic/lowering.py:3987-4000 | jax/_src/pallas/mosaic/lowering.py:4007-4024 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) jax/_src/state/discharge.py:501— jax/_src/state/discharge.py:501-509 | jax/_src/state/discharge.py:650-660 | jax/_src/state/discharge.py:670-680 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) jax/_src/lax/windowed_reductions.py:204— jax/_src/lax/windowed_reductions.py:204-212 | jax/_src/lax/windowed_reductions.py:238-246 | jax/_src/lax/windowed_reductions.py:253-261 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) jax/_src/lax/lax.py:8376— jax/_src/lax/lax.py:8376-8387 | jax/_src/lax/slicing.py:1445-1453 | jax/_src/pjit.py:2570-2580 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×5
Edited copy of a member (3 corresponding lines) jax/experimental/sparse/bcoo.py:455— jax/experimental/sparse/bcoo.py:455-458 | jax/experimental/sparse/bcsr.py:411-413 — These two members are one piece of code written twice and then edited apart: 3 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 (3 corresponding lines) jax/_src/lax/erf.py:1811— jax/_src/lax/erf.py:1811-1813 | jax/_src/scipy/special.py:1227-1229 — These two members are one piece of code written twice and then edited apart: 3 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 (3 corresponding lines) jax/_src/lax/ann.py:262— jax/_src/lax/ann.py:262-264 | jax/_src/lax/lax.py:11109-11111 — These two members are one piece of code written twice and then edited apart: 3 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 (3 corresponding lines) jax/_src/lax/slicing.py:3706— jax/_src/lax/slicing.py:3706-3708 | jax/_src/lax/windowed_reductions.py:483-485 — These two members are one piece of code written twice and then edited apart: 3 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 (3 corresponding lines) examples/spmd_mnist_classifier_fromscratch.py:54— examples/spmd_mnist_classifier_fromscratch.py:54-57 | jax/experimental/jax2tf/examples/mnist_lib.py:156-158 — These two members are one piece of code written twice and then edited apart: 3 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 (7–8 lines × 2) jax/_src/cudnn/fused_attention_stablehlo.py:1006— jax/_src/cudnn/fused_attention_stablehlo.py:1006-1013 | jax/_src/cudnn/fused_attention_stablehlo.py:1801-1807 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/cudnn/fused_attention_stablehlo.py:1006` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) jax/_src/lax/ann.py:360— jax/_src/lax/ann.py:360-366 | jax/_src/tpu_custom_call.py:451-458 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/tpu_custom_call.py:451` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) jax/_src/lax/eval_jaxpr.py:73— jax/_src/lax/eval_jaxpr.py:73-80 | jax/_src/program_order.py:276-282 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7–8 lines × 2) jax/experimental/pallas/ops/tpu/flash_attention.py:423— jax/experimental/pallas/ops/tpu/flash_attention.py:423-430 | jax/experimental/pallas/ops/tpu/flash_attention.py:1211-1217 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/flash_attention.py:423` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) jaxlib/gpu_rnn.py:60— jaxlib/gpu_rnn.py:60-67 | jaxlib/gpu_rnn.py:107-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.
TooManyMethods: _DimExpr jax/_src/export/shape_poly.py:421— TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× 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: Tracer jax/_src/core.py:922— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.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: GPUSharedMemory jax/_src/pallas/mosaic_gpu/interpret/shared_memory.py:440— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.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: ArrayImpl jax/_src/array.py:213— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× 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· Edited copy of a member (26 corresponding lines) · ×4
Edited copy of a member (26 corresponding lines) jax/_src/interpreters/ad.py:87— jax/_src/interpreters/ad.py:87-119 | jax/_src/interpreters/remat.py:140-165 — 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) jax/experimental/mosaic/gpu/layout_inference.py:795— jax/experimental/mosaic/gpu/layout_inference.py:795-821 | jax/experimental/mosaic/gpu/layout_inference.py:843-868 — 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) jax/experimental/roofline/rooflines.py:487— jax/experimental/roofline/rooflines.py:487-516 | jax/experimental/roofline/rooflines.py:682-707 — 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) jax/_src/scipy/stats/expon.py:246— jax/_src/scipy/stats/expon.py:246-275 | jax/_src/scipy/stats/uniform.py:121-146 — 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 (19 corresponding lines) · ×4
Edited copy of a member (19 corresponding lines) jax/_src/lax/convolution.py:756— jax/_src/lax/convolution.py:756-774 | jax/_src/lax/lax.py:7303-7323 — 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) jax/experimental/pallas/ops/tpu/random/philox.py:159— jax/experimental/pallas/ops/tpu/random/philox.py:159-182 | jax/experimental/pallas/ops/tpu/random/threefry.py:91-109 — 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) jax/_src/state/discharge.py:944— jax/_src/state/discharge.py:944-962 | jax/_src/state/discharge.py:965-985 — 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) jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:866— jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:866-884 | jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:1188-1207 — 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 (20 corresponding lines) · ×4
Edited copy of a member (20 corresponding lines) jax/_src/interpreters/partial_eval.py:439— jax/_src/interpreters/partial_eval.py:439-458 | jax/_src/interpreters/partial_eval.py:464-483 — 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.
Edited copy of a member (20 corresponding lines) jax/_src/pallas/mosaic/sc_primitives.py:122— jax/_src/pallas/mosaic/sc_primitives.py:122-141 | jax/_src/pallas/mosaic/sc_primitives.py:357-379 — 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.
Edited copy of a member (20 corresponding lines) jax/_src/pallas/hlo_interpreter.py:123— jax/_src/pallas/hlo_interpreter.py:123-142 | jax/_src/pallas/mosaic/interpret/utils.py:61-82 — 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.
Edited copy of a member (20 corresponding lines) jax/experimental/sparse/bcoo.py:250— jax/experimental/sparse/bcoo.py:250-269 | jax/experimental/sparse/bcsr.py:183-202 — 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· Edited copy of a member (22 corresponding lines) · ×4
Edited copy of a member (22 corresponding lines) jax/_src/cudnn/fused_attention_stablehlo.py:552— jax/_src/cudnn/fused_attention_stablehlo.py:552-573 | jax/_src/cudnn/fused_attention_stablehlo.py:580-608 — 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) jax/_src/random/philox4x32.py:153— jax/_src/random/philox4x32.py:153-174 | jax/_src/random/threefry4x32.py:206-228 — 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) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1184— jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1184-1206 | jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1259-1280 — 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) jax/_src/lax/erf.py:951— jax/_src/lax/erf.py:951-972 | jax/_src/lax/erf.py:976-999 — 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 copies of one member (3 members, 7+ corresponding lines) · ×4
Edited copies of one member (3 members, 7+ corresponding lines) jax/_src/nn/functions.py:575— jax/_src/nn/functions.py:575-610 | jax/_src/ops/special.py:79-85 | jax/_src/ops/special.py:102-108 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) jax/experimental/mosaic/gpu/dialect_lowering.py:1501— jax/experimental/mosaic/gpu/dialect_lowering.py:1501-1507 | jax/experimental/mosaic/gpu/dialect_lowering.py:1585-1593 | jax/experimental/mosaic/gpu/dialect_lowering.py:1610-1618 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) jax/experimental/mosaic/gpu/utils.py:2465— jax/experimental/mosaic/gpu/utils.py:2465-2474 | jax/experimental/mosaic/gpu/utils.py:2478-2487 | jax/experimental/mosaic/gpu/utils.py:2491-2497 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) jax/experimental/sparse/bcsr.py:367— jax/experimental/sparse/bcsr.py:367-373 | jax/experimental/sparse/coo.py:259-265 | jax/experimental/sparse/csr.py:286-292 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (20 lines × 2) docs/_static/fault_tolerance/data_parallelism.py:106— docs/_static/fault_tolerance/data_parallelism.py:106-125 | docs/_static/fault_tolerance/data_parallelism_with_recovery.py:159-178 — before extracting anything, compare `docs/_static/fault_tolerance/data_parallelism.py` and `docs/_static/fault_tolerance/data_parallelism_with_recovery.py` as WHOLE FILES: this scan already matched 4 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. If that is what happened, the fix is to keep one copy and have the other call 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) jax/_src/pallas/core.py:1482— jax/_src/pallas/core.py:1482-1501 | jax/_src/pallas/core.py:1508-1527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/core.py:1482` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) jax/_src/tpu_info.py:483— jax/_src/tpu_info.py:483-502 | jax/_src/tpu_info.py:510-529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/tpu_info.py:483` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:995— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:995-1014 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:1060-1079 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:995` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) jax/_src/ffi.py:509— jax/_src/ffi.py:509-517 | jax/_src/ffi.py:518-527 — both copies are in the same file, so extract the block into 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) jax/_src/lax/parallel.py:3137— jax/_src/lax/parallel.py:3137-3145 | jax/_src/lax/parallel.py:3186-3195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/lax/parallel.py:3186` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) jax/_src/lax/windowed_reductions.py:833— jax/_src/lax/windowed_reductions.py:833-842 | jax/_src/lax/windowed_reductions.py:981-989 — both copies are in the same file, so extract the block into 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) jax/_src/pallas/mosaic/lowering.py:3267— jax/_src/pallas/mosaic/lowering.py:3267-3275 | jax/_src/pallas/mosaic/primitives.py:1737-1746 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic/primitives.py:1737` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) jax/_src/pallas/triton/lowering.py:515— jax/_src/pallas/triton/lowering.py:515-522 | jax/_src/pallas/triton/primitives.py:410-417 | jax/_src/pallas/triton/primitives.py:666-673 — 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 lines × 3) jax/_src/random/core.py:2085— jax/_src/random/core.py:2085-2092 | jax/_src/random/core.py:2536-2543 | jax/_src/random/core.py:2601-2608 — 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) jax/_src/state/primitives.py:925— jax/_src/state/primitives.py:925-932 | jax/_src/state/primitives.py:1009-1016 | jax/_src/state/primitives.py:1100-1107 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/state/primitives.py:925` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) jax/_src/random/philox2x32.py:211— jax/_src/random/philox2x32.py:211-218 | jax/_src/random/philox4x32.py:244-251 | jax/_src/random/threefry4x32.py:315-332 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6–7 lines × 2) jax/_src/compute_on.py:408— jax/_src/compute_on.py:408-414 | jax/_src/xla_metadata.py:521-526 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/compute_on.py:408` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6–7 lines × 2) jax/_src/lax/lax.py:10273— jax/_src/lax/lax.py:10273-10279 | jax/_src/lax/slicing.py:3787-3792 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/lax/lax.py:10273` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6–7 lines × 2) jax/_src/numpy/linalg.py:517— jax/_src/numpy/linalg.py:517-523 | jax/_src/numpy/linalg.py:634-639 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/numpy/linalg.py:517` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6–7 lines × 2) jax/_src/state/discharge.py:945— jax/_src/state/discharge.py:945-951 | jax/_src/state/discharge.py:966-971 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Unstable project //jax/_src/pallas/mosaic_gpu:helpers — //jax/_src/pallas/mosaic_gpu:helpers has instability 0.86 with 1 dependents.
Unstable project //jax/_src/pallas/mosaic_gpu:layout_rules — //jax/_src/pallas/mosaic_gpu:layout_rules has instability 0.83 with 1 dependents.
Unstable project //jax/_src/pallas/mosaic_gpu:lowering — //jax/_src/pallas/mosaic_gpu:lowering has instability 0.88 with 3 dependents.
Unstable project //jax/_src/pallas/mosaic_gpu:pallas_call_registration — //jax/_src/pallas/mosaic_gpu:pallas_call_registration has instability 0.82 with 2 dependents.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×4
Recursive walk over a caller-supplied document has no depth cap jax/_src/state/types.py:316— `apply_transform` is public and takes `ref_or_view: Any` from its caller, and it calls itself at line 316 (`apply_transform`) with a piece of `ref_or_view` — and nowhere in `apply_transform` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `apply_transform` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap jax/_src/numpy/array_constructors.py:307— `array` is public and takes `object: Any` from its caller, and it calls itself at line 307 (`array`) with a piece of `object` — and nowhere in `array` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `array` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap jax/_src/lax/_reduction_order.py:133— `dot_general` is public, takes a document from its caller (line 42) and hands it to `_eval_dot`, which calls itself at line 133 (`_eval_dot`) with a piece of `out_s` — and nowhere in `_eval_dot` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_eval_dot` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap jax/_src/lax/_reduction_order.py:424— `ragged_dot_general` is public, takes a document from its caller (line 375) and hands it to `_eval_ragged_dot`, which calls itself at line 424 (`_eval_ragged_dot`) with a piece of `out_s` — and nowhere in `_eval_ragged_dot` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_eval_ragged_dot` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D4 · Code Duplication· Edited copy of a member (55 corresponding lines) · ×3
Edited copy of a member (55 corresponding lines) jax/_src/scipy/bessel.py:1502— jax/_src/scipy/bessel.py:1502-1565 | jax/_src/scipy/bessel.py:2464-2518 — 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.
Edited copy of a member (55 corresponding lines) jax/_src/numpy/reductions.py:2454— jax/_src/numpy/reductions.py:2454-2508 | jax/_src/numpy/reductions.py:2516-2570 — 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.
Edited copy of a member (55 corresponding lines) jax/_src/numpy/lax_numpy.py:6951— jax/_src/numpy/lax_numpy.py:6951-7005 | jax/_src/numpy/lax_numpy.py:7010-7064 — 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 (38 corresponding lines) · ×3
Edited copy of a member (38 corresponding lines) jax/_src/interpreters/partial_eval.py:1876— jax/_src/interpreters/partial_eval.py:1876-1913 | jax/_src/interpreters/partial_eval.py:1920-1966 — These two members are one piece of code written twice and then edited apart: 38 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 (38 corresponding lines) jax/_src/scipy/stats/pareto.py:28— jax/_src/scipy/stats/pareto.py:28-68 | jax/_src/scipy/stats/pareto.py:156-193 — These two members are one piece of code written twice and then edited apart: 38 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 (38 corresponding lines) jax/_src/random/core.py:2045— jax/_src/random/core.py:2045-2093 | jax/_src/random/core.py:4723-4760 — These two members are one piece of code written twice and then edited apart: 38 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 (40 corresponding lines) · ×3
Edited copy of a member (40 corresponding lines) jax/_src/pallas/mosaic/interpret/utils.py:157— jax/_src/pallas/mosaic/interpret/utils.py:157-196 | jax/_src/pallas/primitives.py:1206-1254 — These two members are one piece of code written twice and then edited apart: 40 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 (40 corresponding lines) jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:813— jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:813-852 | jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:1130-1173 — These two members are one piece of code written twice and then edited apart: 40 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 (40 corresponding lines) jax/experimental/multihost_utils.py:298— jax/experimental/multihost_utils.py:298-383 | jax/experimental/multihost_utils.py:462-501 — These two members are one piece of code written twice and then edited apart: 40 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 (30 corresponding lines) · ×3
Edited copy of a member (30 corresponding lines) jax/_src/lax/lax.py:9467— jax/_src/lax/lax.py:9467-9496 | jax/_src/lax/lax.py:9505-9541 — These two members are one piece of code written twice and then edited apart: 30 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 (30 corresponding lines) jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:2122— jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:2122-2151 | jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:2164-2194 — These two members are one piece of code written twice and then edited apart: 30 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 (30 corresponding lines) jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:1598— jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:1598-1629 | jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:1661-1690 — These two members are one piece of code written twice and then edited apart: 30 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) jax/_src/ad_checkpoint.py:1089— jax/_src/ad_checkpoint.py:1089-1113 | jax/_src/ad_checkpoint.py:1144-1164 — 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) jax/_src/pallas/mosaic_gpu/primitives.py:5784— jax/_src/pallas/mosaic_gpu/primitives.py:5784-5804 | jax/_src/pallas/mosaic_gpu/primitives.py:5995-6016 — 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) jax/example_libraries/stax.py:68— jax/example_libraries/stax.py:68-88 | jax/example_libraries/stax.py:95-115 — 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.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×3
Edited copy of a member (31 corresponding lines) jax/_src/lax/parallel.py:2244— jax/_src/lax/parallel.py:2244-2274 | jax/_src/lax/parallel.py:2493-2523 — 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.
Edited copy of a member (31 corresponding lines) jax/_src/scipy/special.py:4180— jax/_src/scipy/special.py:4180-4210 | jax/_src/scipy/special.py:4531-4562 — 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.
Edited copy of a member (31 corresponding lines) jax/_src/scipy/stats/bernoulli.py:26— jax/_src/scipy/stats/bernoulli.py:26-62 | jax/_src/scipy/stats/geom.py:26-56 — 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 (43 corresponding lines) · ×3
Edited copy of a member (43 corresponding lines) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:984— jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:984-1026 | jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1029-1073 — These two members are one piece of code written twice and then edited apart: 43 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 (43 corresponding lines) jax/_src/random/core.py:1203— jax/_src/random/core.py:1203-1245 | jax/_src/random/core.py:1638-1690 — These two members are one piece of code written twice and then edited apart: 43 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 (43 corresponding lines) jax/_src/numpy/array_creation.py:53— jax/_src/numpy/array_creation.py:53-95 | jax/_src/numpy/array_creation.py:102-144 — These two members are one piece of code written twice and then edited apart: 43 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 copies of one member (3 members, 8+ corresponding lines) · ×3
Edited copies of one member (3 members, 8+ corresponding lines) jax/experimental/jet.py:406— jax/experimental/jet.py:406-416 | jax/experimental/jet.py:509-516 | jax/experimental/jet.py:520-529 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) jax/_src/stages.py:861— jax/_src/stages.py:861-869 | jax/_src/stages.py:892-899 | jax/_src/stages.py:913-920 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) jax/experimental/sparse/coo.py:344— jax/experimental/sparse/coo.py:344-351 | jax/experimental/sparse/csr.py:269-277 | jax/experimental/sparse/csr.py:377-384 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×3
Edited copy of a member (35 corresponding lines) jax/_src/api.py:2835— jax/_src/api.py:2835-2869 | jax/_src/api.py:2872-2908 — These two members are one piece of code written twice and then edited apart: 35 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 (35 corresponding lines) jax/_src/scipy/stats/expon.py:25— jax/_src/scipy/stats/expon.py:25-59 | jax/_src/scipy/stats/expon.py:137-172 — These two members are one piece of code written twice and then edited apart: 35 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 (35 corresponding lines) jax/_src/lax/parallel.py:430— jax/_src/lax/parallel.py:430-464 | jax/_src/lax/parallel.py:468-505 — These two members are one piece of code written twice and then edited apart: 35 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) · ×3
Edited copy of a member (32 corresponding lines) jax/_src/scipy/stats/cauchy.py:27— jax/_src/scipy/stats/cauchy.py:27-58 | jax/_src/scipy/stats/cauchy.py:93-126 — 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.
Edited copy of a member (32 corresponding lines) jax/_src/random/core.py:4124— jax/_src/random/core.py:4124-4159 | jax/_src/random/core.py:4180-4211 — 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.
Edited copy of a member (32 corresponding lines) jax/_src/scipy/stats/expon.py:97— jax/_src/scipy/stats/expon.py:97-133 | jax/_src/scipy/stats/gamma.py:173-204 — 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.
Duplicated block (22 lines × 2) jax/_src/pallas/triton/lowering.py:2101— jax/_src/pallas/triton/lowering.py:2101-2122 | jax/_src/pallas/triton/lowering.py:2324-2345 — both copies are in the same file, so extract the block into 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) jax/_src/scipy/fft.py:235— jax/_src/scipy/fft.py:235-256 | jax/_src/scipy/fft.py:463-484 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/scipy/fft.py:235` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) jax/experimental/pallas/ops/gpu/attention_mgpu.py:81— jax/experimental/pallas/ops/gpu/attention_mgpu.py:81-102 | jax/experimental/pallas/ops/gpu/attention_mgpu.py:657-678 — both copies are in the same file, so extract the block into 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) jax/_src/callback.py:82— jax/_src/callback.py:82-102 | jax/_src/callback.py:421-441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21 lines × 2) jax/experimental/pallas/ops/tpu/flash_attention.py:1120— jax/experimental/pallas/ops/tpu/flash_attention.py:1120-1140 | jax/experimental/pallas/ops/tpu/flash_attention.py:1455-1475 — both copies are in the same file, so extract the block into 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) jax/experimental/pallas/ops/tpu/random/philox.py:83— jax/experimental/pallas/ops/tpu/random/philox.py:83-104 | jax/experimental/pallas/ops/tpu/random/threefry.py:34-54 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:655— jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:655-673 | jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:788-806 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:787` calls `array` and `jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:654` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (19 lines × 2) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1959— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1959-1977 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:2052-2070 — both copies are in the same file, so extract the block into 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) jax/_src/interpreters/ad.py:594— jax/_src/interpreters/ad.py:594-612 | jax/_src/interpreters/ad.py:784-802 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) jax/_src/mesh_utils.py:119— jax/_src/mesh_utils.py:119-136 | jax/_src/mesh_utils.py:168-185 — both copies are in the same file, so extract the block into 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) jax/_src/pallas/mosaic_gpu/interpret/shared_memory.py:701— jax/_src/pallas/mosaic_gpu/interpret/shared_memory.py:701-718 | jax/_src/pallas/mosaic_gpu/interpret/shared_memory.py:839-856 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic_gpu/interpret/shared_memory.py:701` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) jax/experimental/sparse/bcoo.py:273— jax/experimental/sparse/bcoo.py:273-290 | jax/experimental/sparse/bcsr.py:207-229 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `mat` to `Array` in one and `ArrayLike` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 3) jax/_src/tpu_info.py:323— jax/_src/tpu_info.py:323-337 | jax/_src/tpu_info.py:343-357 | jax/_src/tpu_info.py:423-437 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/tpu_info.py:323` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 3) jax/_src/tpu_info.py:363— jax/_src/tpu_info.py:363-377 | jax/_src/tpu_info.py:403-417 | jax/_src/tpu_info.py:450-464 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/tpu_info.py:363` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 3) jax/_src/tpu_info.py:477— jax/_src/tpu_info.py:477-491 | jax/_src/tpu_info.py:504-518 | jax/_src/tpu_info.py:531-545 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/tpu_info.py:477` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) jax/_src/pallas/mosaic_gpu/interpret/interpret_pallas_call.py:310— jax/_src/pallas/mosaic_gpu/interpret/interpret_pallas_call.py:310-324 | jax/_src/pallas/mosaic_gpu/interpret/interpret_pallas_call.py:336-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:315— jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:315-329 | jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py:323-337 — before extracting anything, compare `jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py` and `jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:315` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) jax/experimental/pallas/ops/tpu/flash_attention.py:1500— jax/experimental/pallas/ops/tpu/flash_attention.py:1500-1514 | jax/experimental/pallas/ops/tpu/flash_attention.py:1640-1654 — both copies are in the same file, so extract the block into 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) jax/_src/interpreters/pxla.py:1545— jax/_src/interpreters/pxla.py:1545-1556 | jax/_src/interpreters/pxla.py:1580-1592 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/interpreters/pxla.py:1545` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–13 lines × 2) jax/_src/numpy/ufuncs.py:3047— jax/_src/numpy/ufuncs.py:3047-3058 | jax/_src/numpy/ufuncs.py:3207-3219 — both copies are in the same file, so extract the block into 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) jax/_src/lax/eval_jaxpr.py:98— jax/_src/lax/eval_jaxpr.py:98-109 | jax/_src/xla_metadata.py:446-458 — 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 (11–12 lines × 2) jax/_src/interpreters/mlir.py:2144— jax/_src/interpreters/mlir.py:2144-2154 | jax/_src/interpreters/mlir.py:2187-2198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/interpreters/mlir.py:2144` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) jax/_src/lax/lgamma.py:448— jax/_src/lax/lgamma.py:448-459 | jax/_src/lax/lgamma.py:1137-1147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/lax/lgamma.py:448` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:126— jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:126-137 | jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py:144-154 — before extracting anything, compare `jax/experimental/pallas/ops/gpu/all_gather_mgpu.py` and `jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 2) jax/_src/lax/parallel.py:1126— jax/_src/lax/parallel.py:1126-1135 | jax/_src/lax/parallel.py:2387-2398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jax/_src/lax/parallel.py:2385` calls `list` and `jax/_src/lax/parallel.py:1125` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–12 lines × 2) jax/_src/thunky/thunky.py:89— jax/_src/thunky/thunky.py:89-100 | jax/_src/thunky/thunky.py:2086-2095 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–12 lines × 2) jax/experimental/pallas/ops/gpu/ragged_dot_mgpu.py:286— jax/experimental/pallas/ops/gpu/ragged_dot_mgpu.py:286-295 | jax/experimental/pallas/ops/gpu/transposed_ragged_dot_mgpu.py:263-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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/gpu/ragged_dot_mgpu.py:286` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Low cohesion: Primitive (LCOM4 6) jax/_src/core.py:611— Primitive's methods fall into 6 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 6 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.
Low cohesion: _DimExpr (LCOM4 4) jax/_src/export/shape_poly.py:421— _DimExpr's methods fall into 4 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 4 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.
Low cohesion: Mesh (LCOM4 4) jax/_src/mesh.py:239— Mesh's methods fall into 4 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 4 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.
HackComment tests/pallas/indexing_test.py:420— # hack to reuse the same fn for np cat — 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 jax/_src/core.py:1286— # hack. — 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.
XxxComment jax/experimental/mosaic/gpu/fragmented_array.py:5209— # XXX: We must keep tx_pair_nested_tiled_dim minor! — 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 jax/_src/interpreters/partial_eval.py:152— # XXX: Think twice before changing this constant argument pruning! — 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.
linalg.qr_multiply (cognitive 16) jax/_src/scipy/linalg.py:1115— linalg.qr_multiply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 1 (2 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. This shape REPEATS in the file: one other method here (linalg.qr_multiply) 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.
linalg.qr_multiply (cognitive 16) jax/_src/scipy/linalg.py:1121— linalg.qr_multiply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 1 (2 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. This shape REPEATS in the file: one other method here (linalg.qr_multiply) 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.
Near-duplicate member pair (70 shared lines) jax/_src/state/primitives.py:982— jax/_src/state/primitives.py:982-1072 | jax/_src/state/primitives.py:1076-1154 — These two members are variants of one another: 70 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 (70 shared lines) jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:65— jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:65-229 | jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py:60-266 — These two members are variants of one another: 70 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· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) docs/_static/fault_tolerance/cancel_collectives.py:36— docs/_static/fault_tolerance/cancel_collectives.py:36-56 | docs/_static/fault_tolerance/collectives.py:30-46 | docs/_static/fault_tolerance/dont_fail.py:29-41 | docs/_static/fault_tolerance/live_devices.py:37-60 | docs/_static/fault_tolerance/while_loop.py:26-37 — 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) jax/_src/random/core.py:1992— jax/_src/random/core.py:1992-2027 | jax/_src/random/core.py:2124-2159 | jax/_src/random/core.py:3482-3515 | jax/_src/random/core.py:3531-3564 | jax/_src/random/core.py:3891-3928 — 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.
D4 · Code Duplication· Edited copy of a member (44 corresponding lines) · ×2
Edited copy of a member (44 corresponding lines) jax/_src/interpreters/partial_eval.py:216— jax/_src/interpreters/partial_eval.py:216-259 | jax/_src/interpreters/partial_eval.py:262-306 — These two members are one piece of code written twice and then edited apart: 44 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 (44 corresponding lines) jax/_src/lax/lax.py:4098— jax/_src/lax/lax.py:4098-4146 | jax/_src/lax/lax.py:4177-4220 — These two members are one piece of code written twice and then edited apart: 44 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 (58 corresponding lines) · ×2
Edited copy of a member (58 corresponding lines) jax/_src/pallas/triton/lowering.py:2098— jax/_src/pallas/triton/lowering.py:2098-2167 | jax/_src/pallas/triton/lowering.py:2321-2378 — These two members are one piece of code written twice and then edited apart: 58 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 (58 corresponding lines) jax/_src/numpy/lax_numpy.py:7069— jax/_src/numpy/lax_numpy.py:7069-7126 | jax/_src/numpy/lax_numpy.py:7131-7188 — These two members are one piece of code written twice and then edited apart: 58 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) · ×2
Edited copy of a member (27 corresponding lines) jax/_src/interpreters/ad.py:591— jax/_src/interpreters/ad.py:591-617 | jax/_src/interpreters/ad.py:781-808 — 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.
Edited copy of a member (27 corresponding lines) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:191— jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:191-221 | jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:167-193 — 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 (37 corresponding lines) · ×2
Edited copy of a member (37 corresponding lines) jax/_src/pallas/primitives.py:265— jax/_src/pallas/primitives.py:265-301 | jax/_src/pallas/primitives.py:388-432 — 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.
Edited copy of a member (37 corresponding lines) jax/_src/lax/parallel.py:241— jax/_src/lax/parallel.py:241-277 | jax/_src/lax/parallel.py:281-317 — 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 (36 corresponding lines) · ×2
Edited copy of a member (36 corresponding lines) jax/_src/pallas/mosaic_gpu/primitives.py:5309— jax/_src/pallas/mosaic_gpu/primitives.py:5309-5351 | jax/_src/pallas/triton/primitives.py:315-350 — These two members are one piece of code written twice and then edited apart: 36 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 (36 corresponding lines) jax_plugins/cuda/__init__.py:54— jax_plugins/cuda/__init__.py:54-89 | jax_plugins/oneapi/__init__.py:38-77 — These two members are one piece of code written twice and then edited apart: 36 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 (62 corresponding lines) · ×2
Edited copy of a member (62 corresponding lines) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:779— jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:779-851 | jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:867-928 — These two members are one piece of code written twice and then edited apart: 62 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 (62 corresponding lines) jax/_src/numpy/sorting.py:213— jax/_src/numpy/sorting.py:213-274 | jax/_src/numpy/sorting.py:280-347 — These two members are one piece of code written twice and then edited apart: 62 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 (28 corresponding lines) · ×2
Edited copy of a member (28 corresponding lines) jax/_src/pallas/triton/lowering.py:528— jax/_src/pallas/triton/lowering.py:528-556 | jax/_src/pallas/triton/lowering.py:2603-2630 — These two members are one piece of code written twice and then edited apart: 28 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 (28 corresponding lines) jax/_src/pallas/mosaic_gpu/interpret/jaxpr_interpret.py:1039— jax/_src/pallas/mosaic_gpu/interpret/jaxpr_interpret.py:1039-1066 | jax/_src/pallas/mosaic_gpu/interpret/jaxpr_interpret.py:1195-1225 — These two members are one piece of code written twice and then edited apart: 28 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 (29 corresponding lines) · ×2
Edited copy of a member (29 corresponding lines) jax/experimental/mosaic/gpu/launch_context.py:182— jax/experimental/mosaic/gpu/launch_context.py:182-210 | jax/experimental/mosaic/gpu/launch_context.py:213-243 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) jax/_src/scipy/special.py:1720— jax/_src/scipy/special.py:1720-1748 | jax/_src/scipy/special.py:1752-1780 — These two members are one piece of code written twice and then edited apart: 29 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 (25 corresponding lines) · ×2
Edited copy of a member (25 corresponding lines) jax/_src/config.py:388— jax/_src/config.py:388-469 | jax/_src/config.py:484-508 — These two members are one piece of code written twice and then edited apart: 25 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 (25 corresponding lines) jax/_src/pallas/mosaic_gpu/interpret/shared_memory.py:694— jax/_src/pallas/mosaic_gpu/interpret/shared_memory.py:694-718 | jax/_src/pallas/mosaic_gpu/interpret/shared_memory.py:832-856 — These two members are one piece of code written twice and then edited apart: 25 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 copies of one member (3 members, 12+ corresponding lines) · ×2
Edited copies of one member (3 members, 12+ corresponding lines) jax/_src/compute_on.py:190— jax/_src/compute_on.py:190-204 | jax/_src/xla_metadata.py:377-388 | jax/experimental/fused.py:87-98 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) jax/_src/lax/parallel.py:2110— jax/_src/lax/parallel.py:2110-2125 | jax/_src/lax/parallel.py:2292-2303 | jax/_src/lax/parallel.py:2874-2886 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 12+ corresponding lines) · ×2
Edited copies of one member (4 members, 12+ corresponding lines) jax/_src/random/philox2x32.py:90— jax/_src/random/philox2x32.py:90-106 | jax/_src/random/philox4x32.py:101-117 | jax/_src/random/threefry2x32.py:94-105 | jax/_src/random/threefry4x32.py:142-158 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 12+ corresponding lines) jax/_src/thunky/thunky.py:1764— jax/_src/thunky/thunky.py:1764-1776 | jax/_src/thunky/thunky.py:1786-1797 | jax/_src/thunky/thunky.py:1807-1819 | jax/_src/thunky/thunky.py:1855-1869 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×2
Edited copy of a member (34 corresponding lines) jax/_src/scipy/stats/gumbel_l.py:162— jax/_src/scipy/stats/gumbel_l.py:162-195 | jax/_src/scipy/stats/gumbel_r.py:160-194 — These two members are one piece of code written twice and then edited apart: 34 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 (34 corresponding lines) jax/_src/config.py:839— jax/_src/config.py:839-872 | jax/_src/config.py:885-920 — These two members are one piece of code written twice and then edited apart: 34 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) · ×2
Edited copy of a member (45 corresponding lines) jax/_src/numpy/fft.py:1248— jax/_src/numpy/fft.py:1248-1292 | jax/_src/numpy/fft.py:1296-1341 — 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.
Edited copy of a member (45 corresponding lines) jax/_src/numpy/ufunc_api.py:327— jax/_src/numpy/ufunc_api.py:327-380 | jax/_src/numpy/ufunc_api.py:465-509 — 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 copies of one member (3 members, 11+ corresponding lines) · ×2
Edited copies of one member (3 members, 11+ corresponding lines) jax/_src/lax/lax.py:5862— jax/_src/lax/lax.py:5862-5874 | jax/_src/lax/lax.py:5920-5932 | jax/_src/lax/lax.py:6146-6156 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) jaxlib/gpu_linalg.py:25— jaxlib/gpu_linalg.py:25-36 | jaxlib/gpu_prng.py:25-36 | jaxlib/gpu_sparse.py:23-33 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (59 corresponding lines) · ×2
Edited copy of a member (59 corresponding lines) jax/_src/numpy/reductions.py:2971— jax/_src/numpy/reductions.py:2971-3029 | jax/_src/numpy/reductions.py:3040-3099 — These two members are one piece of code written twice and then edited apart: 59 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 (59 corresponding lines) jax/_src/numpy/reductions.py:2581— jax/_src/numpy/reductions.py:2581-2639 | jax/_src/numpy/reductions.py:2649-2710 — These two members are one piece of code written twice and then edited apart: 59 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 copies of one member (3 members, 6+ corresponding lines) · ×2
Edited copies of one member (3 members, 6+ corresponding lines) jax/_src/lax_reference.py:145— jax/_src/lax_reference.py:145-150 | jax/_src/lax_reference.py:154-159 | jax/_src/lax_reference.py:163-168 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) jax/experimental/sparse/bcoo.py:2724— jax/experimental/sparse/bcoo.py:2724-2729 | jax/experimental/sparse/bcsr.py:911-916 | jax/experimental/sparse/csr.py:141-146 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (1 corresponding lines) · ×2
Edited copy of a member (1 corresponding lines) jax/_src/lax/linalg.py:3162— jax/_src/lax/linalg.py:3162-3162 | jax/_src/tpu/linalg/eigh.py:591-591 — These two members are one piece of code written twice and then edited apart: 1 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 (1 corresponding lines) docs/ffi.py:469— docs/ffi.py:469-469 | docs/hijax_custom_derivatives.py:342-342 — These two members are one piece of code written twice and then edited apart: 1 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 (2 corresponding lines) · ×2
Edited copy of a member (2 corresponding lines) jaxlib/mosaic/python/mosaic_gpu.py:86— jaxlib/mosaic/python/mosaic_gpu.py:86-87 | jaxlib/mosaic/python/tpu.py:39-40 — These two members are one piece of code written twice and then edited apart: 2 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 (2 corresponding lines) examples/mnist_classifier_fromscratch.py:32— examples/mnist_classifier_fromscratch.py:32-33 | examples/spmd_mnist_classifier_fromscratch.py:29-32 — These two members are one piece of code written twice and then edited apart: 2 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 (40 lines × 2) jax/_src/random/core.py:3581— jax/_src/random/core.py:3581-3620 | jax/_src/random/core.py:3639-3678 — both copies are in the same file, so extract the block into 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 × 2) jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:153— jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:153-192 | jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py:173-212 — before extracting anything, compare `jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py` and `jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:153` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (35 lines × 2) docs/_static/fault_tolerance/data_parallelism.py:69— docs/_static/fault_tolerance/data_parallelism.py:69-103 | docs/_static/fault_tolerance/data_parallelism_with_recovery.py:105-139 — before extracting anything, compare `docs/_static/fault_tolerance/data_parallelism.py` and `docs/_static/fault_tolerance/data_parallelism_with_recovery.py` as WHOLE FILES: this scan already matched 4 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. If that is what happened, the fix is to keep one copy and have the other call 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) jax/_src/scipy/stats/pareto.py:28— jax/_src/scipy/stats/pareto.py:28-62 | jax/_src/scipy/stats/pareto.py:156-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 (28 lines × 2) jax/_src/random/core.py:3947— jax/_src/random/core.py:3947-3974 | jax/_src/random/core.py:3999-4026 — both copies are in the same file, so extract the block into 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) jax/_src/scipy/stats/gumbel_l.py:96— jax/_src/scipy/stats/gumbel_l.py:96-123 | jax/_src/scipy/stats/gumbel_l.py:227-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 (25–26 lines × 2) jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:288— jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:288-312 | jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py:293-318 — before extracting anything, compare `jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py` and `jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:288` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (25–26 lines × 2) jax/experimental/pallas/ops/tpu/megablox/gmm.py:529— jax/experimental/pallas/ops/tpu/megablox/gmm.py:529-553 | jax/experimental/pallas/ops/tpu/megablox/gmm.py:767-792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/megablox/gmm.py:529` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1184— jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1184-1199 | jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1259-1273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1184` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) jax/_src/pallas/primitives.py:265— jax/_src/pallas/primitives.py:265-279 | jax/_src/pallas/primitives.py:388-403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/primitives.py:388` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–14 lines × 2) jax/experimental/pallas/ops/tpu/flash_attention.py:886— jax/experimental/pallas/ops/tpu/flash_attention.py:886-899 | jax/experimental/pallas/ops/tpu/flash_attention.py:1221-1232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/flash_attention.py:886` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–14 lines × 2) jax/experimental/mosaic/gpu/examples/flash_attention.py:193— jax/experimental/mosaic/gpu/examples/flash_attention.py:193-206 | jax/experimental/mosaic/gpu/examples/flash_attention.py: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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/mosaic/gpu/examples/flash_attention.py:193` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `jax/experimental/mosaic/gpu/examples/flash_attention.py:208` calls `c`, `wait` and `jax/experimental/mosaic/gpu/examples/flash_attention.py:429` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 3) jax/_src/pallas/mosaic/interpret/race_detection_state.py:119— jax/_src/pallas/mosaic/interpret/race_detection_state.py:119-131 | jax/_src/pallas/mosaic/interpret/race_detection_state.py:167-179 | jax/_src/pallas/mosaic/interpret/race_detection_state.py:189-201 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 3) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1179— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1179-1191 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1663-1675 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:2228-2240 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 2) jax/_src/pallas/mosaic/interpret/utils.py:160— jax/_src/pallas/mosaic/interpret/utils.py:160-170 | jax/_src/pallas/primitives.py:1215-1227 — 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 (11–13 lines × 2) jax/_src/pallas/mosaic_gpu/primitives.py:5314— jax/_src/pallas/mosaic_gpu/primitives.py:5314-5326 | jax/_src/pallas/triton/primitives.py:319-329 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic_gpu/primitives.py:5314` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 3) jax/_src/config.py:569— jax/_src/config.py:569-579 | jax/_src/config.py:629-639 | jax/_src/config.py:712-722 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/config.py:569` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) jax/_src/random/philox2x32.py:142— jax/_src/random/philox2x32.py:142-152 | jax/_src/random/philox4x32.py:153-163 | jax/_src/random/threefry4x32.py:206-216 — 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 (8–9 lines × 2) jax/_src/compute_on.py:270— jax/_src/compute_on.py:270-277 | jax/_src/pjit.py:1746-1754 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/compute_on.py:270` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) jax/_src/pallas/mosaic_gpu/lowering.py:1154— jax/_src/pallas/mosaic_gpu/lowering.py:1154-1162 | jax/_src/pallas/triton/lowering.py:438-445 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic_gpu/lowering.py:1154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–8 lines × 2) jax/_src/lax/ann.py:442— jax/_src/lax/ann.py:442-449 | jax/_src/lax/lax.py:11145-11150 — 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–8 lines × 2) jax/_src/scipy/bessel.py:524— jax/_src/scipy/bessel.py:524-529 | jax/_src/scipy/bessel.py:1146-1153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/scipy/bessel.py:524` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) jax/_src/lax/slicing.py:3188— jax/_src/lax/slicing.py:3188-3193 | jax/_src/lax/slicing.py:3231-3236 | jax/_src/lax/slicing.py:3656-3661 — 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) jax/_src/compute_on.py:411— jax/_src/compute_on.py:411-416 | jax/_src/pjit.py:2002-2007 | jax/_src/xla_metadata.py:523-528 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/compute_on.py:411` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `eqn` to `pe.JaxprEqn` in one and `core.JaxprEqn` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 3) jax/_src/cudnn/fused_attention_stablehlo.py:440— jax/_src/cudnn/fused_attention_stablehlo.py:440-444 | jax/_src/cudnn/fused_attention_stablehlo.py:460-464 | jax/_src/cudnn/fused_attention_stablehlo.py:926-930 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/cudnn/fused_attention_stablehlo.py:440` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) jax/_src/scipy/linalg.py:1582— jax/_src/scipy/linalg.py:1582-1586 | jax/_src/scipy/linalg.py:1593-1598 | jax/_src/scipy/linalg.py:1608-1612 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/scipy/linalg.py:1593` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
tcgen05.mma (cyclomatic 128) jax/experimental/mosaic/gpu/tcgen05.py:216— tcgen05.mma has cyclomatic complexity 128 (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.
LaunchContext.async_copy (cyclomatic 110) jax/experimental/mosaic/gpu/launch_context.py:1473— LaunchContext.async_copy has cyclomatic complexity 110 (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.
FragmentedArray.astype (cyclomatic 106) jax/experimental/mosaic/gpu/fragmented_array.py:2507— FragmentedArray.astype has cyclomatic complexity 106 (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.
mlir.lower_jaxpr_to_fun (cyclomatic 103) jax/_src/interpreters/mlir.py:1779— mlir.lower_jaxpr_to_fun has cyclomatic complexity 103 (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.
FragmentedArray.transfer_tiled (cyclomatic 82) jax/experimental/mosaic/gpu/fragmented_array.py:4749— FragmentedArray.transfer_tiled has cyclomatic complexity 82 (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.
FragmentedArray.reduce (cyclomatic 71) jax/experimental/mosaic/gpu/fragmented_array.py:3299— FragmentedArray.reduce has cyclomatic complexity 71 (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.
reductions._quantile (cyclomatic 58) jax/_src/numpy/reductions.py:2720— reductions._quantile has cyclomatic complexity 58 (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.
primitives._copy_gmem_to_smem_lowering (cyclomatic 52) jax/_src/pallas/mosaic_gpu/primitives.py:975— primitives._copy_gmem_to_smem_lowering has cyclomatic complexity 52 (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.
splash_attention_mask_info._process_mask (cyclomatic 49) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:518— splash_attention_mask_info._process_mask has cyclomatic complexity 49 (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.
interpret_pallas_call._interpret_jaxpr (cyclomatic 48) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1349— interpret_pallas_call._interpret_jaxpr has cyclomatic complexity 48 (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.
signal._spectral_helper (cyclomatic 47) jax/_src/scipy/signal.py:615— signal._spectral_helper has cyclomatic complexity 47 (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.
CustomCallBackendConfig.to_json (cyclomatic 46) jax/_src/tpu_custom_call.py:251— CustomCallBackendConfig.to_json has cyclomatic complexity 46 (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.
array_constructors.array (cyclomatic 44) jax/_src/numpy/array_constructors.py:107— array_constructors.array has cyclomatic complexity 44 (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.
lowering.lower_jaxpr_into_pipelined_module (cyclomatic 41) jax/_src/pallas/mosaic/lowering.py:1104— lowering.lower_jaxpr_into_pipelined_module has cyclomatic complexity 41 (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.
FragmentedArray.to_layout (cyclomatic 41) jax/experimental/mosaic/gpu/fragmented_array.py:1352— FragmentedArray.to_layout has cyclomatic complexity 41 (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.
LaunchContext.async_copy_im2col (cyclomatic 37) jax/experimental/mosaic/gpu/launch_context.py:2266— LaunchContext.async_copy_im2col has cyclomatic complexity 37 (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.
dispatch._device_put_sharding_impl (cyclomatic 36) jax/_src/dispatch.py:471— dispatch._device_put_sharding_impl 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.
lax._convert_element_type (cyclomatic 36) jax/_src/lax/lax.py:1841— lax._convert_element_type 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.
FragmentedArray._store_register_atomic (cyclomatic 36) jax/experimental/mosaic/gpu/fragmented_array.py:4375— FragmentedArray._store_register_atomic 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.
TMEMRef.load (cyclomatic 36) jax/experimental/mosaic/gpu/tcgen05.py:1431— TMEMRef.load 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.
constraints.reduce_constraint (cyclomatic 35) jax/experimental/mosaic/gpu/constraints.py:939— constraints.reduce_constraint has cyclomatic complexity 35 (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.
einsum._einsum (cyclomatic 33) jax/_src/numpy/einsum.py:441— einsum._einsum has cyclomatic complexity 33 (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.
wgmma.wgmma (cyclomatic 32) jax/experimental/mosaic/gpu/wgmma.py:292— wgmma.wgmma has cyclomatic complexity 32 (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.
reductions._reduction (cyclomatic 31) jax/_src/numpy/reductions.py:101— reductions._reduction 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.
primitives._tcgen05_mma_lowering (cyclomatic 31) jax/_src/pallas/mosaic_gpu/primitives.py:2814— primitives._tcgen05_mma_lowering 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.
wgmma._wgmma_m64 (cyclomatic 31) jax/experimental/mosaic/gpu/wgmma.py:119— wgmma._wgmma_m64 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.
mlir.lower_jaxpr_to_module (cyclomatic 30) jax/_src/interpreters/mlir.py:1436— mlir.lower_jaxpr_to_module has cyclomatic complexity 30 (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.
lax_numpy.cov (cyclomatic 30) jax/_src/numpy/lax_numpy.py:9176— lax_numpy.cov has cyclomatic complexity 30 (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.
shard_map_fusion._make_block_extractor (cyclomatic 30) jax/_src/pallas/fuser/shard_map_fusion.py:69— shard_map_fusion._make_block_extractor has cyclomatic complexity 30 (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.
core._launch (cyclomatic 30) jax/experimental/mosaic/gpu/core.py:751— core._launch has cyclomatic complexity 30 (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.
splash_attention_kernel._splash_attention_forward (cyclomatic 30) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:912— splash_attention_kernel._splash_attention_forward has cyclomatic complexity 30 (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.
mlir._set_up_aliases (cyclomatic 29) jax/_src/interpreters/mlir.py:1604— mlir._set_up_aliases has cyclomatic complexity 29 (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.
pallas_call_registration.mpmd_map_tpu_lowering_rule (cyclomatic 29) jax/_src/pallas/mosaic/pallas_call_registration.py:612— pallas_call_registration.mpmd_map_tpu_lowering_rule has cyclomatic complexity 29 (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.
tcgen05._do_mma (cyclomatic 29) jax/experimental/mosaic/gpu/tcgen05.py:665— tcgen05._do_mma has cyclomatic complexity 29 (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.
lowering._dot_general_lowering (cyclomatic 28) jax/_src/pallas/triton/lowering.py:2454— lowering._dot_general_lowering 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.
tpu_custom_call._lowered_to_custom_call_config (cyclomatic 28) jax/_src/tpu_custom_call.py:739— tpu_custom_call._lowered_to_custom_call_config 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.
core._mosaic_gpu_lowering_rule (cyclomatic 28) jax/experimental/mosaic/gpu/core.py:211— core._mosaic_gpu_lowering_rule 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.
LaunchContext._prepare_async_copy (cyclomatic 28) jax/experimental/mosaic/gpu/launch_context.py:1150— LaunchContext._prepare_async_copy 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.
utils.parse_indices (cyclomatic 28) jax/experimental/mosaic/gpu/utils.py:1086— utils.parse_indices 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.
compiler.get_compile_options (cyclomatic 27) jax/_src/compiler.py:187— compiler.get_compile_options 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.
pxla.lower_sharding_computation (cyclomatic 27) jax/_src/interpreters/pxla.py:956— pxla.lower_sharding_computation 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.
indexing._index_to_gather (cyclomatic 27) jax/_src/numpy/indexing.py:1405— indexing._index_to_gather 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.
lowering.jaxpr_subcomp (cyclomatic 27) jax/_src/pallas/mosaic/lowering.py:1790— lowering.jaxpr_subcomp 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.
lowering._ir_cast (cyclomatic 27) jax/_src/pallas/triton/lowering.py:1684— lowering._ir_cast 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.
signal.istft (cyclomatic 27) jax/_src/scipy/signal.py:1051— signal.istft 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.
paged_attention_kernel.paged_attention (cyclomatic 27) jax/experimental/pallas/ops/tpu/paged_attention/paged_attention_kernel.py:391— paged_attention_kernel.paged_attention has cyclomatic complexity 27 (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.
_export._export_lowered (cyclomatic 26) jax/_src/export/_export.py:698— _export._export_lowered 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.
slicing._dynamic_slice_indices (cyclomatic 26) jax/_src/lax/slicing.py:3922— slicing._dynamic_slice_indices 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.
NDIndexer.to_dynamic_slice (cyclomatic 26) jax/_src/numpy/indexing.py:489— NDIndexer.to_dynamic_slice 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.
pallas_call_registration._get_memory_space_from_aval (cyclomatic 26) jax/_src/pallas/mosaic/pallas_call_registration.py:52— pallas_call_registration._get_memory_space_from_aval has cyclomatic complexity 26 (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.
Barrier._wait (cyclomatic 26) jax/_src/pallas/mosaic_gpu/interpret/shared_memory.py:1380— Barrier._wait 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.
lowering._swap_lowering_rule (cyclomatic 26) jax/_src/pallas/mosaic_gpu/lowering.py:2004— lowering._swap_lowering_rule 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.
shard_map._unshard_shaped_array (cyclomatic 26) jax/_src/shard_map.py:980— shard_map._unshard_shaped_array 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.
fused_attention_stablehlo.dot_product_attention (cyclomatic 25) jax/_src/cudnn/fused_attention_stablehlo.py:2032— fused_attention_stablehlo.dot_product_attention has cyclomatic complexity 25 (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.
State.initialize (cyclomatic 25) jax/_src/distributed.py:92— State.initialize 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.
linalg.norm (cyclomatic 25) jax/_src/numpy/linalg.py:1203— linalg.norm has cyclomatic complexity 25 (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.
lowering._lower_jaxpr_to_for_loop (cyclomatic 25) jax/_src/pallas/mosaic/lowering.py:4610— lowering._lower_jaxpr_to_for_loop has cyclomatic complexity 25 (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.
sc_lowering._store_lowering_rule (cyclomatic 25) jax/_src/pallas/mosaic/sc_lowering.py:258— sc_lowering._store_lowering_rule has cyclomatic complexity 25 (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.
lowering._handle_transforms (cyclomatic 25) jax/_src/pallas/mosaic_gpu/lowering.py:1664— lowering._handle_transforms has cyclomatic complexity 25 (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.
mpmd._mpmd_map_abstract_eval (cyclomatic 25) jax/_src/pallas/mpmd.py:91— mpmd._mpmd_map_abstract_eval has cyclomatic complexity 25 (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.
custom_partitioning_sharding_rule._parse_values (cyclomatic 24) jax/_src/custom_partitioning_sharding_rule.py:212— custom_partitioning_sharding_rule._parse_values 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.
custom_partitioning_sharding_rule.sdy_sharding_rule_to_mlir (cyclomatic 24) jax/_src/custom_partitioning_sharding_rule.py:363— custom_partitioning_sharding_rule.sdy_sharding_rule_to_mlir 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.
pxla._get_and_check_device_assignment (cyclomatic 24) jax/_src/interpreters/pxla.py:521— pxla._get_and_check_device_assignment 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.
functions.dot_product_attention (cyclomatic 24) jax/_src/nn/functions.py:1053— functions.dot_product_attention 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.
BlockSpec.to_block_mapping (cyclomatic 24) jax/_src/pallas/core.py:688— BlockSpec.to_block_mapping 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.
interpret_pallas_call.interpret_pallas_call (cyclomatic 24) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:2003— interpret_pallas_call.interpret_pallas_call 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.
lowering._convert_element_type_lowering_rule (cyclomatic 24) jax/_src/pallas/mosaic/lowering.py:3334— lowering._convert_element_type_lowering_rule 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.
lowering._run_scoped_lowering_rule (cyclomatic 24) jax/_src/pallas/mosaic_gpu/lowering.py:3476— lowering._run_scoped_lowering_rule 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.
torch._find_mgpu_call (cyclomatic 24) jax/_src/pallas/mosaic_gpu/torch.py:107— torch._find_mgpu_call 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.
pallas_call._pallas_call_batching_rule (cyclomatic 24) jax/_src/pallas/pallas_call.py:520— pallas_call._pallas_call_batching_rule has cyclomatic complexity 24 (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.
splash_attention_kernel._splash_attention_bwd_dkv (cyclomatic 24) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1871— splash_attention_kernel._splash_attention_bwd_dkv has cyclomatic complexity 24 (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.
dlpack.from_dlpack (cyclomatic 23) jax/_src/dlpack.py:234— dlpack.from_dlpack has cyclomatic complexity 23 (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.
ad.backward_pass3 (cyclomatic 23) jax/_src/interpreters/ad.py:300— ad.backward_pass3 has cyclomatic complexity 23 (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.
conditionals.cond (cyclomatic 23) jax/_src/lax/control_flow/conditionals.py:195— conditionals.cond has cyclomatic complexity 23 (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.
lax.broadcasting_sharding_rule (cyclomatic 23) jax/_src/lax/lax.py:4705— lax.broadcasting_sharding_rule has cyclomatic complexity 23 (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.
lax._dot_general_layout_rule (cyclomatic 23) jax/_src/lax/lax.py:7166— lax._dot_general_layout_rule has cyclomatic complexity 23 (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.
slicing._gather_shape_rule (cyclomatic 23) jax/_src/lax/slicing.py:1941— slicing._gather_shape_rule has cyclomatic complexity 23 (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.
lowering._masked_swap_lowering_rule (cyclomatic 23) jax/_src/pallas/mosaic/lowering.py:2658— lowering._masked_swap_lowering_rule has cyclomatic complexity 23 (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.
lowering._dot_general_lowering_rule (cyclomatic 23) jax/_src/pallas/mosaic/lowering.py:3013— lowering._dot_general_lowering_rule has cyclomatic complexity 23 (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.
lowering._convert_element_type_lowering_rule_wg (cyclomatic 23) jax/_src/pallas/mosaic_gpu/lowering.py:2416— lowering._convert_element_type_lowering_rule_wg has cyclomatic complexity 23 (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.
lowering._compute_offsets_from_indices (cyclomatic 23) jax/_src/pallas/triton/lowering.py:1924— lowering._compute_offsets_from_indices has cyclomatic complexity 23 (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.
FragmentedArray._pointwise (cyclomatic 23) jax/experimental/mosaic/gpu/fragmented_array.py:1629— FragmentedArray._pointwise has cyclomatic complexity 23 (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.
fragmented_array.plan_gmem_transfer (cyclomatic 23) jax/experimental/mosaic/gpu/fragmented_array.py:5426— fragmented_array.plan_gmem_transfer has cyclomatic complexity 23 (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.
mma_utils.create_descriptor (cyclomatic 23) jax/experimental/mosaic/gpu/mma_utils.py:116— mma_utils.create_descriptor has cyclomatic complexity 23 (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.
hlo._parse_hlo_new_format (cyclomatic 23) jax/experimental/source_mapper/hlo.py:68— hlo._parse_hlo_new_format has cyclomatic complexity 23 (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.
evaluate_sampler_bias.evaluate_bias (cyclomatic 23) jax/tools/evaluate_sampler_bias.py:187— evaluate_sampler_bias.evaluate_bias has cyclomatic complexity 23 (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. This is NOT this file's highest cyclomatic complexity: evaluate_sampler_bias.get_scipy_distribution (cyclomatic 24) 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 method is counted neither in this dimension's figures nor in its score.
fused_attention_stablehlo.check_is_flash_attention (cyclomatic 22) jax/_src/cudnn/fused_attention_stablehlo.py:352— fused_attention_stablehlo.check_is_flash_attention 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.
mlir.lower_per_platform (cyclomatic 22) jax/_src/interpreters/mlir.py:2689— mlir.lower_per_platform 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.
convolution._conv_general_dilated_batch_rule (cyclomatic 22) jax/_src/lax/convolution.py:601— convolution._conv_general_dilated_batch_rule 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.
lax._get_monoid_reducer (cyclomatic 22) jax/_src/lax/lax.py:3502— lax._get_monoid_reducer 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.
slicing._scatter_shape_rule (cyclomatic 22) jax/_src/lax/slicing.py:2688— slicing._scatter_shape_rule 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_contractions.matmul (cyclomatic 22) jax/_src/numpy/tensor_contractions.py:138— tensor_contractions.matmul 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.
lowering._check_block_mappings (cyclomatic 22) jax/_src/pallas/mosaic/lowering.py:959— lowering._check_block_mappings 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.
lowering._get_lowering_rule (cyclomatic 22) jax/_src/pallas/mosaic_gpu/lowering.py:1862— lowering._get_lowering_rule 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.
FragmentedArray.load_tiled (cyclomatic 22) jax/experimental/mosaic/gpu/fragmented_array.py:4595— FragmentedArray.load_tiled 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.
fragmented_array.concatenate (cyclomatic 22) jax/experimental/mosaic/gpu/fragmented_array.py:6048— fragmented_array.concatenate 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.
utils.multimem_load_reduce (cyclomatic 22) jax/experimental/mosaic/gpu/utils.py:423— utils.multimem_load_reduce 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.
utils.is_known_divisible (cyclomatic 22) jax/experimental/mosaic/gpu/utils.py:2379— utils.is_known_divisible has cyclomatic complexity 22 (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.
core._check_jaxpr (cyclomatic 21) jax/_src/core.py:3708— core._check_jaxpr 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.
debugging.visualize_sharding (cyclomatic 21) jax/_src/debugging.py:861— debugging.visualize_sharding 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.
dtypes._issubdtype_cached (cyclomatic 21) jax/_src/dtypes.py:554— dtypes._issubdtype_cached has cyclomatic complexity 21 (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.
_export._call_exported_lowering (cyclomatic 21) jax/_src/export/_export.py:1521— _export._call_exported_lowering has cyclomatic complexity 21 (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.
loops.fori_loop (cyclomatic 21) jax/_src/lax/control_flow/loops.py:2699— loops.fori_loop 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.
linalg._eig_gpu_lowering (cyclomatic 21) jax/_src/lax/linalg.py:1104— linalg._eig_gpu_lowering 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.
lowering._transform_ref (cyclomatic 21) jax/_src/pallas/mosaic/lowering.py:2317— lowering._transform_ref 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.
BufferedRef.create (cyclomatic 21) jax/_src/pallas/mosaic/pipeline.py:648— BufferedRef.create 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.
pipeline._partition_grid (cyclomatic 21) jax/_src/pallas/mosaic/pipeline.py:1707— pipeline._partition_grid has cyclomatic complexity 21 (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.
sc_lowering._load_lowering_rule (cyclomatic 21) jax/_src/pallas/mosaic/sc_lowering.py:145— sc_lowering._load_lowering_rule has cyclomatic complexity 21 (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.
pipeline.emit_pipeline_warp_specialized (cyclomatic 21) jax/_src/pallas/mosaic_gpu/pipeline.py:660— pipeline.emit_pipeline_warp_specialized has cyclomatic complexity 21 (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.
lowering._load (cyclomatic 21) jax/_src/pallas/triton/lowering.py:2089— lowering._load has cyclomatic complexity 21 (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.
discharge._eval_jaxpr_discharge_state (cyclomatic 21) jax/_src/state/discharge.py:233— discharge._eval_jaxpr_discharge_state 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.
thunky._transforms_to_slice_params (cyclomatic 21) jax/_src/thunky/thunky.py:191— thunky._transforms_to_slice_params 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.
TpuInfo.is_matmul_supported (cyclomatic 21) jax/_src/tpu_info.py:220— TpuInfo.is_matmul_supported has cyclomatic complexity 21 (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.
FragmentedArray.broadcast_in_dim (cyclomatic 21) jax/experimental/mosaic/gpu/fragmented_array.py:3958— FragmentedArray.broadcast_in_dim has cyclomatic complexity 21 (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.
LaunchContext._prepare_tma (cyclomatic 21) jax/experimental/mosaic/gpu/launch_context.py:1302— LaunchContext._prepare_tma 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.
bcoo._bcoo_spdot_general_abstract_eval (cyclomatic 21) jax/experimental/sparse/bcoo.py:1195— bcoo._bcoo_spdot_general_abstract_eval has cyclomatic complexity 21 (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.
api.device_put (cyclomatic 20) jax/_src/api.py:2388— api.device_put has cyclomatic complexity 20 (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.
slicing._gather_collective_rule (cyclomatic 20) jax/_src/lax/slicing.py:2590— slicing._gather_collective_rule 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.
NDIndexer.to_static_slice (cyclomatic 20) jax/_src/numpy/indexing.py:388— NDIndexer.to_static_slice 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.
lax_numpy._arange (cyclomatic 20) jax/_src/numpy/lax_numpy.py:6005— lax_numpy._arange 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.
primitives._wgmma_lowering (cyclomatic 20) jax/_src/pallas/mosaic_gpu/primitives.py:2220— primitives._wgmma_lowering 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.
primitives._multimem_load_reduce_lowering_rule_wg (cyclomatic 20) jax/_src/pallas/mosaic_gpu/primitives.py:5685— primitives._multimem_load_reduce_lowering_rule_wg 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.
utils.pattern_match_while_to_fori_loop (cyclomatic 20) jax/_src/pallas/utils.py:171— utils.pattern_match_while_to_fori_loop 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.
bessel._yn_series (cyclomatic 20) jax/_src/scipy/bessel.py:930— bessel._yn_series 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.
NDIndexer.from_indices_shape (cyclomatic 20) jax/_src/state/indexing.py:184— NDIndexer.from_indices_shape 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.
layout_inference._check_unsatisfiable_divisibility_constraints (cyclomatic 20) jax/experimental/mosaic/gpu/layout_inference.py:2645— layout_inference._check_unsatisfiable_divisibility_constraints 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.
mma.mma (cyclomatic 20) jax/experimental/mosaic/gpu/mma.py:191— mma.mma has cyclomatic complexity 20 (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.
tcgen05._load_32xcols_native (cyclomatic 20) jax/experimental/mosaic/gpu/tcgen05.py:1844— tcgen05._load_32xcols_native 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.
kernel.static_validate_inputs (cyclomatic 20) jax/experimental/pallas/ops/tpu/ragged_paged_attention/kernel.py:216— kernel.static_validate_inputs has cyclomatic complexity 20 (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.
splash_attention_mask_info._get_mask_info_for_shard (cyclomatic 20) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:172— splash_attention_mask_info._get_mask_info_for_shard 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.
custom_vjp.__call__ (cyclomatic 19) jax/_src/custom_derivatives.py:806— custom_vjp.__call__ 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.
custom_derivatives._flatten_bwd (cyclomatic 19) jax/_src/custom_derivatives.py:1074— custom_derivatives._flatten_bwd 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.
_DecisionByElimination.add_implicit_constraints_term (cyclomatic 19) jax/_src/export/shape_poly_decision.py:362— _DecisionByElimination.add_implicit_constraints_term 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.
loops.scan (cyclomatic 19) jax/_src/lax/control_flow/loops.py:242— loops.scan has cyclomatic complexity 19 (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.
DotAlgorithmPreset._convert_to_hlo_attr (cyclomatic 19) jax/_src/lax/lax.py:2633— DotAlgorithmPreset._convert_to_hlo_attr 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.
linalg._svd_gpu_sub_lowering (cyclomatic 19) jax/_src/lax/linalg.py:2586— linalg._svd_gpu_sub_lowering has cyclomatic complexity 19 (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.
slicing._scatter_spec_computation (cyclomatic 19) jax/_src/lax/slicing.py:2863— slicing._scatter_spec_computation 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.
slicing._scatter_unreduced_rule (cyclomatic 19) jax/_src/lax/slicing.py:3060— slicing._scatter_unreduced_rule 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.
polynomial.polyfit (cyclomatic 19) jax/_src/numpy/polynomial.py:127— polynomial.polyfit has cyclomatic complexity 19 (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.
einshape._inverse_block_transform (cyclomatic 19) jax/_src/pallas/einshape.py:535— einshape._inverse_block_transform 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.
hlo_interpreter.pallas_call_hlo_interpret (cyclomatic 19) jax/_src/pallas/hlo_interpreter.py:316— hlo_interpreter.pallas_call_hlo_interpret 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.
pipeline._emit_pipeline_effectful_abstract_eval (cyclomatic 19) jax/_src/pallas/mosaic/pipeline.py:2475— pipeline._emit_pipeline_effectful_abstract_eval 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.
primitives._atomic_lowering_rule (cyclomatic 19) jax/_src/pallas/triton/primitives.py:445— primitives._atomic_lowering_rule 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.
core._sample_sharding (cyclomatic 19) jax/_src/random/core.py:517— core._sample_sharding 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.
eigh.eigh (cyclomatic 19) jax/_src/tpu/linalg/eigh.py:511— eigh.eigh 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.
fragmented_array.plan_tiled_transfer (cyclomatic 19) jax/experimental/mosaic/gpu/fragmented_array.py:5582— fragmented_array.plan_tiled_transfer has cyclomatic complexity 19 (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.
splash_attention_kernel._splash_attention_bwd_dq (cyclomatic 19) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1417— splash_attention_kernel._splash_attention_bwd_dq has cyclomatic complexity 19 (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.
_DimFactor.evaluate (cyclomatic 18) jax/_src/export/shape_poly.py:228— _DimFactor.evaluate 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.
ffi.ffi_batching_rule (cyclomatic 18) jax/_src/ffi.py:679— ffi.ffi_batching_rule 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.
_reduction_order._check_ring_args (cyclomatic 18) jax/_src/lax/_reduction_order.py:300— _reduction_order._check_ring_args has cyclomatic complexity 18 (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.
loops._check_carry_type (cyclomatic 18) jax/_src/lax/control_flow/loops.py:531— loops._check_carry_type 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.
lax._clamp_batch_rule (cyclomatic 18) jax/_src/lax/lax.py:8584— lax._clamp_batch_rule has cyclomatic complexity 18 (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.
lax_reference._float64_fma_scalar (cyclomatic 18) jax/_src/lax_reference.py:252— lax_reference._float64_fma_scalar has cyclomatic complexity 18 (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.
IndexType.from_index (cyclomatic 18) jax/_src/numpy/indexing.py:68— IndexType.from_index has cyclomatic complexity 18 (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.
indexing.take_along_axis (cyclomatic 18) jax/_src/numpy/indexing.py:832— indexing.take_along_axis 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.
setops._unique (cyclomatic 18) jax/_src/numpy/setops.py:616— setops._unique has cyclomatic complexity 18 (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.
lowering._load_lowering_rule (cyclomatic 18) jax/_src/pallas/mosaic/lowering.py:2459— lowering._load_lowering_rule has cyclomatic complexity 18 (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.
pipeline._spec_has_trivial_windowing (cyclomatic 18) jax/_src/pallas/mosaic/pipeline.py:229— pipeline._spec_has_trivial_windowing 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.
lowering._broadcast_in_dim_lowering_rule (cyclomatic 18) jax/_src/pallas/mosaic_gpu/lowering.py:2306— lowering._broadcast_in_dim_lowering_rule 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.
primitives._wgmma_warpgroup_lowering (cyclomatic 18) jax/_src/pallas/mosaic_gpu/primitives.py:2339— primitives._wgmma_warpgroup_lowering 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.
mpmd._mpmd_map_batching_rule (cyclomatic 18) jax/_src/pallas/mpmd.py:519— mpmd._mpmd_map_batching_rule 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.
lowering._maybe_pattern_match_fori_loop (cyclomatic 18) jax/_src/pallas/triton/lowering.py:2840— lowering._maybe_pattern_match_fori_loop 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.
pjit._get_new_mesh (cyclomatic 18) jax/_src/pjit.py:2912— pjit._get_new_mesh 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.
core._multivariate_normal (cyclomatic 18) jax/_src/random/core.py:1544— core._multivariate_normal has cyclomatic complexity 18 (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.
call_tf._mlir_type_to_numpy_dtype (cyclomatic 18) jax/experimental/jax2tf/call_tf.py:473— call_tf._mlir_type_to_numpy_dtype 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.
_core.jaxpr_type_signature (cyclomatic 18) jax/experimental/key_reuse/_core.py:329— _core.jaxpr_type_signature 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.
dialect_lowering._memref_subview_op_lowering_rule (cyclomatic 18) jax/experimental/mosaic/gpu/dialect_lowering.py:1936— dialect_lowering._memref_subview_op_lowering_rule 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.
FragmentedArray.store_tiled (cyclomatic 18) jax/experimental/mosaic/gpu/fragmented_array.py:4513— FragmentedArray.store_tiled 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.
TMEMRef.store (cyclomatic 18) jax/experimental/mosaic/gpu/tcgen05.py:1573— TMEMRef.store has cyclomatic complexity 18 (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.
reduce_scatter_mgpu.reduce_scatter (cyclomatic 18) jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py:32— reduce_scatter_mgpu.reduce_scatter has cyclomatic complexity 18 (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.
core._why_alive_container_info (cyclomatic 17) jax/_src/core.py:1657— core._why_alive_container_info 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.
fused_attention_stablehlo._dot_product_attention_bwd_batcher (cyclomatic 17) jax/_src/cudnn/fused_attention_stablehlo.py:943— fused_attention_stablehlo._dot_product_attention_bwd_batcher 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.
pxla.maybe_recover_user_shardings (cyclomatic 17) jax/_src/interpreters/pxla.py:1405— pxla.maybe_recover_user_shardings 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.
conditionals._check_branch_outputs (cyclomatic 17) jax/_src/lax/control_flow/conditionals.py:337— conditionals._check_branch_outputs 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.
loops.while_loop (cyclomatic 17) jax/_src/lax/control_flow/loops.py:1677— loops.while_loop 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.
indexing._gather (cyclomatic 17) jax/_src/numpy/indexing.py:1290— indexing._gather 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.
lax_numpy._interp (cyclomatic 17) jax/_src/numpy/lax_numpy.py:2640— lax_numpy._interp 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.
reductions._reduce_minmax (cyclomatic 17) jax/_src/numpy/reductions.py:620— reductions._reduce_minmax 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.
pallas_call_registration._resolve_memory_spaces (cyclomatic 17) jax/_src/pallas/mosaic/pallas_call_registration.py:152— pallas_call_registration._resolve_memory_spaces 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.
pjit._trace_for_jit (cyclomatic 17) jax/_src/pjit.py:497— pjit._trace_for_jit 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.
shard_map._shmap_checks (cyclomatic 17) jax/_src/shard_map.py:371— shard_map._shmap_checks 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.
discharge.transform_swap_array (cyclomatic 17) jax/_src/state/discharge.py:553— discharge.transform_swap_array 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.
NDIndexer.__post_init__ (cyclomatic 17) jax/_src/state/indexing.py:95— NDIndexer.__post_init__ 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.
primitives._swap_vmap (cyclomatic 17) jax/_src/state/primitives.py:981— primitives._swap_vmap 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.
svd.svd (cyclomatic 17) jax/_src/tpu/linalg/svd.py:123— svd.svd 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.
tree_util._register_dataclass (cyclomatic 17) jax/_src/tree_util.py:1151— tree_util._register_dataclass 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.
layout_inference._extract_layout_candidates_from_tmem_registers_transfer (cyclomatic 17) jax/experimental/mosaic/gpu/layout_inference.py:297— layout_inference._extract_layout_candidates_from_tmem_registers_transfer 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.
tcgen05._create_scaled_instr_descriptor (cyclomatic 17) jax/experimental/mosaic/gpu/tcgen05.py:136— tcgen05._create_scaled_instr_descriptor 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.
bcoo.bcoo_concatenate (cyclomatic 17) jax/experimental/sparse/bcoo.py:1767— bcoo.bcoo_concatenate 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.
bcsr._bcsr_dot_general_gpu_lowering (cyclomatic 17) jax/experimental/sparse/bcsr.py:624— bcsr._bcsr_dot_general_gpu_lowering 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.
callback.emit_python_callback (cyclomatic 16) jax/_src/callback.py:764— callback.emit_python_callback 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.
dispatch._device_put_impl (cyclomatic 16) jax/_src/dispatch.py:606— dispatch._device_put_impl 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.
dtypes._least_upper_bound (cyclomatic 16) jax/_src/dtypes.py:823— dtypes._least_upper_bound has cyclomatic complexity 16 (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.
loops._scan_batching_rule (cyclomatic 16) jax/_src/lax/control_flow/loops.py:1225— loops._scan_batching_rule has cyclomatic complexity 16 (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.
lax._dot_general_shape_rule (cyclomatic 16) jax/_src/lax/lax.py:6746— lax._dot_general_shape_rule has cyclomatic complexity 16 (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.
scaled_dot._scaled_dot_validate_inputs (cyclomatic 16) jax/_src/lax/scaled_dot.py:51— scaled_dot._scaled_dot_validate_inputs 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.
slicing._gather_spec_computation (cyclomatic 16) jax/_src/lax/slicing.py:2131— slicing._gather_spec_computation has cyclomatic complexity 16 (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.
fft._fft_core (cyclomatic 16) jax/_src/numpy/fft.py:49— fft._fft_core has cyclomatic complexity 16 (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.
indexing._take (cyclomatic 16) jax/_src/numpy/indexing.py:731— indexing._take has cyclomatic complexity 16 (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.
indexing.rewriting_take (cyclomatic 16) jax/_src/numpy/indexing.py:1165— indexing.rewriting_take 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.
lax_numpy._repeat (cyclomatic 16) jax/_src/numpy/lax_numpy.py:6484— lax_numpy._repeat 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.
ufunc._reduce_via_scan (cyclomatic 16) jax/_src/numpy/ufunc_api.py:262— ufunc._reduce_via_scan has cyclomatic complexity 16 (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.
shard_map_fusion.fuse_shard_map_jaxpr (cyclomatic 16) jax/_src/pallas/fuser/shard_map_fusion.py:219— shard_map_fusion.fuse_shard_map_jaxpr has cyclomatic complexity 16 (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.
interpret_pallas_call.get (cyclomatic 16) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:631— interpret_pallas_call.get 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.
primitives.dma_start_discharge_rule (cyclomatic 16) jax/_src/pallas/mosaic/primitives.py:508— primitives.dma_start_discharge_rule 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.
lowering.lower_jaxpr_to_module (cyclomatic 16) jax/_src/pallas/mosaic_gpu/lowering.py:737— lowering.lower_jaxpr_to_module has cyclomatic complexity 16 (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.
pmap._get_in_axes_flat (cyclomatic 16) jax/_src/pmap.py:561— pmap._get_in_axes_flat 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.
pmap.host_local_array_to_global_array (cyclomatic 16) jax/_src/pmap.py:777— pmap.host_local_array_to_global_array 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.
fft.dctn (cyclomatic 16) jax/_src/scipy/fft.py:159— fft.dctn has cyclomatic complexity 16 (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.
linalg.eigh_tridiagonal (cyclomatic 16) jax/_src/scipy/linalg.py:1736— linalg.eigh_tridiagonal has cyclomatic complexity 16 (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.
IsTransferableTmemRegisters.is_valid_tmem_transfer (cyclomatic 16) jax/experimental/mosaic/gpu/constraints.py:605— IsTransferableTmemRegisters.is_valid_tmem_transfer has cyclomatic complexity 16 (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.
FragmentedArray.store_untiled (cyclomatic 16) jax/experimental/mosaic/gpu/fragmented_array.py:4135— FragmentedArray.store_untiled 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.
launch_context._tma_dma_type (cyclomatic 16) jax/experimental/mosaic/gpu/launch_context.py:735— launch_context._tma_dma_type has cyclomatic complexity 16 (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.
ProfilerSpec.dump (cyclomatic 16) jax/experimental/mosaic/gpu/profiler.py:255— ProfilerSpec.dump 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.
utils.bitcast (cyclomatic 16) jax/experimental/mosaic/gpu/utils.py:2282— utils.bitcast has cyclomatic complexity 16 (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.
all_gather_mgpu.all_gather (cyclomatic 16) jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:32— all_gather_mgpu.all_gather has cyclomatic complexity 16 (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.
attention_mgpu._attention_forward (cyclomatic 16) jax/experimental/pallas/ops/gpu/attention_mgpu.py:72— attention_mgpu._attention_forward has cyclomatic complexity 16 (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.
bcoo.bcoo_update_layout (cyclomatic 16) jax/experimental/sparse/bcoo.py:1572— bcoo.bcoo_update_layout has cyclomatic complexity 16 (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.
LaunchContext.async_copy (cognitive 225) jax/experimental/mosaic/gpu/launch_context.py:1473— LaunchContext.async_copy has cognitive complexity 225 (threshold 15). Drivers by points: if/else 90 (176 pts), loops 8 (18 pts), ternaries 6 (17 pts), boolean chains 14 (nesting depth added 107). 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.
tcgen05.mma (cognitive 194) jax/experimental/mosaic/gpu/tcgen05.py:216— tcgen05.mma has cognitive complexity 194 (threshold 15). Drivers by points: if/else 86 (143 pts), boolean chains 29, ternaries 12 (21 pts), loops 1 (nesting depth added 66). 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.
mlir.lower_jaxpr_to_fun (cognitive 184) jax/_src/interpreters/mlir.py:1779— mlir.lower_jaxpr_to_fun has cognitive complexity 184 (threshold 15). Drivers by points: if/else 55 (95 pts), loops 19 (49 pts), boolean chains 20, ternaries 11 (20 pts) (nesting depth added 79). 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.
FragmentedArray.astype (cognitive 153) jax/experimental/mosaic/gpu/fragmented_array.py:2507— FragmentedArray.astype has cognitive complexity 153 (threshold 15). Drivers by points: if/else 49 (74 pts), boolean chains 38, loops 9 (22 pts), ternaries 8 (15 pts), match/switch 2 (4 pts) (nesting depth added 47). 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.
FragmentedArray.transfer_tiled (cognitive 149) jax/experimental/mosaic/gpu/fragmented_array.py:4749— FragmentedArray.transfer_tiled has cognitive complexity 149 (threshold 15). Drivers by points: if/else 55 (100 pts), loops 11 (23 pts), boolean chains 18, ternaries 5 (8 pts) (nesting depth added 60). 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.
FragmentedArray.reduce (cognitive 115) jax/experimental/mosaic/gpu/fragmented_array.py:3299— FragmentedArray.reduce has cognitive complexity 115 (threshold 15). Drivers by points: if/else 43 (79 pts), ternaries 6 (17 pts), loops 5 (9 pts), boolean chains 7, match/switch 2 (3 pts) (nesting depth added 52). 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.
lowering.lower_jaxpr_into_pipelined_module (cognitive 108) jax/_src/pallas/mosaic/lowering.py:1104— lowering.lower_jaxpr_into_pipelined_module has cognitive complexity 108 (threshold 15). Drivers by points: if/else 26 (72 pts), loops 8 (21 pts), ternaries 3 (10 pts), boolean chains 5 (nesting depth added 66). 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.
reductions._quantile (cognitive 103) jax/_src/numpy/reductions.py:2720— reductions._quantile has cognitive complexity 103 (threshold 15). Drivers by points: if/else 52 (86 pts), ternaries 4 (8 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 40). 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.
primitives._copy_gmem_to_smem_lowering (cognitive 91) jax/_src/pallas/mosaic_gpu/primitives.py:975— primitives._copy_gmem_to_smem_lowering has cognitive complexity 91 (threshold 15). Drivers by points: if/else 44 (76 pts), boolean chains 7, match/switch 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 35). 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.
splash_attention_mask_info._process_mask (cognitive 90) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:518— splash_attention_mask_info._process_mask has cognitive complexity 90 (threshold 15). Drivers by points: if/else 28 (47 pts), loops 10 (20 pts), ternaries 9 (17 pts), boolean chains 6 (nesting depth added 37). 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.
CustomCallBackendConfig.to_json (cognitive 81) jax/_src/tpu_custom_call.py:251— CustomCallBackendConfig.to_json has cognitive complexity 81 (threshold 15). Drivers by points: if/else 38 (62 pts), ternaries 3 (9 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 34). 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.
lowering.jaxpr_subcomp (cognitive 80) jax/_src/pallas/mosaic/lowering.py:1790— lowering.jaxpr_subcomp has cognitive complexity 80 (threshold 15). Drivers by points: if/else 14 (42 pts), error handling 3 (13 pts), ternaries 4 (13 pts), loops 5 (9 pts), boolean chains 3 (nesting depth added 51). 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.
hlo._parse_hlo_new_format (cognitive 76) jax/experimental/source_mapper/hlo.py:68— hlo._parse_hlo_new_format has cognitive complexity 76 (threshold 15). Drivers by points: if/else 18 (66 pts), loops 4 (10 pts) (nesting depth added 54). 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.
FragmentedArray.to_layout (cognitive 73) jax/experimental/mosaic/gpu/fragmented_array.py:1352— FragmentedArray.to_layout has cognitive complexity 73 (threshold 15). Drivers by points: loops 11 (29 pts), if/else 17 (25 pts), ternaries 3 (11 pts), boolean chains 8 (nesting depth added 34). 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.
einsum._einsum (cognitive 68) jax/_src/numpy/einsum.py:441— einsum._einsum has cognitive complexity 68 (threshold 15). Drivers by points: if/else 17 (39 pts), ternaries 4 (16 pts), boolean chains 12, loops 1 (nesting depth added 34). 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.
dispatch._device_put_sharding_impl (cognitive 64) jax/_src/dispatch.py:471— dispatch._device_put_sharding_impl has cognitive complexity 64 (threshold 15). Drivers by points: if/else 22 (47 pts), boolean chains 13, ternaries 2 (4 pts) (nesting depth added 27). 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.
FragmentedArray._store_register_atomic (cognitive 63) jax/experimental/mosaic/gpu/fragmented_array.py:4375— FragmentedArray._store_register_atomic has cognitive complexity 63 (threshold 15). Drivers by points: if/else 22 (39 pts), ternaries 6 (14 pts), boolean chains 7, loops 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.
interpret_pallas_call._interpret_jaxpr (cognitive 62) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1349— interpret_pallas_call._interpret_jaxpr has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (47 pts), loops 3 (7 pts), boolean chains 5, ternaries 2 (3 pts) (nesting depth added 35). 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.
signal._spectral_helper (cognitive 60) jax/_src/scipy/signal.py:615— signal._spectral_helper has cognitive complexity 60 (threshold 15). Drivers by points: if/else 40 (49 pts), boolean chains 6, ternaries 2 (3 pts), error handling 1 (2 pts) (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.
array_constructors.array (cognitive 59) jax/_src/numpy/array_constructors.py:107— array_constructors.array has cognitive complexity 59 (threshold 15). Drivers by points: if/else 24 (34 pts), boolean chains 10, ternaries 5 (10 pts), loops 1 (3 pts), error handling 1 (2 pts) (nesting depth added 18). 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.
thunky._transforms_to_slice_params (cognitive 54) jax/_src/thunky/thunky.py:191— thunky._transforms_to_slice_params has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (47 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 35). 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.
lowering._compute_offsets_from_indices (cognitive 52) jax/_src/pallas/triton/lowering.py:1924— lowering._compute_offsets_from_indices has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (32 pts), loops 4 (11 pts), ternaries 2 (4 pts), boolean chains 3, match/switch 1 (2 pts) (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.
core._launch (cognitive 51) jax/experimental/mosaic/gpu/core.py:751— core._launch has cognitive complexity 51 (threshold 15). Drivers by points: if/else 30 (42 pts), loops 3 (6 pts), boolean chains 3 (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.
custom_partitioning_sharding_rule._parse_values (cognitive 50) jax/_src/custom_partitioning_sharding_rule.py:212— custom_partitioning_sharding_rule._parse_values has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (41 pts), loops 2 (5 pts), boolean chains 4 (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.
slicing._dynamic_slice_indices (cognitive 50) jax/_src/lax/slicing.py:3922— slicing._dynamic_slice_indices has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (32 pts), ternaries 3 (11 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 24). 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.
evaluate_sampler_bias.evaluate_bias (cognitive 50) jax/tools/evaluate_sampler_bias.py:187— evaluate_sampler_bias.evaluate_bias has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (22 pts), ternaries 5 (13 pts), error handling 4 (9 pts), loops 4 (6 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.
LaunchContext.async_copy_im2col (cognitive 49) jax/experimental/mosaic/gpu/launch_context.py:2266— LaunchContext.async_copy_im2col has cognitive complexity 49 (threshold 15). Drivers by points: if/else 29 (42 pts), loops 4, boolean chains 3 (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.
mlir._set_up_aliases (cognitive 48) jax/_src/interpreters/mlir.py:1604— mlir._set_up_aliases has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (33 pts), boolean chains 11, loops 4 (nesting depth added 18). 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.
lax._convert_element_type (cognitive 48) jax/_src/lax/lax.py:1841— lax._convert_element_type has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 15, error handling 1 (4 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.
pallas_call_registration.mpmd_map_tpu_lowering_rule (cognitive 48) jax/_src/pallas/mosaic/pallas_call_registration.py:612— pallas_call_registration.mpmd_map_tpu_lowering_rule has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (32 pts), ternaries 3 (6 pts), loops 3 (4 pts), boolean chains 3, match/switch 2 (3 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.
core._mosaic_gpu_lowering_rule (cognitive 48) jax/experimental/mosaic/gpu/core.py:211— core._mosaic_gpu_lowering_rule has cognitive complexity 48 (threshold 15). Drivers by points: if/else 25 (45 pts), boolean chains 2, ternaries 1 (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.
compiler.get_compile_options (cognitive 47) jax/_src/compiler.py:187— compiler.get_compile_options has cognitive complexity 47 (threshold 15). Drivers by points: if/else 23 (38 pts), boolean chains 5, loops 2 (4 pts) (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.
custom_partitioning_sharding_rule.sdy_sharding_rule_to_mlir (cognitive 47) jax/_src/custom_partitioning_sharding_rule.py:363— custom_partitioning_sharding_rule.sdy_sharding_rule_to_mlir has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (30 pts), loops 7 (14 pts), boolean chains 3 (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.
_export._export_lowered (cognitive 47) jax/_src/export/_export.py:698— _export._export_lowered has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (31 pts), ternaries 3 (6 pts), boolean chains 5, loops 3 (5 pts) (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.
ProfilerSpec.dump (cognitive 47) jax/experimental/mosaic/gpu/profiler.py:255— ProfilerSpec.dump has cognitive complexity 47 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 4 (11 pts), ternaries 2 (8 pts) (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.
mlir.lower_jaxpr_to_module (cognitive 46) jax/_src/interpreters/mlir.py:1436— mlir.lower_jaxpr_to_module has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (26 pts), ternaries 6 (9 pts), boolean chains 5, loops 2 (5 pts), error handling 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.
indexing._index_to_gather (cognitive 45) jax/_src/numpy/indexing.py:1405— indexing._index_to_gather has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (37 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 18). 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.
shard_map_fusion._make_block_extractor (cognitive 45) jax/_src/pallas/fuser/shard_map_fusion.py:69— shard_map_fusion._make_block_extractor has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 6, ternaries 4 (6 pts), error handling 2 (4 pts), loops 2 (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.
discharge._eval_jaxpr_discharge_state (cognitive 45) jax/_src/state/discharge.py:233— discharge._eval_jaxpr_discharge_state has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (39 pts), loops 2 (4 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.
ad.backward_pass3 (cognitive 44) jax/_src/interpreters/ad.py:300— ad.backward_pass3 has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 5 (10 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 22). 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.
pipeline._emit_pipeline_effectful_abstract_eval (cognitive 44) jax/_src/pallas/mosaic/pipeline.py:2475— pipeline._emit_pipeline_effectful_abstract_eval has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (30 pts), ternaries 3 (9 pts), loops 3, boolean chains 2 (nesting depth added 24). 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.
LaunchContext._prepare_async_copy (cognitive 44) jax/experimental/mosaic/gpu/launch_context.py:1150— LaunchContext._prepare_async_copy has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (38 pts), boolean chains 4, loops 1, ternaries 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.
layout_inference._check_unsatisfiable_divisibility_constraints (cognitive 44) jax/experimental/mosaic/gpu/layout_inference.py:2645— layout_inference._check_unsatisfiable_divisibility_constraints has cognitive complexity 44 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 7 (15 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 25). 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.
utils.multimem_load_reduce (cognitive 44) jax/experimental/mosaic/gpu/utils.py:423— utils.multimem_load_reduce has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (36 pts), loops 1 (4 pts), ternaries 1 (4 pts) (nesting depth added 24). 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.
core._check_jaxpr (cognitive 43) jax/_src/core.py:3708— core._check_jaxpr has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 5 (8 pts), error handling 1 (2 pts) (nesting depth added 24). 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.
utils.parse_indices (cognitive 43) jax/experimental/mosaic/gpu/utils.py:1086— utils.parse_indices has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 11, loops 1 (nesting depth added 18). 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.
lowering._check_block_mappings (cognitive 42) jax/_src/pallas/mosaic/lowering.py:959— lowering._check_block_mappings has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 8, loops 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.
constraints.reduce_constraint (cognitive 42) jax/experimental/mosaic/gpu/constraints.py:939— constraints.reduce_constraint has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 7, match/switch 1 (nesting depth added 17). 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.
TMEMRef.load (cognitive 42) jax/experimental/mosaic/gpu/tcgen05.py:1431— TMEMRef.load has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 12 (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.
tcgen05._do_mma (cognitive 42) jax/experimental/mosaic/gpu/tcgen05.py:665— tcgen05._do_mma has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 9 (15 pts), boolean chains 8, loops 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.
interpret_pallas_call.interpret_pallas_call (cognitive 41) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:2003— interpret_pallas_call.interpret_pallas_call has cognitive complexity 41 (threshold 15). Drivers by points: if/else 22 (33 pts), loops 5, boolean chains 2, ternaries 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.
pallas_call_registration._resolve_memory_spaces (cognitive 41) jax/_src/pallas/mosaic/pallas_call_registration.py:152— pallas_call_registration._resolve_memory_spaces has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 2 (5 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 23). 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.
mpmd._mpmd_map_abstract_eval (cognitive 41) jax/_src/pallas/mpmd.py:91— mpmd._mpmd_map_abstract_eval has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 6, ternaries 3 (4 pts), loops 2 (3 pts) (nesting depth added 18). 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.
lax_numpy.cov (cognitive 40) jax/_src/numpy/lax_numpy.py:9176— lax_numpy.cov has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (28 pts), ternaries 5 (9 pts), boolean chains 3 (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.
einshape._inverse_block_transform (cognitive 40) jax/_src/pallas/einshape.py:535— einshape._inverse_block_transform has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (22 pts), ternaries 4 (9 pts), loops 3 (8 pts), match/switch 1 (nesting depth added 22). 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.
Barrier._wait (cognitive 40) jax/_src/pallas/mosaic_gpu/interpret/shared_memory.py:1380— Barrier._wait has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (32 pts), loops 2 (4 pts), boolean chains 3, ternaries 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.
torch._find_mgpu_call (cognitive 40) jax/_src/pallas/mosaic_gpu/torch.py:107— torch._find_mgpu_call has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 3, error handling 1 (3 pts), loops 2 (nesting depth added 19). 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.
splash_attention_mask_info._get_mask_info_for_shard (cognitive 40) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:172— splash_attention_mask_info._get_mask_info_for_shard has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (26 pts), error handling 2 (7 pts), ternaries 2 (3 pts), boolean chains 2, loops 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.
lowering._run_scoped_lowering_rule (cognitive 39) jax/_src/pallas/mosaic_gpu/lowering.py:3476— lowering._run_scoped_lowering_rule has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 6, loops 2 (4 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.
primitives._batch_indexer (cognitive 39) jax/_src/state/primitives.py:799— primitives._batch_indexer has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (37 pts), boolean chains 1, loops 1 (nesting depth added 22). 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.
wgmma._wgmma_m64 (cognitive 39) jax/experimental/mosaic/gpu/wgmma.py:119— wgmma._wgmma_m64 has cognitive complexity 39 (threshold 15). Drivers by points: if/else 24 (28 pts), boolean chains 5, ternaries 3 (4 pts), loops 2 (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.
splash_attention_kernel._splash_attention_forward (cognitive 39) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:912— splash_attention_kernel._splash_attention_forward has cognitive complexity 39 (threshold 15). Drivers by points: if/else 28 (31 pts), ternaries 5, boolean chains 3 (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.
fused_attention_stablehlo.dot_product_attention (cognitive 38) jax/_src/cudnn/fused_attention_stablehlo.py:2032— fused_attention_stablehlo.dot_product_attention has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 10 (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.
debugging.visualize_sharding (cognitive 38) jax/_src/debugging.py:861— debugging.visualize_sharding has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 5 (11 pts), loops 3 (4 pts), boolean chains 3, error handling 1 (2 pts) (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.
pxla.lower_sharding_computation (cognitive 38) jax/_src/interpreters/pxla.py:956— pxla.lower_sharding_computation has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 7, ternaries 5 (6 pts), loops 2 (3 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.
linalg._eig_gpu_lowering (cognitive 38) jax/_src/lax/linalg.py:1104— linalg._eig_gpu_lowering has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (28 pts), ternaries 2 (6 pts), boolean chains 4 (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.
reductions._reduction (cognitive 38) jax/_src/numpy/reductions.py:101— reductions._reduction has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 11, ternaries 3 (4 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.
NDIndexer.__post_init__ (cognitive 38) jax/_src/state/indexing.py:95— NDIndexer.__post_init__ has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (30 pts), error handling 2 (4 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 22). 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.
FragmentedArray._pointwise (cognitive 38) jax/experimental/mosaic/gpu/fragmented_array.py:1629— FragmentedArray._pointwise has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (32 pts), loops 3 (4 pts), boolean chains 2 (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.
paged_attention_kernel.paged_attention (cognitive 38) jax/experimental/pallas/ops/tpu/paged_attention/paged_attention_kernel.py:391— paged_attention_kernel.paged_attention has cognitive complexity 38 (threshold 15). Drivers by points: if/else 25 (29 pts), ternaries 4 (8 pts), boolean chains 1 (nesting depth added 8). 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.
lax.broadcasting_sharding_rule (cognitive 37) jax/_src/lax/lax.py:4705— lax.broadcasting_sharding_rule has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 3 (6 pts), boolean chains 5, ternaries 1 (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.
lowering._dot_general_lowering_rule (cognitive 37) jax/_src/pallas/mosaic/lowering.py:3013— lowering._dot_general_lowering_rule has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (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.
lowering._lower_jaxpr_to_for_loop (cognitive 37) jax/_src/pallas/mosaic/lowering.py:4610— lowering._lower_jaxpr_to_for_loop has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 6, loops 3 (6 pts), ternaries 1 (2 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.
sc_lowering._store_lowering_rule (cognitive 37) jax/_src/pallas/mosaic/sc_lowering.py:258— sc_lowering._store_lowering_rule has cognitive complexity 37 (threshold 15). Drivers by points: if/else 23 (31 pts), boolean chains 4, loops 1, ternaries 1 (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.
lowering._handle_transforms (cognitive 37) jax/_src/pallas/mosaic_gpu/lowering.py:1664— lowering._handle_transforms has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (32 pts), match/switch 1 (2 pts), boolean chains 1, loops 1, ternaries 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.
lowering._swap_lowering_rule (cognitive 37) jax/_src/pallas/mosaic_gpu/lowering.py:2004— lowering._swap_lowering_rule has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (27 pts), loops 3 (6 pts), match/switch 2 (3 pts), boolean chains 1 (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.
FragmentedArray.load_tiled (cognitive 37) jax/experimental/mosaic/gpu/fragmented_array.py:4595— FragmentedArray.load_tiled has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 3 (6 pts), boolean chains 4, error handling 1 (2 pts), ternaries 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.
wgmma.wgmma (cognitive 37) jax/experimental/mosaic/gpu/wgmma.py:292— wgmma.wgmma has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 8, ternaries 2, loops 1 (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.
BufferedRef.create (cognitive 36) jax/_src/pallas/mosaic/pipeline.py:648— BufferedRef.create has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 4 (7 pts), boolean chains 6 (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.
lowering._convert_element_type_lowering_rule_wg (cognitive 36) jax/_src/pallas/mosaic_gpu/lowering.py:2416— lowering._convert_element_type_lowering_rule_wg has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 4, ternaries 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.
utils.pattern_match_while_to_fori_loop (cognitive 36) jax/_src/pallas/utils.py:171— utils.pattern_match_while_to_fori_loop has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 2, loops 1 (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.
signal.istft (cognitive 36) jax/_src/scipy/signal.py:1051— signal.istft has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 5, ternaries 3 (4 pts), error handling 1 (2 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.
LaunchContext._prepare_tma (cognitive 36) jax/experimental/mosaic/gpu/launch_context.py:1302— LaunchContext._prepare_tma has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 16). 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.
pxla._get_and_check_device_assignment (cognitive 35) jax/_src/interpreters/pxla.py:521— pxla._get_and_check_device_assignment has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 7, ternaries 2, loops 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.
NDIndexer.to_dynamic_slice (cognitive 35) jax/_src/numpy/indexing.py:489— NDIndexer.to_dynamic_slice has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 3, loops 2 (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.
mlir.lower_per_platform (cognitive 34) jax/_src/interpreters/mlir.py:2689— mlir.lower_per_platform has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 6 (9 pts), error handling 1 (2 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.
mesh_utils._create_device_mesh_for_nd_torus (cognitive 34) jax/_src/mesh_utils.py:252— mesh_utils._create_device_mesh_for_nd_torus has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 5 (9 pts), ternaries 1 (5 pts), boolean chains 1 (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.
linalg.norm (cognitive 34) jax/_src/numpy/linalg.py:1203— linalg.norm has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 5, ternaries 1 (2 pts), match/switch 1 (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.
lowering._dot_general_lowering (cognitive 34) jax/_src/pallas/triton/lowering.py:2454— lowering._dot_general_lowering has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 3, match/switch 1 (2 pts), loops 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.
utils.pattern_match_scan_to_fori_loop (cognitive 34) jax/_src/pallas/utils.py:114— utils.pattern_match_scan_to_fori_loop has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 22). 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.
shard_map._unshard_shaped_array (cognitive 34) jax/_src/shard_map.py:980— shard_map._unshard_shaped_array has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 4 (10 pts), boolean chains 9, loops 1 (2 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.
discharge.transform_swap_array (cognitive 34) jax/_src/state/discharge.py:553— discharge.transform_swap_array has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (30 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 19). 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.
mma_utils.create_descriptor (cognitive 34) jax/experimental/mosaic/gpu/mma_utils.py:116— mma_utils.create_descriptor has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 9 (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.
convolution._conv_general_dilated_batch_rule (cognitive 33) jax/_src/lax/convolution.py:601— convolution._conv_general_dilated_batch_rule has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 7, ternaries 2 (5 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.
BlockSpec.to_block_mapping (cognitive 33) jax/_src/pallas/core.py:688— BlockSpec.to_block_mapping has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 4, loops 2, match/switch 1 (2 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.
lowering._masked_swap_lowering_rule (cognitive 33) jax/_src/pallas/mosaic/lowering.py:2658— lowering._masked_swap_lowering_rule has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 2, loops 1, ternaries 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.
lowering._extract_aliased_ref (cognitive 33) jax/_src/pallas/mosaic_gpu/lowering.py:1323— lowering._extract_aliased_ref has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 2, match/switch 1 (nesting depth added 18). 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.
primitives._tcgen05_mma_lowering (cognitive 33) jax/_src/pallas/mosaic_gpu/primitives.py:2814— primitives._tcgen05_mma_lowering has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25 (30 pts), match/switch 2, boolean chains 1 (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.
fragmented_array.concatenate (cognitive 33) jax/experimental/mosaic/gpu/fragmented_array.py:6048— fragmented_array.concatenate has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 4 (7 pts), boolean chains 1, match/switch 1 (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.
splash_attention_kernel._splash_attention_bwd_dkv (cognitive 33) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1871— splash_attention_kernel._splash_attention_bwd_dkv has cognitive complexity 33 (threshold 15). Drivers by points: if/else 24 (25 pts), ternaries 7, boolean chains 1 (nesting depth added 1). 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.
pallas_call._pallas_call_batching_rule (cognitive 32) jax/_src/pallas/pallas_call.py:520— pallas_call._pallas_call_batching_rule has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (22 pts), ternaries 4 (6 pts), boolean chains 3, loops 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.
lowering._ir_cast (cognitive 32) jax/_src/pallas/triton/lowering.py:1684— lowering._ir_cast has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 9, loops 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.
lowering._maybe_pattern_match_fori_loop (cognitive 32) jax/_src/pallas/triton/lowering.py:2840— lowering._maybe_pattern_match_fori_loop has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 2, loops 1 (nesting depth added 15). 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.
pjit._resolve_in_layouts (cognitive 32) jax/_src/pjit.py:958— pjit._resolve_in_layouts has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (23 pts), ternaries 2 (6 pts), boolean chains 2, loops 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.
bessel._yn_series (cognitive 32) jax/_src/scipy/bessel.py:930— bessel._yn_series has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 10 (15 pts), boolean chains 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.
dialect_lowering._memref_subview_op_lowering_rule (cognitive 32) jax/experimental/mosaic/gpu/dialect_lowering.py:1936— dialect_lowering._memref_subview_op_lowering_rule has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 2 (4 pts), match/switch 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.
_DecisionByElimination._bounds_for_sorted_terms (cognitive 31) jax/_src/export/shape_poly_decision.py:284— _DecisionByElimination._bounds_for_sorted_terms has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (26 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (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.
primitives._device_id_dict_to_mesh (cognitive 31) jax/_src/pallas/primitives.py:1205— primitives._device_id_dict_to_mesh has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 3 (5 pts), boolean chains 2 (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.
constraints.reduce_collapse_shape_expression (cognitive 31) jax/experimental/mosaic/gpu/constraints.py:328— constraints.reduce_collapse_shape_expression has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 3 (7 pts), match/switch 1 (nesting depth added 19). 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.
FragmentedArray.store_tiled (cognitive 31) jax/experimental/mosaic/gpu/fragmented_array.py:4513— FragmentedArray.store_tiled has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (8 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (2 pts) (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.
FragmentedArray.transfer_strided (cognitive 31) jax/experimental/mosaic/gpu/fragmented_array.py:4696— FragmentedArray.transfer_strided has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (23 pts), loops 3 (7 pts), error handling 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.
fused_attention_stablehlo.check_is_flash_attention (cognitive 30) jax/_src/cudnn/fused_attention_stablehlo.py:352— fused_attention_stablehlo.check_is_flash_attention has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 11, ternaries 1 (2 pts) (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.
dlpack.from_dlpack (cognitive 30) jax/_src/dlpack.py:234— dlpack.from_dlpack has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5, error handling 4 (5 pts), ternaries 3 (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.
_DimFactor.evaluate (cognitive 30) jax/_src/export/shape_poly.py:228— _DimFactor.evaluate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 5, error handling 1 (2 pts) (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.
conditionals.cond (cognitive 30) jax/_src/lax/control_flow/conditionals.py:195— conditionals.cond has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 4, ternaries 3 (4 pts), error handling 1 (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.
conditionals._check_branch_outputs (cognitive 30) jax/_src/lax/control_flow/conditionals.py:337— conditionals._check_branch_outputs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 2 (5 pts), boolean chains 2, error handling 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.
loops._check_carry_type (cognitive 30) jax/_src/lax/control_flow/loops.py:531— loops._check_carry_type has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (25 pts), error handling 2 (3 pts), boolean chains 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.
lax._get_monoid_reducer (cognitive 30) jax/_src/lax/lax.py:3502— lax._get_monoid_reducer has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 7 (21 pts), boolean chains 5, if/else 3 (4 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.
slicing._scatter_unreduced_rule (cognitive 30) jax/_src/lax/slicing.py:3060— slicing._scatter_unreduced_rule has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 4, ternaries 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.
functions.dot_product_attention (cognitive 30) jax/_src/nn/functions.py:1053— functions.dot_product_attention has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 3, ternaries 3, 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.
polynomial.polyfit (cognitive 30) jax/_src/numpy/polynomial.py:127— polynomial.polyfit has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22 (29 pts), boolean chains 1 (nesting depth added 7). 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.
_core.jaxpr_type_signature (cognitive 30) jax/experimental/key_reuse/_core.py:329— _core.jaxpr_type_signature has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 5 (9 pts), boolean chains 4 (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.
attention_mgpu.main (cognitive 30) jax/experimental/pallas/ops/gpu/attention_mgpu.py:849— attention_mgpu.main has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 3, error handling 1 (3 pts), loops 2 (3 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.
custom_vjp.__call__ (cognitive 29) jax/_src/custom_derivatives.py:806— custom_vjp.__call__ has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 2 (6 pts), boolean chains 4, loops 1 (2 pts), error handling 1 (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.
_Parser.shape (cognitive 29) jax/_src/export/shape_poly.py:1640— _Parser.shape has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (4 pts), boolean chains 3 (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.
utils._device_id_dict_to_mesh (cognitive 29) jax/_src/pallas/mosaic/interpret/utils.py:156— utils._device_id_dict_to_mesh has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 3 (5 pts), boolean chains 2 (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.
mpmd._mpmd_map_batching_rule (cognitive 29) jax/_src/pallas/mpmd.py:519— mpmd._mpmd_map_batching_rule has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 5 (8 pts), ternaries 2 (3 pts), 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.
pmap.global_array_to_host_local_array (cognitive 29) jax/_src/pmap.py:867— pmap.global_array_to_host_local_array has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (23 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (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.
core._sample_sharding (cognitive 29) jax/_src/random/core.py:517— core._sample_sharding has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 2 (5 pts), boolean chains 3, loops 2 (3 pts), error handling 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.
tcgen05._load_32xcols_native (cognitive 29) jax/experimental/mosaic/gpu/tcgen05.py:1844— tcgen05._load_32xcols_native has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 2 (8 pts), loops 2 (3 pts), boolean chains 2 (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.
api.device_put (cognitive 28) jax/_src/api.py:2388— api.device_put has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 7, loops 2 (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.
_DecisionByElimination.add_implicit_constraints_term (cognitive 28) jax/_src/export/shape_poly_decision.py:362— _DecisionByElimination.add_implicit_constraints_term has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 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.
loops.fori_loop (cognitive 28) jax/_src/lax/control_flow/loops.py:2699— loops.fori_loop has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 6, error handling 1 (2 pts) (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.
lax_numpy._repeat (cognitive 28) jax/_src/numpy/lax_numpy.py:6484— lax_numpy._repeat has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 3 (7 pts), boolean chains 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.
setops._unique (cognitive 28) jax/_src/numpy/setops.py:616— setops._unique has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 2, ternaries 2 (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.
einshape._get_einshape_dims (cognitive 28) jax/_src/pallas/einshape.py:165— einshape._get_einshape_dims has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (4 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.
hlo_interpreter.pallas_call_hlo_interpret (cognitive 28) jax/_src/pallas/hlo_interpreter.py:316— hlo_interpreter.pallas_call_hlo_interpret has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 5 (7 pts), boolean chains 3, 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.
lowering._broadcast_in_dim_lowering_rule (cognitive 28) jax/_src/pallas/mosaic_gpu/lowering.py:2306— lowering._broadcast_in_dim_lowering_rule has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 3, loops 1 (2 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.
primitives._inline_mgpu_flat_transformed_args (cognitive 28) jax/_src/pallas/mosaic_gpu/primitives.py:3718— primitives._inline_mgpu_flat_transformed_args has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 2 (4 pts), boolean chains 2, loops 2 (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.
pmap.host_local_array_to_global_array (cognitive 28) jax/_src/pmap.py:777— pmap.host_local_array_to_global_array has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 4, 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.
tpu_custom_call._lowered_to_custom_call_config (cognitive 28) jax/_src/tpu_custom_call.py:739— tpu_custom_call._lowered_to_custom_call_config has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 10, ternaries 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.
layout_inference.derive_relayout_constraints (cognitive 28) jax/experimental/mosaic/gpu/layout_inference.py:2548— layout_inference.derive_relayout_constraints has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 5 (10 pts) (nesting depth added 18). 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.
custom_derivatives._flatten_bwd (cognitive 27) jax/_src/custom_derivatives.py:1074— custom_derivatives._flatten_bwd has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 5, ternaries 1 (2 pts), error handling 1, loops 1 (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.
_export._call_exported_lowering (cognitive 27) jax/_src/export/_export.py:1521— _export._call_exported_lowering has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (19 pts), loops 3 (4 pts), ternaries 3, boolean chains 1 (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.
_DecisionByElimination.combine_constraint_with_existing (cognitive 27) jax/_src/export/shape_poly_decision.py:228— _DecisionByElimination.combine_constraint_with_existing has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 5, ternaries 1 (4 pts), loops 2 (3 pts) (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.
ffi.ffi_batching_rule (cognitive 27) jax/_src/ffi.py:679— ffi.ffi_batching_rule has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 7 (16 pts), if/else 6 (8 pts), boolean chains 3 (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.
pxla._maybe_get_and_check_out_shardings (cognitive 27) jax/_src/interpreters/pxla.py:1575— pxla._maybe_get_and_check_out_shardings has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 5, error handling 1 (4 pts), 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.
slicing._gather_shape_rule (cognitive 27) jax/_src/lax/slicing.py:1941— slicing._gather_shape_rule has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5, loops 5 (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.
NDIndexer.to_static_slice (cognitive 27) jax/_src/numpy/indexing.py:388— NDIndexer.to_static_slice has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 2, loops 2, ternaries 1 (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.
interpret_pallas_call.get (cognitive 27) jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:631— interpret_pallas_call.get has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 1, error handling 1, loops 1, ternaries 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.
utils.is_range_out_of_bounds_for_shape (cognitive 27) jax/_src/pallas/mosaic/interpret/utils.py:445— utils.is_range_out_of_bounds_for_shape has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 3, loops 1 (nesting depth added 15). 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.
primitives._get_barrier_base_index (cognitive 27) jax/_src/pallas/mosaic_gpu/primitives.py:1662— primitives._get_barrier_base_index has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (4 pts), match/switch 1 (2 pts) (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.
primitives._populate_custom_primitive_op_block (cognitive 27) jax/_src/pallas/mosaic_gpu/primitives.py:3917— primitives._populate_custom_primitive_op_block has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2, 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.
pjit._run_python_pjit (cognitive 27) jax/_src/pjit.py:136— pjit._run_python_pjit has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 4 (7 pts), loops 2 (4 pts), ternaries 1 (2 pts), 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.
pjit._resolve_in_shardings (cognitive 27) jax/_src/pjit.py:1041— pjit._resolve_in_shardings has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 4, ternaries 1 (2 pts), loops 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.
bessel._jn_impl (cognitive 27) jax/_src/scipy/bessel.py:804— bessel._jn_impl has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 4 (10 pts), 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.
NDIndexer.from_indices_shape (cognitive 27) jax/_src/state/indexing.py:184— NDIndexer.from_indices_shape has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (18 pts), error handling 2 (4 pts), ternaries 2 (3 pts), boolean chains 2 (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.
tensorstore_impl.verify_tensorstore_spec (cognitive 27) jax/experimental/array_serialization/tensorstore_impl.py:187— tensorstore_impl.verify_tensorstore_spec has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (27 pts) (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.
FragmentedArray.broadcast_in_dim (cognitive 27) jax/experimental/mosaic/gpu/fragmented_array.py:3958— FragmentedArray.broadcast_in_dim has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 4 (6 pts), boolean chains 3 (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.
SdyShardingRule.__init__ (cognitive 26) jax/_src/custom_partitioning_sharding_rule.py:124— SdyShardingRule.__init__ has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 5 (9 pts), boolean chains 2 (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.
State.initialize (cognitive 26) jax/_src/distributed.py:92— State.initialize has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 4 (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.
lowering._run_scoped_resource_estimator (cognitive 26) jax/_src/pallas/mosaic_gpu/lowering.py:347— lowering._run_scoped_resource_estimator has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 2, 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.
lowering._get_lowering_rule (cognitive 26) jax/_src/pallas/mosaic_gpu/lowering.py:1862— lowering._get_lowering_rule has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 3 (6 pts), boolean chains 3, match/switch 2 (3 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.
primitives._wgmma_lowering (cognitive 26) jax/_src/pallas/mosaic_gpu/primitives.py:2220— primitives._wgmma_lowering has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (23 pts), match/switch 2 (3 pts) (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.
primitives._wgmma_warpgroup_lowering (cognitive 26) jax/_src/pallas/mosaic_gpu/primitives.py:2339— primitives._wgmma_warpgroup_lowering has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 4, loops 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.
lowering._load (cognitive 26) jax/_src/pallas/triton/lowering.py:2089— lowering._load has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 5, error handling 1 (2 pts), ternaries 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.
core.choice (cognitive 26) jax/_src/random/core.py:1108— core.choice has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 4 (9 pts), boolean chains 1 (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.
eigh.eigh (cognitive 26) jax/_src/tpu/linalg/eigh.py:511— eigh.eigh has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 4, ternaries 2 (3 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.
tree_util._register_dataclass (cognitive 26) jax/_src/tree_util.py:1151— tree_util._register_dataclass has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 3, loops 1, ternaries 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.
FragmentedArray.store_untiled (cognitive 26) jax/experimental/mosaic/gpu/fragmented_array.py:4135— FragmentedArray.store_untiled has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 1 (2 pts), match/switch 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.
fragmented_array.plan_gmem_transfer (cognitive 26) jax/experimental/mosaic/gpu/fragmented_array.py:5426— fragmented_array.plan_gmem_transfer has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, loops 3 (4 pts), ternaries 4 (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.
fragmented_array.optimization_barrier (cognitive 26) jax/experimental/mosaic/gpu/fragmented_array.py:5782— fragmented_array.optimization_barrier has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (4 pts), ternaries 2 (4 pts), boolean chains 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.
ad_checkpoint._saved_residuals (cognitive 25) jax/_src/ad_checkpoint.py:482— ad_checkpoint._saved_residuals has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 5 (6 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.
ad_checkpoint._insert_reduce_precision (cognitive 25) jax/_src/ad_checkpoint.py:664— ad_checkpoint._insert_reduce_precision has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (6 pts), boolean chains 4, loops 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.
partial_eval.lower_jaxpr (cognitive 25) jax/_src/interpreters/partial_eval.py:2373— partial_eval.lower_jaxpr has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 6 (9 pts), loops 3, boolean chains 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.
slicing._scatter_shape_rule (cognitive 25) jax/_src/lax/slicing.py:2688— slicing._scatter_shape_rule has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 3, loops 3 (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.
lax_numpy._interp (cognitive 25) jax/_src/numpy/lax_numpy.py:2640— lax_numpy._interp has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 2 (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.
lax_numpy._arange (cognitive 25) jax/_src/numpy/lax_numpy.py:6005— lax_numpy._arange has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 5, loops 1, ternaries 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.
jaxpr_fusion._construct_output_fusions (cognitive 25) jax/_src/pallas/fuser/jaxpr_fusion.py:212— jaxpr_fusion._construct_output_fusions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (5 pts), ternaries 1 (2 pts), boolean chains 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.
lowering.lower_jaxpr_to_mosaic_gpu (cognitive 25) jax/_src/pallas/mosaic_gpu/lowering.py:1049— lowering.lower_jaxpr_to_mosaic_gpu has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (6 pts), error handling 2 (4 pts), boolean chains 2 (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.
pjit._sharding_constraint_hlo_lowering (cognitive 25) jax/_src/pjit.py:2228— pjit._sharding_constraint_hlo_lowering has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 1 (4 pts), boolean chains 2, loops 1 (2 pts) (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.
shard_map._check_specs (cognitive 25) jax/_src/shard_map.py:494— shard_map._check_specs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (9 pts), ternaries 2 (5 pts), boolean chains 2 (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.
shard_map._spec_divisibility_error (cognitive 25) jax/_src/shard_map.py:620— shard_map._spec_divisibility_error has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (8 pts), loops 2 (3 pts), boolean chains 1 (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.
xla_bridge.backends (cognitive 25) jax/_src/xla_bridge.py:811— xla_bridge.backends has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 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.
layout_inference.assign_layouts (cognitive 25) jax/experimental/mosaic/gpu/layout_inference.py:2396— layout_inference.assign_layouts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (24 pts), 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.
array._array_shard_arg (cognitive 24) jax/_src/array.py:1363— array._array_shard_arg has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, error handling 1 (2 pts), loops 2, ternaries 1 (2 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.
core._why_alive_container_info (cognitive 24) jax/_src/core.py:1657— core._why_alive_container_info has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (24 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.
partial_eval._partial_eval_jaxpr_custom_cached (cognitive 24) jax/_src/interpreters/partial_eval.py:865— partial_eval._partial_eval_jaxpr_custom_cached has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, loops 3 (5 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.
jaxpr_util.jaxpr_to_html (cognitive 24) jax/_src/jaxpr_util.py:357— jaxpr_util.jaxpr_to_html has cognitive complexity 24 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 4 (9 pts), ternaries 2 (4 pts), boolean chains 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.
lax._dot_general_layout_rule (cognitive 24) jax/_src/lax/lax.py:7166— lax._dot_general_layout_rule has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 6, ternaries 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.
linalg._svd_gpu_sub_lowering (cognitive 24) jax/_src/lax/linalg.py:2586— linalg._svd_gpu_sub_lowering has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 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.
slicing._scatter_spec_computation (cognitive 24) jax/_src/lax/slicing.py:2863— slicing._scatter_spec_computation has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 8, loops 2 (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.
slicing._scatter_addsub_transpose_rule (cognitive 24) jax/_src/lax/slicing.py:3180— slicing._scatter_addsub_transpose_rule has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (4 pts), loops 1 (3 pts), boolean chains 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.
slicing._scatter_mul_transpose_rule (cognitive 24) jax/_src/lax/slicing.py:3222— slicing._scatter_mul_transpose_rule has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (4 pts), loops 1 (3 pts), boolean chains 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.
lowering._load_lowering_rule (cognitive 24) jax/_src/pallas/mosaic/lowering.py:2459— lowering._load_lowering_rule has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 3 (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.
pipeline._spec_has_trivial_windowing (cognitive 24) jax/_src/pallas/mosaic/pipeline.py:229— pipeline._spec_has_trivial_windowing has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 4 (5 pts), boolean chains 1, ternaries 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.
MemorySpace.__call__ (cognitive 24) jax/_src/pallas/mosaic_gpu/core.py:199— MemorySpace.__call__ has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 1 (nesting depth added 12). 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.
lowering.lower_jaxpr_to_module (cognitive 24) jax/_src/pallas/mosaic_gpu/lowering.py:737— lowering.lower_jaxpr_to_module has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 1, 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.
pipeline.emit_pipeline_warp_specialized (cognitive 24) jax/_src/pallas/mosaic_gpu/pipeline.py:660— pipeline.emit_pipeline_warp_specialized has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 4, loops 3 (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.
primitives._atomic_lowering_rule (cognitive 24) jax/_src/pallas/triton/primitives.py:445— primitives._atomic_lowering_rule has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 3 (8 pts), boolean chains 1 (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.
program_order.eval_jaxpr_program_order (cognitive 24) jax/_src/program_order.py:111— program_order.eval_jaxpr_program_order has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 1, loops 1 (nesting depth added 12). 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.
fragmented_array.plan_tiled_transfer (cognitive 24) jax/experimental/mosaic/gpu/fragmented_array.py:5582— fragmented_array.plan_tiled_transfer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (7 pts), ternaries 5, boolean chains 2 (nesting depth added 6). 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.
layout_inference._extract_layout_candidates_from_tmem_registers_transfer (cognitive 24) jax/experimental/mosaic/gpu/layout_inference.py:297— layout_inference._extract_layout_candidates_from_tmem_registers_transfer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (5 pts), boolean chains 2, match/switch 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.
splash_attention_kernel._splash_attention_bwd_dq (cognitive 24) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1417— splash_attention_kernel._splash_attention_bwd_dq has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, ternaries 5, boolean chains 2. 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.
api_util.resolve_argnums (cognitive 23) jax/_src/api_util.py:553— api_util.resolve_argnums has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (14 pts), if/else 5 (9 pts) (nesting depth added 13). 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.
dispatch._device_put_impl (cognitive 23) jax/_src/dispatch.py:606— dispatch._device_put_impl has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, ternaries 2 (4 pts), error handling 1 (2 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.
_export._wrap_main_func (cognitive 23) jax/_src/export/_export.py:905— _export._wrap_main_func has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 4 (5 pts), error handling 2, ternaries 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.
loops.scan (cognitive 23) jax/_src/lax/control_flow/loops.py:242— loops.scan has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 3 (5 pts), loops 1 (2 pts), boolean chains 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.
lax._dot_general_sharding_rule (cognitive 23) jax/_src/lax/lax.py:6825— lax._dot_general_sharding_rule has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (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.
lax._merge_an_axis_sharding_rule (cognitive 23) jax/_src/lax/lax.py:9503— lax._merge_an_axis_sharding_rule has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2, 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.
slicing._gather_collective_rule (cognitive 23) jax/_src/lax/slicing.py:2590— slicing._gather_collective_rule has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, loops 2, ternaries 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.
indexing.take_along_axis (cognitive 23) jax/_src/numpy/indexing.py:832— indexing.take_along_axis has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 1, loops 1, ternaries 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.
ufunc._reduce_via_scan (cognitive 23) jax/_src/numpy/ufunc_api.py:262— ufunc._reduce_via_scan has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 1 (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.
GenericSharedMemory.swap_buffer_content (cognitive 23) jax/_src/pallas/mosaic/interpret/shared_memory.py:688— GenericSharedMemory.swap_buffer_content has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (3 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (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.
lowering._transform_ref (cognitive 23) jax/_src/pallas/mosaic/lowering.py:2317— lowering._transform_ref has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 1 (3 pts), boolean chains 2, match/switch 1 (2 pts), loops 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.
pipeline._partition_grid (cognitive 23) jax/_src/pallas/mosaic/pipeline.py:1707— pipeline._partition_grid has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 5 (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.
sc_lowering._load_lowering_rule (cognitive 23) jax/_src/pallas/mosaic/sc_lowering.py:145— sc_lowering._load_lowering_rule has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 4, loops 1, ternaries 1 (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.
shard_map._manual_spec (cognitive 23) jax/_src/shard_map.py:435— shard_map._manual_spec has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 5 (8 pts), loops 2 (4 pts), boolean chains 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.
stages._traced_out_info (cognitive 23) jax/_src/stages.py:398— stages._traced_out_info has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (15 pts), if/else 4 (7 pts), 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.
jax2tf._tfval_to_tensor_jax_dtype (cognitive 23) jax/experimental/jax2tf/jax2tf.py:725— jax2tf._tfval_to_tensor_jax_dtype has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4 (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.
mma.mma (cognitive 23) jax/experimental/mosaic/gpu/mma.py:191— mma.mma has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 3 (6 pts), boolean chains 1 (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.
splash_attention_kernel._apply_mask_and_soft_cap (cognitive 23) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:608— splash_attention_kernel._apply_mask_and_soft_cap has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 1 (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.
bcoo.bcoo_concatenate (cognitive 23) jax/experimental/sparse/bcoo.py:1767— bcoo.bcoo_concatenate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 2 (6 pts), boolean chains 1 (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.
ConfigOptionDirective.run (cognitive 22) docs/sphinxext/jax_list_config_options.py:64— ConfigOptionDirective.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (7 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.
Primitive.bind (cognitive 22) jax/_src/core.py:631— Primitive.bind has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (16 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 12). 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.
core.auto_insert_reshard (cognitive 22) jax/_src/core.py:2784— core.auto_insert_reshard has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, ternaries 2, loops 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.
dtypes._issubdtype_cached (cognitive 22) jax/_src/dtypes.py:554— dtypes._issubdtype_cached has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 9, ternaries 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.
pxla.maybe_recover_user_shardings (cognitive 22) jax/_src/interpreters/pxla.py:1405— pxla.maybe_recover_user_shardings has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 3 (4 pts), ternaries 2 (3 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.
loops._scan_impl (cognitive 22) jax/_src/lax/control_flow/loops.py:618— loops._scan_impl has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 2, ternaries 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.
lax._split_an_axis_sharding_rule (cognitive 22) jax/_src/lax/lax.py:9466— lax._split_an_axis_sharding_rule has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 1 (4 pts), loops 2, 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.
slicing._scatter_transpose_rule (cognitive 22) jax/_src/lax/slicing.py:3642— slicing._scatter_transpose_rule has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 2 (4 pts), loops 1 (3 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.
utils.int_dtype_for_shape (cognitive 22) jax/_src/lax/utils.py:468— utils.int_dtype_for_shape has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (4 pts) (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.
reductions._reduce_minmax (cognitive 22) jax/_src/numpy/reductions.py:620— reductions._reduce_minmax has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4 (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.
primitives._copy_smem_to_gmem_lowering (cognitive 22) jax/_src/pallas/mosaic_gpu/primitives.py:294— primitives._copy_smem_to_gmem_lowering has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (19 pts), ternaries 1 (2 pts), boolean chains 1 (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.
primitives._swap_discharge_rule (cognitive 22) jax/_src/pallas/primitives.py:387— primitives._swap_discharge_rule has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (2 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.
primitives._semaphore_signal_abstract_eval (cognitive 22) jax/_src/pallas/primitives.py:1020— primitives._semaphore_signal_abstract_eval has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (9 pts), 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.
lowering.lower_jaxpr_to_triton_ir (cognitive 22) jax/_src/pallas/triton/lowering.py:392— lowering.lower_jaxpr_to_triton_ir has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 2 (4 pts), loops 2 (3 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.
pjit._get_new_mesh (cognitive 22) jax/_src/pjit.py:2912— pjit._get_new_mesh has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6, loops 2 (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.
core._multivariate_normal (cognitive 22) jax/_src/random/core.py:1544— core._multivariate_normal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 3 (5 pts), boolean chains 3 (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.
fft.dctn (cognitive 22) jax/_src/scipy/fft.py:159— fft.dctn has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 2 (4 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (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.
sharding_impls.parse_flatten_op_sharding (cognitive 22) jax/_src/sharding_impls.py:487— sharding_impls.parse_flatten_op_sharding has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (9 pts), boolean chains 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.
primitives._swap_vmap (cognitive 22) jax/_src/state/primitives.py:981— primitives._swap_vmap has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (17 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.
svd.svd (cognitive 22) jax/_src/tpu/linalg/svd.py:123— svd.svd has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2, ternaries 1 (2 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.
layout_inference._async_load_store_constraint_system (cognitive 22) jax/experimental/mosaic/gpu/layout_inference.py:2230— layout_inference._async_load_store_constraint_system has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1, loops 1, ternaries 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.
Partition.__init__ (cognitive 22) jax/experimental/mosaic/gpu/utils.py:1870— Partition.__init__ has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (4 pts), boolean chains 1 (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.
reduce_scatter_mgpu.reduce_scatter (cognitive 22) jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py:32— reduce_scatter_mgpu.reduce_scatter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 1 (2 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.
mlir.parse_mlir_locations (cognitive 22) jax/experimental/source_mapper/mlir.py:82— mlir.parse_mlir_locations has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (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.
ArrayImpl.__dlpack_device__ (cognitive 21) jax/_src/array.py:453— ArrayImpl.__dlpack_device__ has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (21 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.
compiler._resolve_compilation_strategy (cognitive 21) jax/_src/compiler.py:549— compiler._resolve_compilation_strategy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 6 (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.
custom_partitioning._custom_partitioning_lowering_rule (cognitive 21) jax/_src/custom_partitioning.py:527— custom_partitioning._custom_partitioning_lowering_rule has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3 (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.
hardware_utils.num_available_amd_gpus (cognitive 21) jax/_src/hardware_utils.py:102— hardware_utils.num_available_amd_gpus has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 2 (3 pts), boolean chains 2, loops 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.
ExecuteReplicated.__call__ (cognitive 21) jax/_src/interpreters/pxla.py:400— ExecuteReplicated.__call__ has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), error handling 1 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). 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.
conditionals._cond_lowering (cognitive 21) jax/_src/lax/control_flow/conditionals.py:1142— conditionals._cond_lowering has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 4 (8 pts), 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.
scaled_dot._scaled_dot_validate_inputs (cognitive 21) jax/_src/lax/scaled_dot.py:51— scaled_dot._scaled_dot_validate_inputs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 2 (4 pts), loops 2 (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.
slicing._gather_spec_computation (cognitive 21) jax/_src/lax/slicing.py:2131— slicing._gather_spec_computation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 8, loops 2 (4 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.
fft._fft_core (cognitive 21) jax/_src/numpy/fft.py:49— fft._fft_core has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 1 (2 pts), boolean chains 1 (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.
_AxisConcat.__getitem__ (cognitive 21) jax/_src/numpy/index_tricks.py:151— _AxisConcat.__getitem__ has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 1 (3 pts), boolean chains 2, loops 1, ternaries 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.
indexing.rewriting_take (cognitive 21) jax/_src/numpy/indexing.py:1165— indexing.rewriting_take has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 7, error handling 2 (4 pts), boolean chains 2 (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.
scatter._scatter_impl (cognitive 21) jax/_src/ops/scatter.py:89— scatter._scatter_impl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 1 (3 pts), ternaries 1 (2 pts) (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.
core.get_grid_mapping (cognitive 21) jax/_src/pallas/core.py:1410— core.get_grid_mapping has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 3, ternaries 1 (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.
einshape._apply_split (cognitive 21) jax/_src/pallas/einshape.py:784— einshape._apply_split has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 pts), boolean chains 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.
lowering.aval_to_ir_type (cognitive 21) jax/_src/pallas/mosaic/lowering.py:599— lowering.aval_to_ir_type has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (20 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.
lowering._convert_helper (cognitive 21) jax/_src/pallas/mosaic/lowering.py:3298— lowering._convert_helper has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (20 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.
primitives._get_dma_effects (cognitive 21) jax/_src/pallas/mosaic/primitives.py:358— primitives._get_dma_effects has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (7 pts), boolean chains 2, ternaries 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.
pjit._trace_for_jit (cognitive 21) jax/_src/pjit.py:497— pjit._trace_for_jit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, boolean chains 6, ternaries 2 (3 pts) (nesting depth added 1). 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.
pjit._sharding_constraint_impl (cognitive 21) jax/_src/pjit.py:2175— pjit._sharding_constraint_impl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3 (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.
fft.idctn (cognitive 21) jax/_src/scipy/fft.py:380— fft.idctn has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 2 (4 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (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.
shard_map._shmap_checks (cognitive 21) jax/_src/shard_map.py:371— shard_map._shmap_checks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 3 (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.
sharding_impls.canonicalize_sharding (cognitive 21) jax/_src/sharding_impls.py:852— sharding_impls.canonicalize_sharding has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3, loops 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.
serialization.is_remote_storage (cognitive 21) jax/experimental/array_serialization/serialization.py:77— serialization.is_remote_storage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 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.
call_tf._call_tf_lowering (cognitive 21) jax/experimental/jax2tf/call_tf.py:514— call_tf._call_tf_lowering has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 2 (3 pts), error handling 1 (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.
core._construct_smem_reftree (cognitive 21) jax/experimental/mosaic/gpu/core.py:532— core._construct_smem_reftree has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), ternaries 2 (6 pts), match/switch 1 (2 pts), loops 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.
layout_inference._conjure_transforms_for_smem_ref (cognitive 21) jax/experimental/mosaic/gpu/layout_inference.py:255— layout_inference._conjure_transforms_for_smem_ref has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (7 pts), loops 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.
blackwell_matmul_mgpu.main (cognitive 21) jax/experimental/pallas/ops/gpu/blackwell_matmul_mgpu.py:271— blackwell_matmul_mgpu.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 2 (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.
ragged_dot_mgpu.main (cognitive 21) jax/experimental/pallas/ops/gpu/ragged_dot_mgpu.py:245— ragged_dot_mgpu.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 1 (3 pts), loops 2 (3 pts) (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.
transform.eval_sparse (cognitive 21) jax/experimental/sparse/transform.py:396— transform.eval_sparse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), ternaries 1 (3 pts) (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.
cuda._check_cuda_versions (cognitive 21) jax_plugins/cuda/__init__.py:147— cuda._check_cuda_versions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4, loops 1 (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.
callback.emit_python_callback (cognitive 20) jax/_src/callback.py:764— callback.emit_python_callback has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 3 (4 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.
ClusterEnv.auto_detect_unset_distributed_params (cognitive 20) jax/_src/clusters/cluster.py:45— ClusterEnv.auto_detect_unset_distributed_params has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2 (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.
core.pp_toplevel_jaxpr (cognitive 20) jax/_src/core.py:4127— core.pp_toplevel_jaxpr has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 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.
conditionals._join_cond_fwd_res (cognitive 20) jax/_src/lax/control_flow/conditionals.py:813— conditionals._join_cond_fwd_res has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 2 (9 pts), if/else 3 (8 pts), loops 2 (3 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.
linalg._svd_cpu_gpu_lowering (cognitive 20) jax/_src/lax/linalg.py:2514— linalg._svd_cpu_gpu_lowering has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 2 (6 pts), boolean chains 3 (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.
utils._check_no_collectives (cognitive 20) jax/_src/lax/utils.py:72— utils._check_no_collectives has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, loops 2 (3 pts) (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.
lax_reference._float64_fma_scalar (cognitive 20) jax/_src/lax_reference.py:252— lax_reference._float64_fma_scalar has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 6, ternaries 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.
named_sharding.named_sharding_to_xla_hlo_sharding (cognitive 20) jax/_src/named_sharding.py:429— named_sharding.named_sharding_to_xla_hlo_sharding has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 8 (9 pts), boolean chains 1 (nesting depth added 5). 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_contractions.matmul (cognitive 20) jax/_src/numpy/tensor_contractions.py:138— tensor_contractions.matmul has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 4, loops 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.
lowering._convert_element_type_lowering_rule (cognitive 20) jax/_src/pallas/mosaic/lowering.py:3334— lowering._convert_element_type_lowering_rule has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 7 (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.
primitives.dma_start_discharge_rule (cognitive 20) jax/_src/pallas/mosaic/primitives.py:508— primitives.dma_start_discharge_rule has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 3 (5 pts), boolean chains 2 (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.
primitives._print_layout_lowering (cognitive 20) jax/_src/pallas/mosaic_gpu/primitives.py:137— primitives._print_layout_lowering has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 1 (4 pts), loops 1 (3 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.
mpmd._mpmd_map_discharge_rule (cognitive 20) jax/_src/pallas/mpmd.py:215— mpmd._mpmd_map_discharge_rule has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 6 (7 pts), ternaries 3, 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.
primitives._load_discharge_rule (cognitive 20) jax/_src/pallas/primitives.py:264— primitives._load_discharge_rule has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (6 pts), boolean chains 5, loops 1 (2 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.
lowering._store (cognitive 20) jax/_src/pallas/triton/lowering.py:2313— lowering._store has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 2, error handling 1 (2 pts) (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.
core._truncated_normal (cognitive 20) jax/_src/random/core.py:1711— core._truncated_normal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 2 (4 pts), boolean chains 1 (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.
sharding_impls.prepare_axis_resources (cognitive 20) jax/_src/sharding_impls.py:324— sharding_impls.prepare_axis_resources has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 4, loops 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.
call_tf._mlir_type_to_numpy_dtype (cognitive 20) jax/experimental/jax2tf/call_tf.py:473— call_tf._mlir_type_to_numpy_dtype has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 6 (8 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.
bcoo._bcoo_spdot_general_abstract_eval (cognitive 20) jax/experimental/sparse/bcoo.py:1195— bcoo._bcoo_spdot_general_abstract_eval has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 9, ternaries 2. 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.
callback._callback_op_sharding (cognitive 19) jax/_src/callback.py:157— callback._callback_op_sharding has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 1 (3 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.
dispatch._device_put_transpose (cognitive 19) jax/_src/dispatch.py:754— dispatch._device_put_transpose has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts), ternaries 1 (2 pts), boolean chains 1 (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.
_DimFactor._syntactic_cmp (cognitive 19) jax/_src/export/shape_poly.py:186— _DimFactor._syntactic_cmp has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 5 (6 pts), boolean chains 2, loops 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.
mlir.merge_mlir_modules (cognitive 19) jax/_src/interpreters/mlir.py:3388— mlir.merge_mlir_modules has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 2 (4 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 7). 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.
DynamicJaxprTrace.default_process_primitive (cognitive 19) jax/_src/interpreters/partial_eval.py:1829— DynamicJaxprTrace.default_process_primitive has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (2 pts), ternaries 2 (nesting depth added 4). 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.
partial_eval.diff_types (cognitive 19) jax/_src/interpreters/partial_eval.py:2111— partial_eval.diff_types has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, loops 1, ternaries 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.
loops._infer_scan_length (cognitive 19) jax/_src/lax/control_flow/loops.py:473— loops._infer_scan_length has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), error handling 2 (3 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.
loops._scan_batching_rule (cognitive 19) jax/_src/lax/control_flow/loops.py:1225— loops._scan_batching_rule has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (11 pts), if/else 3 (4 pts), boolean chains 3, loops 1 (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.
linalg._eigh_cpu_gpu_lowering (cognitive 19) jax/_src/lax/linalg.py:1302— linalg._eigh_cpu_gpu_lowering has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (7 pts), boolean chains 3 (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.
linalg._resolve_gpu_svd_implementation (cognitive 19) jax/_src/lax/linalg.py:2465— linalg._resolve_gpu_svd_implementation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), error handling 1 (2 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.
Einsum.transpose (cognitive 19) jax/_src/numpy/hijax.py:548— Einsum.transpose has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 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.
indexing._take (cognitive 19) jax/_src/numpy/indexing.py:731— indexing._take has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4 (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.
indexing._gather (cognitive 19) jax/_src/numpy/indexing.py:1290— indexing._gather has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 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.
reductions._average (cognitive 19) jax/_src/numpy/reductions.py:1163— reductions._average has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 1 (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.
Einshape.block_eval_rule (cognitive 19) jax/_src/pallas/einshape.py:443— Einshape.block_eval_rule has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 2 (4 pts), ternaries 1 (4 pts), boolean chains 2, match/switch 1 (2 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.
lowering._debug_print_rule (cognitive 19) jax/_src/pallas/mosaic/lowering.py:5968— lowering._debug_print_rule has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, ternaries 1 (3 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.
bessel._yn_first_quadrant (cognitive 19) jax/_src/scipy/bessel.py:1389— bessel._yn_first_quadrant has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (5 pts), boolean chains 2 (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.
linalg.eigh_tridiagonal (cognitive 19) jax/_src/scipy/linalg.py:1736— linalg.eigh_tridiagonal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 2 (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.
primitives._addupdate_vmap (cognitive 19) jax/_src/state/primitives.py:1075— primitives._addupdate_vmap has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4 (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.
xla_bridge._options_from_jax_configs (cognitive 19) jax/_src/xla_bridge.py:526— xla_bridge._options_from_jax_configs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 pts), ternaries 1 (2 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.
pytree_serialization._set_up_destination (cognitive 19) jax/experimental/array_serialization/pytree_serialization.py:146— pytree_serialization._set_up_destination has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 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.
Tiling.tile_nested_shape_strides (cognitive 19) jax/experimental/mosaic/gpu/fragmented_array.py:193— Tiling.tile_nested_shape_strides has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 pts), ternaries 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.
hopper_matmul_mgpu.main (cognitive 19) jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:275— hopper_matmul_mgpu.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 2 (7 pts), ternaries 2 (6 pts), error handling 1 (3 pts), loops 2 (3 pts) (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.
hopper_mixed_type_matmul_mgpu.main (cognitive 19) jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py:278— hopper_mixed_type_matmul_mgpu.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 2 (7 pts), ternaries 2 (6 pts), error handling 1 (3 pts), loops 2 (3 pts) (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.
kernel.static_validate_inputs (cognitive 19) jax/experimental/pallas/ops/tpu/ragged_paged_attention/kernel.py:216— kernel.static_validate_inputs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, boolean chains 8. 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.
api.clear_backends (cognitive 18) jax/_src/api.py:2911— api.clear_backends has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), error handling 1 (2 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.
fused_attention_stablehlo.check_layout (cognitive 18) jax/_src/cudnn/fused_attention_stablehlo.py:275— fused_attention_stablehlo.check_layout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, ternaries 1 (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.
_export.to_named_sharding_with_abstract_mesh (cognitive 18) jax/_src/export/_export.py:646— _export.to_named_sharding_with_abstract_mesh has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 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.
mlir.jaxpr_subcomp (cognitive 18) jax/_src/interpreters/mlir.py:2242— mlir.jaxpr_subcomp has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 2 (3 pts) (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.
partial_eval.tracers_to_jaxpr (cognitive 18) jax/_src/interpreters/partial_eval.py:581— partial_eval.tracers_to_jaxpr has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (4 pts), boolean chains 1, loops 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.
pxla._concretize_abstract_out_shardings (cognitive 18) jax/_src/interpreters/pxla.py:916— pxla._concretize_abstract_out_shardings has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (8 pts), boolean chains 1, loops 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.
pxla._get_out_sharding_from_orig_sharding (cognitive 18) jax/_src/interpreters/pxla.py:1378— pxla._get_out_sharding_from_orig_sharding has cognitive complexity 18 (threshold 15). Drivers by points: error handling 2 (8 pts), if/else 4 (7 pts), boolean chains 2, loops 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.
loops.while_loop (cognitive 18) jax/_src/lax/control_flow/loops.py:1677— loops.while_loop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 4, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 2). 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.
solves._linear_solve_batching_rule (cognitive 18) jax/_src/lax/control_flow/solves.py:499— solves._linear_solve_batching_rule has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, ternaries 4, loops 1 (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.
lax._convert_element_type_unreduced_rule (cognitive 18) jax/_src/lax/lax.py:6309— lax._convert_element_type_unreduced_rule has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 2 (nesting depth added 10). 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.
lax._ragged_dot_general_shape_rule (cognitive 18) jax/_src/lax/lax.py:7732— lax._ragged_dot_general_shape_rule has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, match/switch 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.
lax._split_on_one_axis (cognitive 18) jax/_src/lax/lax.py:9356— lax._split_on_one_axis has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), boolean chains 1 (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.
lax._select_transpose_rule (cognitive 18) jax/_src/lax/lax.py:9973— lax._select_transpose_rule has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (13 pts), if/else 4 (5 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.
setops._in1d (cognitive 18) jax/_src/numpy/setops.py:45— setops._in1d has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 1 (2 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.
einshape.get_einshape_transforms (cognitive 18) jax/_src/pallas/einshape.py:217— einshape.get_einshape_transforms has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3 (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.
shard_map_fusion.fuse_shard_map_jaxpr (cognitive 18) jax/_src/pallas/fuser/shard_map_fusion.py:219— shard_map_fusion.fuse_shard_map_jaxpr has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, loops 2 (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.
RaceDetectionState.check_write (cognitive 18) jax/_src/pallas/mosaic/interpret/race_detection_state.py:137— RaceDetectionState.check_write has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (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.
pipeline._normalize_buffer_count (cognitive 18) jax/_src/pallas/mosaic/pipeline.py:304— pipeline._normalize_buffer_count has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 2 (6 pts), boolean chains 5 (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.
sc_lowering._dma_start_lowering_rule (cognitive 18) jax/_src/pallas/mosaic/sc_lowering.py:637— sc_lowering._dma_start_lowering_rule has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 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.
sc_lowering._extract_indirect_offsets_from_indices (cognitive 18) jax/_src/pallas/mosaic/sc_lowering.py:860— sc_lowering._extract_indirect_offsets_from_indices has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, match/switch 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.
GPURaceDetectionState._check_ref_union (cognitive 18) jax/_src/pallas/mosaic_gpu/interpret/race_detection_state.py:77— GPURaceDetectionState._check_ref_union has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 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.
Barrier.arrive (cognitive 18) jax/_src/pallas/mosaic_gpu/interpret/shared_memory.py:1310— Barrier.arrive has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 1 (2 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.
lowering.merge_indexers (cognitive 18) jax/_src/pallas/mosaic_gpu/lowering.py:4414— lowering.merge_indexers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 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.
primitives._tcgen05_mma_abstract_eval (cognitive 18) jax/_src/pallas/mosaic_gpu/primitives.py:2763— primitives._tcgen05_mma_abstract_eval has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2 (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.
pjit.pjit_check_aval_sharding (cognitive 18) jax/_src/pjit.py:839— pjit.pjit_check_aval_sharding has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 2 (5 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (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.
pjit._lower_shaped_reshard (cognitive 18) jax/_src/pjit.py:2368— pjit._lower_shaped_reshard has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, ternaries 1 (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.
pmap._get_in_axes_flat (cognitive 18) jax/_src/pmap.py:561— pmap._get_in_axes_flat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, error handling 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.
Executable.as_text (cognitive 18) jax/_src/stages.py:120— Executable.as_text has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (4 pts), boolean chains 2 (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.
discharge._addupdate_discharge (cognitive 18) jax/_src/state/discharge.py:692— discharge._addupdate_discharge has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 1, ternaries 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.
primitives._get_vmap (cognitive 18) jax/_src/state/primitives.py:908— primitives._get_vmap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4 (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.
thunky._lower_call_jax (cognitive 18) jax/_src/thunky/thunky.py:1468— thunky._lower_call_jax has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (6 pts), loops 2, boolean chains 1, error handling 1 (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.
thunky._call_thunky_discharge_rule (cognitive 18) jax/_src/thunky/thunky.py:2060— thunky._call_thunky_discharge_rule has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (4 pts), loops 3, boolean chains 2 (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.
constraints._reduce_system_once (cognitive 18) jax/experimental/mosaic/gpu/constraints.py:1470— constraints._reduce_system_once has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (5 pts), loops 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.
tcgen05._store_32xcols_native (cognitive 18) jax/experimental/mosaic/gpu/tcgen05.py:1742— tcgen05._store_32xcols_native has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (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.
splash_attention_mask_info._process_dynamic_mask (cognitive 18) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:316— splash_attention_mask_info._process_dynamic_mask has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 2 (3 pts), ternaries 1 (2 pts) (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.
build_utils.create_wheel_sources_map (cognitive 18) jaxlib/tools/build_utils.py:38— build_utils.create_wheel_sources_map has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 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.
api._mapped_axis_size (cognitive 17) jax/_src/api.py:1313— api._mapped_axis_size has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), error handling 1, loops 1, ternaries 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.
api._lift_linearized (cognitive 17) jax/_src/api.py:1594— api._lift_linearized has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 1, loops 1, ternaries 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.
compiler.backend_compile_and_load (cognitive 17) jax/_src/compiler.py:342— compiler.backend_compile_and_load has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, loops 1 (2 pts), error handling 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.
fused_attention_stablehlo._dot_product_attention_bwd_batcher (cognitive 17) jax/_src/cudnn/fused_attention_stablehlo.py:943— fused_attention_stablehlo._dot_product_attention_bwd_batcher has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, ternaries 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.
custom_derivatives._flatten_jvp (cognitive 17) jax/_src/custom_derivatives.py:303— custom_derivatives._flatten_jvp has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, error handling 1, ternaries 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.
dtypes.dtype (cognitive 17) jax/_src/dtypes.py:1035— dtypes.dtype has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, error handling 1 (2 pts) (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.
_export._call_exported_abstract_eval (cognitive 17) jax/_src/export/_export.py:1401— _export._call_exported_abstract_eval has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 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.
pxla.check_array_xla_sharding_layout_match (cognitive 17) jax/_src/interpreters/pxla.py:2062— pxla.check_array_xla_sharding_layout_match has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, ternaries 1 (2 pts), loops 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.
_reduction_order._check_ring_args (cognitive 17) jax/_src/lax/_reduction_order.py:300— _reduction_order._check_ring_args has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 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.
fft.fft_abstract_eval (cognitive 17) jax/_src/lax/fft.py:94— fft.fft_abstract_eval has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 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.
einsum.einsum (cognitive 17) jax/_src/numpy/einsum.py:69— einsum.einsum has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, ternaries 3 (nesting depth added 1). 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.
Semaphore.wait (cognitive 17) jax/_src/pallas/mosaic/interpret/shared_memory.py:148— Semaphore.wait has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, loops 1 (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.
sc_primitives._masked_cumop_lowering_rule (cognitive 17) jax/_src/pallas/mosaic/sc_primitives.py:596— sc_primitives._masked_cumop_lowering_rule has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 4 (5 pts), boolean chains 1, match/switch 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.
UntilingTransform.commute_ndindexer (cognitive 17) jax/_src/pallas/mosaic_gpu/core.py:875— UntilingTransform.commute_ndindexer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, match/switch 1 (2 pts), loops 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.
lowering._ndindexer_indices (cognitive 17) jax/_src/pallas/mosaic_gpu/lowering.py:1831— lowering._ndindexer_indices has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 4, ternaries 1 (3 pts), loops 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.
primitives._copy_gmem_to_smem_abstract_eval (cognitive 17) jax/_src/pallas/mosaic_gpu/primitives.py:836— primitives._copy_gmem_to_smem_abstract_eval has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, match/switch 1, ternaries 1 (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.
primitives._async_prefetch_lowering (cognitive 17) jax/_src/pallas/mosaic_gpu/primitives.py:1544— primitives._async_prefetch_lowering has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 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.
pjit._pjit_batcher_for_sharding (cognitive 17) jax/_src/pjit.py:1530— pjit._pjit_batcher_for_sharding has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3 (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.
bessel._jn_recur_from_asym (cognitive 17) jax/_src/scipy/bessel.py:615— bessel._jn_recur_from_asym has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4, loops 1 (3 pts), boolean chains 1 (nesting depth added 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.
serialization._get_cpu_device_map (cognitive 17) jax/experimental/colocated_python/serialization.py:110— serialization._get_cpu_device_map has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (4 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.
constraints.reduce_reshape_expression (cognitive 17) jax/experimental/mosaic/gpu/constraints.py:211— constraints.reduce_reshape_expression has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 1 (3 pts), match/switch 2 (3 pts), boolean chains 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.
TiledLayout.__post_init__ (cognitive 17) jax/experimental/mosaic/gpu/fragmented_array.py:372— TiledLayout.__post_init__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 2, loops 1 (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.
layout_inference.conjure_assignment (cognitive 17) jax/experimental/mosaic/gpu/layout_inference.py:483— layout_inference.conjure_assignment has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (4 pts), loops 3 (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.
layout_inference._tcgen05_mma_constraint_system (cognitive 17) jax/experimental/mosaic/gpu/layout_inference.py:1614— layout_inference._tcgen05_mma_constraint_system has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1 (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.
tcgen05.commit_arrive (cognitive 17) jax/experimental/mosaic/gpu/tcgen05.py:859— tcgen05.commit_arrive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1, ternaries 1 (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.
roofline._roofline_interpreter (cognitive 17) jax/experimental/roofline/roofline.py:138— roofline._roofline_interpreter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (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.
rooflines._get_spatial_valid_position_count_for_one_dim (cognitive 17) jax/experimental/roofline/rooflines.py:258— rooflines._get_spatial_valid_position_count_for_one_dim has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (3 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.
rooflines._ppermute_roofline (cognitive 17) jax/experimental/roofline/rooflines.py:711— rooflines._ppermute_roofline has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (7 pts), if/else 3 (6 pts), ternaries 1 (4 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.
transform._add_sparse (cognitive 17) jax/experimental/sparse/transform.py:645— transform._add_sparse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3 (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.
transform._mul_sparse (cognitive 17) jax/experimental/sparse/transform.py:692— transform._mul_sparse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2 (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.
api_util._non_static_arg_names (cognitive 16) jax/_src/api_util.py:723— api_util._non_static_arg_names has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (4 pts), error handling 1 (2 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.
K8sCluster.get_coordinator_address (cognitive 16) jax/_src/clusters/k8s_cluster.py:179— K8sCluster.get_coordinator_address has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 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.
core.get_mat (cognitive 16) jax/_src/core.py:2260— core.get_mat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 1 (2 pts), boolean chains 1, loops 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.
SymbolicScope._process_explicit_constraint (cognitive 16) jax/_src/export/shape_poly.py:1103— SymbolicScope._process_explicit_constraint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4 (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.
mlir._find_manual_pallas_collective_ids (cognitive 16) jax/_src/interpreters/mlir.py:809— mlir._find_manual_pallas_collective_ids has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), boolean chains 1 (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.
mlir.custom_call (cognitive 16) jax/_src/interpreters/mlir.py:3487— mlir.custom_call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 2 (4 pts), boolean chains 1 (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.
partial_eval.make_jaxpr_effects (cognitive 16) jax/_src/interpreters/partial_eval.py:1524— partial_eval.make_jaxpr_effects has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (3 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.
jaxpr_util.jaxpr_and_binder_in_params (cognitive 16) jax/_src/jaxpr_util.py:284— jaxpr_util.jaxpr_and_binder_in_params has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 2 (3 pts), ternaries 1 (2 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.
conditionals._cond_typecheck (cognitive 16) jax/_src/lax/control_flow/conditionals.py:999— conditionals._cond_typecheck has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, loops 1 (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.
loops._while_loop_batching_rule (cognitive 16) jax/_src/lax/control_flow/loops.py:1921— loops._while_loop_batching_rule has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 2, loops 2, ternaries 1 (2 pts) (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.
lax.empty_like (cognitive 16) jax/_src/lax/lax.py:4173— lax.empty_like has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 2 (nesting depth added 1). 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.
lax._handle_dot_precision (cognitive 16) jax/_src/lax/lax.py:7426— lax._handle_dot_precision has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2 (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.
array_creation.full_like (cognitive 16) jax/_src/numpy/array_creation.py:426— array_creation.full_like has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 2 (4 pts), boolean chains 1 (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.
Nonzero.batch (cognitive 16) jax/_src/numpy/hijax.py:356— Nonzero.batch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 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.
indexing._normalize_index (cognitive 16) jax/_src/numpy/indexing.py:801— indexing._normalize_index has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, ternaries 1 (2 pts) (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.
lax_numpy.histogramdd (cognitive 16) jax/_src/numpy/lax_numpy.py:1019— lax_numpy.histogramdd has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (2 pts), error handling 1 (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.
lax_numpy.ravel_multi_index (cognitive 16) jax/_src/numpy/lax_numpy.py:2085— lax_numpy.ravel_multi_index has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 2 (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.
sc_lowering._prepare_dma_refs (cognitive 16) jax/_src/pallas/mosaic/sc_lowering.py:507— sc_lowering._prepare_dma_refs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, match/switch 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.
sc_lowering._sort_lowering_rule (cognitive 16) jax/_src/pallas/mosaic/sc_lowering.py:1003— sc_lowering._sort_lowering_rule has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (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.
jaxpr_interpret._get_barrier_allocation_key_from_inval (cognitive 16) jax/_src/pallas/mosaic_gpu/interpret/jaxpr_interpret.py:117— jaxpr_interpret._get_barrier_allocation_key_from_inval has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 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.
primitives._extract_gmem_copy_params (cognitive 16) jax/_src/pallas/mosaic_gpu/primitives.py:486— primitives._extract_gmem_copy_params has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 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.
pallas_call_registration.pallas_call_lowering (cognitive 16) jax/_src/pallas/triton/pallas_call_registration.py:49— pallas_call_registration.pallas_call_lowering has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, ternaries 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 1). 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.
shard_map._spec_rank_error (cognitive 16) jax/_src/shard_map.py:572— shard_map._spec_rank_error has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 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.
indexing._pp_slice (cognitive 16) jax/_src/state/indexing.py:35— indexing._pp_slice has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (5 pts) (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.
thunky.all_to_all (cognitive 16) jax/_src/thunky/thunky.py:1108— thunky.all_to_all has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, ternaries 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.
KeyReuseSignature.update_consumption (cognitive 16) jax/experimental/key_reuse/_core.py:184— KeyReuseSignature.update_consumption has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4, 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.
dialect_lowering._vector_load_op_lowering_rule (cognitive 16) jax/experimental/mosaic/gpu/dialect_lowering.py:395— dialect_lowering._vector_load_op_lowering_rule has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, ternaries 1 (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.
FragmentedArray.load_strided (cognitive 16) jax/experimental/mosaic/gpu/fragmented_array.py:1207— FragmentedArray.load_strided has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (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.
FragmentedArray.foreach (cognitive 16) jax/experimental/mosaic/gpu/fragmented_array.py:4068— FragmentedArray.foreach has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 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.
fragmented_array.tiled_copy_smem_gmem_layout (cognitive 16) jax/experimental/mosaic/gpu/fragmented_array.py:5899— fragmented_array.tiled_copy_smem_gmem_layout has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (4 pts), boolean chains 2 (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.
fragmented_array.copy_tiled (cognitive 16) jax/experimental/mosaic/gpu/fragmented_array.py:5962— fragmented_array.copy_tiled has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 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.
tcgen05.async_copy_scales_smem_to_tmem (cognitive 16) jax/experimental/mosaic/gpu/tcgen05.py:1945— tcgen05.async_copy_scales_smem_to_tmem has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 2). 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.
utils.memref_reshape (cognitive 16) jax/experimental/mosaic/gpu/utils.py:877— utils.memref_reshape has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, error handling 1 (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.
utils.bitcast (cognitive 16) jax/experimental/mosaic/gpu/utils.py:2282— utils.bitcast has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6 (nesting depth added 1). 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.
multihost_utils._handle_array_process_allgather (cognitive 16) jax/experimental/multihost_utils.py:97— multihost_utils._handle_array_process_allgather has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 1 (3 pts), boolean chains 2 (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.
all_gather_mgpu.all_gather (cognitive 16) jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:32— all_gather_mgpu.all_gather has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 1 (2 pts), boolean chains 1 (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.
flash_attention.flash_attention (cognitive 16) jax/experimental/pallas/ops/tpu/flash_attention.py:140— flash_attention.flash_attention has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2 (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.
gmm.gmm (cognitive 16) jax/experimental/pallas/ops/tpu/megablox/gmm.py:314— gmm.gmm has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 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.
bcoo.bcoo_slice (cognitive 16) jax/experimental/sparse/bcoo.py:1960— bcoo.bcoo_slice has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 2 (4 pts), loops 2 (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.
bcoo.bcoo_dynamic_slice (cognitive 16) jax/experimental/sparse/bcoo.py:2037— bcoo.bcoo_dynamic_slice has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 5 (6 pts), loops 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.
bcoo._bcoo_reduce_sum (cognitive 16) jax/experimental/sparse/bcoo.py:2138— bcoo._bcoo_reduce_sum has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 1 (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.
Change coupling clique: serialization.py, export_with_memory_space.py, export_with_specified_sharding.py, export_with_unspecified_sharding.py jax/_src/export/serialization.py— 4 files — `jax/_src/export/serialization.py`, `jax/_src/internal_test_util/export_back_compat_test_data/export_with_memory_space.py`, `jax/_src/internal_test_util/export_back_compat_test_data/export_with_specified_sharding.py`, `jax/_src/internal_test_util/export_back_compat_test_data/export_with_unspecified_sharding.py` — all change together with no explicit dependency: a fully-connected co-change clique, not 6 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
Near-duplicate member pair (83 shared lines) jax/experimental/pallas/ops/tpu/flash_attention.py:961— jax/experimental/pallas/ops/tpu/flash_attention.py:961-1143 | jax/experimental/pallas/ops/tpu/flash_attention.py:1306-1478 — These two members are variants of one another: 83 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 (80 shared lines) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1439— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1439-1682 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1895-2253 — These two members are variants of one another: 80 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 (79 shared lines) jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:41— jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:41-158 | jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py:42-177 — These two members are variants of one another: 79 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 (41 shared lines) jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:162— jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:162-221 | jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py:181-243 — These two members are variants of one another: 41 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 (118 corresponding lines) · ×1
Edited copy of a member (118 corresponding lines) jax/experimental/pallas/ops/tpu/flash_attention.py:819— jax/experimental/pallas/ops/tpu/flash_attention.py:819-938 | jax/experimental/pallas/ops/tpu/flash_attention.py:1167-1284 — These two members are one piece of code written twice and then edited apart: 118 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 (75 corresponding lines) · ×1
Edited copy of a member (75 corresponding lines) jax/experimental/pallas/ops/gpu/ragged_dot_mgpu.py:246— jax/experimental/pallas/ops/gpu/ragged_dot_mgpu.py:246-326 | jax/experimental/pallas/ops/gpu/transposed_ragged_dot_mgpu.py:226-300 — These two members are one piece of code written twice and then edited apart: 75 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 (79 corresponding lines) · ×1
Edited copy of a member (79 corresponding lines) jax/_src/cudnn/fused_attention_stablehlo.py:677— jax/_src/cudnn/fused_attention_stablehlo.py:677-755 | jax/_src/cudnn/fused_attention_stablehlo.py:762-849 — These two members are one piece of code written twice and then edited apart: 79 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 copies of one member (3 members, 57+ corresponding lines) · ×1
Edited copies of one member (3 members, 57+ corresponding lines) jax/experimental/pallas/ops/gpu/blackwell_ragged_dot_mgpu.py:378— jax/experimental/pallas/ops/gpu/blackwell_ragged_dot_mgpu.py:378-435 | jax/experimental/pallas/ops/gpu/hopper_matmul_mgpu.py:276-332 | jax/experimental/pallas/ops/gpu/hopper_mixed_type_matmul_mgpu.py:279-340 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 57 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (91 corresponding lines) · ×1
Edited copy of a member (91 corresponding lines) jax/_src/pallas/mosaic/sc_lowering.py:646— jax/_src/pallas/mosaic/sc_lowering.py:646-753 | jax/_src/pallas/mosaic/sc_lowering.py:767-857 — These two members are one piece of code written twice and then edited apart: 91 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 (69 corresponding lines) · ×1
Edited copy of a member (69 corresponding lines) jax/_src/pmap.py:780— jax/_src/pmap.py:780-864 | jax/_src/pmap.py:868-936 — These two members are one piece of code written twice and then edited apart: 69 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 (56 corresponding lines) · ×1
Edited copy of a member (56 corresponding lines) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:972— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:972-1028 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask_info.py:1038-1093 — These two members are one piece of code written twice and then edited apart: 56 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 copies of one member (3 members, 20+ corresponding lines) · ×1
Edited copies of one member (3 members, 20+ corresponding lines) jax/_src/lax/special.py:435— jax/_src/lax/special.py:435-474 | jax/_src/lax/special.py:621-640 | jax/_src/lax/special.py:643-663 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 39+ corresponding lines) · ×1
Edited copies of one member (5 members, 39+ corresponding lines) jax/_src/config.py:524— jax/_src/config.py:524-579 | jax/_src/config.py:594-639 | jax/_src/config.py:655-722 | jax/_src/config.py:737-779 | jax/_src/config.py:790-828 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 39 lines, 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 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 17+ corresponding lines) · ×1
Edited copies of one member (3 members, 17+ corresponding lines) jax/_src/ad_checkpoint.py:793— jax/_src/ad_checkpoint.py:793-813 | jax/_src/compute_on.py:407-430 | jax/_src/xla_metadata.py:520-536 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) jax/_src/pallas/mosaic/lowering.py:4809— jax/_src/pallas/mosaic/lowering.py:4809-4841 | jax/_src/pallas/mosaic_gpu/lowering.py:3831-3869 — These two members are one piece of code written twice and then edited apart: 33 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) jax/_src/pallas/mosaic/interpret/shared_memory.py:578— jax/_src/pallas/mosaic/interpret/shared_memory.py:578-625 | jax/_src/pallas/mosaic/interpret/shared_memory.py:636-686 — 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 copies of one member (3 members, 22+ corresponding lines) · ×1
Edited copies of one member (3 members, 22+ corresponding lines) jax/experimental/mosaic/gpu/fragmented_array.py:1764— jax/experimental/mosaic/gpu/fragmented_array.py:1764-1785 | jax/experimental/mosaic/gpu/fragmented_array.py:1803-1824 | jax/experimental/mosaic/gpu/fragmented_array.py:1827-1850 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (47 corresponding lines) · ×1
Edited copy of a member (47 corresponding lines) jax/_src/numpy/lax_numpy.py:8910— jax/_src/numpy/lax_numpy.py:8910-8956 | jax/_src/numpy/lax_numpy.py:8962-9009 — These two members are one piece of code written twice and then edited apart: 47 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 copies of one member (5 members, 8+ corresponding lines) · ×1
Edited copies of one member (5 members, 8+ corresponding lines) jax/_src/compute_on.py:389— jax/_src/compute_on.py:389-401 | jax/_src/custom_partitioning.py:211-222 | jax/_src/pjit.py:906-915 | jax/_src/xla_metadata.py:484-493 | jax/experimental/fused.py:157-164 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 11+ corresponding lines) · ×1
Edited copies of one member (7 members, 11+ corresponding lines) jax/experimental/sparse/_lowerings.py:83— jax/experimental/sparse/_lowerings.py:83-95 | jax/experimental/sparse/_lowerings.py:209-221 | jax/experimental/sparse/_lowerings.py:261-274 | jax/experimental/sparse/_lowerings.py:307-318 | jax/experimental/sparse/_lowerings.py:321-331 | jax/experimental/sparse/_lowerings.py:334-345 | jax/experimental/sparse/_lowerings.py:348-358 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 11 lines, 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 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. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 51+ corresponding lines) · ×1
Edited copies of one member (3 members, 51+ corresponding lines) jax/_src/random/core.py:1907— jax/_src/random/core.py:1907-1957 | jax/_src/random/core.py:2487-2547 | jax/_src/random/core.py:2557-2615 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 51 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (60 corresponding lines) · ×1
Edited copy of a member (60 corresponding lines) jax/_src/numpy/lax_numpy.py:6691— jax/_src/numpy/lax_numpy.py:6691-6750 | jax/_src/numpy/lax_numpy.py:6756-6819 — These two members are one piece of code written twice and then edited apart: 60 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 copies of one member (3 members, 33+ corresponding lines) · ×1
Edited copies of one member (3 members, 33+ corresponding lines) jax/_src/numpy/ufuncs.py:1256— jax/_src/numpy/ufuncs.py:1256-1291 | jax/_src/numpy/ufuncs.py:1306-1338 | jax/_src/numpy/ufuncs.py:1601-1634 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 33 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (51 corresponding lines) · ×1
Edited copy of a member (51 corresponding lines) jax/_src/scipy/linalg.py:3027— jax/_src/scipy/linalg.py:3027-3077 | jax/_src/scipy/linalg.py:3089-3149 — These two members are one piece of code written twice and then edited apart: 51 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 (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) jax/_src/scipy/special.py:3013— jax/_src/scipy/special.py:3013-3053 | jax/_src/scipy/special.py:3057-3107 — These two members are one piece of code written twice and then edited apart: 41 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 copies of one member (4 members, 7+ corresponding lines) · ×1
Edited copies of one member (4 members, 7+ corresponding lines) jax/experimental/sparse/coo.py:491— jax/experimental/sparse/coo.py:491-500 | jax/experimental/sparse/coo.py:612-618 | jax/experimental/sparse/csr.py:505-520 | jax/experimental/sparse/csr.py:618-631 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 11+ corresponding lines) · ×1
Edited copies of one member (6 members, 11+ corresponding lines) jax/_src/numpy/array_methods.py:672— jax/_src/numpy/array_methods.py:672-683 | jax/_src/numpy/array_methods.py:686-697 | jax/_src/numpy/array_methods.py:732-742 | jax/_src/numpy/array_methods.py:745-755 | jax/_src/numpy/array_methods.py:774-784 | jax/_src/numpy/array_methods.py:787-797 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 11 lines, 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 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×1
Edited copies of one member (3 members, 14+ corresponding lines) jax/experimental/sparse/bcsr.py:269— jax/experimental/sparse/bcsr.py:269-282 | jax/experimental/sparse/coo.py:354-369 | jax/experimental/sparse/csr.py:388-401 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 21+ corresponding lines) · ×1
Edited copies of one member (4 members, 21+ corresponding lines) jax/_src/pallas/mosaic/sc_primitives.py:89— jax/_src/pallas/mosaic/sc_primitives.py:89-113 | jax/_src/pallas/mosaic/sc_primitives.py:172-203 | jax/_src/pallas/mosaic/sc_primitives.py:207-228 | jax/_src/pallas/mosaic/sc_primitives.py:232-252 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 40+ corresponding lines) · ×1
Edited copies of one member (4 members, 40+ corresponding lines) jax/_src/scipy/bessel.py:888— jax/_src/scipy/bessel.py:888-927 | jax/_src/scipy/bessel.py:1598-1640 | jax/_src/scipy/bessel.py:1934-1980 | jax/_src/scipy/bessel.py:2567-2614 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 40 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 26+ corresponding lines) · ×1
Edited copies of one member (4 members, 26+ corresponding lines) jax/_src/scipy/stats/gumbel_l.py:96— jax/_src/scipy/stats/gumbel_l.py:96-129 | jax/_src/scipy/stats/gumbel_r.py:97-127 | jax/_src/scipy/stats/gumbel_r.py:198-228 | jax/_src/scipy/stats/gumbel_r.py:232-257 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 26 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 8+ corresponding lines) · ×1
Edited copies of one member (4 members, 8+ corresponding lines) jax/experimental/roofline/rooflines.py:81— jax/experimental/roofline/rooflines.py:81-88 | jax/experimental/roofline/rooflines.py:185-193 | jax/experimental/roofline/rooflines.py:207-221 | jax/experimental/roofline/rooflines.py:797-805 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (81 corresponding lines) · ×1
Edited copy of a member (81 corresponding lines) jax/_src/numpy/reductions.py:1204— jax/_src/numpy/reductions.py:1204-1288 | jax/_src/numpy/reductions.py:1356-1436 — These two members are one piece of code written twice and then edited apart: 81 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 copies of one member (3 members, 55+ corresponding lines) · ×1
Edited copies of one member (3 members, 55+ corresponding lines) jax/_src/numpy/lax_numpy.py:4706— jax/_src/numpy/lax_numpy.py:4706-4760 | jax/_src/numpy/lax_numpy.py:4766-4820 | jax/_src/numpy/lax_numpy.py:4826-4881 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 55 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 43+ corresponding lines) · ×1
Edited copies of one member (6 members, 43+ corresponding lines) jax/_src/lax/slicing.py:484— jax/_src/lax/slicing.py:484-562 | jax/_src/lax/slicing.py:576-626 | jax/_src/lax/slicing.py:636-678 | jax/_src/lax/slicing.py:687-729 | jax/_src/lax/slicing.py:738-780 | jax/_src/lax/slicing.py:859-935 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 43 lines, 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 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 25+ corresponding lines) · ×1
Edited copies of one member (4 members, 25+ corresponding lines) jax/_src/pallas/mosaic_gpu/primitives.py:792— jax/_src/pallas/mosaic_gpu/primitives.py:792-828 | jax/_src/pallas/mosaic_gpu/primitives.py:4541-4565 | jax/_src/pallas/mosaic_gpu/primitives.py:4575-4599 | jax/_src/pallas/mosaic_gpu/primitives.py:4721-4755 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 25 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 15+ corresponding lines) · ×1
Edited copies of one member (8 members, 15+ corresponding lines) jax/_src/numpy/array_methods.py:1198— jax/_src/numpy/array_methods.py:1198-1212 | jax/_src/numpy/array_methods.py:1243-1257 | jax/_src/numpy/array_methods.py:1264-1278 | jax/_src/numpy/array_methods.py:1286-1300 | jax/_src/numpy/array_methods.py:1310-1327 | jax/_src/numpy/array_methods.py:1335-1353 | jax/_src/numpy/array_methods.py:1361-1376 | jax/_src/numpy/array_methods.py:1384-1400 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 15 lines, 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 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. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 27+ corresponding lines) · ×1
Edited copies of one member (4 members, 27+ corresponding lines) jax/_src/numpy/window_functions.py:43— jax/_src/numpy/window_functions.py:43-72 | jax/_src/numpy/window_functions.py:77-103 | jax/_src/numpy/window_functions.py:108-134 | jax/_src/numpy/window_functions.py:139-165 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 27 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 38+ corresponding lines) · ×1
Edited copies of one member (5 members, 38+ corresponding lines) jax/_src/scipy/stats/beta.py:109— jax/_src/scipy/stats/beta.py:109-148 | jax/_src/scipy/stats/beta.py:188-227 | jax/_src/scipy/stats/chi2.py:111-153 | jax/_src/scipy/stats/chi2.py:191-233 | jax/_src/scipy/stats/gamma.py:99-136 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 38 lines, 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 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 20+ corresponding lines) · ×1
Edited copies of one member (4 members, 20+ corresponding lines) jax/_src/nn/initializers.py:99— jax/_src/nn/initializers.py:99-118 | jax/_src/nn/initializers.py:123-146 | jax/_src/nn/initializers.py:166-189 | jax/_src/nn/initializers.py:196-228 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 34+ corresponding lines) · ×1
Edited copies of one member (3 members, 34+ corresponding lines) jax/_src/scipy/special.py:271— jax/_src/scipy/special.py:271-325 | jax/_src/scipy/special.py:1128-1161 | jax/_src/scipy/special.py:2358-2395 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 5+ corresponding lines) · ×1
Edited copies of one member (4 members, 5+ corresponding lines) jax/_src/ad_checkpoint.py:967— jax/_src/ad_checkpoint.py:967-985 | jax/_src/compute_on.py:65-69 | jax/_src/shard_map.py:115-166 | jax/_src/util.py:313-324 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 5 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (62–77 lines × 4) jax/_src/scipy/fft.py:53— jax/_src/scipy/fft.py:53-114 | jax/_src/scipy/fft.py:163-232 | jax/_src/scipy/fft.py:275-345 | jax/_src/scipy/fft.py:384-460 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/scipy/fft.py:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (57–58 lines × 2) jax/_src/numpy/sorting.py:213— jax/_src/numpy/sorting.py:213-269 | jax/_src/numpy/sorting.py:280-337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (54 lines × 2) jax/_src/pallas/mosaic/sc_lowering.py:155— jax/_src/pallas/mosaic/sc_lowering.py:155-208 | jax/_src/pallas/mosaic/sc_lowering.py:275-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (45–53 lines × 4) jax/_src/random/core.py:1907— jax/_src/random/core.py:1907-1952 | jax/_src/random/core.py:2487-2539 | jax/_src/random/core.py:2557-2604 | jax/_src/random/core.py:3707-3751 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/random/core.py:1907` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (53 lines × 2) jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:71— jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:71-123 | jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py:86-138 — before extracting anything, compare `jax/experimental/pallas/ops/gpu/all_gather_mgpu.py` and `jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (46–50 lines × 2) jax/_src/pallas/mosaic_gpu/primitives.py:2846— jax/_src/pallas/mosaic_gpu/primitives.py:2846-2891 | jax/_src/pallas/mosaic_gpu/primitives.py:3071-3120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `jax/_src/pallas/mosaic_gpu/primitives.py:3122` calls `handle_transforms_and_get_ref` and `jax/_src/pallas/mosaic_gpu/primitives.py:2893` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (36–49 lines × 2) jax/_src/scipy/special.py:3013— jax/_src/scipy/special.py:3013-3048 | jax/_src/scipy/special.py:3057-3105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (47 lines × 2) jax/_src/numpy/reductions.py:2454— jax/_src/numpy/reductions.py:2454-2500 | jax/_src/numpy/reductions.py:2516-2562 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (43 lines × 2) jax/_src/random/core.py:3778— jax/_src/random/core.py:3778-3820 | jax/_src/random/core.py:4430-4473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/random/core.py:4430` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (41–43 lines × 2) jax/experimental/pallas/ops/tpu/flash_attention.py:1057— jax/experimental/pallas/ops/tpu/flash_attention.py:1057-1099 | jax/experimental/pallas/ops/tpu/flash_attention.py:1398-1438 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (41–42 lines × 3) jax/_src/numpy/array_creation.py:275— jax/_src/numpy/array_creation.py:275-316 | jax/_src/numpy/array_creation.py:328-369 | jax/_src/numpy/array_creation.py:380-420 — 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 (41–42 lines × 2) jax/_src/state/primitives.py:1005— jax/_src/state/primitives.py:1005-1045 | jax/_src/state/primitives.py:1095-1136 — both copies are in the same file, so extract the block into 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–41 lines × 2) jax/_src/random/core.py:4232— jax/_src/random/core.py:4232-4271 | jax/_src/random/core.py:4295-4335 — both copies are in the same file, so extract the block into 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–37 lines × 5) jax/_src/random/core.py:1992— jax/_src/random/core.py:1992-2026 | jax/_src/random/core.py:2124-2158 | jax/_src/random/core.py:3482-3514 | jax/_src/random/core.py:3531-3563 | jax/_src/random/core.py:3891-3927 — 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 (33–36 lines × 2) jax/_src/pallas/mosaic/interpret/shared_memory.py:636— jax/_src/pallas/mosaic/interpret/shared_memory.py:636-668 | jax/_src/pallas/mosaic/interpret/shared_memory.py:698-733 — both copies are in the same file, so extract the block into 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) jax/_src/scipy/stats/pareto.py:112— jax/_src/scipy/stats/pareto.py:112-148 | jax/_src/scipy/stats/pareto.py:199-235 — both copies are in the same file, so extract the block into 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 × 2) jax/_src/lax/parallel.py:241— jax/_src/lax/parallel.py:241-272 | jax/_src/lax/parallel.py:281-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 (27–31 lines × 3) jax/experimental/pallas/ops/tpu/flash_attention.py:730— jax/experimental/pallas/ops/tpu/flash_attention.py:730-756 | jax/experimental/pallas/ops/tpu/flash_attention.py:1062-1092 | jax/experimental/pallas/ops/tpu/flash_attention.py:1403-1433 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/flash_attention.py:730` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31 lines × 2) jax/_src/scipy/stats/gumbel_l.py:28— jax/_src/scipy/stats/gumbel_l.py:28-58 | jax/_src/scipy/stats/gumbel_r.py:29-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–31 lines × 2) jax/experimental/pallas/ops/tpu/flash_attention.py:701— jax/experimental/pallas/ops/tpu/flash_attention.py:701-725 | jax/experimental/pallas/ops/tpu/flash_attention.py:1368-1398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/flash_attention.py:701` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28–30 lines × 2) jax/_src/custom_derivatives.py:323— jax/_src/custom_derivatives.py:323-350 | jax/_src/custom_derivatives.py:995-1024 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/custom_derivatives.py:323` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (3–29 lines × 3) jax/experimental/mosaic/gpu/fragmented_array.py:4916— jax/experimental/mosaic/gpu/fragmented_array.py:4916-4918 | jax/experimental/mosaic/gpu/fragmented_array.py:5447-5475 | jax/experimental/mosaic/gpu/fragmented_array.py:5609-5637 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (21–28 lines × 2) jax/_src/tpu_custom_call.py:709— jax/_src/tpu_custom_call.py:709-736 | jax/_src/tpu_custom_call.py:1058-1078 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/tpu_custom_call.py:709` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26–27 lines × 2) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1624— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1624-1649 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:2183-2209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1624` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–26 lines × 4) jax/_src/lax/slicing.py:3197— jax/_src/lax/slicing.py:3197-3214 | jax/_src/lax/slicing.py:3245-3262 | jax/_src/lax/slicing.py:3414-3439 | jax/_src/lax/slicing.py:3671-3688 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/lax/slicing.py:3414` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (26 lines × 3) jaxlib/tools/build_gpu_kernels_wheel.py:110— jaxlib/tools/build_gpu_kernels_wheel.py:110-135 | jaxlib/tools/build_gpu_kernels_wheel.py:167-192 | jaxlib/tools/build_gpu_kernels_wheel.py:223-248 — 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–25 lines × 3) jax/_src/pallas/mosaic/sc_primitives.py:172— jax/_src/pallas/mosaic/sc_primitives.py:172-196 | jax/_src/pallas/mosaic/sc_primitives.py:207-222 | jax/_src/pallas/mosaic/sc_primitives.py:232-245 — 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–25 lines × 2) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1651— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1651-1670 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:2211-2235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1651` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) jax/_src/pallas/mosaic/sc_lowering.py:529— jax/_src/pallas/mosaic/sc_lowering.py:529-552 | jax/_src/pallas/mosaic/sc_lowering.py:560-583 — both copies are in the same file, so extract the block into 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–24 lines × 2) jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:815— jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:815-834 | jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:1131-1154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:815` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–23 lines × 2) jax/experimental/pallas/ops/gpu/attention_mgpu.py:468— jax/experimental/pallas/ops/gpu/attention_mgpu.py:468-488 | jax/experimental/pallas/ops/gpu/attention_mgpu.py:575-597 — both copies are in the same file, so extract the block into 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–22 lines × 2) jax/_src/pallas/mosaic_gpu/pipeline.py:464— jax/_src/pallas/mosaic_gpu/pipeline.py:464-485 | jax/_src/pallas/mosaic_gpu/pipeline.py:1044-1062 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic_gpu/pipeline.py:464` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–21 lines × 2) jax/_src/lax/lax.py:4122— jax/_src/lax/lax.py:4122-4142 | jax/_src/lax/lax.py:4193-4208 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jax/_src/lax/lax.py:4119` calls `isinstance`, `full` and `jax/_src/lax/lax.py:4191` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18–20 lines × 2) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1553— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1553-1570 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:2084-2103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1553` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (19–20 lines × 2) jaxlib/tools/build_gpu_plugin_wheel.py:116— jaxlib/tools/build_gpu_plugin_wheel.py:116-134 | jaxlib/tools/build_gpu_plugin_wheel.py:156-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 (17–19 lines × 2) jax/_src/callback.py:608— jax/_src/callback.py:608-624 | jax/_src/callback.py:645-663 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/callback.py:608` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18–19 lines × 2) jax/_src/pallas/triton/lowering.py:528— jax/_src/pallas/triton/lowering.py:528-546 | jax/_src/pallas/triton/lowering.py:2603-2620 — both copies are in the same file, so extract the block into 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–18 lines × 2) jax/_src/pallas/mosaic/interpret/race_detection_state.py:109— jax/_src/pallas/mosaic/interpret/race_detection_state.py:109-126 | jax/_src/pallas/mosaic/interpret/race_detection_state.py:160-174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic/interpret/race_detection_state.py:109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–17 lines × 2) jax/_src/scipy/bessel.py:506— jax/_src/scipy/bessel.py:506-517 | jax/_src/scipy/bessel.py:1122-1138 — both copies are in the same file, so extract the block into 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–17 lines × 2) jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:145— jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:145-158 | jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py:161-177 — before extracting anything, compare `jax/experimental/pallas/ops/gpu/all_gather_mgpu.py` and `jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py:161` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jax/experimental/pallas/ops/gpu/all_gather_mgpu.py:142` calls `multimem_store`, `semaphore_signal_multicast` and `jax/experimental/pallas/ops/gpu/reduce_scatter_mgpu.py:161` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–16 lines × 2) jax/_src/pallas/mosaic/pallas_call_registration.py:171— jax/_src/pallas/mosaic/pallas_call_registration.py:171-186 | jax/_src/pallas/mosaic/pallas_call_registration.py:193-204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic/pallas_call_registration.py:171` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–16 lines × 2) jax/_src/scipy/bessel.py:570— jax/_src/scipy/bessel.py:570-578 | jax/_src/scipy/bessel.py:1177-1192 — both copies are in the same file, so extract the block into 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) jax/_src/lax/control_flow/conditionals.py:400— jax/_src/lax/control_flow/conditionals.py:400-413 | jax/_src/lax/control_flow/loops.py:597-611 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/lax/control_flow/conditionals.py:400` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–15 lines × 2) jax/experimental/mosaic/gpu/layout_inference.py:1429— jax/experimental/mosaic/gpu/layout_inference.py:1429-1441 | jax/experimental/mosaic/gpu/layout_inference.py:1486-1500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/mosaic/gpu/layout_inference.py:1429` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `op` to `vector.ExtractStridedSliceOp` in one and `vector.InsertStridedSliceOp` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jax/experimental/mosaic/gpu/layout_inference.py:1485` calls `Variable`, `ValueSite` and `jax/experimental/mosaic/gpu/layout_inference.py:1428` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–15 lines × 2) jax/experimental/mosaic/gpu/tcgen05.py:446— jax/experimental/mosaic/gpu/tcgen05.py:446-457 | jax/experimental/mosaic/gpu/wgmma.py:395-409 — 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–13 lines × 3) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:963— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:963-975 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1455-1465 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1915-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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:963` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1468` calls `ValueError` and `jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1927` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–13 lines × 2) jax/_src/scipy/bessel.py:625— jax/_src/scipy/bessel.py:625-634 | jax/_src/scipy/bessel.py:1290-1302 — both copies are in the same file, so extract the block into 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–12 lines × 4) jax/_src/pallas/mosaic_gpu/primitives.py:4312— jax/_src/pallas/mosaic_gpu/primitives.py:4312-4319 | jax/_src/pallas/mosaic_gpu/primitives.py:4345-4356 | jax/_src/pallas/mosaic_gpu/primitives.py:4447-4454 | jax/_src/pallas/mosaic_gpu/primitives.py:4493-4504 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/pallas/mosaic_gpu/primitives.py:4312` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jax/_src/pallas/mosaic_gpu/primitives.py:4344` calls `isinstance` and `jax/_src/pallas/mosaic_gpu/primitives.py:4311` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–12 lines × 4) jax/experimental/sparse/_lowerings.py:66— jax/experimental/sparse/_lowerings.py:66-77 | jax/experimental/sparse/_lowerings.py:119-130 | jax/experimental/sparse/_lowerings.py:193-203 | jax/experimental/sparse/_lowerings.py:245-255 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/sparse/_lowerings.py:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10–12 lines × 3) jax/_src/lax/linalg.py:1805— jax/_src/lax/linalg.py:1805-1814 | jax/_src/lax/linalg.py:2009-2020 | jax/_src/tpu/linalg/eigh.py:674-685 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/lax/linalg.py:1805` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) jax/_src/pallas/mosaic_gpu/primitives.py:4616— jax/_src/pallas/mosaic_gpu/primitives.py:4616-4627 | jax/_src/pallas/mosaic_gpu/primitives.py:4799-4810 | jax/_src/pallas/mosaic_gpu/primitives.py:4863-4874 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jax/_src/pallas/mosaic_gpu/primitives.py:4798` calls `isinstance` and `jax/_src/pallas/mosaic_gpu/primitives.py:4862` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–12 lines × 3) jax/experimental/mosaic/gpu/fragmented_array.py:1766— jax/experimental/mosaic/gpu/fragmented_array.py:1766-1776 | jax/experimental/mosaic/gpu/fragmented_array.py:1805-1815 | jax/experimental/mosaic/gpu/fragmented_array.py:1830-1841 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/experimental/mosaic/gpu/fragmented_array.py:1766` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–11 lines × 2) jax/_src/pallas/mosaic_gpu/interpret/jaxpr_interpret.py:1044— jax/_src/pallas/mosaic_gpu/interpret/jaxpr_interpret.py:1044-1052 | jax/_src/pallas/mosaic_gpu/interpret/jaxpr_interpret.py:1196-1206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–11 lines × 2) jax/_src/scipy/bessel.py:1549— jax/_src/scipy/bessel.py:1549-1559 | jax/_src/scipy/bessel.py:2499-2506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/scipy/bessel.py:1549` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 4) jax/_src/pallas/mosaic/lowering.py:3695— jax/_src/pallas/mosaic/lowering.py:3695-3704 | jax/_src/pallas/mosaic/lowering.py:3717-3726 | jax/_src/pallas/mosaic/lowering.py:4053-4062 | jax/_src/pallas/mosaic/lowering.py:4075-4084 — 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 × 3) jax/_src/custom_derivatives.py:331— jax/_src/custom_derivatives.py:331-340 | jax/_src/custom_derivatives.py:1018-1027 | jax/_src/hijax.py:1423-1432 — 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 (2–10 lines × 4) jax/_src/cudnn/fused_attention_stablehlo.py:910— jax/_src/cudnn/fused_attention_stablehlo.py:910-918 | jax/_src/cudnn/fused_attention_stablehlo.py:986-987 | jax/_src/cudnn/fused_attention_stablehlo.py:1739-1748 | jax/_src/cudnn/fused_attention_stablehlo.py:1790-1791 — 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 × 5) docs/_static/fault_tolerance/cancel_collectives.py:37— docs/_static/fault_tolerance/cancel_collectives.py:37-45 | docs/_static/fault_tolerance/collectives.py:31-39 | docs/_static/fault_tolerance/dont_fail.py:30-38 | docs/_static/fault_tolerance/live_devices.py:38-46 | docs/_static/fault_tolerance/while_loop.py:26-34 — before extracting anything, compare `docs/_static/fault_tolerance/cancel_collectives.py` and `docs/_static/fault_tolerance/collectives.py` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `docs/_static/fault_tolerance/cancel_collectives.py:49` calls `_live_devices`, `devices` and `docs/_static/fault_tolerance/collectives.py:41` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–9 lines × 3) jax/experimental/mosaic/gpu/examples/matmul_blackwell.py:77— jax/experimental/mosaic/gpu/examples/matmul_blackwell.py:77-82 | jax/experimental/pallas/ops/gpu/blackwell_matmul_mgpu.py:83-88 | jax/experimental/pallas/ops/gpu/blackwell_ragged_dot_mgpu.py:246-254 — before extracting anything, compare `jax/experimental/pallas/ops/gpu/blackwell_matmul_mgpu.py` and `jax/experimental/pallas/ops/gpu/blackwell_ragged_dot_mgpu.py` 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–9 lines × 2) jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask.py:272— jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask.py:272-280 | jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_mask.py:544-550 — both copies are in the same file, so extract the block into 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 × 4) jax/_src/cudnn/fused_attention_stablehlo.py:908— jax/_src/cudnn/fused_attention_stablehlo.py:908-915 | jax/_src/cudnn/fused_attention_stablehlo.py:974-981 | jax/_src/cudnn/fused_attention_stablehlo.py:1737-1744 | jax/_src/cudnn/fused_attention_stablehlo.py:1778-1785 — 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) jax/experimental/sparse/ad.py:97— jax/experimental/sparse/ad.py:97-102 | jax/experimental/sparse/ad.py:125-130 | jax/experimental/sparse/ad.py:148-153 | jax/experimental/sparse/ad.py:171-176 — 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–6 lines × 3) jax/_src/cudnn/fused_attention_stablehlo.py:482— jax/_src/cudnn/fused_attention_stablehlo.py:482-487 | jax/_src/cudnn/fused_attention_stablehlo.py:602-606 | jax/_src/cudnn/fused_attention_stablehlo.py:1002-1006 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–6 lines × 4) jax/_src/compute_on.py:250— jax/_src/compute_on.py:250-255 | jax/_src/lax/eval_jaxpr.py:61-64 | jax/_src/program_order.py:260-263 | jax/_src/xla_metadata.py:432-437 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/compute_on.py:250` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `jax/_src/compute_on.py:255` calls `split_list` and `jax/_src/lax/eval_jaxpr.py:64` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (4–6 lines × 3) jax/_src/lax/control_flow/conditionals.py:379— jax/_src/lax/control_flow/conditionals.py:379-384 | jax/_src/lax/control_flow/loops.py:557-562 | jax/_src/lax/control_flow/loops.py:581-584 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/lax/control_flow/conditionals.py:379` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jax/_src/lax/control_flow/loops.py:581` calls `_capitalize` and `jax/_src/lax/control_flow/conditionals.py:379` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) jax/_src/compute_on.py:198— jax/_src/compute_on.py:198-204 | jax/_src/xla_metadata.py:382-388 | jax/experimental/fused.py:92-98 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `jax/_src/compute_on.py:198` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (15 lines × 4) jax_plugins/cuda/plugin_setup.py:40— jax_plugins/cuda/plugin_setup.py:40-54 | jax_plugins/oneapi/plugin_setup.py:27-61 | jax_plugins/rocm/plugin_setup.py:38-54 | jaxlib/setup.py:24-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `jax_plugins/oneapi/plugin_setup.py:63` calls `open`, `read` and `jax_plugins/cuda/plugin_setup.py:56` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication· Edited copies of one member (3 members, 30+ corresponding lines) · ×1
Edited copies of one member (3 members, 30+ corresponding lines) jax/example_libraries/optimizers.py:295— jax/example_libraries/optimizers.py:295-327 | jax/example_libraries/optimizers.py:360-389 | jax/example_libraries/optimizers.py:430-460 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 23+ corresponding lines) · ×1
Edited copies of one member (3 members, 23+ corresponding lines) jax/example_libraries/optimizers.py:241— jax/example_libraries/optimizers.py:241-263 | jax/example_libraries/optimizers.py:268-290 | jax/example_libraries/optimizers.py:332-355 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 4+ corresponding lines) · ×1
Edited copies of one member (4 members, 4+ corresponding lines) examples/differentially_private_sgd.py:129— examples/differentially_private_sgd.py:129-132 | examples/mnist_classifier.py:42-45 | examples/mnist_classifier_fromscratch.py:51-54 | examples/spmd_mnist_classifier_fromscratch.py:62-65 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 3+ corresponding lines) · ×1
Edited copies of one member (4 members, 3+ corresponding lines) examples/differentially_private_sgd.py:122— examples/differentially_private_sgd.py:122-125 | examples/mnist_classifier.py:37-39 | examples/mnist_classifier_fromscratch.py:46-48 | examples/spmd_mnist_classifier_fromscratch.py:47-49 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (23 lines × 2) jax/example_libraries/optimizers.py:394— jax/example_libraries/optimizers.py:394-416 | jax/example_libraries/optimizers.py:430-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 predicate jax/experimental/pallas/ops/gpu/blackwell_matmul_mgpu.py:316— `"exceeds available shared memory" in e.args[0] or "Accumulator layout mismatch:" in e.args[0]` appears character-identically in 2 files — jax/experimental/pallas/ops/gpu/blackwell_matmul_mgpu.py, jax/experimental/pallas/ops/gpu/blackwell_ragged_dot_mgpu.py. 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 jax/experimental/pallas/ops/tpu/random/philox.py:167— `( shape[-2] % BLOCK_SIZE[-2] != 0) or (shape[-1] % BLOCK_SIZE[-1] != 0)` appears character-identically in 2 files — jax/experimental/pallas/ops/tpu/random/philox.py, jax/experimental/pallas/ops/tpu/random/threefry.py. 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 jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:2170— `(output_idx >= 0) and (output_idx < grid_mapping.num_outputs)` appears character-identically in 2 files — jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py, jax/_src/pallas/mosaic_gpu/interpret/interpret_pallas_call.py. 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 jax/experimental/pallas/ops/tpu/random/philox.py:106— `(shape[-2] % block_size[-2] != 0) or (shape[-1] % block_size[-1] != 0)` appears character-identically in 2 files — jax/experimental/pallas/ops/tpu/random/philox.py, jax/experimental/pallas/ops/tpu/random/threefry.py. 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 jax/_src/config.py:272— `TYPE_CHECKING or jaxlib_extension_version >= 509` appears character-identically in 3 files — jax/_src/config.py, jax/_src/layout.py, jax/_src/mesh.py. 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 jax/_src/interpreters/pxla.py:1971— `a is not core.abstract_token and dtypes.issubdtype(a.dtype, dtypes.extended)` appears character-identically in 2 files — jax/_src/interpreters/pxla.py, jax/_src/pjit.py. 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 jax/_src/numpy/linalg.py:147— `a.ndim < 2 or a.shape[-1] != a.shape[-2]` appears character-identically in 2 files — jax/_src/numpy/linalg.py, jax/_src/scipy/linalg.py. 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 jax/experimental/sparse/bcsr.py:369— `ad.is_undefined_primal(indices) or ad.is_undefined_primal(indptr)` appears character-identically in 2 files — jax/experimental/sparse/bcsr.py, jax/experimental/sparse/csr.py. 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 jaxlib/tools/build_gpu_kernels_wheel.py:79— `args.enable_cuda and not args.nvidia_wheel_versions_data` appears character-identically in 2 files — jaxlib/tools/build_gpu_kernels_wheel.py, jaxlib/tools/build_gpu_plugin_wheel.py. 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 jax/_src/pallas/mosaic/lowering.py:2379— `assumption.no_hazard or assumption.no_hazard_no_deps` appears character-identically in 2 files — jax/_src/pallas/mosaic/lowering.py, jax/_src/pallas/mosaic/primitives.py. 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 jax/_src/interpreters/ad.py:271— `config.enable_checks.value and core.check_jaxpr(jaxpr)` appears character-identically in 3 files — jax/_src/interpreters/ad.py, jax/_src/interpreters/partial_eval.py, jax/_src/lax/control_flow/common.py. 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 jax/_src/ad_checkpoint.py:697— `config.enable_checks.value and core.check_jaxpr(new_jaxpr)` appears character-identically in 2 files — jax/_src/ad_checkpoint.py, jax/_src/interpreters/partial_eval.py. 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 jax/_src/compiler.py:560— `config.enable_pgle.value and config.pgle_profiling_runs.value > 0` appears character-identically in 2 files — jax/_src/compiler.py, jax/_src/pjit.py. 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 jax/_src/pallas/core.py:1675— `config.pallas_tpu_interpret_mode_context_manager.value or interpret` appears character-identically in 4 files — jax/_src/pallas/core.py, jax/_src/pallas/helpers.py, jax/_src/pallas/mpmd.py, jax/_src/pallas/pallas_call.py. 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 jax/_src/lax/lax.py:3509— `core.is_concrete(x) and aval.shape == ()` appears character-identically in 2 files — jax/_src/lax/lax.py, jax/_src/lax/windowed_reductions.py. 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 jax/_src/lax/fft.py:225— `ctx.platforms or ctx.module_context.platforms` appears character-identically in 2 files — jax/_src/lax/fft.py, jax/_src/pallas/triton/pallas_call_registration.py. 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 jax/_src/compute_on.py:414— `dced_jaxpr is eqn.params['jaxpr'] and all(used_inputs) and all(used_outputs)` appears character-identically in 3 files — jax/_src/compute_on.py, jax/_src/pjit.py, jax/_src/xla_metadata.py. 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 jax/_src/numpy/array_creation.py:192— `device is not None and out_sharding is None` appears character-identically in 2 files — jax/_src/numpy/array_creation.py, jax/_src/numpy/util.py. 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 jax/_src/lax/linalg.py:2341— `full_matrices and subset_by_index != (0, rank)` appears character-identically in 2 files — jax/_src/lax/linalg.py, jax/_src/tpu/linalg/svd.py. 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 jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py:587— `idx.is_dynamic_start or idx.is_dynamic_size` appears character-identically in 2 files — jax/_src/pallas/mosaic_gpu/interpret/gpu_callbacks.py, jax/_src/state/discharge.py. 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 jax/_src/api.py:1636— `isinstance(a, core.ShapedArray) and isinstance(a_, core.ShapedArray)` appears character-identically in 2 files — jax/_src/api.py, jax/_src/custom_derivatives.py. 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 jax/_src/pallas/mosaic/pallas_call_registration.py:166— `isinstance(aval, jax_core.ShapedArray) and not isinstance(aval.memory_space, jax_core.MemorySpace)` appears character-identically in 2 files — jax/_src/pallas/mosaic/pallas_call_registration.py, jax/_src/pallas/mpmd.py. 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 jax/_src/interpreters/mlir.py:1332— `isinstance(axis_ctx, sharding_impls.SPMDAxisContext) and axis_ctx.manual_axes` appears character-identically in 2 files — jax/_src/interpreters/mlir.py, jax/_src/pjit.py. 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 jax/_src/interpreters/ad.py:105— `isinstance(c, pe.DynamicJaxprTracer) and getattr(c._trace, 'tag', None) is tag` appears character-identically in 2 files — jax/_src/interpreters/ad.py, jax/_src/interpreters/remat.py. 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 jax/experimental/sparse/bcsr.py:293— `isinstance(indices, ad.Zero) or isinstance(indptr, ad.Zero)` appears character-identically in 2 files — jax/experimental/sparse/bcsr.py, jax/experimental/sparse/csr.py. 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.
Orphaned file jax/_src/internal_test_util/export_back_compat_test_data/tpu_Sharding.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 jax/_src/scipy/stats/gumbel_r.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 jax/_src/scipy/stats/gumbel_l.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 jax/_src/internal_test_util/export_back_compat_test_data/shardy_sharding_ops_with_different_meshes.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 jax/_src/sourcemap.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 jaxlib/gpu_rnn.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 jax/collect_profile.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 jaxlib/tools/build_mosaic_wheel.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 jax/_src/internal_test_util/export_back_compat_test_data/cuda_lu_pivots_to_permutation.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 jaxlib/mosaic/gpu/wheel/setup.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 jax/tools/pgo_nsys_converter.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 jax/experimental/pallas/ops/tpu/megablox/ops.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 jax/_src/clusters/mpi4py_cluster.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 ci/utilities/convert_msys_paths_to_win_paths.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 jax/experimental/pallas/ops/tpu/paged_attention/quantization_utils.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 jax/experimental/source_mapper/common.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.
Interpolated log message defeats structured logging jax_plugins/cuda/__init__.py:284— `warning` at line 284 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 jax_plugins/cuda/__init__.py:359— `debug` at line 359 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.debug("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.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging jax/_src/compiler.py:593— `info` at line 593 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.info("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.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging jax/_src/lru_cache.py:105— `debug` at line 105 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.debug("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.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging jax/_src/lru_cache.py:108— `debug` at line 108 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.debug("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.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging jax/_src/tpu_custom_call.py:788— `warning` at line 788 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 jax/_src/xla_bridge.py:903— `warning` at line 903 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 jax/_src/xla_bridge.py:907— `warning` at line 907 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 jax/_src/xla_bridge.py:932— `warning` at line 932 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 jax/_src/clusters/cluster.py:59— `error` at line 59 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging jax/_src/clusters/cluster.py:62— `error` at line 62 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging jax/_src/clusters/k8s_cluster.py:43— `debug` at line 43 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.debug("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.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging jax/_src/clusters/k8s_cluster.py:53— `debug` at line 53 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.debug("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.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging build/tools/utils.py:272— `debug` at line 272 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.debug("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.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging build/rocm/tools/build_wheels.py:241— `error` at line 241 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging build/rocm/tools/build_wheels.py:244— `error` at line 244 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 9 significant file(s) lose their only recent owner: jax/_src/numpy/index_tricks.py, jax/_src/scipy/stats/chi2.py, jax/_src/scipy/stats/uniform.py, benchmarks/math_benchmark.py, jax/_src/scipy/stats/t.py, jax/_src/scipy/stats/laplace.py, jax/_src/random/__init__.py, jax/_src/scipy/stats/multinomial.py (+1 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 3 significant file(s) lose their only recent owner: jax/_src/lax/erf.py, jax/_src/image/scale.py, benchmarks/linalg_benchmark.py. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 3 significant file(s) lose their only recent owner: jax/_src/internal_test_util/export_back_compat_test_data/export_with_multiple_meshes.py, jax/_src/internal_test_util/export_back_compat_test_data/export_with_specified_sharding.py, jax/_src/internal_test_util/export_back_compat_test_data/export_with_unspecified_sharding.py. Pair on, review, or document these before any departure.
C2 · Access Controls· No named authorization policies · ×1
No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 4 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 (19 single-owned of 458 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; 458 of the 682 production source files in this repository met that bar). They are anonymized user #4 (1 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (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: jax/example_libraries/stax.py, jax/_src/pallas/mosaic/prefetch.py, benchmarks/pallas/mgpu_planar_snake_bench.py, benchmarks/shape_poly_benchmark.py.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 7 project(s) overshoot their size bounds, lowering Project Cohesion to 7.1/10. The most over is `(repository root)` (295849 LoC, 1392 module-visible types across 64 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.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 16 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: jax/_src/internal_test_util/export_back_compat_test_data/tpu_Sharding.py, jax/_src/scipy/stats/gumbel_r.py, jax/_src/scipy/stats/gumbel_l.py, jax/_src/internal_test_util/export_back_compat_test_data/shardy_sharding_ops_with_different_meshes.py, jax/_src/sourcemap.py, jaxlib/gpu_rnn.py, jax/collect_profile.py, jaxlib/tools/build_mosaic_wheel.py (and 8 more) (33 orphaned of 458 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; 458 of the 682 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D40 · Network Egress Confinement· No network policy · ×1
No network policy — No Kubernetes NetworkPolicy (or Cilium policy) found. Without one, every pod can talk to every other pod and reach out to the internet by default. Add a default-deny policy and open only the flows you need.
No seccomp profile REDACTED:12— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No src/ separation — Most of the production code is in directories of its own, but 1 application file(s) sit at the repository root beside the build and tooling files (`build_wheel.py`).
No SAST .github/workflows/asan.yaml:24— No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 35 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P4 · Deployment & Rollback· No rollback/health safety · ×1
No rollback/health safety — Deployment automation exists but no readiness/liveness probes, rolling-update strategy, lifecycle hooks or migration job were evidenced — a bad release is harder to detect and reverse.
X23 · Unguarded diagnostic materialisation· Diagnostic log message is built whether or not it is wanted · ×1
Diagnostic log message is built whether or not it is wanted jax/_src/clusters/cluster.py:89— `debug` at line 89 is called with an argument built by `"…".join(e.__name__ for e in cls._cluster_types)` (line 90), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Silent fallback default in catch jax/_src/api_util.py:713— `fun_sourceinfo` swallows every exception into `return '<unknown>'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
Dependency hygiene PARTLY measured — Python dependencies read, no exact pin to grade for currency — This repository's Python dependencies were read: 3 shipped distribution(s) across 8 manifest(s) (114 development or optional declaration(s) excluded, because a consumer does not install them). Whether any of them is behind its current release is the dependency-CURRENCY question, and no declaration here carries an EXACT pin to ask it about — every one is a floor or a range, which installs the newest release it admits and therefore cannot be behind one. That is a healthy declaration style, NOT a defect and NOT a gap in this analyzer; there is simply no currency question to answer. This is NOT a finding that these dependencies are current or healthy. Lockfiles are deliberately not read (poetry.lock, uv.lock, Pipfile.lock, pdm.lock): the four disagree about dev/optional membership, and misreading one would charge a test-only package a consumer never receives. Known CVEs in the same dependency graph are a separate question, reported under D30.
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.
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. semgrep could not parse 49 file(s) — `jax/_src/ad_util.py`, `jax/_src/api.py`, `jax/_src/checkify.py`, `jax/_src/config.py`, `jax/_src/core.py`, … (+44 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
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 — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
Run 01a1d83a-2b10-7aea-9f85-efeaacfbc84c · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 48 · Warnings: 3352 · Recommendations: 98 · Info: 1 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 04:04 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.