Skip to content

Add SrpV3Emulation module for software-only SRPv3 CI testing (ESROGUE-493)#1174

Merged
ruck314 merged 8 commits into
pre-releasefrom
ESROGUE-493
Apr 13, 2026
Merged

Add SrpV3Emulation module for software-only SRPv3 CI testing (ESROGUE-493)#1174
ruck314 merged 8 commits into
pre-releasefrom
ESROGUE-493

Conversation

@ruck314

@ruck314 ruck314 commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds SrpV3Emulation — a software SRPv3 endpoint that receives SRP request frames, processes them against internal memory emulation, and sends response frames
  • Enables CI regression testing of the SrpV3 client without FPGA/ASIC hardware (ESROGUE-493)
  • Uses a worker thread + queue to avoid deadlock from synchronous frame processing within the SrpV3 transaction lock scope
  • Memory allocated on demand in 4 KiB pages with random initialization (emulates uninitialized SRAM)
  • Validates request size and opcode fields, rejecting malformed frames

Test plan

  • 8 pytest tests in tests/protocols/test_srpv3_emulation.py — all passing
  • Tests cover: basic write/read, multiple registers, overwrite, 64-bit wide register, uninitialized read (consistent random data), multi-device address isolation, zero write, invalid request size rejection
  • C++ and Python linters pass (./scripts/run_linters.sh)
  • CI pipeline passes

Software SRPv3 server that receives SRP request frames and produces
response frames against an internal memory emulation. Enables CI
regression testing of the SrpV3 client without FPGA/ASIC hardware.

Uses a worker thread to avoid deadlock from synchronous frame
processing within the SrpV3 transaction lock scope. Memory is
allocated on demand in 4 KiB pages.

Includes 7 pytest regression tests and documentation updates.
@ruck314 ruck314 requested a review from bengineerd April 4, 2026 23:05
@ruck314 ruck314 changed the title Add SrpV3Server module for software-only SRPv3 CI testing Add SrpV3Server module for software-only SRPv3 CI testing (ESROGUE-493) Apr 4, 2026
@ruck314 ruck314 requested a review from Copilot April 5, 2026 06:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a software-only SRPv3 endpoint (SrpV3Server) to enable CI/regression testing of the existing SrpV3 client path without requiring FPGA/ASIC hardware, and includes new pytest coverage plus documentation and build/module wiring.

Changes:

  • Added rogue::protocols::srp::SrpV3Server C++ implementation + Python bindings to emulate an SRPv3 hardware endpoint in software.
  • Wired the new module into the SRP build/module initialization and added Sphinx docs pages.
  • Added a pytest suite that validates SRPv3 read/write behavior through a SrpV3 <-> SrpV3Server loopback.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/protocols/test_srpv3_server.py New pytest suite exercising SRPv3 client/server round-trips via software-only loopback
src/rogue/protocols/srp/SrpV3Server.cpp New server implementation: frame queue + worker thread, memory paging, request decode/response generation
include/rogue/protocols/srp/SrpV3Server.h Public C++ API and detailed class documentation for the server
src/rogue/protocols/srp/module.cpp Exposes SrpV3Server to Python via Boost.Python setup
src/rogue/protocols/srp/CMakeLists.txt Adds SrpV3Server.cpp to the rogue-core build
docs/src/built_in_modules/protocols/srp/srpV3Server.rst New conceptual/built-in module documentation page
docs/src/built_in_modules/protocols/srp/index.rst Adds srpV3Server to built-in SRP docs index
docs/src/api/python/rogue/protocols/srp/srpv3server.rst New Python API doc stub for the exported class
docs/src/api/python/rogue/protocols/srp/index.rst Adds srpv3server to Python API docs index
docs/src/api/cpp/protocols/srp/srpV3Server.rst New C++ API doc page for the class
docs/src/api/cpp/protocols/srp/index.rst Adds srpV3Server to C++ API docs index

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/rogue/protocols/srp/SrpV3Emulation.cpp
Comment thread src/rogue/protocols/srp/SrpV3Emulation.cpp
Comment thread src/rogue/protocols/srp/SrpV3Emulation.cpp
Comment thread src/rogue/protocols/srp/SrpV3Server.cpp Outdated
Replace raw new[]/delete[] with std::vector<uint8_t> for exception
safety, and add a null check on calloc for page allocation.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/rogue/protocols/srp/SrpV3Emulation.cpp
Comment thread src/rogue/protocols/srp/SrpV3Emulation.cpp

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/protocols/test_srpv3_server.py Outdated
Comment thread docs/src/built_in_modules/protocols/srp/srpV3Server.rst Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/rogue/protocols/srp/SrpV3Server.cpp Outdated
Comment thread src/rogue/protocols/srp/SrpV3Server.cpp Outdated
ruck314 and others added 4 commits April 13, 2026 10:58
Replace zero-initialized memory with random data to better emulate
uninitialized hardware SRAM. Both read and write paths now use a
shared allocatePage() helper that fills new 4K pages with random
data, ensuring consistent behavior between the two paths.
Rename to clarify this is a memory emulation module, not a real
hardware server endpoint. Updates class name, files, tests, docs,
and all references across the codebase.
@ruck314 ruck314 changed the title Add SrpV3Server module for software-only SRPv3 CI testing (ESROGUE-493) Add SrpV3Emulation module for software-only SRPv3 CI testing (ESROGUE-493) Apr 13, 2026
@ruck314 ruck314 merged commit 61de353 into pre-release Apr 13, 2026
7 checks passed
@ruck314 ruck314 deleted the ESROGUE-493 branch April 13, 2026 19:01
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.

4 participants