Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precise decode output slice length checking #269

Merged
merged 6 commits into from
Mar 2, 2024

Commits on Feb 28, 2024

  1. Keep morsels as separate bytes

    ~6% speedup on decode_slice/3
    marshallpierce committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    9979cc3 View commit details
    Browse the repository at this point in the history
  2. Simplify leftover output writes

    No perf impact
    marshallpierce committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    a25be06 View commit details
    Browse the repository at this point in the history

Commits on Mar 1, 2024

  1. Decode main loop improvements

    - Rearrange main decoding loops to handle chunks of 32 bytes at a time, then 4 bytes at a time, meaning that `decode_suffix` need only handle 0-4 bytes, simplifying its code. Moderate speed gains of around 5-10%.
    - Improve error precision. `InvalidLength` now has a `usize` length indicating how many valid symbols were found, but that the count of those symbols was invalid. Before, it just did `input % 4 == `, which was harder to reason about, as there might be padding etc. DecoderReader now also precisely reports the suitable InvalidByte if an earlier block of decoding found padding that was valid in that context, but more padding was found later, rendering that earlier padding invalid.
    - Tidy up decode tests. There were some duplicated scenarios, and certain aspects are now tested in more detail.
    marshallpierce committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    a8a60f4 View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2024

  1. Engine::internal_decode now returns DecodeSliceError

    Implementations must now precisely, not conservatively, return an error when the output length is too small.
    marshallpierce committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    9e9c7ab View commit details
    Browse the repository at this point in the history
  2. Add some tests to boost coverage

    The logic isn't important, but it helps make actual coverage gaps more visible.
    marshallpierce committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    2b91084 View commit details
    Browse the repository at this point in the history
  3. Release notes

    marshallpierce committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    efb6c00 View commit details
    Browse the repository at this point in the history