[0079] 修复 bytevector-base64-decode Scheme 实现并收紧 base64 性能基准#877
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.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.
Summary
(liii base64)库bytevector-base64-decode的多个正确性缺陷:长度非 4X 时崩溃(比率传给 make-bytevector)、填充位置错误的输入被错误解码(如Zg=v)、非法字符静默接受、缺少类型检查tests/liii/base64/bytevector-base64-decode-test.scm,覆盖 36 个 check(空输入、1~6 字节全部填充、字符集边界含 0xff/NUL、round-trip、非法长度/字符/填充位置/类型)bench/base64-perf.scm各档迭代次数,总耗时从 >60s 降至约 17s,便于频繁运行和后续优化对比Test plan
bin/gf fmt goldfish/liii/base64.scmbin/gf fmt tests/liii/base64/bytevector-base64-decode-test.scmbin/gf tests/liii/base64/bytevector-base64-decode-test.scm— 36 correct, 0 failedbin/gf tests/liii/base64/base64-decode-test.scm— 9 correct, 0 failed(无回归)bin/gf tests/liii/base64/base64-encode-test.scm— 10 correct, 0 failed(无回归)bin/gf bench/base64-perf.scm— 17.3s,各档稳定输出🤖 Generated with Claude Code