Allow case where parity shard count is greater than data shard count #4
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-sleepybishop/nanors!4
Loading…
Reference in a new issue
No description provided.
Delete branch "ps_limit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm working on replacing the Reed-Solomon implementation in Sunshine, an NVIDIA GameStream host, with nanors (with great performance results). For the most part it was a drop-in replacement, however there is one case which nanors doesn't currently support:
ps > dsThere is a configurable attribute in the SDP used by GameStream that allows the client to specify a minimum parity shard count per frame. NVIDIA's official clients and Moonlight both set this to 2, which means we can sometimes encounter a case where we have a small frame with only 1 data shard that will be generating 2 parity shards, which fails the check here.
This check appears to be superfluous, so I've removed it and updated the tests and benchmark to exercise that case. The tests required a bit more work than would be otherwise necessarily since it had assumptions that
2 * K >= K + Nin various places that needed to be adjusted. I also updated them to ensure that a failure ofreed_solomon_new()would result in aFAILEDoutput, rather than just outputting nothing.I locally ran
make checkandmake ubsanto verify this change.Thank you for the PR!
One of the optimizations I made was to keep allocations to a minimum, so
reed_solomon_new()preallocates the estimated space it will need for matrix inversion. I remember there was an issue where if there was more parity shards than data shards then the inversion workspace would get overrun. I believe I fixed that and just forgot to remove the guard.Thank you for patching it up along with the tests.