Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
b41220a
Optimize qualified name simplification
live1206 Jun 3, 2026
4870164
Handle System member qualified name reduction
live1206 Jun 4, 2026
59eb312
Avoid ambiguous System member pre-reduction
live1206 Jun 4, 2026
5bbd4eb
Revert "Avoid ambiguous System member pre-reduction"
live1206 Jun 4, 2026
47fbfa9
Experiment with manual generated name reduction
live1206 Jun 4, 2026
f25c028
Reduce global aliases in manual name experiment
live1206 Jun 4, 2026
bbf0305
Handle global aliases in cast type arguments
live1206 Jun 4, 2026
8e5c569
Reduce qualified names iteratively
live1206 Jun 4, 2026
d867864
Match generated baselines without Roslyn simplifier
live1206 Jun 4, 2026
6c536ed
Add post-processing benchmark
live1206 Jun 4, 2026
90def0a
Support scaled post-processing benchmark corpora
live1206 Jun 4, 2026
e4019d3
Reduce manual post-processing passes
live1206 Jun 4, 2026
8f6da6a
Profile C# post-processing benchmarks
live1206 Jun 11, 2026
c11ae82
Add provider reference map shadow replacement
live1206 Jun 12, 2026
ff55509
Profile C# post-processing benchmarks
live1206 Jun 11, 2026
f022e78
Add provider reference map shadow replacement
live1206 Jun 12, 2026
f88a64a
Revert "Profile C# post-processing benchmarks"
live1206 Jun 12, 2026
2d57265
Remove hybrid map diagnostics from generator
live1206 Jun 12, 2026
dc145f4
Rename hybrid reference map components
live1206 Jun 12, 2026
0cc3abf
Document hybrid reference map decisions
live1206 Jun 12, 2026
c2abe79
Fix hybrid reference map CI failures
live1206 Jun 12, 2026
a5f8d40
Update provider reference map benchmarks
live1206 Jun 12, 2026
c463995
Track serialization providers in hybrid reference map
live1206 Jun 12, 2026
df00d67
Track serialization providers in benchmark reference map
live1206 Jun 12, 2026
9a1d1a1
Handle model factory subclasses in reference map
live1206 Jun 12, 2026
2917111
Track generated body type references
live1206 Jun 15, 2026
2cda184
Match Roslyn cleanup for body references
live1206 Jun 15, 2026
ce16922
Remove unused serialization providers
live1206 Jun 15, 2026
7a32814
Merge remote-tracking branch 'origin/main' into mtg-hybrid-reference-map
live1206 Jun 15, 2026
5a8248f
Preserve public discriminator subtypes
live1206 Jun 15, 2026
27e121e
Sync benchmark reference map parity fixes
live1206 Jun 15, 2026
43529f3
Use explicit serialization helper dependencies
live1206 Jun 15, 2026
21ecc1a
Use explicit collection result dependencies
live1206 Jun 15, 2026
8bb0d29
Benchmark explicit provider dependencies
live1206 Jun 15, 2026
f3259a4
Use explicit client body dependencies
live1206 Jun 15, 2026
b6e8aad
Track rest client helper dependencies
live1206 Jun 15, 2026
74bd30c
Use explicit client body dependencies
live1206 Jun 15, 2026
8da04b0
Track rest client helper dependencies
live1206 Jun 15, 2026
48885cb
Skip stubbed client body dependencies
live1206 Jun 15, 2026
aa94fa3
Skip stubbed client body dependencies
live1206 Jun 15, 2026
c6539de
Internalize models from final API reachability
live1206 Jun 16, 2026
f676243
Update model root visibility test
live1206 Jun 16, 2026
0a37522
Detect custom model factory providers
live1206 Jun 16, 2026
582fa84
Preserve file header when removing usings
live1206 Jun 16, 2026
74be26d
Limit derived public reachability to discriminators
live1206 Jun 16, 2026
dc6f0f2
Ignore custom roots for derived public reachability
live1206 Jun 16, 2026
7c20ef2
Propagate public discriminator reachability transitively
live1206 Jun 17, 2026
2e4af08
Keep enum serialization helpers reachable
live1206 Jun 17, 2026
8919ffc
Fix XML doc reference spelling
live1206 Jun 17, 2026
4d60b88
perf(http-client-csharp): optimize reference map post-processing
live1206 Jun 19, 2026
26181a8
Merge remote-tracking branch 'origin/main' into mtg-manual-name-reduc…
live1206 Jun 19, 2026
ac2717b
perf(http-client-csharp): optimize reference map post-processing
live1206 Jun 19, 2026
00ca133
fix(http-client-csharp): preserve generated public baseline roots
live1206 Jun 19, 2026
abd3760
fix(http-client-csharp): preserve provider map regen parity
live1206 Jun 21, 2026
620063d
fix(http-client-csharp): preserve dictionary helper body references
live1206 Jun 21, 2026
11ac8ba
Merge remote-tracking branch 'origin/main' into mtg-hybrid-reference-map
live1206 Jun 22, 2026
ce1fef1
fix(http-client-csharp): preserve rest client helper references
live1206 Jun 22, 2026
281af2a
fix(http-client-csharp): limit helper reference fallback
live1206 Jun 22, 2026
12338c4
fix(http-client-csharp): preserve generated internal accessibility
live1206 Jun 22, 2026
9bbb09c
fix(http-client-csharp): preserve last contract roots
live1206 Jun 22, 2026
45d9a27
perf(http-client-csharp): update hybrid reference map benchmark
live1206 Jun 23, 2026
32840a5
perf(http-client-csharp): avoid stale generated roots in benchmark
live1206 Jun 23, 2026
47998b8
perf(http-client-csharp): use current generated roots
live1206 Jun 23, 2026
4117135
fix(http-client-csharp): preserve hybrid reference map parity
live1206 Jun 23, 2026
fa09582
fix(http-client-csharp): keep non-azure union roots
live1206 Jun 23, 2026
d055a32
fix(http-client-csharp): keep enum serialization dependencies
live1206 Jun 24, 2026
0eb6ca5
fix(http-client-csharp): retain custom enum serialization providers
live1206 Jun 24, 2026
b8a5c3a
fix(http-client-csharp): scan serialization provider references
live1206 Jun 24, 2026
912ffe0
fix(http-client-csharp): preserve base-kept dependencies
live1206 Jun 24, 2026
db768fa
perf(http-client-csharp): update hybrid benchmark analyzer
live1206 Jun 24, 2026
57ed559
perf(http-client-csharp): reduce provider reference map overhead
live1206 Jun 24, 2026
88bea57
perf(http-client-csharp): reduce provider reference map analysis cost
live1206 Jun 24, 2026
7b3c0f1
perf(http-client-csharp): scan generated bodies without helper symbol…
live1206 Jun 24, 2026
18b8131
fix(http-client-csharp): preserve generated client helpers
live1206 Jun 24, 2026
b14b1f2
fix(http-client-csharp): preserve generated client helpers
live1206 Jun 24, 2026
4e4f67e
Merge origin/main into mtg-hybrid-reference-map
live1206 Jun 25, 2026
d58bebe
fix(http-client-csharp): add braces for cop check
live1206 Jun 25, 2026
b333b96
Merge latest hybrid reference map changes into benchmark
live1206 Jun 25, 2026
b3a872f
fix(http-client-csharp): preserve provider map signature reachability
live1206 Jun 25, 2026
f4a1bbb
perf(http-client-csharp): align benchmark provider map fix
live1206 Jun 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@typespec/http-client-csharp"
---

Improve C# generator post-processing reference-map parity and performance.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@typespec/http-client-csharp"
---

Tune hybrid provider reference-map benchmark parity and performance.
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,73 @@ private IReadOnlyList<ParameterProvider> GetClientParameters()

protected override string BuildName() => _inputClient.IsExactName ? _inputClient.Name : _inputClient.Name.ToIdentifierName();

protected override IReadOnlyList<string> BuildHelperDependencyNames()
{
foreach (var method in Methods.OfType<ScmMethodProvider>())
{
if (method.BodyStatements != null)
{
return ["CancellationTokenExtensions", "ClientPipelineExtensions"];
}
}

return [];
}

protected override IReadOnlyList<CSharpType> BuildBodyDependencyTypes()
{
var dependencies = new List<CSharpType>();
foreach (var method in Methods.OfType<ScmMethodProvider>())
{
if (method.BodyStatements == null)
{
continue;
}

if (method.CollectionDefinition != null)
{
dependencies.Add(method.CollectionDefinition.Type);
}

if (method.ServiceMethod == null)
{
continue;
}

AddInputTypeDependency(dependencies, method.ServiceMethod.Response.Type);
AddInputTypeDependency(dependencies, method.ServiceMethod.Exception?.Type);
foreach (var parameter in method.ServiceMethod.Parameters)
{
AddInputTypeDependency(dependencies, parameter.Type);
}

foreach (var parameter in method.ServiceMethod.Operation.Parameters)
{
AddInputTypeDependency(dependencies, parameter.Type);
}

foreach (var response in method.ServiceMethod.Operation.Responses)
{
AddInputTypeDependency(dependencies, response.BodyType);
foreach (var header in response.Headers)
{
AddInputTypeDependency(dependencies, header.Type);
}
}
}

return dependencies;
}

