Skip to content

feat(server): per-link CSI metrics keyed by (receiver, transmitter) - #1828

Open
clonea1 wants to merge 2 commits into
ruvnet:mainfrom
clonea1:contrib/server-links
Open

feat(server): per-link CSI metrics keyed by (receiver, transmitter)#1828
clonea1 wants to merge 2 commits into
ruvnet:mainfrom
clonea1:contrib/server-links

Conversation

@clonea1

@clonea1 clonea1 commented Sep 4, 2026

Copy link
Copy Markdown

Adds a LinkTable that accumulates CSI per (rx_node, tx_mac) pair, and runs it
BEFORE the existing per-node subcarrier-grid gate.

The gate locks each node to the densest grid it has seen. A node associates
with one AP and receives HE-SU data from it at 256 bins, while everything else
it merely overhears sends beacons and management frames at 64. The lock
therefore always settles on the associated AP's format, and every
non-associated transmitter is sparser BY CONSTRUCTION -- dropped by a bare
continue before it can become a link.

Grid consistency is a property of the TRANSMITTER, so it belongs on the link
rather than the node. LinkTable applies the same densest-wins policy per
(rx_node, tx_mac).

The existing gate is NOT modified. The per-node feature path behaves exactly
as before; the link path simply runs ahead of the continue, so a frame the
node path cannot use stays available to consumers that can.

MEASURED 2026-09-01, before -> after:
links 31 -> 137 transmitters 10 -> 32
renderable 29 -> 88 grids in use 256 only -> 64:97, 256:33, 128:7
illuminators with two or more receivers: 1 -> 24

97 of the 137 recovered links are 64-bin: precisely the population being
discarded. No firmware, hardware or network change -- the frames were always
arriving.

Adds GET /api/v1/links and GET /api/v1/links/inventory. The inventory endpoint
reports the table's full contents including links the metrics view omits, with
the reason for each, because that filter_map dropped links silently.


Rebased onto current main. Two conflicts in main.rs, both purely additive and resolved by keeping both sides: main has since gained the room-debounce fields (#1793) where this branch adds link_table. Compiles clean and the server test suite passes.

Joe and others added 2 commits September 4, 2026 16:30
The frame parser accepts one magic (0xC5110001) and a fixed 20-byte header, so
a frame carrying transmitter or transmission identity is rejected outright.
That makes it impossible for a node to tell the server anything about WHICH
link a measurement belongs to, or WHICH transmission produced it.

Adds named constants for the three wire versions and dispatches on the magic:

    v1  0xC5110001  20-byte header, unchanged
    v2  0xC5110008  + transmitter MAC (addr2) at bytes 20..25
    v3  0xC511000A  + 802.11 rx_seq (u16 LE) at bytes 26..27

Esp32Frame gains source_mac and rx_seq, both Option, both None for a v1 frame.
A mixed fleet therefore keeps working: older firmware parses exactly as before
and newer firmware simply carries more.

This is the receiver half of the wire change and should land BEFORE any
firmware starts emitting v2/v3, so there is never a moment where a node sends
something the server rejects.

It is also a prerequisite for two follow-on changes that cannot work without
per-frame identity: per-link CSI state keyed on (receiver, transmitter), and
cross-node pairing keyed on (transmitter, rx_seq).

Co-Authored-By: claude-flow <ruv@ruv.net>
Adds a LinkTable that accumulates CSI per (rx_node, tx_mac) pair, and runs it
BEFORE the existing per-node subcarrier-grid gate.

The gate locks each node to the densest grid it has seen. A node associates
with one AP and receives HE-SU data from it at 256 bins, while everything else
it merely overhears sends beacons and management frames at 64. The lock
therefore always settles on the associated AP's format, and every
non-associated transmitter is sparser BY CONSTRUCTION -- dropped by a bare
continue before it can become a link.

Grid consistency is a property of the TRANSMITTER, so it belongs on the link
rather than the node. LinkTable applies the same densest-wins policy per
(rx_node, tx_mac).

The existing gate is NOT modified. The per-node feature path behaves exactly
as before; the link path simply runs ahead of the continue, so a frame the
node path cannot use stays available to consumers that can.

MEASURED 2026-09-01, before -> after:
  links         31 -> 137      transmitters  10 -> 32
  renderable    29 ->  88      grids in use  256 only -> 64:97, 256:33, 128:7
  illuminators with two or more receivers: 1 -> 24

97 of the 137 recovered links are 64-bin: precisely the population being
discarded. No firmware, hardware or network change -- the frames were always
arriving.

Adds GET /api/v1/links and GET /api/v1/links/inventory. The inventory endpoint
reports the table's full contents including links the metrics view omits, with
the reason for each, because that filter_map dropped links silently.

Co-Authored-By: claude-flow <ruv@ruv.net>
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