Skip to content

Fix shared-memory frame size guard - #275

Open
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/shm-frame-size-guard
Open

Fix shared-memory frame size guard#275
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/shm-frame-size-guard

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

Reject frames that exceed a shared-memory slot before claiming or writing to the ring buffer. The error includes the frame dimensions, pixel format, byte count, and configured slot capacity.

This also adds a defensive read-side check for oversized FrameSignal.data_sz values, and covers the failure mode with focused regression tests that verify rejected frames do not advance the writer or corrupt the next slot header.

Validation

  • PYTHONPATH=server-runtime:utils/xr-ai-logging uv run --python 3.12 --project agent-sdk --with pytest --with pytest-asyncio --with loguru pytest tests/test_shm_ring_buffer.py
  • PYTHONPATH=server-runtime:utils/xr-ai-logging TMPDIR=/tmp uv run --python 3.12 --project agent-sdk --with pytest --with pytest-asyncio --with loguru pytest --basetemp=/tmp/xr-ai-pytest tests/test_participant_events.py
  • uvx ruff check agent-sdk/xr_ai_agent/_shm.py tests/test_shm_ring_buffer.py
  • git diff --check

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