turbine: accelerate 32+32 FEC generation and recovery - #259
Draft
7layermagik wants to merge 9 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improve Mithril's standard 32 data + 32 coding shred path from block construction through repair recovery:
DATA_COMPLETE_SHREDonly at the actual end of a component spanning multiple FEC sets;This PR does not change the repair wire protocol, request signing, peer selection, or scheduler policy. Request-path work will be reviewed separately.
Motivation
The producer target previously represented two individual shred payloads rather than two complete 32-shred FEC payloads. That caused unnecessarily small entry batches. The generator also marked each FEC boundary as data-complete, which truncated components spanning multiple FEC sets.
On recovery, the general decoder pays matrix/setup and allocation costs when only one data shred is absent. For the invariant 32+32 matrix, that output has a direct GF(256) equation and can use process-wide precomputed coefficient rows without changing the encoded data or acceptance rules.
Production scope
The production recovery dispatch is deliberately narrow:
All other erasure patterns continue through the existing
reedsolomon.ReconstructSomepath. The reduced multi-missing and coding-only paths remain test/benchmark evidence only.Zen 5 results
Ryzen 7 9700X, Go 1.26.4,
GOMAXPROCS=1, one pinned physical core. Repair-simulator values are medians of seven sequential one-second samples.The one-missing boundary drops from 144 to 5 allocations per operation. Deep-catch-up scenarios remain effectively neutral because they do not enter the specialized dispatch.
Correctness and auditability
SlotAssemblerboundary;Validation
Passed:
go test -count=1 ./pkg/repair ./pkg/turbine/...go test -race -count=1 ./pkg/repair ./pkg/turbine ./pkg/turbine/internal/rsrecover ./pkg/turbine/repairsimgo vet ./pkg/repair ./pkg/turbine/...git diff --checkA local
go test ./...also passed the changed repair/turbine packages but is not globally green in this checkout because unrelated conformance/genesis fixtures are unavailable and existing lightbringer/sealevel tests fail.