Rename compression WindowLog APIs to WindowLog2 - #129977
#129977Merged
rzikm merged 9 commits intoJul 8, 2026
maindotnet/runtime:mainfrom
copilot/rename-windowlog-to-windowlog2dotnet/runtime:copilot/rename-windowlog-to-windowlog2Copy head branch name to clipboard
Merged
Rename compression WindowLog APIs to WindowLog2#129977rzikm merged 9 commits intomaindotnet/runtime:mainfrom copilot/rename-windowlog-to-windowlog2dotnet/runtime:copilot/rename-windowlog-to-windowlog2Copy head branch name to clipboard
rzikm merged 9 commits into
maindotnet/runtime:mainfrom
copilot/rename-windowlog-to-windowlog2dotnet/runtime:copilot/rename-windowlog-to-windowlog2Copy head branch name to clipboard
Conversation
Co-authored-by: rzikm <32671551+rzikm@users.noreply.github.com>
Co-authored-by: rzikm <32671551+rzikm@users.noreply.github.com>
Co-authored-by: rzikm <32671551+rzikm@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Rename WindowLog properties to WindowLog2 in compression options
Rename compression WindowLog APIs to WindowLog2
Jun 29, 2026
rzikm
reviewed
Jun 29, 2026
Co-authored-by: rzikm <32671551+rzikm@users.noreply.github.com>
Contributor
Author
Co-authored-by: rzikm <32671551+rzikm@users.noreply.github.com>
Contributor
Author
Contributor
There was a problem hiding this comment.
Pull request overview
Renames the WindowLog / MaxWindowLog public-facing compression option members and related parameter names to *WindowLog2 / *MaxWindowLog2 to make the base-2 logarithm semantics explicit and consistent across Brotli, zlib/deflate/gzip, and Zstandard APIs.
Changes:
- Renames public option properties and related helpers/constants to
*WindowLog2(and Zstd decompressionMaxWindowLog2), including ref assembly updates. - Updates encoder/decoder constructors, parameter validation (
ArgumentOutOfRangeException.ParamName), and call sites to use the new parameter names. - Updates tests and user-facing error text to match the new naming.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/System.IO.Compression/tests/Zstandard/ZstandardEncoderDecoderTests.cs | Updates Zstd encoder/decoder tests for renamed ctor parameters and messages. |
| src/libraries/System.IO.Compression/tests/Zstandard/ZstandardCompressionOptionsTests.cs | Updates Zstd options tests to WindowLog2 / MaxWindowLog2. |
| src/libraries/System.IO.Compression/tests/ZLibEncoderDecoderTestBase.cs | Aligns shared zlib test base to expect windowLog2 param name. |
| src/libraries/System.IO.Compression/tests/ZLibCompressionOptionsUnitTests.cs | Renames zlib options tests for WindowLog2 and *WindowLog2 statics. |
| src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardEncoder.cs | Renames Zstd encoder ctors/overloads and validation to windowLog2. |
| src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDecompressionOptions.cs | Renames and validates decompression option MaxWindowLog2. |
| src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDecoder.cs | Renames Zstd decoder ctors/validation to maxWindowLog2. |
| src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardCompressionOptions.cs | Renames Zstd compression option WindowLog2 and related statics/docs. |
| src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/Zstandard.PlatformNotSupported.cs | Updates platform stub members/ctors to *WindowLog2 naming. |
| src/libraries/System.IO.Compression/src/System/IO/Compression/ZLibStream.cs | Uses ZLibCompressionOptions.WindowLog2 when resolving window bits. |
| src/libraries/System.IO.Compression/src/System/IO/Compression/ZLibEncoder.cs | Renames zlib encoder ctor/overload parameter to windowLog2. |
| src/libraries/System.IO.Compression/src/System/IO/Compression/ZLibCompressionOptions.cs | Renames zlib options property/fields/statics to *WindowLog2. |
| src/libraries/System.IO.Compression/src/System/IO/Compression/GZipStream.cs | Uses ZLibCompressionOptions.WindowLog2 when resolving window bits. |
| src/libraries/System.IO.Compression/src/System/IO/Compression/GZipEncoder.cs | Renames gzip encoder ctor/overload parameter to windowLog2. |
| src/libraries/System.IO.Compression/src/System/IO/Compression/DeflateZLib/DeflateStream.cs | Uses ZLibCompressionOptions.WindowLog2 when resolving window bits. |
| src/libraries/System.IO.Compression/src/System/IO/Compression/DeflateEncoder.cs | Renames deflate encoder ctors/overloads and validation to windowLog2. |
| src/libraries/System.IO.Compression/src/Resources/Strings.resx | Updates the Zstd “window too large” guidance text to maxWindowLog2. |
| src/libraries/System.IO.Compression/ref/System.IO.Compression.cs | Updates public ref surface for renamed members/parameters (*WindowLog2). |
| src/libraries/System.IO.Compression.Brotli/tests/CompressionStreamUnitTests.Brotli.cs | Updates Brotli options tests to WindowLog2. |
| src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression/enc/BrotliStream.Compress.cs | Uses BrotliCompressionOptions.WindowLog2 when configuring encoder. |
| src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression/enc/BrotliCompressionOptions.cs | Renames Brotli options property/field to WindowLog2. |
| src/libraries/System.IO.Compression.Brotli/ref/System.IO.Compression.Brotli.cs | Updates Brotli ref surface to expose WindowLog2. |
| src/libraries/Common/tests/System/IO/Compression/EncoderDecoderTestBase.cs | Aligns shared encoder/decoder test expectations to windowLog2 naming. |
| src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs | Updates shared stream roundtrip test name and option property to WindowLog2. |
MihaZupan
approved these changes
Jun 29, 2026
iremyux
approved these changes
Jun 30, 2026
Co-authored-by: rzikm <32671551+rzikm@users.noreply.github.com>
…owLog2 in DecompressionHandler and test Co-authored-by: rzikm <32671551+rzikm@users.noreply.github.com>
cincuranet
approved these changes
Jul 8, 2026
eiriktsarpalis
pushed a commit
that referenced
this pull request
Jul 15, 2026
Based on a feedback from #128456 (comment) <!-- --> Renames compression option APIs that exposed `WindowLog` so the public surface consistently uses `WindowLog2` for base-2 log values, including the matching Zstandard decompression property `MaxWindowLog2`. - **API surface** - `BrotliCompressionOptions.WindowLog` → `WindowLog2` - `ZLibCompressionOptions.WindowLog` → `WindowLog2` - `ZstandardCompressionOptions.WindowLog` → `WindowLog2` - `ZstandardDecompressionOptions.MaxWindowLog` → `MaxWindowLog2` - Aligns related public members to the same naming: - zlib/zstd `DefaultWindowLog*`, `MinWindowLog*`, `MaxWindowLog*` → `*WindowLog2` - encoder / decoder parameter names `windowLog` / `maxWindowLog` → `windowLog2` / `maxWindowLog2` - **Implementation updates** - Updates all in-repo call sites, option consumers, constructors, ref files, platform stubs, XML docs, and error text. - Ensures thrown `ArgumentOutOfRangeException.ParamName` values match the renamed public parameters. - **Compatibility** - This is an intentional public API rename; no compatibility alias/shim is added. - **Example** ```csharp var options = new ZstandardCompressionOptions { Quality = 3, WindowLog2 = 20 }; var decompressionOptions = new ZstandardDecompressionOptions { MaxWindowLog2 = 20 }; ``` - **Validation** - Rebuilt `System.IO.Compression` and `System.IO.Compression.Brotli` - Ran targeted test projects: - `System.IO.Compression.Tests` - `System.IO.Compression.Brotli.Tests` --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rzikm <32671551+rzikm@users.noreply.github.com>
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.
Based on a feedback from #128456 (comment)
Renames compression option APIs that exposed
WindowLogso the public surface consistently usesWindowLog2for base-2 log values, including the matching Zstandard decompression propertyMaxWindowLog2.API surface
BrotliCompressionOptions.WindowLog→WindowLog2ZLibCompressionOptions.WindowLog→WindowLog2ZstandardCompressionOptions.WindowLog→WindowLog2ZstandardDecompressionOptions.MaxWindowLog→MaxWindowLog2DefaultWindowLog*,MinWindowLog*,MaxWindowLog*→*WindowLog2windowLog/maxWindowLog→windowLog2/maxWindowLog2Implementation updates
ArgumentOutOfRangeException.ParamNamevalues match the renamed public parameters.Compatibility
Example
Validation
System.IO.CompressionandSystem.IO.Compression.BrotliSystem.IO.Compression.TestsSystem.IO.Compression.Brotli.Tests