Fix cross-process EXEC_* execution over the M162 socket transport - #17
Merged
Conversation
Copilot created this pull request from a session on behalf of
rickenator
July 5, 2026 03:56
View session
rickenator
marked this pull request as ready for review
July 5, 2026 03:59
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.
M166's exec hook resolves tensor operands via raw host pointers valid only in the process that issued them. Forwarding those pointers to a socket-backed
att1-aimu-endpointdaemon's separate address space and dereferencing them there was undefined behavior (reproducibly crashed the daemon), sotest_two_tile_decode_socketonly ever exercised fabric/barrier traffic, standing in precomputed cpu-f32 values for real tile compute.Client: forward real bytes, not pointers
src/aimu_endpoint_client.c:client_cmd_submit()copies the actual operand bytes forLOAD_TENSOR_TILE(f32),EXEC_MATMUL,EXEC_RMSNORM,EXEC_ROPE,EXEC_FFNinto the wire request's existingpayloadfield instead of forwardinginput_buf_addrverbatim.command_id, since dispatch happens asynchronously relative to submit) remembers where each result belongs;client_cmd_poll_completion()copies the daemon's real result bytes back into the caller's output buffer.q8/q4LOAD_TENSOR_TILEis rejected client-side withATT1_ERR_UNSUPPORTED: those weight tensors are referenced by a struct pointer with its own nested owned buffers (and, for q4, agroup_sizethe frozen v1.0 packet has nowhere to carry), so safe reconstruction needs wire-protocol changes beyond this fix.Daemon: own the memory, rewrite the command
tools/att1-aimu-endpoint.c: newdispatch_cmd_submit()copies the payload into daemon-owned buffers and rewritescmd.input_buf_addr/output_buf_addrto point at them before submitting, so the exec hook only ever dereferences memory valid in the daemon's own process. Client-visible addresses are restored in the echoed response so no daemon pointer leaks back.dispatch_cmd_poll_completion()looks up the daemon-owned output buffer bycommand_idand returns the real result bytes in the response payload, then frees the buffers.ATT1_ERR_INVALID_ARG/ATT1_ERR_IO) rather than silently truncated.Tests
tests/test_aimu_cluster_decode.c:test_two_tile_decode_socketnow binds a realatt1_backend_pcieto each socket-backed endpoint, mirroring the in-process test, and asserts the combined logits still match the cpu-f32 reference exactly — proving genuine cross-processEXEC_*execution rather than just fabric/barrier traffic.Docs
docs/PHASE2_PLAN.md(M167 entry) anddocs/OPERATION_LOG.mdupdated to record the fix and note the backend-comparison report'spciecolumn is separate, not-yet-implemented follow-up work (no pcie wiring inatt1-benchtoday).