Skip to content

V1 - #3

Merged
neuecc merged 3 commits into
mainfrom
v1
Sep 28, 2026
Merged

V1#3
neuecc merged 3 commits into
mainfrom
v1

Conversation

@neuecc

@neuecc neuecc commented Sep 28, 2026

Copy link
Copy Markdown
Member

No description provided.

neuecc and others added 3 commits September 25, 2026 19:53
- Ship SerializerFoundation.Analyzers (SF001-SF003) inside the package under analyzers/dotnet/cs
- Add analyzer release tracking (AnalyzerReleases.Shipped/Unshipped.md) and drop the RS2008 suppression
- Strong-name SerializerFoundation with opensource.snk and use its public key for InternalsVisibleTo
- Fix PackageTags, wire the analyzer into sandbox/ConsoleApp1
- Rewrite README in the ZLinq/R3 style (work in progress)
- Retire the async buffer tier and the Benchmark sandbox; add Compatible* buffer variants, BufferSegments and RequireOverride

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
allows ref struct is available from the .NET 9 runtime and C# 13, and the
library source already gates on NET9_0_OR_GREATER, so ship the ref struct
tier from net9.0 on. README and test comments follow the same condition.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 28, 2026 10:01
@neuecc
neuecc merged commit ce9737f into main Sep 28, 2026
8 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Three unresolved findings affect analyzer correctness and IBufferWriter behavior.

Review effort: Lite
Findings: 2 High severity

Open (2)
What changed in this PR

This PR introduces the V1 synchronous buffer APIs, validation and segmented handling, analyzers, xUnit tests, and removes legacy async infrastructure.

Changes:

  • Adds span, sequence, pooled, and IBufferWriter implementations.
  • Adds SF001–SF003 analyzers and test coverage.
  • Updates packaging, documentation, and project structure.

Review findings:

  • Critical: RequireOverrideAnalyzer must exclude sealed overrides.
  • Critical: BufferWriterWriteBuffer can box mutable struct writers.
  • Moderate: GetSpan(0) should normalize the hint to one.
