Repository navigation
Conversation
residentSample.read and the residentTakeRecorder reader wrap a looping position as r - floor(r/L)*L + start in f64. For a position a rounding error below start, the remainder can round up to L, or stay just below L and round up to the exclusive end when start is added: the largest double below 3 in the slice [3,5) wraps to 5. Below capacity, the reader then returned the frame at end. That frame lies outside the slice, and after a shorter reload or a logical recorder reset it holds stale bytes that docs/sample.md and docs/resident-recorder.md describe as unreachable. samplePlayer and granularSource use the same wrap, so a looping player could report its end frame as its position for one sample. Both readers now map a wrapped position at or above end back to start and clamp one below start, which an underflowing quotient can leave at start 0. This is the loop-crossfade guard applied to the absolute position; guarding only the remainder before start is added still lets the second case through. New tests read at and just below the start of [3,5), [1,4) and a slice clipped by a shorter reload or by a take recorded over cleared bytes, and step a looping player just below its start. All three fail without the guard; the two read tests also fail with a remainder-only guard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JP5nzyggXWpUAMagBt4JZB
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This branch was successfully 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.
Requested by yuichkun · project thread
residentSample.readand theresidentTakeRecorderreader wrap a looping position asr - floor(r / L) * L + startin f64. For a position a rounding error belowstart, the remainder can round up toL, or stay just belowLand round up to the exclusiveendoncestartis added.read(3 - 1e-15, 3, 91, true)returned the frame at 91, outside the slice, instead of interpolating toward frame 3, and the largest double below 3 in the slice [3, 5) wrapped to 5. After a shorter reload or a logical recorder reset, that frame holds stale bytes thatdocs/sample.mdanddocs/resident-recorder.mddescribe as unreachable.samplePlayerandgranularSourceshare the wrap, so a looping player could report its end frame as its position for one sample.Both readers now map a wrapped position at or above
endback tostart, and clamp one belowstart, which an underflowing quotient can leave at start 0. This is the guardloop-crossfadealready applies, moved to the absolute position: guarding only the remainder beforestartis added still lets the second case through. The other wrap helpers (loop crossfade, modulation, musical controls, LFO, sine and pulse sources, windowed pitch shift, wavetables, granular clock, frequency shifter) were checked and are already guarded, clamped, or cannot reach the edge.Validation:
npm run checkpassed, andnpx vitest runpassed 61 files / 1,106 tests locally on Node 24.Audio remains CANDIDATE.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JP5nzyggXWpUAMagBt4JZB