Repository navigation
[http-client-csharp] Prototype compiler-backed structural C# reduction - #12432
Draft
Wei Hu (live1206) wants to merge 4 commits into
Draft
Wei Hu (live1206) wants to merge 4 commits into
Wei Hu (live1206) wants to merge 4 commits into
Conversation
commit: |
Contributor
|
No changes needing a change description found. |
Consolidate the provider-aware prototype, accepted structural rules through C9, supporting benchmarks and regression coverage. Keep Roslyn as the default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Wei Hu (live1206)
force-pushed
the
prototype/provider-name-reducer
branch
from
October 29, 2026 09:37
1f5245a to
a6134d0
Compare
Add the accepted stable-method SELF interface-cast qualification slice and its diagnostic/import/source regression coverage. Update the published prototype status and residual inventory. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #12442
Opt-in compiler-backed C# structural reduction through C9, SDK-shaped cast/interface qualification, both Optional.IsDefined refinements, bounded whole-cref import activation/exception provenance, and branch-local static invocations. Enable with
TYPESPEC_PROVIDER_REDUCER=structural; Roslyn remains the default.Original writer provenance and shared original-compilation facts feed one rewrite traversal and final serialization. Unsupported cases retain their spelling, without a Roslyn fallback, per-edit production compilation or occurrence-acceptance cache.
Applied rules
this., attribute names/suffixes, optional defaults and grammar-safe parentheses/statement cleanup.((IPersistableModel<T>)this)receivers: recorded interface heads and enclosing SELF-model arguments only, with import witnesses and exact composed-type/parser/source proofs. No cast removal or foreign-model expansion.The paused serialization-context experiment and deferred imported-cref code-witness prototype are not included. Historical C3, C6
nameof, C7 method-callthisand C10 SDK-shaped generic inference remain excluded.Pre-merge saved AppService evaluation
Same saved input/reference, 2,301 emitted files. Counts are canonical syntax events, not diff lines or promises for other SDKs.
Latest delta: 1,255 static-receiver prefix removals /596 files—627 JsonDocument,627 JsonSerializer and1 BinaryData.FromString. All other categories unchanged; every changed output independently reconstructed through UTF16 deletions with exact UTF8/BOM parity. Remaining largest categories: type names3,940; method-call
this.3,834; static receivers2,811;nameof2,399; crefs1,945.Change-specific validation
Merged
mainat6ba281975981910906590563363d16e74b5fbf47; resolved the binary-expression writer conflict while retaining both main'sAddParenthesesoption and grammar-safe unparenthesized statement emission..Defaulterrors are preserved, not repaired or ignored.Limits
The saved SDK measurements above belong to the pre-merge source epoch. They are not post-merge whole-SDK semantic/compiler/emit/native/API clearance. Historical CAST validation included full implementation/local integration checks and net10 GA AppService1.5.0 API/byte-identical XML; that evidence is not automatically inherited by later permissions or the main merge. Broader SDK semantic/native/API/whole-XML validation and fresh netstandard2.0/net8.0/comparative profiling remain pending. The oversized context graph pipeline remains stopped.
This remains a draft prototype, not default enablement or a complete Roslyn-simplifier replacement. Large local captures/benchmarks and separately paused work are intentionally not committed. Status:
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/perf/ProviderReducerStatus.md.- by copilot