fix: improve base64 and decodeUTF8 error messages#1043
Open
He-Pin wants to merge 1 commit into
Open
Conversation
3757010 to
ac56108
Compare
d1df400 to
3163994
Compare
Use allocation-free UTF-8 byte-length accounting for base64 string error heuristics. Keep decodeUTF8 validation single-pass and preserve original element indexes and values across JVM, JS, and WASM. Keep renderer integer scratch buffers interpreter-local instead of global mutable state.
3163994 to
b794c65
Compare
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
getByteson the error path.decodeUTF8element-index reporting and uses stable numeric rendering for array element values.decodeUTF8; otherwise validates and fills the byte array in a single indexed pass.CLAUDE.md.Current head:
b794c651c7bc8416d3e66fdf752f3563c0632854Performance Notes
decodeUTF8avoids iterator/zipWithIndex/mappipelines in the validation path.rawBytes.Verification
rtk ./mill --no-daemon 'sjsonnet.jvm[3.3.8].reformat'rtk ./mill --no-daemon 'sjsonnet.jvm[3.3.8].checkFormat'rtk ./mill --no-daemon 'sjsonnet.js[2.13.18].checkFormat'rtk ./mill --no-daemon 'sjsonnet.jvm[3.3.8].test' sjsonnet.Base64Testsrtk ./mill --no-daemon 'sjsonnet.jvm[3.3.8].test' sjsonnet.StdStringTestsrtk ./mill --no-daemon 'sjsonnet.jvm[3.3.8].test' sjsonnet.FileTestsrtk ./mill --no-daemon 'sjsonnet.js[2.13.18].test' sjsonnet.Base64Testsrtk ./mill --no-daemon 'sjsonnet.js[2.13.18].test' sjsonnet.StdStringTestsrtk ./mill --no-daemon 'sjsonnet.js[2.13.18].test' sjsonnet.FileTestsrtk ./mill --no-daemon 'sjsonnet.wasm[2.13.18].test' sjsonnet.Base64Testsrtk ./mill --no-daemon 'sjsonnet.wasm[2.13.18].test' sjsonnet.StdStringTestsrtk ./mill --no-daemon 'sjsonnet.wasm[2.13.18].test' sjsonnet.FileTestsrtk ./mill --no-daemon 'sjsonnet.native[2.13.18].compile'