Repository navigation
Conversation
- 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>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Three unresolved findings affect analyzer correctness and IBufferWriter behavior.
Review effort: Lite
Findings: 2
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
IBufferWriterimplementations. - Adds SF001–SF003 analyzers and test coverage.
- Updates packaging, documentation, and project structure.
Review findings:
- Critical:
RequireOverrideAnalyzermust exclude sealed overrides. - Critical:
BufferWriterWriteBuffercan 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; |
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.

No description provided.