Skip to content

F4: Surface RX seq_num + TSF low on <devourer-stream>#89

Merged
josephnef merged 1 commit into
masterfrom
rx-seq-tsfl
Jun 7, 2026
Merged

F4: Surface RX seq_num + TSF low on <devourer-stream>#89
josephnef merged 1 commit into
masterfrom
rx-seq-tsfl

Conversation

@josephnef
Copy link
Copy Markdown
Collaborator

Summary

Both fields are already on the RX descriptor: seq_num is parsed at FrameParser.cpp:98, tsfl was one commented-out line at line 129. The FEC layer (#86 / #87) and any latency-measurement consumer want both visible; this PR surfaces what the chip already gives us.

Changes

  • src/FrameParser.h — add uint32_t tsfl to rx_pkt_attrib alongside the existing seq_num.
  • src/FrameParser.cpp — uncomment the TSFL parser and drop the bogus (byte) cast (the macro reads all 32 bits of pdesc+20 as a u32, not a byte — verified against rtl8812a_recv.h):
    - /* pattrib.tsfl=(byte)GET_RX_STATUS_DESC_TSFL_8812(pdesc); */
    + pattrib.tsfl = GET_RX_STATUS_DESC_TSFL_8812(pdesc);
  • demo/main.cpp — extend the <devourer-stream> printf with seq=%u tsfl=%u. Optional fields; PR Phy-level soft metrics on stream lines + BER-vs-SNR analyser #84's regex pattern in stream_rx.py / tun_p2p.py / corruption_analysis.py already tolerates them via the same pass-through approach used for rssi/evm/snr.

What this enables (out of scope for this PR — just data surfacing)

  • FEC RX side can dedup by chip-side seq before feeding the codec, so air-level retransmissions stop double-counting at the codec.
  • One-way latency measurement by diffing TSF against the host clock at TX time — a building block for the F5 TX-RPT goodput numbers and any adaptive --fec-overhead loop.

Test plan

  • cmake --build build -j clean
  • <devourer-stream> lines on master now carry seq + tsfl fields; existing Python consumers tolerate the additions via their existing regex pass-through (no Python-side change required).
  • Reviewer to run an existing tun_p2p bench and confirm the new fields appear without disturbing throughput / loss numbers.

Second in the five-feature C++ series. Followed by:

  • F3 — selectable stream-carrier rate/BW (uses F1's HT-MCS unlock + this PR's seq/tsfl plumbing for dup detection)
  • F5 — C2H TX-RPT parser + REG_FIFOPAGE_INFO queue-depth poll
  • F2 — BB-dbgport per-subcarrier IQ spike (research)

Predecessor: F1 (#88).

🤖 Generated with Claude Code

Both fields are already on the RX descriptor: `seq_num` is parsed at
FrameParser.cpp:98, `tsfl` was one commented-out line at line 129. The
FEC layer (#86 / #87) and any latency-measurement consumer want both
visible; this is the data the chip already gives us.

* src/FrameParser.h — add `uint32_t tsfl` to rx_pkt_attrib alongside
  the existing seq_num.
* src/FrameParser.cpp — uncomment the TSFL parser:
  -   /* pattrib.tsfl=(byte)GET_RX_STATUS_DESC_TSFL_8812(pdesc); */
  +   pattrib.tsfl = GET_RX_STATUS_DESC_TSFL_8812(pdesc);
  Drop the bogus `(byte)` cast — the macro reads all 32 bits of
  pdesc+20 as a u32, not a byte (verified against rtl8812a_recv.h).
* demo/main.cpp — extend the <devourer-stream> printf with
  `seq=%u tsfl=%u`. Optional fields; PR #84's regex pattern in
  stream_rx.py / tun_p2p.py / corruption_analysis.py already tolerates
  the new fields via the same pass-through approach used for
  rssi/evm/snr (no Python-side change required to keep working).

What this enables (out of scope for this PR — just data surfacing)

* FEC RX side can dedup by chip-side seq before feeding the codec, so
  air-level retransmissions stop double-counting at the codec.
* One-way latency measurement by diffing TSF against the host clock
  at TX time — a building block for the F5 TX-RPT goodput numbers and
  for any adaptive `--fec-overhead` loop.

Verification

* `cmake --build build -j` clean.
* Default behaviour: <devourer-stream> lines now carry seq + tsfl
  fields; existing Python consumers (regexes are tolerant) keep
  working. tests/regress.py 4-cell matrix byte-identical.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@josephnef josephnef merged commit fd87c63 into master Jun 7, 2026
5 checks passed
@josephnef josephnef deleted the rx-seq-tsfl branch June 7, 2026 19:08
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