[QEC] Decoding server: guard tx-slot writes, drop dead code from #769 - #779
Open
bmhowe23 wants to merge 1 commit into
Open
[QEC] Decoding server: guard tx-slot writes, drop dead code from #769#779bmhowe23 wants to merge 1 commit into
bmhowe23 wants to merge 1 commit into
Conversation
…IA#769 Post-merge cleanups on the HOST_CALL request path: - ResultWriter: split out payload_capacity(), which checks the slot against sizeof(RPCResponse) BEFORE subtracting. The old payload() evaluated `capacity_ - sizeof(RPCResponse)` first and relied on a later ||-term to catch the underflow. - handle_get_corrections: take the payload pointer and capacity from the ResultWriter instead of recomputing them. The hand-rolled `slot_size - sizeof(RPCResponse)` bypassed the very guard the writer exists to provide; a slot too short for the response header now yields nullptr -> INTERNAL_ERROR rather than a wrapped capacity. - Assert sizeof(RPCResponse) <= sizeof(RPCHeader). Every write_response caller gates on `slot_size >= sizeof(RPCHeader)` and then writes an RPCResponse into that slot; the structs are equal-sized today but live in the cudaq realtime headers and move independently of this repo. - Drop DecodingServer::print_session_stats(), orphaned when the stats loop was moved into cudaqx_qec_decoding_server_print_stats(). Two copies of the QEC_DECODING_SERVER_DECODER_STATS line the test harness greps for could drift apart. - Retire two CMake comments describing the removed worker threads. New test RpcSlotWrite.ResultWriterRefusesASlotTooSmallForTheResponseHeader covers the exact-fit, undersized, null, and roomy slots. Signed-off-by: Ben Howe <bhowe@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Post-merge cleanups on the HOST_CALL request path:
capacity_ - sizeof(RPCResponse)first and relied on a later ||-term to catch the underflow.slot_size - sizeof(RPCResponse)bypassed the very guard the writer exists to provide; a slot too short for the response header now yields nullptr -> INTERNAL_ERROR rather than a wrapped capacity.slot_size >= sizeof(RPCHeader)and then writes an RPCResponse into that slot; the structs are equal-sized today but live in the cudaq realtime headers and move independently of this repo.New test RpcSlotWrite.ResultWriterRefusesASlotTooSmallForTheResponseHeader covers the exact-fit, undersized, null, and roomy slots.