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

vertexcodec: Reduce tail padding for v1 #825

Merged
merged 5 commits into from
Dec 25, 2024
Merged

vertexcodec: Reduce tail padding for v1 #825

merged 5 commits into from
Dec 25, 2024

Conversation

zeux
Copy link
Owner

@zeux zeux commented Dec 25, 2024

When v0 was implemented, the decode limit was thought to be 32 bytes;
hence the tail had to be at least 32 bytes to cover the decode overhang.
Since then, decode limit was revised to 24 bytes (8 bytes of 4-bit data
plus 16 bytes of outliers), but the tail remained the same as the format
is fixed. For v1, the decode limit is the same and this is unlikely to
change for future revisions either since 6-bit groups did not end up
working out (they would have required 28 bytes of tail space), so it is
time to reduce the tail to 24 bytes for v1.

This only impacts small blobs but makes the format a little cleaner.

This contribution is sponsored by Valve.

zeux added 5 commits December 23, 2024 11:52
Instead of checking v0 & 4 levels of v1, only check a single
combination. This allows exploration to happen faster.

We can then use the extra time to re-encode the data at the boundary of
the encoding size. This checks that the encoder and decoder is memory safe.
unreachable comment marks the line as dead for coverage analysis.
We were using 15 bytes per line which is confusing to inspect as it does
not align with hex dumps.
When v0 was implemented, the decode limit was thought to be 32 bytes;
hence the tail had to be at least 32 bytes to cover the decode overhang.
Since then, decode limit was revised to 24 bytes (8 bytes of 4-bit data
plus 16 bytes of outliers), but the tail remained the same as the format
is fixed. For v1, the decode limit is the same and this is unlikely to
change for future revisions either since 6-bit groups did not end up
working out (they would have required 28 bytes of tail space), so it is
time to reduce the tail to 24 bytes for v1.

This only impacts small blobs but makes the format a little cleaner.
Ignoring trivial bitgroups is sometimes detrimental for performance, so
for now just remove this; also split a line that's too long in two.
@zeux zeux merged commit a744d99 into master Dec 25, 2024
12 checks passed
@zeux zeux deleted the vcone-tail branch December 25, 2024 16:33
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.

1 participant