RedTail-X

Scholarly Publications & Official Findings & Reports Below:


RedTail-X

Variable-Length Final Shares for 4+2 Erasure-Coded Storage

(DarkRock VLFSC-RDTX) 

TL;DR: Fixed a padding bug in the storage layout, found a real repair bug while stress-testing it, and wrote it all up below — including what didn't work.

RedTail-X cover concept. Concept and art direction: Michael Cohee; image generated with ChatGPT (OpenAI). Artwork is illustrative, not a diagram of the measured storage system

Technical description: Variable-length final-share erasure-coded storage (VLFSECS), tuned to real file-size distributions rather than assuming every file divides evenly into fixed stripes.
Author: Michael Cohee
Project: DarkRock (darkrock_storage)
Test platform: Apple M1, Rust release builds
Status: Verified in local memory with real file input. No deployed network, persisted shard or manifest format, or encryption is evaluated here.

Later lab result (September 26, 2026): A separate single-host exercise persisted a narrowly scoped HMAC-protected manifest and 4+2 shares for 384 generated .sh files. Separate processes repaired one logical node and one six-node zone, restoring all files exactly. A corrected placement spread those files over 364 distinct six-node sets and passed eight seeded, staggered one- and two-node loss rounds. [1] This does not retroactively change the PDF benchmark methodology below; the lab's key, manifest, and all logical nodes reside on one physical volume, and no network or production metadata format was tested.

Controlled race follow-up: A new node loss during repair exposed a false-success condition in the lab's serial repair loop. A final-state audit now reports residual missing shares instead of success for that tested timing; a third overlapping loss can still cross the 4+2 recovery threshold. [2] This is a lab repair-control finding, not a change to RedTail-X coding math.

Abstract

RedTail-X is a storage-layout optimization for 4+2 Reed–Solomon (RS) erasure coding. A fixed-share implementation writes six 256 KiB shares even when a file's final stripe contains only a few bytes. RedTail-X retains 256 KiB shares for full stripes and sizes every share in a partial stripe to ceil(tail_bytes / 4).

On a local corpus of 213 PDF files totaling 666,933,563 bytes, actual emitted RS share bytes fell from 1,218,969,600 (1.8277× input) to 1,000,400,844 (1.5000× input), saving 218,568,756 bytes, or 17.93% of the fixed-share output. In one local pass, aggregate tail encode time fell from 1,338.0 to 611.5 ms, and aggregate tail repair time after two share losses fell from 1,358.9 to 693.2 ms. These timings are single-run observations, not stable latency estimates.

RedTail-X changes share sizing, not the RS mathematics. Standard systematic RS over GF(2⁸) remains the coding algorithm.

1. Background

DarkRock initially tested whether a custom polynomial parity construction could improve on a mature RS implementation. That comparison did not establish a coding advantage. Later, the fixed-share layout revealed a separate inefficiency: each file's short final stripe paid for six full 256 KiB shares. RedTail-X addresses that layout cost.

For four data and two parity shares, an unpadded stripe stores 1.5 coded bytes per data byte, apart from byte rounding. The measured fixed-share ratio on the PDF corpus was 1.8277×. File-size analysis showed that PDFs under 1 MiB contained 7.38% of input bytes but caused 70.57% of padding above the 1.5× reference. The excess padding was 218,569,255.5 bytes in the size calculation.[3]

2.1 Custom parity versus standard RS

The latest local 16 MiB pseudorandom-input run compared standard RS 4+2 with the custom GF(2⁸) parity construction:

Operation Standard RS Custom parity
Encode 140.44 ms 193.91 ms
Reconstruct with one data share missing 165.50 ms 134.39 ms
Reconstruct with two data shares missing 155.80 ms 235.20 ms
Coded storage on full stripes 1.50× 1.50×

The custom construction is in the systematic RS/MDS family and showed no repair-bandwidth or storage-overhead advantage. Its one-share reconstruction was faster in this single run, while encode and two-share reconstruction were slower. One pass does not establish a stable speed ranking. DarkRock uses the mature RS crate for the storage path. [4]

2.2 Compression selection

DarkRock's representation selector tests raw bytes against zstd level 3 when a cheap gate predicts compression may help. The gate examines one 8 KiB sample at the start of each 256 KiB chunk. It tries zstd if Shannon byte entropy is below 6.4 bits/byte or if a same-sample periodicity check finds a strong repeat. When zstd is attempted, the selector verifies exact decoding and keeps the smaller representation.

On 477 files totaling 872,272,600 bytes from a mixed local corpus:

Policy Bytes saved against raw Savings missed against always-try-zstd Median select-and-verify time, three passes
8 KiB sample at start 36.6 MB 21.7 MB 3.35 s
16 KiB sample at start 34.0 MB 24.3 MB 3.34 s
8 KiB sample at middle 32.2 MB 26.1 MB 3.19 s
Always try zstd 58.3 MB 0 6.32 s

The 8 KiB start policy saved the most bytes among the sampled policies on this corpus. On the PDF-only corpus, the middle sample saved more than the start sample (18.7 versus 17.3 MB). Neither result proves that one sample location is best for future object mixes. These are representation-stage measurements; the table does not include RS encoding or network write time. [5][6]

2.3 Repair-helper routing

An isolated model compared latency-weighted shortest paths with direct first-available and advertised-bandwidth helper choices across 1,000 fixed-seed synthetic topologies. Per-link latency and bandwidth were generated, and advertised node rates were deliberately independent of actual links. For one offline node, shortest-path selection beat first-available in 857 trials, tied in 130, and lost in 13; the median modeled time ratio was 0.841. Against advertised-bandwidth selection, it won 808, tied 177, and lost 15. With two offline nodes, each strategy had the same four available helpers, although their paths could differ; the median result was a tie.

This establishes behavior under the chosen synthetic distribution. It is not a live-network result and is not a Storj performance claim. A separate hand-built topology doubled network byte-hops for the weighted-path choice; that cost does not describe the randomized trial distribution. Routing is independent of RedTail-X. [7]

2.4 Exploratory formulations excluded from RedTail-X

Zero-coefficient canonicalization. For an abstract polynomial P(x) = Σ_e c_e x^e, an exact symbolic rule may omit terms with c_e = 0 and sort the remaining (e, c_e) pairs. This preserves the polynomial's mathematical value. It does not establish that two differently serialized files can be merged and later restored byte-for-byte. DarkRock's exploratory polynomial.rs uses f64, discards sums with |c_e| < 10⁻⁹, and formats retained coefficients to 12 exponential digits. Those near-zero and formatting steps can erase distinctions in the original representation. A byte-preserving version would have to store enough per-object undo information u_x to satisfy decode(canonical(x), u_x) = x for every original byte string x, then count the protected bytes of u_x and the index. No such polynomial-to-file transform or net storage saving is established here. Zero-coefficient canonicalization is excluded from the RedTail-X design and result.[8]

Corpus-size-normalized entropy (“N*Tropy”). The separate compression gate's actual byte-histogram measure is H₈ = −Σ_{b=0}^{255} p_b log₂(p_b), with 0 ≤ H₈ ≤ log₂(256) = 8 bits per byte; zero-probability terms contribute zero. Its current threshold is 6.4 bits per byte. The proposed score H_N = H₈ / log₂(N), where N is a growing number of corpus chunks, uses the wrong denominator for a fixed 256-symbol byte alphabet: it can fall solely because more chunks were added. In a read-only Dark corpus check, measured entropy barely changed from 7.8061 to 7.8038 bits per byte between 1,239 and 2,477 chunks, while H_N fell from 0.7597 to 0.6922. The proposed logit transform ln(p/(1−p)) for p = H₈/8 is undefined at p = 0 or 1 and has no demonstrated benefit for this gate. N*Tropy and entropy prediction are excluded; the measured fixed-scale compression gate is a separate component, not a RedTail-X share-sizing formula.[8]

3. RedTail-X design

3.1 Stripe sizing

A full stripe contains 4 × 256 KiB = 1 MiB of input. It retains four 256 KiB data shares and two 256 KiB parity shares.

For a nonempty partial stripe containing tail_bytes < 1 MiB, RedTail-X computes:

share_len = ceil(tail_bytes / 4)
coded_bytes = 6 × share_len

The four data shares hold the tail in order and use at most three zero-padding bytes in total. The two parity shares have the same share_len and use the same RS matrix as full stripes.

