Skip to content

test(function): centralize fixture ownership and reduce contract test work - #29591

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/quality-29249-20261003
Oct 3, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/quality-29249-20261003

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Refs #29249. Continuation after merged #29585, rebased onto main 7ff3eac2e8.

  • Give the existing function fixture one rollback/release owner, migrate terminal and borrowed consumers to their actual lifetimes, and remove the duplicate evaluator type and test-only production declarations.
  • Share 23 identical fixed-type comparison loops while retaining float64 epsilon/NaN behavior, existing vector wrappers, NULL ordering, diagnostics and variable-length comparison paths.
  • Preserve real boundary oracles while reducing Sleep wall time through virtual time, payload admission map rebuilding, XML budget setup, and LIKE budget/NTT test work.
  • Keep literal result, metadata, raw geometry, failure, account and cleanup assertions. Extend the existing reuse fixture rather than adding a type-by-behavior matrix.

Go code: net 312 lines removed, counting the fixture move as movement rather than reduction. Design/coverage documentation: 107 added lines, net whole change 205 lines removed.

Evidence

  • Actual Codex CLI gpt-6.1-sol, xhigh, read-only, multi-agent disabled: design and implementation APPROVE. Rebase range-diff shows both reviewed patches identical.
  • Full owning-package normal and race tests, incremental configured lint and go vet: rebased HEAD 9f0fb65aaf: normal 7.024s, race 12.782s, lint/vet exit 0; all 221 Go source hashes unchanged.
  • Old-source real Abs/Cast probes independently establish exact float32, tolerant float64/paired NaN, NULL polarity and first/last-row diagnostic contracts.
  • Comparator equality and premature-NULL-skip mutations fail the selected real-entry test. Private constructor/input/result/helper release mutations fail exact allocation baselines; Sleep units, payload capacity, XML work spending and LIKE dispatch/budget mutations are also rejected.
  • Production-only compilation passed the ownership checkpoint; no native sources changed. No SQL behavior is introduced, so BVT was not run for this test-harness closure.

Matched three-pair serial package measurements before comparator deduplication: wall 9.079s -> 6.281s, CPU 2.397s -> 2.132s, peak RSS 168544 -> 170472 KiB. Compilation excluded. These local observations establish no CI-wide time saving or memory reduction.

Remaining limits

This is a draft continuation, not closure of #29249 or the 342-file audit. Formal regexp2 v1.10 has a deterministic stopped-clock/stale-deadline failure, consistent with a previously observed race failure; a private fix/probe exists but is unpublished and not silently substituted here. A subsequent green run does not erase that defect. Broader error-oracle cleanup, benchmark iteration accounting and the memory objective remain open.

Detailed responsibility and coverage map: docs/design/20261003-function-test-fixture-ownership.md.

Clock gate follow-up

Independent dependency defect is tracked in #29592. The formal regexp2 dependency remains unchanged. Whole-package race failed again at regexp_icu_test.go:370; the recorded earlier green run does not erase it. Overall delivery remains blocked by that gate.

A benchmark-contract follow-up is locally committed as 255303da69 but not pushed to this PR head. Full normal tests plus all 176 benchmarks at 1x, the four affected UTs plus all 176 benchmarks under race at 2x, actual B.N+1 entry-count probes, post-admission Cast input mutations, and incremental lint/vet are complete. Independent gpt-6.1-sol/xhigh review accepted the local implementation/evidence closure and explicitly withheld overall delivery approval. The full-package race failure is preserved; it was not retried as an acceptance check.

Refs matrixorigin#29249. Release terminal cases and preserve borrowed result lifetimes, retire duplicate fixture execution types, and tighten existing temporal and serialization oracles. Whole-package normal/race and incremental static checks pass. Performance reduction is not claimed for this ownership checkpoint; broader audit and independent delivery review remain open.
Refs matrixorigin#29249. Retain float64 epsilon semantics, reject comparator mutants, and preserve exact resource boundaries while reducing Sleep, payload, XML and LIKE test cost.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed commit 9f0fb65aaf541918cb01b1c12b6f3b64e0b57b67 against main@7ff3eac2e8f17c0d013178c287dc686b4360b0f0. No subagents used. Unpublished follow-up commits are excluded.

结论:本次发布 diff 的设计和实现未发现新的阻塞问题;整体交付仍 HOLD,保留 PR 已声明的 #29592 gate。

  • 职责归属合理:复用 executeLogicOfOverload,由既有 fixture 统一承担构造回滚和输入/结果释放;RunAndFree 复用 Run,借用结果的调用者保留到最后一次检查。没有新建重复状态机、缓存或执行路径。
  • 完整差异审查覆盖所有 94 个文件。机械替换逐 hunk 核对;另用 AST 对 1,450 处 terminal 调用做同对象后续引用检查,53 处后续引用均先重新构造。未发现释放后继续读取旧结果。下层 vector/result 释放、失败回滚和 helper 所有权转移已跟踪。
  • 23 个定长比较分支保留类型映射、NULL 两种不匹配、双 NULL 后续行检查和诊断;float32 精确比较及 float64 epsilon/NaN 语义保持。时间精度和 SERIAL 测试断言加强。Sleep、payload、XML、LIKE 缩减仍覆盖真实执行与容量/工作量边界。
  • 分开核算:运行时代码 +3/-3(等价类型替换);fixture 移动归位后净减 210 行,其他测试净减 102 行,测试合计净减 312 行;文档 +107,整体净减 205。文件移动不计减量,也没有证据支持 RSS 改善或整个 CI 的性能提升。

验证:复用此 head 的 CI build/SCA/UT/BVT 结果,并核对 function owning package 在 matrixone_test -race heavy 阶段,终态为 0。本机按当前源码重建 native 库;11 个顶层测试、含子测试共 54 个场景通过(2.953s)。独立挑战补充了“已分配输入后结果 wrapper 构造失败”和“执行中的 Sleep 取消”,验证返回行为及 native/heap 分配归零。TestSleep 在 race 下精确重复 100 次通过(3.498s)。诊断测试已移出工作树,生产代码未修改。

现有评论核销:评审时 PR 没有 review/inline/conversation comments,故没有遗漏的历史评论项。

尚未关闭的交付事项: #29592 记录了 regexp2 的 stale-deadline 缺陷及 owning-package race 失败。本 PR 未修改依赖、regexp_icu.go 或对应失败用例;本轮未将它归因为新增回归,也未把一次绿色 CI 解释成缺陷已解决。继续保持 draft/交付阻塞,直到该已声明 gate 正式闭合。未推送的 benchmark 修复、其余弱错误断言及 #29249 全仓目标不计为本次已完成。

当前账号为 PR 作者,因此以 COMMENT 提交这份 commit review;这不是 GitHub APPROVE。

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

This branch was previously deployed

1 inactive deployment
ci — 72142e1b Deployed Oct 3, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Denotes a PR that changes [1000, 1999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants