Skip to main content

Module io

Module io 

Source
Expand description

IO subsystem - GPU↔runtime DMA request queue for the persistent megakernel.

Module ownership:

  • mod.rs: doc + constants + IoRequest/IoCompletion + word/op/status modules
  • queue.rs: ResidentIoQueue + view
  • poll.rs: host poll/claim/peek surface + the GPU completion-poll IR builder
  • complete.rs: completion-write surface
  • encode.rs: bytes <-> validated queue helpers
  • queue_words.rs: bounds-checked slot-word addressing + queue validation
  • tests.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_queue for a mapped ingest slot the GPU can consume.
IoRequest
Host-side IO request decoded from the io_queue buffer.
ResidentIoQueue
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.