Skip to content

Md/s1#1937

Draft
aschwartz12 wants to merge 1 commit into
ai-dynamo:mainfrom
aschwartz12:md/s1
Draft

Md/s1#1937
aschwartz12 wants to merge 1 commit into
ai-dynamo:mainfrom
aschwartz12:md/s1

Conversation

@aschwartz12

@aschwartz12 aschwartz12 commented Jul 14, 2026

Copy link
Copy Markdown

PR1 - refactor(metadata): backend contract and P2P backend

Branch md/s1 (bc4202cc), stacked on upstream nixl/main. First slice of
the 4-PR metadata-manager stack. Introduces the internal nixlMetadataBackend
contract, a self-contained P2P backend implementation, and the
nixlMetadataContext interface on nixlAgentData — without wiring any of it
into the agent yet.

On main, P2P metadata exchange is implemented inline in nixlAgent on top of a
shared comm-worker thread, with socket helpers living in nixl_listener.cpp.
This commit adds the new abstraction layer alongside the existing path. Runtime
behavior is unchanged: the agent still uses the inline comm-thread path.

What?

Adds three new source files and a partial agent_data.h update:

  • nixl_metadata_backend.h — backend contract (prepare* methods, needsWorker,
    serviceEvents)
  • nixl_p2p_metadata_backend.{cpp,h} — self-contained P2P sockets and listener
  • nixlMetadataContext interface in agent_data.h — the port backends use to
    reach serialization and cache operations

No manager, no ETCD backend, no agent cutover, no nixl_listener.cpp deletion.

Why?

Establishes the transport boundary before the cutover. Reviewers can read the
contract and the P2P backend in isolation (~640 added lines) without the larger
manager/ETCD/agent rewrite that follows in PR2.

The P2P socket helpers move out of nixl_listener.cpp into the backend class.
They live in an anonymous namespace in the old file, so this slice compiles
cleanly alongside the existing listener.

How?

Contract - nixlMetadataBackend defines four prepare* methods
(prepareSendLocal, prepareSendLocalPartial, prepareFetchRemote,
prepareInvalidateLocal). Each runs on the caller thread, validates and
serializes, returns a synchronous status, and hands back transport work as a
nixlWorkerTask wrapped in nixlPreparedOp.

P2P backend - nixlP2pMetadataBackend owns its sockets and listener logic
(previously in nixl_listener.cpp). It is self-contained but not yet
instantiated; PR2 wires it through the manager.

Context port - nixlMetadataContext is declared in agent_data.h with the
methods backends need (getLocalMD, getLocalPartialMD, loadRemoteMD,
getName, getConfig, invalidateRemoteMD). nixlAgentData does not yet
implement it; that lands in PR2.

Scope - Additive only. No public API change. No behavior change. The comm thread
and nixl_listener.cpp remain in place until PR2.

Size

~639 lines added across 5 files. Under the 1000-line target.

Test plan

  • Builds in the no-ETCD config (builddir) and the ETCD config (builddir-etcd).
  • Existing metadata gtests pass unchanged (behavior is identical to main).
  • No new gtests in this slice; coverage lands in PR3.

Stack

  • Base: nixl/main
  • Next: PR2 (md/s2) wires the manager, adds ETCD, flips the agent, deletes
    nixl_listener.cpp

Introduce the metadata-exchange backend layer without wiring it in yet:
the nixlMetadataBackend contract, the nixlMetadataContext interface (the
agent-side operations a backend needs), and the self-contained P2P
(socket) backend that implements the contract against the context.

Nothing constructs these yet; the agent still uses its inline path. The
manager that owns and dispatches to backends, and the cutover that
removes the inline path, come in the following commit. Splitting the
introduction out keeps that cutover reviewable on its own.
@copy-pr-bot

copy-pr-bot Bot commented Jul 14, 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.

@github-actions

Copy link
Copy Markdown

👋 Hi aschwartz12! Thank you for contributing to ai-dynamo/nixl.

Your PR reviewers will review your contribution then trigger the CI to test your changes.

🚀

@aschwartz12 aschwartz12 changed the title refactor(metadata): add backend contract and P2P backend Md/s3 Jul 14, 2026
@aschwartz12 aschwartz12 changed the title Md/s3 Md/s1 Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant