add 7bit key#88
Open
jamesmoore wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Introduces a new solver variant (AutogramBytesNoStringsV5f) that uses a more compact 7-bit-packed history key to reduce memory usage, and wires it into the test suite and benchmarks for comparison with prior versions.
Changes:
- Add
ByteHistoryKey7Bit128(7-bit packing into 4×uint) and use it in new solverAutogramBytesNoStringsV5f. - Add a new unit test covering
AutogramBytesNoStringsV5f. - Extend benchmarks to include V5f and change which benchmark is marked as the baseline.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| AutogramTest/AutogramTest.cs | Adds a new [Fact] to run the V5f solver against the standard autogram test. |
| AutogramBenchmark/AutogramBenchmark.cs | Adds setup/cleanup + benchmark entry for V5f; baseline benchmark designation adjusted. |
| Autogram/ByteHistoryKey7Bit128.cs | New packed key struct intended to store history keys more compactly. |
| Autogram/AutogramBytesNoStringsV5f.cs | New solver variant that swaps the history key type to the new packed key. |
Comments suppressed due to low confidence (1)
Autogram/ByteHistoryKey7Bit128.cs:24
stackalloc uint[4]does not guarantee zero-initialized memory;chunksmay contain garbage and the subsequent|=operations can produce nondeterministic keys, breakingHashSetlookups (missed hits / unbounded growth). Clear the span (e.g.,chunks.Clear()) or explicitly initialize the 4 uints before OR-ing in values.
Span<uint> chunks = stackalloc uint[4];
for (var i = 0; i < values.Length; i++)
{
var value = values[i];
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(value, (byte)128);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Add 64x7bit key using 4 uints instead of 8