private static void AddInputTypeDependency(List<CSharpType> dependencies, InputType? inputType)
{
var type = inputType == null ? null : ScmCodeModelGenerator.Instance.TypeFactory.CreateCSharpType(inputType);
if (type != null)
{
dependencies.Add(type);
}
}

protected override FieldProvider[] BuildFields()
{
List<FieldProvider> fields = [EndpointField];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,22 @@ private bool HasPagingOperationNameCollision(string operationName)
protected override TypeSignatureModifiers BuildDeclarationModifiers()
=> TypeSignatureModifiers.Internal | TypeSignatureModifiers.Partial | TypeSignatureModifiers.Class;

protected override IReadOnlyList<CSharpType> BuildBodyDependencyTypes()
{
var dependencies = new List<CSharpType> { Client.Type, ResponseModelType, NextPagePropertyType };
if (ItemModelType != null)
{
dependencies.Add(ItemModelType);
}

foreach (var field in RequestFields)
{
dependencies.Add(field.Type);
}

return dependencies;
}

protected override FieldProvider[] BuildFields() => [ClientField, .. RequestFields];

protected override CSharpType[] BuildImplements() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ public MrwSerializationTypeDefinition(InputModelType inputModel, ModelProvider m

protected override CSharpType? BuildBaseType() => _model.BaseType;

protected override IReadOnlyList<string> BuildHelperDependencyNames() => _rawDataField != null || _additionalProperties.Value.Length > 0
? ["ChangeTrackingDictionary"]
: [];

protected override SuppressionStatement[] BuildDisabledFileWarnings()
{
if (_model.CanonicalView.Properties.Any(p => ScmModelProvider.IsFileBinaryContentType(p.Type)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ protected override string BuildRelativeFilePath()
return Path.Combine("src", "Generated", "Models", $"{Name}.Serialization.Multipart.cs");
}

protected override IReadOnlyList<string> BuildHelperDependencyNames() => _model.Properties.Any(
prop => prop.WireInfo != null && !prop.WireInfo.IsRequired &&
(prop.Type is { IsCollection: true, IsReadOnlyMemory: false } || prop.Type.IsDictionary))
? ["Optional"]
: [];

protected override SuppressionStatement[] BuildDisabledFileWarnings()
=> [new SuppressionStatement(null, Literal(ScmModelProvider.FileBinaryContentDiagnosticId), ScmModelProvider.ScmEvaluationTypeSuppressionJustification)];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,36 @@ protected override FieldProvider[] BuildFields()
return [.. pipelineMessage20xClassifiersFields];
}

protected override IReadOnlyList<string> BuildHelperDependencyNames()
{
var dependencies = new HashSet<string>(StringComparer.Ordinal)
{
"ClientUriBuilder"
};
foreach (var serviceMethod in _inputClient.Methods)
{
foreach (var parameter in serviceMethod.Operation.Parameters)
{
if (parameter is not InputHeaderParameter and not InputQueryParameter)
{
continue;
}

var type = ScmCodeModelGenerator.Instance.TypeFactory.CreateCSharpType(parameter.Type);
if (type?.IsDictionary == true)
{
dependencies.Add("ChangeTrackingDictionary");
}
else if (type?.IsCollection == true)
{
dependencies.Add("ChangeTrackingList");
}
}
}

return [.. dependencies];
}

protected override ScmMethodProvider[] BuildMethods()
{
List<ScmMethodProvider> methods = new List<ScmMethodProvider>();
Expand Down
Loading
Loading