Skip to content

refactor(rdma): move learned depth definition - #622

Merged
ketor merged 1 commit into
dingodb:mainfrom
ketor:lr/trn23-learned-depth-ea587d30
Nov 28, 2026
Merged

ketor merged 1 commit into
dingodb:mainfrom
ketor:lr/trn23-learned-depth-ea587d30

Conversation

@ketor

@ketor ketor commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Scope

将 private RdmaTransport::LearnedDepth 的 8行定义 从 rdma_transport.cc 原样迁移到 existing rdma_transport_ops.cc,紧随之前迁移的 ConnectionDepth。header、private Lane/depth map/mutex 的字段声明、NoteNegotiatedDepth 状态writer、默认参数、include、CMake、caller、tests 和 public API 均不变;没有任何helper、compat layer或新状态。

每个实例的 mutex/learned data/control maps 仍是原来的对象成员。搬迁reader并不复制状态或锁:源码中的 NoteNegotiatedDepth 继续对同一实例成员更新,不是TU-local第二份cache。

  • Candidate head: e71a1b20d18c655e0c41bc704e2c6b67d445069c
  • Tree: b03e34a10b1a16950af8f35c767207148ee59558
  • Parent at candidate creation/review: ea587d30ee6bec17cfb621812809ad17fd961651
  • 仅两份 .cc,各 −9/+9 行。原始393B定义和316B statement body保持字节相同。

完整源码重建

从真实base blob执行预期切片后可逐字节重建两个最终文件,不是只做行数/hint匹配:

文件 最终 SHA-256 / Git blob
main c3e744f8c509c0234dbc8ddbe1e60966b4f19860bc3634094576eed5a5d2b79b / 79c9b1a8c0732f8b4195c32cfd0096afd68ef4e0,201997 B / 4697行
ops 9cc59b4e9cba63c88137930d4d339e40158548b075e8c2c918179c2ba59f027a / c04ea6404fbc883caaf02b62a238deed69b8b332,7901 B / 200行

main无该definition,ops恰有一个,位于ops 191–198。OpBound仍为header inline,NoteBlock仍保留logging/high-water side effects,NoteNegotiatedDepth仍保留其状态写入;没有outline挪动它们。

构建、对象与动态链接

同主机、GNU 13.3、Release、tests/RDMA/io_uring ON,分别fresh build baseline/candidate,均 384/384 steps(这不是384个测试);dfkv 和 dfkv_core 均验证。main失去definition,ops的U LearnedDepth变为T definition。两target各自class emitted-member multiset为149→149。combined objects和linked library无新增未解析/重复定义。

LearnedDepth 仍保持 FUNC / GLOBAL / DEFAULT / size 393及mangled identity(private声明并不等同于hidden symbol)。其实际machine bytes和有序relocation也保持一致;其q/mutex/map成员访问并非凭名字推断为相似逻辑。地址改变(0x333990→0x3766d0),仅不解释为地址等价。

Codegen/size changes(明确保留,不做“全产物完全相同”断言)

同profile literal搬移会改变编译布局和部分优化。独立源码/focused审查确认以下代码生成后果,并将 size_sensitive_multiset_equal=false 保持为真实结果:

  • libdfkv.so:RoundTrip −29B、NoteFailedCompletion +86B,其 .cold −16B。
  • dfkv_core main object还观察到:ConfirmRefusal +59B、NoteFailedCompletion +54B、其 .cold −21B;constructor alias记录 C1/C2 −8B,C2.cold +52B。别名记录不是另造两份独立功能。

参与比较的name/type/binding/visibility/section identity无额外增删;linked动态defined/undefined canonical delta为空。size如果不被忽略,严格multiset不相等。reader本身的raw machine bytes/relocation一致,但未安排same-source A/A reproducibility来证明其余优化差异的普遍可重复编译因果关系。

以上不是新算法编辑、性能提升声明或任意执行路径/机器码/任意toolchain ABI等价声明。实际linked属性为DT_NEEDED=libibverbs.so.1,libc.so.6/loader、SONAME libdfkv.so.2,baseline/candidate ldd -r rc=0;仅描述实测target/link面。

OFF/OFF:Release, tests=ON, DFKV_WITH_RDMA=OFF, DFKV_WITH_URING=OFF,358/358 build/link;214 compile commands中没有两个changed TU,相应object不存在;dynamic defined/undefined无dfkv::RdmaTransport,DT_NEEDED仅libc/loader,下载后的ldd -r也通过。没有采纳或伪装OFF/ON不兼容配置。

