Skip to content

test: avoid DWARF linking for temporary race binaries - #29032

Merged
XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/28419-race-link-cost-20260917
Sep 17, 2026
Merged

XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/28419-race-link-cost-20260917

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Related to #28419. This does not close the overall UT runtime/timeout issue.

What this PR does / why we need it:

A global review of the successful 47m28s race-UT trace found that the engine,
plan and optional embedded prebuild paths pay for DWARF linking that ordinary
go test already omits. Their go test -c outputs are temporary executables,
not debugger artifacts.

Use -ldflags=-w only for those compile-only commands. Preserve race
instrumentation, every dynamically discovered test, all assertions, process
isolation, single-runner and concurrency budgets, timeouts, native flags,
cancellation, report ownership and failure propagation. Embedded prebuild
remains off by default. No production, coverage or SCA build is changed.

Local Go 1.26.4 darwin/arm64 plan build pairs (warm compilation, forced links,
sequential commands and reversed order in pair 2):

Pair Before After
1 44.68s 17.44s
2 31.18s 16.89s
Total 75.86s 34.33s

Measured build-command time decreased 54.7%, and the binary decreased from
approximately 232 MiB to 190 MiB. This is not an end-to-end CI speedup claim.
Linux/amd64 results and total CI impact remain unmeasured; peak RSS was not
consistently reduced. See scope, cost review and evidence.

Validation:

  • Full candidate plan race binary: 3,020 top-level passes; identical default/
    candidate test-name lists.
  • Full candidate engine race binary: 160 top-level passes, three existing skips.
  • Intentional-race probe: still fails with function/file/line diagnostics;
    runtime stack-frame probe preserves function/file/line metadata.
  • Mock-based runner contracts verify flags, build-failure propagation and
    existing prebuild success/failure/cancellation behavior without adding MO
    compilations to CI.
  • Incremental golangci-lint: zero issues; go vet ./optools, shell syntax,
    gofmt and diff checks pass.
  • Full optools race validation: isolated run passed in 53.160s.
    The initial run concurrent with an engine build timed out in the existing
    15-second cancellation-diagnostics harness; the single-test isolated rerun
    passed in 1.350s. No timeout is increased to hide this observation.

Tradeoff: temporary CI binaries no longer support DWARF-based variable
inspection in Delve/GDB. Rebuild normally for interactive debugging. This
does not strip the Go symbol table (-s is deliberately not used).

Review classification: focused build maintenance; no new scheduler, lifecycle,
cache format or production contract. Broader stage overlap and additional
runners are deliberately not enabled. CI is not being waited on for this PR.

@XuPeng-SH
XuPeng-SH requested a review from fengttt as a code owner September 17, 2026 03:18
@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 →

@mergify

mergify Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@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.

GPT-6 Astra medium deep review for exact head 8711eb5.

Astra reviewed the complete diff and design/CI evidence.

Conclusion: no evidence-backed P0/P1/P2 blocker.

  • -ldflags=-w is limited to the three temporary race-binary compilation sites. It removes DWARF while preserving race support, and the tradeoff is documented.
  • Binary lifecycle, cleanup, failure propagation, concurrency, test selection, sharding, and reproducibility are unchanged.
  • Exact-head Linux UT passed with the expected engine and plan test discovery, and CI Required passed.

This is a comment-only review because the PR is authored by the review requester. Code review conclusion is approve, subject to the normal CI gate.

@XuPeng-SH
XuPeng-SH merged commit 0370bb4 into matrixorigin:main Sep 17, 2026
21 of 26 checks passed
@XuPeng-SH
XuPeng-SH deleted the codex/28419-race-link-cost-20260917 branch September 17, 2026 07:52
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…9032)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [x] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Related to matrixorigin#28419. This does not close the overall UT runtime/timeout
issue.

## What this PR does / why we need it:

A global review of the successful 47m28s race-UT trace found that the
engine,
plan and optional embedded prebuild paths pay for DWARF linking that
ordinary
`go test` already omits. Their `go test -c` outputs are temporary
executables,
not debugger artifacts.

Use `-ldflags=-w` only for those compile-only commands. Preserve race
instrumentation, every dynamically discovered test, all assertions,
process
isolation, single-runner and concurrency budgets, timeouts, native
flags,
cancellation, report ownership and failure propagation. Embedded
prebuild
remains off by default. No production, coverage or SCA build is changed.

Local Go 1.26.4 darwin/arm64 plan build pairs (warm compilation, forced
links,
sequential commands and reversed order in pair 2):

