Skip to content

LDPC as a first-class primitive: bench-derived RX caps, encoding proof, coding-gain waterfall#288

Merged
josephnef merged 1 commit into
masterfrom
feat/ldpc-truth-caps
Jul 12, 2026
Merged

LDPC as a first-class primitive: bench-derived RX caps, encoding proof, coding-gain waterfall#288
josephnef merged 1 commit into
masterfrom
feat/ldpc-truth-caps

Conversation

@josephnef

Copy link
Copy Markdown
Collaborator

What

Makes LDPC a low-level library primitive backed by bench facts instead of vendor folklore. Closes the loop on the "one Rocket M5 outperforms my 8812AU rig" thread: LDPC is a free ~3 dB the kernel-driver ecosystem throws away (aircrack-ng/88XXau strips the radiotap LDPC/STBC bits on TX; devourer honours them per-packet on all three generations).

Bench campaign (this rig, 2×-direction encoding-matrix, devourer↔devourer)

chip (gen) TX LDPC HT/VHT RX decodes LDPC RX reports per-frame flag
RTL8812AU (J1) ✓/✓ ✓ (RX-desc bit)
RTL8814AU (J1) ✓/✓ ✗ — no HW indicator
RTL8822BU (J2) ✓/✓ ✓ (phy-status b7[5])
RTL8812CU (J3) ✓/✓
RTL8812EU (J3) ✓/✓ (STBC n/a, 1SS TX)
RTL8821AU (J1) pending physical swap (VHT-LDPC RX field-reported broken)

The vendor HAL_DEF_RX_LDPC table (all-false on Jaguar1; 8812A C-cut TX "IOT issue" disable, dated comments from hpfan 2013) is association-IE advertisement policy, not hardware truth — the 8812A demonstrably decodes LDPC on-air.

Measured coding gain (tests/ldpc_waterfall.sh, 8812AU→8822BU, MCS7/20 MHz, TXAGC-index sweep): +3.0 dB at the 10%-delivery crossing. Bonus: in the near-field saturation regime BCC MCS7 rolls over and dies (0–19%) while LDPC keeps delivering ~80% — LDPC also rides through distortion, not just noise.

Changes

  • AdapterCaps.ldpc_rx_ht / ldpc_rx_vht / ldpc_rx_flag — bench-derived RX truth table, split HT/VHT (separate decoder silicon; the 8821A failure is VHT-only). Emitted in adapter.caps.
  • rx.txhit gains rate/bw/stbc/ldpc — an encoding-matrix pass now proves what encoding was decoded (a pass with ldpc:0 = TX fell back to BCC).
  • rx.energy gains frames_ldpc/frames_stbc — live per-encoding delivery split for adaptive controllers.
  • tests/regress.py --modes txside:rxside — truth-table runs use --modes devourer:devourer (kernel rows strip the bits and double runtime).
  • tests/ldpc_waterfall.{sh,py} — the coding-gain measurement harness.
  • Docs: docs/logging.md schemas, tests/README.md, CLAUDE.md.

Validation

  • Truth-table sweep: 8 pair-directions × 6 encodings, all ✓ (8812EU pairs on ch36 per the 8822e 2.4 GHz TX quirk).
  • ldpc=1 flag cross-checked on 8822BU / 8812CU / 8812AU RX; 8814AU confirmed flag-less while decoding.
  • Caps events hardware-checked: 8812A 1/1/1, 8814A 1/1/0; frames_ldpc == frames on a pure LDPC feed.
  • ctest 20/20.

🤖 Generated with Claude Code

…f on rx.txhit, per-encoding counters, coding-gain waterfall

Bench campaign (encoding-matrix devourer<->devourer cells, 8812AU reference,
ch6/ch36): every plugged chip — 8812AU, 8814AU, 8822BU, 8812CU, 8812EU —
passes HT-LDPC / HT-LDPC+STBC / VHT-LDPC both directions at full delivery.
The vendor HAL_DEF_RX_LDPC table (all-false on Jaguar1, "IOT issue" C-cut
TX disable) is 2013-era interop-advertisement policy, not hardware truth.

- AdapterCaps: ldpc_rx_ht / ldpc_rx_vht / ldpc_rx_flag — the bench-derived
  LDPC RX truth table, split HT/VHT because the decoders are separate
  silicon paths (the 8821A field failure is VHT-only). ldpc_rx_flag=false
  on the 8814A: it decodes LDPC but the vendor wired no per-frame
  indicator (rxdesc offsets 16/20 unparsed, no ldpc bit in the Jaguar1
  phy-status report) — RxAtrib.ldpc reads 0 on frames it decoded fine.
- rx.txhit gains rate/bw/stbc/ldpc so an encoding-matrix pass proves what
  encoding was actually decoded, not just that frames arrived.
- rx.energy gains frames_ldpc/frames_stbc (DEVOURER_RX_AGG_SA-filtered) —
  the live per-encoding delivery split an adaptive controller compares.
- regress.py --modes txside:rxside filter: LDPC/STBC truth-table runs want
  --modes devourer:devourer (kernel-TX rows strip those bits and double
  the runtime).
- tests/ldpc_waterfall.{sh,py}: delivery-vs-TXAGC-index waterfalls for
  BCC vs LDPC at the same MCS; measured on 8812AU->8822BU at MCS7/20MHz:
  +3.0 dB LDPC gain at the 10%-delivery crossing, and in the near-field
  saturation regime LDPC delivered ~80% where BCC rolled over to 0-19%.

Hardware-validated: caps events (8812A 1/1/1, 8814A 1/1/0), frames_ldpc
== frames on a pure LDPC feed, ldpc=1 txhits confirmed on 8822BU/8812CU/
8812AU RX. ctest 20/20.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@josephnef josephnef merged commit bbc829b into master Jul 12, 2026
15 checks passed
@josephnef josephnef deleted the feat/ldpc-truth-caps branch July 12, 2026 22:20
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