Repository navigation
fix(ts): hold a byte vector's capacity as a heap or deque takes it - #417
Merged
Merged
Conversation
…skipped Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This was referenced Nov 2, 2026
kixelated
added a commit
that referenced
this pull request
Nov 2, 2026
…or settled Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moq-bot Bot
pushed a commit
that referenced
this pull request
Nov 2, 2026
…d, and share lang's translation (#419) * chore(quest): claim quest/m0/checks/differential.md Quest-Claim: b513aa5d0c89f7f9 * chore(ts): run the differential fixtures optimized and single-threaded, and share lang's translation Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(quest): finish the cheaper differential Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(quest): plan reaching every lang case Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(quest): drop the lang cases quest, which #417's two-byte selector settled Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Luke Curley <432854+kixelated@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: moq-bot <moq-bot@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.
Problem
BinaryHeap<u8>::from(h.into_vec()), andVecDeque<u8>::from(Vec<u8>), convert aVec<u8>(rt.ByteVec) to a JS array withrt.byteVecToVec. That conversion sets the array's capacity withcapSet, which records nothing when the capacity equals what the length implies. Once the heap is cleared, its capacity falls back to what the new length implies, below what an earlierreserveguaranteed. Rust keeps it:The lang differential found this once #414's two-byte selector moved random inputs onto
capacity::heaps(reduced from input695dff6e…).Approach
byteVecToVecholds the capacity withcapHold, asreservedoes, so it survives the length dropping. No othercapSetmakes a fresh array from a container whose capacity may be held: the others either keep an existing hold (c.cap !== undefined) or start a fresh floor.Impact
byteVecToVecnow keeps au8heap's or deque's capacity as Rust does. No API change.Tests: a named
capacity::heapscase of each element type: extended past its least capacity,reserve(0), remade from itsVec, and cleared. It differs from native on theu8heap without the fix, and agrees with it.Stacks on #414 (its two-byte
opincaller.ts); land after it.Alternatives
capSetalways record the capacity. Rejected: it would put acapon every clonedVec, where the derived one already meets std's guarantee.Review
gpt-6.1-solat medium effort (quest review --base origin/ts-harness/selector), round 1 on7e814171: no findings.just cipasses locally on7e814171.(written by Claude Opus 5.5)
🤖 Generated with Claude Code