You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three distinct problems — agent/LLM token cost, GitHub tool interaction, and GitHub UI/search — all stem from the same root cause: files that have grown without a size budget. This issue tracks candidates for splitting and flags files that break specific documented thresholds.
Audit methodology: git ls-tree -r -l HEAD for byte sizes, git show | split for per-file line and max-line-length, git log --oneline --since=2.years for 2-year commit counts. No large files were opened whole; the audit itself was non-destructive.
Confirmed thresholds
Limit
Value
Source
view tool truncation
20 KB
Tool documentation
Agent token cost
morph.cpp (~585 KB) ≈ 137k tokens ≈ 200 AI credits per full read
A separate class of problem: these files are loaded as context by LLM agents. The 20 KB view tool truncation applies to files an agent reads at runtime (build config, KB docs, referenced instruction files). Empirical testing confirmed that SKILL.md files are injected in full by the skill loader — not via view — so their content is not silently truncated on invocation. Large skill files still consume more context budget per use, and any secondary files those skills reference at runtime (e.g. pr-assessment.md, .github/instructions/*.md) remain subject to the 20 KB truncation.
Agent definition; loading mechanism not empirically tested
The six .lock.yml files are the most acute: each is ~120 KB of binary-encoded metadata that an agent cannot reason about, and all six appear in any *.yml glob of .github/workflows/.
*.PlatformNotSupported.cs intrinsics stubs — maintained alongside their real counterparts by design
Candidate work items (priority order)
Split src/coreclr/jit/gentree.cpp — 1.2 MB / 37k lines / 289 commits/2y. One full read exceeds the 128k-token context of most models. Natural seams: node construction, printing, fgMorphXxx helpers, flag management, assertion logic.
Decompose src/coreclr/jit/compiler.h — 524 KB / 13.7k lines / 392 commits/2y (highest churn in repo). Included by every JIT translation unit. Split by phase state, liveness helpers, assertion structs, opt flags.
Split importer pipeline — importer.cpp (563 KB / 129 commits) + importercalls.cpp (502 KB / 158 commits). Both exceed code search and diff limits. Further split by opcode category (arithmetic/compare, memory, control flow, calls).
Address ref assembly size/line-length — System.Runtime.cs (1.57 MB, max line 2,652 chars trips code search 1,024-char truncation). System.Runtime.Intrinsics.cs (2.05 MB, ~490k tokens). Whether split by logical area or otherwise is an api-review-process question.
Split src/coreclr/vm/jitinterface.cpp — 521 KB / 16k lines / 188 commits/2y. Second-highest-churn VM file; every meaningful change produces a partially-hidden diff. Natural split: helper implementations, EE callbacks for type/method queries, JIT code manager helpers.
Split src/coreclr/jit/morph.cpp + lower.cpp — morph.cpp (572 KB / 190 commits) is the calibration file at ~200 AI credits per read. lower.cpp (479 KB / 177 commits) already has a precedent split with lowerxarch.cpp. Both exceed code search and diff limits.
Note
This issue was researched and drafted with GitHub Copilot (Claude Sonnet 4.6). The analysis methodology, threshold verification, and prioritization were performed autonomously from git metadata without opening large files. Thresholds were confirmed against official documentation where available; the blob-view rendering limit (~1 MB) is noted as unverified.
Summary
Three distinct problems — agent/LLM token cost, GitHub tool interaction, and GitHub UI/search — all stem from the same root cause: files that have grown without a size budget. This issue tracks candidates for splitting and flags files that break specific documented thresholds.
Audit methodology:
git ls-tree -r -l HEADfor byte sizes,git show | splitfor per-file line and max-line-length,git log --oneline --since=2.yearsfor 2-year commit counts. No large files were opened whole; the audit itself was non-destructive.Confirmed thresholds
viewtool truncation160 files in the repo currently exceed the 350 KiB code search exclusion.
Native (JIT core)
Files are hand-maintained, in active development, and exceed the code search exclusion and/or the per-file diff limit.
src/coreclr/jit/gentree.cppsrc/coreclr/jit/compiler.hsrc/coreclr/jit/emitxarch.cppsrc/coreclr/jit/emitarm64sve.cppsrc/coreclr/jit/morph.cppsrc/coreclr/jit/valuenum.cppsrc/coreclr/jit/lsra.cppsrc/coreclr/jit/importer.cppsrc/coreclr/jit/importercalls.cppsrc/coreclr/jit/lower.cppsrc/coreclr/jit/compiler.cppsrc/coreclr/jit/codegenxarch.cppsrc/coreclr/jit/lowerxarch.cppsrc/coreclr/jit/instrsxarch.hsrc/coreclr/jit/emit.cppsrc/coreclr/jit/gentree.hNative (VM / Debug / Mono)
src/coreclr/vm/jitinterface.cppsrc/coreclr/vm/methodtablebuilder.cppsrc/coreclr/vm/excep.cppsrc/coreclr/vm/proftoeeinterfaceimpl.cppsrc/coreclr/debug/ee/debugger.cppsrc/coreclr/debug/di/process.cppsrc/coreclr/debug/di/rspriv.hsrc/coreclr/tools/superpmi/superpmi-shared/methodcontext.cppsrc/mono/mono/mini/mini-llvm.csrc/mono/mono/mini/aot-compiler.csrc/mono/mono/mini/method-to-ir.cManaged
src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cssrc/libraries/System.Runtime/ref/System.Runtime.cssrc/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cssrc/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cssrc/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cssrc/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Emitter.cssrc/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cssrc/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs.githubinstruction / skill filesA separate class of problem: these files are loaded as context by LLM agents. The 20 KB
viewtool truncation applies to files an agent reads at runtime (build config, KB docs, referenced instruction files). Empirical testing confirmed that SKILL.md files are injected in full by the skill loader — not viaview— so their content is not silently truncated on invocation. Large skill files still consume more context budget per use, and any secondary files those skills reference at runtime (e.g.pr-assessment.md,.github/instructions/*.md) remain subject to the 20 KB truncation..github/workflows/ci-failure-scan-feedback.lock.ymlgh-awlockfile; looks like a real workflow to glob, contains only SHAs and hashes.github/workflows/holistic-review.lock.yml.github/workflows/ci-failure-fix.lock.yml.github/workflows/closed-issue-reference-check.lock.yml.github/workflows/ci-failure-scan.lock.yml.github/workflows/breaking-change-doc.lock.yml.github/workflows/holistic-review-orchestrator.yml.github/workflows/ci-failure-scan.mdDirectory.Build.propsviewwhen investigating any build issue; always truncated.github/workflows/ci-failure-fix.md.github/skills/issue-triage/SKILL.md.github/agents/system-net-review.agent.md.github/workflows/ci-failure-scan-feedback.md.github/skills/code-review/SKILL.md.github/skills/api-proposal/SKILL.md.github/workflows/shared/create-kbe.instructions.md.github/agents/extensions-reviewer.agent.mdThe six
.lock.ymlfiles are the most acute: each is ~120 KB of binary-encoded metadata that an agent cannot reason about, and all six appear in any*.ymlglob of.github/workflows/.Generated / by-design (not action items)
src/coreclr/pal/prebuilt/inc/corprof.h/cordebug.h/xclrdata.h— MIDL-generated ("this ALWAYS GENERATED file")src/coreclr/ilasm/prebuilt/asmparse.cpp— Bison-generatedsrc/coreclr/debug/ee/amd64/amd64InstrDecode.h— machine-generated, seegen_amd64InstrDecode/README.mdsrc/tools/ilasm/src/ILAssembler/gen/CILParser.cs—<auto-generated>src/tests/JIT/jit64/opt/cse/hugeexpr1.csand siblings — intentionally enormous CSE stress testssrc/native/external/**— vendored external code (brotli, zlib-ng, zstd, valgrind)*.PlatformNotSupported.csintrinsics stubs — maintained alongside their real counterparts by designCandidate work items (priority order)
Split
src/coreclr/jit/gentree.cpp— 1.2 MB / 37k lines / 289 commits/2y. One full read exceeds the 128k-token context of most models. Natural seams: node construction, printing,fgMorphXxxhelpers, flag management, assertion logic.Decompose
src/coreclr/jit/compiler.h— 524 KB / 13.7k lines / 392 commits/2y (highest churn in repo). Included by every JIT translation unit. Split by phase state, liveness helpers, assertion structs, opt flags.Split importer pipeline —
importer.cpp(563 KB / 129 commits) +importercalls.cpp(502 KB / 158 commits). Both exceed code search and diff limits. Further split by opcode category (arithmetic/compare, memory, control flow, calls).Address ref assembly size/line-length —
System.Runtime.cs(1.57 MB, max line 2,652 chars trips code search 1,024-char truncation).System.Runtime.Intrinsics.cs(2.05 MB, ~490k tokens). Whether split by logical area or otherwise is an api-review-process question.Split
src/coreclr/vm/jitinterface.cpp— 521 KB / 16k lines / 188 commits/2y. Second-highest-churn VM file; every meaningful change produces a partially-hidden diff. Natural split: helper implementations, EE callbacks for type/method queries, JIT code manager helpers.Split
src/coreclr/jit/morph.cpp+lower.cpp—morph.cpp(572 KB / 190 commits) is the calibration file at ~200 AI credits per read.lower.cpp(479 KB / 177 commits) already has a precedent split withlowerxarch.cpp. Both exceed code search and diff limits.Note
This issue was researched and drafted with GitHub Copilot (Claude Sonnet 4.6). The analysis methodology, threshold verification, and prioritization were performed autonomously from
gitmetadata without opening large files. Thresholds were confirmed against official documentation where available; the blob-view rendering limit (~1 MB) is noted as unverified.