Repository navigation
jaguar3: SetWideTxIgiFloor, the wide-TX IGI floor at run time - #609
Conversation
DeviceConfig::Tuning::wide_tx_igi_floor is fixed at construction. The edge below which a Jaguar3 transmitter loses 40 MHz capacity differs per unit and per channel, and the 0x35 default costs uplink sensitivity, so a caller that wants the lowest safe floor has to move it while the radio runs. IRtlRadio::SetWideTxIgiFloor(floor) records the new floor and re-applies it under _reg_mu, under the same rule as the construction-time value (after the session's first >= 40 MHz frame, while tuned that wide; every retune re-applies it). It is callable while another thread is blocked in bulk-OUT, and it can throw on a failed USB transfer; the floor is recorded first, so the DIG tick enforces it either way. Default: false (unsupported). PhydmRuntimeJaguar3::set_igi_floor now clamps IGI at once whenever the floor is lowered, not only when it is dropped to 0: a lowered non-zero floor pulls IGI down to max(floor, top of the channel's DIG window). The rule is a pure function (jaguar3/IgiFloor.h) with an igi_floor selftest. The TX arm in build_tx_block now runs on the first wide frame even when the floor is 0, so a floor set later still applies; with a floor of 0 the apply writes no register, and it takes _reg_mu once per session as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Summary by QodoAllow Jaguar3 wide-TX IGI floor changes at runtime
AI Description
Merge Risk
|
Code Review by Qodo
1. Failed floor writes look successful
|
josephnef
left a comment
There was a problem hiding this comment.
The setter behaves as described. I checked it on a second 8812EU (bare BL-M8812EU2, 0bda:a81a), channel 157(+) at 40 MHz, MCS2/40/LDPC, 1400-byte frames, with this PR merged together with #610 (clean merge, full build, ctest 96/96 with the two MT7612U generator checks skipped). IGI was read out of band (chipstate --no-claim --peek 0x1d70:4) while the probe held the interface.
Reproduced
| Step | IGI observed |
|---|---|
| Set 0x30 before any wide frame | unchanged (DIG window) |
| First wide frame, floor 0x35 | 0x35 |
| 0x35 → 0x24 | 0x24 at once |
| 0x24 → 0x1e | 0x22 at once, then DIG walks it to 0x1e |
| Raise to 0x22, 0x2c, 0x35 | at once |
| 0x80 | refused |
- No-gap flood: 2745–2780 frames/s at IGI 0x22 and above. At 0x1e it fell to 2381 with 15 send timeouts, then 1590 with 60, and was back at 2746 in the step that raised the floor to 0x22.
- A device constructed with
wide_tx_igi_floor = 0stalls at 0x1e (2026 frames/s, 21 timeouts) and takes a run-time 0x35 (2743 frames/s), so thebuild_tx_blockarming change works.
Requested before merge
- Land the measurements in the tree, not only in this description (inline on
DeviceConfig.h). - An in-tree caller. Nothing in the repo calls the setter, so neither table can be reproduced from the tree.
tests/cca_gates_probe.cppwas added for the same reason for the gate split; one small probe could cover this andGetTxQueuePagestogether.
Also
- Fork CI has not run on this PR; it needs a green run.
- Three non-blocking notes inline.
Limits of my check: one unit, one channel, one run per arm, TX power at −20 dB (this module's bench supply sags at full power under a no-gap flood, on master too), and host-side submitted rates rather than frames counted by a witness receiver. I did not reproduce the receiver-cost table.
tests/igi_floor_probe.cpp (IgiFloorProbe) is the in-tree caller for IRtlRadio::SetWideTxIgiFloor: it floods a 40 MHz tune, walks the floor through a list and prints the rate, failed sends, longest send and IGI per step; --rx-ta counts a second card's frames and their RSSI per step, for the receiver-cost table. The per-channel edge and the receiver cost measured on one 8812EU now live in docs/experiments/8822c-ht40-tx-stall.md and the DeviceConfig::Tuning::wide_tx_igi_floor comment, with their scope, in place of the "per unit" / "estimated, not measured" text. PhydmRuntimeJaguar3::set_igi_floor reads IGI before it records the new floor: a throw on that read now changes nothing, so a retry of the same lowered floor still clamps (before, it saw prev == floor and skipped the clamp, which stuck under skip_dig). The SetWideTxIgiFloor comment now says only the read throws (BB writes drop their result), that a floor at or below the DIG window bottom acts like no floor, and that the live value outlives Stop / Init / InitWrite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Pushed dfd03c4.
Qodo #1 (failed floor writes look successful). |
josephnef
left a comment
There was a problem hiding this comment.
Re-review of dfd03c4. Everything from the first round is addressed; one new blocker, from CI.
Blocking
- The MSVC job fails on the new probe (
build (windows-latest, Release, cl), error C2589 attests/igi_floor_probe.cpplines 91 and 168). See the inline comment.
Resolved
DeviceConfig.h, the experiment doc andsrc/jaguar3/CLAUDE.mdcarry the measurements and their scope.set_igi_floorreads IGI before it records the floor.- The
IRtlRadio.hcontract covers the read-only throw, the floor below the DIG window, and persistence across re-init. - Declining Qodo's failed-write finding here is fine by me: it belongs in the shared BB write path.
Checked on hardware (BL-M8812EU2, ch 157(+), MCS2/40/LDPC, 1400 B, the probe built from the #610 head, which includes this branch):
- No gap, 4 s per step, floors 0x35, 0x24, 0x1e, 0x22, 0x35, 0x1c:
igiread 0x35, 0x24, 0x1e, 0x22, 0x35, 0x1e; 2792-2813 frames/s and 0 failed sends at every step; 0x80 refused; probe exit 0. - At 0x1e this run kept full rate (2792 frames/s). My first-round run on the same unit fell to 2381 and then 1590. So that unit's behaviour at 0x1e is not stable between sessions; single runs both times.
Non-blocking
- As shipped the probe did not complete on my bench. See the inline comment on the power knob.
Limits: one unit, one channel, one run per arm, host-side submitted rates only, TX power at -20 dB through a local patch to the probe. I did not rerun the receiver-cost table.
NOMINMAX before the libusb include, as the other libusb tools do, so windows.h does not turn std::max into its macro (C2589). --pwr-qdb N applies SetTxPowerOffsetQdb(N) after bring-up, so the probe reproduces the doc's -20 dB run-time row and runs on a bench whose supply sags under a full-power flood. A step whose register access throws prints a FAIL line and the walk goes on, as the setter's contract tells callers to catch, instead of an uncaught terminate. The doc's run-time paragraph adds the second session on the same unit, which kept full rate at 0x1e. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
josephnef
left a comment
There was a problem hiding this comment.
Re-review of c89d162. The MSVC blocker is fixed and everything from the earlier rounds is addressed.
Resolved
NOMINMAXabove the libusb include;build (windows-latest, Release, cl)passes, CI 30/30.--pwr-qdbapplies the offset afterInitWriteand prints it; the doc names the flag.- A throwing step prints
FAIL step ..., counts toward exit 1, and the walk continues.
Checked on hardware (BL-M8812EU2, ch 157(+), MCS2/40/LDPC, 1400 B, the probe unpatched from the #610 head with --pwr-qdb -80, no gap, 4 s per step, exit 0):
| floor | IGI | frames/s | failed |
|---|---|---|---|
| 0x35 | 0x35 | 2818 | 0 |
| 0x24 | 0x24 | 2791 | 0 |
| 0x1e | 0x1e | 2296 | 27 |
| 0x22 | 0x22 | 2795 | 0 |
| 0x35 | 0x35 | 2795 | 0 |
| 0x1c | 0x1e | 2221 | 29 |
This session the unit stalled at 0x1e again, as in my first round and unlike my second, which fits the doc's "not stable between sessions".
Limits: one unit, one channel, one run per arm, host-side submitted rates only. The throwing-step path is checked by reading; I could not force a register-read failure on the bench.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
#610) ## The gap When a Jaguar3 transmitter holds 40 MHz frames (low IGI on a quiet channel, `docs/experiments/8822c-ht40-tx-stall.md`), the frames back up inside the chip. A bulk-OUT send blocks only once the chip's queue is full, so a caller that watches send timing sees the stall late or never. The PUB queue's free-page count does show it, but today only `DumpChipState` reads it, as a log line. ## The change `IRtlRadio::GetTxQueuePages(uint16_t& free_pages, uint16_t& total_pages)` (Jaguar3) reads `REG_FIFOPAGE_INFO_5` (0x0240; free pages in bits 27:16, configured pages in 11:0), the same field `DumpChipState` prints. - One control read under `_reg_mu`. Callable from any thread at a supervisory cadence (never per frame), including while a sender is blocked in bulk-OUT, since EP0 is separate from the bulk pipe. - Throws on a failed USB transfer. - Other generations return false and leave the outputs untouched (default virtual). ## Measured One 8812EU, MCS2/40, 1400-byte frames at a fixed offered load, silent 144(-) with no other traffic, IGI pinned, 10 s per cell, sampled every 200 ms. "Empty" means free pages at the idle value 1745. | offered | IGI | sent | queue empty in | lowest free pages | longest blocked send | |---|---|---|---|---|---| | 790 frames/s (28 % air) | 0x22, 0x20 | 100 % | 100 % of samples | 1745 | 0-9 ms | | 790 frames/s | 0x1e | 94-100 % | 12-45 % | 17-1197 | 0-124 ms | | 1980 frames/s (70 % air) | 0x22 | 100 % | 100 % | 1713 | 0 ms | | 1980 frames/s | 0x1e | 60 % | 0 % | 17 | 154 ms | At 790 frames/s and 0x1e, one run had no blocked send at all, yet it sent 98 %, its worst 200 ms carried 68 % of the offered load, and the queue was empty in only 14 % of samples. The free count separates the stalled state where send timing does not. The same reading drove a run-time floor controller (with `SetWideTxIgiFloor`, #609). Once per second it took the deepest backlog: healthy seconds reached 40 % backlog in 1 % of seconds, seconds at IGI 0x1e in 90 %. Build: full, no-Jaguar3 and Jaguar3-only configure + build; `ctest` 91/91 (82/82 Jaguar3-only). No selftest: the method is one register read and a field split. ## Not covered - One 8812EU; no 8812CU reading. - Only the PUB page pool (INFO_5); the per-queue reservations (INFO_1..4) are not read. - No caller in this tree. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Joseph <162703152+josephnef@users.noreply.github.com>
The gap
DeviceConfig::Tuning::wide_tx_igi_flooris fixed at construction. Its comment already says the edge is per unit, and that 0x35 costs idle-channel RX sensitivity that was estimated but not measured. One more 8812EU, measured below, shows the edge also moves with the channel, and that the cost is large. So no single construction-time value fits. A caller that wants the lowest safe floor has to start low and raise it while the radio runs, and today it cannot.The change
IRtlRadio::SetWideTxIgiFloor(uint8_t floor)(Jaguar3). It records the floor and re-applies it under_reg_mu, under the same rule as the construction-time value: after the session's first ≥ 40 MHz frame, while tuned that wide; every retune re-applies it. Values above 0x7f return false. Other generations return false (default virtual).PhydmRuntimeJaguar3::set_igi_floorclamps IGI at once whenever the floor is lowered, not only when it drops to 0. IGI goes to max(new floor, top of the channel's DIG window) instead of keeping the old floor's gain until DIG walks it down. The rule is a purejaguar3::igi_on_floor_change(IgiFloor.h) with anigi_floorselftest. The old dropped-to-0 behaviour is unchanged.build_tx_blockarms on the first wide frame even when the floor is 0, so a floor set later still applies. With 0 the apply writes no register; it is still one_reg_mutake per session, and the hot path stays lock-free.Measured
One 8812EU (USB high speed), MCS2/40/LDPC, 1400-byte frames, sent with no gap (ceiling ~2790 frames/s). IGI pinned with DIG off; share of the ceiling per value:
This unit's edge is 0x1f on 144 and 0x1c on 157 and 100. 20 MHz frames run at full rate at every IGI from 0x08 to 0x24.
What the floor costs the receiver. A second card sent MCS0/20 frames at three levels while the 8812EU transmitted at 40 MHz and counted them per floor. Reception falls from ~99 % to 0 in one floor step, about 19-23 IGI above the frames' RSSI (chip units):
Extended down, 0x35 is deaf below an RSSI of about 28-30 and 0x22-0x24 below about 9-11. The weakest frames either card decoded at IGI 0x1e-0x20 were at RSSI 16 (13-15 dB SNR). So on this unit 0x35 costs at least ~12 dB of sensitivity to weak frames, against 0-4 dB for a floor just above its edge.
A caller using the setter. It starts at a low floor and raises it when its TX stalls (longest send ≥ 30 ms, or PUB queue backlog ≥ 60 %). It reverts if the stall does not clear and keeps the value after 3 clean 1 s windows. Windows with CLM busy ≥ 20 % are not judged. A 60 fps video downlink at 40 MHz, 170 s runs (330 s with the jammer); "spread" is p99 − p50 frame arrival per 30 s slice:
161 is rough for its first minute at MCS2 whatever the floor (the 0x22 row never moves).
Build: full, no-Jaguar3 and Jaguar3-only configure + build;
ctest92/92 (83/83 Jaguar3-only). Theigi_floorselftest was revert-checked: with the old dropped-to-0-only clamp, the three "lowered" checks fail.Not covered
🤖 Generated with Claude Code