Each stripe's in-memory StripeManifest records both original_len and share_len, along with a hash of the original bytes and hashes of the six shares. The decoder validates share_len == ceil(original_len / 4), validates share lengths and hashes, reconstructs, truncates to original_len, and verifies the original hash. share_len alone cannot recover the exact original_len: up to four different tail lengths can have the same rounded share length. The manifest is not yet serialized or authenticated for remote use.

The full-stripe share geometry and RS parity math are unchanged. The implementation uses the same manifest-aware verification path for full and partial stripes.

3.2 Scope

RedTail-X retains the 4+2 recovery property: any four valid shares are sufficient for a stripe. It does not change the RS code or batch unrelated files into one stripe. Tests cover every one- and two-share-loss pattern at selected boundary sizes; the real PDF corpus exercised one specific two-loss pattern on every partial tail.

4. Results

4.1 Emitted coded bytes

The real RS encoder processed the 213 PDFs independently. Both rows below count the actual lengths of all emitted shares, rather than only applying a formula to file sizes:

Layout Emitted share bytes Ratio to original input
Fixed 256 KiB shares 1,218,969,600 1.8277×
RedTail-X variable final shares 1,000,400,844 1.5000×

The saving was 218,568,756 bytes. The variable result exceeds the exact 1.5 × input_bytes reference by only 499.5 bytes, attributable to byte rounding across files. The 1.5× reference applies to the selected bytes entering 4+2 RS; compression may reduce those bytes before coding. [9]

4.2 Local timing

Operation, corpus aggregate Fixed shares Variable final shares
Full-stripe encode 4,609.9 ms 4,620.8 ms
Partial-tail encode 1,338.0 ms 611.5 ms
Partial-tail two-loss repair 1,358.9 ms 693.2 ms

These are single-pass local wall times including parity and hashing. They indicate a substantial reduction in work on short tails, but require repeated trials before making stable performance claims. File reads occurred; no shard writes to disk or network were measured.

4.3 Correctness

Unit tests cover 1-byte through full-stripe boundaries and every one- and two-share-loss pattern for those sizes. A mixed test reconstructs a file with two full stripes and a short tail after two simulated losses per stripe. Invalid or absent length information is rejected.

In the PDF RS-isolation benchmark, all 213 partial tails reconstructed after simulated loss of data share 0 and parity share 4, with byte-for-byte comparison to their input tails.[9] In the separate compression-plus-RS run, every coded stripe, including full stripes, was reconstructed after the same two-share-loss pattern, and every file was restored and compared byte-for-byte.[10]

4.4 Compression gate followed by RedTail-X

The separate pipeline run used the default 8 KiB start gate, zstd level 3, and variable-final-share RS:

Metric Measured value
Original PDF bytes 666,933,563
Selected representation bytes 649,644,262
Actual RS share bytes 974,466,894
RS share bytes / original PDF bytes 1.4611×

This is below 1.5× relative to original PDF bytes because the selector removed 17,289,301 bytes before coding. RS itself still produces approximately 1.5× the selected representation bytes. The report excludes persisted manifest and representation metadata, encryption, and transport. [10]

5. Alternative layout: batching

A size-only calculation compared RedTail-X with concatenating all PDF bytes into a single shared stream before fixed-share coding:

Layout Predicted coded bytes Saving against fixed per-file stripes
All files batched into one stream 1,001,914,368 217,055,232
Independent files with variable final shares 1,000,400,844 218,568,756

Both approach the 1.5× reference. Batching would require a pack index and a policy for updates, deletes, and garbage collection. RedTail-X keeps file boundaries independent and achieved slightly better byte efficiency on this corpus. The batching row was calculated, not implemented or benchmarked. [3]

6. Limitations

  • The PDF corpus is one local file-size and content distribution. Percentage savings will vary with object sizes; a large-file workload amortizes final-stripe padding.
  • CPU timings are single-pass observations. The prototype has no persisted, authenticated manifest or shard format; metadata bytes are excluded from the reported storage totals.
  • Real node placement, disk-write behavior, encryption, retries, and network repair were not tested. Local corpus files were read from disk.
  • The default compression gate can miss compressible chunks and was not selected specifically for PDF-heavy workloads. The middle sample saved more bytes in the isolated PDF representation test, but was not run through the combined pipeline.
  • Corpus repair tests used one two-loss pattern. Boundary unit tests covered every one- and two-share-loss pattern at the tested sizes. The code's length-agnostic RS behavior still needs operational validation in a persistent storage system.
  • The in-memory hashes detect accidental corruption under the tested conditions; they do not authenticate a manifest supplied by an adversary.
  • The later sprawl lab authenticates its own persisted manifest with HMAC-SHA256, but stores the key beside it on the same machine. It validates reload and tamper detection with that key, not protection against compromise of the host or a remote trust model.

