Skip to content

Fused FEC: sub-block integrity + Reed-Solomon + per-layer UEP#113

Merged
josephnef merged 1 commit into
masterfrom
feat/fused-fec
Jun 27, 2026
Merged

Fused FEC: sub-block integrity + Reed-Solomon + per-layer UEP#113
josephnef merged 1 commit into
masterfrom
feat/fused-fec

Conversation

@josephnef

Copy link
Copy Markdown
Collaborator

What

A cross-layer fused FEC stack for the long-range video downlink. Today three error-correction resources never cooperate: the PHY-MCS inner code, an application-layer erasure code, and DEVOURER_RX_KEEP_CORRUPTED (kept FCS-failed frames). This wires them together: instead of discarding a CRC-failed frame as one whole-frame erasure, it salvages the frame's CRC-valid sub-blocks — turning the chip's all-or-nothing FCS into fine-grained per-symbol erasures the outer code already knows how to recover from.

Full architecture, design rationale, and results: docs/fused-fec.md.

Contents (tools/precoder/, all numpy-light Python)

  • fec_subblock.py — the sub-block-integrity (SBI) layer: fixed-size, individually CRC-guarded sub-blocks (one sub-block == one outer-code symbol), with stream_id multiplexing. Fixed-size on purpose so a corrupted length byte can't desync neighbours.
  • stream_fec_rs.py — Reed-Solomon outer scheme (systematic GF(2⁸) Vandermonde, Rizzo/zfec construction), added as a third scheme alongside RaptorQ/RLC; MDS, best for small low-latency blocks.
  • svc_uep_fec.py — per-SVC-layer FEC-rate UEP (HEVC NAL → temporal layer → RS redundancy); the application-FEC half complementing the MCS ladder in svc_tx.h.
  • fused_fec_link.py + fused_fec_tx/rx.py — chip-path sender/receiver + CLIs; the RX runs baseline and SBI decoders in lockstep and reports the gain.
  • fec_fusion_sim.py — offline simulation quantifying the SBI gain and sizing the sub-blocks (no hardware).

tests/: fused_fec_onair.sh (chip↔chip on-air harness), sdr_interferer.py (USRP B210 calibrated co-channel source — a reproducible SNR knob without an attenuator). txdemo/stream_tx_demo/main.cpp: DEVOURER_TX_PWR_OVERRIDE.

Results

  • 22 new unit tests; full precoder suite 130/130 green.
  • On-air, real silicon (8812 → 8821, MCS7, 15 s): +129 RS blocks recovered that the drop-whole-frame baseline lost (~13 % lift in delivered blocks).

Notes

  • The SDR-RX path (USRP B210 + a gr-ieee802-11 fork) is a separate experiment in sister repos; this PR is the chip-path + the shared FEC stack. The SDR over-air gain is currently decoder-limited (hard-decision Viterbi) — documented as future work in docs/fused-fec.md.
  • No change to the WiFiDriver core RX/TX behaviour beyond the additive DEVOURER_TX_PWR_OVERRIDE knob.

🤖 Generated with Claude Code

Cross-layer FEC for the video downlink: keep FCS-failed frames
(DEVOURER_RX_KEEP_CORRUPTED) and salvage their CRC-valid sub-blocks instead of
discarding the whole frame as one erasure. A frame's all-or-nothing FCS becomes
fine-grained per-symbol erasures, multiplying the outer code's recovery when
corruption is localized.

tools/precoder/:
- fec_subblock.py — sub-block-integrity (SBI) layer: pack/unpack fixed-size,
  individually CRC-guarded sub-blocks (one sub-block == one outer-code symbol);
  stream_id multiplexing; numpy-free so it imports into the GNU Radio env.
- stream_fec_rs.py — Reed-Solomon outer scheme (systematic GF(2^8) Vandermonde,
  Rizzo/zfec construction, poly 0x11d), registered as a third scheme alongside
  RaptorQ/RLC in stream_fec.py.
- svc_uep_fec.py — per-SVC-layer FEC-rate UEP (HEVC NAL -> temporal layer -> RS
  redundancy); the application-FEC half of cross-layer UEP that complements the
  MCS ladder in svc_tx.h.
- fused_fec_link.py + fused_fec_tx.py/fused_fec_rx.py — chip-path sender/receiver
  + CLIs; the RX runs baseline and SBI decoders in lockstep and reports the gain.
- fec_fusion_sim.py — offline simulation quantifying the SBI gain and sizing the
  sub-blocks, no hardware.
- 22 new unit tests (suite 130/130 green).

tests/:
- fused_fec_onair.sh — chip<->chip on-air gain harness (8812 TX -> 8821 RX).
- sdr_interferer.py — USRP B210 calibrated co-channel AWGN/CW source, a
  reproducible SNR knob when no attenuator is available.

txdemo/stream_tx_demo/main.cpp — DEVOURER_TX_PWR_OVERRIDE (absolute per-rate
TXAGC index 0..63) for the marginal-SNR bench setups that exercise the salvage.

On-air, real silicon (8812->8821, MCS7, 15 s): +129 RS blocks recovered that the
drop-whole-frame baseline lost. Full architecture + results: docs/fused-fec.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@josephnef josephnef merged commit db52c97 into master Jun 27, 2026
6 checks passed
@josephnef josephnef deleted the feat/fused-fec branch June 27, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant