HFDL: forensic round — LPDU emission parity, bench fixture (33 vs oracle 37)#100
Conversation
…cle 37) VDL2-methodology oracle diff (dumphfdl built from source, frame-exact): the 13 data LPDUs match one-for-one; the missing 4 are the weakest bursts (4.0-5.0 dB SNR at 300 bps) - a sensitivity tail, NOT a convention bug. Parser-policy fixes from the round: - no CRC-valid LPDU is silently dropped anymore: unparsable HFNPDU contents emit an 'unnumbered-data' envelope with payload hex (dumphfdl-equivalent behaviour) - LPDU 0x4F correctly labeled logon-resume (was logon-request) Bench: hfdl_offair fixture (release asset) + floor 31. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughHFDL parser now emits separate events for logon request ( ChangesHFDL Parser and Benchmark Improvements
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/xng-mode-hfdl/src/pdu.rs (1)
198-229: ⚡ Quick winAdd focused unit tests for the new fallback/classification branches.
Please add parser tests that assert: (1) LPDU
0x4Femitslogon-resume, and (2) CRC-valid but unparsable HFNPDU content emitsunnumbered-datawith stabledata_hex. The bench decode-count gate validates totals, but not event-kind/detail correctness.Proposed test scaffold
+ #[test] + fn lpdu_0x4f_emits_logon_resume() { + let lpdu = with_fcs(vec![0x4F, 0x12, 0x34, 0x56]); + let mpdu = build_mpdu_downlink(3, 0xC7, &[lpdu]); + let ev = PduParser::new().parse(&mpdu, 300); + assert_eq!(ev.len(), 1); + assert_eq!(ev[0].kind, "logon-resume"); + } + + #[test] + fn unparsable_hfnpdu_emits_unnumbered_data_envelope() { + let lpdu = build_lpdu_hfnpdu(&[0x01, 0x02]); // non-0xFF HFNPDU + let mpdu = build_mpdu_downlink(3, 0xC7, &[lpdu]); + let ev = PduParser::new().parse(&mpdu, 300); + assert_eq!(ev.len(), 1); + assert_eq!(ev[0].kind, "unnumbered-data"); + assert_eq!(ev[0].details["data_hex"], "0102"); + }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/xng-mode-hfdl/src/pdu.rs` around lines 198 - 229, Add focused unit tests for the HFDP/LPDU parser to cover the new fallback/classification branches: create tests that feed a LPDU with first byte 0x4F and assert the parser emits an HfdlEvent with kind "logon-resume" and appropriate details; and feed a CRC-valid HFNPDU whose payload bytes are not parsable by xng_acars::block::parse and assert the parser emits an HfdlEvent with kind "unnumbered-data" whose details contain a stable data_hex exactly matching the input bytes and raw equals the original payload. Locate the parsing entry (in pdu.rs where the envelope closure, match on h[1], and xng_acars::block::parse are defined) and add tests that call the public parse function/entrypoint used by the crate, constructing minimal headers/CRC so the code path hits the 0x4F and the CRC-valid but unparsable branches, and assert on HfdlEvent.kind, details["data_hex"], and raw fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@crates/xng-mode-hfdl/src/pdu.rs`:
- Around line 198-229: Add focused unit tests for the HFDP/LPDU parser to cover
the new fallback/classification branches: create tests that feed a LPDU with
first byte 0x4F and assert the parser emits an HfdlEvent with kind
"logon-resume" and appropriate details; and feed a CRC-valid HFNPDU whose
payload bytes are not parsable by xng_acars::block::parse and assert the parser
emits an HfdlEvent with kind "unnumbered-data" whose details contain a stable
data_hex exactly matching the input bytes and raw equals the original payload.
Locate the parsing entry (in pdu.rs where the envelope closure, match on h[1],
and xng_acars::block::parse are defined) and add tests that call the public
parse function/entrypoint used by the crate, constructing minimal headers/CRC so
the code path hits the 0x4F and the CRC-valid but unparsable branches, and
assert on HfdlEvent.kind, details["data_hex"], and raw fields.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f7b16ea5-cab0-4acc-b4e2-0e099756f0ea
📒 Files selected for processing (6)
.github/workflows/bench.yml.gitignorebench/baselines.jsonbench/run.shcrates/xng-mode-hfdl/src/pdu.rsdocs/notes/BENCHMARKS.md
What
The HFDL forensic round (task #36), VDL2 methodology — dumphfdl built from source, frame-exact diff on the 21931 kHz capture:
unnumbered-dataenvelope (hex payload) instead of vanishing; LPDU 0x4F correctly labeledlogon-resume.hfdl_offairfixture (release asset) with floor 31 (actual 33) — the fourth fenced mode.xng now stands at 33/37 (89 %) of dumphfdl with the gap precisely characterized.
Testing
Full workspace green; all four bench gates green (this PR's CI exercises the new fixture).
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
New Features
Documentation
Chores