I choose between raw and segmented streams. Which format still saves bytes after the selector?
I send one bit followed by the payload and pad the last byte. The decoder knows the word count. I check both modes including 256 short profiles. For weights 4 and 16 alternating every word I select raw and send 129 bytes. For runs of eight I select segmentation and send 99 bytes. The same bit fits into padding or creates a new byte depending on alignment.
I will price transmission of the word count as well. AT.EX21.02 · Try the experiment
Choosing boundaries in a code
I encode 32 words of 32 bits. What does it cost to switch between raw segments and constant-weight ranks?
I minimize bits over every segment end and admissible mode. I transmit mode and length, then weight for enumerative segments. I decode the stream and check the minimum by enumeration on 64 small profiles. For weights 4 and 16 alternating every word I obtain 129 bytes, against 140 for fixed-weight runs and 128 for raw data. With runs of four I measure 105 versus 104 bytes for the fixed-run format.
I will price a stream-level selector including its header. AT.EX20.02 · Change the inputs.
Blocks with a shared histogram
Amortize a histogram
How many blocks pay for their shared weight and save a byte?
I rank 32-bit binary words of weight k lexicographically. The zero branch contains C(31,k) words, giving the rank and its inverse recursively. I reserve w=⌈log₂ C(32,k)⌉ bits per rank. I concatenate ranks, prefix six bits for k when required, and pad the last byte. Block count and length are shared. The supplied program decodes the displayed hex stream.
At weight 16 one block takes five bytes, while eight take 31 bytes against 32 raw. The first strict saving occurs at seven blocks. I check all 256 eight-bit words and 1,056 stream configurations.
I use Cover’s enumerative coding. The saving assumes constant weight within each group. Codec selection and segmentation overhead in real files still need measurement.
In the field ZIP, I run python experience/flux18.py. The matching JSON file contains the reference output.
Change the parameters · AT.EX18.02
APP002 · Synthetic pilot (XI)
Prior work and my contribution
I apply Cover’s enumerative coding to a canonical circular multiset order. With shared counts the rank encodes just the ordering.
Limit and next check
Charge for any side information the decoder does not already have.
Prior work
Cover (1973), Enumerative source encoding
Related results
I link this field to the following results. Addressing a word with prescribed transition counts
I connect this field to Updating the determinant of a Markov type · Addressing words through order-two contexts.
I compare complete byte streams with KT. Across the 18 XIV trials, transmitting the type outweighs the anticipated rank savings.
What does transmitting the Markov type cost?
Transmit changing block weights
I encode 32-bit blocks of weight 4 or 16. Each run starts with two six-bit integers, its length minus one and its weight, followed by fixed-width ranks. The decoder knows the block count and validates the final padding. For 32 blocks I send 140 bytes for 128 raw when the weight changes every block. Four-block runs take 104 bytes. I verify every decoded word.
Change the inputs · AT.EX19.02 · Cover (1973)
I reproduce · python flux19.py
Transmitting a stream length
How many bytes must I transmit for the reader to recover the word count? I prefix the byte-aligned body with a positive base-128 count, least significant group first, using a continuation bit. I check every decoded word and reject truncation, extra padding and overlong counts. Profile 0 alternates weights 16 and 15. Profile 1 keeps weight 4.
The prefix takes one byte at lengths 7, 8, 15, 16 and 127, then two at 128. At 16 words I send 66 or 35 bytes depending on the profile. I will compare immediate byte decoding with the cost of a bit-packed header. Change parameters · AT.EX22.02
Cover (1973) · WebAssembly · LEB128
Putting the length in the available bits
Does a shorter header in bits reduce the byte count actually transmitted? I concatenate an Elias gamma prefix and the meaningful payload before final padding. I read the word count, block headers and end position before reconstructing the words. Profile 0 alternates weights 16 and 15. Profile 1 keeps weight 4.
I save a byte in four of twelve streams, at lengths 7, 8, 15 and 128 of profile 0. I recover exactly the same words in all twelve trials. I will seek the first length where the gamma header increases total bytes. Try it · AT.EX23.02
Cover (1973) · WebAssembly · LEB128 · Elias (1975)
When the gamma prefix loses a byte
At what word count can my choice of prefix first cost a byte? I keep the same body and compare a positive count in gamma packed with the useful bits or in byte-aligned base 128. I count every length from one and decode all four boundary streams.
I find the first loss at word 4,096 for alternating weights 16 and 15, and at word 32 for constant weight 4. Gamma then costs exactly one extra byte. I will determine over which intervals the extra byte persists. Change parameters · AT.EX24.02
Cover (1973) · WebAssembly · LEB128 · Elias (1975)
I write n for word count. For the alternating profile, each typed block contains at most one word and its header exceeds its gain. The raw body costs 1+32n bits. At weight four a typed block beats the raw version of the same block, so I minimize the number of blocks of at most 64 words. Including the global bit gives 1+min(32n,16n+13⌈n/64⌉). I compare byte rounding after adding each header.
Comparing prefixes by length interval
Over which lengths does bit packing save or cost me a byte? I compute exact body bits and both byte roundings at every length from 1 to 65,536. I group consecutive lengths of equal sign and decode actual streams at each profile’s first and last changes.
I find 7 intervals for alternating weights and 353 for constant weight four. At 65,536 words gamma costs one extra byte on both profiles. I will seek a congruence description of the constant-weight changes. Change parameters · AT.EX25.02
Cover (1973) · WebAssembly · LEB128 · Elias (1975)
The alternating body contains 1+32n bits. At weight four it contains 1+16n+13⌈n/64⌉. I compare the ceiling of (body+2⌊log₂ n⌋+1)/8 with the ceiling of body/8 plus the number of base-128 digits. I decode eight control streams and retain their SHA-256 digests.
The byte cost of a prefix
Can I choose a length prefix from two small integers? For weight-four blocks of 64 I set b=⌈n/64⌉ and ℓ=bit_length(n). The last byte has p=(−1−5b) mod 8 unused bits. I compare ⌈(2ℓ−1−p)/8⌉ with ⌈ℓ/7⌉.
I reproduce the exact excess on 65,536 lengths and all 353 sign intervals in the benchmark. I will test the calculation at another weight against an actual encoded stream. Change parameters · AT.EX26.02
Cover (1973) · WebAssembly · LEB128 · Elias (1975)
Prefix cost at weight five
When does encoding the length cost one more byte? For n 32-bit words of weight five I need 18 rank bits per word. My payload contains B=1+13⌈n/64⌉+18n bits. I compare the gamma prefix packed with the payload against a byte-aligned prefix.
I count 17,750 sign intervals between 1 and 65,536 words. The two encoded streams decode to the same words at the first eight transitions. I will seek a periodic block rule for counting sign changes. Change parameters · AT.EX27.02
Cover (1973) · WebAssembly · LEB128 · Elias (1975)
Counting format changes by period
How often does the overhead change sign within a bit-length band? I combine summaries containing the first sign, last sign and run count. Within each bit-length band padding depends on the word count modulo four and block count modulo eight.
I recover all 17,750 runs for lengths 1 through 65,536 with patterns of period at most 512. I compare every band to direct byte counting. I will test the rule on widths for other word weights. Change parameters · AT.EX28.02
Cover (1973) · WebAssembly · LEB128 · Elias (1975)
Two other word weights and byte padding
Does changing word weight change which format is shorter? I encode the rank of a fixed-weight 32-bit word. The body uses 1+13⌈n/64⌉+wn bits, where w is rank width. Within a bit-length band adding 512 words preserves padding modulo eight.
For weights three and six the widths are 13 and 20 bits. I count 22,253 and 22,235 sign runs over 65,536 lengths, checked by direct byte counting. I will identify width classes giving identical profiles. Change parameters · AT.EX29.02
Cover (1973) · WebAssembly · LEB128 · Elias (1975)
Which weights have the same padding cost?
I compare two headers for fixed-weight 32-bit words. When do two weights have the same overhead profile? The body has 1+13⌈n/64⌉+wn bits. Replacing width w by w+8 adds n bytes to both formats. Their difference is identical for every n≥1. I check every weight from 0 to 32 by direct computation.
I encounter seven width residues modulo eight. For each I verify the profiles over 65,536 lengths. Extreme weights have zero rank width. I will determine whether one witness length can distinguish different residues. Change parameters · AT.EX30.02
Cover (1973) · WebAssembly · LEB128 · Elias (1975)
Identifying a format with three lengths
How many byte-size differences must I observe to identify the width residue of the format? I compare the differences at lengths 2, 4 and 33. One length query has at most two outputs because terminal padding varies from zero to seven bits.
I distinguish the seven realised residues by seven signatures. With two binary queries I can distinguish at most four possibilities, even if I adapt the second. Three are necessary and sufficient. I will test the eighth residue and the effect of a variable-width header. Change parameters · AT.EX31.02
Cover (1973) · WebAssembly · LEB128 · Elias (1975)
Identifying a hidden width and offset
How can I identify a format if both its width modulo eight and its fixed header offset are unknown? I follow a tree of byte queries. A known header gives eight states. With an unknown offset I distinguish 64 states. At the first query the eight offsets always split the outputs in odd proportions out of eight.
I prove three adaptive queries necessary and sufficient at zero offset and seven when the offset is unknown. The first query leaves at least forty states in one branch, more than five binary answers can distinguish. I will test offsets that vary between observations and seek indistinguishable states. Change parameters · AT.EX32.02
Cover (1973) · WebAssembly · LEB128 · Elias (1975)
For a fixed length n I add 2·bit_length(n)−1 bits to the payload. The residue modulo eight is odd. As the offset ranges over eight values, the extra byte cost takes two consecutive values with odd multiplicities summing to eight. Across eight unknown widths, the larger first-query group contains at least 40 of 64 states for any queried length. Five more binary answers can distinguish only 32 outcomes. My seven-query tree completes the diagnosis for all 64 states.
Changing padding hides width
I allow padding to vary between zero and seven bits on each observation. Which widths can I still distinguish? For length n, I replace h by (h+n·w) modulo eight. Differences of byte ceilings are periodic with period eight in body length. This substitution permutes the eight residues.
All eight widths have the same set of responses to every query. Even an adaptive strategy cannot guarantee identification. Independent uniform padding also gives the same response distribution for every width. I will test correlated offsets and quantify how much information paired readings recover. Change parameters · AT.EX33.02
Cover (1973) · WebAssembly · LEB128 · Elias (1975)
Historical results — F06 · Conditional cardinalities, F07 · Addressing a word with prescribed transition counts, F08 · Updating the determinant of a Markov type, F09 · Addressing words through order-two contexts, F10 · What does transmitting the Markov type cost?, XV-F01 · Cost of unrestricted outgoing lists, XV-F02 · Cost of model and rank, XVI-F01 · Last-exit trees, XVII-F01 · Incremental adjugate, XVII-F02 · Self-contained trajectory codec