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.
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 9b6bea99..d906a69 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -266,6 +266,8 @@
 
 * LUCENE-9773: Upgrade icu to 68.2 (Robert Muir)
 
+* LUCENE-9822: Add assertion to PFOR exception encoding, documenting the BLOCK_SIZE assumption. (Greg Miller)
+
 ======================= Lucene 8.9.0 =======================
 
 API Changes
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/PForUtil.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/PForUtil.java
index 17af2e5..4376036 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/PForUtil.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/PForUtil.java
@@ -37,6 +37,7 @@
   private final ForUtil forUtil;
 
   PForUtil(ForUtil forUtil) {
+    assert ForUtil.BLOCK_SIZE <= 256 : "blocksize must fit in one byte. got " + ForUtil.BLOCK_SIZE;
     this.forUtil = forUtil;
   }