Skip to content

refactor(rdma): relocate connection geometry definitions - #620

Merged
ketor merged 1 commit into
dingodb:mainfrom
ketor:lr/trn23-connection-geometry
Nov 28, 2026
Merged

ketor merged 1 commit into
dingodb:mainfrom
ketor:lr/trn23-connection-geometry

Conversation

@ketor

@ketor ketor commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Scope: only two literal definition moves

ConnectionBound and ConnectionDepth move verbatim, in that order, from src/transport/rdma_transport.cc into the existing src/transport/rdma_transport_ops.cc, after RangeIntoMulti and before the namespace close. This is an unnumbered TRN-23 source-partition increment, not a new S1 or an algorithm change.

  • ConnectionBound: 10 lines, 440 bytes, definition SHA-256 84398200f913a1ca96a2778aabb7105acddba9ee053d9bc6088950ad14c3c8a9; body SHA-256 d0fa5757d670878e7f9986dbe6f7040b687277b9cafce1098449d5cd49fa9ec4.
  • ConnectionDepth: 10 lines, 487 bytes, definition SHA-256 70d11d7153ec16746302902e53ab1d4465acb2a29f0da3ceb6a3ffdb2d839798; body SHA-256 c807dc7522f7d15a528de57a1ad9c5206f2ced361b97cb70d78649060d54316f.

The parent/base bytes plus only those two definitions and their two blank separators reconstruct exactly the two candidate files. The former definitions are absent from main and occur exactly once each, in the stated order, in ops. The removed and inserted segments are each 929 bytes (including separator placement); the diff is +22/−22 across those two files only.

No public header/declaration/class layout/default argument/caller/test/CMake/include/default/helper is changed. rdma_transport.h stays SHA-256 d99e90394759cc1b0dfbd31be7e8efc1a6d9939900fc1225a13db1c7d0f11327; test/transport/rdma_loopback_test.cc stays SHA-256 0dec37976d84f9a18295d885ffe44dd09e66620185afb38daa9326959d2c07d7; CMakeLists.txt stays SHA-256 d86549155c41c407a463ccf78b083e0ae0ddf797926d5b3d33326f2eadf384ca.

OpBound(), class-private fields, Lane, and LearnedDepth keep their declarations/semantics. LearnedDepth stays defined in main, preserving its mutex/map behavior. NoteBlock and its high-water/rejection atomics stay in main. Neither moved body uses Conn, RcEndpoint, anonymous helpers, logging,TLS, or debug controls. Definitions in namespace dfkv retain normal class-private access across translation units. std::min/max already resolve through transport/rdma_transport.h → transport/transport.h → <algorithm>; ops already supplies the other required standard types. No new include, bridge, forwarder, alias, second definition, or compatibility shim is introduced. CacheMany, CacheFromMulti, Acquire, and the Conn/failure/TLS/helper machinery are outside this change.

Exact candidate:

  • HEAD 2128249c6cceedb18070919beeff61ade1a70187
  • Tree 9a5d1daa54fdecac5a69fb65e57d32a0abdfcad6
  • Parent/main 3e843f5382bd354836211fe81e6c52db5b41dae2
  • Base tree 630dde2993bffda33da9e7091f9774c594093611

Definition/file identities remain:

  • main SHA-256 81593f5417ec10f345f34fc5dda78faedb655d05bc09688094a68adfd128c035
  • ops SHA-256 57b78231f86cbab34070b70eae6889737c3159ae48b93fc8fc0d53afb1f736f8

Narrow verification completed on exact candidate

Focused real RDMA

Exactly one executed single-rail run, using actual InfiniBand ib6s200p0, active port 1 (ACTIVE), mlx5 kernel driver. The JUnit/gtests independently show 4 PASS / 0 SKIP / 0 FAIL / 0 ERROR / 0 disabled, every case status="run" and result="completed":

Test Actual result Meaningful invariants retained
RdmaLoopback.DataConnectionsUseActualBlockSizeClasses PASS Idle bounds {4096} → {4096,65536}, direct 1→4096, 5000→8192, 60 KiB→65536, plus real small-GET payload correctness; declarations 4096 and 65536
RdmaLoopback.DataConnectionsUseActualDepthClasses PASS Idle depths become {1,4}, requested credits 1→1, 3→4, class metrics and actual qd=1/qd=4 records
RdmaLoopback.RangeIntoMultiNamesEachRailOnce PASS All 8 statuses kOk, non-empty device name, one-rail branch rejects repeated -> rail names
RdmaLoopback.StalePooledConnectionOnTheOnlyRailRecoversOnTheRetry PASS Stale-pool and retry each one, expected old/ new connection lifecycle 1→2 and no increase beyond 2, remote-rail cooldown/failure remain zero, same rail is reused and successful

