Priority: P2 selective-build footprint. Not a release blocker or a claim of measured executable savings.
Evidence at #707 3d955ff998eef120cd398f163c613a54e3383ccb
Consequently, adding Metal to a lite build activates a large unrelated grammar dependency even though the adapter uses the same C++ extraction path. A full build already selects that bundle for other languages, so this is specifically an avoidable selective-build cost; do not claim a default/full release reduction from this feature-edge change alone.
Smallest change
Make lang-metal depend on the actual C++ grammar provider rather than large-grammars (the existing medium-grammars boundary is the immediate candidate). Keep .metal dispatch and retained-tree behavior. Do not introduce a new Metal parser, a grammar registry framework, a dependency fork or another capability matrix for this alias.
Verify the exact C++ grammar identity/output being selected before making the change. With both bundles enabled, the later table entries can replace an earlier same-key entry; do not assume the two upstream bundle snapshots have byte-identical C++ parsers without checking. If they differ, preserve the intended supported C++/Metal behavior explicitly and separate any grammar upgrade from this packaging cut. Do not silently exchange syntax behavior to obtain a smaller dependency graph.
Acceptance
- A fresh
--no-default-features --features lite,lang-metal extraction build no longer resolves/compiles the large grammar bundle solely for Metal.
- A narrow
--no-default-features --features lang-metal build has the parser its registered adapter needs and can extract a real Metal fixture.
- Full and retained/incremental extraction preserve canonical nodes, spans, relations and refusals on the existing Metal/C++ regression corpus. This proves the actual adapter boundary, not a hard-coded inventory of every Cargo feature edge.
- Report resolved grammar dependencies, native archive/rlib bytes, clean build time and stripped binary size separately where measured. Linker dead stripping and duplicate grammar copies must be measured rather than guessed.
- Ordinary full-feature languages remain available; the patched Rust grammar and dedicated Markdown binding are unchanged.
Related
#978's main Markdown/lite problem is already fixed and closed; its closure reports actual reductions. This is a separate unnecessary dependency edge exposed after that cut, not a request to reopen #978 or restore the old duplicated cfg inventories. #1053 owns the vendor review split and #1054 WGSL provenance/build invalidation. Keep #707 draft. Source inspection only; no Cargo builds, parser tests or size benchmarks were executed for this issue.
Priority: P2 selective-build footprint. Not a release blocker or a claim of measured executable savings.
Evidence at #707
3d955ff998eef120cd398f163c613a54e3383ccbcrates/tracedecay-code-extraction/Cargo.tomldeclareslang-metal = ["large-grammars"]; that feature activates the optionaltokensave-large-treesittersdependency.src/metal_extractor.rshas no Metal-specific parser: full extraction delegates toCppExtractor::extract_source, and retained-tree extraction delegates toCppExtractor::extract_parsed.src/lib.rs::LanguageExtractor::retained_grammar_keymaps bothC++andMetaltocpp.src/ts_provider.rs::build_language_tablealready supplies C++ from the medium bundle used by lite. Enabling the large bundle constructs its entire language table, filtering only the separately supplied Rust and Markdown entries.Consequently, adding Metal to a lite build activates a large unrelated grammar dependency even though the adapter uses the same C++ extraction path. A full build already selects that bundle for other languages, so this is specifically an avoidable selective-build cost; do not claim a default/full release reduction from this feature-edge change alone.
Smallest change
Make
lang-metaldepend on the actual C++ grammar provider rather thanlarge-grammars(the existingmedium-grammarsboundary is the immediate candidate). Keep.metaldispatch and retained-tree behavior. Do not introduce a new Metal parser, a grammar registry framework, a dependency fork or another capability matrix for this alias.Verify the exact C++ grammar identity/output being selected before making the change. With both bundles enabled, the later table entries can replace an earlier same-key entry; do not assume the two upstream bundle snapshots have byte-identical C++ parsers without checking. If they differ, preserve the intended supported C++/Metal behavior explicitly and separate any grammar upgrade from this packaging cut. Do not silently exchange syntax behavior to obtain a smaller dependency graph.
Acceptance
--no-default-features --features lite,lang-metalextraction build no longer resolves/compiles the large grammar bundle solely for Metal.--no-default-features --features lang-metalbuild has the parser its registered adapter needs and can extract a real Metal fixture.Related
#978's main Markdown/lite problem is already fixed and closed; its closure reports actual reductions. This is a separate unnecessary dependency edge exposed after that cut, not a request to reopen #978 or restore the old duplicated cfg inventories. #1053 owns the vendor review split and #1054 WGSL provenance/build invalidation. Keep #707 draft. Source inspection only; no Cargo builds, parser tests or size benchmarks were executed for this issue.