实际 focused RDMA

精确candidate在单一物理轨 ib6s200p0(PORT_ACTIVE(4)、mlx5_core)上执行,独立复核XML为 4 run / 4 completed / 4 PASS / 0 SKIP / 0 FAIL / 0 ERROR,总4.608秒,原始日志显示实际 QP/CQ/retry行为。

Case 实际关注的行为
DataConnectionsUseActualDepthClasses scalar PUT到四项batch后idle depth {1}→{1,4};helper对requested 1/3分别返回1/4,connection class metrics与实际qd一致
StalePooledConnectionOnTheOnlyRailRecoversOnTheRetry 真实stale retry并新建QP,connections 1→2、stale/retry各1、remote cooldown/failure=0,后续请求继续成功
RangeIntoMultiNamesEachRailOnce 8个kOk和non-empty output;单轨不重复连续rail名,未进入two-rail条件循环
DataConnectionsUseActualBlockSizeClasses 原始payload读回一致;idle {4096}→{4096,65536},请求4000B/5000/60KiB分别归入4096/8192/65536 class

未直接覆盖非default的learned-map命中、non-power-of-two learned value、zero requested credit、depth_>=256 cap、穷举lane/control/SG算术、two-rail、并发或跨rail/性能等价。未把单轨条件分支的空转称为two-rail执行,也不以 #620 或并发TCP #621的记录代替本次证据。

资源、审查与后续

最早的wrong-cwd metadata、source preflight和scp配置异常分别保留。校正后以精确head/tree进行的fresh build、focused与链接产物才是本结论的依据;没有用这些错误阶段充当通过。原既有测试源码的dangling-else warnings也保留。unit最终Result=success、ExecMainStatus=0,本候选两个owned resource targeted claims为空,且另有完整invocation/journal和processor记录;不是用inactive/not-found推断成功。

独立源码/focused evidence review为 GO、0 must-fix。本地完整审查:${CODE_ROOT}/dfkv-evidence/trn23-learned-depth-ea587d30/independent-source-focused-review-e71a1b20.md;该文件作为审查后的补充制品,不冒充包含在生成时较早的192项输入清单中的文件。

原始源/符号/XML/logs、192项verified retained inputs与完整历史bundle均在${CODE_ROOT}/dfkv-evidence/trn23-learned-depth-ea587d30/。原 source/candidate-complete-history.bundle SHA-256=8bb8f71a9d37f8f31632114d6fa4e8a2d4a9af2ef9770d203ff2e42b24160724,通过完整历史校验并含精确candidate HEAD;发布前自查发现它只有HEAD、没有自有本地branch ref,故原物保留,另以candidate HEAD、该精确owned ref与upstream/main补齐 source/candidate-complete-history-with-owned-ref.bundle,三项refs均已验证,SHA-256=45001451cc7ba8afbdbd56b15d23a269826d938461aae9dcfd9dc81a1cc5ccf2。这属于artifact保存范围补齐,不改候选代码或已有审查结论。owned branch/worktree暂留,不合并到共享开发配置或production。

后续门禁尚未完成:发布前再次核对actual main,fresh maintained full与当前public CI、最终源码/证据审核,之后才可能ready/GraphQL queue;实际MERGED后还须确认真实merge OID/tree,再执行完整bundle保全后的owned清理。本批只闭合一个LearnedDepth literal relocation,不代表TRN-23/TRN-24/M6、TRN-31/32或生产验收完成。

- Keep the private helper body byte-identical in the existing ops translation unit.
@ketor
ketor force-pushed the lr/trn23-learned-depth-ea587d30 branch from e71a1b2 to 2cc272a Compare November 28, 2026 16:17
@ketor

ketor commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Verification summary — rebased current-main head

Raw candidate: 2cc272abe9a3ffe13c1f97bea7c0e8ef1384baeb
Tree: 3672f32a484f795c60120d4d61ff83cd00d975f7
Parent/base at verification: 4def7fa4994dcdb668d6b3b10f631a06a254a0b4

Scope and source evidence

This is exactly the eight-line RdmaTransport::LearnedDepth definition moved unchanged from rdma_transport.cc into the existing rdma_transport_ops.cc, following ConnectionDepth. Only those two .cc files change, nine lines each. Header, declarations, caller, per-instance state/mutex, public transport interface, defaults, CMake and tests are unchanged. Definition/body SHA-256 are respectively 2288839ad5dbb2bf9d921a0b0cd92ae004a4ef17f3d1e16b69b796438d043eea and 9538d3971f22591eb6b6d1b7da76adec7d4218b46becf2161b8ab9d3a4317354. Independent source review found no must-fix findings. This includes the current-main TCP deadline correction; it is not reverted.

Fresh maintained full on current main

The source was restored from and verified against a complete-history bundle containing the exact owned candidate ref and upstream main. The current-main full was freshly built and run on 0099 with Release, tests/RDMA/io_uring ON, sequential maintained ordering, private mount/tmp and the unchanged exclusions and per-case limits.

  • Discovery: 2111; selected and executed: 2105 (six established exclusions).
  • Independently parsed original XML: 2007 PASS / 98 SKIP / 0 FAIL.
  • Raw runner ledger was 2001/104/0. Exactly six name-only Skipped parser false positives were corrected individually using each case’s own raw CTest Passed plus non-skipped JUnit status=run with no skip/failure/disabled/error evidence. No aggregate string substitution or inherited counts were used.
  • 32/32 required cases are genuine executed passes: migration 14, legacy slot/RDMA 4, geometry 4, ConnectionPool 8, and health controls 2.
  • The original CTest 1024-byte output-removal markers are retained and classified, not ignored or treated as missing evidence by themselves. Required-case proof uses actual CTest PASS plus JUnit run; 16 retain a complete literal gtest OK and 16 do not. The separate 17-row marker count includes case 601, which retains OK while a later output segment is removed. This is not a claim that skipped features or missing text were executed/invented.
  • Full unit completed successfully with a matching exact invocation/head and no remaining owned claims/processes. The first adjudicator incorrectly required an absent optional CTest root errors attribute; its failed result is preserved. The subsequent artifact-only adjudication retained strict skipped/failure/error/disabled rejection and completed without rerunning product tests.
  • Final archive SHA-256: adfaeba67a4c970918279d33ff6f89392050fb75e8b48d51b1f62a218bdde4a2. Local artifact, source-tree and delivery manifests were independently verified.

Focused build/link and physical RDMA behavior

On the exact current base and candidate, ordinary base/candidate builds each completed 384/384; exact real single-rail focused tests completed 4 PASS / 0 SKIP / 0 FAIL / 0 ERROR (depth 1/4, block classes 4096/8192/65536, genuine stale-retry and rail naming). RDMA=OFF + io_uring=OFF configured and built/linked 358/358 with the changed transport TUs excluded. The selected class-member multiset remained 149; defined/undefined dynamic multisets were unchanged, SONAME remained libdfkv.so.2, and recorded link closures succeeded.

Measured symbol-size differences from optimizer/code-layout effects remain preserved, e.g. RoundTrip −29 B and NoteFailedCompletion +86 B. The earlier OFF harness’s incorrect libc-only dependency predicate and failed history are preserved; the corrected audit evaluates the unchanged artifacts’ actual libc+loader closure. This is not a claim of arbitrary binary, ABI, performance or concurrency equivalence, nor execution of the separate two-rail branch.

Public CI and independent final review

CI run 46164381513, run number 1760, attempt 1: 13/13 jobs and 13/13 check-runs completed successfully on the exact candidate head. The prior e71a1b20 CI run is not reused for this head.

Independent final evidence review returned GO with zero must-fix/blocking findings, after directly recomputing the source bytes, all 2105 XML cases/raw CTest logs, required cases, six precise parser corrections, lifecycle, integrity manifests and official CI. It confirms no remaining scoped evidence prerequisite or source must-fix for the bounded relocation.

This closes only the literal LearnedDepth relocation and the validation described above; it does not claim completion of all TRN-23/M6 work, production rollout, or universal feature/performance equivalence.

@ketor
ketor marked this pull request as ready for review November 28, 2026 17:03
@ketor
ketor added this pull request to the merge queue Nov 28, 2026
Merged via the queue into dingodb:main with commit df50024 Nov 28, 2026
13 checks passed
@ketor
ketor deleted the lr/trn23-learned-depth-ea587d30 branch November 28, 2026 17:06
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