Skip to content

[codex] Add InlineArray parser generation - #198

Merged
dameng324 merged 1 commit into
mainfrom
inline-array-source-generator
Jul 2, 2026
Merged

[codex] Add InlineArray parser generation#198
dameng324 merged 1 commit into
mainfrom
inline-array-source-generator

Conversation

@dameng324

Copy link
Copy Markdown
Owner

Summary

  • Add source-generator support for [InlineArray] repeated fields, including generic inline arrays.
  • Generate nested per-member InlineArray readers and writers that implement collection parser interfaces.
  • Make collection parser interface members public so generated parsers in consumer assemblies can implement them.
  • Add regression coverage for non-generic and generic InlineArray types, including custom struct item types.

Validation

  • dotnet test tests\LightProto.Tests\LightProto.Tests.csproj --no-build -c Debug -f net10.0
  • dotnet build tests\LightProto.Tests\LightProto.Tests.csproj --no-restore -c Release -f net8.0
  • dotnet build tests\LightProto.Tests\LightProto.Tests.csproj --no-restore -c Release -f net10.0
  • dotnet build src\LightProto\LightProto.csproj --no-restore -c Release -f netstandard2.0
  • dotnet tool run csharpier -- check src\LightProto.Generator src\LightProto\Parser\IEnumerableReader.cs src\LightProto\Parser\IEnumerableWriter.cs tests\LightProto.Tests\Parsers\InlineArray.cs

Release builds still show existing IL2067 warnings in NonGenericSerializerTests, unrelated to this change.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 39 complexity · 2 duplication

Metric Results
Complexity 39
Duplication 2

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.67%. Comparing base (599aeb9) to head (f9d4912).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #198   +/-   ##
=======================================
  Coverage   95.67%   95.67%           
=======================================
  Files         124      124           
  Lines        3287     3287           
  Branches      441      441           
=======================================
  Hits         3145     3145           
  Misses         76       76           
  Partials       66       66           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dameng324
dameng324 marked this pull request as ready for review July 2, 2026 09:46
@dameng324
dameng324 merged commit e8a22bb into main Jul 2, 2026
8 checks passed
@dameng324
dameng324 deleted the inline-array-source-generator branch July 2, 2026 09:46
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.45GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.301
  [Host]    : .NET 8.0.28 (8.0.28, 8.0.2826.26413), X64 RyuJIT x86-64-v3
  .NET 10.0 : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3
  .NET 8.0  : .NET 8.0.28 (8.0.28, 8.0.2826.26413), X64 RyuJIT x86-64-v3
  .NET 9.0  : .NET 9.0.17 (9.0.17, 9.0.1726.26416), X64 RyuJIT x86-64-v3


Method Job Runtime Mean Error StdDev Ratio Allocated Alloc Ratio
Deserialize_ProtoBuf_net .NET 10.0 .NET 10.0 765.7 μs 1.77 μs 1.66 μs 1.22 562 KB 0.98
Deserialize_GoogleProtoBuf .NET 10.0 .NET 10.0 612.1 μs 2.68 μs 2.37 μs 0.98 648.7 KB 1.13
Deserialize_LightProto .NET 10.0 .NET 10.0 626.4 μs 2.98 μs 2.78 μs 1.00 574.8 KB 1.00
Deserialize_ProtoBuf_net .NET 8.0 .NET 8.0 903.2 μs 2.02 μs 1.79 μs 1.45 562 KB 0.98
Deserialize_GoogleProtoBuf .NET 8.0 .NET 8.0 821.9 μs 2.90 μs 2.71 μs 1.32 648.7 KB 1.13
Deserialize_LightProto .NET 8.0 .NET 8.0 623.7 μs 3.07 μs 2.57 μs 1.00 574.8 KB 1.00
Deserialize_ProtoBuf_net .NET 9.0 .NET 9.0 811.8 μs 2.71 μs 2.53 μs 1.31 562 KB 0.98
Deserialize_GoogleProtoBuf .NET 9.0 .NET 9.0 710.7 μs 3.10 μs 2.90 μs 1.15 648.7 KB 1.13
Deserialize_LightProto .NET 9.0 .NET 9.0 620.4 μs 3.43 μs 3.04 μs 1.00 574.8 KB 1.00

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.45GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.301
  [Host]    : .NET 8.0.28 (8.0.28, 8.0.2826.26413), X64 RyuJIT x86-64-v3
  .NET 10.0 : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3
  .NET 8.0  : .NET 8.0.28 (8.0.28, 8.0.2826.26413), X64 RyuJIT x86-64-v3
  .NET 9.0  : .NET 9.0.17 (9.0.17, 9.0.1726.26416), X64 RyuJIT x86-64-v3


Method Job Runtime Mean Error StdDev Ratio Allocated Alloc Ratio
Serialize_ProtoBuf_net .NET 10.0 .NET 10.0 925.3 μs 8.22 μs 7.69 μs 1.30 526.41 KB 1.03
Serialize_GoogleProtoBuf .NET 10.0 .NET 10.0 790.2 μs 4.54 μs 4.25 μs 1.11 512.95 KB 1.00
Serialize_LightProto .NET 10.0 .NET 10.0 709.1 μs 3.79 μs 3.36 μs 1.00 512.92 KB 1.00
Serialize_ProtoBuf_net .NET 8.0 .NET 8.0 1,049.2 μs 7.56 μs 7.07 μs 1.32 526.4 KB 1.03
Serialize_GoogleProtoBuf .NET 8.0 .NET 8.0 812.6 μs 9.09 μs 8.51 μs 1.02 512.95 KB 1.00
Serialize_LightProto .NET 8.0 .NET 8.0 793.7 μs 4.04 μs 3.59 μs 1.00 512.92 KB 1.00
Serialize_ProtoBuf_net .NET 9.0 .NET 9.0 1,098.5 μs 11.09 μs 10.37 μs 1.39 526.4 KB 1.03
Serialize_GoogleProtoBuf .NET 9.0 .NET 9.0 796.7 μs 2.85 μs 2.38 μs 1.01 512.95 KB 1.00
Serialize_LightProto .NET 9.0 .NET 9.0 787.5 μs 3.87 μs 3.23 μs 1.00 512.92 KB 1.00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant