Skip to content

Fix byte decoder input positions for nonzero offsets - #73

Merged
lemire merged 1 commit into
fast-pack:masterfrom
PHJ2000:fix-byte-decoder-input-offset
Oct 23, 2026
Merged

lemire merged 1 commit into
fast-pack:masterfrom
PHJ2000:fix-byte-decoder-input-offset

Conversation

@PHJ2000

@PHJ2000 PHJ2000 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

When a byte-array block starts at a nonzero input offset, VariableByte and IntegratedVariableByte add the final absolute cursor to the original offset. For example, decoding a four-byte block starting at 1 leaves the cursor at 6 instead of 5, so the next block is read from the wrong location. A zero-length decode also changes a nonzero cursor.

Set the input position to the final cursor in both decoders. Extend the existing nonzero-offset round-trip test to check both cursors and add an empty-input regression.

Validation: the regressions fail before the fix; mvn package passes (104 tests, 1 existing skip), and the example compiles and runs on Java 21.

Signed-off-by: Jaehong Park <105151063+PHJ2000@users.noreply.github.com>
@lemire
lemire merged commit de8bdbd into fast-pack:master Oct 23, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants