refactor(fast_io): decompose io_uring/registered_buffers into submodules (LoC audit)#4310
Merged
Merged
Conversation
The monolithic 1607-line file mixed the registration coordinator, slot allocator, telemetry, batch submit helpers, and tests. Split into focused submodules under registered_buffers/ to bring each file under the LoC audit cap and clarify ownership of each concern. No public API changes - external imports (file_reader, file_writer, shared_ring, integration tests) continue to resolve through the re-export surface in mod.rs.
Merged
4 tasks
oferchen
added a commit
that referenced
this pull request
May 17, 2026
…ern (#4320) The post-#4310 tests.rs at 882 lines exceeded the 650-line cap. Split into a tests/ directory grouped by concern, each file well under cap: - tests/mod.rs (39) - shared try_ring / try_group helpers and module decls. - tests/registry.rs (113) - page size, validation guards, slot allocator. - tests/submit.rs (179) - submit_read/write_fixed_batch helpers. - tests/stats.rs (141) - acquire/miss counters and snapshot semantics. - tests/status.rs (49) - try_new_with_status outcome reporting. - tests/drop_contract.rs (309) - Drop semantics and constrained-env coverage for the PR #4022 / task #2118 fixed-buffer invariants audit. The try_ring / try_group helpers replace the repeated match-or-return boilerplate that handled environments where io_uring is unavailable (CI sandboxes, seccomp, kernel < 5.6). No behavioural change; test coverage is preserved.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…les (#4310) The monolithic 1607-line file mixed the registration coordinator, slot allocator, telemetry, batch submit helpers, and tests. Split into focused submodules under registered_buffers/ to bring each file under the LoC audit cap and clarify ownership of each concern. No public API changes - external imports (file_reader, file_writer, shared_ring, integration tests) continue to resolve through the re-export surface in mod.rs.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…ern (#4320) The post-#4310 tests.rs at 882 lines exceeded the 650-line cap. Split into a tests/ directory grouped by concern, each file well under cap: - tests/mod.rs (39) - shared try_ring / try_group helpers and module decls. - tests/registry.rs (113) - page size, validation guards, slot allocator. - tests/submit.rs (179) - submit_read/write_fixed_batch helpers. - tests/stats.rs (141) - acquire/miss counters and snapshot semantics. - tests/status.rs (49) - try_new_with_status outcome reporting. - tests/drop_contract.rs (309) - Drop semantics and constrained-env coverage for the PR #4022 / task #2118 fixed-buffer invariants audit. The try_ring / try_group helpers replace the repeated match-or-return boilerplate that handled environments where io_uring is unavailable (CI sandboxes, seccomp, kernel < 5.6). No behavioural change; test coverage is preserved.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…les (#4310) The monolithic 1607-line file mixed the registration coordinator, slot allocator, telemetry, batch submit helpers, and tests. Split into focused submodules under registered_buffers/ to bring each file under the LoC audit cap and clarify ownership of each concern. No public API changes - external imports (file_reader, file_writer, shared_ring, integration tests) continue to resolve through the re-export surface in mod.rs.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…ern (#4320) The post-#4310 tests.rs at 882 lines exceeded the 650-line cap. Split into a tests/ directory grouped by concern, each file well under cap: - tests/mod.rs (39) - shared try_ring / try_group helpers and module decls. - tests/registry.rs (113) - page size, validation guards, slot allocator. - tests/submit.rs (179) - submit_read/write_fixed_batch helpers. - tests/stats.rs (141) - acquire/miss counters and snapshot semantics. - tests/status.rs (49) - try_new_with_status outcome reporting. - tests/drop_contract.rs (309) - Drop semantics and constrained-env coverage for the PR #4022 / task #2118 fixed-buffer invariants audit. The try_ring / try_group helpers replace the repeated match-or-return boilerplate that handled environments where io_uring is unavailable (CI sandboxes, seccomp, kernel < 5.6). No behavioural change; test coverage is preserved.
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.
Summary
crates/fast_io/src/io_uring/registered_buffers.rs(1607 lines, 147% over the LoC audit cap) into focused submodules underregistered_buffers/.mod.rs(105 lines) - module docs,MAX_REGISTERED_BUFFERS,page_size(), public re-exports.registry.rs(407 lines) -RegisteredBufferGroupregistration logic, atomic free-bitset slot allocator,RegisteredBufferSlothandle, Drop contract.stats.rs(8 lines) - re-exports theRegisteredBufferStats/RegisteredBufferStatustelemetry types fromio_uring_common.submit.rs(260 lines) -submit_read_fixed_batch,submit_write_fixed_batch,RegisteredBufferSlotInfoDTO.tests.rs(882 lines) - unit tests for registry, slot lifecycle, submit helpers, telemetry, and constrained-environment Drop coverage.file_reader,file_writer,shared_ring, and the integration test incrates/fast_io/tests/iouring_fixed_batch_short_reads.rs) keeps resolving through the existing re-export surface inio_uring/mod.rs.Test plan
cargo nextest run -p fast_io --features io_uringon Linux.tools/enforce_limits.shconfirms every new file is under cap.