The two-rail branch of RangeIntoMultiNamesEachRailOnce is conditional and not proved here. It uses continue without a gtest skip; the zero-skip count is real but does not imply two-rail coverage. There was no test-failure retry or replacing execution by process exit 0.

Source, compile semantics and symbol surface

git diff --check clean. Each exact definition and body retains SHA-256 and relative order; full-file reconstruction is exact. LSP genuinely reports no configured C++ language server for this project; exact source/reference/body proof is retained in exact-source-reference-proof.txt, not fabricated semantic lookups.

234 normalized ON compile-command records match after substituting the independent source/build roots; both geometry TUs still compile into both dfkv and dfkv_core, preserving project defaults.

Across dfkv and dfkv_core, independent object parsing produces main 130 → 128, ops 15 → 17, with the main+ops multiset 145 → 145. The main loses only ordinary T definitions for the two wrappers because their definitions moved, though their callers stay; it correspondingly retains only the expected U references to both. Ops gains exactly those two T definitions and only the expected U dependency on LearnedDepth, which remains defined in main.

The wider target-object multiset stays 149 → 149: this includes cold clones, lambdas and COMDAT duplicates, with 144 unique strings. Four unchanged rdma_transport_metrics.cc rows account for the difference between the 145 main+ops view and the whole-target 149 view. It is not 149 public ABI methods or a hidden symbol increase.

Dynamic type+name WALs are both empty (defined: 7576→7576; undefined: 270→270). Both selected methods remain globally defined exactly once and not dynamically undefined; LearnedDepth likewise stays defined once and not dynamically undefined. SONAME remains libdfkv.so.2. Baseline/candidate remote and downloaded-local ldd -r pass with no closure errors.

Definition addresses do move. The empty dynamic WAL is specifically a type/name-multiset comparison, not a claim that library bytes, addresses, export binary layouts or arbitrary toolchains/ABIs are identical. ON libdfkv.so hashes:

  • baseline 295673f22981104a3d9dcff71b57a3a950b9b25aea6c44a014e5620a3be0e60d
  • candidate 36573ac2ed91a7172d7a8c77d002a801d351b7a74c75b41fc077968f40232b84

RDMA=OFF plus io_uring=OFF

The correct configuration with both DFKV_WITH_RDMA=OFF and DFKV_WITH_URING=OFF:

  • Actual build log from [1/358] to [358/358]; 214 OFF compile-command entries contain no DFKV_WITH_RDMA, DFKV_WITH_URING or rdma_transport occurrences.
  • Both geometry TUs and metrics remain excluded by the unchanged root CMake logic.
  • ldd -r succeeds; readelf/ldd show only libc/ld-linux loader dependencies, with no ibverbs or liburing and no dynamic RdmaTransport:: defined/undefined symbols.
  • OFF library SHA-256 3caf8cabdb48ae2d2d1eb22141329fee1cf09135b85fa682d418276a0e88cd01.
  • Unit dfkv-trn23-connection-geometry-3e843-validation reports Result=success, ExecMainStatus=0, then inactive/dead, MainPID=0; coordinator history matched exact head and completed with exit 0 and claims=[].

Coverage limits are explicit. These tests do not separately force wanted >= logical_max saturation, zero requested credits, non-power-of-two learned depth, every control/SG arithmetic branch, two-rail behavior, or exhaustive atomic/concurrency/fallback behavior. The evidence supports the exact literal move and those focused paths, not a universal runtime equivalence guarantee.

Independent final review

The independent reviewer returned GO, zero must-fix findings. It independently reconstructed both candidate files, checked actual source/literal source scope, class-private declarations/callers/includes, object and dynamic symbol deltas, genuine focused cases, correct OFF outputs and artifact integrity. It explained the 149-versus-145 multiset reconciliation rather than hiding it, and distinguished type/name surface parity from arbitrary byte/export equality. It also checked the actual coordinator/journal/hash chains and separated collection-time faults from accepted artifacts.

Raw evidence root: ${CODE_ROOT}/dfkv-evidence/trn23-connection-geometry/.

  • candidate-complete-history bundle SHA-256 b850eca5f33f590d74fcc536c211d166332d77d4c1cad9e8f741d8ff8c7b6555;
  • validated external evidence v2 archive SHA-256 cd75aa58054da29f1b94c48d182edf115c6faaa68f326de253ca9870a275e8ca;
  • independently dereferenced library v3 addendum SHA-256 9c80b16409df2f183fee6713f43a79ccbc6fca7043ea248fe7501784942dcc27;
  • verified 122 remote evidence hash entries;
  • original independent review: promotion/independent-source-evidence-review-2128249c.md.

