Repository navigation
Conversation
This branch has not been deployed
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.
Summary
Copypromises Go array-copy semantics and returns the smaller logical bit length, but it currently copies entire backing words. Copying a one-bit source into an already populated 64-bit destination therefore clears bits 1–63 even though it reports that only one bit was copied.Copy only complete words within the logical range, then merge the remaining low bits into the destination's partial word. Save that source word before the bulk copy so overlapping backing slices retain Go copy semantics. Keep the existing destination padding cleanup.
This does not grow the destination or change the return count.
CopyFullis unchanged.Regression coverage
Validation
Go 1.26.10, Linux amd64:
go test -race -cover -count=1 ./...,go vet ./..., gofmt andgit diff --checkpass. Root statement coverage: 99.4%; generator: 94.2%. Linux/386 test binaries compile, but this host cannot execute them (exec format error). No claim is made that the entire upstream OS/Go-version CI matrix was executed.Prepared with OpenAI Codex assistance and independently reviewed by a second agent. No human review is claimed.