File Change
tests/​SerializerFoundation.Tests/​WriteBufferAdvanceValidationTest.cs Tests write-buffer validation.
tests/​SerializerFoundation.Tests/​SerializerFoundation.Tests.csproj Migrates tests to xUnit.
tests/​SerializerFoundation.Tests/​RequireOverrideAnalyzerTest.cs Tests SF003.
tests/​SerializerFoundation.Tests/​ReadTestHelper.cs Removes obsolete helper.
tests/​SerializerFoundation.Tests/​ReadOnlySpanReadBufferTest.cs Removes legacy tests.
tests/​SerializerFoundation.Tests/​ReadOnlySequenceReadBufferTest.cs Removes legacy tests.
tests/​SerializerFoundation.Tests/​ReadBufferEmptySegmentTest.cs Tests empty sequence segments.
tests/​SerializerFoundation.Tests/​ReadBufferCopyToTest.cs Tests non-consuming copies.
tests/​SerializerFoundation.Tests/​ReadBufferAdvanceValidationTest.cs Tests read validation.
tests/​SerializerFoundation.Tests/​PointerReadBufferTest.cs Removes legacy tests.
tests/​SerializerFoundation.Tests/​PipeWriterAsyncWriteBufferTest.cs Removes async buffer tests.
tests/​SerializerFoundation.Tests/​NonRefReadOnlySequenceReadBufferTest.cs Removes legacy tests.
tests/​SerializerFoundation.Tests/​NonRefArrayPoolWriteBufferTest.cs Removes legacy tests.
tests/​SerializerFoundation.Tests/​Mini/​MiniSerializer.cs Removes obsolete serializer code.
tests/​SerializerFoundation.Tests/​FixedSpanBufferTest.cs Removes legacy tests.
tests/​SerializerFoundation.Tests/​FallbackTierBufferTest.cs Tests compatible buffers.
tests/​SerializerFoundation.Tests/​CompatibleBufferWriterWriteBufferTest.cs Tests compatible writers.
tests/​SerializerFoundation.Tests/​BufferWriterWriteBufferTests.cs Tests writer behavior.
tests/​SerializerFoundation.Tests/​BufferWriterWriteBufferTest.cs Removes legacy tests.
tests/​SerializerFoundation.Tests/​BufferMustBeStructAnalyzerTest.cs Tests SF001.
tests/​SerializerFoundation.Tests/​AssertUtils.cs Removes TUnit helpers.
tests/​SerializerFoundation.Tests/​ArrayPoolListWriteBufferTest.cs Removes legacy tests.
tests/​SerializerFoundation.Tests/​ArrayBuilderTest.cs Removes obsolete tests.
src/​SerializerFoundation/​WriteBuffers/​SpanWriteBuffer.cs Adds span-backed writers.
src/​SerializerFoundation/​WriteBuffers/​PipeWriterAsyncWriteBuffer.cs Removes async writer.
src/​SerializerFoundation/​WriteBuffers/​FixedSpanWriteBuffer.cs Replaces legacy writer.
src/​SerializerFoundation/​WriteBuffers/​BufferWriterWriteBuffer.cs Adds writer-backed buffers.
src/​SerializerFoundation/​WriteBuffers/​ArrayPoolListWriteBuffer.cs Adds pooled segmented writers.
src/​SerializerFoundation/​Throws.cs Removes old exception helper.
src/​SerializerFoundation/​SerializerFoundation.csproj Updates targets and packaging.
src/​SerializerFoundation/​ReadBuffers/​ReadOnlySpanReadBuffer.cs Adds contiguous read buffers.
src/​SerializerFoundation/​ReadBuffers/​ReadOnlySequenceReadBuffer.cs Adds segmented reading and copying.
src/​SerializerFoundation/​ReadBuffers/​PipeReaderAsyncReadBuffer.cs Removes async reader.
src/​SerializerFoundation/​IWriteBuffer.cs Defines the write contract.
src/​SerializerFoundation/​IReadBuffer.cs Defines the read contract.
src/​SerializerFoundation/​Internal/​Throws.cs Adds validation helpers.
src/​SerializerFoundation/​Internal/​Polyfill.cs Adds compatibility polyfills.
src/​SerializerFoundation/​Internal/​PointerSpan.cs Validates pointer spans.
src/​SerializerFoundation/​IAsyncWriteBuffer.cs Removes async write API.
src/​SerializerFoundation/​IAsyncReadBuffer.cs Removes async read API.
src/​SerializerFoundation/​CodeAnalysis/​RequireOverrideAttribute.cs Adds override-contract attribute.
src/​SerializerFoundation/​BufferSegments.cs Adds segmented output views.
src/​SerializerFoundation/​ArrayBuilder.cs Removes legacy builder.
src/​SerializerFoundation.Analyzers/​SerializerFoundation.Analyzers.csproj Adds analyzer project.
src/​SerializerFoundation.Analyzers/​RequireOverrideAnalyzer.cs Implements SF003.
src/​SerializerFoundation.Analyzers/​BufferMustBeStructAnalyzer.cs Implements SF001.
src/​SerializerFoundation.Analyzers/​AnalyzerReleases.Unshipped.md Adds release tracking metadata.
src/​SerializerFoundation.Analyzers/​AnalyzerReleases.Shipped.md Registers shipped rules.
SerializerFoundation.slnx Adds analyzers and removes benchmarks.
sandbox/​ConsoleApp1/​MiniMessagePack/​Code.cs Disables obsolete sample code.
sandbox/​ConsoleApp1/​ConsoleApp1.csproj Adds analyzer wiring.
sandbox/​Benchmark/​Program.cs Removes benchmark entry code.
sandbox/​Benchmark/​MicroBenchmarks/​MemorySliceVsPinPointer.cs Removes obsolete benchmark.
sandbox/​Benchmark/​Benchmark.csproj Removes benchmark project.
README.md Documents the V1 APIs.
Directory.Build.props Updates package metadata.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +64 to +66
if (member is not IMethodSymbol { IsVirtual: true } and not IMethodSymbol { IsOverride: true, IsSealed: false } ||
member is not IMethodSymbol required ||
!HasRequireOverride(required, attribute))
Comment on lines +33 to +37
public BufferWriterWriteBuffer(IBufferWriter<byte> bufferWriter)
{
if (buffer.Length == 0 || (uint)buffer.Length < (uint)sizeHint)
{
EnsureNewBuffer(sizeHint);
}
ArgumentNullException.ThrowIfNull(bufferWriter);

return buffer;
this.bufferWriter = bufferWriter;
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.

2 participants