| Pair | Before | After |
| --- | ---: | ---: |
| 1 | 44.68s | 17.44s |
| 2 | 31.18s | 16.89s |
| Total | 75.86s | 34.33s |

Measured build-command time decreased **54.7%**, and the binary
decreased from
approximately 232 MiB to 190 MiB. **This is not an end-to-end CI speedup
claim.**
Linux/amd64 results and total CI impact remain unmeasured; peak RSS was
not
consistently reduced. See [scope, cost review and
evidence](https://github.com/XuPeng-SH/matrixone/blob/95d2a2c23a/docs/design/RACE_UT_LINK_COST.md).

Validation:

- Full candidate plan race binary: 3,020 top-level passes; identical
default/
  candidate test-name lists.
- Full candidate engine race binary: 160 top-level passes, three
existing skips.
- Intentional-race probe: still fails with function/file/line
diagnostics;
  runtime stack-frame probe preserves function/file/line metadata.
- Mock-based runner contracts verify flags, build-failure propagation
and
existing prebuild success/failure/cancellation behavior without adding
MO
  compilations to CI.
- Incremental golangci-lint: zero issues; `go vet ./optools`, shell
syntax,
  gofmt and diff checks pass.
- Full optools race validation: isolated run passed in 53.160s.
The initial run concurrent with an engine build timed out in the
existing
15-second cancellation-diagnostics harness; the single-test isolated
rerun
  passed in 1.350s. No timeout is increased to hide this observation.

Tradeoff: temporary CI binaries no longer support DWARF-based variable
inspection in Delve/GDB. Rebuild normally for interactive debugging.
This
does not strip the Go symbol table (`-s` is deliberately not used).

Review classification: focused build maintenance; no new scheduler,
lifecycle,
cache format or production contract. Broader stage overlap and
additional
runners are deliberately not enabled. CI is not being waited on for this
PR.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…9032)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [x] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Related to matrixorigin#28419. This does not close the overall UT runtime/timeout
issue.

## What this PR does / why we need it:

A global review of the successful 47m28s race-UT trace found that the
engine,
plan and optional embedded prebuild paths pay for DWARF linking that
ordinary
`go test` already omits. Their `go test -c` outputs are temporary
executables,
not debugger artifacts.

Use `-ldflags=-w` only for those compile-only commands. Preserve race
instrumentation, every dynamically discovered test, all assertions,
process
isolation, single-runner and concurrency budgets, timeouts, native
flags,
cancellation, report ownership and failure propagation. Embedded
prebuild
remains off by default. No production, coverage or SCA build is changed.

Local Go 1.26.4 darwin/arm64 plan build pairs (warm compilation, forced
links,
sequential commands and reversed order in pair 2):

| Pair | Before | After |
| --- | ---: | ---: |
| 1 | 44.68s | 17.44s |
| 2 | 31.18s | 16.89s |
| Total | 75.86s | 34.33s |

Measured build-command time decreased **54.7%**, and the binary
decreased from
approximately 232 MiB to 190 MiB. **This is not an end-to-end CI speedup
claim.**
Linux/amd64 results and total CI impact remain unmeasured; peak RSS was
not
consistently reduced. See [scope, cost review and
evidence](https://github.com/XuPeng-SH/matrixone/blob/95d2a2c23a/docs/design/RACE_UT_LINK_COST.md).

Validation:

- Full candidate plan race binary: 3,020 top-level passes; identical
default/
  candidate test-name lists.
- Full candidate engine race binary: 160 top-level passes, three
existing skips.
- Intentional-race probe: still fails with function/file/line
diagnostics;
  runtime stack-frame probe preserves function/file/line metadata.
- Mock-based runner contracts verify flags, build-failure propagation
and
existing prebuild success/failure/cancellation behavior without adding
MO
  compilations to CI.
- Incremental golangci-lint: zero issues; `go vet ./optools`, shell
syntax,
  gofmt and diff checks pass.
- Full optools race validation: isolated run passed in 53.160s.
The initial run concurrent with an engine build timed out in the
existing
15-second cancellation-diagnostics harness; the single-test isolated
rerun
  passed in 1.350s. No timeout is increased to hide this observation.

Tradeoff: temporary CI binaries no longer support DWARF-based variable
inspection in Delve/GDB. Rebuild normally for interactive debugging.
This
does not strip the Go symbol table (`-s` is deliberately not used).

Review classification: focused build maintenance; no new scheduler,
lifecycle,
cache format or production contract. Broader stage overlap and
additional
runners are deliberately not enabled. CI is not being waited on for this
PR.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

This branch had an error being deployed

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

Labels

kind/enhancement kind/test-ci size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants