Skip to content

add 7bit key#88

Open
jamesmoore wants to merge 2 commits into
mainfrom
add-7bit-key
Open

add 7bit key#88
jamesmoore wants to merge 2 commits into
mainfrom
add-7bit-key

Conversation

@jamesmoore
Copy link
Copy Markdown
Owner

@jamesmoore jamesmoore commented May 20, 2026

Add 64x7bit key using 4 uints instead of 8

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 solver AutogramBytesNoStringsV5f.
  • 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; chunks may contain garbage and the subsequent |= operations can produce nondeterministic keys, breaking HashSet lookups (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.

Comment thread Autogram/ByteHistoryKey7Bit128.cs
Comment thread Autogram/AutogramBytesNoStringsV5f.cs
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