Skip to content

Strict receive: a frame is received only if the receiver listened for it - #7

Open
A13xB0 wants to merge 3 commits into
mainfrom
strict-receive
Open

A13xB0 wants to merge 3 commits into
mainfrom
strict-receive

Conversation

@A13xB0

@A13xB0 A13xB0 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

On silicon SetStandby aborts a reception, a receiver that returns to receive locks on only if enough preamble is left to detect, and the detection flags stay latched until the firmware clears them. The model hid all three: the inbox grace delivered frames the receiver was not listening for, and the flags were cleared when the carrier ended. That hides any driver that re-arms mid-frame, runs CAD while a frame is arriving, or times out a stale flag.

  • vsx_set_strict_receive(chip, on): a frame is received only if the receiver entered receive with at least four preamble symbols still to come and stayed in receive to the end. Preamble detection only counts symbols heard while in receive, and HeaderValid needs a detected preamble. The detection flags stay latched when the carrier ends.
  • vsx_deliver_frame_failed failure 3: the receiver detected the frame and never locked onto it. Under strict receive this withdraws the HeaderValid the model raised from the carrier's length and leaves PreambleDetected latched. Otherwise it does nothing. A library older than 1.7 reads 3 as a CRC error, so a host sends it only to 1.7 or later.
  • Under strict receive, ClearIrqStatus no longer makes the chip detect the same carrier's preamble and header again. Before, a clear mid-frame was followed on the next tick by both flags returning for a preamble that had long gone. A driver that re-arms after every packet never saw this, but one that stays in continuous receive read busy for whole frames: about 5 times the busy time on a 159-node run. The lenient model still has this fault, and I have left it alone so the emulated hosts are unchanged.
  • vsx_frames_aborted(chip): how many frames were refused. This is a separate call rather than a vsx_counters field, so a host built against the older header is not handed a larger struct.
  • ABI 1.7. It is off by default, so every existing host behaves as before. It is meant for the native build, whose clock is the engine's. The emulated hosts drift against the engine and keep the grace.

Tests: test/test_listening.cpp covers the grace still applying with strict receive off, a frame received while listening throughout, a re-arm in the payload losing the frame, a re-arm early in the preamble still locking on, a late start hearing no preamble, flags latching past the carrier, failure 3 withdrawing HeaderValid only under strict receive, failure 3 not being read as a CRC error, and a clear mid-frame staying clear for the rest of that carrier. test_c_abi.c covers the two new entry points, including with a null handle.

On silicon SetStandby aborts a reception, and a receiver that comes back to
receive locks on only if enough preamble is left to detect. The inbox grace
hands such a frame over anyway, which hides a driver that re-arms its receiver
mid-frame or scans for activity while a frame is arriving.

vsx_set_strict_receive turns the grace off for a host whose clock is the
engine's own: a frame is refused unless the receiver entered receive with a
detectable preamble still to come and stayed there to the end, and preamble
detection only counts symbols heard in receive. vsx_frames_aborted counts the
refusals. ABI 1.7; off by default, so every existing host is unchanged.
…d onto withdraws its header

The part has no interrupt for a preamble that came to nothing, so a flag
raised for a frame that never finished stays until the firmware clears it.
Clearing both flags with the carrier hid that, and with it every firmware
path that times a stale flag out. Under strict receive they now latch.

HeaderValid is the model's stand-in for a header it cannot decode, raised from
how long the carrier has lasted. Failure 3 on vsx_deliver_frame_failed says the
receiver detected a frame and never locked onto it, and withdraws that stand-in
while leaving PreambleDetected latched. Without strict receive it does nothing.
…eamble again

ClearIrqStatus also forgot that this carrier's preamble and header had been
detected, so the next tick raised them again for a preamble long gone. A
driver that re-arms after every packet never saw it, because its receiver
came back too late to hear the old preamble; one that stays in receive had
its flags raised again on every clear and read busy for whole frames. Under
strict receive the markers now outlive the clear and reset with the carrier.
The lenient model keeps the old behaviour, which has the same fault, for the
emulated hosts.
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.

2 participants