The initial 30-second tsh-go transport wait timed out while the real systemd unit continued and is retained separately. An in-directory tar: file changed as we read it packaging attempt was not accepted as evidence; the separately produced external v2 and library-v3 artifacts were independently validated.

Gates still outstanding before merge

This draft documents exact source and completed narrow testing, not CI/merge completion. Still required: parent-run maintained full regression, all public CI checks for this exact raw head, final publication/ready/queue, independent actual MERGED/tree verification, and current-owned source/ref/worktree cleanup. No production config, current symlink, default switch, deployment, performance benefit, full M6/TRN-23, multi-tenant behavior or giant-model acceptance is claimed.

- Relocate ConnectionBound and ConnectionDepth verbatim into the existing ops translation unit.
- Preserve declarations, call sites, and behavior.
@ketor

ketor commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head verification: 2128249c6cceedb18070919beeff61ade1a70187

发布评论前重新核对:upstream main 与 PR base 均为 3e843f5382bd354836211fe81e6c52db5b41dae2,PR head 未变化。

源码边界

仅移动 private ConnectionBound / ConnectionDepth 两个 10 行 definition,从 rdma_transport.cc 到 existing rdma_transport_ops.cc、置于 RangeIntoMulti 之后;两个 .cc 合计 +22/−22。独立审查用移除/重新插入同一 929-byte 片段逐字重建两份候选文件。header、class/public declarations/default arguments/API/helper/caller/test/CMake 不变。动态 defined/undefined、SONAME 和 ldd -r 已按实际 target 核验;不声称任意目标字节或跨编译器 ABI 相同。独立 source 与完整证据终审均为 GO,0 must-fix。

实质验收

门 实际结果
真实 focused RDMA(单轨 ib6s200p0) 4 PASS / 0 SKIP / 0 FAIL,block-size/depth classes、SG rail-name、stale retry 均真实 run/completed;实际 data connections 含 {4096,8192,65536} block class 与 {1,4} depth
maintained full(精确 head,Release、tests/RDMA/io_uring ON) discovery 2110,selected/executed 2104,2006 PASS / 98 SKIP / 0 FAIL;原六项 canonical exclusions 与 900/600 秒界限不变
必需回归 22/22 PASS:14 migration、4 legacy slot/RDMA、4 geometry;均核对 JUnit、raw CTest 与 [ RUN ]
公开 CI(精确 head) run 46150860600 13/13 completed/success,官方 check-run 的 head 均同 2128249c…

全部 2,104 份最终 JUnit 和对应 CTest logs 已由独立审查重算。原 raw parser 的 2000 PASS/104 SKIP 因六个仅名字含 Skipped 的用例发生误分类;六项分别由本 case 的实际 CTest Passed、JUnit status=run、skipped=0 且无失败节点纠正为 PASS,得到真实 2006/98/0。最初的 validator 失败保留,未重跑或修改产品测试。

归档哈希与完整历史 bundle 已核验;full unit invocation=563b1394021b4053baec4794ab9c27a0 的完成记录、成功退出和精确 journal 时间关系闭环,自有 claims 已释放。预检的两次 harness 前置错误与观察连接超时也分别保存;它们在实际 full unit claim/execution 前或观察端发生,未伪装成产品通过。

保留范围

  • 98 个 SKIP 仍未执行,包括 19 个明确需要两个活动 RDMA rail 的用例和 53 个 CUDA 用例。focused 和 full 均未被冒充为两轨、全部 CUDA 或全部几何/算术边界覆盖。
  • 初始 local OK-line audit 遇到 CTest 的 system-out 截断;原始 rejected 输出与独立 XML 复核表明是 14 个 required cases 缺少完整 OK 行(不是先前诊断文字中的 13)。这属于已保留诊断文案的数量纠正,未补造 OK 文本,也未改变最终 22 个必需 PASS rows 的判定。
  • 两次预检无法把空的 --no-checkout worktree/index 当存在于内容的 clean checkout,随后以实际有内容的 detached clean worktree 验证源代码,不改源码、测试、排除或时限;不是降低门槛。
  • 本结果只适用于上述精确 candidate 和已列验收范围,不宣称 TRN-23/M6、生产部署或 giant/模型能力已全部完成。

本地原始与终审证据:${CODE_ROOT}/dfkv-evidence/trn23-connection-geometry/,最终独立审查在 promotion/independent-final-acceptance-review-2128249c.md。

@ketor
ketor marked this pull request as ready for review November 28, 2026 14:27
@ketor
ketor added this pull request to the merge queue Nov 28, 2026
Merged via the queue into dingodb:main with commit ea587d3 Nov 28, 2026
13 checks passed
@ketor
ketor deleted the lr/trn23-connection-geometry branch November 28, 2026 14:33
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