Skip to content

Feature - Declare the S3RDMA ioctx and add backend integration seams - #181

Open
ran-yuan-rui wants to merge 6 commits into
NVIDIA:mainfrom
ran-yuan-rui:feature-s3rdma-s1-seams
Open

Feature - Declare the S3RDMA ioctx and add backend integration seams#181
ran-yuan-rui wants to merge 6 commits into
NVIDIA:mainfrom
ran-yuan-rui:feature-s3rdma-s1-seams

Conversation

@ran-yuan-rui

@ran-yuan-rui ran-yuan-rui commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR declares the cuCascade interfaces needed by the S3RDMA backend. It does not implement the S3RDMA transport.

The transport implementation remains in Sirius. The non-constructible s3rdma_ioctx header links to the detailed design document.

Changes

  • Add io_context_type::s3rdma.
  • Add a non-constructible s3rdma_ioctx declaration.
  • Add object_store_listing and implement it with the existing REST listing methods.
  • Add io_context_registry::replace_ioctx().
  • Add templated_ioctx::on_device_dispatch_failure().

replace_ioctx()

cuCascade initially assigns s3:// paths to the REST backend. When S3RDMA is selected, Sirius uses this API before the first path lookup to replace the REST registration with the S3RDMA checker and factory.

The replacement runs under the registry lock and leaves one explicit claimant for s3://. It changes registration metadata only; it does not create, stop, or migrate an I/O context.

on_device_dispatch_failure()

templated_ioctx normally converts synchronous device-dispatch exceptions into errored futures. S3RDMA needs to check whether such a failure came from a sticky CUDA context error before returning it as a normal request failure.

The new protected hook provides that check point. Its default implementation is a no-op, so existing backends keep their current behavior.

Testing

  • Added registry replacement tests.
  • Added dispatch-failure hook tests.
  • Added listing capability tests.
  • Full cuCascade test suite passes (cucascade_io_tests 113 → 133 cases).

@copy-pr-bot

copy-pr-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ran-yuan-rui ran-yuan-rui changed the title Feature add s3rdma support in IO framework Feature add s3rdma backend placeholder in IO framework Aug 6, 2026
@ran-yuan-rui
ran-yuan-rui force-pushed the feature-s3rdma-s1-seams branch 2 times, most recently from 4098802 to 7bc2084 Compare August 6, 2026 14:40
A new backend identifier for an S3-over-RDMA ioctx. The registry is
map-driven (no switch over the enum), so the value is inert until a
backend registers under it.
Listing is prefix resolution on the control plane, independent of how a
backend's data plane reads the resolved keys. A glob / LIST layer can now
depend on this interface instead of a concrete ioctx type. rest_ioctx
implements it in the same change (its existing list_objects_paged /
list_max_matches become overrides — no behavior change), so the interface
lands with a production implementation.

The ListObjectsV2 page/entry types stay in rest/s3: they are S3-protocol
shapes, not REST-transport shapes; the include is documented as such.
A protected virtual with an empty default body, called from the exception
handlers of both device-plane dispatch bodies before the failure is
returned through an errored future. A backend whose contract makes a
poisoned CUDA context fatal — because registered GPU memory must not be
reused before RDMA writes and CUDA work are quiescent — invokes its fatal
policy in the override; every existing backend inherits the no-op and is
behavior-identical.
Hands one type's registration to a new backend type in a single stroke —
unlike an unregister+register pair there is no observable no-claimant gap
and no call-it-early-enough discipline left to convention. Throws
invalid_argument on a missing old type, an already-registered new type,
or null checker/factory, with the strong guarantee (the emplace precedes
an erase by key — an iterator would not survive a rehash). The registry
latches its first lookup_path; replace_ioctx afterwards throws
logic_error (bootstrap is single-threaded by contract).
A non-constructible declaration for the planned S3-over-RDMA backend: an
ioctx subclass with a deleted constructor and every override declared but
not defined, claiming no paths, plus a placeholder translation unit so CI
compiles the header. The backend is developed in Sirius (design:
experimental/s3-rdma-transport-design.md there); its implementation
replaces this declaration when the backend is contributed upstream.
…ject_store_listing

Registry: replace success re-routes s3:// and proves the old claimant is
gone (a counting factory registered over it stays at zero calls);
invalid_argument on missing old / registered new / null checker /
null factory, each leaving routing unchanged; logic_error after the
first lookup_path; register_ioctx stays legal after lookup.

Hook: a stub reactor drives both device-plane dispatch bodies through
prep- and enqueue-stage throws (hook fires exactly once per failed
dispatch), empty reactor selection and success paths (no call), and the
non-overriding default (error future preserved).

Listing: rest_ioctx exercised purely through the object_store_listing
interface against a test-local scripted LIST server (multi-page with
continuation tokens, query recording; the accept thread owns a fixed fd,
shut down before join): pagination, early-stop sink, on-the-wire
max-keys clamp, the max_scanned cap, and the configured match cap.
@ran-yuan-rui
ran-yuan-rui force-pushed the feature-s3rdma-s1-seams branch from 7bc2084 to dedb58c Compare August 8, 2026 12:40
@ran-yuan-rui ran-yuan-rui changed the title Feature add s3rdma backend placeholder in IO framework Declare the S3RDMA ioctx and add backend integration seams Aug 8, 2026
@ran-yuan-rui
ran-yuan-rui marked this pull request as ready for review August 8, 2026 12:47
@ran-yuan-rui ran-yuan-rui changed the title Declare the S3RDMA ioctx and add backend integration seams Feature - Declare the S3RDMA ioctx and add backend integration seams Aug 8, 2026
@ran-yuan-rui

Copy link
Copy Markdown
Contributor Author

@aminaramoon @felipeblazing Please help to review and start to test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant