You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some more digging I believe the source of the issue is that the ring buffer is initialized with the last two bytes set to 0 (here in c brotli and here in rust brotli) but in the rust brotli implementation the end of the ring buffer is immediately overwritten with the shared dictionary. As a result the p1 and p2 lookups get the value of the last two bytes of the shared dictionary instead of 0 as in the c implementation.
The text was updated successfully, but these errors were encountered:
Here's a unit test that can reproduce:
I turned on logging for both the c implementation and this one and found that they diverged in behaviour on the first insert/copy:
c brotli:
rust brotli:
After some more digging I believe the source of the issue is that the ring buffer is initialized with the last two bytes set to 0 (here in c brotli and here in rust brotli) but in the rust brotli implementation the end of the ring buffer is immediately overwritten with the shared dictionary. As a result the p1 and p2 lookups get the value of the last two bytes of the shared dictionary instead of 0 as in the c implementation.
The text was updated successfully, but these errors were encountered: