[ 
https://issues.apache.org/jira/browse/LUCENE-9822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17295647#comment-17295647
 ] 

ASF subversion and git services commented on LUCENE-9822:
---------------------------------------------------------

Commit 8e337ab63fac9aeeaf76e91c698cabad0ccbe769 in lucene-solr's branch 
refs/heads/master from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=8e337ab ]

LUCENE-9822: Assert that ForUtil.BLOCK_SIZE can be PFOR-encoded in a single byte

For/PFor code has BLOCK_SIZE=128 as a static final constant, with a lot
of assumptions and optimizations for that case. For example it will
encode 3 exceptions at most and optimizes the exception encoding with a
single byte.

This would not work at all if you changed the constant in the code to
something like 512, but an assertion at an early stage helps make
experimentation less painful, and better "documents" the assumption of how
the exception encoding currently works.


> Assert that ForUtil.BLOCK_SIZE can be encoded in a single byte in PForUtil
> --------------------------------------------------------------------------
>
>                 Key: LUCENE-9822
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9822
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/codecs
>    Affects Versions: master (9.0)
>            Reporter: Greg Miller
>            Priority: Trivial
>         Attachments: LUCENE-9822.patch
>
>
> PForUtil assumes that ForUtil.BLOCK_SIZE can be encoded in a single byte when 
> generating "patch offsets". If this assumption doesn't hold, PForUtil will 
> silently encode incorrect positions. While the BLOCK_SIZE isn't particularly 
> configurable, it would be nice to assert this assumption early in PForUtil in 
> the even that the BLOCK_SIZE changes in some future codec version.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to