interplane.Get Omega
Read in your language

interplane-mv

INTERPLANE: open interoperability protocol between AI models and agent runtimes. Models express intent. Runtimes retain authority.

Brought by drakestapleton

branch main Branches Tags History

interplane-mv / docs / external / nightdriver / 666 / REPORT.md

107 lines · 13197 bytes Raw Blame History Source

NightDriverStrip issue 666: "Socket server: Unknown command in packet received: 31202"

External proving-ground lane D1. Upstream project: PlummersSoftwareLLC/NightDriverStrip. Nothing here has been sent upstream (tag upstreamed is not claimed anywhere below).

Outcome: B, already fixed upstream. Reporter 1's error is a receiver framing bug (the receiver did not consume the payload of a command it chose to ignore). It was fixed upstream in commit d73d18db (2025-08-27) and is absent from pinned main 4d79c290. Reporter 2's error is a misconfigured client (a websocket aimed at the raw TCP port), not a bug. No code change is proposed. The remaining value is the harness and the generic cases.

Evidence tags: observed, reproduced, hypothesized, fixed, tested, upstreamed, accepted.

Observed

Issue thread read in full (GitHub API; gh issue view fails here on a Projects-classic GraphQL error). Two reporters, treated separately.

Reporter 1, jmadotgg (2024-11-09): value 31202, running samples/audioserver/audioserver.py against the ledstrip demo.

Reporter 2, Cyborg-Squirrel (2025-07-05): value 17735, Kotlin client opening a WebSocket to port 49152.

Reproduction

What was built: the project's real src/socketserver.cpp, extracted unmodified with git archive at four SHAs, compiled on Linux (g++ 13, C++20) against stub platform headers (FreeRTOS task base, logging macros, PSRAM allocators, WiFi state, buffer manager, uzlib), driven over loopback TCP by a Rust harness. Stubs live in harness/stubs/; they are written for this harness and contain no project code. For the older snapshots, whose task loop lives in src/network.cpp (SocketServerTaskEntry, line 697 at 15221f20), the host driver replicates that loop. Byte-reader helpers are stand-ins for the originals on those snapshots.

Snapshots: | label | SHA | what it is | |---|---|---| | s0 | 15221f20 | last socket-server change before the report | | s1 | d73d18db~1 | parent of the fix | | s2 | d73d18db | the fix (2025-08-27) | | main | 4d79c290 | pinned upstream main (2026-08-15) |

Command (needs a NightDriverStrip clone; no project source is stored in this repo):

ND_REPO=~/workspace/external/NightDriverStrip \
  docs/external/nightdriver/666/harness/run-matrix.sh > results.tsv

Recorded run: harness/results.tsv. Summary of the property cases (PASS means the stream stayed aligned and every frame arrived byte-identical):

cases0s1s2main
peak12_with_pixels (audioserver shape, float[0] low bits 0x79E2)FAIL: Unknown command 31202FAIL: 31202PASSPASS
peak16_with_pixelsFAIL: 31202FAIL: 31202PASSPASS
whole frames, every split offset, coalescing, 1-byte writesPASSPASSPASSPASS
disconnect mid-header / mid-body then reconnectPASSPASSPASSPASS
unknown command then validPASSPASSPASSPASS
max accepted, max+1 rejected, 0xFFFFFFFF rejectedPASSPASSPASSPASS
slow sender inside / past the 3 s read timeoutPASSPASSPASSPASS
HTTP GET on raw port gives 17735PASSPASSPASSPASS
reconnect stormPASSPASSPASSPASS

Audio-on builds (ENABLE_AUDIO=1) of s2 and main: all property cases PASS.

Limits, stated precisely: the s1 snapshot gates on runtime g_Analyzer.Enabled(); the host stub models it as the compile-time ENABLE_AUDIO value. That is a modelling assumption. [hypothesized, untested] A real build with audio compiled in but no microphone could return false at run time and desync the same way, which would also explain reporter 1 if they had flashed audio on. this is the real socket-server source, not a replica of its parsing, but it runs on Linux loopback TCP with SO_RCVTIMEO, not lwIP on an ESP32. Nothing here was run on a physical ESP32 and nothing is claimed about lwIP buffering, task scheduling, or PSRAM behaviour. A device test would need an ESP32 board flashed with the ledstrip demo from a pre-d73d18db checkout (and one from main), plus audioserver.py pointed at it with a serial monitor to read the log.

Root Cause

[reproduced] for reporter 1, on the reporter-era source: a command that the firmware decides to ignore (PEAKDATA with audio disabled) was not drained from the TCP stream. The receiver parsed payload bytes as the next header. [observed] Fixed by d73d18db.

Reporter 2: no receiver defect. [observed] misdirected client.

Fix

[fixed] upstream by d73d18db (not by us): when audio is disabled, read STANDARD_DATA_HEADER_SIZE + length32 bytes and discard them before resetting the buffer. [tested] on main by the harness above (both audio settings). Upstream main also validates the length with CheckedStandardPacketSize before reading (src/socketserver.cpp:511-527).

No fork branch and no pull request: there is no remaining defect on main to fix. The 12 vs NUM_BANDS mismatch is in the reporter's pasted script, not in the repository sample (see Observed).

Regression

[tested] Cases peak12_with_pixels and peak16_with_pixels fail on the pre-fix snapshots and pass on the fix and on main. Upstream has no automated test environment for the firmware: platformio.ini has no test environment, and the only tests in the tree are Python tooling tests (tools/test_build_tools.py, tools/test_topology.py). So no in-repo test is proposed; the harness stays on our side.

Scope (not changed)

INTERPLANE Lesson

Generic case list: transport-cases.md. Harness: harness/ (host/ C++ driver and build script, stubs/ platform stubs, torture/ Rust test driver, run-matrix.sh, results.tsv).