{"$schema":"https://json.schemastore.org/sarif-2.1.0.json","version":"2.1.0","runs":[{"tool":{"driver":{"name":"codehealth","informationUri":"https://codehealth.canine.dev","rules":[{"id":"D1","name":"Cyclomatic Complexity","shortDescription":{"text":"Cyclomatic Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D1"},{"id":"D2","name":"Cognitive Complexity","shortDescription":{"text":"Cognitive Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D2"},{"id":"D3","name":"God Classes","shortDescription":{"text":"God Classes"},"helpUri":"https://codehealth.canine.dev/dimensions/D3"},{"id":"D4","name":"Code Duplication","shortDescription":{"text":"Code Duplication"},"helpUri":"https://codehealth.canine.dev/dimensions/D4"},{"id":"D5","name":"Coupling","shortDescription":{"text":"Coupling"},"helpUri":"https://codehealth.canine.dev/dimensions/D5"},{"id":"D6","name":"Cohesion (LCOM4)","shortDescription":{"text":"Cohesion (LCOM4)"},"helpUri":"https://codehealth.canine.dev/dimensions/D6"},{"id":"D9","name":"Test Distribution","shortDescription":{"text":"Test Distribution"},"helpUri":"https://codehealth.canine.dev/dimensions/D9"},{"id":"D11","name":"Test Reliability","shortDescription":{"text":"Test Reliability"},"helpUri":"https://codehealth.canine.dev/dimensions/D11"},{"id":"D12","name":"Dependency Hygiene","shortDescription":{"text":"Dependency Hygiene"},"helpUri":"https://codehealth.canine.dev/dimensions/D12"},{"id":"D13","name":"Secret Scanning","shortDescription":{"text":"Secret Scanning"},"helpUri":"https://codehealth.canine.dev/dimensions/D13","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A07:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"],"owasp":"A07:2025"}},{"id":"D14","name":"License Compliance","shortDescription":{"text":"License Compliance"},"helpUri":"https://codehealth.canine.dev/dimensions/D14"},{"id":"D15","name":"Churn \u00D7 Complexity Hotspots","shortDescription":{"text":"Churn \u00D7 Complexity Hotspots"},"helpUri":"https://codehealth.canine.dev/dimensions/D15"},{"id":"D16","name":"Bus Factor","shortDescription":{"text":"Bus Factor"},"helpUri":"https://codehealth.canine.dev/dimensions/D16"},{"id":"D17","name":"Explicit Debt","shortDescription":{"text":"Explicit Debt"},"helpUri":"https://codehealth.canine.dev/dimensions/D17"},{"id":"D19","name":"Documentation Quality","shortDescription":{"text":"Documentation Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D19"},{"id":"D20","name":"ADR Quality","shortDescription":{"text":"ADR Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D20"},{"id":"D26","name":"Project Cohesion","shortDescription":{"text":"Project Cohesion"},"helpUri":"https://codehealth.canine.dev/dimensions/D26"},{"id":"D27","name":"Navigability","shortDescription":{"text":"Navigability"},"helpUri":"https://codehealth.canine.dev/dimensions/D27"},{"id":"D28","name":"Secrets (history)","shortDescription":{"text":"Secrets (history)"},"helpUri":"https://codehealth.canine.dev/dimensions/D28","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A07:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"],"owasp":"A07:2025"}},{"id":"D29","name":"Static Analysis (SAST)","shortDescription":{"text":"Static Analysis (SAST)"},"helpUri":"https://codehealth.canine.dev/dimensions/D29","relationships":[{"target":{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-94","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-77","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A05:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-79","CWE-89","CWE-78","CWE-94","CWE-77"],"owasp":"A05:2025"}},{"id":"D30","name":"Dependency Vulnerabilities","shortDescription":{"text":"Dependency Vulnerabilities"},"helpUri":"https://codehealth.canine.dev/dimensions/D30","relationships":[{"target":{"id":"CWE-1395","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-937","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1395","CWE-937"],"owasp":"A03:2025"}},{"id":"D34","name":"Knowledge Freshness","shortDescription":{"text":"Knowledge Freshness"},"helpUri":"https://codehealth.canine.dev/dimensions/D34"},{"id":"D35","name":"Change Coupling","shortDescription":{"text":"Change Coupling"},"helpUri":"https://codehealth.canine.dev/dimensions/D35"},{"id":"D36","name":"Supply-chain Provenance \u0026 Signing","shortDescription":{"text":"Supply-chain Provenance \u0026 Signing"},"helpUri":"https://codehealth.canine.dev/dimensions/D36","relationships":[{"target":{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-494","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1357","CWE-494"],"owasp":"A03:2025"}},{"id":"D43","name":"Malicious Dependencies","shortDescription":{"text":"Malicious Dependencies"},"helpUri":"https://codehealth.canine.dev/dimensions/D43","relationships":[{"target":{"id":"CWE-506","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A08:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-506"],"owasp":"A08:2025"}},{"id":"D44","name":"Platform End-of-Life","shortDescription":{"text":"Platform End-of-Life"},"helpUri":"https://codehealth.canine.dev/dimensions/D44"},{"id":"AX10","name":"Code composition","shortDescription":{"text":"Code composition"},"helpUri":"https://codehealth.canine.dev/dimensions/AX10"},{"id":"AX3","name":"Project dependency cycles","shortDescription":{"text":"Project dependency cycles"},"helpUri":"https://codehealth.canine.dev/dimensions/AX3"},{"id":"AX4","name":"Dependency direction","shortDescription":{"text":"Dependency direction"},"helpUri":"https://codehealth.canine.dev/dimensions/AX4"},{"id":"AX6","name":"Interface segregation","shortDescription":{"text":"Interface segregation"},"helpUri":"https://codehealth.canine.dev/dimensions/AX6"},{"id":"AX8","name":"Test isolation","shortDescription":{"text":"Test isolation"},"helpUri":"https://codehealth.canine.dev/dimensions/AX8"},{"id":"AX9","name":"CQS / query purity","shortDescription":{"text":"CQS / query purity"},"helpUri":"https://codehealth.canine.dev/dimensions/AX9"},{"id":"AXB2","name":"Runtime readiness","shortDescription":{"text":"Runtime readiness"},"helpUri":"https://codehealth.canine.dev/dimensions/AXB2"},{"id":"C2","name":"Access Controls","shortDescription":{"text":"Access Controls"},"helpUri":"https://codehealth.canine.dev/dimensions/C2"},{"id":"ED5","name":"Idempotency","shortDescription":{"text":"Idempotency"},"helpUri":"https://codehealth.canine.dev/dimensions/ED5"},{"id":"M1","name":"Documentation (README)","shortDescription":{"text":"Documentation (README)"},"helpUri":"https://codehealth.canine.dev/dimensions/M1"},{"id":"M2","name":"Architecture documentation","shortDescription":{"text":"Architecture documentation"},"helpUri":"https://codehealth.canine.dev/dimensions/M2"},{"id":"M3","name":"Folder \u0026 project structure","shortDescription":{"text":"Folder \u0026 project structure"},"helpUri":"https://codehealth.canine.dev/dimensions/M3"},{"id":"M4","name":"Documentation accuracy","shortDescription":{"text":"Documentation accuracy"},"helpUri":"https://codehealth.canine.dev/dimensions/M4"},{"id":"P1","name":"CI/CD gates","shortDescription":{"text":"CI/CD gates"},"helpUri":"https://codehealth.canine.dev/dimensions/P1"},{"id":"P10","name":"Library API \u0026 versioning","shortDescription":{"text":"Library API \u0026 versioning"},"helpUri":"https://codehealth.canine.dev/dimensions/P10"},{"id":"P12","name":"CI test-gate honesty","shortDescription":{"text":"CI test-gate honesty"},"helpUri":"https://codehealth.canine.dev/dimensions/P12"},{"id":"P2","name":"Observability","shortDescription":{"text":"Observability"},"helpUri":"https://codehealth.canine.dev/dimensions/P2"},{"id":"P3","name":"Security \u0026 performance tooling","shortDescription":{"text":"Security \u0026 performance tooling"},"helpUri":"https://codehealth.canine.dev/dimensions/P3"},{"id":"P4","name":"Deployment \u0026 Rollback","shortDescription":{"text":"Deployment \u0026 Rollback"},"helpUri":"https://codehealth.canine.dev/dimensions/P4"},{"id":"P6","name":"Release Hygiene","shortDescription":{"text":"Release Hygiene"},"helpUri":"https://codehealth.canine.dev/dimensions/P6"},{"id":"P7","name":"Outbound HTTP resilience","shortDescription":{"text":"Outbound HTTP resilience"},"helpUri":"https://codehealth.canine.dev/dimensions/P7"},{"id":"PF3","name":"Async \u0026 latency hygiene","shortDescription":{"text":"Async \u0026 latency hygiene"},"helpUri":"https://codehealth.canine.dev/dimensions/PF3"},{"id":"SC1","name":"Supply-chain hygiene","shortDescription":{"text":"Supply-chain hygiene"},"helpUri":"https://codehealth.canine.dev/dimensions/SC1"},{"id":"X1","name":"Async correctness","shortDescription":{"text":"Async correctness"},"helpUri":"https://codehealth.canine.dev/dimensions/X1"},{"id":"X10","name":"Duplicated predicate","shortDescription":{"text":"Duplicated predicate"},"helpUri":"https://codehealth.canine.dev/dimensions/X10"},{"id":"X12","name":"Unreachable branch","shortDescription":{"text":"Unreachable branch"},"helpUri":"https://codehealth.canine.dev/dimensions/X12"},{"id":"X13","name":"Undrained process stream","shortDescription":{"text":"Undrained process stream"},"helpUri":"https://codehealth.canine.dev/dimensions/X13"},{"id":"X14","name":"Bypassable address classification","shortDescription":{"text":"Bypassable address classification"},"helpUri":"https://codehealth.canine.dev/dimensions/X14"},{"id":"X15","name":"Unvalidated length from an untrusted reader","shortDescription":{"text":"Unvalidated length from an untrusted reader"},"helpUri":"https://codehealth.canine.dev/dimensions/X15"},{"id":"X16","name":"Unfloored truncation loop","shortDescription":{"text":"Unfloored truncation loop"},"helpUri":"https://codehealth.canine.dev/dimensions/X16"},{"id":"X17","name":"Uncapped recursion over a caller-supplied document","shortDescription":{"text":"Uncapped recursion over a caller-supplied document"},"helpUri":"https://codehealth.canine.dev/dimensions/X17"},{"id":"X18","name":"Disposal-pattern correctness","shortDescription":{"text":"Disposal-pattern correctness"},"helpUri":"https://codehealth.canine.dev/dimensions/X18"},{"id":"X19","name":"Unrestored process-global state","shortDescription":{"text":"Unrestored process-global state"},"helpUri":"https://codehealth.canine.dev/dimensions/X19"},{"id":"X20","name":"Mistyped argument guard","shortDescription":{"text":"Mistyped argument guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X20"},{"id":"X21","name":"Side-effecting pattern guard","shortDescription":{"text":"Side-effecting pattern guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X21"},{"id":"X22","name":"Contradicted release guard","shortDescription":{"text":"Contradicted release guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X22"},{"id":"X23","name":"Unguarded diagnostic materialisation","shortDescription":{"text":"Unguarded diagnostic materialisation"},"helpUri":"https://codehealth.canine.dev/dimensions/X23"},{"id":"X24","name":"Document value interpolated into markup unescaped","shortDescription":{"text":"Document value interpolated into markup unescaped"},"helpUri":"https://codehealth.canine.dev/dimensions/X24"},{"id":"X25","name":"Inert configuration knob","shortDescription":{"text":"Inert configuration knob"},"helpUri":"https://codehealth.canine.dev/dimensions/X25"},{"id":"X26","name":"Unsynchronised callback handoff","shortDescription":{"text":"Unsynchronised callback handoff"},"helpUri":"https://codehealth.canine.dev/dimensions/X26"},{"id":"X27","name":"Collection changed while being enumerated","shortDescription":{"text":"Collection changed while being enumerated"},"helpUri":"https://codehealth.canine.dev/dimensions/X27"},{"id":"X28","name":"Index access outside its own emptiness guard","shortDescription":{"text":"Index access outside its own emptiness guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X28"},{"id":"X29","name":"Per-element action decided by a fixed element","shortDescription":{"text":"Per-element action decided by a fixed element"},"helpUri":"https://codehealth.canine.dev/dimensions/X29"},{"id":"X3","name":"Exception handling","shortDescription":{"text":"Exception handling"},"helpUri":"https://codehealth.canine.dev/dimensions/X3"},{"id":"X30","name":"Support guard that admits what it rejects","shortDescription":{"text":"Support guard that admits what it rejects"},"helpUri":"https://codehealth.canine.dev/dimensions/X30"},{"id":"X32","name":"Type resolved by simple name across every loaded assembly","shortDescription":{"text":"Type resolved by simple name across every loaded assembly"},"helpUri":"https://codehealth.canine.dev/dimensions/X32"},{"id":"X4","name":"Structured logging","shortDescription":{"text":"Structured logging"},"helpUri":"https://codehealth.canine.dev/dimensions/X4"},{"id":"X5","name":"Nullable reference types","shortDescription":{"text":"Nullable reference types"},"helpUri":"https://codehealth.canine.dev/dimensions/X5"},{"id":"X6","name":"Hand-rolled structured-format parsing","shortDescription":{"text":"Hand-rolled structured-format parsing"},"helpUri":"https://codehealth.canine.dev/dimensions/X6"},{"id":"X7","name":"Silent fallback defaults","shortDescription":{"text":"Silent fallback defaults"},"helpUri":"https://codehealth.canine.dev/dimensions/X7"},{"id":"X9","name":"Subsumed condition operand","shortDescription":{"text":"Subsumed condition operand"},"helpUri":"https://codehealth.canine.dev/dimensions/X9"}]}},"results":[{"ruleId":"D1","level":"warning","message":{"text":"gen_config.gen_config (cyclomatic 28): gen_config.gen_config 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/gen_config.py"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"a52d473c4b7ea0aad4ed741e6f9904aed564c10d5d2f3a172c996dac66441f5a"}},{"ruleId":"D1","level":"warning","message":{"text":"package.build_model_library (cyclomatic 25): package.build_model_library 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/package.py"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dbcf19494bbd749f690d7d49e982e50d716ac3cc29a992f54f4f633cd3ad8a8"}},{"ruleId":"D1","level":"warning","message":{"text":"PopenServer.start (cyclomatic 25): PopenServer.start 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/server/popen_server.py"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"de7b1dda1af2986f888ef26e7b2639faac223064f76044dab875af0b74a010a7"}},{"ruleId":"D1","level":"warning","message":{"text":"Ministral3Config.__post_init__ (cyclomatic 24): Ministral3Config.__post_init__ 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/ministral3/ministral3_model.py"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef6abe029d1d880cd4aa3101eabc840dc33e708eb43f3fa7755bae1b213ee15a"}},{"ruleId":"D1","level":"warning","message":{"text":"Qwen25VLConfig.__post_init__ (cyclomatic 21): Qwen25VLConfig.__post_init__ 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2_5_vl/qwen2_5_vl_model.py"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fa38240c80fdf0072ee467a2475a0acaa41223d2bed6404396c04f888dba64d"}},{"ruleId":"D1","level":"warning","message":{"text":"Gemma4TextConfig.__post_init__ (cyclomatic 19): Gemma4TextConfig.__post_init__ 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma4/gemma4_config.py"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddbc801e33fa1811c388945f1c8357daaaa6aa0710a2e67e1b429023b6a23b7d"}},{"ruleId":"D1","level":"warning","message":{"text":"Qwen35Config.__post_init__ (cyclomatic 19): Qwen35Config.__post_init__ 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen35/qwen35_model.py"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"e22b550938775a7f5dc1df16233e32692680ef294e4ff62d4d63bb06696ad83b"}},{"ruleId":"D1","level":"warning","message":{"text":"Conversation.as_prompt (cyclomatic 19): Conversation.as_prompt 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/protocol/conversation_protocol.py"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"5efe17c9c29e0377eb893022d1ecd6d4fe8e6a82f3b12fd8348eb24449811504"}},{"ruleId":"D1","level":"warning","message":{"text":"mrope.get_mrope_position_ids (cyclomatic 18): mrope.get_mrope_position_ids 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/mrope.py"},"region":{"startLine":365}}}],"partialFingerprints":{"codehealthFindingId/v1":"df5788876f31dab150bf3364e7a78a2e9ab04d289c515a7e4c6319adafd64072"}},{"ruleId":"D1","level":"warning","message":{"text":"compile._compile (cyclomatic 16): compile._compile 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/compile.py"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"160d05de35c7637213122bfccd545ba200426066250c46cb69672a81b2942051"}},{"ruleId":"D1","level":"warning","message":{"text":"AsyncMLCEngine._chat_completion (cyclomatic 16): AsyncMLCEngine._chat_completion 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":911}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecffcb179c475064745477ddf0b783e4c8ea3cc5f44af9220dee0d38e410e20d"}},{"ruleId":"D2","level":"warning","message":{"text":"gen_config.gen_config (cognitive 51): gen_config.gen_config has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (31 pts), loops 5 (9 pts), error handling 3 (6 pts), boolean chains 4, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/gen_config.py"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"89211c7828c5b15724ba7c15fe4ac79e3c1c8db1b63d06a0e79575ab17721be8"}},{"ruleId":"D2","level":"warning","message":{"text":"Ministral3Config.__post_init__ (cognitive 48): Ministral3Config.__post_init__ has cognitive complexity 48 (threshold 15). Drivers by points: if/else 23 (42 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/ministral3/ministral3_model.py"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4e5048920aecee90cf5fc61225c65f2888601b7e5923ba45b4792a42c8ca181"}},{"ruleId":"D2","level":"warning","message":{"text":"package.build_model_library (cognitive 47): package.build_model_library has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (35 pts), ternaries 2 (6 pts), boolean chains 4, loops 2 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/package.py"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bde37651f35b585eb9054094e9b2d096a293396116634157cd5a7b770b0fa5d"}},{"ruleId":"D2","level":"warning","message":{"text":"Qwen35Config.__post_init__ (cognitive 40): Qwen35Config.__post_init__ has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 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\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen35/qwen35_model.py"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"41085f893f2e943d024a5501368bc1d60f26a823e4715f0bd130316fe4544b7d"}},{"ruleId":"D2","level":"warning","message":{"text":"Conversation.as_prompt (cognitive 31): Conversation.as_prompt has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 4 (8 pts), loops 2 (3 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/protocol/conversation_protocol.py"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"2785b99a4a0446d987654136f5f38cdae8d0cc2a1c288c4b79639f33bdb8dd46"}},{"ruleId":"D2","level":"warning","message":{"text":"PopenServer.start (cognitive 30): PopenServer.start has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (22 pts), loops 3 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/server/popen_server.py"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b1f0a127fdff35004497f02f14054c7135bf2cd632d5e706c204950d122e0ab"}},{"ruleId":"D2","level":"warning","message":{"text":"delivery._main (cognitive 28): delivery._main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/delivery.py"},"region":{"startLine":281}}}],"partialFingerprints":{"codehealthFindingId/v1":"33b09fd4ab4dc0d959b747ea8867a085a084fbdbd07dc99be22981d9f3fb4de8"}},{"ruleId":"D2","level":"warning","message":{"text":"Qwen25VLConfig.__post_init__ (cognitive 27): Qwen25VLConfig.__post_init__ has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 3 (4 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2_5_vl/qwen2_5_vl_model.py"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"3209bcdfcb43890b9503e6dce2c6628b301c981f93dd6a1e2cabbf88eb82685d"}},{"ruleId":"D2","level":"warning","message":{"text":"openai_entrypoints.request_completion (cognitive 26): openai_entrypoints.request_completion has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (3 pts), boolean chains 1, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/entrypoints/openai_entrypoints.py"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"a78b46d1a1c1cd4a914f0e60eee0243c6fc3a5c85a3fcf43f64b1d7d27da91a4"}},{"ruleId":"D2","level":"warning","message":{"text":"MistralConfig.__post_init__ (cognitive 24): MistralConfig.__post_init__ has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/mistral/mistral_model.py"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e5967d5ba335093ee4c17433b6fb3c278b06611e56cc78b69df51a5a5eac48e"}},{"ruleId":"D2","level":"warning","message":{"text":"_PipelineParallelRewriter.transform (cognitive 23): _PipelineParallelRewriter.transform has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 3 (8 pts), ternaries 1 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/pipeline_parallel_rewrite.py"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c402f8471c24d5d25558b6900d951a10fd5988cf40f7de779c9e4f503c69455"}},{"ruleId":"D2","level":"warning","message":{"text":"Router._handle_completion_round_robin (cognitive 23): Router._handle_completion_round_robin has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/router/router.py"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"935ebb62e3a3a687d6e835c51d85ef2d5dcee5cad33330def021cf9fb8d81bc3"}},{"ruleId":"D2","level":"warning","message":{"text":"ChatState.requestGenerate (cognitive 23): ChatState.requestGenerate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCChat/MLCChat/States/ChatState.swift"},"region":{"startLine":125}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7312ef37decaec5a3875e53bcec8a3bba11be74d5e8bff476abe576df5af28b"}},{"ruleId":"D2","level":"warning","message":{"text":"mrope.get_mrope_position_ids (cognitive 22): mrope.get_mrope_position_ids has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/mrope.py"},"region":{"startLine":365}}}],"partialFingerprints":{"codehealthFindingId/v1":"86259b49defbe4575734311a5e2b0dfc5ba2cf5896bf290deb062a8f686d6b95"}},{"ruleId":"D2","level":"warning","message":{"text":"AsyncEmbeddingEngine._embed_encoder (cognitive 22): AsyncEmbeddingEngine._embed_encoder has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/embedding_engine.py"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"23b50bae871a78a65997b094a743cc61ed46bc05abc4f82af51940f825ae8d0f"}},{"ruleId":"D2","level":"warning","message":{"text":"openai_entrypoints.request_chat_completion (cognitive 22): openai_entrypoints.request_chat_completion has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (3 pts), ternaries 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/entrypoints/openai_entrypoints.py"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"737930aa0abc1df2a568f4ff9c6248e17cc93318f8da45276d7892d185866574"}},{"ruleId":"D2","level":"warning","message":{"text":"AppState.loadModelsConfig (cognitive 22): AppState.loadModelsConfig has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (21 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCChat/MLCChat/States/AppState.swift"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d66e27f8caebd6d51babe02b43a81becd6d7f0dfa32ccc76ddb8f9912b1d8b6"}},{"ruleId":"D2","level":"warning","message":{"text":"LowBatchGemvSpecialize.transform_module (cognitive 21): LowBatchGemvSpecialize.transform_module has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/low_batch_specialization.py"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfeec723b2a9257a6bfca05f694e92f74704665772e3f1a18c013b679bfc71f2"}},{"ruleId":"D2","level":"warning","message":{"text":"compile._compile (cognitive 21): compile._compile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/compile.py"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"b17eea0ed25e5dd3fb3d4be9a071209ff98d759d4a53f8fe69f1b59c3c71c86c"}},{"ruleId":"D2","level":"warning","message":{"text":"deepseek_v2_loader.huggingface (cognitive 21): deepseek_v2_loader.huggingface has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, loops 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"aed941c89d5c143dae1d9ee31d885a65d34e4dbb09cd75e82a138a51eafb999e"}},{"ruleId":"D2","level":"warning","message":{"text":"AsyncEmbeddingEngine._init_encoder (cognitive 21): AsyncEmbeddingEngine._init_encoder has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/embedding_engine.py"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0c1c694e6c4f9a2c038038a2d6f038ded0ccc08c59f81418a63a273264e2545"}},{"ruleId":"D2","level":"warning","message":{"text":"AsyncMLCEngine._chat_completion (cognitive 21): AsyncMLCEngine._chat_completion has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 5, loops 2 (3 pts), error handling 2, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":911}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f9479891f60ae6180639ae58c66dec3fa969ef7192560f5aa8e34a39eea47d7"}},{"ruleId":"D2","level":"warning","message":{"text":"delivery._generate_model_delivery_diff (cognitive 20): delivery._generate_model_delivery_diff has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/delivery.py"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"b62b7cc70e2f08a749fc2d37f488df1a6831564c0a12e552fce4433c025f4d30"}},{"ruleId":"D2","level":"warning","message":{"text":"CohereConfig.__post_init__ (cognitive 20): CohereConfig.__post_init__ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/cohere/cohere_model.py"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ba27588331a4aa3a9e21e436a4c030a9d01404c1471bf5f047397d5219717e3"}},{"ruleId":"D2","level":"warning","message":{"text":"engine_base.process_chat_completion_stream_output (cognitive 20): engine_base.process_chat_completion_stream_output has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (5 pts), boolean chains 2, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine_base.py"},"region":{"startLine":782}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca750202852adf1b77ed3783065af462f109f206e7be436901f1c175abcf2755"}},{"ruleId":"D2","level":"warning","message":{"text":"Gemma4TextConfig.__post_init__ (cognitive 19): Gemma4TextConfig.__post_init__ has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 4, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma4/gemma4_config.py"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e3892d333066a7d541e25a929a7e84cb64c6e98f0e8603845089c98a5e263a7"}},{"ruleId":"D2","level":"warning","message":{"text":"LlamaConfig.__post_init__ (cognitive 19): LlamaConfig.__post_init__ has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"809326f843e800d810a47a549d8043c1ea4aefcab0d2249f81fb895e79eb265f"}},{"ruleId":"D2","level":"warning","message":{"text":"Phi3VConfig.__post_init__ (cognitive 19): Phi3VConfig.__post_init__ has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (17 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 \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi3v/phi3v_model.py"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbb021e78bbc69b5bdf2a82be8dc3429908930ee3139cab277d85eecf9a7fe52"}},{"ruleId":"D2","level":"warning","message":{"text":"attention.attention (cognitive 19): attention.attention has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/attention.py"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c303f5cb567817e475d84700c79b6c8fb293254f610dadf17b165efe68293c8"}},{"ruleId":"D2","level":"warning","message":{"text":"ChatCompletionRequest.check_message_validity (cognitive 19): ChatCompletionRequest.check_message_validity has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (17 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/protocol/openai_api_protocol.py"},"region":{"startLine":348}}}],"partialFingerprints":{"codehealthFindingId/v1":"76b2f7795aec11735c5b977293f0bb1231c10a320f0c87c42665cc6030ebb71b"}},{"ruleId":"D2","level":"warning","message":{"text":"AsyncEmbeddingEngine._init_decoder (cognitive 19): AsyncEmbeddingEngine._init_decoder has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (19 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 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\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/embedding_engine.py"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"721bf34391154ae4f724919a88df89768f98be43b6a3fd7e3aabc7042fab3a0b"}},{"ruleId":"D2","level":"warning","message":{"text":"MLCEngine._chat_completion (cognitive 19): MLCEngine._chat_completion has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 5, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":1483}}}],"partialFingerprints":{"codehealthFindingId/v1":"4650ee7c85b68d4756d9edd947253e4d8a5074ed0d24956357bba93b401df3c7"}},{"ruleId":"D2","level":"warning","message":{"text":"ChatState.requestGenerate (cognitive 19): ChatState.requestGenerate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCChat/app/src/main/java/ai/mlc/mlcchat/AppViewModel.kt"},"region":{"startLine":698}}}],"partialFingerprints":{"codehealthFindingId/v1":"efb4b75d8a69f64f2c88c0ef047c6845723db10d97bbd87756e3f0a175418fc8"}},{"ruleId":"D2","level":"warning","message":{"text":"lift_global_buffer_alloc._resolve_tir_var_mapping (cognitive 18): lift_global_buffer_alloc._resolve_tir_var_mapping has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 3 (8 pts), 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/lift_global_buffer_alloc.py"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb4f981ba63bb3e65893e12fec763205fc44a16ee309f3d5a4bc354aeae9f86d"}},{"ruleId":"D2","level":"warning","message":{"text":"OLMoConfig.__post_init__ (cognitive 18): OLMoConfig.__post_init__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/olmo/olmo_model.py"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc6b2f696f69d95a6d1839fc6a568b92c822928967e080d7c7e16125f9c0fb70"}},{"ruleId":"D2","level":"warning","message":{"text":"ChatCompletionRequest.check_function_call_usage (cognitive 18): ChatCompletionRequest.check_function_call_usage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/protocol/openai_api_protocol.py"},"region":{"startLine":366}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b35b562dbbc57926b4380d3dd58e854fff241dfa179cb08b02ed36480e89480"}},{"ruleId":"D2","level":"warning","message":{"text":"PerTensorQuantizeLinear.forward (cognitive 18): PerTensorQuantizeLinear.forward has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/per_tensor_quantization.py"},"region":{"startLine":405}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d34d970632a8ba270717729bb3858bde5752adfc8d1de2d0de03e409795ff16"}},{"ruleId":"D2","level":"warning","message":{"text":"engine_base.process_completion_stream_output (cognitive 18): engine_base.process_completion_stream_output has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine_base.py"},"region":{"startLine":1010}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ddf5090e71803ea199b3e93b5f748cf5e847d3034f0306738aecc82a84e98ac"}},{"ruleId":"D2","level":"warning","message":{"text":"huggingface_loader._loading_order (cognitive 17): huggingface_loader._loading_order has cognitive complexity 17 (threshold 15). Drivers by points: loops 7 (11 pts), if/else 2 (6 pts) (nesting depth added 8). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/loader/huggingface_loader.py"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba513e972ee81c52044fff40f3040b1a7299d198abeb605276d9faa27b30b563"}},{"ruleId":"D2","level":"warning","message":{"text":"AsyncMLCEngine._completion (cognitive 17): AsyncMLCEngine._completion has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), ternaries 3, 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. This shape REPEATS in the file: one other method here (MLCEngine._completion) has the same decision points, in the same order, at the same nesting depths \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":1053}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a4977b67474c8a3c1aaa15c3fc104882b37101a2c87ed8e4997ec242d1e4987"}},{"ruleId":"D2","level":"warning","message":{"text":"MLCEngine._completion (cognitive 17): MLCEngine._completion has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), ternaries 3, 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. This shape REPEATS in the file: one other method here (AsyncMLCEngine._completion) has the same decision points, in the same order, at the same nesting depths \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":1615}}}],"partialFingerprints":{"codehealthFindingId/v1":"8bc755282a8efb734b0e2502acafb774237d2cfe30e6972e04a73c721fab01e3"}},{"ruleId":"D2","level":"warning","message":{"text":"SyncMLCEngine.generate (cognitive 17): SyncMLCEngine.generate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (5 pts), 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/sync_engine.py"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"9895d2301e3d631e329d4ad700d47cdfc3902aae6dfa9bdc89e7b07d8adfd3be"}},{"ruleId":"D2","level":"warning","message":{"text":"ModelState.handleFinishDownload (cognitive 17): ModelState.handleFinishDownload 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCChat/app/src/main/java/ai/mlc/mlcchat/AppViewModel.kt"},"region":{"startLine":434}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2a18869c5dbc0dd1cc3aea04680ee437ca7893a4eb15d808848ea1e6fabb64a"}},{"ruleId":"D2","level":"warning","message":{"text":"EngineState.streamCallback (cognitive 17): EngineState.streamCallback has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (15 pts), error handling 1, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 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\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCSwift/Sources/Swift/LLMEngine.swift"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"946c04db77e238d69abbf4e776b1076df785a85e3e28e141435304e78c63bea2"}},{"ruleId":"D2","level":"warning","message":{"text":"DeepseekV2Config.__post_init__ (cognitive 16): DeepseekV2Config.__post_init__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba16aa2b0972d87a9bf0b1d96be3df4fbae3e7b251bbcb39a33d84a130ccee70"}},{"ruleId":"D2","level":"warning","message":{"text":"minicpm_loader.huggingface (cognitive 16): minicpm_loader.huggingface has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 5 (7 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_loader.py"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c03241d3871ac1fcf02328c8850d9b5705980ccaeed5bf72e6e8364be76cd5e"}},{"ruleId":"D2","level":"warning","message":{"text":"Phi1Config.__post_init__ (cognitive 16): Phi1Config.__post_init__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, loops 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi/phi_model.py"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"439972eb53bde2aca2cdbc26ad608e24e34d17f9021a14c4a001432ab6089df0"}},{"ruleId":"D2","level":"warning","message":{"text":"PhiConfig.__post_init__ (cognitive 16): PhiConfig.__post_init__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, loops 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi/phi_model.py"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bff2c5d7cf443ed19430b7ee25611e48bac1e2e677d3acd5139381d29bb1abb"}},{"ruleId":"D2","level":"warning","message":{"text":"Phi3Config.__post_init__ (cognitive 16): Phi3Config.__post_init__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi3/phi3_model.py"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"ccea2ea76e9eafba0ff899a36b41d975abdc18392457f44bc21a5d93797c470a"}},{"ruleId":"D2","level":"warning","message":{"text":"Qwen3Config.__post_init__ (cognitive 16): Qwen3Config.__post_init__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen3/qwen3_model.py"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"cad99da138705fd0ebce3d23e9095a88c393daac519a46e3c79640135e0b0518"}},{"ruleId":"D2","level":"warning","message":{"text":"qwen35_loader.map_language_model (cognitive 16): qwen35_loader.map_language_model has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen35/qwen35_loader.py"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"eabf4e1226206b54fefb9bdd3a7c6a1eff31526022147b8615f80876fc240c19"}},{"ruleId":"D2","level":"warning","message":{"text":"ChatViewKt.MessageView (cognitive 16): ChatViewKt.MessageView has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCChat/app/src/main/java/ai/mlc/mlcchat/ChatView.kt"},"region":{"startLine":151}}}],"partialFingerprints":{"codehealthFindingId/v1":"4542bdb9b09693f995391fa5f1187d6d9f430848bf57151f2c3583747615cd1e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: serve/engine.py: FileTooLong \u2014 1148 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 648 over it, 2.30\u00D7 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec47c2ed39aa51015936fb3d0f07e53e9758f5ad0b7e6cd89f7152e87769981d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: serve/engine_base.py: FileTooLong \u2014 716 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 216 over it, 1.43\u00D7 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine_base.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd005c5cef741c45437c549facc2a0838c6756daa14bd49dce5953054a73cd35"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: deepseek_v2/deepseek_v2_model.py: FileTooLong \u2014 704 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 204 over it, 1.41\u00D7 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb1b6e22732c8dba2b65454c2bea2a4bb80acfd8e065b12fa39b913174fe4826"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: AppViewModel: ClassTooLong \u2014 512 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 112 over it, 1.28\u00D7 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCChat/app/src/main/java/ai/mlc/mlcchat/AppViewModel.kt"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"879edf1f3e84bb4ad36520ce2661be6eae3396d3eee9ebe3f465f77eb4a83f7e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: llama4/llama4_model.py: FileTooLong \u2014 619 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 119 over it, 1.24\u00D7 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama4/llama4_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbe61b071e4ffeb3219eb8656a34210ac71a1939a795e7bc7d27f83b198308d8"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: qwen35/qwen35_model.py: FileTooLong \u2014 611 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 111 over it, 1.22\u00D7 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen35/qwen35_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b5f2e86ad41f019762528fef80c74d6680f985e4e0afdc6d4c4d096cd93d5a2"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: mlcchat/AppViewModel.kt: FileTooLong \u2014 585 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: AppViewModel (36-794). The bar is 500 significant lines; this is 85 over it, 1.17\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCChat/app/src/main/java/ai/mlc/mlcchat/AppViewModel.kt"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d8dee1a07a8303062cd5d97c1094953ae412e8119aa0db81fd3e32b690dbbc4"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: model/model.py: FileTooLong \u2014 581 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 81 over it, 1.16\u00D7 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"87cd751db381f28df38f74977fe147e891968f580b484b3545505749c438464a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: gemma3/gemma3_model.py: FileTooLong \u2014 569 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 69 over it, 1.14\u00D7 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma3/gemma3_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"194958b74eed11a2c92098d167ba33e76cd83e2b760be996568cc9590b3c6c7a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: quantization/block_scale_quantization.py: FileTooLong \u2014 533 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 33 over it, 1.07\u00D7 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/block_scale_quantization.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"299415afcfd805d93ccf91efc4b54270cf1472f9d0d0b0e1d25e12ff5e0ea126"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: op/moe_matmul.py: FileTooLong \u2014 521 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 21 over it, 1.04\u00D7 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7a940666b5f1e0a6bef1d591124044f960268633d3f53f1af38471c8e89533f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: op/triton.py: FileTooLong \u2014 511 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 11 over it, 1.02\u00D7 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/triton.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac6b3febd0e78b1bee86a6a27abf1dd5db7a8a6ec1ec29281550eacf7191083f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: gemma4/gemma4_model.py: FileTooLong \u2014 510 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 10 over it, 1.02\u00D7 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma4/gemma4_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a39122de0811cb86101b45e56403c2108631a251450efa1513e787429c59be07"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member family (6 members, 28 shared lines): python/mlc_llm/model/cohere/cohere_model.py:44-87 | python/mlc_llm/model/gemma/gemma_model.py:43-86 | python/mlc_llm/model/olmo/olmo_model.py:49-105 | python/mlc_llm/model/olmo2/olmo2_model.py:48-100 | python/mlc_llm/model/orion/orion_model.py:43-85 | python/mlc_llm/model/phi/phi_model.py:44-88 \u2014 These 6 members are variants of one another: a block of 28 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 6 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/cohere/cohere_model.py"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a2c8b4f8851d72ae543a3edb885463e0814c9af2a281e00ed30dfe74e62adf0"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member family (5 members, 45 shared lines): python/mlc_llm/model/eagle/eagle_loader.py:27-105 | python/mlc_llm/model/llama/llama_loader.py:26-104 | python/mlc_llm/model/llava/llava_loader.py:32-101 | python/mlc_llm/model/mistral/mistral_loader.py:26-98 | python/mlc_llm/model/olmo/olmo_loader.py:26-104 \u2014 These 5 members are variants of one another: a block of 45 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/eagle/eagle_loader.py"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"d69f22134deb2c60b59411ecab4fa8b0ac4b27d18061733ed065dbc34707bd23"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member family (4 members, 38 shared lines): python/mlc_llm/model/deepseek/deepseek_loader.py:17-149 | python/mlc_llm/model/minicpm/minicpm_loader.py:17-150 | python/mlc_llm/model/mixtral/mixtral_loader.py:17-130 | python/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py:17-130 \u2014 These 4 members are variants of one another: a block of 38 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_loader.py"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"459bea8f9957685a71d3056f0ff9e38e449ff1ca58da5bab35f4b73244e807e1"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member family (4 members, 31 shared lines): python/mlc_llm/model/olmo/olmo_model.py:49-105 | python/mlc_llm/model/olmo2/olmo2_model.py:48-100 | python/mlc_llm/model/phi/phi_model.py:44-88 | python/mlc_llm/model/qwen3/qwen3_model.py:49-104 \u2014 These 4 members are variants of one another: a block of 31 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/olmo/olmo_model.py"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e6005877fd08fa691f89dc014ab30a733b5efe2e7d2788e655526c1207631be"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member family (4 members, 10 shared lines): python/mlc_llm/op/moe_matmul.py:16-77 | python/mlc_llm/op/moe_matmul.py:88-179 | python/mlc_llm/op/moe_matmul.py:189-298 | python/mlc_llm/op/moe_matmul.py:309-385 \u2014 These 4 members are variants of one another: a block of 10 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"33102a060e8a24c4b5c561b79f7dc98afb603be85e800047c06d240af20650ff"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member family (3 members, 32 shared lines): python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:68-124 | python/mlc_llm/model/gemma/gemma_model.py:43-86 | python/mlc_llm/model/gemma3/gemma3_model.py:50-95 \u2014 These 3 members are variants of one another: a block of 32 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"0438300b42a9ee5a5b350e9b89e7bf8bb3b151aed6b9067af77786b9ade2dba5"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (112 shared lines): python/mlc_llm/op/moe_matmul.py:389-559 | python/mlc_llm/op/moe_matmul.py:571-769 \u2014 These two members are variants of one another: 112 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\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":389}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7ee749e60ef582b5a26707e25c43744b779dda1f71a9713b3b5978adf146f1b"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (57 shared lines): python/mlc_llm/nn/rnn_state.py:152-222 | python/mlc_llm/nn/rnn_state.py:232-305 \u2014 These two members are variants of one another: 57 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\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/nn/rnn_state.py"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"22d0f6ae31ef00ebea8d20e67654e9a3ff6eface8543bf15340ce9fa1fca6ae9"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (33 shared lines): python/mlc_llm/model/rwkv5/rwkv5_model.py:73-118 | python/mlc_llm/model/rwkv6/rwkv6_model.py:73-118 \u2014 These two members are variants of one another: 33 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_model.py"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"f30feba240954b053abf5438abda6b3aa703e73f666d8477672643f1ff5f883e"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (28 shared lines): python/mlc_llm/compiler_pass/fuse_add_norm.py:16-83 | python/mlc_llm/compiler_pass/fuse_add_norm.py:87-151 \u2014 These two members are variants of one another: 28 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\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/fuse_add_norm.py"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"a82c61b2c67faf20b24b1dbfd58687f026f79657c7b38d2e91bd2bd122611d7a"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (20 corresponding lines): ios/MLCSwift/Sources/Swift/LLMEngine.swift:115-159 | ios/MLCSwift/Sources/Swift/OpenAIProtocol.swift:250-288 \u2014 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 \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCSwift/Sources/Swift/LLMEngine.swift"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f92093f4c8cf41a167e524cce7c5321bf4c83a47b068667a3a8cf06aa46fec8"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (27 members, 50\u002B identical tokens): python/mlc_llm/model/chatglm3/chatglm3_model.py:366-382 | python/mlc_llm/model/cohere/cohere_model.py:326-342 | python/mlc_llm/model/deepseek/deepseek_model.py:436-452 | python/mlc_llm/model/eagle/eagle_model.py:172-188 | python/mlc_llm/model/gemma/gemma_model.py:311-327 | python/mlc_llm/model/gemma3/gemma3_model.py:474-498 | python/mlc_llm/model/gemma3/gemma3v_model.py:318-342 | python/mlc_llm/model/internlm2/internlm2_model.py:297-313 | python/mlc_llm/model/llama/llama_model.py:404-423 | python/mlc_llm/model/llama4/llama4_model.py:684-702 | python/mlc_llm/model/minicpm/minicpm_model.py:440-456 | python/mlc_llm/model/ministral3/ministral3_model.py:453-470 | python/mlc_llm/model/mistral/mistral_model.py:310-326 | python/mlc_llm/model/nemotron/nemotron_model.py:383-403 | python/mlc_llm/model/olmo/olmo_model.py:436-454 | python/mlc_llm/model/olmo2/olmo2_model.py:436-454 | python/mlc_llm/model/orion/orion_model.py:292-308 | python/mlc_llm/model/phi/phi_model.py:407-424 | python/mlc_llm/model/phi3/phi3_model.py:331-350 | python/mlc_llm/model/phi3v/phi3v_model.py:296-314 | python/mlc_llm/model/qwen2/qwen2_model.py:327-343 | python/mlc_llm/model/qwen2_5_vl/qwen2_5_vl_model.py:501-519 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:310-326 | python/mlc_llm/model/qwen3/qwen3_model.py:360-376 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:308-324 | python/mlc_llm/model/stable_lm/stablelm_model.py:295-312 | python/mlc_llm/model/starcoder2/starcoder2_model.py:315-331 \u2014 These 27 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 \u2014 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 27 times. The repair is at the members\u0027 grain \u2014 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 27 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/chatglm3/chatglm3_model.py"},"region":{"startLine":366}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9f2c62ec86469ed1b737fd4735721e5a9eaacb1733aaf081c3f7c4f4c8eb996"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (12 members, 50\u002B identical tokens): python/mlc_llm/model/baichuan/baichuan_model.py:114-125 | python/mlc_llm/model/gemma/gemma_model.py:104-116 | python/mlc_llm/model/internlm/internlm_model.py:117-129 | python/mlc_llm/model/internlm2/internlm2_model.py:123-134 | python/mlc_llm/model/llama/llama_model.py:108-120 | python/mlc_llm/model/ministral3/ministral3_model.py:196-209 | python/mlc_llm/model/mistral/mistral_model.py:100-112 | python/mlc_llm/model/olmo/olmo_model.py:176-193 | python/mlc_llm/model/olmo2/olmo2_model.py:182-199 | python/mlc_llm/model/orion/orion_model.py:90-102 | python/mlc_llm/model/qwen/qwen_model.py:118-129 | python/mlc_llm/model/stable_lm/stablelm_model.py:122-133 \u2014 These 12 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 \u2014 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 12 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 12 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"4491cde9f32f35c62e4d0a13b48f651bc2bd913a1f92d53e8f14b58b0aadec60"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (10 members, 50\u002B identical tokens): python/mlc_llm/model/baichuan/baichuan_model.py:222-230 | python/mlc_llm/model/deepseek/deepseek_model.py:374-382 | python/mlc_llm/model/internlm/internlm_model.py:239-247 | python/mlc_llm/model/mistral/mistral_model.py:249-257 | python/mlc_llm/model/orion/orion_model.py:231-239 | python/mlc_llm/model/phi3v/phi3v_model.py:169-177 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:249-257 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:247-255 | python/mlc_llm/model/stable_lm/stablelm_model.py:234-242 | python/mlc_llm/model/starcoder2/starcoder2_model.py:254-262 \u2014 These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"14fb8829cf878f0e329df1fe3a92af568451d3cd0ba5e8243c3ec6d0b8ec4435"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (9 members, 50\u002B identical tokens): python/mlc_llm/json_ffi/engine.py:143-198 | python/mlc_llm/serve/engine.py:195-240 | python/mlc_llm/serve/engine.py:387-432 | python/mlc_llm/serve/engine.py:579-624 | python/mlc_llm/serve/engine.py:771-816 | python/mlc_llm/serve/engine.py:939-1051 | python/mlc_llm/serve/engine.py:1081-1169 | python/mlc_llm/serve/engine.py:1511-1613 | python/mlc_llm/serve/engine.py:1643-1730 \u2014 These 9 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 \u2014 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 9 times. The repair is at the members\u0027 grain \u2014 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 9 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/json_ffi/engine.py"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"627d3e6234c257804aee79da95b2e410bf2ce30487cf230fef94fafc549f107a"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (6 members, 50\u002B identical tokens): python/mlc_llm/model/minicpm/minicpm_model.py:157-167 | python/mlc_llm/model/phi3/phi3_model.py:113-121 | python/mlc_llm/model/qwen2/qwen2_model.py:144-152 | python/mlc_llm/model/qwen2_5_vl/qwen2_5_vl_model.py:275-283 | python/mlc_llm/model/qwen3/qwen3_model.py:175-183 | python/mlc_llm/model/qwen35/qwen35_model.py:150-153 \u2014 These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_model.py"},"region":{"startLine":157}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f53fcf1dd8ae8c36ad45599ed45b8a472a2c0d08b8330bec3d43e55dabedbe8"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (5 members, 50\u002B identical tokens): python/mlc_llm/model/baichuan/baichuan_model.py:283-299 | python/mlc_llm/model/gpt_j/gpt_j_model.py:288-306 | python/mlc_llm/model/gpt_neox/gpt_neox_model.py:336-353 | python/mlc_llm/model/internlm/internlm_model.py:300-316 | python/mlc_llm/model/qwen/qwen_model.py:279-295 \u2014 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 \u2014 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\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":283}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae2524e36474c0273cb4ac6512d98f453d64ff3b3fb46644589955efd3493ed1"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (5 members, 50\u002B identical tokens): python/mlc_llm/model/deepseek/deepseek_model.py:124-135 | python/mlc_llm/model/internlm2/internlm2_model.py:107-118 | python/mlc_llm/model/minicpm/minicpm_model.py:119-130 | python/mlc_llm/model/stable_lm/stablelm_model.py:106-117 | python/mlc_llm/model/starcoder2/starcoder2_model.py:114-125 \u2014 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 \u2014 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\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"294f180489a2250ea7881680a9114b30550737caf8f82155b61d249fc41c198b"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (5 members, 50\u002B identical tokens): python/mlc_llm/model/deepseek/deepseek_model.py:314-320 | python/mlc_llm/model/qwen2/qwen2_model.py:197-203 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:192-198 | python/mlc_llm/model/qwen3/qwen3_model.py:229-235 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:189-195 \u2014 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 \u2014 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\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":314}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c4e15deea8295763880181a2fc76c6e9e28dc16f8152d78e95ea815468cc2e7"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (5 members, 50\u002B identical tokens): python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:659-675 | python/mlc_llm/model/qwen2/qwen2_model.py:229-243 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:224-236 | python/mlc_llm/model/qwen3/qwen3_model.py:261-276 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:221-234 \u2014 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 \u2014 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\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py"},"region":{"startLine":659}}}],"partialFingerprints":{"codehealthFindingId/v1":"c88c757216294fa235bbe2da945b88f98894798dff7d6ce81edf82bb6c22fb97"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (5 members, 50\u002B identical tokens): python/mlc_llm/model/gpt2/gpt2_model.py:241-249 | python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py:209-217 | python/mlc_llm/model/gpt_j/gpt_j_model.py:227-235 | python/mlc_llm/model/phi/phi_model.py:343-351 | python/mlc_llm/model/qwen/qwen_model.py:224-231 \u2014 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 \u2014 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\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt2/gpt2_model.py"},"region":{"startLine":241}}}],"partialFingerprints":{"codehealthFindingId/v1":"99ad5065cd7a20cbf81a8a61a5da50ecbb4bae0849f1ea722f280977f162eefa"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (5 members, 50\u002B identical tokens): python/mlc_llm/model/minicpm/minicpm_model.py:370-381 | python/mlc_llm/model/ministral3/ministral3_model.py:380-392 | python/mlc_llm/model/qwen2/qwen2_model.py:256-268 | python/mlc_llm/model/qwen3/qwen3_model.py:289-301 | python/mlc_llm/model/qwen35/qwen35_model.py:708-719 \u2014 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 \u2014 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\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_model.py"},"region":{"startLine":370}}}],"partialFingerprints":{"codehealthFindingId/v1":"a30cfb96e44bcb72530e2ddc3de8100fa5fa1954857daf33e1f363e00fc3acc8"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): python/mlc_llm/compiler_pass/attach_sampler.py:72-117 | python/mlc_llm/compiler_pass/attach_sampler.py:155-229 | python/mlc_llm/compiler_pass/attach_sampler.py:262-343 | python/mlc_llm/compiler_pass/attach_sampler.py:347-394 \u2014 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 \u2014 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\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_sampler.py"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f8b72c3b54f2a81ac3e7556af16087a4c9642edcd8e516f7a4dc759c43b3f9c"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): python/mlc_llm/model/baichuan/baichuan_model.py:98-109 | python/mlc_llm/model/gpt_j/gpt_j_model.py:104-115 | python/mlc_llm/model/internlm/internlm_model.py:101-112 | python/mlc_llm/model/qwen/qwen_model.py:102-113 \u2014 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 \u2014 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\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"8fcb1f55bc8d3d2579b1c57f0609c9c9f7e28d0f237d93cb1650ea0444139070"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): python/mlc_llm/model/llama/llama_model.py:219-235 | python/mlc_llm/model/nemotron/nemotron_model.py:197-213 | python/mlc_llm/model/olmo/olmo_model.py:254-274 | python/mlc_llm/model/olmo2/olmo2_model.py:258-274 \u2014 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 \u2014 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\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"871cafefaed56bfbccddf71f98630db6dddcac10c1b73b48a614957bd3e2c42e"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): python/mlc_llm/model/llama/llama_model.py:249-280 | python/mlc_llm/model/nemotron/nemotron_model.py:227-259 | python/mlc_llm/model/olmo/olmo_model.py:288-317 | python/mlc_llm/model/olmo2/olmo2_model.py:288-317 \u2014 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 \u2014 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\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":249}}}],"partialFingerprints":{"codehealthFindingId/v1":"89a391a8bb4daac721f10ad697b6cbecc91f975708911ff19db494bcc79cadb8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (56\u201357 lines \u00D7 2): python/mlc_llm/serve/engine.py:1081-1136 | python/mlc_llm/serve/engine.py:1643-1699 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/serve/engine.py:1081\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":1081}}}],"partialFingerprints":{"codehealthFindingId/v1":"1475aeb56b1bed540ac806dafaa3b8b043acd88e740d2f551bb442e1c5ede2f7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (53 lines \u00D7 2): python/mlc_llm/model/minicpm/minicpm_model.py:196-248 | python/mlc_llm/model/mixtral/mixtral_model.py:65-117 \u2014 \u0060python/mlc_llm/model/minicpm/minicpm_model.py\u0060 and \u0060python/mlc_llm/model/mixtral/mixtral_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 86 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_model.py"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa6613d70948cee5e9837fdd5ebb757d572510f88cc15a2087264f31e2b93b8e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (47 lines \u00D7 2): python/mlc_llm/model/ministral3/ministral3_model.py:121-167 | python/mlc_llm/model/mistral/mistral_model.py:47-93 \u2014 \u0060python/mlc_llm/model/ministral3/ministral3_model.py\u0060 and \u0060python/mlc_llm/model/mistral/mistral_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 18 separate duplicated blocks between them, totalling at least 213 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/ministral3/ministral3_model.py"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"62db61edca81271e767402c2bff1a7ed0d883c8b6c223aa9f25c9edb3a010d7b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (45 lines \u00D7 3): python/mlc_llm/model/eagle/eagle_loader.py:58-102 | python/mlc_llm/model/llama/llama_loader.py:57-101 | python/mlc_llm/model/olmo/olmo_loader.py:57-101 \u2014 \u0060python/mlc_llm/model/eagle/eagle_loader.py\u0060 and \u0060python/mlc_llm/model/llama/llama_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 9 separate duplicated blocks between them, totalling at least 184 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/eagle/eagle_loader.py:58\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/eagle/eagle_loader.py"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"8239d98b844b1c94a26d886db42a3aa8ae585fcd37cd5a9af26a8ccbf6b9b82d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (42 lines \u00D7 2): python/mlc_llm/model/llava/llava_loader.py:57-98 | python/mlc_llm/model/mistral/mistral_loader.py:54-95 \u2014 \u0060python/mlc_llm/model/llava/llava_loader.py\u0060 and \u0060python/mlc_llm/model/mistral/mistral_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 135 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/llava/llava_loader.py:57\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llava/llava_loader.py"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"03d7deaf71c88d3f07b44836b13605258a36f327073d4cf6966ca319dc105fb1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (41 lines \u00D7 2): python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py:47-87 | python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py:47-87 \u2014 \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py\u0060 and \u0060python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 108 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py:47\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060model_config\u0060 to \u0060DeepseekV2Config\u0060 in one and \u0060Qwen3MoeConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e8d49cf1d8dc458a6294fc69ecb6c414192d14345d1036b8b5f306b4c858eac"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (41 lines \u00D7 2): python/mlc_llm/testing/debug_chat.py:497-537 | python/mlc_llm/testing/debug_compare.py:187-227 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 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 \u0060python/mlc_llm/testing/debug_chat.py:497\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/testing/debug_chat.py"},"region":{"startLine":497}}}],"partialFingerprints":{"codehealthFindingId/v1":"30e594d7b4b88c05d98f6c9d4903f9545c47b7edbcf617d3b313994cfac6dba3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (40 lines \u00D7 3): python/mlc_llm/json_ffi/engine.py:149-188 | python/mlc_llm/serve/engine.py:963-1002 | python/mlc_llm/serve/engine.py:1533-1572 \u2014 there are 3 copies across 2 file(s) \u2014 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 \u0060python/mlc_llm/json_ffi/engine.py:149\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/json_ffi/engine.py"},"region":{"startLine":149}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d7685feb35d2f645998c34602649b0c6d56cdf02adc292a3d939b44ec701df6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (37 lines \u00D7 2): python/mlc_llm/model/phi3/phi3_model.py:49-85 | python/mlc_llm/model/phi3v/phi3v_model.py:76-112 \u2014 \u0060python/mlc_llm/model/phi3/phi3_model.py\u0060 and \u0060python/mlc_llm/model/phi3v/phi3v_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 94 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/phi3/phi3_model.py:49\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi3/phi3_model.py"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad009a9c7ec123f5b9db08219630f3d9bccdbcfe7372249730dda1b0ef1dee64"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (35 lines \u00D7 2): python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:68-102 | python/mlc_llm/model/qwen3/qwen3_model.py:49-83 \u2014 \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py\u0060 and \u0060python/mlc_llm/model/qwen3/qwen3_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 82 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"82b974b9f171f177d585ef90792e38068eaa5390e59252812a351bf355e66604"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (35 lines \u00D7 2): python/mlc_llm/op/cutlass.py:290-324 | python/mlc_llm/op/triton.py:660-694 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 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 \u0060python/mlc_llm/op/cutlass.py:290\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/cutlass.py"},"region":{"startLine":290}}}],"partialFingerprints":{"codehealthFindingId/v1":"5749e78eb899af53b7741f63167862601d5537f7d62f920f59e5863f41b9d64b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (33\u201334 lines \u00D7 2): python/mlc_llm/model/minicpm/minicpm_loader.py:92-124 | python/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py:85-118 \u2014 \u0060python/mlc_llm/model/minicpm/minicpm_loader.py\u0060 and \u0060python/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 85 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_loader.py"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad575619b849f432a017acf0db15f247f8e5d0b561696d9835397853c026b914"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (33 lines \u00D7 2): python/mlc_llm/nn/rnn_state.py:152-184 | python/mlc_llm/nn/rnn_state.py:232-264 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/nn/rnn_state.py:152\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/nn/rnn_state.py"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"fcd8cb29cdd34c99a7ac24a49b825ba370d075ae44edcc6d55d564e102f810c6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (32 lines \u00D7 2): python/mlc_llm/serve/engine.py:1177-1208 | python/mlc_llm/serve/engine.py:1735-1766 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":1177}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac41a99cd4745830b0e63bfeddd0074754d40d27bde605dd8aec6bcb22fbb82f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (31 lines \u00D7 2): python/mlc_llm/model/qwen3/qwen3_loader.py:92-122 | python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py:80-110 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/qwen3/qwen3_loader.py\u0060 and \u0060python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/qwen3/qwen3_loader.py:92\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen3/qwen3_loader.py"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"13eb003f29e035322e1ae47a1f5b642133a832e1d6c3f4b64ca17a8defbd07ed"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (30 lines \u00D7 2): python/mlc_llm/serve/engine.py:1243-1272 | python/mlc_llm/serve/engine.py:1783-1812 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":1243}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a2ed38a40db4c48e3751b94e3e4c2ab6f7abf954b5836e603dae2b3cc1640c6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (29 lines \u00D7 2): python/mlc_llm/model/deepseek/deepseek_model.py:206-234 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:100-128 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 and \u0060python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 11 separate duplicated blocks between them, totalling at least 122 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"a36bd41d0ce01f0a121ae4e9c86c4c7f6c4f465710c5553456a34283006d7eeb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (29 lines \u00D7 2): python/mlc_llm/model/olmo/olmo_model.py:289-317 | python/mlc_llm/model/olmo2/olmo2_model.py:289-317 \u2014 \u0060python/mlc_llm/model/olmo/olmo_model.py\u0060 and \u0060python/mlc_llm/model/olmo2/olmo2_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 23 separate duplicated blocks between them, totalling at least 294 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060OLMoConfig\u0060 in one and \u0060OLMo2Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/olmo/olmo_model.py"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"657715066c3136b191b49518797c3ec9f16333021fd287f3000939534854e6c5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (29 lines \u00D7 2): python/mlc_llm/model/rwkv5/rwkv5_loader.py:57-85 | python/mlc_llm/model/rwkv6/rwkv6_loader.py:40-68 \u2014 \u0060python/mlc_llm/model/rwkv5/rwkv5_loader.py\u0060 and \u0060python/mlc_llm/model/rwkv6/rwkv6_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 1 separate duplicated blocks between them, totalling at least 29 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060model_config\u0060 to \u0060RWKV5Config\u0060 in one and \u0060RWKV6Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_loader.py"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"2da73c669f84f2bb0db7964d411a4938fb25e5a1918ecdd116f510021121da3a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (28 lines \u00D7 3): python/mlc_llm/model/eagle/eagle_loader.py:27-54 | python/mlc_llm/model/llama/llama_loader.py:26-53 | python/mlc_llm/model/olmo/olmo_loader.py:26-53 \u2014 \u0060python/mlc_llm/model/eagle/eagle_loader.py\u0060 and \u0060python/mlc_llm/model/llama/llama_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 9 separate duplicated blocks between them, totalling at least 184 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060model_config\u0060 to \u0060EagleConfig\u0060 in one and \u0060LlamaConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/eagle/eagle_loader.py"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"820fe424b392b7eaefba8f95485ee26d80cd3f0a46af8a03b54ec7814d8193af"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (27\u201328 lines \u00D7 2): python/mlc_llm/model/phi3v/phi3v_image.py:220-247 | python/mlc_llm/model/phi3v/phi3v_image.py:251-277 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/model/phi3v/phi3v_image.py:220\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi3v/phi3v_image.py"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"045533518a5141f6c98490ded58e1974ffeb4156ffad54fc7783e6e6cbe7579a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (28 lines \u00D7 2): python/mlc_llm/op/moe_matmul.py:88-128 | python/mlc_llm/op/moe_matmul.py:189-216 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/op/moe_matmul.py:88\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"d67feb1e46a6f0cdf62b912fe915034fb5e2a37f9842e544d070ab17cbe7be4c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (28 lines \u00D7 2): python/mlc_llm/op/moe_matmul.py:509-536 | python/mlc_llm/op/moe_matmul.py:719-746 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":509}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddc8325f1f40fb882ad2c8f7bf9ac8a27dbe1f757024bd4f04b87b543c2b770a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (23\u201327 lines \u00D7 3): python/mlc_llm/compiler_pass/fuse_ft_dequantize_matmul_epilogue.py:133-155 | python/mlc_llm/compiler_pass/fuse_ft_dequantize_matmul_epilogue.py:157-181 | python/mlc_llm/compiler_pass/fuse_ft_dequantize_matmul_epilogue.py:303-329 \u2014 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 \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/fuse_ft_dequantize_matmul_epilogue.py"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad47ba6cbb23e20652c68d114bd2124270ce6ca3cb12577c42a9b3536ba7b572"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (27 lines \u00D7 2): python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:476-502 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:104-130 \u2014 \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py\u0060 and \u0060python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 81 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py"},"region":{"startLine":476}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a701dd1a3c2f901b9319f0e46fb61b5ad07a96e2c5aa271cce6c15a0dbc123e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (27 lines \u00D7 2): python/mlc_llm/model/gpt2/gpt2_model.py:47-73 | python/mlc_llm/model/gpt_j/gpt_j_model.py:49-75 \u2014 \u0060python/mlc_llm/model/gpt2/gpt2_model.py\u0060 and \u0060python/mlc_llm/model/gpt_j/gpt_j_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 84 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/gpt2/gpt2_model.py:47\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt2/gpt2_model.py"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"b84895d698a4dbe05249c57badcf4fca6f24049ecf744455d829f994216b08fb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (26 lines \u00D7 2): python/mlc_llm/serve/engine.py:215-240 | python/mlc_llm/serve/engine.py:407-432 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/serve/engine.py:215\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4d9c08b2c271fccaa8e2389d8e024aede89a7ab40c1fb63ff2dd04bda9faa79"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (26 lines \u00D7 2): python/mlc_llm/serve/engine.py:599-624 | python/mlc_llm/serve/engine.py:791-816 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/serve/engine.py:599\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":599}}}],"partialFingerprints":{"codehealthFindingId/v1":"24226d3107984cdae018b6bc205adbe9e7ea8746933cc8263ac89f97587906fa"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (26 lines \u00D7 2): python/mlc_llm/support/auto_config.py:43-68 | python/mlc_llm/support/auto_config.py:89-114 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/support/auto_config.py"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"d397ec1301025b9c409ec4d6ccc5714829566c95173a32b7f8e5c801ff268e4f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22\u201325 lines \u00D7 3): python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py:40-64 | python/mlc_llm/model/qwen3/qwen3_loader.py:47-68 | python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py:40-64 \u2014 \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py\u0060 and \u0060python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 108 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py:40\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060model_config\u0060 to \u0060DeepseekV2Config\u0060 in one and \u0060Qwen3Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"f512f22d82ec9dc1bd0ee0d4e205a28ee6d0dba4796cb57c2a0c2d48152be840"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (25 lines \u00D7 3): python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:93-117 | python/mlc_llm/model/gemma/gemma_model.py:55-79 | python/mlc_llm/model/gemma3/gemma3_model.py:61-85 \u2014 \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py\u0060 and \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"a78ee01ddd861abf1778b578f2c1834a205aeb3c2bf25431bc98c53cedaf3995"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (25 lines \u00D7 2): python/mlc_llm/model/gemma3/gemma3_model.py:474-498 | python/mlc_llm/model/gemma3/gemma3v_model.py:318-342 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/gemma3/gemma3_model.py\u0060 and \u0060python/mlc_llm/model/gemma3/gemma3v_model.py\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma3/gemma3_model.py"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"53025ec5aaa62adfd5c8afd5ae2fe020446c146c72aa6ea4fd90cee523cbfd0e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (23\u201324 lines \u00D7 4): python/mlc_llm/model/olmo/olmo_model.py:63-86 | python/mlc_llm/model/olmo2/olmo2_model.py:62-85 | python/mlc_llm/model/phi/phi_model.py:51-73 | python/mlc_llm/model/qwen3/qwen3_model.py:75-97 \u2014 \u0060python/mlc_llm/model/olmo/olmo_model.py\u0060 and \u0060python/mlc_llm/model/olmo2/olmo2_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 23 separate duplicated blocks between them, totalling at least 294 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/olmo/olmo_model.py"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbe0663082e7722d0359e1de9d5153e78243bf3ebd74043dc907324870e039a2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (24 lines \u00D7 2): android/MLCChat/bundle_weight.py:13-36 | android/MLCEngineExample/bundle_weight.py:13-36 \u2014 \u0060android/MLCChat/bundle_weight.py\u0060 and \u0060android/MLCEngineExample/bundle_weight.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 1 separate duplicated blocks between them, totalling at least 24 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCChat/bundle_weight.py"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"4778f1b34aebfd600318c24e199556f397fdc42c5af8d91da3fc9a6635938cfa"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (23\u201324 lines \u00D7 2): python/mlc_llm/serve/engine_base.py:826-849 | python/mlc_llm/serve/engine_base.py:1053-1075 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/serve/engine_base.py:826\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine_base.py"},"region":{"startLine":826}}}],"partialFingerprints":{"codehealthFindingId/v1":"28a84c132587b05a280e1212bcc9ad09329a557e5ab9494f73ba255666fbdb7b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21\u201324 lines \u00D7 2): python/mlc_llm/serve/entrypoints/debug_entrypoints.py:18-41 | python/mlc_llm/serve/entrypoints/debug_entrypoints.py:107-127 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/entrypoints/debug_entrypoints.py"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"81aa51a790bedc9efe6816381fcb4d968109746e7dfb19d1d79394ddfb6b72ea"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20\u201323 lines \u00D7 2): python/mlc_llm/compiler_pass/dispatch_triton_kernel.py:85-104 | python/mlc_llm/compiler_pass/dispatch_triton_kernel.py:133-155 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/compiler_pass/dispatch_triton_kernel.py:85\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/dispatch_triton_kernel.py"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"44809b458d38af35a3d5284c59d039cb56b06eef6bd6e8f25122b10064987619"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21\u201322 lines \u00D7 3): python/mlc_llm/cli/calibrate.py:11-31 | python/mlc_llm/cli/chat.py:9-30 | python/mlc_llm/cli/serve.py:107-128 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 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 \u0060python/mlc_llm/cli/calibrate.py:11\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/calibrate.py"},"region":{"startLine":11}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e4881e5fc2f231c3d673e38852f95e892b7d9c557c1f540fd864ea2dd84071c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22 lines \u00D7 2): python/mlc_llm/compiler_pass/attach_logit_processor.py:108-129 | python/mlc_llm/compiler_pass/attach_logit_processor.py:151-172 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_logit_processor.py"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb1114475ed027fb99b26fbac5f8b62e4eaeaee87443b89601db355bc72fee80"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22 lines \u00D7 2): python/mlc_llm/model/deepseek/deepseek_loader.py:36-57 | python/mlc_llm/model/minicpm/minicpm_loader.py:36-57 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_loader.py\u0060 and \u0060python/mlc_llm/model/minicpm/minicpm_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 73 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/deepseek/deepseek_loader.py:36\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060model_config\u0060 to \u0060DeepseekConfig\u0060 in one and \u0060MiniCPMConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_loader.py"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"87882d15cb420f9162e16a3ea94cee8a5f191fac4cc6ba9a73788aed931d30cc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22 lines \u00D7 2): python/mlc_llm/op/cutlass.py:183-204 | python/mlc_llm/op/cutlass.py:255-276 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/op/cutlass.py:183\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/cutlass.py"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"193fa539d3cf64563385486d1e0dc34e72f2ec891528854a78f6c41db3e5c552"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 11): python/mlc_llm/model/baichuan/baichuan_model.py:50-70 | python/mlc_llm/model/bert/bert_model.py:49-69 | python/mlc_llm/model/chatglm3/chatglm3_model.py:56-76 | python/mlc_llm/model/deepseek/deepseek_model.py:61-81 | python/mlc_llm/model/internlm/internlm_model.py:49-69 | python/mlc_llm/model/internlm2/internlm2_model.py:51-71 | python/mlc_llm/model/minicpm/minicpm_model.py:59-79 | python/mlc_llm/model/qwen/qwen_model.py:47-67 | python/mlc_llm/model/qwen2/qwen2_model.py:50-70 | python/mlc_llm/model/stable_lm/stablelm_model.py:48-68 | python/mlc_llm/model/starcoder2/starcoder2_model.py:51-71 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/chatglm3/chatglm3_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/baichuan/baichuan_model.py:50\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"952ce15bba4f950227dfb4761eab214c7490ea7fb6c4289a5112e52d761ee7a8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 6): python/mlc_llm/serve/engine.py:215-235 | python/mlc_llm/serve/engine.py:407-427 | python/mlc_llm/serve/engine.py:600-620 | python/mlc_llm/serve/engine.py:792-812 | python/mlc_llm/serve/engine.py:1104-1124 | python/mlc_llm/serve/engine.py:1667-1687 \u2014 all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"36f3893402ac2c28cec530b2057e6e5afe37bc2215ecfe61fa8e5b1258fda0d7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 2): python/mlc_llm/model/deepseek/deepseek_loader.py:66-86 | python/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py:63-83 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_loader.py\u0060 and \u0060python/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 88 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_loader.py"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"d516b1159aeabc8a6f2731f28eaba2641a47760c92880cbc198d4442f9a93804"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20\u201321 lines \u00D7 2): python/mlc_llm/serve/engine.py:1150-1169 | python/mlc_llm/serve/engine.py:1710-1730 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":1150}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fd4834b2bf13e5da635a629bf20e00ae05b46ac8e365ce4717c383c67498220"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17\u201320 lines \u00D7 5): python/mlc_llm/model/eagle/eagle_loader.py:69-88 | python/mlc_llm/model/llama/llama_loader.py:68-87 | python/mlc_llm/model/llava/llava_loader.py:69-85 | python/mlc_llm/model/mistral/mistral_loader.py:66-82 | python/mlc_llm/model/olmo/olmo_loader.py:68-87 \u2014 \u0060python/mlc_llm/model/eagle/eagle_loader.py\u0060 and \u0060python/mlc_llm/model/llama/llama_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 9 separate duplicated blocks between them, totalling at least 184 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/eagle/eagle_loader.py:69\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/eagle/eagle_loader.py"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"35270cd603356b490f9ee425b923eaa19bcf66f03a99b3fe2d37f84d36b0dac4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17\u201320 lines \u00D7 4): python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:481-497 | python/mlc_llm/model/minicpm/minicpm_model.py:215-234 | python/mlc_llm/model/mixtral/mixtral_model.py:84-103 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:108-125 \u2014 \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py\u0060 and \u0060python/mlc_llm/model/minicpm/minicpm_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 4 separate duplicated blocks between them, totalling at least 60 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:481\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py"},"region":{"startLine":481}}}],"partialFingerprints":{"codehealthFindingId/v1":"d5f71732a11c3f4bde8da309feef0854cbf97a95625943589c92134d7a269b26"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19\u201320 lines \u00D7 3): python/mlc_llm/interface/router.py:62-80 | python/mlc_llm/serve/entrypoints/openai_entrypoints.py:164-183 | python/mlc_llm/serve/entrypoints/openai_entrypoints.py:270-289 \u2014 there are 3 copies across 2 file(s) \u2014 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 \u0060python/mlc_llm/serve/entrypoints/openai_entrypoints.py:164\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/router.py"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce9ea958300127a5c46262313052fb3a802d1b206267783aad68b508e5192388"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 2): python/mlc_llm/compiler_pass/attach_logit_processor.py:43-62 | python/mlc_llm/compiler_pass/attach_logit_processor.py:75-94 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_logit_processor.py"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"180663849f773295a1623f6a1232107c57b329bfca345d769ce4099f7480acd4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 2): python/mlc_llm/model/chatglm3/chatglm3_loader.py:32-51 | python/mlc_llm/model/starcoder2/starcoder2_loader.py:34-53 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/chatglm3/chatglm3_loader.py"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"76f33ffbbc76b93f432c089bc1b9dd656d6191f37c605ba77df64a34850b1720"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 2): python/mlc_llm/model/llama/llama_model.py:261-280 | python/mlc_llm/model/nemotron/nemotron_model.py:240-259 \u2014 \u0060python/mlc_llm/model/llama/llama_model.py\u0060 and \u0060python/mlc_llm/model/nemotron/nemotron_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 19 separate duplicated blocks between them, totalling at least 175 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060LlamaConfig\u0060 in one and \u0060NemotronConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":261}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ad434597b66f11dcfe677f3de4de8c18cb4a2d0736208aa7ecc5f21be4c7a8b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 2): python/mlc_llm/serve/engine.py:1561-1580 | python/mlc_llm/serve/engine.py:1686-1705 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/serve/engine.py:1561\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":1561}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6bced94705b7e94e725d033e6f85e027c1c70ccc493eac3207a5bb179deffdf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): python/mlc_llm/compiler_pass/attach_sampler.py:81-99 | python/mlc_llm/compiler_pass/attach_sampler.py:174-192 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060python/mlc_llm/compiler_pass/attach_sampler.py:172\u0060 calls \u0060ShapeExpr\u0060, \u0060wrap_nested\u0060 and \u0060python/mlc_llm/compiler_pass/attach_sampler.py:80\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_sampler.py"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"3fbdf56cfb9614a0f0223266a96644ac52372f45eeb50de2312b7df3dda4e494"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): python/mlc_llm/model/llama4/llama4_loader.py:57-75 | python/mlc_llm/model/llama4/llama4_loader.py:89-107 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/model/llama4/llama4_loader.py:57\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama4/llama4_loader.py"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0d1fd2b9f3db9bf7ec40528d7e7cd9afed1c671425980e0dd7090a127eac728"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): python/mlc_llm/model/rwkv5/rwkv5_model.py:96-114 | python/mlc_llm/model/rwkv6/rwkv6_model.py:96-114 \u2014 \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py\u0060 and \u0060python/mlc_llm/model/rwkv6/rwkv6_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 14 separate duplicated blocks between them, totalling at least 129 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py:96\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_model.py"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"b98253edf909883357600a1643378ecc3d13a55f3557251eadb8351eb7b454e9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): python/mlc_llm/serve/engine.py:991-1009 | python/mlc_llm/serve/engine.py:1123-1141 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/serve/engine.py:991\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":991}}}],"partialFingerprints":{"codehealthFindingId/v1":"155e504a5700c40f646708ca0dbce6a98fe21a057c16936fe1caaf77b6044fb0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 9): python/mlc_llm/json_ffi/engine.py:153-170 | python/mlc_llm/serve/engine.py:216-233 | python/mlc_llm/serve/engine.py:408-425 | python/mlc_llm/serve/engine.py:601-618 | python/mlc_llm/serve/engine.py:793-810 | python/mlc_llm/serve/engine.py:968-985 | python/mlc_llm/serve/engine.py:1105-1122 | python/mlc_llm/serve/engine.py:1538-1555 | python/mlc_llm/serve/engine.py:1668-1685 \u2014 there are 9 copies across 2 file(s) \u2014 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 9 sites; resolving a subset leaves the remainder to drift apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/json_ffi/engine.py"},"region":{"startLine":153}}}],"partialFingerprints":{"codehealthFindingId/v1":"6784af1e545a40cdeaf12f8f8220b5b401be406ba5400131fedb861c22084c27"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 9): python/mlc_llm/model/eagle/eagle_model.py:38-55 | python/mlc_llm/model/gemma/gemma_model.py:171-188 | python/mlc_llm/model/gemma2/gemma2_model.py:63-80 | python/mlc_llm/model/llama/llama_model.py:181-198 | python/mlc_llm/model/ministral3/ministral3_model.py:276-293 | python/mlc_llm/model/mistral/mistral_model.py:165-182 | python/mlc_llm/model/olmo/olmo_model.py:216-233 | python/mlc_llm/model/olmo2/olmo2_model.py:218-235 | python/mlc_llm/model/orion/orion_model.py:152-169 \u2014 \u0060python/mlc_llm/model/eagle/eagle_model.py\u0060 and \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 80 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/eagle/eagle_model.py"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b1aaeae34fda1c310dab4e3ee64fc83d8cf732894cc7e2e318f8b06b9466542"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17\u201318 lines \u00D7 6): python/mlc_llm/model/gemma/gemma_model.py:49-65 | python/mlc_llm/model/olmo/olmo_model.py:55-72 | python/mlc_llm/model/olmo2/olmo2_model.py:54-71 | python/mlc_llm/model/orion/orion_model.py:43-59 | python/mlc_llm/model/phi/phi_model.py:44-60 | python/mlc_llm/model/phi/phi_model.py:113-129 \u2014 \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 and \u0060python/mlc_llm/model/olmo/olmo_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 14 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma/gemma_model.py"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd870e58b1e22d3509fe2a475fca48deec48c0f8aac0ee68920e0198798efdb2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 4): python/mlc_llm/model/cohere/cohere_loader.py:72-89 | python/mlc_llm/model/eagle/eagle_loader.py:55-72 | python/mlc_llm/model/llama/llama_loader.py:54-71 | python/mlc_llm/model/olmo/olmo_loader.py:54-71 \u2014 \u0060python/mlc_llm/model/cohere/cohere_loader.py\u0060 and \u0060python/mlc_llm/model/eagle/eagle_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 50 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/model/cohere/cohere_loader.py:90\u0060 calls \u0060_add\u0060 and \u0060python/mlc_llm/model/eagle/eagle_loader.py:75\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/cohere/cohere_loader.py"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"668f32b893c16d9224c3a86e195a722187673ceb0c6385c284c27d68d3348800"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17\u201318 lines \u00D7 2): python/mlc_llm/model/bert/bert_loader.py:75-91 | python/mlc_llm/model/starcoder2/starcoder2_loader.py:75-92 \u2014 \u0060python/mlc_llm/model/bert/bert_loader.py\u0060 and \u0060python/mlc_llm/model/starcoder2/starcoder2_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 71 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/bert/bert_loader.py:75\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/bert/bert_loader.py"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"2aefcff3d1301afc79c7ee43ddeded3426ca543ff4251d96873d555378c3c6d9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): python/mlc_llm/model/cohere/cohere_model.py:111-128 | python/mlc_llm/model/phi3/phi3_model.py:132-149 \u2014 \u0060python/mlc_llm/model/cohere/cohere_model.py\u0060 and \u0060python/mlc_llm/model/phi3/phi3_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 76 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060CohereConfig\u0060 in one and \u0060Phi3Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/cohere/cohere_model.py"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1f9fdd15b08d073623b09b508a0fedeb64a98ec2f6f0b1ed3da2fdf3cf35005"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15\u201317 lines \u00D7 5): python/mlc_llm/model/cohere/cohere_loader.py:66-82 | python/mlc_llm/model/eagle/eagle_loader.py:51-65 | python/mlc_llm/model/llama/llama_loader.py:50-64 | python/mlc_llm/model/mistral/mistral_loader.py:50-64 | python/mlc_llm/model/olmo/olmo_loader.py:50-64 \u2014 \u0060python/mlc_llm/model/cohere/cohere_loader.py\u0060 and \u0060python/mlc_llm/model/eagle/eagle_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 50 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/cohere/cohere_loader.py:66\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060model_config\u0060 to \u0060EagleConfig\u0060 in one and \u0060LlamaConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/cohere/cohere_loader.py"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"76ac7596385a4a13c54522ea7e2458536934e47b42e9f317f74e6724686e4267"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16\u201317 lines \u00D7 5): python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py:50-65 | python/mlc_llm/model/olmo/olmo_model.py:72-88 | python/mlc_llm/model/olmo2/olmo2_model.py:71-87 | python/mlc_llm/model/phi/phi_model.py:60-75 | python/mlc_llm/model/qwen3/qwen3_model.py:84-99 \u2014 \u0060python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py\u0060 and \u0060python/mlc_llm/model/phi/phi_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 58 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py:50\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"85bd7f29850a384c11ad4401d19f3c96e53cb2f3fbd5184a11c3c0527e8d5e3a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): python/mlc_llm/cli/convert_weight.py:41-57 | python/mlc_llm/cli/gen_config.py:24-40 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 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 \u0060python/mlc_llm/cli/convert_weight.py:41\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/convert_weight.py"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc92e90aacf92607f22fda57ce0ffcabecb64134909b5816d3603084ff48b75c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): python/mlc_llm/compiler_pass/attach_logit_processor.py:197-213 | python/mlc_llm/compiler_pass/attach_logit_processor.py:235-251 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/compiler_pass/attach_logit_processor.py:197\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_logit_processor.py"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5a020df33b8c37d0fa7fb307b47980c43eca12ed344947fbf3de483b95f4a9d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): python/mlc_llm/model/gemma/gemma_loader.py:27-43 | python/mlc_llm/model/gemma2/gemma2_loader.py:27-43 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060python/mlc_llm/model/gemma/gemma_loader.py:27\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060model_config\u0060 to \u0060GemmaConfig\u0060 in one and \u0060Gemma2Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/model/gemma2/gemma2_loader.py:44\u0060 calls \u0060add_one\u0060 and \u0060python/mlc_llm/model/gemma/gemma_loader.py:45\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma/gemma_loader.py"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"67f53e63fadd22f32eeef5c324881d07173ac5adbba33348dde293d6b9ba70d1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): python/mlc_llm/model/gemma3/gemma3_model.py:154-170 | python/mlc_llm/model/llama4/llama4_model.py:161-177 \u2014 \u0060python/mlc_llm/model/gemma3/gemma3_model.py\u0060 and \u0060python/mlc_llm/model/llama4/llama4_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 66 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060Gemma3Config\u0060 in one and \u0060Llama4Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma3/gemma3_model.py"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9543780d24ad09ad58cf1b08030a69b18265345ee6d268139c7a12e75c7f339"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13\u201317 lines \u00D7 2): python/mlc_llm/model/gemma3/gemma3v_model.py:170-186 | python/mlc_llm/model/qwen35/qwen35v_model.py:117-129 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/gemma3/gemma3v_model.py\u0060 and \u0060python/mlc_llm/model/qwen35/qwen35v_model.py\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma3/gemma3v_model.py"},"region":{"startLine":170}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ebbaa7d61db14f319bf534a26f345090d395d88cf26ec10f88d4db28c17dd63"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): python/mlc_llm/model/minicpm/minicpm_loader.py:119-135 | python/mlc_llm/model/mixtral/mixtral_loader.py:99-115 \u2014 \u0060python/mlc_llm/model/minicpm/minicpm_loader.py\u0060 and \u0060python/mlc_llm/model/mixtral/mixtral_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 63 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/minicpm/minicpm_loader.py:119\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_loader.py"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f0def292704ad7bab39c527fcb2dcdf10f2db0aa1334a5a88f90882ebe20169"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15\u201317 lines \u00D7 2): python/mlc_llm/model/ministral3/ministral3_loader.py:134-148 | python/mlc_llm/model/ministral3/ministral3_loader.py:172-188 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/ministral3/ministral3_loader.py"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"32cf442e45c9b5bfe1a99c6d4751d406d222b389e2c4eee8425c63d7220a0ce7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:89-105 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:87-103 \u2014 \u0060python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py\u0060 and \u0060python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 18 separate duplicated blocks between them, totalling at least 186 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab155ca104dbda3e6124336a962aff895f8f06abc5c328ee4fa59800ef8c8cb8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): python/mlc_llm/serve/entrypoints/openai_entrypoints.py:134-150 | python/mlc_llm/serve/entrypoints/openai_entrypoints.py:238-254 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 first that the copies are not typed on the same thing: the declarations holding them bind \u0060request\u0060 to \u0060CompletionRequest\u0060 in one and \u0060ChatCompletionRequest\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/entrypoints/openai_entrypoints.py"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0e79e1b0a851e2c70537dd4304e3dcbacdba0f370347f5616d28827640e2c08"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 26): python/mlc_llm/model/baichuan/baichuan_model.py:48-63 | python/mlc_llm/model/bert/bert_model.py:47-62 | python/mlc_llm/model/chatglm3/chatglm3_model.py:54-69 | python/mlc_llm/model/deepseek/deepseek_model.py:59-74 | python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:93-108 | python/mlc_llm/model/gemma/gemma_model.py:55-70 | python/mlc_llm/model/gemma3/gemma3_model.py:61-76 | python/mlc_llm/model/gpt2/gpt2_model.py:45-60 | python/mlc_llm/model/gpt_j/gpt_j_model.py:47-62 | python/mlc_llm/model/gpt_neox/gpt_neox_model.py:46-61 | python/mlc_llm/model/internlm/internlm_model.py:47-62 | python/mlc_llm/model/internlm2/internlm2_model.py:49-64 | python/mlc_llm/model/llama/llama_model.py:61-76 | python/mlc_llm/model/minicpm/minicpm_model.py:57-72 | python/mlc_llm/model/ministral3/ministral3_model.py:131-146 | python/mlc_llm/model/mistral/mistral_model.py:57-72 | python/mlc_llm/model/olmo/olmo_model.py:62-77 | python/mlc_llm/model/olmo2/olmo2_model.py:61-76 | python/mlc_llm/model/orion/orion_model.py:49-64 | python/mlc_llm/model/phi/phi_model.py:50-65 | python/mlc_llm/model/qwen/qwen_model.py:45-60 | python/mlc_llm/model/qwen2/qwen2_model.py:48-63 | python/mlc_llm/model/qwen3/qwen3_model.py:74-89 | python/mlc_llm/model/qwen35/qwen35_model.py:93-108 | python/mlc_llm/model/stable_lm/stablelm_model.py:46-61 | python/mlc_llm/model/starcoder2/starcoder2_model.py:49-64 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/chatglm3/chatglm3_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"acb2c6d2de5bd59ed3c10cc98a0f9cd7efb66ba3f9a3ff879b78f993b7b0180b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15\u201316 lines \u00D7 6): python/mlc_llm/model/chatglm3/chatglm3_loader.py:49-63 | python/mlc_llm/model/deepseek/deepseek_loader.py:135-149 | python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py:244-258 | python/mlc_llm/model/internlm2/internlm2_loader.py:79-94 | python/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py:116-130 | python/mlc_llm/model/starcoder2/starcoder2_loader.py:84-99 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_loader.py\u0060 and \u0060python/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 88 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/chatglm3/chatglm3_loader.py:49\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/chatglm3/chatglm3_loader.py"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"56ac5f89af2c82166b9764062b27327fc4ba77ee29bdd7e00f5aeb8cebfaa07c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15\u201316 lines \u00D7 5): python/mlc_llm/model/eagle/eagle_loader.py:90-105 | python/mlc_llm/model/llama/llama_loader.py:89-104 | python/mlc_llm/model/llava/llava_loader.py:87-101 | python/mlc_llm/model/mistral/mistral_loader.py:84-98 | python/mlc_llm/model/olmo/olmo_loader.py:89-104 \u2014 \u0060python/mlc_llm/model/eagle/eagle_loader.py\u0060 and \u0060python/mlc_llm/model/llama/llama_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 9 separate duplicated blocks between them, totalling at least 184 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/eagle/eagle_loader.py:90\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/eagle/eagle_loader.py"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"86745fa7308a1b00932c63bfaa880e09961beb1a788073cd72497c35bef2593e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15\u201316 lines \u00D7 4): python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py:35-50 | python/mlc_llm/model/ministral3/ministral3_loader.py:64-79 | python/mlc_llm/model/qwen3/qwen3_loader.py:43-57 | python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py:35-50 \u2014 \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py\u0060 and \u0060python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 108 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060model_config\u0060 to \u0060DeepseekV2Config\u0060 in one and \u0060Ministral3Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"b575ee835ac71a17d3f2c906b36bdab4750ca08c83d2890d11b99742d46b8039"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): python/mlc_llm/compiler_pass/attach_logit_processor.py:86-101 | python/mlc_llm/compiler_pass/attach_logit_processor.py:164-179 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/compiler_pass/attach_logit_processor.py:86\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060python/mlc_llm/compiler_pass/attach_logit_processor.py:163\u0060 calls \u0060Tensor\u0060 and \u0060python/mlc_llm/compiler_pass/attach_logit_processor.py:85\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_logit_processor.py"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e68b95a2479bb2e08bd8a0a02044bb134d6d53adff267c79fa64ca48e51a604"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13\u201316 lines \u00D7 2): python/mlc_llm/compiler_pass/attach_sampler.py:315-327 | python/mlc_llm/compiler_pass/attach_sampler.py:357-372 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/compiler_pass/attach_sampler.py:315\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_sampler.py"},"region":{"startLine":315}}}],"partialFingerprints":{"codehealthFindingId/v1":"58e66d7d80c57f6a1d7f348f5a5406c95820bc2ecb3f545de6b992dbb12c67c2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): python/mlc_llm/model/phi/phi_loader.py:103-118 | python/mlc_llm/model/phi3/phi3_loader.py:32-47 \u2014 \u0060python/mlc_llm/model/phi/phi_loader.py\u0060 and \u0060python/mlc_llm/model/phi3/phi3_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 33 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi/phi_loader.py"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"4af03e6617489cd33b89e68b122c7784ffa1fab4215a7a2e44a0f516d98d0aa1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:71-86 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:68-83 \u2014 \u0060python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py\u0060 and \u0060python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 18 separate duplicated blocks between them, totalling at least 186 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060Qwen2MoeConfig\u0060 in one and \u0060Qwen3MoeConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"14efcb275bbfda6e95bc49e0a79b7e1322a932c68b60cc09bc22bc289dd4fcd4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): python/mlc_llm/serve/engine_base.py:594-609 | python/mlc_llm/serve/sync_engine.py:115-130 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine_base.py"},"region":{"startLine":594}}}],"partialFingerprints":{"codehealthFindingId/v1":"137a1694b7fd636e3451346879b7adc2afc323255be0526577517e7eefece82d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 28): python/mlc_llm/model/baichuan/baichuan_model.py:67-81 | python/mlc_llm/model/chatglm3/chatglm3_model.py:73-87 | python/mlc_llm/model/cohere/cohere_model.py:62-76 | python/mlc_llm/model/deepseek/deepseek_model.py:78-92 | python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:110-124 | python/mlc_llm/model/gemma/gemma_model.py:72-86 | python/mlc_llm/model/gemma3/gemma3_model.py:78-92 | python/mlc_llm/model/gpt2/gpt2_model.py:64-78 | python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py:56-70 | python/mlc_llm/model/gpt_j/gpt_j_model.py:66-80 | python/mlc_llm/model/gpt_neox/gpt_neox_model.py:71-85 | python/mlc_llm/model/internlm/internlm_model.py:66-80 | python/mlc_llm/model/internlm2/internlm2_model.py:68-82 | python/mlc_llm/model/llama/llama_model.py:89-103 | python/mlc_llm/model/llama4/llama4_model.py:142-156 | python/mlc_llm/model/minicpm/minicpm_model.py:76-90 | python/mlc_llm/model/nemotron/nemotron_model.py:56-70 | python/mlc_llm/model/olmo/olmo_model.py:79-93 | python/mlc_llm/model/olmo2/olmo2_model.py:78-92 | python/mlc_llm/model/orion/orion_model.py:71-85 | python/mlc_llm/model/phi/phi_model.py:66-80 | python/mlc_llm/model/phi3/phi3_model.py:76-90 | python/mlc_llm/model/phi3v/phi3v_model.py:103-117 | python/mlc_llm/model/qwen/qwen_model.py:64-78 | python/mlc_llm/model/qwen2/qwen2_model.py:67-81 | python/mlc_llm/model/qwen3/qwen3_model.py:90-104 | python/mlc_llm/model/stable_lm/stablelm_model.py:65-79 | python/mlc_llm/model/starcoder2/starcoder2_model.py:68-82 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/chatglm3/chatglm3_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060python/mlc_llm/model/olmo/olmo_model.py:73\u0060 calls \u0060ValueError\u0060 and \u0060python/mlc_llm/model/cohere/cohere_model.py:60\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d7aae0a7b31c1b4ba7cfeb0f19107198df981cb6b31eff743c0570fd5a401db"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13\u201315 lines \u00D7 6): python/mlc_llm/model/cohere/cohere_loader.py:70-84 | python/mlc_llm/model/eagle/eagle_loader.py:53-67 | python/mlc_llm/model/llama/llama_loader.py:52-66 | python/mlc_llm/model/llava/llava_loader.py:55-67 | python/mlc_llm/model/mistral/mistral_loader.py:52-64 | python/mlc_llm/model/olmo/olmo_loader.py:52-66 \u2014 \u0060python/mlc_llm/model/cohere/cohere_loader.py\u0060 and \u0060python/mlc_llm/model/eagle/eagle_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 50 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/cohere/cohere_loader.py:70\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/cohere/cohere_loader.py"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"98eb517e320ab7220732a0f9041463b60735985f2c0eabc57eb34078cb91eedd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14\u201315 lines \u00D7 6): python/mlc_llm/model/llava/llava_loader.py:60-74 | python/mlc_llm/model/mistral/mistral_loader.py:57-71 | python/mlc_llm/model/mixtral/mixtral_loader.py:49-63 | python/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py:50-63 | python/mlc_llm/model/qwen3/qwen3_loader.py:114-127 | python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py:102-115 \u2014 \u0060python/mlc_llm/model/llava/llava_loader.py\u0060 and \u0060python/mlc_llm/model/mistral/mistral_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 135 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llava/llava_loader.py"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a125db0dc428fe534156aa12999f3e68a48d1b49a31fdb6c1e35890938a126c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): python/mlc_llm/model/gemma3/gemma3_loader.py:55-69 | python/mlc_llm/model/gemma3/gemma3v_loader.py:61-75 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 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 \u0060python/mlc_llm/model/gemma3/gemma3_loader.py:55\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma3/gemma3_loader.py"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"faa586a08acd8280797151b54418083a1bc073ce46d044efa3c4552a85005198"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): python/mlc_llm/model/olmo/olmo_model.py:179-193 | python/mlc_llm/model/olmo2/olmo2_model.py:185-199 \u2014 \u0060python/mlc_llm/model/olmo/olmo_model.py\u0060 and \u0060python/mlc_llm/model/olmo2/olmo2_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 23 separate duplicated blocks between them, totalling at least 294 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/olmo/olmo_model.py:179\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060OLMoConfig\u0060 in one and \u0060OLMo2Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/olmo/olmo_model.py"},"region":{"startLine":179}}}],"partialFingerprints":{"codehealthFindingId/v1":"72ff13f65a5c443c125dd9a09b3a41725391afc8b87a80a1b25001f5d350826a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): python/mlc_llm/model/phi3/phi3_loader.py:57-71 | python/mlc_llm/model/phi3v/phi3v_loader.py:59-73 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060python/mlc_llm/model/phi3/phi3_loader.py:57\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi3/phi3_loader.py"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e235d2bb923115ecb0109fcecfc507788763b41739438d680cea4b8e590b748"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): python/mlc_llm/model/qwen35/qwen35_model.py:290-304 | python/mlc_llm/model/qwen35/qwen35_model.py:326-340 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/model/qwen35/qwen35_model.py:290\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen35/qwen35_model.py"},"region":{"startLine":290}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6852831f73d72eb5408377aa7dcc4024583bdae3d53d00a6a016aa705ab60e7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): python/mlc_llm/op/moe_misc.py:101-115 | python/mlc_llm/op/moe_misc.py:190-204 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/op/moe_misc.py:101\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060python/mlc_llm/op/moe_misc.py:188\u0060 calls \u0060sblock_alloc_tensor\u0060 and \u0060python/mlc_llm/op/moe_misc.py:100\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_misc.py"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"3414d2d4795c7e47664e07d6fe9048af3acd54c9bd53e6d5f3782bef8169c576"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13\u201314 lines \u00D7 7): python/mlc_llm/model/cohere/cohere_model.py:47-60 | python/mlc_llm/model/gemma/gemma_model.py:52-64 | python/mlc_llm/model/olmo/olmo_model.py:58-71 | python/mlc_llm/model/olmo2/olmo2_model.py:57-70 | python/mlc_llm/model/orion/orion_model.py:46-58 | python/mlc_llm/model/phi/phi_model.py:47-59 | python/mlc_llm/model/phi/phi_model.py:116-128 \u2014 \u0060python/mlc_llm/model/cohere/cohere_model.py\u0060 and \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 77 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/cohere/cohere_model.py:47\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/model/olmo/olmo_model.py:73\u0060 calls \u0060ValueError\u0060 and \u0060python/mlc_llm/model/cohere/cohere_model.py:62\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/cohere/cohere_model.py"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"114700aff80dc440af66356bd9f33b5eb478f07d21bb2733f2e6c226a772381b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12\u201314 lines \u00D7 6): python/mlc_llm/model/eagle/eagle_loader.py:91-102 | python/mlc_llm/model/llama/llama_loader.py:90-101 | python/mlc_llm/model/llava/llava_loader.py:87-98 | python/mlc_llm/model/mistral/mistral_loader.py:84-95 | python/mlc_llm/model/mixtral/mixtral_loader.py:113-126 | python/mlc_llm/model/olmo/olmo_loader.py:90-101 \u2014 \u0060python/mlc_llm/model/eagle/eagle_loader.py\u0060 and \u0060python/mlc_llm/model/llama/llama_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 9 separate duplicated blocks between them, totalling at least 184 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/eagle/eagle_loader.py:91\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/eagle/eagle_loader.py"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"9786ef7b10c608e3c7bc6043ee3da688bfa69acab8f236bee7383c76a0cd511d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 5): python/mlc_llm/model/baichuan/baichuan_model.py:283-296 | python/mlc_llm/model/gpt_j/gpt_j_model.py:288-301 | python/mlc_llm/model/gpt_neox/gpt_neox_model.py:336-349 | python/mlc_llm/model/internlm/internlm_model.py:300-313 | python/mlc_llm/model/qwen/qwen_model.py:279-292 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/gpt_j/gpt_j_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 4 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/baichuan/baichuan_model.py:283\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":283}}}],"partialFingerprints":{"codehealthFindingId/v1":"05338626a13c6d2fe14ea2edf9788da4f94f07c475ad175c94b474786e55e237"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13\u201314 lines \u00D7 3): python/mlc_llm/model/bert/bert_loader.py:56-68 | python/mlc_llm/model/mixtral/mixtral_loader.py:44-57 | python/mlc_llm/model/starcoder2/starcoder2_loader.py:55-68 \u2014 \u0060python/mlc_llm/model/bert/bert_loader.py\u0060 and \u0060python/mlc_llm/model/mixtral/mixtral_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/bert/bert_loader.py:56\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060model_config\u0060 to \u0060MixtralConfig\u0060 in one and \u0060Starcoder2Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060python/mlc_llm/model/bert/bert_loader.py:53\u0060 calls \u0060to_hf\u0060 and \u0060python/mlc_llm/model/mixtral/mixtral_loader.py:42\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/bert/bert_loader.py"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"6dcc7431a41a904c5ede7987190a61309c721202878d0be985c7ef795f26d188"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12\u201314 lines \u00D7 3): python/mlc_llm/model/deepseek/deepseek_model.py:222-234 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:117-128 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:126-139 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 and \u0060python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 11 separate duplicated blocks between them, totalling at least 122 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/deepseek/deepseek_model.py:222\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd8ecf693491eabe6e1973815423f1a985a6922fe10abe6ab41355bbb8427020"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): python/mlc_llm/loader/standard_loader.py:93-106 | python/mlc_llm/loader/standard_loader.py:108-121 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/loader/standard_loader.py"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"0041de04c0fa2790eb6f62c8f21153747cafaff34786ba8f1b8d89479782a187"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): python/mlc_llm/model/minicpm/minicpm_model.py:96-109 | python/mlc_llm/model/starcoder2/starcoder2_model.py:88-101 \u2014 \u0060python/mlc_llm/model/minicpm/minicpm_model.py\u0060 and \u0060python/mlc_llm/model/starcoder2/starcoder2_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 11 separate duplicated blocks between them, totalling at least 123 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060MiniCPMConfig\u0060 in one and \u0060Starcoder2Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_model.py"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ec9e119cc368799731eb0889788de746ec4cc4c2a9313058081aa39a0424567"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): python/mlc_llm/model/olmo/olmo_model.py:121-134 | python/mlc_llm/model/olmo2/olmo2_model.py:116-129 \u2014 \u0060python/mlc_llm/model/olmo/olmo_model.py\u0060 and \u0060python/mlc_llm/model/olmo2/olmo2_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 23 separate duplicated blocks between them, totalling at least 294 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060OLMoConfig\u0060 in one and \u0060OLMo2Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/olmo/olmo_model.py"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"c64c9a1a39f185879fc2f385e4e205d6a79bb15f18102219be56cfa6f7dc79de"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): python/mlc_llm/model/phi3/phi3_model.py:238-251 | python/mlc_llm/model/phi3v/phi3v_model.py:137-150 \u2014 \u0060python/mlc_llm/model/phi3/phi3_model.py\u0060 and \u0060python/mlc_llm/model/phi3v/phi3v_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 94 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060Phi3Config\u0060 in one and \u0060Phi3VConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi3/phi3_model.py"},"region":{"startLine":238}}}],"partialFingerprints":{"codehealthFindingId/v1":"f41dbcf55b8d106492901f0425c4f88fb411fea65f110f2185b8c72c03e5623f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): python/mlc_llm/model/rwkv5/rwkv5_model.py:265-278 | python/mlc_llm/model/rwkv6/rwkv6_model.py:319-332 \u2014 \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py\u0060 and \u0060python/mlc_llm/model/rwkv6/rwkv6_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 14 separate duplicated blocks between them, totalling at least 129 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060RWKV5Config\u0060 in one and \u0060RWKV6Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_model.py"},"region":{"startLine":265}}}],"partialFingerprints":{"codehealthFindingId/v1":"175ca899d73af3662cfb5d980762a1358ea7a063bb560ea3e64764371329589d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (4\u201314 lines \u00D7 3): python/mlc_llm/quantization/block_scale_quantization.py:244-257 | python/mlc_llm/quantization/block_scale_quantization.py:390-403 | python/mlc_llm/quantization/block_scale_quantization.py:524-527 \u2014 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 \u2014 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 \u0060python/mlc_llm/quantization/block_scale_quantization.py:244\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060src\u0060 to \u0060nn.Linear\u0060 in one and \u0060\u0022MixtralExperts\u0022\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/quantization/block_scale_quantization.py:405\u0060 calls \u0060apply_sharding\u0060 and \u0060python/mlc_llm/quantization/block_scale_quantization.py:529\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/block_scale_quantization.py"},"region":{"startLine":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"0538b54ad603e7878df747b8c73fc959ee85b73dd32b829064a882be3b8c75d6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): python/mlc_llm/serve/engine.py:1038-1051 | python/mlc_llm/serve/engine.py:1600-1613 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":1038}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f3747003064ac52153d95e8fc12141130a4d08fe5a8ae71f291b4c2606c86ec"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 9): python/mlc_llm/model/bert/bert_loader.py:59-71 | python/mlc_llm/model/bert/bert_loader.py:74-86 | python/mlc_llm/model/deepseek/deepseek_loader.py:49-61 | python/mlc_llm/model/minicpm/minicpm_loader.py:49-61 | python/mlc_llm/model/mixtral/mixtral_loader.py:48-60 | python/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py:49-61 | python/mlc_llm/model/qwen3/qwen3_loader.py:113-125 | python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py:101-113 | python/mlc_llm/model/starcoder2/starcoder2_loader.py:59-71 \u2014 \u0060python/mlc_llm/model/bert/bert_loader.py\u0060 and \u0060python/mlc_llm/model/mixtral/mixtral_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/bert/bert_loader.py"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d36b202bed88736d185ed909e7bb1ef6607efa1ec283ef7e3d853e1ed07adbc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 8): python/mlc_llm/model/bert/bert_loader.py:59-71 | python/mlc_llm/model/llava/llava_loader.py:59-71 | python/mlc_llm/model/mistral/mistral_loader.py:56-68 | python/mlc_llm/model/mixtral/mixtral_loader.py:48-60 | python/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py:49-61 | python/mlc_llm/model/qwen3/qwen3_loader.py:113-125 | python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py:101-113 | python/mlc_llm/model/starcoder2/starcoder2_loader.py:59-71 \u2014 \u0060python/mlc_llm/model/bert/bert_loader.py\u0060 and \u0060python/mlc_llm/model/mixtral/mixtral_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/bert/bert_loader.py"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"76a10ea5712b4d23198beddfe6843828762548ec131ff6961a50ce6718857161"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 5): python/mlc_llm/model/deepseek/deepseek_loader.py:34-46 | python/mlc_llm/model/gpt_neox/gpt_neox_loader.py:34-46 | python/mlc_llm/model/minicpm/minicpm_loader.py:34-46 | python/mlc_llm/model/mixtral/mixtral_loader.py:34-46 | python/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py:34-46 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_loader.py\u0060 and \u0060python/mlc_llm/model/minicpm/minicpm_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 73 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060model_config\u0060 to \u0060DeepseekConfig\u0060 in one and \u0060GPTNeoXConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_loader.py"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d619afc83746c9841f51462c5333a23830e9b8758fab7661651eda0f1f492e0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 5): python/mlc_llm/model/deepseek/deepseek_loader.py:68-80 | python/mlc_llm/model/deepseek/deepseek_loader.py:125-137 | python/mlc_llm/model/llama4/llama4_loader.py:47-59 | python/mlc_llm/model/minicpm/minicpm_loader.py:67-79 | python/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py:65-77 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_loader.py\u0060 and \u0060python/mlc_llm/model/minicpm/minicpm_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 73 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_loader.py"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbe6347b141a471ae8ee48ac629c174190a68b23ab2c8d998ed8c6c94b3449b7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11\u201313 lines \u00D7 3): python/mlc_llm/bench/api_endpoint.py:89-99 | python/mlc_llm/bench/api_endpoint.py:246-257 | python/mlc_llm/router/router.py:183-195 \u2014 there are 3 copies across 2 file(s) \u2014 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 \u0060python/mlc_llm/bench/api_endpoint.py:246\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/api_endpoint.py"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e835d8dd3fd3526e103ff80a34764d84a1f03624e8b25ac846f5d2e8da188ac"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12\u201313 lines \u00D7 3): python/mlc_llm/cli/compile.py:65-77 | python/mlc_llm/cli/convert_weight.py:50-61 | python/mlc_llm/cli/gen_config.py:33-44 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 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 \u0060python/mlc_llm/cli/compile.py:65\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/compile.py"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"7eb6510ea16553a76ca526739d3c8210568eb06ef0179d67ce80bd99e9222b41"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): python/mlc_llm/model/bert/bert_loader.py:74-86 | python/mlc_llm/model/deepseek/deepseek_loader.py:49-61 | python/mlc_llm/model/starcoder2/starcoder2_loader.py:74-86 \u2014 \u0060python/mlc_llm/model/bert/bert_loader.py\u0060 and \u0060python/mlc_llm/model/starcoder2/starcoder2_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 71 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/bert/bert_loader.py"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"29c759ef1549542cce4afe7488496f5ebc3f1aeff5d95f1ad5742d24ae2efd00"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py:68-80 | python/mlc_llm/model/ministral3/ministral3_loader.py:111-123 | python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py:68-80 \u2014 \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py\u0060 and \u0060python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 108 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py:68\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e9450770ad3e70f51765b7d23776bf642def98cb2ce17714fea6b814d7ce935"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): python/mlc_llm/op/cutlass.py:178-190 | python/mlc_llm/op/cutlass.py:250-262 | python/mlc_llm/op/cutlass.py:329-341 \u2014 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 \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/cutlass.py"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"317169f1eeb9bb20994ec52972c82a9c6041bf56dbad5c14ad62d385a29ca8f2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): python/mlc_llm/compiler_pass/fuse_add_norm.py:36-48 | python/mlc_llm/compiler_pass/fuse_add_norm.py:107-119 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/fuse_add_norm.py"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c7cc9cd0f6311a6c305e5310c79b9e10b1a14cb59a7a321aca5679807504e28"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py:104-116 | python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py:119-131 \u2014 \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py\u0060 and \u0060python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 108 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py:104\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"a71a074ef88f8c502a96bdbb437cd768089a99b741606f9c95de8ff0e3e04c8d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): python/mlc_llm/model/minicpm/minicpm_model.py:181-193 | python/mlc_llm/model/mixtral/mixtral_model.py:50-62 \u2014 \u0060python/mlc_llm/model/minicpm/minicpm_model.py\u0060 and \u0060python/mlc_llm/model/mixtral/mixtral_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 86 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060MiniCPMConfig\u0060 in one and \u0060MixtralConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_model.py"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"006b8a0d49e68e96479d53d6b6f761d84470cc0297137f38d838e07f10662860"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): python/mlc_llm/model/ministral3/ministral3_model.py:227-239 | python/mlc_llm/model/mistral/mistral_model.py:124-136 \u2014 \u0060python/mlc_llm/model/ministral3/ministral3_model.py\u0060 and \u0060python/mlc_llm/model/mistral/mistral_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 18 separate duplicated blocks between them, totalling at least 213 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060Ministral3Config\u0060 in one and \u0060MistralConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/ministral3/ministral3_model.py"},"region":{"startLine":227}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1a658a9026c071cddbc30e0abaf2950c5c75d33a131f28e1dd031199aa8d0bb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): python/mlc_llm/model/qwen2/qwen2_model.py:86-98 | python/mlc_llm/model/qwen3/qwen3_model.py:109-121 \u2014 \u0060python/mlc_llm/model/qwen2/qwen2_model.py\u0060 and \u0060python/mlc_llm/model/qwen3/qwen3_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 18 separate duplicated blocks between them, totalling at least 189 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/qwen2/qwen2_model.py:86\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060QWen2Config\u0060 in one and \u0060Qwen3Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2/qwen2_model.py"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c30f797ce7a263f61019073c391a162183ac25f26d3aa9ddfa43710527cfb59"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): python/mlc_llm/op/batch_spec_verify.py:139-151 | python/mlc_llm/op/top_p_pivot.py:154-166 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/batch_spec_verify.py"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"83ecd9b7b4a4ba22e5eef00efb6c9877e1c4a81c89ff7298b7aa18dd07ecd289"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): python/mlc_llm/op/moe_matmul.py:485-497 | python/mlc_llm/op/moe_matmul.py:695-707 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/op/moe_matmul.py:485\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060python/mlc_llm/op/moe_matmul.py:692\u0060 calls \u0060sblock_alloc_tensor\u0060 and \u0060python/mlc_llm/op/moe_matmul.py:484\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":485}}}],"partialFingerprints":{"codehealthFindingId/v1":"86e4a3f18d8cd9ee9d7b855941edf188c278af37929ce8e5d00f471b8323b7de"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12\u201313 lines \u00D7 2): python/mlc_llm/serve/engine.py:1594-1605 | python/mlc_llm/serve/entrypoints/openai_entrypoints.py:320-332 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060python/mlc_llm/serve/engine.py:1594\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":1594}}}],"partialFingerprints":{"codehealthFindingId/v1":"696c7bf1bd00a8cc3f9df0d9c53cd9cdc8bb697de4827d8eb5529f86e3fd987a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 25): python/mlc_llm/model/chatglm3/chatglm3_model.py:366-377 | python/mlc_llm/model/cohere/cohere_model.py:326-337 | python/mlc_llm/model/deepseek/deepseek_model.py:436-447 | python/mlc_llm/model/eagle/eagle_model.py:172-183 | python/mlc_llm/model/gemma/gemma_model.py:311-322 | python/mlc_llm/model/internlm2/internlm2_model.py:297-308 | python/mlc_llm/model/llama/llama_model.py:404-415 | python/mlc_llm/model/llama4/llama4_model.py:684-695 | python/mlc_llm/model/minicpm/minicpm_model.py:440-451 | python/mlc_llm/model/ministral3/ministral3_model.py:453-464 | python/mlc_llm/model/mistral/mistral_model.py:310-321 | python/mlc_llm/model/nemotron/nemotron_model.py:383-394 | python/mlc_llm/model/olmo/olmo_model.py:436-447 | python/mlc_llm/model/olmo2/olmo2_model.py:436-447 | python/mlc_llm/model/orion/orion_model.py:292-303 | python/mlc_llm/model/phi/phi_model.py:407-418 | python/mlc_llm/model/phi3/phi3_model.py:331-342 | python/mlc_llm/model/phi3v/phi3v_model.py:296-307 | python/mlc_llm/model/qwen2/qwen2_model.py:327-338 | python/mlc_llm/model/qwen2_5_vl/qwen2_5_vl_model.py:502-513 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:310-321 | python/mlc_llm/model/qwen3/qwen3_model.py:360-371 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:308-319 | python/mlc_llm/model/stable_lm/stablelm_model.py:295-306 | python/mlc_llm/model/starcoder2/starcoder2_model.py:315-326 \u2014 \u0060python/mlc_llm/model/chatglm3/chatglm3_model.py\u0060 and \u0060python/mlc_llm/model/cohere/cohere_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 37 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/chatglm3/chatglm3_model.py:366\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/chatglm3/chatglm3_model.py"},"region":{"startLine":366}}}],"partialFingerprints":{"codehealthFindingId/v1":"92f01d3e2d70aad7265d2c95b9a93b7ff7269bd09a04806161953999dafd1583"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 4): python/mlc_llm/model/deepseek/deepseek_loader.py:87-98 | python/mlc_llm/model/minicpm/minicpm_loader.py:91-102 | python/mlc_llm/model/mixtral/mixtral_loader.py:71-82 | python/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py:84-95 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_loader.py\u0060 and \u0060python/mlc_llm/model/minicpm/minicpm_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 73 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/deepseek/deepseek_loader.py:87\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_loader.py"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0b6ef7281664249d871f38b6992a053dd0e12e47502fef1612b6d8b961d690f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 4): python/mlc_llm/model/gemma/gemma_model.py:126-137 | python/mlc_llm/model/llama/llama_model.py:141-152 | python/mlc_llm/model/nemotron/nemotron_model.py:124-135 | python/mlc_llm/model/orion/orion_model.py:112-123 \u2014 \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 and \u0060python/mlc_llm/model/llama/llama_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 18 separate duplicated blocks between them, totalling at least 182 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/gemma/gemma_model.py:126\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060GemmaConfig\u0060 in one and \u0060LlamaConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma/gemma_model.py"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0bb6f886e6933177806582ac57c0b6a242d6826db14f578b6d1e2ed35b1647b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201312 lines \u00D7 4): python/mlc_llm/model/llama/llama_model.py:225-235 | python/mlc_llm/model/nemotron/nemotron_model.py:203-213 | python/mlc_llm/model/olmo/olmo_model.py:263-274 | python/mlc_llm/model/olmo2/olmo2_model.py:265-274 \u2014 \u0060python/mlc_llm/model/llama/llama_model.py\u0060 and \u0060python/mlc_llm/model/nemotron/nemotron_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 19 separate duplicated blocks between them, totalling at least 175 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/olmo/olmo_model.py:263\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060LlamaConfig\u0060 in one and \u0060NemotronConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":225}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f74606566554679a50119d9306e997a7e2784db5d38e6831adba2101275ce77"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 4): python/mlc_llm/model/qwen2/qwen2_model.py:165-176 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:148-159 | python/mlc_llm/model/qwen3/qwen3_model.py:196-207 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:153-164 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/qwen2/qwen2_model.py\u0060 and \u0060python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py\u0060 as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060QWen2Config\u0060 in one and \u0060Qwen2MoeConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2/qwen2_model.py"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f45db5aa30015c39d9f7ad6fdad0ce1c5711733d240dfc3d66c02ead5b4b3c8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): python/mlc_llm/model/gemma3/gemma3_model.py:484-495 | python/mlc_llm/model/gemma3/gemma3v_model.py:328-339 | python/mlc_llm/model/llama4/llama4_model.py:687-698 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/gemma3/gemma3_model.py\u0060 and \u0060python/mlc_llm/model/gemma3/gemma3v_model.py\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma3/gemma3_model.py"},"region":{"startLine":484}}}],"partialFingerprints":{"codehealthFindingId/v1":"d402f059b0da4dfd8c4d47dd72ba3b532255c5545eecadb10ba634972e5fdea4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11\u201312 lines \u00D7 3): python/mlc_llm/model/ministral3/ministral3_model.py:400-411 | python/mlc_llm/model/qwen2/qwen2_model.py:276-286 | python/mlc_llm/model/qwen3/qwen3_model.py:309-319 \u2014 \u0060python/mlc_llm/model/ministral3/ministral3_model.py\u0060 and \u0060python/mlc_llm/model/qwen2/qwen2_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 8 separate duplicated blocks between them, totalling at least 87 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/ministral3/ministral3_model.py"},"region":{"startLine":400}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e374989dbf14392afb17db1ca6b4f3c8193a182adb8b0dc40adef57b5fb10da"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): python/mlc_llm/model/qwen2/qwen2_model.py:170-181 | python/mlc_llm/model/qwen2_5_vl/qwen2_5_vl_model.py:304-315 | python/mlc_llm/model/qwen3/qwen3_model.py:201-212 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/qwen2/qwen2_model.py\u0060 and \u0060python/mlc_llm/model/qwen2_5_vl/qwen2_5_vl_model.py\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2/qwen2_model.py"},"region":{"startLine":170}}}],"partialFingerprints":{"codehealthFindingId/v1":"37882700d4fbf28ae9594956b4ce72436b52f8649d45e7b9dfeb50159ca1a0d9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): python/mlc_llm/compiler_pass/dispatch_kv_cache_creation.py:161-172 | python/mlc_llm/compiler_pass/dispatch_kv_cache_creation.py:214-225 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/dispatch_kv_cache_creation.py"},"region":{"startLine":161}}}],"partialFingerprints":{"codehealthFindingId/v1":"a17d3b6d45e9a84a77f9f9e5c87ec6b463371948a4f996760e6880bcadb3a4e6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): python/mlc_llm/compiler_pass/dispatch_triton_kernel.py:71-82 | python/mlc_llm/compiler_pass/dispatch_triton_kernel.py:118-129 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/compiler_pass/dispatch_triton_kernel.py:71\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/dispatch_triton_kernel.py"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ddc5dfa9aeaf7b2e1e48985df86ab5745e9b2064d93c654034100024c183aa0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): python/mlc_llm/contrib/embeddings/openai.py:65-76 | python/mlc_llm/contrib/embeddings/openai.py:91-102 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/contrib/embeddings/openai.py"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"d860ab4fe4efc7228da585efb4d23146c3f85969a66773e4e00d3acf74f200ce"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201312 lines \u00D7 2): python/mlc_llm/model/baichuan/baichuan_model.py:141-150 | python/mlc_llm/model/internlm/internlm_model.py:144-155 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/internlm/internlm_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 18 separate duplicated blocks between them, totalling at least 190 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/baichuan/baichuan_model.py:141\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf2de19a48827aabfe1de5c13d05ecdc3aa49885f5a4893c6d611455e7def443"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): python/mlc_llm/model/bert/bert_loader.py:85-97 | python/mlc_llm/model/qwen3/qwen3_loader.py:135-146 \u2014 \u0060python/mlc_llm/model/bert/bert_loader.py\u0060 and \u0060python/mlc_llm/model/qwen3/qwen3_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 39 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/bert/bert_loader.py:85\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/bert/bert_loader.py"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"005a5af55a9a067ae8cdc0d11684b9835759797cf5e57dfa0f96a47121d467d2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): python/mlc_llm/model/llama/llama_model.py:47-58 | python/mlc_llm/model/llama4/llama4_model.py:58-69 \u2014 \u0060python/mlc_llm/model/llama/llama_model.py\u0060 and \u0060python/mlc_llm/model/llama4/llama4_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 8 separate duplicated blocks between them, totalling at least 76 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"bae32e8ba21a49fca880ea3cd8d4114817e68a0a52c54f83748462fbc1b4963c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201312 lines \u00D7 2): python/mlc_llm/model/minicpm/minicpm_model.py:265-276 | python/mlc_llm/model/stable_lm/stablelm_model.py:149-158 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/minicpm/minicpm_model.py\u0060 and \u0060python/mlc_llm/model/stable_lm/stablelm_model.py\u0060 as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/minicpm/minicpm_model.py:265\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_model.py"},"region":{"startLine":265}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d74bb2ae71ce29f59ce34bd80f376a385a2792195ce75207034a5d6e445ab58"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11\u201312 lines \u00D7 2): python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:178-189 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:176-186 \u2014 \u0060python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py\u0060 and \u0060python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 18 separate duplicated blocks between them, totalling at least 186 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:178\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdb433e3c3a03d784346d87a6a68729011ed1d8bf38520988c6c2b4cf7be1cb4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): python/mlc_llm/model/rwkv5/rwkv5_model.py:52-63 | python/mlc_llm/model/rwkv6/rwkv6_model.py:52-63 \u2014 \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py\u0060 and \u0060python/mlc_llm/model/rwkv6/rwkv6_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 14 separate duplicated blocks between them, totalling at least 129 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_model.py"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"4523a93637a35ffb2ca525c9bff802547c91388fc62159a5ce114607a35e929d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201311 lines \u00D7 8): python/mlc_llm/model/baichuan/baichuan_model.py:116-125 | python/mlc_llm/model/gemma/gemma_model.py:107-116 | python/mlc_llm/model/internlm/internlm_model.py:119-129 | python/mlc_llm/model/llama/llama_model.py:111-120 | python/mlc_llm/model/ministral3/ministral3_model.py:199-208 | python/mlc_llm/model/mistral/mistral_model.py:103-112 | python/mlc_llm/model/orion/orion_model.py:93-102 | python/mlc_llm/model/stable_lm/stablelm_model.py:124-133 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 72 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/baichuan/baichuan_model.py:116\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060BaichuanConfig\u0060 in one and \u0060GemmaConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"49a4ba2943d92b8310f26f67939084b4929325288cbd5a612f22859dd573f906"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u201311 lines \u00D7 8): python/mlc_llm/model/eagle/eagle_model.py:38-45 | python/mlc_llm/model/gemma/gemma_model.py:171-178 | python/mlc_llm/model/gemma2/gemma2_model.py:60-70 | python/mlc_llm/model/llama/llama_model.py:181-188 | python/mlc_llm/model/ministral3/ministral3_model.py:276-283 | python/mlc_llm/model/mistral/mistral_model.py:165-172 | python/mlc_llm/model/mixtral/mixtral_model.py:130-137 | python/mlc_llm/model/olmo2/olmo2_model.py:215-225 \u2014 \u0060python/mlc_llm/model/eagle/eagle_model.py\u0060 and \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 80 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/gemma2/gemma2_model.py:60\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060Gemma2Config\u0060 in one and \u0060OLMo2Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/eagle/eagle_model.py"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"aeed51f309ee95231f4ddeb35a2982e1efba9e5844c3bc3865c8df293f232b21"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 4): python/mlc_llm/model/baichuan/baichuan_model.py:155-165 | python/mlc_llm/model/deepseek/deepseek_model.py:301-311 | python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:594-604 | python/mlc_llm/model/internlm/internlm_model.py:173-183 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 8 separate duplicated blocks between them, totalling at least 94 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:592\u0060 calls \u0060isinstance\u0060 and \u0060python/mlc_llm/model/deepseek/deepseek_model.py:300\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"16249ef181ab68ea727eea07dc1cd5c4745d3aa66e9ea53c2a8b2e96d34c3763"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9\u201311 lines \u00D7 4): python/mlc_llm/model/cohere/cohere_model.py:240-248 | python/mlc_llm/model/eagle/eagle_model.py:88-98 | python/mlc_llm/model/gemma/gemma_model.py:229-237 | python/mlc_llm/model/orion/orion_model.py:210-218 \u2014 \u0060python/mlc_llm/model/cohere/cohere_model.py\u0060 and \u0060python/mlc_llm/model/eagle/eagle_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 33 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/eagle/eagle_model.py:88\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060CohereConfig\u0060 in one and \u0060EagleConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/cohere/cohere_model.py"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b4bb3b0143be15546f8c820a4f7ee92548c643364a6a59a5d6b94d66f5f7a93"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 4): python/mlc_llm/model/eagle/eagle_loader.py:43-53 | python/mlc_llm/model/llama/llama_loader.py:42-52 | python/mlc_llm/model/olmo/olmo_loader.py:42-52 | python/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py:36-46 \u2014 \u0060python/mlc_llm/model/eagle/eagle_loader.py\u0060 and \u0060python/mlc_llm/model/llama/llama_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 9 separate duplicated blocks between them, totalling at least 184 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060model_config\u0060 to \u0060EagleConfig\u0060 in one and \u0060LlamaConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/eagle/eagle_loader.py"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e4a43a219d0b928ed3ce3872dba1bd5fd054887627e5951d1bd3d42092bb32a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 4): python/mlc_llm/model/qwen2/qwen2_model.py:233-243 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:226-236 | python/mlc_llm/model/qwen3/qwen3_model.py:265-275 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:223-233 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/qwen2/qwen2_model.py\u0060 and \u0060python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py\u0060 as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note what the matched lines are: every one of them assigns one field to another, so the block is a hand-written mapper between two data shapes rather than behaviour with a helper inside it. Extracting one shared function only works if both sites map the SAME pair of types in the same direction \u2014 check that first, because inverse or differently-typed mappers have no single function they can both call. Where they do not, the moves that exist are a generated or reflective mapper, a common embedded/base type the fields live on once, or accepting the run and covering it with a test that fails when a field is added to one side only. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060QWen2Config\u0060 in one and \u0060Qwen2MoeConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2/qwen2_model.py"},"region":{"startLine":233}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1a660ce18db08585fdb03c5223b206337eac603daa0fc75f3e05d6aa2036923"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201311 lines \u00D7 3): python/mlc_llm/interface/router.py:101-110 | python/mlc_llm/serve/engine.py:1153-1163 | python/mlc_llm/serve/engine.py:1715-1724 \u2014 there are 3 copies across 2 file(s) \u2014 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 \u0060python/mlc_llm/interface/router.py:101\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/router.py"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"8acf02d154a6863f98c9e8749d016d82685bbf546b85339ff4c16ee23a47b2f5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): python/mlc_llm/model/ministral3/ministral3_model.py:380-390 | python/mlc_llm/model/qwen2/qwen2_model.py:256-266 | python/mlc_llm/model/qwen3/qwen3_model.py:289-299 \u2014 \u0060python/mlc_llm/model/ministral3/ministral3_model.py\u0060 and \u0060python/mlc_llm/model/qwen2/qwen2_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 8 separate duplicated blocks between them, totalling at least 87 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/ministral3/ministral3_model.py"},"region":{"startLine":380}}}],"partialFingerprints":{"codehealthFindingId/v1":"f602396efce2db71a9285db3c571cc0de0ebce1035f3decee4f6b0e933083c8b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201311 lines \u00D7 3): python/mlc_llm/model/ministral3/ministral3_model.py:414-424 | python/mlc_llm/model/qwen2/qwen2_model.py:289-298 | python/mlc_llm/model/qwen3/qwen3_model.py:322-331 \u2014 \u0060python/mlc_llm/model/ministral3/ministral3_model.py\u0060 and \u0060python/mlc_llm/model/qwen2/qwen2_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 8 separate duplicated blocks between them, totalling at least 87 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/ministral3/ministral3_model.py"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf8417049edaafad08ad9bb7e26ccf18c8ef106e0fd5adc6116fec114c991437"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): python/mlc_llm/json_ffi/engine.py:82-92 | python/mlc_llm/serve/engine_base.py:637-647 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/json_ffi/engine.py"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"255c9c24f3aaea2660c096b2b633cae7ebfe33daa95080ad4f2a0ed522b32b29"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): python/mlc_llm/model/deepseek/deepseek_model.py:230-240 | python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:506-516 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 and \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py\u0060 as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":230}}}],"partialFingerprints":{"codehealthFindingId/v1":"94d0a425a9b9d6f6e517edca0a802b5e559dc90d0f64a636fee396e8c8296dff"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): python/mlc_llm/model/deepseek/deepseek_model.py:260-270 | python/mlc_llm/model/minicpm/minicpm_model.py:264-274 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 and \u0060python/mlc_llm/model/minicpm/minicpm_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 13 separate duplicated blocks between them, totalling at least 139 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/deepseek/deepseek_model.py:260\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060DeepseekConfig\u0060 in one and \u0060MiniCPMConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":260}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0ec2e83cf747d4f9abf41abcef9d630260a7833c39b8ae2f6a441e7ea2ddd77"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): python/mlc_llm/model/gpt_j/gpt_j_model.py:104-114 | python/mlc_llm/model/qwen/qwen_model.py:102-112 \u2014 \u0060python/mlc_llm/model/gpt_j/gpt_j_model.py\u0060 and \u0060python/mlc_llm/model/qwen/qwen_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 9 separate duplicated blocks between them, totalling at least 94 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt_j/gpt_j_model.py"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"58a96b60e9b54592e6d0128b4688467184771ca4bcf2586a56c383aa7616ff22"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): python/mlc_llm/model/ministral3/ministral3_loader.py:255-265 | python/mlc_llm/model/qwen3/qwen3_loader.py:135-147 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060python/mlc_llm/model/qwen3/qwen3_loader.py:135\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/ministral3/ministral3_loader.py"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf801b15a6a416515230cd2eb26b3a7ec906b091c762b6cd98b53bd95d9cdc6c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): python/mlc_llm/model/qwen3/qwen3_model.py:209-219 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:166-176 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/qwen3/qwen3_model.py\u0060 and \u0060python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py\u0060 as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/qwen3/qwen3_model.py:209\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen3/qwen3_model.py"},"region":{"startLine":209}}}],"partialFingerprints":{"codehealthFindingId/v1":"840916783af4827bae0489ca6a2df1a7faaf2bf4a97880fbf84378c83400b4fd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201311 lines \u00D7 2): python/mlc_llm/nn/rnn_state.py:197-207 | python/mlc_llm/nn/rnn_state.py:279-288 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/nn/rnn_state.py:197\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/nn/rnn_state.py"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"099f32dcd884b5700138c1df77ff7380a225ff8d0e6242fe7f651417f4cd1f19"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): python/mlc_llm/op/moe_matmul.py:445-455 | python/mlc_llm/op/moe_matmul.py:652-662 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":445}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e08fa6b649ea1538e902babe4ff94a8b8526037d659d2ddc23f99485baf4148"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): python/mlc_llm/op/triton.py:614-624 | python/mlc_llm/op/triton.py:709-719 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/op/triton.py:720\u0060 calls \u0060_compute_expert_id_per_block\u0060 and \u0060python/mlc_llm/op/triton.py:626\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/triton.py"},"region":{"startLine":614}}}],"partialFingerprints":{"codehealthFindingId/v1":"7cdfd3ac0f8ec75206755167dc2811794f5b099005d1966953512fd704799e67"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): python/mlc_llm/quantization/group_quantization.py:378-388 | python/mlc_llm/quantization/per_tensor_quantization.py:391-401 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 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 \u0060python/mlc_llm/quantization/group_quantization.py:378\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060GroupQuantize\u0060 in one and \u0060PerTensorQuantize\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/quantization/group_quantization.py:389\u0060 calls \u0060apply_sharding\u0060 and \u0060python/mlc_llm/quantization/per_tensor_quantization.py:403\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/group_quantization.py"},"region":{"startLine":378}}}],"partialFingerprints":{"codehealthFindingId/v1":"a65e757e46fe2baf53777394767acf7fb1423a2cfdda4f5e17716181859c2f43"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 27): python/mlc_llm/model/chatglm3/chatglm3_model.py:368-377 | python/mlc_llm/model/cohere/cohere_model.py:328-337 | python/mlc_llm/model/deepseek/deepseek_model.py:438-447 | python/mlc_llm/model/eagle/eagle_model.py:174-183 | python/mlc_llm/model/gemma/gemma_model.py:313-322 | python/mlc_llm/model/gemma3/gemma3_model.py:483-492 | python/mlc_llm/model/gemma3/gemma3v_model.py:327-336 | python/mlc_llm/model/internlm2/internlm2_model.py:299-308 | python/mlc_llm/model/llama/llama_model.py:406-415 | python/mlc_llm/model/llama4/llama4_model.py:686-695 | python/mlc_llm/model/minicpm/minicpm_model.py:442-451 | python/mlc_llm/model/ministral3/ministral3_model.py:455-464 | python/mlc_llm/model/mistral/mistral_model.py:312-321 | python/mlc_llm/model/nemotron/nemotron_model.py:385-394 | python/mlc_llm/model/olmo/olmo_model.py:438-447 | python/mlc_llm/model/olmo2/olmo2_model.py:438-447 | python/mlc_llm/model/orion/orion_model.py:294-303 | python/mlc_llm/model/phi/phi_model.py:409-418 | python/mlc_llm/model/phi3/phi3_model.py:333-342 | python/mlc_llm/model/phi3v/phi3v_model.py:298-307 | python/mlc_llm/model/qwen2/qwen2_model.py:329-338 | python/mlc_llm/model/qwen2_5_vl/qwen2_5_vl_model.py:504-513 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:312-321 | python/mlc_llm/model/qwen3/qwen3_model.py:362-371 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:310-319 | python/mlc_llm/model/stable_lm/stablelm_model.py:297-306 | python/mlc_llm/model/starcoder2/starcoder2_model.py:317-326 \u2014 \u0060python/mlc_llm/model/chatglm3/chatglm3_model.py\u0060 and \u0060python/mlc_llm/model/cohere/cohere_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 37 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/chatglm3/chatglm3_model.py"},"region":{"startLine":368}}}],"partialFingerprints":{"codehealthFindingId/v1":"368cb754c5b91a851c03808a7fd78bf42fb892076c895486574453744b4911c6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 11): python/mlc_llm/model/baichuan/baichuan_model.py:115-124 | python/mlc_llm/model/gemma/gemma_model.py:106-115 | python/mlc_llm/model/internlm/internlm_model.py:118-128 | python/mlc_llm/model/internlm2/internlm2_model.py:124-133 | python/mlc_llm/model/llama/llama_model.py:110-119 | python/mlc_llm/model/ministral3/ministral3_model.py:198-207 | python/mlc_llm/model/mistral/mistral_model.py:102-111 | python/mlc_llm/model/olmo/olmo_model.py:178-187 | python/mlc_llm/model/olmo2/olmo2_model.py:184-193 | python/mlc_llm/model/orion/orion_model.py:92-101 | python/mlc_llm/model/stable_lm/stablelm_model.py:123-132 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 72 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060BaichuanConfig\u0060 in one and \u0060GemmaConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1ef3b3118ecb4d21604518bb0e8a0c4efdb131c941be8b6b6780e7664628413"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u201310 lines \u00D7 5): python/mlc_llm/model/minicpm/minicpm_model.py:373-381 | python/mlc_llm/model/ministral3/ministral3_model.py:383-392 | python/mlc_llm/model/qwen2/qwen2_model.py:259-268 | python/mlc_llm/model/qwen3/qwen3_model.py:292-301 | python/mlc_llm/model/qwen35/qwen35_model.py:711-718 \u2014 \u0060python/mlc_llm/model/minicpm/minicpm_model.py\u0060 and \u0060python/mlc_llm/model/ministral3/ministral3_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_model.py"},"region":{"startLine":373}}}],"partialFingerprints":{"codehealthFindingId/v1":"76d86e0b9f0e54d652073dc9e1a7844a4739d0e353a4db782a3d99eef7e36e7d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7\u201310 lines \u00D7 4): python/mlc_llm/model/deepseek/deepseek_model.py:220-229 | python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:496-502 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:115-123 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:124-132 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 and \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py\u0060 as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb0369d8bbcc8e6838d9f7dd42ad412d25ffaf5febc8068d0dd8164e1ed7022e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): python/mlc_llm/model/deepseek/deepseek_model.py:259-268 | python/mlc_llm/model/internlm/internlm_model.py:142-151 | python/mlc_llm/model/minicpm/minicpm_model.py:263-272 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 and \u0060python/mlc_llm/model/internlm/internlm_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 10 separate duplicated blocks between them, totalling at least 113 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060DeepseekConfig\u0060 in one and \u0060InternLMConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"729b361184edc216ad2f4ee4b859a1df33efb9749557dcac52002c36ddb0c66b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): python/mlc_llm/model/llama/llama_model.py:250-259 | python/mlc_llm/model/nemotron/nemotron_model.py:228-237 | python/mlc_llm/model/phi3/phi3_model.py:235-244 \u2014 \u0060python/mlc_llm/model/llama/llama_model.py\u0060 and \u0060python/mlc_llm/model/nemotron/nemotron_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 19 separate duplicated blocks between them, totalling at least 175 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060LlamaConfig\u0060 in one and \u0060NemotronConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":250}}}],"partialFingerprints":{"codehealthFindingId/v1":"02e9de619dfe7e81749e28571487ea3203fe070105179ae6518ebb7c046a0f5a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): python/mlc_llm/model/phi3v/phi3v_image.py:27-36 | python/mlc_llm/model/phi3v/phi3v_image.py:40-49 | python/mlc_llm/model/phi3v/phi3v_image.py:316-326 \u2014 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 \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi3v/phi3v_image.py"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"746fc62294e3b3863b43dabba5e33863979c40b80d5f26d1e2eb251084e1d7a7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): python/mlc_llm/model/qwen2/qwen2_model.py:178-187 | python/mlc_llm/model/qwen2_5_vl/qwen2_5_vl_model.py:312-321 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:162-171 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/qwen2/qwen2_model.py\u0060 and \u0060python/mlc_llm/model/qwen2_5_vl/qwen2_5_vl_model.py\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/qwen2/qwen2_model.py:178\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2/qwen2_model.py"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"81de343e4f854d93a9c5e776dd00a27f901a0706571f707d014b09e08eb5bc31"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/compiler_pass/attach_logit_processor.py:72-81 | python/mlc_llm/compiler_pass/attach_logit_processor.py:231-240 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/compiler_pass/attach_logit_processor.py:72\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_logit_processor.py"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"85cbd480fd2efd7776770531aba03b2bda4492060f1c9e4dae9c4d234025f948"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/compiler_pass/fuse_add_norm.py:16-25 | python/mlc_llm/compiler_pass/fuse_add_norm.py:87-96 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/compiler_pass/fuse_add_norm.py:16\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/fuse_add_norm.py"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"e31ead31b3fc6c771bf70228cee19aef838941f74faca8bf6734eab70a52717e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/contrib/embeddings/openai.py:133-142 | python/mlc_llm/contrib/embeddings/openai.py:169-178 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/contrib/embeddings/openai.py:133\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/contrib/embeddings/openai.py"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"de8715a94c110ba1ad596310b20d0eb03380caa57fb2d256d0d42e43d013661a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/model/baichuan/baichuan_model.py:200-209 | python/mlc_llm/model/internlm/internlm_model.py:217-226 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/internlm/internlm_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 18 separate duplicated blocks between them, totalling at least 190 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060BaichuanConfig\u0060 in one and \u0060InternLMConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"aee3d1a463338987b07fb47dd29d0fae905b2b082262c74fd625f6ae0c6c2d48"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:581-590 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:177-186 \u2014 \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py\u0060 and \u0060python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 44 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:581\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py"},"region":{"startLine":581}}}],"partialFingerprints":{"codehealthFindingId/v1":"45ad923e63378731409d00c031a1c416017ffafc1e75fa82029659d5b9498a0d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/model/gemma3/gemma3_model.py:117-126 | python/mlc_llm/model/gemma3/gemma3v_model.py:64-73 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/gemma3/gemma3_model.py\u0060 and \u0060python/mlc_llm/model/gemma3/gemma3v_model.py\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma3/gemma3_model.py"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"923581f5061191b29039303a193dfc603863364648f384fa4eef9fc069421213"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/model/gpt2/gpt2_model.py:158-167 | python/mlc_llm/model/qwen/qwen_model.py:154-163 \u2014 \u0060python/mlc_llm/model/gpt2/gpt2_model.py\u0060 and \u0060python/mlc_llm/model/qwen/qwen_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/gpt2/gpt2_model.py:158\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt2/gpt2_model.py"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"3316048b6bae99a9977b8b4369f77a2f113c98d6d9d77776bfce9884a2c86541"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9\u201310 lines \u00D7 2): python/mlc_llm/model/llama4/llama4_model.py:324-333 | python/mlc_llm/model/olmo2/olmo2_model.py:160-168 \u2014 \u0060python/mlc_llm/model/llama4/llama4_model.py\u0060 and \u0060python/mlc_llm/model/olmo2/olmo2_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 8 separate duplicated blocks between them, totalling at least 74 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama4/llama4_model.py"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce38fbca2dbf5405d909d2f2592e2e33d828a3168311b1e2c11c98b81ffca372"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/model/mixtral/mixtral_loader.py:120-129 | python/mlc_llm/model/phi3v/phi3v_loader.py:119-128 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/mixtral/mixtral_loader.py"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"70014d1dda7acf9cdcf4ff45f6f6a17adaa54f02dca306bf0018cfa92b8a8d42"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:58-67 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:57-66 \u2014 \u0060python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py\u0060 and \u0060python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 18 separate duplicated blocks between them, totalling at least 186 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060Qwen2MoeConfig\u0060 in one and \u0060Qwen3MoeConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:68\u0060 calls \u0060Qwen2MoeMLP\u0060, \u0060Linear\u0060 and \u0060python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:68\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3f56dbe2dbc7e0485055ca02d12e817b1bd0b63a75ae7f34bd9a4feea52ac43"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9\u201310 lines \u00D7 2): python/mlc_llm/model/qwen3/qwen3_model.py:122-130 | python/mlc_llm/model/qwen35/qwen35_model.py:178-187 \u2014 \u0060python/mlc_llm/model/qwen3/qwen3_model.py\u0060 and \u0060python/mlc_llm/model/qwen35/qwen35_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/qwen3/qwen3_model.py:122\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060Qwen3Config\u0060 in one and \u0060Qwen35Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen3/qwen3_model.py"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e8dd47387a69fbb000198b1aeb9317926e2a3b0f7115cd4048e889cd731f75a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/model/rwkv5/rwkv5_model.py:193-202 | python/mlc_llm/model/rwkv6/rwkv6_model.py:222-231 \u2014 \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py\u0060 and \u0060python/mlc_llm/model/rwkv6/rwkv6_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 14 separate duplicated blocks between them, totalling at least 129 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_model.py"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"295cc8f8e19beb0af876bc15c64f310ea2aa5a0b1ae4aec03c74ec9b5566373f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/model/rwkv5/rwkv5_model.py:251-260 | python/mlc_llm/model/rwkv6/rwkv6_model.py:305-314 \u2014 \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py\u0060 and \u0060python/mlc_llm/model/rwkv6/rwkv6_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 14 separate duplicated blocks between them, totalling at least 129 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_model.py"},"region":{"startLine":251}}}],"partialFingerprints":{"codehealthFindingId/v1":"50abcb5185e62701d799dabfb2ef922ef3aa3a28da68708b94540958743431e2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/model/vision/clip_vision.py:87-96 | python/mlc_llm/model/vision/siglip_vision.py:82-91 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/vision/clip_vision.py"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"711aa8ae906ad3491bd4abdeb00455966575268ad62e7749d4e00fe07774e2b4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/model/vision/clip_vision.py:172-181 | python/mlc_llm/model/vision/siglip_vision.py:125-134 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/vision/clip_vision.py"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"370c43669b272486f180d3764e62df3e893aaa86fff86bf99d83229614f59c85"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/model/vision/image_processing.py:158-167 | python/mlc_llm/model/vision/image_processing.py:202-211 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/vision/image_processing.py"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbf32515012fab33ae91d9dd2f5b4657fd0eb203eb2f24503d3431821cc8bccc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9\u201310 lines \u00D7 2): python/mlc_llm/op/moe_matmul.py:475-483 | python/mlc_llm/op/moe_matmul.py:683-692 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/op/moe_matmul.py:475\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":475}}}],"partialFingerprints":{"codehealthFindingId/v1":"774143626ae47a506df198da62d366c439f20d9620ceba8abc35e837e801f1d5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/op/moe_matmul.py:499-508 | python/mlc_llm/op/moe_matmul.py:709-718 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/op/moe_matmul.py:499\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":499}}}],"partialFingerprints":{"codehealthFindingId/v1":"0731c1e128a3e19fe82f8e087bf0e3d5ff9c5ccad07102c8d6bdcdf5a9292807"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/op/moe_matmul.py:537-546 | python/mlc_llm/op/moe_matmul.py:747-756 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":537}}}],"partialFingerprints":{"codehealthFindingId/v1":"232906c6524f3a1116a59f448524b94530cbbc328454d237269aebd618d0ab87"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/op/moe_misc.py:572-581 | python/mlc_llm/op/moe_misc.py:584-593 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_misc.py"},"region":{"startLine":572}}}],"partialFingerprints":{"codehealthFindingId/v1":"820e2b8fbb1cefef337ebaebeb175c9af2510066d2d9862c8fe42630ac33f984"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/quantization/ft_quantization.py:397-406 | python/mlc_llm/quantization/group_quantization.py:442-451 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/ft_quantization.py"},"region":{"startLine":397}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fda2e07468c947f13c83b27a0f363fabed9a99cae68dcb8cdcc816e47ccc665"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9\u201310 lines \u00D7 2): python/mlc_llm/quantization/per_tensor_quantization.py:349-357 | python/mlc_llm/quantization/per_tensor_quantization.py:640-649 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/quantization/per_tensor_quantization.py:349\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/per_tensor_quantization.py"},"region":{"startLine":349}}}],"partialFingerprints":{"codehealthFindingId/v1":"a916fa82489caa643530a43d38c64077ad63145dd1901805309188f5d0eee5ed"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u201310 lines \u00D7 2): python/mlc_llm/serve/engine.py:1020-1027 | python/mlc_llm/serve/engine.py:1586-1595 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":1020}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9f3e6ce8025871ebb18d7f0cc9b0e78aa1b48bd04b903d1cfd9a5c1a9ed0cd7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/support/auto_target.py:208-217 | python/mlc_llm/support/auto_target.py:295-304 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/support/auto_target.py"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"39159f0cec1a963267c7a1bd9de36c0fdba1e54dd9626e08f54b73f47cfdcd0c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 10): python/mlc_llm/model/baichuan/baichuan_model.py:222-230 | python/mlc_llm/model/deepseek/deepseek_model.py:374-382 | python/mlc_llm/model/internlm/internlm_model.py:239-247 | python/mlc_llm/model/mistral/mistral_model.py:249-257 | python/mlc_llm/model/orion/orion_model.py:231-239 | python/mlc_llm/model/phi3v/phi3v_model.py:169-177 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:249-257 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:247-255 | python/mlc_llm/model/stable_lm/stablelm_model.py:234-242 | python/mlc_llm/model/starcoder2/starcoder2_model.py:254-262 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 8 separate duplicated blocks between them, totalling at least 94 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"1228815167758a44de3d9a956c64b8d6f0d819f050c3ec47c4cb2bf91f815724"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u20139 lines \u00D7 8): python/mlc_llm/model/deepseek/deepseek_model.py:257-265 | python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:537-545 | python/mlc_llm/model/internlm/internlm_model.py:141-148 | python/mlc_llm/model/minicpm/minicpm_model.py:262-269 | python/mlc_llm/model/qwen2/qwen2_model.py:164-171 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:147-154 | python/mlc_llm/model/qwen3/qwen3_model.py:195-202 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:152-159 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 and \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py\u0060 as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/deepseek/deepseek_model.py:257\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060DeepseekConfig\u0060 in one and \u0060DeepseekV2Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"90456f17e70814540378336305edab4384bfe3989608d2cdea8ab8c8a504694c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): python/mlc_llm/model/deepseek/deepseek_model.py:97-105 | python/mlc_llm/model/minicpm/minicpm_model.py:95-103 | python/mlc_llm/model/starcoder2/starcoder2_model.py:87-95 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 and \u0060python/mlc_llm/model/minicpm/minicpm_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 13 separate duplicated blocks between them, totalling at least 139 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060DeepseekConfig\u0060 in one and \u0060MiniCPMConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"8db90ac5dccef179f93d6cf0c4917aec2c838eb139ebdf7760790b689bf9929a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): python/mlc_llm/model/baichuan/baichuan_model.py:101-109 | python/mlc_llm/model/internlm/internlm_model.py:104-112 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/internlm/internlm_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 18 separate duplicated blocks between them, totalling at least 190 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"761e3d3ec1fcf101c7c0ffa954cd2f504ccce6d1d8e7c2907b893e6a67356fd9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): python/mlc_llm/model/mistral/mistral_model.py:226-234 | python/mlc_llm/model/orion/orion_model.py:209-217 \u2014 \u0060python/mlc_llm/model/mistral/mistral_model.py\u0060 and \u0060python/mlc_llm/model/orion/orion_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 20 separate duplicated blocks between them, totalling at least 187 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060MistralConfig\u0060 in one and \u0060OrionConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/mistral/mistral_model.py"},"region":{"startLine":226}}}],"partialFingerprints":{"codehealthFindingId/v1":"27a60b041cd6a20f47a27deafa56522473902a68fd047d62ace60c6797ee00b3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): python/mlc_llm/model/qwen3/qwen3_model.py:138-146 | python/mlc_llm/model/qwen35/qwen35_model.py:204-212 \u2014 \u0060python/mlc_llm/model/qwen3/qwen3_model.py\u0060 and \u0060python/mlc_llm/model/qwen35/qwen35_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen3/qwen3_model.py"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"0bd4ae14d7928979b6c0e600c7af47d7b15ad16096d23c3976a67219244608eb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): python/mlc_llm/model/rwkv5/rwkv5_model.py:73-81 | python/mlc_llm/model/rwkv6/rwkv6_model.py:73-81 \u2014 \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py\u0060 and \u0060python/mlc_llm/model/rwkv6/rwkv6_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 14 separate duplicated blocks between them, totalling at least 129 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py:73\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_model.py"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"df609ef83578ed3c495257e0dd76e50abfb383ffaf52d94fa6ed1486649e9c45"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): python/mlc_llm/model/rwkv5/rwkv5_model.py:230-238 | python/mlc_llm/model/rwkv6/rwkv6_model.py:278-286 \u2014 \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py\u0060 and \u0060python/mlc_llm/model/rwkv6/rwkv6_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 14 separate duplicated blocks between them, totalling at least 129 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py:230\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_model.py"},"region":{"startLine":230}}}],"partialFingerprints":{"codehealthFindingId/v1":"66986fab1203e4052f53bf801d33df2977c9ec6c58dfd34b19bed1723b877fd4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): python/mlc_llm/model/rwkv5/rwkv5_model.py:285-293 | python/mlc_llm/model/rwkv6/rwkv6_model.py:339-347 \u2014 \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py\u0060 and \u0060python/mlc_llm/model/rwkv6/rwkv6_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 14 separate duplicated blocks between them, totalling at least 129 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_model.py"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ad4ceec33a9cee7358e81d54128d73de8d8a0fb0a6b48b0a8c634186ede1e68"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): python/mlc_llm/model/rwkv5/rwkv5_model.py:344-352 | python/mlc_llm/model/rwkv6/rwkv6_model.py:399-407 \u2014 \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py\u0060 and \u0060python/mlc_llm/model/rwkv6/rwkv6_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 14 separate duplicated blocks between them, totalling at least 129 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_model.py"},"region":{"startLine":344}}}],"partialFingerprints":{"codehealthFindingId/v1":"a99692eecea18100428a268a8652388b5d8b9e88d8b6532ec383ecaf34265ff4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): python/mlc_llm/model/vision/clip_vision.py:153-161 | python/mlc_llm/model/vision/siglip_vision.py:110-118 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 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 \u0060config\u0060 to \u0060CLIPVisionConfig\u0060 in one and \u0060SigLIPVisionConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/vision/clip_vision.py"},"region":{"startLine":153}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c13bf9b9a0be3f4c7b3c5327494ccbc6b5c386023b785adb61fc5604bfe7c08"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): python/mlc_llm/op/cutlass.py:50-58 | python/mlc_llm/op/cutlass.py:115-123 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/cutlass.py"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"bec8fc7dc960d734eb77a4781c9909b92bdf71b442c1a4565d1eede32ef4cbc9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u20139 lines \u00D7 2): python/mlc_llm/op/cutlass.py:343-351 | python/mlc_llm/op/triton.py:699-706 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/cutlass.py"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"6aa7a085674c5a82995d8dd8358efa71874ca3cde65be079685dc4d1dc31669b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): python/mlc_llm/op/moe_matmul.py:415-423 | python/mlc_llm/op/moe_matmul.py:620-628 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/op/moe_matmul.py:630\u0060 calls \u0060pad\u0060 and \u0060python/mlc_llm/op/moe_matmul.py:425\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":415}}}],"partialFingerprints":{"codehealthFindingId/v1":"63d3183e813c9b1f7cfbc1291520b2a72b667ff3e8c5c7818f9ea71daf38a839"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): python/mlc_llm/op/moe_matmul.py:548-556 | python/mlc_llm/op/moe_matmul.py:758-766 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/op/moe_matmul.py:548\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":548}}}],"partialFingerprints":{"codehealthFindingId/v1":"51a35f52d4d03778d23c20b5d024f8a0870513ff4fe06bef0e59e748ef4fecf4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): python/mlc_llm/quantization/fp8_quantization.py:79-87 | python/mlc_llm/quantization/per_tensor_quantization.py:430-438 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 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 \u0060python/mlc_llm/quantization/fp8_quantization.py:79\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/fp8_quantization.py"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c76d5f83f0b6f6f246ec0c25129c81cce83debd430acd8ef0b26c6c7f93a4b2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 12): python/mlc_llm/model/baichuan/baichuan_model.py:114-121 | python/mlc_llm/model/gemma/gemma_model.py:105-112 | python/mlc_llm/model/internlm/internlm_model.py:117-125 | python/mlc_llm/model/internlm2/internlm2_model.py:123-130 | python/mlc_llm/model/llama/llama_model.py:109-116 | python/mlc_llm/model/ministral3/ministral3_model.py:197-204 | python/mlc_llm/model/mistral/mistral_model.py:101-108 | python/mlc_llm/model/olmo/olmo_model.py:177-184 | python/mlc_llm/model/olmo2/olmo2_model.py:183-190 | python/mlc_llm/model/orion/orion_model.py:91-98 | python/mlc_llm/model/qwen/qwen_model.py:118-125 | python/mlc_llm/model/stable_lm/stablelm_model.py:122-129 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 72 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/baichuan/baichuan_model.py:114\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060BaichuanConfig\u0060 in one and \u0060GemmaConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"90df4ecf9e1835c1fe200ae317ef35c2f4ef8da41158814c56986dba7f032037"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 11): python/mlc_llm/model/eagle/eagle_model.py:52-59 | python/mlc_llm/model/gemma/gemma_model.py:185-192 | python/mlc_llm/model/gemma2/gemma2_model.py:77-84 | python/mlc_llm/model/gemma3/gemma3_model.py:309-316 | python/mlc_llm/model/llama/llama_model.py:195-202 | python/mlc_llm/model/ministral3/ministral3_model.py:290-297 | python/mlc_llm/model/mistral/mistral_model.py:179-186 | python/mlc_llm/model/olmo/olmo_model.py:230-237 | python/mlc_llm/model/olmo2/olmo2_model.py:232-239 | python/mlc_llm/model/orion/orion_model.py:166-173 | python/mlc_llm/model/phi3/phi3_model.py:193-200 \u2014 \u0060python/mlc_llm/model/eagle/eagle_model.py\u0060 and \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 80 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/eagle/eagle_model.py"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"7cc6f08d36595bd7ad5788ae6d9a33e48f016d41cade5fa815f65b2d80a31576"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 10): python/mlc_llm/model/eagle/eagle_model.py:38-45 | python/mlc_llm/model/gemma/gemma_model.py:171-178 | python/mlc_llm/model/gemma2/gemma2_model.py:61-70 | python/mlc_llm/model/llama/llama_model.py:181-188 | python/mlc_llm/model/ministral3/ministral3_model.py:276-283 | python/mlc_llm/model/mistral/mistral_model.py:165-172 | python/mlc_llm/model/mixtral/mixtral_model.py:130-137 | python/mlc_llm/model/olmo/olmo_model.py:216-223 | python/mlc_llm/model/olmo2/olmo2_model.py:216-225 | python/mlc_llm/model/orion/orion_model.py:152-159 \u2014 \u0060python/mlc_llm/model/eagle/eagle_model.py\u0060 and \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 80 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/gemma2/gemma2_model.py:61\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060Gemma2Config\u0060 in one and \u0060OLMo2Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/eagle/eagle_model.py"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4b945428b7967a5009986055f4dc59c472697a4a10199104894817a364abc71"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 9): python/mlc_llm/model/cohere/cohere_model.py:135-142 | python/mlc_llm/model/gemma/gemma_model.py:151-158 | python/mlc_llm/model/llama/llama_model.py:162-169 | python/mlc_llm/model/mistral/mistral_model.py:144-151 | python/mlc_llm/model/nemotron/nemotron_model.py:145-152 | python/mlc_llm/model/olmo/olmo_model.py:153-160 | python/mlc_llm/model/orion/orion_model.py:133-140 | python/mlc_llm/model/phi/phi_model.py:214-221 | python/mlc_llm/model/phi3/phi3_model.py:156-163 \u2014 \u0060python/mlc_llm/model/cohere/cohere_model.py\u0060 and \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 77 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060python/mlc_llm/model/olmo/olmo_model.py:151\u0060 calls \u0060maximum\u0060, \u0060minimum\u0060 and \u0060python/mlc_llm/model/cohere/cohere_model.py:134\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/cohere/cohere_model.py"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"e112714cabe5837c887e81b3e2d700be682a1350bf204d91fb6c4972969bd739"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 6): python/mlc_llm/model/gemma/gemma_model.py:147-154 | python/mlc_llm/model/llama/llama_model.py:158-165 | python/mlc_llm/model/ministral3/ministral3_model.py:251-258 | python/mlc_llm/model/mistral/mistral_model.py:140-147 | python/mlc_llm/model/nemotron/nemotron_model.py:141-148 | python/mlc_llm/model/orion/orion_model.py:129-136 \u2014 \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 and \u0060python/mlc_llm/model/llama/llama_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 18 separate duplicated blocks between them, totalling at least 182 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/gemma/gemma_model.py:147\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma/gemma_model.py"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2b112380356fa96875877723c5226cbc7fe9f302f1cbb6050e182056d2fde28"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7\u20138 lines \u00D7 5): python/mlc_llm/model/baichuan/baichuan_model.py:152-159 | python/mlc_llm/model/qwen2/qwen2_model.py:184-190 | python/mlc_llm/model/qwen2_5_vl/qwen2_5_vl_model.py:318-324 | python/mlc_llm/model/qwen3/qwen3_model.py:216-222 | python/mlc_llm/model/stable_lm/stablelm_model.py:165-171 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/qwen2/qwen2_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 65 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/baichuan/baichuan_model.py:152\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"6dfe28c4b9ae4036555a36b188098bf90b31440e3fc2a16c62f969083732f236"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 5): python/mlc_llm/model/gpt2/gpt2_model.py:241-249 | python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py:209-217 | python/mlc_llm/model/gpt_j/gpt_j_model.py:227-235 | python/mlc_llm/model/phi/phi_model.py:343-351 | python/mlc_llm/model/qwen/qwen_model.py:224-231 \u2014 \u0060python/mlc_llm/model/gpt2/gpt2_model.py\u0060 and \u0060python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt2/gpt2_model.py"},"region":{"startLine":241}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab08225a27e829f62f0852bc312e4c35276c081b7509ea303532154893c4756f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (3\u20138 lines \u00D7 6): python/mlc_llm/model/minicpm/minicpm_model.py:158-165 | python/mlc_llm/model/phi3/phi3_model.py:114-120 | python/mlc_llm/model/qwen2/qwen2_model.py:144-150 | python/mlc_llm/model/qwen2_5_vl/qwen2_5_vl_model.py:275-281 | python/mlc_llm/model/qwen3/qwen3_model.py:175-181 | python/mlc_llm/model/qwen35/qwen35_model.py:150-152 \u2014 \u0060python/mlc_llm/model/minicpm/minicpm_model.py\u0060 and \u0060python/mlc_llm/model/phi3/phi3_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 4 separate duplicated blocks between them, totalling at least 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060MiniCPMConfig\u0060 in one and \u0060Phi3Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/model/minicpm/minicpm_model.py:165\u0060 calls \u0060Linear\u0060 and \u0060python/mlc_llm/model/qwen35/qwen35_model.py:152\u0060 does not \u2014 after which the two agree again for 5 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_model.py"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"f269e535183ee0463323440c2ec562a2f75124924f1fc39614b0cd063dec4f23"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 4): python/mlc_llm/compiler_pass/attach_logit_processor.py:109-116 | python/mlc_llm/compiler_pass/attach_logit_processor.py:152-159 | python/mlc_llm/compiler_pass/attach_logit_processor.py:196-203 | python/mlc_llm/compiler_pass/attach_logit_processor.py:234-241 \u2014 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 \u2014 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 \u0060python/mlc_llm/compiler_pass/attach_logit_processor.py:109\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060python/mlc_llm/compiler_pass/attach_logit_processor.py:151\u0060 calls \u0060dynamic\u0060 and \u0060python/mlc_llm/compiler_pass/attach_logit_processor.py:232\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_logit_processor.py"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e4c0b133dd564e297144e81ed954c274f110ffb67eb633b586d12e0fbbb575c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 4): python/mlc_llm/model/deepseek/deepseek_model.py:128-135 | python/mlc_llm/model/minicpm/minicpm_model.py:123-130 | python/mlc_llm/model/stable_lm/stablelm_model.py:110-117 | python/mlc_llm/model/starcoder2/starcoder2_model.py:118-125 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 and \u0060python/mlc_llm/model/minicpm/minicpm_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 13 separate duplicated blocks between them, totalling at least 139 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4f8920c3a0937c618c5e7fb8c0531b2552a277f26e6b53e2e801b0d42c1a266"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 4): python/mlc_llm/model/llama/llama_model.py:263-270 | python/mlc_llm/model/nemotron/nemotron_model.py:242-249 | python/mlc_llm/model/olmo/olmo_model.py:302-309 | python/mlc_llm/model/olmo2/olmo2_model.py:302-309 \u2014 \u0060python/mlc_llm/model/llama/llama_model.py\u0060 and \u0060python/mlc_llm/model/nemotron/nemotron_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 19 separate duplicated blocks between them, totalling at least 175 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060LlamaConfig\u0060 in one and \u0060NemotronConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":263}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4f50868f68089e2b4a419d27f3cd32ad82e808951d09e7dee5a7e58a516d82d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (4\u20138 lines \u00D7 5): python/mlc_llm/op/moe_matmul.py:157-164 | python/mlc_llm/op/moe_matmul.py:246-253 | python/mlc_llm/op/moe_matmul.py:269-276 | python/mlc_llm/op/moe_matmul.py:363-370 | python/mlc_llm/quantization/block_scale_quantization.py:814-817 \u2014 there are 5 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/op/moe_matmul.py:157\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/quantization/block_scale_quantization.py:817\u0060 calls \u0060remap\u0060, \u0060_dequantize\u0060, \u0060grid\u0060 and \u0060python/mlc_llm/op/moe_matmul.py:164\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":157}}}],"partialFingerprints":{"codehealthFindingId/v1":"6afe62b8d2030c33a25fca8f14c5fbe81c2c9ce53c02d3ad6ca54dfbbff8db56"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): python/mlc_llm/compiler_pass/attach_logit_processor.py:70-77 | python/mlc_llm/compiler_pass/attach_logit_processor.py:146-153 | python/mlc_llm/compiler_pass/attach_logit_processor.py:229-236 \u2014 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 \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_logit_processor.py"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"5672bf036530dd79339472a845422f19b9d4777a45e68ab3487883d9405503ad"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): python/mlc_llm/model/baichuan/baichuan_model.py:86-93 | python/mlc_llm/model/internlm/internlm_model.py:85-92 | python/mlc_llm/model/qwen/qwen_model.py:83-90 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/internlm/internlm_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 18 separate duplicated blocks between them, totalling at least 190 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060BaichuanConfig\u0060 in one and \u0060InternLMConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b8ba4d9c0a6fec9442e5743ec8cab9c6f3d4defe82853ec2ebc6452e9734d08"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): python/mlc_llm/model/phi3v/phi3v_image.py:86-93 | python/mlc_llm/model/vision/image_processing.py:102-109 | python/mlc_llm/model/vision/image_processing.py:278-285 \u2014 there are 3 copies across 2 file(s) \u2014 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 \u0060python/mlc_llm/model/phi3v/phi3v_image.py:86\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi3v/phi3v_image.py"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"d279fb19e00edcba7f2af1b18743e3673f51317e48bd7132f1d278f1f6eb06a8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): python/mlc_llm/serve/engine.py:1023-1030 | python/mlc_llm/serve/engine.py:1591-1598 | python/mlc_llm/serve/entrypoints/openai_entrypoints.py:317-324 \u2014 there are 3 copies across 2 file(s) \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":1023}}}],"partialFingerprints":{"codehealthFindingId/v1":"c74bc1408cda28d255f4baaa655e59931cdab5af3c2fbbffc81b6122673b96eb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): python/mlc_llm/model/minicpm/minicpm_loader.py:83-90 | python/mlc_llm/model/mixtral/mixtral_loader.py:63-70 \u2014 \u0060python/mlc_llm/model/minicpm/minicpm_loader.py\u0060 and \u0060python/mlc_llm/model/mixtral/mixtral_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 63 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_loader.py"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0744c3a3963d6432430f9fcdd7cb7b1b818fd4e367b2ceaa1060e48be267b45"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): python/mlc_llm/model/phi/phi_loader.py:132-139 | python/mlc_llm/model/phi3/phi3_loader.py:51-59 \u2014 \u0060python/mlc_llm/model/phi/phi_loader.py\u0060 and \u0060python/mlc_llm/model/phi3/phi3_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 33 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/phi3/phi3_loader.py:51\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi/phi_loader.py"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc3af47afe02ac2ef90087a5958fb6b2955f8e4fd03ea51dc802e6957d0aa4b9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5\u20138 lines \u00D7 3): python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:137-141 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:37-44 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:36-43 \u2014 \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py\u0060 and \u0060python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 44 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:137\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060DeepseekV2Config\u0060 in one and \u0060Qwen2MoeConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6fe981a918c4b744a1b67ca07a0ac2abb979d399883318a141d9a81066d8e9d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): python/mlc_llm/nn/rnn_state.py:186-193 | python/mlc_llm/nn/rnn_state.py:266-273 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/nn/rnn_state.py:186\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/nn/rnn_state.py"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c7cf561fcbd95331cb7bce9ec902a70c9e01697565cf2510ba63c0cb77aa8ef"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): python/mlc_llm/quantization/awq_quantization.py:63-70 | python/mlc_llm/quantization/group_quantization.py:56-63 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/awq_quantization.py"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"50e9faa1da06a8d5ed3e76c182251284d21d5fed01e6719250c967ee2313a747"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 8): python/mlc_llm/model/cohere/cohere_model.py:132-138 | python/mlc_llm/model/gemma/gemma_model.py:148-154 | python/mlc_llm/model/llama/llama_model.py:159-165 | python/mlc_llm/model/ministral3/ministral3_model.py:252-258 | python/mlc_llm/model/mistral/mistral_model.py:141-147 | python/mlc_llm/model/nemotron/nemotron_model.py:142-148 | python/mlc_llm/model/orion/orion_model.py:130-136 | python/mlc_llm/model/phi3/phi3_model.py:153-159 \u2014 \u0060python/mlc_llm/model/cohere/cohere_model.py\u0060 and \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 77 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/cohere/cohere_model.py:132\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/cohere/cohere_model.py"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"7180993f3a7ac3f4b38e162481bee98ee6393465e1486794d16affb7fbcd7336"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 5): python/mlc_llm/model/deepseek/deepseek_model.py:127-133 | python/mlc_llm/model/internlm2/internlm2_model.py:110-116 | python/mlc_llm/model/minicpm/minicpm_model.py:122-128 | python/mlc_llm/model/stable_lm/stablelm_model.py:109-115 | python/mlc_llm/model/starcoder2/starcoder2_model.py:117-123 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 and \u0060python/mlc_llm/model/internlm2/internlm2_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 86 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"e080449afe40378268236ebaf8eda390e98c32d9ed9ca3513c77297c4ccf3b5d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 5): python/mlc_llm/model/deepseek/deepseek_model.py:314-320 | python/mlc_llm/model/qwen2/qwen2_model.py:197-203 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:192-198 | python/mlc_llm/model/qwen3/qwen3_model.py:229-235 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:189-195 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 and \u0060python/mlc_llm/model/qwen2/qwen2_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 8 separate duplicated blocks between them, totalling at least 95 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":314}}}],"partialFingerprints":{"codehealthFindingId/v1":"14baa7ea331d168808fd691811b434d1fa041cf2faf3c31214a3f2651d8615a5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 5): python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:660-666 | python/mlc_llm/model/qwen2/qwen2_model.py:232-238 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:225-231 | python/mlc_llm/model/qwen3/qwen3_model.py:264-270 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:222-228 \u2014 \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py\u0060 and \u0060python/mlc_llm/model/qwen2/qwen2_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 4 separate duplicated blocks between them, totalling at least 47 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060DeepseekV2Config\u0060 in one and \u0060QWen2Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py"},"region":{"startLine":660}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2eddceab55361e95c589d43c2242106c72f4afa05d69d1e410f13f8e00af26a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 5): python/mlc_llm/model/llama/llama_model.py:149-155 | python/mlc_llm/model/ministral3/ministral3_model.py:234-240 | python/mlc_llm/model/mistral/mistral_model.py:131-137 | python/mlc_llm/model/nemotron/nemotron_model.py:132-138 | python/mlc_llm/model/orion/orion_model.py:120-126 \u2014 \u0060python/mlc_llm/model/llama/llama_model.py\u0060 and \u0060python/mlc_llm/model/ministral3/ministral3_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 15 separate duplicated blocks between them, totalling at least 148 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060LlamaConfig\u0060 in one and \u0060Ministral3Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":149}}}],"partialFingerprints":{"codehealthFindingId/v1":"d559b5866d57a79bd61b4c7ad5498f10e0f0cbec2333d0504be9aa5845d63022"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 5): python/mlc_llm/model/llama/llama_model.py:252-258 | python/mlc_llm/model/mistral/mistral_model.py:226-232 | python/mlc_llm/model/nemotron/nemotron_model.py:230-236 | python/mlc_llm/model/orion/orion_model.py:209-215 | python/mlc_llm/model/phi3/phi3_model.py:237-243 \u2014 \u0060python/mlc_llm/model/llama/llama_model.py\u0060 and \u0060python/mlc_llm/model/mistral/mistral_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 17 separate duplicated blocks between them, totalling at least 163 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060LlamaConfig\u0060 in one and \u0060MistralConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":252}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e29552aea2f7a39fa8a25b5291818848d78f10680d6a465efa633fbae71d555"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 4): python/mlc_llm/model/baichuan/baichuan_model.py:101-107 | python/mlc_llm/model/gpt_j/gpt_j_model.py:108-114 | python/mlc_llm/model/internlm/internlm_model.py:104-110 | python/mlc_llm/model/qwen/qwen_model.py:106-112 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/gpt_j/gpt_j_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 4 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"a784015a1d15cf5fe3cbd15138f3814635599b17e38647f02902bcfa2ad54119"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 4): python/mlc_llm/model/vision/image_processing.py:103-109 | python/mlc_llm/model/vision/image_processing.py:158-164 | python/mlc_llm/model/vision/image_processing.py:202-208 | python/mlc_llm/model/vision/image_processing.py:279-285 \u2014 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 \u2014 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 \u0060python/mlc_llm/model/vision/image_processing.py:103\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/vision/image_processing.py"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"22155a13f37b4bd4ee9e0c28289bffae731ea3d8d5305a72d1ee33e70e5787ac"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): python/mlc_llm/model/qwen35/qwen35_model.py:300-306 | python/mlc_llm/model/qwen35/qwen35_model.py:312-318 | python/mlc_llm/model/qwen35/qwen35_model.py:336-342 \u2014 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 \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen35/qwen35_model.py"},"region":{"startLine":300}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9c2d10a9b29b10e435be7fd09d37a80c40b499faebd24452508ade20c5a9c6f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): python/mlc_llm/compiler_pass/attach_logit_processor.py:219-225 | python/mlc_llm/compiler_pass/attach_logit_processor.py:260-266 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/compiler_pass/attach_logit_processor.py:219\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_logit_processor.py"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"03e4ff11bba4b38c0ccac5e8b57a0ca525b9b85d0328916c7f42c6de3dcc2513"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): python/mlc_llm/model/chatglm3/chatglm3_model.py:121-127 | python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py:118-125 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/chatglm3/chatglm3_model.py"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"b741c163cf35cbbbb4978b9b27b5866441d4263ff869155c1b39b092de382c6c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): python/mlc_llm/model/deepseek/deepseek_model.py:195-201 | python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py:434-440 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 and \u0060python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py\u0060 as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"a31ca19742b24aaadb92393f360f32c08e55e3b9535298ecef9847f8623fc8ac"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): python/mlc_llm/model/gemma3/gemma3_model.py:387-393 | python/mlc_llm/model/gemma3/gemma3v_model.py:135-141 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/gemma3/gemma3_model.py\u0060 and \u0060python/mlc_llm/model/gemma3/gemma3v_model.py\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Note what the matched lines are: every one of them assigns one field to another, so the block is a hand-written mapper between two data shapes rather than behaviour with a helper inside it. Extracting one shared function only works if both sites map the SAME pair of types in the same direction \u2014 check that first, because inverse or differently-typed mappers have no single function they can both call. Where they do not, the moves that exist are a generated or reflective mapper, a common embedded/base type the fields live on once, or accepting the run and covering it with a test that fails when a field is added to one side only. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060Gemma3Config\u0060 in one and \u0060Gemma3VConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma3/gemma3_model.py"},"region":{"startLine":387}}}],"partialFingerprints":{"codehealthFindingId/v1":"12fb1c1711f18eaafe3d63f2128e34faf2d70616fff83001b2890b65505d8a15"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): python/mlc_llm/model/internlm2/internlm2_model.py:215-221 | python/mlc_llm/model/stable_lm/stablelm_model.py:211-217 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/internlm2/internlm2_model.py\u0060 and \u0060python/mlc_llm/model/stable_lm/stablelm_model.py\u0060 as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060InternLM2Config\u0060 in one and \u0060StableLmConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/internlm2/internlm2_model.py"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ae0352ea3d50afc5835718c8405ed0bce550ce7f549046d7ffbb7d5cb4a7b22"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): python/mlc_llm/model/rwkv5/rwkv5_model.py:122-128 | python/mlc_llm/model/rwkv6/rwkv6_model.py:122-128 \u2014 \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py\u0060 and \u0060python/mlc_llm/model/rwkv6/rwkv6_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 14 separate duplicated blocks between them, totalling at least 129 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_model.py"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"154a989cb84ab4f5d3bcb0720ecb940b05ce9c75b173b98a182a39b05f0f5d88"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): python/mlc_llm/op/moe_matmul.py:49-55 | python/mlc_llm/op/moe_matmul.py:147-153 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/op/moe_matmul.py:49\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/op/moe_matmul.py:154\u0060 calls \u0060Tensor\u0060 and \u0060python/mlc_llm/op/moe_matmul.py:56\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"56e7f71350786f3ef30a5c96ab974252b77164af092e40d9c05c06f53f19de92"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): python/mlc_llm/op/moe_matmul.py:458-464 | python/mlc_llm/op/moe_matmul.py:665-671 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":458}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbca928e06e0607c8370d11b175d00474ee86833a775961a53b9c91697dd1e0c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): python/mlc_llm/op/triton.py:315-321 | python/mlc_llm/op/triton.py:422-428 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/op/triton.py:315\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060python/mlc_llm/op/triton.py:421\u0060 calls \u0060Tensor\u0060 and \u0060python/mlc_llm/op/triton.py:315\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/triton.py"},"region":{"startLine":315}}}],"partialFingerprints":{"codehealthFindingId/v1":"98be761d730f00512e2b103ac8b1e5e329f3b5a522ca857c7978f419bfca97b1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6\u20137 lines \u00D7 2): python/mlc_llm/quantization/group_quantization.py:517-522 | python/mlc_llm/quantization/per_tensor_quantization.py:573-579 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 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 \u0060python/mlc_llm/quantization/group_quantization.py:517\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/group_quantization.py"},"region":{"startLine":517}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b9298860cd500eee25e02d41d36318eb184ddeaf596ecf3ab1cf9071c9cfd45"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 3): python/mlc_llm/model/phi/phi_loader.py:134-139 | python/mlc_llm/model/phi3/phi3_loader.py:53-60 | python/mlc_llm/model/phi3v/phi3v_loader.py:55-62 \u2014 \u0060python/mlc_llm/model/phi/phi_loader.py\u0060 and \u0060python/mlc_llm/model/phi3/phi3_loader.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 3 separate duplicated blocks between them, totalling at least 33 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/phi3/phi3_loader.py:53\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi/phi_loader.py"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"48071b5d7aadf9fc043a9cc9f8e6308e61c489ce851e4fb479c4f54138bb4320"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): python/mlc_llm/compiler_pass/lift_global_buffer_alloc.py:166-171 | python/mlc_llm/compiler_pass/lift_global_buffer_alloc.py:180-185 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060v_l\u0060 to \u0060buffer_shape) == len(arg_shape) for\u0060 in one and \u0060buffer_shape) == len(ret_tensor_shape) for\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/lift_global_buffer_alloc.py"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb07684be36badc0de0ffa5d44bd9092f4aa5375bf8dd65ebe6f01de2c8b5afa"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): python/mlc_llm/model/deepseek/deepseek_model.py:279-284 | python/mlc_llm/model/minicpm/minicpm_model.py:275-280 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 and \u0060python/mlc_llm/model/minicpm/minicpm_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 13 separate duplicated blocks between them, totalling at least 139 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":279}}}],"partialFingerprints":{"codehealthFindingId/v1":"8075ceec2b8158fa45dbf63bb86d343e6df14f7f43f8ee76daac27a690d6a172"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): python/mlc_llm/model/deepseek/deepseek_model.py:351-356 | python/mlc_llm/model/starcoder2/starcoder2_model.py:231-236 \u2014 \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 and \u0060python/mlc_llm/model/starcoder2/starcoder2_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 13 separate duplicated blocks between them, totalling at least 135 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060DeepseekConfig\u0060 in one and \u0060Starcoder2Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e10e1640876b07c498a904b9bf0968e8ae0d617b5e1326a7b1e8cbc72c92170"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): python/mlc_llm/model/minicpm/minicpm_model.py:345-350 | python/mlc_llm/model/starcoder2/starcoder2_model.py:231-236 \u2014 \u0060python/mlc_llm/model/minicpm/minicpm_model.py\u0060 and \u0060python/mlc_llm/model/starcoder2/starcoder2_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 11 separate duplicated blocks between them, totalling at least 123 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060MiniCPMConfig\u0060 in one and \u0060Starcoder2Config\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_model.py"},"region":{"startLine":345}}}],"partialFingerprints":{"codehealthFindingId/v1":"7eae4c8cfeaf06dadabe797f2000a94035ff8d9f18c129b0e33fb657a989b60a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (4\u20136 lines \u00D7 3): python/mlc_llm/model/cohere/cohere_model.py:78-81 | python/mlc_llm/model/phi3/phi3_model.py:92-97 | python/mlc_llm/model/phi3v/phi3v_model.py:119-124 \u2014 \u0060python/mlc_llm/model/cohere/cohere_model.py\u0060 and \u0060python/mlc_llm/model/phi3/phi3_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 76 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/cohere/cohere_model.py"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"938cafab05968f4a6b8de6f60f5d0bb2c458ebd61aacb2c3ec9671fd1768f532"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): python/mlc_llm/nn/rnn_state.py:209-214 | python/mlc_llm/nn/rnn_state.py:290-295 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/nn/rnn_state.py:209\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/nn/rnn_state.py"},"region":{"startLine":209}}}],"partialFingerprints":{"codehealthFindingId/v1":"58b2c6ce04976ae01ab0e69db7aa1318846adb7fa2e6c3583b74ede431603ee2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): python/mlc_llm/op/moe_matmul.py:236-241 | python/mlc_llm/op/moe_matmul.py:350-355 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/op/moe_matmul.py:236\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":236}}}],"partialFingerprints":{"codehealthFindingId/v1":"3cce046d4f8d3db917b85819825ae8ecd0bef688507cfa6cc88e9126e01eaeec"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 7): python/mlc_llm/op/moe_matmul.py:58-62 | python/mlc_llm/op/moe_matmul.py:157-161 | python/mlc_llm/op/moe_matmul.py:246-250 | python/mlc_llm/op/moe_matmul.py:269-273 | python/mlc_llm/op/moe_matmul.py:363-367 | python/mlc_llm/op/moe_matmul.py:433-438 | python/mlc_llm/op/moe_matmul.py:641-645 \u2014 all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 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 \u0060python/mlc_llm/op/moe_matmul.py:58\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060python/mlc_llm/op/moe_matmul.py:243\u0060 calls \u0060Tensor\u0060 and \u0060python/mlc_llm/op/moe_matmul.py:55\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a894a65c8374f87ef055e54d48d9f8253c8b83b5c5864c0fc60563f122caac8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 6): python/mlc_llm/model/baichuan/baichuan_model.py:138-142 | python/mlc_llm/model/gemma/gemma_model.py:168-172 | python/mlc_llm/model/llama/llama_model.py:178-182 | python/mlc_llm/model/ministral3/ministral3_model.py:273-277 | python/mlc_llm/model/mistral/mistral_model.py:162-166 | python/mlc_llm/model/mixtral/mixtral_model.py:127-131 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 72 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060config\u0060 to \u0060BaichuanConfig\u0060 in one and \u0060GemmaConfig\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"65f6c5a78842afdc9e1e8b94d05d786fbc7abeb65060d3dd17a3a3f6e1cd2748"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 5): python/mlc_llm/model/qwen35/qwen35_model.py:293-297 | python/mlc_llm/model/qwen35/qwen35_model.py:329-333 | python/mlc_llm/model/qwen35/qwen35_model.py:348-352 | python/mlc_llm/model/rwkv5/rwkv5_model.py:99-103 | python/mlc_llm/model/rwkv6/rwkv6_model.py:99-103 \u2014 \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py\u0060 and \u0060python/mlc_llm/model/rwkv6/rwkv6_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 14 separate duplicated blocks between them, totalling at least 129 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen35/qwen35_model.py"},"region":{"startLine":293}}}],"partialFingerprints":{"codehealthFindingId/v1":"0edba329dbc0a21751e828ebad38b8b469cda1edc1ee60a3ad43dcf04fab22ca"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 4): python/mlc_llm/compiler_pass/attach_logit_processor.py:97-101 | python/mlc_llm/compiler_pass/attach_logit_processor.py:175-179 | python/mlc_llm/op/moe_misc.py:103-107 | python/mlc_llm/op/moe_misc.py:192-196 \u2014 there are 4 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/compiler_pass/attach_logit_processor.py:97\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_logit_processor.py"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff672a6776c5f28d9f5382478a22db031e715aad75a084e18d8845b4026a18e5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): python/mlc_llm/cli/serve.py:66-71 | python/mlc_llm/interface/compiler_flags.py:171-175 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/serve.py"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"515860d0348bfdf0f0d09db6321c2d692ea2db7d05dc6c1fd2974b915ceffaee"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): python/mlc_llm/compiler_pass/attach_logit_processor.py:138-142 | python/mlc_llm/compiler_pass/attach_logit_processor.py:186-192 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/compiler_pass/attach_logit_processor.py:138\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_logit_processor.py"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab06a71a6c28017ec8a8852999334ebc05c82a7e57ac6a2e87cae2bdda3ae7f3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (4\u20135 lines \u00D7 5): python/mlc_llm/compiler_pass/attach_sampler.py:72-75 | python/mlc_llm/compiler_pass/attach_sampler.py:157-161 | python/mlc_llm/compiler_pass/attach_sampler.py:307-313 | python/mlc_llm/compiler_pass/attach_sampler.py:347-350 | python/mlc_llm/compiler_pass/attach_sampler.py:352-356 \u2014 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 \u2014 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 \u0060python/mlc_llm/compiler_pass/attach_sampler.py:352\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/compiler_pass/attach_sampler.py:350\u0060 calls \u0060Var\u0060, \u0060TensorType\u0060 and \u0060python/mlc_llm/compiler_pass/attach_sampler.py:356\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_sampler.py"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"29d656477159ebebd17c2d3cde6ffc7c2b6d9690bd2ec8862e1e209b2e1f346c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): python/mlc_llm/compiler_pass/attach_softmax_with_temperature.py:132-136 | python/mlc_llm/compiler_pass/attach_softmax_with_temperature.py:190-194 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/compiler_pass/attach_softmax_with_temperature.py:132\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_softmax_with_temperature.py"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"b07e69850fdf176e006f96093cff66be52944a55e00bd13c01ec11afdc58c584"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): python/mlc_llm/contrib/embeddings/openai.py:124-128 | python/mlc_llm/contrib/embeddings/openai.py:158-162 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/contrib/embeddings/openai.py"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"4386acbc6494181f17689fdc45101281ec31af0c713c4f1fef3d91cbedbf3ef8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): python/mlc_llm/model/gemma3/gemma3v_model.py:273-277 | python/mlc_llm/model/qwen35/qwen35v_model.py:162-166 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/gemma3/gemma3v_model.py\u0060 and \u0060python/mlc_llm/model/qwen35/qwen35v_model.py\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma3/gemma3v_model.py"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"a319c06e92cf30dbc4f409ab1a5c61ee85402e18c03657909f5e50cf4b204675"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): python/mlc_llm/model/phi3v/phi3v_image.py:73-77 | python/mlc_llm/model/vision/image_processing.py:24-28 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi3v/phi3v_image.py"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"08b57f1f6b1dbe154562a3a296ea4ad4766693816d162225f47680146f2fec07"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): python/mlc_llm/model/phi3v/phi3v_image.py:137-141 | python/mlc_llm/model/vision/image_processing.py:167-171 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060python/mlc_llm/model/phi3v/phi3v_image.py:137\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060python/mlc_llm/model/phi3v/phi3v_image.py:136\u0060 calls \u0060Tensor\u0060 and \u0060python/mlc_llm/model/vision/image_processing.py:166\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi3v/phi3v_image.py"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"24230ca02191687cc381cc83a2dbadf294b8a76c020ec3092625744bc360c256"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 3): python/mlc_llm/model/qwen35/qwen35_model.py:266-270 | python/mlc_llm/model/rwkv5/rwkv5_model.py:84-88 | python/mlc_llm/model/rwkv6/rwkv6_model.py:84-88 \u2014 \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py\u0060 and \u0060python/mlc_llm/model/rwkv6/rwkv6_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 14 separate duplicated blocks between them, totalling at least 129 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060python/mlc_llm/model/qwen35/qwen35_model.py:266\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py:89\u0060 calls \u0060func_attr\u0060 and \u0060python/mlc_llm/model/qwen35/qwen35_model.py:270\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen35/qwen35_model.py"},"region":{"startLine":266}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c3a9eb1f6f7ff455b9185bcea7646757fd07337b5bd73c41f7fd114bb8e0a88"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): python/mlc_llm/op/moe_matmul.py:52-56 | python/mlc_llm/op/moe_matmul.py:263-267 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/op/moe_matmul.py:52\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"a546490dc9712d19dec86ca9d96f243c26fd23c9f91bb47423e5243c953c607f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): python/mlc_llm/quantization/ft_quantization.py:201-205 | python/mlc_llm/quantization/group_quantization.py:216-220 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/ft_quantization.py"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c2d196bd560963aec12a4106fd24bcda3d988557d04444c18576e3747680adc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): python/mlc_llm/compiler_pass/fuse_dequantize_transpose.py:30-36 | python/mlc_llm/compiler_pass/scatter_tuple_get_item.py:30-36 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/fuse_dequantize_transpose.py"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"e77dd6753d9828453ca94ba8fe49718f3c9e310590bfe9bf3cc03243b0ae6020"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): python/mlc_llm/contrib/embeddings/embeddings.py:30-37 | python/mlc_llm/testing/debug_chat.py:37-44 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/contrib/embeddings/embeddings.py"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"35cdad9c4b32b5aab2c4e04446029d09a0e1c8fcd4a7b4bba3f11b0154b6ddc3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 4): python/mlc_llm/contrib/embeddings/embeddings.py:65-76 | python/mlc_llm/contrib/embeddings/embeddings.py:79-90 | python/mlc_llm/testing/debug_chat.py:72-83 | python/mlc_llm/testing/debug_chat.py:86-97 \u2014 there are 4 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/contrib/embeddings/embeddings.py"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"14291a4503211b2a12d6d7078490ca8794ff81cd40c1aa191c1d08a0221217d1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 11): python/mlc_llm/model/baichuan/baichuan_model.py:168-172 | python/mlc_llm/model/gemma/gemma_model.py:195-199 | python/mlc_llm/model/internlm/internlm_model.py:186-190 | python/mlc_llm/model/llama/llama_model.py:205-209 | python/mlc_llm/model/ministral3/ministral3_model.py:300-304 | python/mlc_llm/model/mistral/mistral_model.py:189-193 | python/mlc_llm/model/nemotron/nemotron_model.py:183-187 | python/mlc_llm/model/olmo/olmo_model.py:245-249 | python/mlc_llm/model/orion/orion_model.py:176-180 | python/mlc_llm/model/stable_lm/stablelm_model.py:178-182 | python/mlc_llm/model/starcoder2/starcoder2_model.py:199-203 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 72 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd9b90ce0656cf8dbcd423a3d8abb8ad0459f5c3776c470c7523d0a37e79c58b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 15): python/mlc_llm/model/baichuan/baichuan_model.py:190-194 | python/mlc_llm/model/cohere/cohere_model.py:229-233 | python/mlc_llm/model/deepseek/deepseek_model.py:341-345 | python/mlc_llm/model/internlm/internlm_model.py:207-211 | python/mlc_llm/model/internlm2/internlm2_model.py:204-208 | python/mlc_llm/model/minicpm/minicpm_model.py:333-337 | python/mlc_llm/model/ministral3/ministral3_model.py:326-330 | python/mlc_llm/model/mistral/mistral_model.py:214-218 | python/mlc_llm/model/orion/orion_model.py:199-203 | python/mlc_llm/model/qwen2/qwen2_model.py:220-224 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:215-219 | python/mlc_llm/model/qwen3/qwen3_model.py:252-256 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:212-216 | python/mlc_llm/model/stable_lm/stablelm_model.py:200-204 | python/mlc_llm/model/starcoder2/starcoder2_model.py:221-225 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 8 separate duplicated blocks between them, totalling at least 94 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"018e40f4efec3be39e0d6dd368a0a07fc6542aaf4f01835da713fdeb03068705"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 10): python/mlc_llm/model/baichuan/baichuan_model.py:238-245 | python/mlc_llm/model/deepseek/deepseek_model.py:390-398 | python/mlc_llm/model/internlm/internlm_model.py:255-262 | python/mlc_llm/model/mistral/mistral_model.py:265-272 | python/mlc_llm/model/orion/orion_model.py:247-254 | python/mlc_llm/model/phi3v/phi3v_model.py:180-189 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:265-272 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:263-270 | python/mlc_llm/model/stable_lm/stablelm_model.py:250-257 | python/mlc_llm/model/starcoder2/starcoder2_model.py:270-277 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 8 separate duplicated blocks between them, totalling at least 94 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":238}}}],"partialFingerprints":{"codehealthFindingId/v1":"9739ecf85b8c1423c6c01f59558dd83522bcc1b46bb0416c4ee44609df43511f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 10): python/mlc_llm/model/baichuan/baichuan_model.py:248-254 | python/mlc_llm/model/deepseek/deepseek_model.py:401-407 | python/mlc_llm/model/internlm/internlm_model.py:265-271 | python/mlc_llm/model/mistral/mistral_model.py:275-281 | python/mlc_llm/model/orion/orion_model.py:257-263 | python/mlc_llm/model/phi3v/phi3v_model.py:192-198 | python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py:275-281 | python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py:273-279 | python/mlc_llm/model/stable_lm/stablelm_model.py:260-266 | python/mlc_llm/model/starcoder2/starcoder2_model.py:280-286 \u2014 \u0060python/mlc_llm/model/baichuan/baichuan_model.py\u0060 and \u0060python/mlc_llm/model/deepseek/deepseek_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 8 separate duplicated blocks between them, totalling at least 94 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":248}}}],"partialFingerprints":{"codehealthFindingId/v1":"f926d010d311e5898fb09706c90a71cfba6f50e72637fec981bf6f33862de302"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): python/mlc_llm/model/gemma/gemma_model.py:256-262 | python/mlc_llm/model/gemma3/gemma3_model.py:415-421 \u2014 \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 and \u0060python/mlc_llm/model/gemma3/gemma3_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 87 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma/gemma_model.py"},"region":{"startLine":256}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a2495656245b9ff6113889fa60e7d251e0a18667ea9ce514f56ad722f824ad3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 7): python/mlc_llm/model/gemma/gemma_model.py:270-275 | python/mlc_llm/model/gemma3/gemma3_model.py:429-434 | python/mlc_llm/model/llama/llama_model.py:335-340 | python/mlc_llm/model/llama4/llama4_model.py:615-620 | python/mlc_llm/model/nemotron/nemotron_model.py:314-319 | python/mlc_llm/model/olmo/olmo_model.py:370-375 | python/mlc_llm/model/olmo2/olmo2_model.py:370-375 \u2014 \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 and \u0060python/mlc_llm/model/gemma3/gemma3_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 7 separate duplicated blocks between them, totalling at least 87 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma/gemma_model.py"},"region":{"startLine":270}}}],"partialFingerprints":{"codehealthFindingId/v1":"36cd42b079632e252153b13b6dcc73f8feecd97654962436bed5b1aea53b8640"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): python/mlc_llm/model/gemma3/gemma3_model.py:592-598 | python/mlc_llm/model/gemma3/gemma3v_model.py:259-265 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/gemma3/gemma3_model.py\u0060 and \u0060python/mlc_llm/model/gemma3/gemma3v_model.py\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma3/gemma3_model.py"},"region":{"startLine":592}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8c481d50f17dad3877607c571d7f131d1156822f6d1592e6208321d5f149e11"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 3): python/mlc_llm/model/gemma3/gemma3v_model.py:460-473 | python/mlc_llm/model/llava/llava_model.py:379-392 | python/mlc_llm/model/qwen35/qwen35v_model.py:358-372 \u2014 before extracting anything, compare \u0060python/mlc_llm/model/gemma3/gemma3v_model.py\u0060 and \u0060python/mlc_llm/model/qwen35/qwen35v_model.py\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma3/gemma3v_model.py"},"region":{"startLine":460}}}],"partialFingerprints":{"codehealthFindingId/v1":"21a9ae67b04274e259c6a44212273a869e15f2a0d9d844117257ce45c2e4ae77"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): python/mlc_llm/model/gpt2/gpt2_model.py:208-216 | python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py:174-183 \u2014 \u0060python/mlc_llm/model/gpt2/gpt2_model.py\u0060 and \u0060python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt2/gpt2_model.py"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"a372e01b6fe0f6f14174ba0b8ebcf645a91a4c38bacc70ff0b4e86192ed46eef"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 5): python/mlc_llm/model/gpt2/gpt2_model.py:257-264 | python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py:225-232 | python/mlc_llm/model/gpt_j/gpt_j_model.py:243-250 | python/mlc_llm/model/phi/phi_model.py:354-363 | python/mlc_llm/model/qwen/qwen_model.py:239-246 \u2014 \u0060python/mlc_llm/model/gpt2/gpt2_model.py\u0060 and \u0060python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt2/gpt2_model.py"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3aa23378d0394977e7a26eee7828d8cfed9196a87d3bfc5ddeef2fbf6591f5c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 5): python/mlc_llm/model/gpt2/gpt2_model.py:267-273 | python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py:235-241 | python/mlc_llm/model/gpt_j/gpt_j_model.py:253-259 | python/mlc_llm/model/phi/phi_model.py:366-372 | python/mlc_llm/model/qwen/qwen_model.py:249-255 \u2014 \u0060python/mlc_llm/model/gpt2/gpt2_model.py\u0060 and \u0060python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 5 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt2/gpt2_model.py"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"55abc40a71a09654689365a3eb2ae92e60bd90e3548035aebecfc8b7d35740aa"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): python/mlc_llm/model/gpt_j/gpt_j_model.py:193-197 | python/mlc_llm/model/qwen/qwen_model.py:193-197 \u2014 \u0060python/mlc_llm/model/gpt_j/gpt_j_model.py\u0060 and \u0060python/mlc_llm/model/qwen/qwen_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 9 separate duplicated blocks between them, totalling at least 94 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt_j/gpt_j_model.py"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0f3d89badbc19d90a82733c13eeb41e8cabf13375b9e436edcbffac24bdb968"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 4): python/mlc_llm/model/llama/llama_model.py:238-244 | python/mlc_llm/model/nemotron/nemotron_model.py:216-222 | python/mlc_llm/model/olmo/olmo_model.py:277-283 | python/mlc_llm/model/olmo2/olmo2_model.py:277-283 \u2014 \u0060python/mlc_llm/model/llama/llama_model.py\u0060 and \u0060python/mlc_llm/model/nemotron/nemotron_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 19 separate duplicated blocks between them, totalling at least 175 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":238}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ff8766db2de345a7a16f9f454f63d6786c80f8f200dcf1423d70ecafc39ab53"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 5): python/mlc_llm/model/llama/llama_model.py:293-300 | python/mlc_llm/model/llama4/llama4_model.py:573-580 | python/mlc_llm/model/nemotron/nemotron_model.py:272-279 | python/mlc_llm/model/olmo/olmo_model.py:330-336 | python/mlc_llm/model/olmo2/olmo2_model.py:330-336 \u2014 \u0060python/mlc_llm/model/llama/llama_model.py\u0060 and \u0060python/mlc_llm/model/llama4/llama4_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 8 separate duplicated blocks between them, totalling at least 76 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":293}}}],"partialFingerprints":{"codehealthFindingId/v1":"24829189909bccf7251fe9067cc811c9673af4bb433f6996d39231bbc5d4b683"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 5): python/mlc_llm/model/llama/llama_model.py:318-325 | python/mlc_llm/model/llama4/llama4_model.py:598-605 | python/mlc_llm/model/nemotron/nemotron_model.py:297-304 | python/mlc_llm/model/olmo/olmo_model.py:353-360 | python/mlc_llm/model/olmo2/olmo2_model.py:353-360 \u2014 \u0060python/mlc_llm/model/llama/llama_model.py\u0060 and \u0060python/mlc_llm/model/llama4/llama4_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 8 separate duplicated blocks between them, totalling at least 76 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":318}}}],"partialFingerprints":{"codehealthFindingId/v1":"e50d8e7beb837b839963effa9a72468f1a7ed216d5d91a46d36f20e9f34bee35"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 5): python/mlc_llm/model/llama/llama_model.py:328-332 | python/mlc_llm/model/llama4/llama4_model.py:608-612 | python/mlc_llm/model/nemotron/nemotron_model.py:307-311 | python/mlc_llm/model/olmo/olmo_model.py:363-367 | python/mlc_llm/model/olmo2/olmo2_model.py:363-367 \u2014 \u0060python/mlc_llm/model/llama/llama_model.py\u0060 and \u0060python/mlc_llm/model/llama4/llama4_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 8 separate duplicated blocks between them, totalling at least 76 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":328}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8cf1ec69631119e15b9b95d8a142392809a55a83a9718891af19943d85c7c33"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): python/mlc_llm/model/rwkv5/rwkv5_model.py:311-315 | python/mlc_llm/model/rwkv6/rwkv6_model.py:365-369 \u2014 \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py\u0060 and \u0060python/mlc_llm/model/rwkv6/rwkv6_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 14 separate duplicated blocks between them, totalling at least 129 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_model.py"},"region":{"startLine":311}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ba12155d448e1994d8b9ff6d737b4f551d76beb7b0f9c6bd661c37dd6f502db"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): python/mlc_llm/compiler_pass/fuse_add_norm.py:71-75 | python/mlc_llm/compiler_pass/fuse_add_norm.py:139-143 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/fuse_add_norm.py"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"a28b23240df3ff83b4002e8dba821fb9d458d7d192fdeace6ce5ee39c1d6f013"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): python/mlc_llm/interface/compile.py:49-53 | python/mlc_llm/interface/convert_weight.py:56-60 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/interface/compile.py:56\u0060 calls \u0060bold\u0060 and \u0060python/mlc_llm/interface/convert_weight.py:63\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/compile.py"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"db705997b0922cc9c5f62b78012557be1f4b487e75e80a3ff3dbbcee3c1aa095"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): python/mlc_llm/model/gemma3/gemma3_model.py:253-258 | python/mlc_llm/model/llama4/llama4_model.py:269-274 \u2014 \u0060python/mlc_llm/model/gemma3/gemma3_model.py\u0060 and \u0060python/mlc_llm/model/llama4/llama4_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 66 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma3/gemma3_model.py"},"region":{"startLine":253}}}],"partialFingerprints":{"codehealthFindingId/v1":"e999db07a0487d2f6543b96596f6bbe83853235d9543c70158ef13f88590a0b7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): python/mlc_llm/model/rwkv5/rwkv5_model.py:133-138 | python/mlc_llm/model/rwkv6/rwkv6_model.py:132-137 \u2014 \u0060python/mlc_llm/model/rwkv5/rwkv5_model.py\u0060 and \u0060python/mlc_llm/model/rwkv6/rwkv6_model.py\u0060 are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 14 separate duplicated blocks between them, totalling at least 129 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_model.py"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"87df00829c633f5a711216980990076318e8b60c5a8a0e17941351bec5ba6fc6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 5): python/mlc_llm/op/moe_matmul.py:65-69 | python/mlc_llm/op/moe_matmul.py:167-171 | python/mlc_llm/op/moe_matmul.py:256-260 | python/mlc_llm/op/moe_matmul.py:279-283 | python/mlc_llm/op/moe_matmul.py:373-377 \u2014 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 \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"65a0d9cf972caabaf03b46c24df099dd59be6d9fffd7d69b0b5f5a3f5d6978e8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): python/mlc_llm/op/moe_matmul.py:134-139 | python/mlc_llm/op/moe_matmul.py:613-618 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/op/moe_matmul.py:134\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea7a7841a1b8b11637c1837db24b9ba47b15d3e04235b7490d723df913b4ae17"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): python/mlc_llm/op/moe_misc.py:95-100 | python/mlc_llm/op/moe_misc.py:182-187 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/op/moe_misc.py:95\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/op/moe_misc.py:188\u0060 calls \u0060sblock_alloc_tensor\u0060 and \u0060python/mlc_llm/op/moe_misc.py:101\u0060 does not \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_misc.py"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ebf89a751da3d286dae00382711f4d933a6923dcdd7a4a6b567f6c97bda48c0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): python/mlc_llm/serve/engine.py:1011-1015 | python/mlc_llm/serve/engine.py:1581-1585 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine.py"},"region":{"startLine":1011}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b870f003882b50ef5a9583cb3d9cf8452ff684b249a8d7963135b2a238908e7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (24 lines \u00D7 2): android/MLCChat/app/src/main/java/ai/mlc/mlcchat/ui/theme/Theme.kt:84-107 | android/MLCEngineExample/app/src/main/java/ai/mlc/mlcengineexample/ui/theme/Theme.kt:84-107 \u2014 before extracting anything, compare \u0060android/MLCChat/app/src/main/java/ai/mlc/mlcchat/ui/theme/Theme.kt\u0060 and \u0060android/MLCEngineExample/app/src/main/java/ai/mlc/mlcengineexample/ui/theme/Theme.kt\u0060 as WHOLE FILES: 97% of the shorter file\u0027s 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 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it \u2014 treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCChat/app/src/main/java/ai/mlc/mlcchat/ui/theme/Theme.kt"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5ca3a744658ef1ea3c71b92fed2a4c309ca1647c1ec2f4b1059935f437a5417"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): ios/MLCSwift/Sources/Swift/LLMEngine.swift:116-133 | ios/MLCSwift/Sources/Swift/OpenAIProtocol.swift:251-268 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCSwift/Sources/Swift/LLMEngine.swift"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c09ce9b284cf7345697622a5078b17b63af3d71dcf23479432d39024c79b059"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): ios/MLCChat/MLCChat/States/AppState.swift:75-83 | ios/MLCChat/MLCChat/States/AppState.swift:98-107 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060ios/MLCChat/MLCChat/States/AppState.swift:75\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCChat/MLCChat/States/AppState.swift"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"347f6f3d9f52d085a036aba4adcd8eb2589f128885c5e80184dad556a94aebb9"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (44 shared lines): python/mlc_llm/bench/api_endpoint.py:67-177 | python/mlc_llm/bench/api_endpoint.py:216-307 \u2014 These two members are variants of one another: 44 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\u0027 grain \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/api_endpoint.py"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"dae8b3664472b53312d2543069576fa158382e9d79641e4a3fd7b8b16ca81d01"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (52 lines \u00D7 2): python/mlc_llm/bench/dataset.py:116-167 | python/mlc_llm/bench/dataset.py:651-702 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/dataset.py"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"65c6148ad67555030c5f69391901364f7293981679bf780e5eded0f3d503b399"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 2): python/mlc_llm/bench/dataset.py:67-87 | python/mlc_llm/bench/dataset.py:608-628 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/dataset.py"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"b21a2d1d77b9e4dcf0b254adc663d1edfda1c76cb41bd7f10ed149234101106c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 3): python/mlc_llm/bench/api_endpoint.py:153-172 | python/mlc_llm/bench/api_endpoint.py:283-302 | python/mlc_llm/bench/api_endpoint.py:396-415 \u2014 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 \u2014 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 \u0060python/mlc_llm/bench/api_endpoint.py:153\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/api_endpoint.py"},"region":{"startLine":153}}}],"partialFingerprints":{"codehealthFindingId/v1":"fcc9c59983694f3d310cc48128cfc74d4b0041fe0a895a96b0d253f69f7c0ae2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): python/mlc_llm/compiler_pass/attach_spec_decode_aux_funcs.py:41-54 | python/mlc_llm/compiler_pass/attach_spec_decode_aux_funcs.py:61-74 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_spec_decode_aux_funcs.py"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6d8f4494b1b4e429ce9b40a1f6b0a6201a6d3a7604f2c992e6b7a068abfaca5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): python/mlc_llm/bench/api_endpoint.py:139-151 | python/mlc_llm/bench/api_endpoint.py:269-281 | python/mlc_llm/bench/api_endpoint.py:383-395 \u2014 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 \u2014 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 \u0060python/mlc_llm/bench/api_endpoint.py:139\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/api_endpoint.py"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f2099b7aeb86cd952c30d332c4e46deb157252816fee8b5c0975c1e6bb50ee6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): python/mlc_llm/bench/api_endpoint.py:46-55 | python/mlc_llm/bench/api_endpoint.py:191-200 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/api_endpoint.py"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6acbc9474ade694422faf0b4cef47dee82def13e506547c84c68777f96eefb9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): python/mlc_llm/bench/evaluation/gsm8k.py:168-176 | python/mlc_llm/bench/evaluation/mmlu.py:82-90 \u2014 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 \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/evaluation/gsm8k.py"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbacf8a3eaba431ea950ad0535d5c83b1d62a1a72657b6b54f75b673c86de9eb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): python/mlc_llm/bench/dataset.py:89-96 | python/mlc_llm/bench/dataset.py:629-636 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/dataset.py"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"18712b04d221b7d06264c19991fba6482ae352a080fc23ecfe46fe9acb982f80"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): python/mlc_llm/bench/api_endpoint.py:107-113 | python/mlc_llm/bench/api_endpoint.py:126-132 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/bench/api_endpoint.py:107\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/api_endpoint.py"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"499b84e4a3bb902da1787d149d6c97a77f908146b376b09b0615323a71fc42b6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): python/mlc_llm/compiler_pass/attach_spec_decode_aux_funcs.py:87-93 | python/mlc_llm/compiler_pass/attach_spec_decode_aux_funcs.py:113-119 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/compiler_pass/attach_spec_decode_aux_funcs.py:87\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_spec_decode_aux_funcs.py"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"bfca70f2628fd7ed7253976ad258cc973820c12716cdadb436b70b3dd0f1b93e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (4\u20135 lines \u00D7 5): python/mlc_llm/bench/request_record.py:201-204 | python/mlc_llm/bench/request_record.py:211-215 | python/mlc_llm/bench/request_record.py:224-228 | python/mlc_llm/bench/request_record.py:237-241 | python/mlc_llm/bench/request_record.py:250-254 \u2014 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 \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060python/mlc_llm/bench/request_record.py:215\u0060 calls \u0060center\u0060 and \u0060python/mlc_llm/bench/request_record.py:204\u0060 does not \u2014 after which the two agree again for 5 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/request_record.py"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfcf2ef5e238c2b3565b9e4d8b0df42fa0857f90f68b3c3e724f470ff431fa4b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): python/mlc_llm/bench/api_endpoint.py:114-118 | python/mlc_llm/bench/api_endpoint.py:133-137 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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 \u0060python/mlc_llm/bench/api_endpoint.py:114\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/api_endpoint.py"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"f05d84b966591b548ec64b037e1ac768ebd749abd942fef6e345851dc4024e4b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): examples/rest/python/sample_langchain.py:109-114 | examples/rest/python/sample_langchain.py:149-154 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"examples/rest/python/sample_langchain.py"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"c86bd3fae57f910845982353cc2375e2e0c1e0c7a9e9fe1dd41fa1d38cbdc225"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): python/mlc_llm/op/batch_spec_verify.py:131-136 | python/mlc_llm/op/batch_spec_verify.py:159-164 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/batch_spec_verify.py"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b0fc803d4f0349477f58101395c0afa97dab6914c2f33991849a32672b126aa"}},{"ruleId":"D12","level":"warning","message":{"text":"No Gemfile.lock committed by an application: This repository declares 2 gem(s) across 1 Bundler manifest(s) and ships no application \u0060.gemspec\u0060, so it is an APPLICATION \u2014 but no \u0060Gemfile.lock\u0060 is committed. Nothing records the versions a working build resolved to, so \u0060bundle install\u0060 re-resolves against whatever rubygems.org serves today and two deploys of this commit are not guaranteed to be the same deploy. Run \u0060bundle install\u0060 and commit the resulting \u0060Gemfile.lock\u0060. (A published GEM correctly omits its lock, which is why this is asked only of a repository that ships no .gemspec.)"},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"cce86a6764b0429f696055851835123ad1dee71ace60575c329aed06e5e6bcd7"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: python/mlc_llm/protocol/conversation_protocol.py: python/mlc_llm/protocol/conversation_protocol.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in Conversation.as_prompt at line 122. 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-01..2026-10-30, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-01 01:57:42 -07:00\u0027 --until=\u00272026-10-30 01:57:42 -07:00\u0027 --full-history --no-merges -- python/mlc_llm/protocol/conversation_protocol.py\u0060: 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 \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/protocol/conversation_protocol.py"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"76ac29cfec21499069053acef39751252412f679adaa232031c115b44ee06460"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: python/mlc_llm/interface/compile.py: python/mlc_llm/interface/compile.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in compile._compile at line 110. 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-01..2026-10-30, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-01 01:57:42 -07:00\u0027 --until=\u00272026-10-30 01:57:42 -07:00\u0027 --full-history --no-merges -- python/mlc_llm/interface/compile.py\u0060: 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 \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/compile.py"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6f7efd752b6709214432860e44a9dc69166e27f1db90c188fb4229d17af945d"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #1: If anonymized user #1 becomes unavailable, 5 significant file(s) lose their only recent owner: python/mlc_llm/model/gemma4/gemma4_model.py, python/mlc_llm/model/gemma3/gemma3v_model.py, python/mlc_llm/protocol/artifact_manifest.py, python/mlc_llm/model/qwen35/qwen35v_model.py, python/mlc_llm/model/ministral3/ministral3_loader.py. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"3fd33f1ccf9c4ff42eb1788ac69ddb40a687743f24be574eb76f19c909cae368"}},{"ruleId":"D16","level":"note","message":{"text":"Further sole-owners (lower concentration): 3 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold \u2014 folded into the bus-factor score and metrics (9 single-owned of 221 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; 221 of the 381 production source files in this repository met that bar). They are anonymized user #2 (2 file(s)), anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)) \u2014 spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: python/mlc_llm/bench/evaluation/gsm8k.py, python/mlc_llm/bench/evaluation/mmlu.py, version.py, python/mlc_llm/cli/router.py."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"6eac528f2429e724e1a97ed868f79eefbcf1888dab4af9a9e673429369bb5b2f"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: Add pytorch precision \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"tests/python/serve/test_serve_engine_spec.py"},"region":{"startLine":411}}}],"partialFingerprints":{"codehealthFindingId/v1":"f32d20c71455649cbcc26bc8c4748fa8a20305c7e7cd78f1b87dcefe6668f3db"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(@junrushao): use \u0060list(mlc_llm.quantization.QUANTIZATION.keys())\u0060 \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"tests/python/integration/test_model_compile.py"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"4cb448a65a7ce4c07699ef9e88e428dc630bf599d6692dc18fb140b515fe9fdf"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: Support RNN KVState \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/testing/debug_chat.py"},"region":{"startLine":290}}}],"partialFingerprints":{"codehealthFindingId/v1":"11fac9fb1a4acd47d10dde8d94ff9c8f9efee9962febdf82328462623c89d15d"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: add help message on how to specify the target manually \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/support/auto_target.py"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"cde604d2c4d7cb63fa5a36620edc04a8df8f7b64a648b38bb556fd687111c6a5"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(vvchernov): support text_offset \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine_base.py"},"region":{"startLine":1002}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc1e39ea00b89e76a9213aa617e7328864e9a1b902cd4d74839c94758709679a"}},{"ruleId":"D17","level":"warning","message":{"text":"HackComment: # hacky way to check if string list \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/engine_base.py"},"region":{"startLine":1172}}}],"partialFingerprints":{"codehealthFindingId/v1":"b18ff5613240cd6db3273dd26b8243f6fa27d23418e01b9b0a6b832ead1c58ba"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(mlc-team): consider refactor server context to \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/entrypoints/metrics_entrypoints.py"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc80a4ac32ee77a86b4358965a7084e2417a4bf7ea237a2292467590e0879b54"}},{"ruleId":"D17","level":"warning","message":{"text":"FixmeComment: # FIXME: This is a temporary solution to make sure \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/entrypoints/openai_entrypoints.py"},"region":{"startLine":151}}}],"partialFingerprints":{"codehealthFindingId/v1":"4aa888336e9dea463f2b51a57e13cd92c9921ce4b67018fe6c0a3896e9300e1c"}},{"ruleId":"D17","level":"warning","message":{"text":"FixmeComment: # FIXME: This is a temporary solution to make sure \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/entrypoints/openai_entrypoints.py"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"1cc68d74efe6aef0fee9bf669bc4a80db0667356e56bfe322752d4f5e76c73cd"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # todo: replace this with start_generate \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/router/router.py"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1b6ed5acd5f5d25d493f61d84d747f3697a8262c5406b46c449693a1d8e7643"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # Todo: return string directly to reduce str-\u003Ejson-\u003Estr roundtrip overhead \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/router/router.py"},"region":{"startLine":366}}}],"partialFingerprints":{"codehealthFindingId/v1":"369c52ca5859fa821568f4d45467d082fe1c8da14c12af689c231ef9e1c397e8"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # Todo: check \u0022shape supported by cutlass\u0022 for Hopper \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/block_scale_quantization.py"},"region":{"startLine":291}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e8d67379cb0d517d0879ff8ce42de33d53c644631c36e19e69528be5a872725"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: use more specious condition to determine final fc \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/utils.py"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"67c22a1dde9f329e8a3686963e3ff33b8845db7286af861096ca37e3eb0c023d"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(vvchernov): skip optional after support \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/protocol/openai_api_protocol.py"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"dad84b91e26d3dc63361b1d22c96e38dbc52af26bc8d3f6d5eccb06b941dd96b"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: Implement M-RoPE. Hugging Face gives image tokens 2D grid positions and resumes \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen35/qwen35v_model.py"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"695b3215cf7949567004e9643acaa826ebe1200b914bcf1a8711ddbe938b09c7"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: XLM-RoBERTa models use position indices starting from pad_token_id \u002B 1 \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/bert/bert_model.py"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b6cc89514497baea1017ecfeade9c6a2b46f6470e4d7ddb4c817978f19b4fad"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(mlc-team): possibly leverage debug option \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/chat.py"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"f39ddba0bac0e683149d85d1a347a9e21787f47df3dfefe4613a51d4509f4741"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: Remove this workaround when the TVM CSE regression is fixed. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/compile.py"},"region":{"startLine":227}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ebf009d593814abbf8e82fddbfce1a49a8c17cd7ea35c5cd50b76fb41e2f9b5"}},{"ruleId":"D17","level":"warning","message":{"text":"FixmeComment: # FIXME: Copy RWKV tokenizer file \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/gen_config.py"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"e97d0bb38318d58cbb80e6c380bc9b98c30b7d3c1e407b5748ec4c36088c4b58"}},{"ruleId":"D17","level":"warning","message":{"text":"FixmeComment: # FIXME: Non-streaming response not fully implemented \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/router.py"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"5885ca275b361ad98d3ab0ace9958d3810ed3ef1638b9569fac6259911a57cfb"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(Charlie): This is copied from engine.py -- \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/router.py"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5e5eb96e210a3e90084fdf00622cf9c522c472dcd51583a9d081b9ade3c18bb"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(mlc-team): move conversation template apply to this namespace \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/conversation_template/__init__.py"},"region":{"startLine":3}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d1868128f6ac0ecd54c8aa6439f560f7840a9f4cb3c0df08d8620fec0e06c08"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: If support quantized KV in future, need to change this \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/model_metadata.py"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c83853f8ae719199ab85d0e37ef68105c0f51c4b9039d0ba9875414da53f79e"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # Todo: APIEndPoint with AsyncOpenAI Python interface \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/api_endpoint.py"},"region":{"startLine":422}}}],"partialFingerprints":{"codehealthFindingId/v1":"105098cb00355e564b19d4340f97d9be2488dfc724e46ca487896b9423fa7fac"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // Todo(mlc-team): check the last error in engine and report if there\u0027s any \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCSwift/Sources/Swift/LLMEngine.swift"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c08eda5f4862e1c30bf3853d6834d1f18847b664c931357171f4b59600a0d52"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: Should move out \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCChat/MLCChat/States/AppState.swift"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"8915a6ca6522099887cfa9508791b4336fb874a2329179022d4bda9ffe0cbc06"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: Should move out \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCChat/MLCChat/States/AppState.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"85269e79bd1cc3cb9610995aef048222ba05909fe43184be210c6f53e9ec8e6a"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO(mlc-team) support new UI for image processing \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCChat/MLCChat/States/ChatState.swift"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"4686e664b2c2e733d206f6e90c8a69cac5c422fd163bde04ec514b4fa62a9434"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO(mlc-team) run a system message prefill \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCChat/MLCChat/States/ChatState.swift"},"region":{"startLine":352}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd3b2261634b922d133749542ded5746976d416f8a38780bf7b59a93c4885aeb"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: can it decouple? \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCChat/MLCChat/States/ModelState.swift"},"region":{"startLine":409}}}],"partialFingerprints":{"codehealthFindingId/v1":"202869954a3fa58a40582defac6ac9a45c56c62056bf101b5220e93f5479e8fd"}},{"ruleId":"D20","level":"note","message":{"text":"No ADRs found: No ADRs found. No recognised ADR directory (\u0060docs/adr/\u0060, \u0060docs/decisions/\u0060, \u0060adr/\u0060, \u0060docs/rfcs/\u0060, an \u0060ADR0001/\u0060 folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (\u0060docs/adr/use-postgres.md\u0060, \u0060docs/adr/2024/0001-x.md\u0060); or a file anywhere whose name is ADR-shaped (\u00600001-use-postgres.md\u0060, \u0060adr-012-caching.md\u0060); or, when neither turned anything up, a document carrying the decision-record signature (an \u0022Architecture Decision Record\u0022 heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these \u2014 unnumbered files outside any recognised directory, without those headings \u2014 is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in \u0060docs/adr/\u0060."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"d2bea044ff79d7d275f5a91a6e2f548586178eaf480274c33960ad020c854631"}},{"ruleId":"D26","level":"note","message":{"text":"Projects may be oversized for their cohesion: 1 of 12 project(s) overshoot their size bounds, lowering Project Cohesion to 8.3/10. The most over is \u0060python\u0060 (55465 LoC, 695 module-visible types across 67 directories). Review these for cohesion \u2014 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."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"d5a94650dc74886a0f1f08eb9fb6775f1fc395279ef7e901c970c9d26f767a72"}},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f52169bbb8e4495a1aa82996ad2d1b135f335da5bc5412ad7bf80e6fc99b6374"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"a50bda9c66b9c34020f76da715dc28273e3fd3eeb98812fef9dc57af247fddbc"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-829","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"b89a2a0e1e1c4818048c1fe4cd1cdc2edeb0118557c99cf5bc45fc8e264e1981"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"1f6d1151ff5e680d12245edfc153f087595b8157ec862c36638757add6eb2f08"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-829","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"18f4bb7f658f1e850a80585fe9466c4f596fe164c579df17fd5e6af98f54fce1"},"taxa":[{"id":"CWE-214","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-532","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A09:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"09475e7acc448c83a0003f06cc325012b7df07ed96c378efbfd5ef33991f016f"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"b171699298b1154f7767a2b5ead5e00f39772171d2e939b598c3b6ac929f2d76"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"bce1f82b9a958b06f3b21b8588ea9d4211a695039ba4522e43fdf3df3efb205a"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"57afb4a111f42f50731f872cec7fb330e01c8b983e13400fe3015b46604da19e"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"e3a3b3313b07f1dfaba9d81c881c07cf149ef59466bd222ee43249cb1e99bc76"},"taxa":[{"id":"CWE-95","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A05:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"471ce4f2f6d71f87b167c3612730a08947b984a7494bd360a173bd34fcce7b3b"},"taxa":[{"id":"CWE-95","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A05:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"a89097cf3e3d0da9e69a002b0a725ee7b69392a0d1f3c0e14895aa7a847e5cb6"},"taxa":[{"id":"CWE-95","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A05:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"69c15a0425d2fa696e987eb154550e205ce01b598c52af6f1cd7094de0ff773c"},"taxa":[{"id":"CWE-95","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A05:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"2218d0977699b14821af5fcacff93f4ef5aea085ec35b1e59f7a823a4ee4c2a3"},"taxa":[{"id":"CWE-1104","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-1329","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},{"id":"CICD-SEC-8","toolComponent":{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"59bcddcc0bf36b1e3e651742843def32f9821027542951748975e148670be18a"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A05:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"5ac0ddacbd9f0221b3e61582c7c5b91b69a518c35335eba5897ba1533ce1a35f"},"taxa":[{"id":"CWE-532","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A09:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"e29de8863c7132f5e9b17863465ff44390142161e7ca259bee4024248d595675"},"taxa":[{"id":"CWE-532","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A09:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"778bdd28eddd990ba5036cdf3cccfd560d61ae6db69a0b2c18a7a46c36953ef9"},"taxa":[{"id":"CWE-532","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A09:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"01ba67d656fbf6a51c51a4a0f473dbbbef90f21c3bc63e0f53090b813cdf1756"},"taxa":[{"id":"CWE-532","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A09:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"4390752d26bc53b14697d4c8c57c1e5809f3db0862f0a7ffc4186f446a4f8202"},"taxa":[{"id":"CWE-327","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"3312a29f4c0537f9a65786c42f6b505bc46564c753b2773821a0656435277067"},"taxa":[{"id":"CWE-327","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"319754a5d032bf7c6f194e19d518262ebe8cbb88c51e24fe46f2a0635cf40301"},"taxa":[{"id":"CWE-327","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"80182be99ae2c3256863033a16d7d1ecbccc9614b59505c5b4d2e01f1104d783"},"taxa":[{"id":"CWE-319","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c48df56072601cabac710e4073a3543f27a00ad6d8d5ab1b6b2def0a6ca46657"},"taxa":[{"id":"CWE-319","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D34","level":"note","message":{"text":"Concentrated knowledge decay: 140 of 221 significant files have no living knowledge, while the repository is still being changed at a low rate (18 commit(s) in the last 90 days) \u2014 so this is one repo-wide knowledge-decay state, not 140 separate risks. Counted over 221 of the 381 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. The code moved on without the people who understood these files: document them or schedule a read-through before the next change lands in them."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"008bd8d3156a7f5206da709f59f1f87af76671c6b9becea72c8c9cffbcbd4f8e"}},{"ruleId":"D34","level":"note","message":{"text":"Most significant orphaned file: One of the orphaned files carrying the most lost knowledge \u2014 ranked by size weighted by the file\u0027s role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama4/llama4_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"32a408541cabbc242af7ff3cd61de22ce18b010495034bad833348e1c176b46f"}},{"ruleId":"D34","level":"note","message":{"text":"Most significant orphaned file: One of the orphaned files carrying the most lost knowledge \u2014 ranked by size weighted by the file\u0027s role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCChat/app/src/main/java/ai/mlc/mlcchat/AppViewModel.kt"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5541ea75f7d92b653fc45f67f63611c78c3fcb353722d5750bf475d27abddde"}},{"ruleId":"D34","level":"note","message":{"text":"Most significant orphaned file: One of the orphaned files carrying the most lost knowledge \u2014 ranked by size weighted by the file\u0027s role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/olmo2/olmo2_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9154106241f4c6cd31b9e064cb6b4b3925635b46f603e2750734837f8bc9b269"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/olmo/olmo_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"45af750b7082f76b185e8c84c38cca0c24e42c324cb089ce44488edfa1f31e19"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5dabf7e48963e7f0033d0f8e5cb857cfd9478f8bd257071b5ebc8caf49bda2a1"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2_5_vl/qwen2_5_vl_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"144af4d44b8649073cca3e0c332d672de4f8138ad6a72008a052141cb0786a45"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/embedding_engine.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1324f43fb61fb1204615af83f446d95ea3bee04ce044edcc2a05a6e29f6f372a"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen3/qwen3_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3482d6534b2f2a552312bc2dd7a823220ce8a8dc9bcb0a9f03ec0e0f2e3a4deb"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/nemotron/nemotron_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0720187a1b65f11b7e7f0aa9ccd84f924a523838415ae8cdb1b46bca525c47aa"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e868c274b0a26e026d0d248cec446b9c10ab8556f765514d0fedda60c2abf44"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4bfc55928996fef987ba35044ad33f7e6d390c1e9b005c02b6dc8dc117eea299"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi/phi_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"31956da87fa9c3f4a4bdcf4398495cd653c75c1f10f882973794ce63803372e0"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/mrope.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a62d5d3f0929a08f9e0b27d9b704f93f490ece6fbe6f99a6e78b5a8c8ac721e"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/chatglm3/chatglm3_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f7824577b034952f01e7f77893c46e40465c50fa08ea732170f9b632a19e22a"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/router/router.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3708224d2757c0d2eef4fb2156789bff3b48d45e6db7cb7604316708c4fd136d"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/protocol/openai_api_protocol.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"66c75e0fff33d00dd4696cfd1cf79b76c92167afbede1133530a1fd9c61fe7e5"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi3/phi3_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"db7ce98a0200440a03b5d4fb8e50362c1f8b77f87382cb37c359876655d994c3"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt_neox/gpt_neox_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"61223ed0ea34fdd8c16c0845ca93f47e550140a85f8a4a416f65805a4af6d06c"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/cohere/cohere_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"660a0390fc5d3299dd971cefaee6f6a735039512dbdd7858adaf3eaeaf0da0c3"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"97da963fee5f8f19ca7d6c1180a0c696c25c5979f03a998716490c7915b5ad09"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2/qwen2_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"745626e25e24f7600c400504f71f9b2665cb88699e41dca022649caabacbdacd"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"55004943cf230147b1b724f56e28c32209332904e544f1ce391ee12fad85cdd3"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/mistral/mistral_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"50bab3fc56eb242f739d864216265b3473e60106124ebaaebc0a03b8036efd62"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/starcoder2/starcoder2_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"13ba9d307535042e551d36a7dd4e7eabde453a07a6fc44974a4920d53bf3ae6c"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/delivery.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa7a69d748ebabaf243c8f4739a42d1b6d19649869b4a2eea78b1a57c046458e"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/stable_lm/stablelm_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9b698d79e0a0318620f523cd0f422d1a035b770c114bd200cd6ab60fa811fd8"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/orion/orion_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ec835c386d909ff909950f2f243612d1ff721c0d1d33226b7c5f312f8b465d6"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/internlm2/internlm2_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc7b65b558b1bb1de37af45eb6b61e53d678f0092d6333098eeb6397b86b376a"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/internlm/internlm_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"76bbc7c1ba332990c94f1bcc24b720f85dea2581c35ad7a198ca3faeaebf3ffd"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt2/gpt2_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"79e3875794e6734cc66559e0050aeac24d69aef86e7a0c46acfdb007afbf52f0"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/baichuan/baichuan_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"192b8e4c4c2d351f918f4029765d2e7de77839378edd40b33262880c8d88f2fc"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/sync_engine.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"cdbb02c54480bd787edb9ee3799fc841fc87c4172229158deb4a393013313dcb"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen/qwen_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"07e728cd7e63a746962b2ce5415eebca16b5f523663dd51f0e274b564c32644d"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt_j/gpt_j_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d24a924885d85357a848be5bfd56d98a2956b1b8d575b9baaa34af38a36b693f"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/entrypoints/openai_entrypoints.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bacdf6ed1e513b09128bda158593424a421245232f8017a955c8e41c300f138"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCChat/app/src/main/java/ai/mlc/mlcchat/ChatView.kt"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c47a7f3e98306ac68b89ba1412fcc09f808ced40045fd264e62b45dea04e1f5"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCChat/MLCChat/States/ModelState.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"eeb6108c9397dba403e3579a2e5fcfc57546e5997309e87d9883a8c9a4237724"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/help.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a49cbe8bad44e2e0b09a36fcd662b4bed411d0985694c117be8756ec05c2ac9"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5780ff4b0ee703e6c8e53f1db80109f2b11237627b0ea41507a56d48af51ab8a"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/request_record.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"742870c15cedbbc964fc9e960bce4cb310b1403088703f4de7561eb8cfdcd173"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/cutlass.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"568796fc9a3936c85c96b03e6f24d22489704f605a0e7e8efd85d17d0aaf7eaa"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/chat.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0eb4c34156f1087aaff31acee7f2bfb72d5e2ec80056ff97b327cf7ecf615ff"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCChat/MLCChat/States/AppState.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"836a4e70e083ccf1bdbc2ea75c3f383c22227c2aff954973442a45e61daf3cb8"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/fuse_ft_dequantize_matmul_epilogue.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"31880cb33d787dcb85cc385276a191a3df618c76ac8f6845f642ba3aafda1f69"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/serve.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c32267f5a1c31678483bea52669d6289712a1ee9e14e54243bc5c7f8e110878"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/json_ffi/engine.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4ce0a57ceea03e7ac3525e96b6cb9d62b1009ee510ec4d359aefc5083caa64f"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCChat/MLCChat/States/ChatState.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9a5a6092d3eff50b78e40f3fa316c7642dc9a105ed29ba8c21ac7c582bc88a6"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/evaluation/gsm8k.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2e52ff710bd0d7fc7e72f8aad446f4c56fb843faa38ac236d3c49554a76d876"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/bert/bert_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fe76536ea7a72e5d4f8aa88e3be9659a5539adaabbe00422e474ec231efbf04"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fecd7056707e04fe7ea988e397ecad70d83a2edc72fcf96e792388c988781a2"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/eagle/eagle_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a341e131aa34735615d11c33925f94523954c7a44cee06c4cb46129fc9ec0d3a"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/contrib/embeddings/openai.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8535ccf3c2b34266a66ae6234bf9bbb0a09d1cc199f1731db499391a02f480b8"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCChat/app/src/main/java/ai/mlc/mlcchat/StartView.kt"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"35d6fc5b8784dba82746a630698f7a53e2bbd8ebe7ad97bf13b3ad4f9e29d5ad"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCSwift/Sources/Swift/OpenAIProtocol.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7aab2def2f50bc8a8e5655f78edf3e63e69971e3c6c008d0ee9bcc725975c6f5"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/support/download_cache.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a934e92978f000d1982ddcd18db91f7e38b286ef624ed22ecb832ccf83215f9c"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCSwift/Sources/Swift/LLMEngine.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"673fb32b68bb4a1084ce2ee2f0a02b7f60c4c6024bfb3e058f4860e42564fc18"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/testing/debug_compare.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8159ba7a71c1966364f52da0375af3b19d57f6762f32d645a6d39ce768cb21bf"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/config.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8edcd63816cf83e4366785115329441cd3ffa227a3bed4201c447692d3130811"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/bench/evaluation/mmlu.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1d4d9e6c9ac1d324f2c30a5636b11ead289300e2ff152e8e802d281638df38f"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/mixtral/mixtral_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c4ac28baf26413fe323e6e33421587b3e75b984b3aad6ba196eda0c851e7049"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/mlc4j/src/main/java/ai/mlc/mlcllm/OpenAIProtocol.kt"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"13c0dd52adc956d6020b90aac987334d598a50add1507c8319b385653d2d1c25"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/server/popen_server.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bb4e698b187a5b3c7f6826d6ca86ee344b698d45a909ef20ec754c6826dc5b5"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/model_metadata.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"da416cbc901b570afda33115c138dc4e1751e9be4370b7713ddb75abd39a58cd"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/lib_delivery.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee6db6f1aa679041fe6cc72e33b6592e154b136caca33d8e8ff5ad2844d9bed5"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/attach_support_info.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a10595cdfabd8274c33a16b512fdadf0cb2dcbd31c0de47fea902ff79d8ffc1f"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/contrib/embeddings/embeddings.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0285251765da198c39e139dc7eb1ec48248c336d5b277f20e60d3f302ba1992a"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi/phi_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a085c35af82d4f80e694ca0c6d5fbd5a2c56b83bf907c04c1cc4b36ceeaf81e"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/support/auto_weight.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"53c1bc32a6e60f07d976c0f4fd045a950b51a02c048d23f4ba3f3ff7b51c5c6e"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCChat/MLCChat/Views/ChatView.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0461618283cb261c7bf44cf8e5cc8679cd0f188281fb598d6f19cf446973f0a6"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/mlc4j/src/main/java/ai/mlc/mlcllm/MLCEngine.kt"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"056bcfbd58627c8e9e09dee56fbe9c0ead2da890cd02014d534b5fc00b49db9b"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/loader/standard_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"50ebf575d3e78cb6b35cfa96852eebcceb4a5da068be904e7c8ad32537069a08"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/jit.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0330dec31b525f4fd06b358d190f62d7efcc6d32d8b23969e136708baf26ae8"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/calibrate.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"740cf897d61cee7364ea349819af4ff7af4ccb607c344818159307f3ca0ae7f1"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/model_quantization.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"871bd4e8f5c7c2d684af641e19b02e19b551f883e57aa3dbc648f5ecc8008644"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/dispatch_triton_kernel.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c68bf9c3dc4abb2c4a9369ecaf4dc06ab14f81bbd3fee8d92cb2cd507e83076a"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/compiler_pass/fuse_transpose_matmul.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"98a4f1ce3c986006bba6f622479b6f772d036731f4f2a3421dfe9fa8420bf057"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9e07a9fb877654b5f05cc2a1c52611daa171329f34555fdd8c2eeea9a5ac586"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/support/convert_tiktoken.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab9f4dc0a44547c0121bb67c5dd24c0bab571bddc77dd1c0dbf6fb29c0903789"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCChat/app/src/main/java/ai/mlc/mlcchat/MainActivity.kt"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc378c4f2883f615ff3c22fe4fdd30b9af92d114a46d4c7d9223688e12dca008"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen3/qwen3_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e1ca378ff49a0fb911a708402b701d30ba2a360a0409cd63111d95fbb11f293"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e315c5bac3f1d4be57942351e6fc16ca009c0337663f13331b35fb753e9a845"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/router.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1e43a567d7edb2ca903c212129519e39efb50d25a4f73c76735b4e00a13c492"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3ffa70396651227f63d143fc8a214b8f2b72d66de148045177c2cb437c04563"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi3v/phi3v_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a13251644732bf31abfeb453202cea4ae1bdef1a6c32fc7265dbd5c08dbc058f"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/entrypoints/debug_entrypoints.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b98162e6e36df9b5e0622cb9f206a56230e84e6faefc7eea84fedc58749a8092"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/serve.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2cff69f7e476049bf0998b3fd792c960f64be47bde27c24dfddeada1de563eda"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/compile.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"47a88af3ae2c858a76d65218764980aa4b7004a04d3b93674890f60167b87353"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma2/gemma2_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"209f6c1693f6e4e62c685151673c5d38affd9cd8d145228782e8d74116fe4984"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/conversation_template/llama.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"214d1e1ca07aafa11a0271284f22a06ce57e077c70da5b412dc938277d9d7106"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/loader/mapping.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3f7f085acd27e131f0671d966d6dec6633d3d861652f72bd981589ddcba3b7c"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"67a36bb79afd9c94508795c5a495586bd7b380d6db0c2520fc4d211090145905"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/radix_tree.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ce31da5a8f651ed7e1dde0af0cdc6e3420aba6665e452ac5ad38893db8fadc5"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/tokenizers/tokenizers.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"735160579910e679005c16055dd91adaa4f6e967a4e84adf31efc43966e44e93"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/mixtral/mixtral_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9b3ee6fa0f54326a477b0c57b67e77f59424d5ccf95aa9a30c5b03c90a8d18a"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCChat/MLCChat/Views/ModelView.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7c69b7583570303e9c4149adf5882726ea54afa8a2e4ade0690f0be6b1e8bd8"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/ft_gemm.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fc958f6d985f111091e4bfbba1ca17717a15fee2417c1524a5edf88cca342b2"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/support/tensor_parallel.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb7ed845a255f4d437648eb12c6cf1ef0bc3451764e46e1502ba9fddcf464475"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/mlc4j/prepare_libs.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"051e415342a66d0f542aff810d179cad173f03faedfc84ac5ceb350ccfd19799"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/gen_config.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1cfbb115ea2a8c48c064000726abe1389bc4bef7f0c1ebdc129bc3ac7a6cb903"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/support/config.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"46b32a1da9c60999d00bfcced65a584491209bc74aea92b16a9ab2b741393ebb"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/cohere/cohere_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"66729226dadd802b177629b046722cac11ff168ca9fc45b6eeba35d15390bbb5"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/conversation_template/hermes.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2b5b7cd2dec48f50cd6b90975d7fbe967b91123b4a35e24e92a497a081cdb9f"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/bert/bert_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1079057461201d29f1bb4b818d0548fa2c5942ca822f6c16cece580f4e8aeb0"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama4/llama4_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"47d2255bccb9b33ab2c566736ce1c0d3265c69afb3ad9a3f7205e54f7fd512aa"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/convert_weight.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0822940d29edfcb9df0618f699ec88e04e9d87e0cd1c5bae419a79f6447f262"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/eagle/eagle_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"27a2bbccde4390ebdf491a98f2e81a38f2fda7c6d3d8b303c4d35db8ac08c7f1"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"664388f9a0214f16a4eff67090308159a220b33c7bd1f41a1e591882cc246149"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/olmo/olmo_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e9f580ed38c8e2c42547dbdc177ba76f67118a2531c12fc5575df0678f5c281"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llava/llava_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b266bf326fe9f3537db9a61e5c78108ecfcd0849bb733180c56549ded10c23df"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/conversation_template/deepseek.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e8290a7b25713e8653b7d9a0469100d573a3cd100219a378868f9cf781ed35f"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCChat/MLCChat/Views/MessageView.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"753fbde2e361a893d21778cc4f8c8678991f268d5bb2d30f5d87e76da621f482"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCEngineExample/app/src/main/java/ai/mlc/mlcengineexample/ui/theme/Theme.kt"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7df5b1223a1f4df1352741da488c3183956340b6fd6cea33563c45f788b9dc1d"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCChat/app/src/main/java/ai/mlc/mlcchat/ui/theme/Theme.kt"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5c5b5b4d56e1a3b9ebe65f193c157e942e6cc2f407b1de9c06ff4cfc486003f"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/mistral/mistral_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"da35c066f266028f74c283ea6485ba8b6fc0a47eea90a944d2ccad5200b213bf"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/support/constants.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4294f3fc4125cc65335dd77910cb309c0b049d6b2c371d3233d4dff0cad3c1e"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/starcoder2/starcoder2_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"00bff14870950c01b7b3832b452f1b79f2996c3d79b766272ec348337a0a3469"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCEngineExample/app/src/main/java/ai/mlc/mlcengineexample/MainActivity.kt"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e4896da701f070056d583d7b2a6d62964ee8057b4f193577b540a9ead35270f"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/mlc4j/src/main/java/ai/mlc/mlcllm/JSONFFIEngine.java"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5bc07cfe3ab29795f03ca547a99c7f58f699ea48b0bbe6c49038861044c00ec"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/support/auto_device.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e81b205bdd3381c174968ee2b7a808ef7b909d6b9538c710a10896fdcbaffadd"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt_neox/gpt_neox_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d65a7c623e1b94e65f1cf26590d7d5d31694d1b983f31c4cca591fb73b4089b"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/internlm2/internlm2_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"69f49d0980f057b595eb107b7ceabac8aba26b9795a3e93d3dfef474ac1bc133"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/server/server_context.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c02d825f46e7ae64c71db46a2e5d8738c1a64397d64bb5df355e06a7c4c82c17"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/conversation_template/registry.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"57104e84e730fc9a5bd7a39179489ee28271e755d36a2ec47b88254ba9d6aec6"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7541279b03d01a0da214390f0080d3d9be122a313e49992dcf10878c90790326"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/loader/stats.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5078580873e3358987fa4c4c2f79b126f7a33d120fda6fecc68caa32c67c37e8"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCEngineExample/MLCEngineExample/MLCEngineExampleApp.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d74c4fd7d10dbf1130f9aef3856795144606f28e03439abf620ae04d5b6669d1"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/loader/utils.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"60d372a1eb771c8ef6b1156318f3f1cae7a07544f398f98bded952559dc7208c"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/serve/entrypoints/microserving_entrypoints.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"abecd0577e93903d8100a9b1d40c67fa00ad132a9a6ba68ceb59661127564e8a"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/testing/pytest_utils.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"40b3e076f26b1538357c18262fc52da03be03908db9bca185dbc8da7f2237b44"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/router.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"03919a8fb5b7834bed7c4bb57a0754a13fbb6d0e858b89b228671d605de4ba38"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/extern.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3721c0bf35e0fccddfc9de68541d8f6a45ac40d98d68e04219c933da40827787"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt2/gpt2_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ac5b369a5c673188b15d231d1bbc4e40d4f4b2e597e36f4f7abb41d673c1b9c"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/phi3/phi3_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf8c30c489c1fc3a244c73a5deb360c73f0da30d96ad2fb125b6dfe4a5eeb53f"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCChat/app/build.gradle"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee8a726a2de7770a8610dab8f9c493114172c4a40965881862cd4a38d76cf72f"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCEngineExample/bundle_weight.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c014f66b6d93604fc07deeb068cff0d4679818ebaea84028f527668cd11c3c6e"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCChat/bundle_weight.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"df20be34345587f086faabd069da880646bbaa5f525d86e05857e2ee297f2beb"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ios/MLCChat/MLCChat/Views/ImageProcessing.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a4112ca62fd3555490e4054b2db629de7e630b7e322664fcaa72b0df7d14746"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCEngineExample/app/build.gradle"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf2b5ae011b8b33e1e3d6d890f1d1968b33e9cf1dc72b25457e1bd41523284a7"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma3/gemma3_loader.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba7457f23268b5261e7115e3bb175942803e885934eecd444d79a31443d1c220"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/libinfo.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f4767daa3efb2df5e264accca5786e2a85fefe85e425b66fd8ae55476aa497a"}},{"ruleId":"D35","level":"warning","message":{"text":"Change-coupling hub: gpt_bigcode_model.py \u2192 gpt_neox_model.py, llama_model.py, mistral_model.py, phi_model.py: \u0060python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py\u0060 changes together with 4 other files \u2014 \u0060python/mlc_llm/model/gpt_neox/gpt_neox_model.py\u0060, \u0060python/mlc_llm/model/llama/llama_model.py\u0060, \u0060python/mlc_llm/model/mistral/mistral_model.py\u0060, \u0060python/mlc_llm/model/phi/phi_model.py\u0060 \u2014 none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8eaf0fc890e13f90addc11764506f1308e9463c426842d27851b3ab29a83087e"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: gpt_neox_model.py \u2194 phi_model.py: \u0060python/mlc_llm/model/gpt_neox/gpt_neox_model.py\u0060 and \u0060python/mlc_llm/model/phi/phi_model.py\u0060 change together 71% of the time (12 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well \u2014 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 \u2014 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 \u2014 the registration is the link, and it is meant not to be an import \u2014 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 12 shared commits counted here, the most recent 3 are \u006066fd62df\u0060 [Model] Udpate default prefill chunk size and max batch size (#2917); \u006031842942\u0060 [Model] Fix config detection for Mistral (#2504); \u0060cd099339\u0060 [Pass] Attach manual softmax-with-temperature (#2280) \u2014 run \u0060git show\u0060 on any of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt_neox/gpt_neox_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c19f6407a0325823100e1dc8aae6f9e68ace231122fb90f26337fc86999041a"}},{"ruleId":"D35","level":"warning","message":{"text":"Change-coupling hub: gpt2_model.py \u2192 gemma_model.py, gpt_bigcode_model.py, gpt_neox_model.py, llama_model.py, mistral_model.py, phi_model.py, stablelm_model.py: \u0060python/mlc_llm/model/gpt2/gpt2_model.py\u0060 changes together with 7 other files \u2014 \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060, \u0060python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py\u0060, \u0060python/mlc_llm/model/gpt_neox/gpt_neox_model.py\u0060, \u0060python/mlc_llm/model/llama/llama_model.py\u0060, \u0060python/mlc_llm/model/mistral/mistral_model.py\u0060, \u0060python/mlc_llm/model/phi/phi_model.py\u0060, \u0060python/mlc_llm/model/stable_lm/stablelm_model.py\u0060 \u2014 none of which declares a dependency on it: one file is the hub of 7 separate couplings, not 7 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 7."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt2/gpt2_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"03794704839db5c9a96511f5e07b60b60ddecd3fbe7236983fa18a7650223a00"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: gpt_neox_model.py \u2194 llama_model.py: \u0060python/mlc_llm/model/gpt_neox/gpt_neox_model.py\u0060 and \u0060python/mlc_llm/model/llama/llama_model.py\u0060 change together 63% of the time (12 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well \u2014 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 \u2014 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 \u2014 the registration is the link, and it is meant not to be an import \u2014 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 12 shared commits counted here, the most recent 3 are \u006066fd62df\u0060 [Model] Udpate default prefill chunk size and max batch size (#2917); \u006031842942\u0060 [Model] Fix config detection for Mistral (#2504); \u0060cd099339\u0060 [Pass] Attach manual softmax-with-temperature (#2280) \u2014 run \u0060git show\u0060 on any of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gpt_neox/gpt_neox_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"91813f473c689ed0df65af4d0c7762a387d1717a208ed4157096118b641db885"}},{"ruleId":"D35","level":"warning","message":{"text":"Change-coupling hub: stablelm_model.py \u2192 gemma_model.py, gpt_bigcode_model.py, gpt_neox_model.py, llama_model.py, phi_model.py, qwen2_model.py: \u0060python/mlc_llm/model/stable_lm/stablelm_model.py\u0060 changes together with 6 other files \u2014 \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060, \u0060python/mlc_llm/model/gpt_bigcode/gpt_bigcode_model.py\u0060, \u0060python/mlc_llm/model/gpt_neox/gpt_neox_model.py\u0060, \u0060python/mlc_llm/model/llama/llama_model.py\u0060, \u0060python/mlc_llm/model/phi/phi_model.py\u0060, \u0060python/mlc_llm/model/qwen2/qwen2_model.py\u0060 \u2014 none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 6."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/stable_lm/stablelm_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"833da728449501360a5e776a4acb867541978089523baed413fe9dde4ecfae25"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: llama_model.py \u2194 phi_model.py: \u0060python/mlc_llm/model/llama/llama_model.py\u0060 and \u0060python/mlc_llm/model/phi/phi_model.py\u0060 change together 59% of the time (10 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well \u2014 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 \u2014 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 \u2014 the registration is the link, and it is meant not to be an import \u2014 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 10 shared commits counted here, the most recent 3 are \u006066fd62df\u0060 [Model] Udpate default prefill chunk size and max batch size (#2917); \u006031842942\u0060 [Model] Fix config detection for Mistral (#2504); \u0060cd099339\u0060 [Pass] Attach manual softmax-with-temperature (#2280) \u2014 run \u0060git show\u0060 on any of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"68cf3d41178a1c82846b0d4d04e97ddb58a7aa682d40caaea4a720652bffb9db"}},{"ruleId":"D35","level":"warning","message":{"text":"Change-coupling hub: gemma_model.py \u2192 gpt_neox_model.py, llama_model.py, phi_model.py: \u0060python/mlc_llm/model/gemma/gemma_model.py\u0060 changes together with 3 other files \u2014 \u0060python/mlc_llm/model/gpt_neox/gpt_neox_model.py\u0060, \u0060python/mlc_llm/model/llama/llama_model.py\u0060, \u0060python/mlc_llm/model/phi/phi_model.py\u0060 \u2014 none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma/gemma_model.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"15ffe681e8fed95c0381cc7bc8cf2f4d263926e370e9ba1828d00c5e81537776"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: __init__.py \u2194 model.py: \u0060python/mlc_llm/conversation_template/__init__.py\u0060 and \u0060python/mlc_llm/model/model.py\u0060 change together 53% of the time (9 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well \u2014 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 \u2014 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 \u2014 the registration is the link, and it is meant not to be an import \u2014 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 9 shared commits counted here, the most recent 3 are \u00602ca3380e\u0060 [Model] Add OLMo 2 Support (#3467); \u0060af1020e4\u0060 [Model] Support Ministral 3 (#3409); \u0060e2690772\u0060 Revert accidental merge (#3402) \u2014 run \u0060git show\u0060 on any of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/conversation_template/__init__.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"68d326fb5137ccfa07445499e22652cb971a9e15367e4762ceb02a0d529f7e21"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: help.py \u2194 serve.py: \u0060python/mlc_llm/interface/help.py\u0060 and \u0060python/mlc_llm/interface/serve.py\u0060 change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well \u2014 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 \u2014 a sibling reference still needs an import \u2014 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 \u006028a10169\u0060 [Serving] Add prefill-mode to cli option (#2735); \u00606bbd49cb\u0060 [EngineConfig] Add override options (#2550); \u006070f2a76c\u0060 [Refactor] Expose EngineConfig in engine constructor (#2399) \u2014 run \u0060git show\u0060 on any of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/help.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1add9c3ebcaa65a8bcf711ceec769a8423e9b75ad194bcd59cb79e1610b8c21"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: moe_matmul.py \u2194 utils.py: \u0060python/mlc_llm/op/moe_matmul.py\u0060 and \u0060python/mlc_llm/quantization/utils.py\u0060 change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well \u2014 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 \u2014 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 \u2014 the registration is the link, and it is meant not to be an import \u2014 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 5 shared commits counted here, the most recent 3 are \u006056a5ff9f\u0060 [DataType] Rename FP8 dtypes (#3155); \u00609216467c\u0060 [Quantization] Add e4m3 mode and enable fp8 storage type (reland #215\u2026; \u00607d3f34e6\u0060 Revert \u0022[Quantization] Add e4m3 mode and enable fp8 storage type\u0022 (#2\u2026 \u2014 run \u0060git show\u0060 on any of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"89c87c8ab885fd6ae06f2a5f3ed382c2f43b9c8753c96a54ff8ff341864fe3d7"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: moe_matmul.py \u2194 quantization.py: \u0060python/mlc_llm/op/moe_matmul.py\u0060 and \u0060python/mlc_llm/quantization/quantization.py\u0060 change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well \u2014 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 \u2014 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 \u2014 the registration is the link, and it is meant not to be an import \u2014 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 5 shared commits counted here, the most recent 3 are \u006056a5ff9f\u0060 [DataType] Rename FP8 dtypes (#3155); \u00609216467c\u0060 [Quantization] Add e4m3 mode and enable fp8 storage type (reland #215\u2026; \u00607d3f34e6\u0060 Revert \u0022[Quantization] Add e4m3 mode and enable fp8 storage type\u0022 (#2\u2026 \u2014 run \u0060git show\u0060 on any of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/op/moe_matmul.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2c1f5170de70b0c8c9808c8d051f93c16ff1cbefeb70adccdf9a84153c14f41"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: compile.py \u2194 gen_config.py: \u0060python/mlc_llm/cli/compile.py\u0060 and \u0060python/mlc_llm/cli/gen_config.py\u0060 change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well \u2014 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 \u2014 a sibling reference still needs an import \u2014 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 5 shared commits counted here, the most recent 3 are \u0060ceb27d5e\u0060 Rename \u0060max-sequence-length\u0060 to \u0060context-window-size\u0060 (#1265) (at that commit the files were still \u0060python/mlc_chat/cli/compile.py\u0060 and \u0060python/mlc_chat/cli/gen_mlc_chat_config.py\u0060); \u0060cd4a8ed2\u0060 Introduce mlc_chat subcommands (#1251) (at that commit the files were still \u0060python/mlc_chat/cli/compile.py\u0060 and \u0060python/mlc_chat/cli/gen_mlc_chat_config.py\u0060); \u006040217853\u0060 Specify argument \u0022dest\u0022 in argparse (#1245) (at that commit the files were still \u0060python/mlc_chat/cli/compile.py\u0060 and \u0060python/mlc_chat/cli/gen_mlc_chat_config.py\u0060) \u2014 run \u0060git show\u0060 on any of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/compile.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"17a491f3ee40df150565b33898fa50bf81b755250ec0bfcf33c8ae71c8fb829f"}},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"1b213f6eedd4b140d0bc37bdf1496f72811a643f34064f12518b32e9e83bcfc7"},"taxa":[{"id":"CICD-SEC-9","toolComponent":{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35"}}]},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"0e17f71490e4d120a48b2b2881ab866c93b272bef2febb673a3e8e42b2c288ab"},"taxa":[{"id":"CICD-SEC-9","toolComponent":{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35"}}]},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"eb00976a698a5d68999b7ee6d27206fd374e916853e7ff1ead5eed42386f043f"},"taxa":[{"id":"CICD-SEC-9","toolComponent":{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35"}}]},{"ruleId":"D36","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"90f83b4fa27db32740afe9540c905f3c0499caed87f61049a8a903ecc95b41c3"},"taxa":[{"id":"CICD-SEC-8","toolComponent":{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35"}}]},{"ruleId":"D36","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"fe357c0607457c5880321e4a84fc9bfd64d9c6e2d884b4f1c75a38d48df82caa"},"taxa":[{"id":"CICD-SEC-5","toolComponent":{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35"}}]},{"ruleId":"D36","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"d3602e3230d82fb9d1f03db29baff358a65fd735b14907054a6a8f1e398d007e"},"taxa":[{"id":"CICD-SEC-5","toolComponent":{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35"}}]},{"ruleId":"D36","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"88200b3fe7646da868c4efee954db95acfb70a42027973d91c47e98bcfaba1b8"},"taxa":[{"id":"CICD-SEC-5","toolComponent":{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35"}}]},{"ruleId":"D36","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"9c87400263d32d47b76ae23ed300be9e848e333fed67666b4b2e324bac6e886d"},"taxa":[{"id":"CICD-SEC-5","toolComponent":{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35"}}]},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"ace515990e7ee0f17b5c17e44dd168a5bdecf90804a3a3dd845cf05540978013"},"taxa":[{"id":"CICD-SEC-3","toolComponent":{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35"}}]},{"ruleId":"D44","level":"warning","message":{"text":"End-of-life runtime: Node.js 14: examples/rest/nodejs/package.json declares Node.js 14 as this project\u0027s engines.node, and Node.js 14, support ended 2023-04-30. An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2023-04-30 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"examples/rest/nodejs/package.json"},"region":{"startLine":10}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9b1ab02cd13b776ab93f6ab09cbd470bfb4c9780f06e947bfa3f4a0bc6ede14"}},{"ruleId":"C2","level":"note","message":{"text":"No named authorization policies: Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) \u2014 this is NOT a claim that endpoints are unprotected. What\u0027s missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can\u0027t be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"b048fdf3fa524ac68c7874fdfcdb4c49d5f010013f2cb22a0bd84cb12ceb951f"}},{"ruleId":"M1","level":"warning","message":{"text":"README may be stale: 142 code files changed in the last 6 months but the README was not touched \u2014 it may no longer reflect the system."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"e973e7a8d5d866995cbf78b120250fe7f132bf928812d48ca62e69aba11b9910"}},{"ruleId":"M2","level":"note","message":{"text":"No ADRs: No Architecture Decision Records found \u2014 no conventional ADR directory, no numbered \u0060NNNN-title\u0060 documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"670b3d6e36a756d63097d0dfbf90afd5fc761308800b9354894a07c3f4e4aa14"}},{"ruleId":"P10","level":"note","message":{"text":"Large public API surface: 92/122 types (75%) declared in the published library are public. For a library, every public type is a stability contract \u2014 keep implementation types off the surface and expose only the intended API."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"ed2ba843444ae377c17142f58f714e281e4bd3f183ab100ee1fbef389875d3e6"}},{"ruleId":"P2","level":"note","message":{"text":"Logging is not universal: Only 4/6 runnable modules use logging (modules with no entry point or server are excluded \u2014 they are libraries a runnable module hosts). Silent: \u0060ios/MLCChat\u0060, \u0060ios/MLCEngineExample\u0060."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"91a94e21d6d4d0e6a2003f94505b0b02b157176f0b24c4820f3f82b4447a97fe"}},{"ruleId":"P3","level":"note","message":{"text":"No SAST: No static application security testing detected. For this repository\u0027s stack, add bandit, \u0060semgrep --config=p/python\u0060, or CodeQL\u0027s python pack as a CI step. What was searched, so you can tell an absence from a miss: the 3661 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\u0027s web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen \u2014 if that is your case the row is wrong, and saying so is more useful than adding a second scanner."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":".github/workflows/lint.yml"},"region":{"startLine":6}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e54424179c892f03ef2fd003130ac4bd43f39bbf3b1ca0a0143e25acb80ec87"}},{"ruleId":"P3","level":"note","message":{"text":"No dependency-update automation: \u0060examples/rest/nodejs/package.json\u0060 declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices \u2014 including after an advisory is published against it. Add a \u0060.github/dependabot.yml\u0060 with one \u0060package-ecosystem\u0060 entry per ecosystem the tree uses (or an enabled \u0060renovate.json\u0060), and gate pull requests with \u0060actions/dependency-review-action\u0060."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"examples/rest/nodejs/package.json"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"537bfea5f31746dfb7d34249031faf45dbf0008ccb4c0773096a737ff2437c4a"}},{"ruleId":"P6","level":"note","message":{"text":"No changelog: No CHANGELOG/HISTORY/RELEASES file \u2014 what shipped when isn\u0027t easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)"},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"dda5aa5aed8cbb292c3ef2b733bc138f614293ae6426c85e98bf31ef330d9415"}},{"ruleId":"P7","level":"warning","message":{"text":"Outbound HTTP without resilience: \u0060requests.get(\u0060 makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service\u0027s request, thread or connection until the call gives up on its own \u2014 or never, for a client with no default timeout."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"scripts/check_url_validity.py"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"aaf702274025792acbceec1a24ba7ba3ff20dbb742e8fe4d6dd4b5b9772c9bb1"}},{"ruleId":"SC1","level":"warning","message":{"text":"JavaScript dependencies are not locked: examples/rest/nodejs/package.json declares dependencies that no committed lockfile resolves \u2014 there is no package-lock.json / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it \u2014 so its installs aren\u0027t reproducible (SSDF PW.4.4). Commit its package manager\u0027s lockfile (or add it to the locked workspace) and install from it (\u0060npm ci\u0060, \u0060yarn --immutable\u0060, \u0060pnpm i --frozen-lockfile\u0060 or \u0060bun i --frozen-lockfile\u0060). Advisory \u2014 never scored."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"examples/rest/nodejs/package.json"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fb39458c9e10ccb5b7b3aae7e162e241773a2627eb3da92bc56c7d6732cd375"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060dynamicColor \u0026\u0026 Build.VERSION.SDK_INT \u003E= Build.VERSION_CODES.S\u0060 appears character-identically in 2 files \u2014 android/MLCChat/app/src/main/java/ai/mlc/mlcchat/ui/theme/Theme.kt, android/MLCEngineExample/app/src/main/java/ai/mlc/mlcengineexample/ui/theme/Theme.kt. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"android/MLCChat/app/src/main/java/ai/mlc/mlcchat/ui/theme/Theme.kt"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf678297983397488246e053bfe53498ee563b0bbaf1761991b5b759d8fb02f0"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060args.quantization.kind == \u0022ft-quant\u0022 and hasattr(model_config, \u0022tensor_parallel_shards\u0022) and model_config.tensor_parallel_shards \u003E 1\u0060 appears character-identically in 2 files \u2014 python/mlc_llm/interface/compile.py, python/mlc_llm/interface/convert_weight.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/compile.py"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b4f423910d1c5cd11be1b9c71a4b9c3f995feffc4a1b33f3ef2b80a956b7bea"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060choice.finish_reason is not None and finish_reasons[choice.index] is None\u0060 appears character-identically in 3 files \u2014 python/mlc_llm/interface/router.py, python/mlc_llm/serve/engine.py, python/mlc_llm/serve/entrypoints/openai_entrypoints.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/router.py"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"63bcd14987a958ce93ee54f27fd64fd368ced1f0b05f9fc3fcb496e89aff9fd1"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060config.n_routed_experts is not None and layer_idx \u003E= config.first_k_dense_replace and layer_idx % config.moe_layer_freq == 0\u0060 appears character-identically in 2 files \u2014 python/mlc_llm/model/deepseek/deepseek_model.py, python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_model.py"},"region":{"startLine":252}}}],"partialFingerprints":{"codehealthFindingId/v1":"e575355bd119f6cd5bc88dd477801312c0d76d1beec397a6f903cec1bc574958"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060config.num_experts \u003E 0 and config.decoder_sparse_step == 1\u0060 appears character-identically in 2 files \u2014 python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py, python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"18216ce68c6228d02923787ddc76853bb159f15cd2374a0e8a56ee3287ae7b50"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060current and current.kind.name == \u0022webgpu\u0022\u0060 appears character-identically in 3 files \u2014 python/mlc_llm/model/gemma3/gemma3v_model.py, python/mlc_llm/model/llava/llava_model.py, python/mlc_llm/model/qwen35/qwen35v_model.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma3/gemma3v_model.py"},"region":{"startLine":471}}}],"partialFingerprints":{"codehealthFindingId/v1":"9784c0d2bf0be7ff0ca1c30d8b75cfc7d7b4e100bc3853d6edec45983384a143"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060dtype is not None and isinstance(getattr(self, \u0022dtype\u0022, None), str)\u0060 appears character-identically in 5 files \u2014 python/mlc_llm/quantization/awq_quantization.py, python/mlc_llm/quantization/block_scale_quantization.py, python/mlc_llm/quantization/ft_quantization.py, python/mlc_llm/quantization/group_quantization.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/awq_quantization.py"},"region":{"startLine":283}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d19e0f892a41df45a664a6ff8c6231e8c6089ce340bce312476e0e969dc13fa"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060i \u003E= model_config.first_k_dense_replace and i % model_config.moe_layer_freq == 0\u0060 appears character-identically in 2 files \u2014 python/mlc_llm/model/deepseek/deepseek_loader.py, python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek/deepseek_loader.py"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8e96f786dc5da1e5fd75caf6096e31dd82b2640810c2a7f17dcd474780af98b"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060intermediate_size or config.intermediate_size\u0060 appears character-identically in 2 files \u2014 python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py, python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/qwen2_moe/qwen2_moe_model.py"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6c99ad4a0e41e6929daf952487f6e92f2c80453bf9d7f1bbaf09ad724649662"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060isinstance(node, nn.Embedding) and self.config.quantize_embedding\u0060 appears character-identically in 2 files \u2014 python/mlc_llm/quantization/group_quantization.py, python/mlc_llm/quantization/per_tensor_quantization.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/group_quantization.py"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"acf43feedad586c79b6da28d7fefad3dd0956b7cbd1d2786ffebf88306f9e6ca"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060isinstance(node, nn.Linear) and not is_final_fc(name) and not is_moe_gate(name, node)\u0060 appears character-identically in 2 files \u2014 python/mlc_llm/quantization/awq_quantization.py, python/mlc_llm/quantization/block_scale_quantization.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/awq_quantization.py"},"region":{"startLine":123}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee5fe7e3b5400075ad25aa9de06c9737ecec9f47c6da60d1136318889412722c"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060isinstance(quantization_config, dict) and quantization_config.get(\u0022activation_scheme\u0022, \u0022\u0022) == \u0022dynamic\u0022 and quantization_config.get(\u0022fmt\u0022, \u0022\u2026\u0060 appears character-identically in 2 files \u2014 python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py, python/mlc_llm/model/qwen3/qwen3_model.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"6396941ff16b882a4692dd64c9a3b4bacbc928ff0c3f942cbb10746334e2d94a"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060layer_id != 0 and layer_id in self.layer_partition\u0060 appears character-identically in 4 files \u2014 python/mlc_llm/model/llama/llama_model.py, python/mlc_llm/model/nemotron/nemotron_model.py, python/mlc_llm/model/olmo/olmo_model.py, python/mlc_llm/model/olmo2/olmo2_model.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba2037ca50d5a8d692f7659d7d764d191eec718cac847bcef359204abb4523d7"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060not is_final_fc(name) or self.config.quantize_final_fc\u0060 appears character-identically in 2 files \u2014 python/mlc_llm/quantization/group_quantization.py, python/mlc_llm/quantization/per_tensor_quantization.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/group_quantization.py"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"960a6cf45a1070761c11d141ad2196c7a9f82f2d032ae3ac426cc5640ea0e5c1"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060not isinstance(quantization, BlockScaleQuantize) and model_config.weight_block_size is not None\u0060 appears character-identically in 4 files \u2014 python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py, python/mlc_llm/model/ministral3/ministral3_loader.py, python/mlc_llm/model/qwen3/qwen3_loader.py, python/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_loader.py"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0c8b141863c0f71e1e060d100e75c3e63bd8093833c93f248e910ffcabd0990"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060not isinstance(self.weight_block_size, (tuple, list)) or len(self.weight_block_size) != 2\u0060 appears character-identically in 3 files \u2014 python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py, python/mlc_llm/model/ministral3/ministral3_model.py, python/mlc_llm/model/qwen3/qwen3_model.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"1756627f74cd3fd79b768fccd00b184bf08102d34823359e8634e662d2133836"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060op_ext.get_store().cutlass_group_gemm and self.dtype in [ \u0022float16\u0022, \u0022bfloat16\u0022, ]\u0060 appears character-identically in 2 files \u2014 python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py, python/mlc_llm/model/qwen3_moe/qwen3_moe_model.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py"},"region":{"startLine":476}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8487a757cb56b5d40fa75d502c4cc32677c54e7661755856a5e3e663f85eec8"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060op_ext.get_store().cutlass_group_gemm or op_ext.get_store().faster_transformer\u0060 appears character-identically in 2 files \u2014 python/mlc_llm/model/minicpm/minicpm_model.py, python/mlc_llm/model/mixtral/mixtral_model.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/minicpm/minicpm_model.py"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc7640871e40918be11d6d129ef6007b5e60572e642e9342860b165e0b421ae4"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060os.environ.get(\u0022MLC_MACABI_ARCH\u0022, \u0022\u0022).strip() or \u0022arm64\u0022\u0060 appears character-identically in 2 files \u2014 python/mlc_llm/interface/package.py, python/mlc_llm/support/auto_target.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/interface/package.py"},"region":{"startLine":329}}}],"partialFingerprints":{"codehealthFindingId/v1":"580551b1fc985d3bec8d68a0949e313a0b644830c0b6e1cd75df6bf2fe503981"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060self.bias is not None and self.out_dtype is None\u0060 appears character-identically in 5 files \u2014 python/mlc_llm/quantization/awq_quantization.py, python/mlc_llm/quantization/block_scale_quantization.py, python/mlc_llm/quantization/ft_quantization.py, python/mlc_llm/quantization/group_quantization.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/quantization/awq_quantization.py"},"region":{"startLine":281}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d580ab63267dd80592dbd0a159ae712f10760b8564565db7a368043fdb96e01"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060self.intermediate_size or int(self.hidden_size * 3.5) // 32 * 32\u0060 appears character-identically in 2 files \u2014 python/mlc_llm/model/rwkv5/rwkv5_model.py, python/mlc_llm/model/rwkv6/rwkv6_model.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_model.py"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4d1b56b83b1b08896a9f14ed4f849a9974d6e300ff71bcdec648e41750411a1"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060self.num_key_value_heads == 0 or self.num_key_value_heads is None\u0060 appears character-identically in 4 files \u2014 python/mlc_llm/model/cohere/cohere_model.py, python/mlc_llm/model/phi/phi_model.py, python/mlc_llm/model/phi3/phi3_model.py, python/mlc_llm/model/phi3v/phi3v_model.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/cohere/cohere_model.py"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"74a11e26a12859e70482f84cfe41361d92c966634c95cfb97f6b9206f7ca6060"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060self.pipeline_parallel_stages \u003C= 0 or self.pipeline_parallel_stages \u003E self.num_hidden_layers\u0060 appears character-identically in 3 files \u2014 python/mlc_llm/model/llama/llama_model.py, python/mlc_llm/model/olmo/olmo_model.py, python/mlc_llm/model/olmo2/olmo2_model.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/llama/llama_model.py"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b757ccff02d3a4280863c01558e9e0bd2404f6f6e94c7bf207bbb207499db16"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060self.rescale_every \u003E 0 and (self.layer_id \u002B 1) % self.rescale_every == 0\u0060 appears character-identically in 2 files \u2014 python/mlc_llm/model/rwkv5/rwkv5_model.py, python/mlc_llm/model/rwkv6/rwkv6_model.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/rwkv5/rwkv5_model.py"},"region":{"startLine":291}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8346664271b7f8a05a2fe7c4f35f689b17980d334fc3e8f42efed3944e8f3b1"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060target.Target.current() and target.Target.current().kind.name == \u0022webgpu\u0022\u0060 appears character-identically in 4 files \u2014 python/mlc_llm/model/gemma3/gemma3v_model.py, python/mlc_llm/model/llava/llava_model.py, python/mlc_llm/model/phi3v/phi3v_model.py, python/mlc_llm/model/qwen35/qwen35v_model.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/model/gemma3/gemma3v_model.py"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bc669f43e42294cbc60351d4aa9b53d50ab86f43a3643deef53d6ba060901bf"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060except Exception\u0060 takes every exception and records none of it \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"python/mlc_llm/cli/check_device.py"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b34f4a9daaeb02e9f1d3e07db712aa6562f6dfe365c25133224f26d7a443aa1"}}],"taxonomies":[{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d","organization":"MITRE","informationUri":"https://cwe.mitre.org/","isComprehensive":false,"shortDescription":{"text":"The MITRE Common Weakness Enumeration (CWE)."},"taxa":[{"id":"CWE-1104","guid":"4c918cb5-b2a6-6c55-9963-a44ee464305e","name":"Use of Unmaintained Third Party Components","shortDescription":{"text":"Use of Unmaintained Third Party Components"},"helpUri":"https://cwe.mitre.org/data/definitions/1104.html"},{"id":"CWE-1329","guid":"f70f1c3f-4ccf-cb5e-bdd3-03ba4868d36d","name":"Reliance on Component That is Not Updateable","shortDescription":{"text":"Reliance on Component That is Not Updateable"},"helpUri":"https://cwe.mitre.org/data/definitions/1329.html"},{"id":"CWE-1357","guid":"e4d2e772-757e-0a5c-bd7d-77052949d866","name":"Reliance on Insufficiently Trustworthy Component","shortDescription":{"text":"Reliance on Insufficiently Trustworthy Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1357.html"},{"id":"CWE-1395","guid":"800e09e7-c11a-8654-9fa6-86f398995fed","name":"Dependency on Vulnerable Third-Party Component","shortDescription":{"text":"Dependency on Vulnerable Third-Party Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1395.html"},{"id":"CWE-214","guid":"b10ad120-fb22-1351-9348-aa23b453e815","name":"CWE-214","shortDescription":{"text":"CWE-214"},"helpUri":"https://cwe.mitre.org/data/definitions/214.html"},{"id":"CWE-259","guid":"ae9ad959-fbb6-9d5e-892d-3dca66da0b69","name":"Use of Hard-coded Password","shortDescription":{"text":"Use of Hard-coded Password"},"helpUri":"https://cwe.mitre.org/data/definitions/259.html"},{"id":"CWE-319","guid":"7af97476-9f0d-4458-9163-3d2043918a1a","name":"Cleartext Transmission of Sensitive Information","shortDescription":{"text":"Cleartext Transmission of Sensitive Information"},"helpUri":"https://cwe.mitre.org/data/definitions/319.html"},{"id":"CWE-327","guid":"e51910ff-67b5-3c51-aa3d-92837d9eab90","name":"Use of a Broken or Risky Cryptographic Algorithm","shortDescription":{"text":"Use of a Broken or Risky Cryptographic Algorithm"},"helpUri":"https://cwe.mitre.org/data/definitions/327.html"},{"id":"CWE-353","guid":"09d7e902-d4ee-f05d-ae6c-0a1554d0c18f","name":"Missing Support for Integrity Check","shortDescription":{"text":"Missing Support for Integrity Check"},"helpUri":"https://cwe.mitre.org/data/definitions/353.html"},{"id":"CWE-494","guid":"b8a65e0d-e459-4a55-a931-fc1136482375","name":"Download of Code Without Integrity Check","shortDescription":{"text":"Download of Code Without Integrity Check"},"helpUri":"https://cwe.mitre.org/data/definitions/494.html"},{"id":"CWE-506","guid":"401d6455-56e3-0552-9a39-f77461673e3f","name":"Embedded Malicious Code","shortDescription":{"text":"Embedded Malicious Code"},"helpUri":"https://cwe.mitre.org/data/definitions/506.html"},{"id":"CWE-532","guid":"1cd8877a-76e8-ce54-b40b-779af23364a0","name":"Insertion of Sensitive Information into Log File","shortDescription":{"text":"Insertion of Sensitive Information into Log File"},"helpUri":"https://cwe.mitre.org/data/definitions/532.html"},{"id":"CWE-77","guid":"332c8ade-6612-9f56-a06b-d8d90b1a8750","name":"Improper Neutralization of Special Elements used in a Command (\u0027Command Injection\u0027)","shortDescription":{"text":"Improper Neutralization of Special Elements used in a Command (\u0027Command Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/77.html"},{"id":"CWE-78","guid":"2e31ceaf-c7ae-2e5e-9661-cfb1362789cf","name":"Improper Neutralization of Special Elements used in an OS Command (\u0027OS Command Injection\u0027)","shortDescription":{"text":"Improper Neutralization of Special Elements used in an OS Command (\u0027OS Command Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/78.html"},{"id":"CWE-79","guid":"fd45580b-e8c4-fc5e-8c2f-aa8fab0b4dbf","name":"Improper Neutralization of Input During Web Page Generation (\u0027Cross-site Scripting\u0027)","shortDescription":{"text":"Improper Neutralization of Input During Web Page Generation (\u0027Cross-site Scripting\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/79.html"},{"id":"CWE-798","guid":"5e8f057d-fee3-995a-a0cb-9fc5b0d174d1","name":"Use of Hard-coded Credentials","shortDescription":{"text":"Use of Hard-coded Credentials"},"helpUri":"https://cwe.mitre.org/data/definitions/798.html"},{"id":"CWE-829","guid":"13c33925-97fb-5a5e-b40c-56d328b8a4d7","name":"Inclusion of Functionality from Untrusted Control Sphere","shortDescription":{"text":"Inclusion of Functionality from Untrusted Control Sphere"},"helpUri":"https://cwe.mitre.org/data/definitions/829.html"},{"id":"CWE-89","guid":"6d08fdad-37eb-c150-bbf0-d7d946863407","name":"Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027)","shortDescription":{"text":"Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/89.html"},{"id":"CWE-937","guid":"16f316ae-415c-b354-a59b-1f7905f756e9","name":"Using Components with Known Vulnerabilities","shortDescription":{"text":"Using Components with Known Vulnerabilities"},"helpUri":"https://cwe.mitre.org/data/definitions/937.html"},{"id":"CWE-94","guid":"75e7f50c-6c2f-dd52-bf40-bf6c52b861fd","name":"Improper Control of Generation of Code (\u0027Code Injection\u0027)","shortDescription":{"text":"Improper Control of Generation of Code (\u0027Code Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/94.html"},{"id":"CWE-95","guid":"400bba4e-483c-5c50-a695-114fa9168003","name":"Improper Neutralization of Directives in Dynamically Evaluated Code (\u0027Eval Injection\u0027)","shortDescription":{"text":"Improper Neutralization of Directives in Dynamically Evaluated Code (\u0027Eval Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/95.html"}]},{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61","version":"2025","organization":"OWASP Foundation","informationUri":"https://top10.owasp.org/2025/","isComprehensive":false,"shortDescription":{"text":"The OWASP Top 10:2025 web application security risks."},"taxa":[{"id":"A03:2025","guid":"168e227c-7735-2e57-bc6e-997affe644c5","name":"Software Supply Chain Failures","shortDescription":{"text":"Software Supply Chain Failures"},"helpUri":"https://top10.owasp.org/2025/A03_2025-Software_Supply_Chain_Failures/"},{"id":"A04:2025","guid":"6a9f5bfd-1a56-6453-beec-a7eff0ba3007","name":"Cryptographic Failures","shortDescription":{"text":"Cryptographic Failures"},"helpUri":"https://top10.owasp.org/2025/A04_2025-Cryptographic_Failures/"},{"id":"A05:2025","guid":"87e86033-3231-8458-8e4a-5cb82743553a","name":"Injection","shortDescription":{"text":"Injection"},"helpUri":"https://top10.owasp.org/2025/A05_2025-Injection/"},{"id":"A07:2025","guid":"334ddd78-539d-d35c-83dd-253647eb7eaf","name":"Authentication Failures","shortDescription":{"text":"Authentication Failures"},"helpUri":"https://top10.owasp.org/2025/A07_2025-Authentication_Failures/"},{"id":"A08:2025","guid":"84b0c297-710e-9a5f-9335-936ecb260c36","name":"Software or Data Integrity Failures","shortDescription":{"text":"Software or Data Integrity Failures"},"helpUri":"https://top10.owasp.org/2025/A08_2025-Software_or_Data_Integrity_Failures/"},{"id":"A09:2025","guid":"78892bc9-3c98-495d-881c-8af1390d643c","name":"Security Logging \u0026 Alerting Failures","shortDescription":{"text":"Security Logging \u0026 Alerting Failures"},"helpUri":"https://top10.owasp.org/2025/A09_2025-Security_Logging_and_Alerting_Failures/"}]},{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35","organization":"OWASP Foundation","informationUri":"https://owasp.org/www-project-top-10-ci-cd-security-risks/","isComprehensive":false,"shortDescription":{"text":"The OWASP Top 10 CI/CD Security Risks."},"taxa":[{"id":"CICD-SEC-3","guid":"458c83a6-ebf7-cf55-8cc3-b4d949bbf271","name":"Dependency Chain Abuse","shortDescription":{"text":"Dependency Chain Abuse"},"helpUri":"https://owasp.github.io/www-project-top-10-ci-cd-security-risks/CICD-SEC-03-Dependency-Chain-Abuse"},{"id":"CICD-SEC-5","guid":"cc7f4610-8859-e654-9029-d5f97d992220","name":"Insufficient PBAC (Pipeline-Based Access Controls)","shortDescription":{"text":"Insufficient PBAC (Pipeline-Based Access Controls)"},"helpUri":"https://owasp.github.io/www-project-top-10-ci-cd-security-risks/CICD-SEC-05-Insufficient-PBAC"},{"id":"CICD-SEC-8","guid":"b6b2dacf-a168-4957-876e-a8c73ee00eb0","name":"Ungoverned Usage of 3rd Party Services","shortDescription":{"text":"Ungoverned Usage of 3rd Party Services"},"helpUri":"https://owasp.github.io/www-project-top-10-ci-cd-security-risks/CICD-SEC-08-Ungoverned-Usage-of-3rd-Party-Services"},{"id":"CICD-SEC-9","guid":"b3d36727-0395-5b51-94c4-5e173d62eab3","name":"Improper Artifact Integrity Validation","shortDescription":{"text":"Improper Artifact Integrity Validation"},"helpUri":"https://owasp.github.io/www-project-top-10-ci-cd-security-risks/CICD-SEC-09-Improper-Artifact-Integrity-Validation"}]}],"properties":{"codehealthPublication":{"public":true,"notice":"This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings \u2014 which rule fired, in which file, on which line, and how to fix it \u2014 are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.","securityFindingsRedacted":33,"secretScannerRunsExcluded":0}},"redactionTokens":["A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."]}]}