Repository navigation
Conversation
|
GNU testsuite comparison: |
7168c18 to
3f383ad
Compare
|
@limadog9 please fix the regressions when they happen :) |
|
The GNU bot shows tests/basenc/base64 and tests/basenc/basenc failing now that the seds are gone. |
| break; | ||
| } | ||
| } | ||
| if all_valid { |
There was a problem hiding this comment.
this now accepts padding in the middle (YQ==YQ==), is it intended? please split it out with a test if so
| use std::io::{self, BufReader, Cursor, Read}; | ||
|
|
||
| #[test] | ||
| fn buffered_decode_keeps_prefix_on_error() { |
There was a problem hiding this comment.
duplicates the z85 integration test, do we need it?
| true | ||
| } | ||
|
|
||
| fn validate_decode_buffer(&self, input: &[u8]) -> UResult<()> { |
There was a problem hiding this comment.
this depends on the read buffer size, the exact GNU quirk discussed in #6008
#6008 (comment)
do we really want to replicate it?
| fn validate_decode_buffer(&self, input: &[u8]) -> UResult<()> { | ||
| // Unlike ordinary garbage, the standard base64 symbols are rejected | ||
| // before base64url starts decoding the buffer. | ||
| if self.encoding == data_encoding::BASE64URL |
There was a problem hiding this comment.
three self.encoding == BASE64URL checks in a generic wrapper, could it be a dedicated type or flag instead?
| } | ||
| } | ||
|
|
||
| fn pad_remainder(&self, remainder: &[u8]) -> Option<PadResult> { |
There was a problem hiding this comment.
unpadded base64url tail is unrelated to the issue, please split into another pr
| sed -i "s/\(baddecode.*OUT=>\"\).*\"/\1\"/g" tests/basenc/base64.pl | ||
| sed -i "s/\(\(b2[ml]_[69]\|z85_8\|z85_35\).*OUT=>\)[^}]*\(.*\)/\1\"\"\3/g" tests/basenc/basenc.pl | ||
|
|
||
| # add "error: " to the expected error message |
There was a problem hiding this comment.
removing these seds makes tests/basenc/base64 and tests/basenc/basenc fail now, please check which cases still differ
i do prefer our behavior here
3f383ad to
5f4c5e3
Compare
Merging this PR will degrade performance by 3%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ |
Simulation | du_all_wide_tree[(5000, 500)] |
33.8 ms | 34.8 ms | -3% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing limadog9:fix/basenc-partial-output-6008 (93eff75) with main (d2d9694)
Footnotes
-
70 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
|
Updated |
Preserve decoded bytes before invalid input, padding, trailing bits and read failures without changing the codec padding rules. Keep valid input batched. Adjust the GNU base64url expectation to retain the valid prefix before an invalid alphabet character. Both GNU basenc and base64 suites pass, along with 85 native decoder integration tests. Closes uutils#6008.
5f4c5e3 to
93eff75
Compare
Invalid or incomplete input discarded decoded data from the current batch. Preserve complete output before reporting the error across the shared decoders, keep valid input batched, and handle unpadded base64url tails. Add regressions for all standard encodings, batch boundaries, and read failures.
Validation: 84 base32/base64/basenc integration tests and 3 unit tests pass; eight GNU differential cases pass.
Closes #6008