Expand description
IO subsystem - GPU↔runtime DMA request queue for the persistent megakernel.
Module ownership:
mod.rs: doc + constants + IoRequest/IoCompletion + word/op/status modulesqueue.rs:ResidentIoQueue+ viewpoll.rs: host poll/claim/peek surface + the GPU completion-poll IR buildercomplete.rs: completion-write surfaceencode.rs: bytes <-> validated queue helpersqueue_words.rs: bounds-checked slot-word addressing + queue validationtests.rs: full test suite
§Protocol
Each IO slot is 8 × u32 words:
[op_type, src_handle, dst_handle, offset_lo, offset_hi, byte_count, status, tag]The GPU CAS-claims slots like the work ring, but uses the io_queue
buffer. The host polls status for REQUEST and services the DMA.
Modules§
- io_op
- IO operation types.
- io_
status - IO completion status codes written by the host pump.
- io_word
- Word offsets within an IO slot.
Structs§
- IoCompletion
- Host-side completion record published into
io_queuefor a mapped ingest slot the GPU can consume. - IoRequest
- Host-side IO request decoded from the io_queue buffer.
- Resident
IoQueue - Host-side handle to the megakernel IO queue. Wraps a
Vec<u32>slot ring and exposes typed poll/publish/complete entry points.
Constants§
- IO_
DESTINATION_ CAPABILITY_ TABLE - Resource table name used for resolving IO destination handles.
- IO_
QUEUE_ DMA_ TAG - Async stream tag used by megakernel IO DMA requests.
- IO_
SLOT_ COUNT - Default number of IO queue slots.
- IO_
SLOT_ WORDS - Number of u32 words per IO queue slot.
- IO_
SOURCE_ CAPABILITY_ TABLE - Resource table name used for resolving IO source handles.
Functions§
- claim_
io_ requests_ into - Poll and claim pending requests into caller-owned storage.
- complete_
io_ request - Write a completion status for a serviced IO request.
- complete_
io_ requests_ batch - Complete several serviced IO requests.
- encode_
empty_ io_ queue - Encode an empty IO queue buffer.
- io_
completion_ poll_ body - Build the GPU-side IO poll body as
Vec<Node>for composition into the megakernel persistent loop. - try_
claim_ io_ requests_ into - Strictly poll and claim pending requests into caller-owned storage.
- try_
complete_ io_ request - Strictly write a completion status for a serviced IO request.
- try_
complete_ io_ requests_ batch - Strictly complete several claimed IO requests after one validation pass.
- try_
encode_ empty_ io_ queue - Strictly encode an empty IO queue buffer.
- try_
encode_ empty_ io_ queue_ into - Strictly encode an empty IO queue buffer into caller-owned storage.
- try_
poll_ io_ requests - contains a partial IO slot, or exceeds the compiled poll window.
- try_
poll_ io_ requests_ into - Strictly poll pending requests into caller-owned storage without claiming.
- validate_
io_ queue_ bytes - contains a partial IO slot, or exceeds the compiled poll window.