7. Conclusion

RedTail-X removes the dominant fixed-share padding cost in this PDF corpus. Actual coded output fell by 218,568,756 bytes while retaining 4+2 RS recovery in local tests. On partial tails, measured encode and repair work also fell substantially in a single run. The improvement is a storage-layout result, not a new erasure-code result or evidence that DarkRock outperforms deployed decentralized storage networks.

Combined with the default compression gate, the prototype emitted 974,466,894 RS share bytes for 666,933,563 original PDF bytes and restored every tested file after two simulated share losses per stripe. Persistence, authentication, encryption, and network operation remain open before production claims.

Glossary

  • 4+2 RS: Four data shares and two parity shares per stripe; any four valid shares can reconstruct the stripe.
  • MDS: Maximum Distance Separable; a code that achieves the optimal recovery threshold for its share count.
  • Stripe: Up to 1 MiB of input coded into six shares in this implementation.
  • Partial tail: A file's nonempty final stripe with fewer than 1 MiB of input.
  • Coded ratio: Emitted share bytes divided by the stated input bytes. This paper distinguishes original file bytes from selected representation bytes.

Source notes and quotations

These excerpts come from the dated local DarkRock reports named below. They are reproduced here so this Blogger post is readable without local file links. The full reports remain project records; these quotations do not add new measurements.

[1] DarkRock 18-node diversified sprawl and incremental failure test

sprawl-lab-v2-m1.md — local DarkRock report.

“It produced 364 distinct six-node sets across the same 384 files.”

[2] DarkRock controlled mid-repair failure test

midflight-failure-m1.md — local DarkRock report.

“Before the correction, the repair process returned success, but an independent full audit found five files still missing one share; verify failed at file 0.”

[2] DarkRock controlled mid-repair failure test

midflight-failure-m1.md — local DarkRock report. These are two separate injections.

Second failure: false completion.

“Before the correction, the repair process returned success, but an independent full audit found five files still missing one share; verify failed at file 0.”

Third overlapping failure: recovery limit crossed.

“The repair process stopped loudly at file 73: lost >2 shares.”

[3] PDF 4+2 padding distribution

pdf-padding-distribution-m1.md — local DarkRock report.

“Files under 1 MiB contribute 154,250,471 bytes (70.57%) of that padding while containing 49,209,873 bytes (7.38%) of input.”

[4] DarkRock storage benchmark

benchmark-m1.md — local DarkRock report.

“The custom row is a simple systematic GF(2^8) MDS construction in the Reed-Solomon family, separate from symbolic polynomial canonicalization.”

[5] Real-file entropy corpus: Downloads

entropy-corpus-downloads-m1.md — local DarkRock report.

“Files: 477. Nonempty chunks: 3638. Total input: 872272600 bytes.”

[6] Real-file entropy corpus: Dark PDFs

entropy-corpus-dark-pdfs-m1.md — local DarkRock report.

“Files: 213. Nonempty chunks: 2648. Total input: 666933563 bytes.”

[7] Randomized routing sensitivity test

routing-randomized-m1.md — local DarkRock report.

“This distribution deliberately makes advertised rate a poor proxy for actual links. It shows sensitivity to that assumption, not a field-measured prevalence of mismatches.”

[8] Canonical-key and entropy float check

entropy-float-check-dark-1gb.md — local DarkRock report.

“From 90 to 179 files, whole-corpus entropy changed only −0.002241 bits/byte, while H/log2(chunks) fell 0.067544.”

[9] Actual RS 4+2 variable final-share benchmark

variable-stripe-pdfs-m1.md — local DarkRock report.

“Actual emitted-byte saving: 218568756. Fixed and variable full stripes have identical share lengths.”

[10] PDF compression gate to variable-final-share RS 4+2

pdf-pipeline-variable-m1.md — local DarkRock report.

“Every coded stripe was reconstructed after losing data share 0 and parity share 4; every file was restored and compared byte-for-byte.”

Previous
Previous

The House That Watches Back: Reconstructing The Greko

Next
Next

redStackPro v1.0