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

Enhance Codec's decoding options #279

Open
Wondertan opened this issue Dec 16, 2023 · 1 comment
Open

Enhance Codec's decoding options #279

Wondertan opened this issue Dec 16, 2023 · 1 comment

Comments

@Wondertan
Copy link
Member

Wondertan commented Dec 16, 2023

Problem

Currently, Decode allows decoding only the entire axis. It requires a 2D bytes slice as input and reconstructs nil shares via non-nil ones. However, we now need an additional use case where we want to reconstruct only particular nil shares and not all of them. This optimization is a part of lazy-extend effort and avoids unnecessary share reconstruction for Codec

Solutions

  • change the Decode slice share inputs to have three states: built, nil, and empty(zero-length). The new empty share slices will signal to Codec that they need to be reconstructed by the provided built, while nil shares will be left untouched.
    • Less explicit and needs to be properly documented
  • add a new DecodeSome method that takes the same shares slice as input + an additional slice of bools with the same line as the shares slice, following klauspost's ReconstructSome method.
    • Allocates additional slice
    • Two code paths for lazy and non-lazy decoding that can be single.

Refs

Blocked on klauspost/reedsolomon#264

@rootulp
Copy link
Collaborator

rootulp commented Dec 19, 2023

I prefer the second proposed solution because it is API additive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants