Skip to content

ci: parallelize native builds in UT jobs - #27706

Merged
XuPeng-SH merged 4 commits into
mainfrom
codex/systematic-ut-job-perf
Aug 27, 2026
Merged

XuPeng-SH merged 4 commits into
mainfrom
codex/systematic-ut-job-perf

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Aug 27, 2026 •

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:

issue #27705

What this PR does / why we need it:

The UT runner already receives an explicit UT_PARALLEL CPU budget, but native third-party/CGo preparation ignored it and built serially before race testing began. The analyzed job spent about 5m03s in this phase (about 4m22s in third parties and 33s in CGo).

This change:

  • reuses the existing bounded UT CPU budget for third-party and CGo compilation;
  • makes the third-party dependency graph safe for parallel make by declaring generated-header and install-directory prerequisites;
  • keeps ordinary developer builds serial by default;
  • adds an opt-in for CI to attest that the exact checkout already passed the separately timed config canary, avoiding duplicate package-graph verification;
  • reduces archive extraction log volume.

No Go test, package selection, race flag, coverage path, assertion, timeout, or fixture is changed. Native compilation completes before race tests, so this does not raise the race phase process or memory budget.

The companion workflow change is matrixorigin/CI#433. It is backward-compatible with older MatrixOne branches, which ignore the new variable and retain the duplicate verification.

Validation

Same commit, clean native build:

  • baseline serial: 80.43s wall;
  • candidate parallel run 1: 18.92s wall;
  • candidate parallel run 2: 17.75s wall;
  • reduction: 76.5% to 77.9%.

Correctness checks:

  • default NATIVE_BUILD_JOBS=1 path completed successfully;
  • serial and parallel libmo.so / libmo.a SHA256 hashes are identical;
  • forced compiler failure propagates through recursive make with non-zero status;
  • native library/archive formats and exported libmo symbols verified;
  • deterministic CGo-transitive external-link test passed with -count=1;
  • CGo-direct package compiled and linked successfully;
  • default make -n ut retains one config verification, while UT_CONFIGURED=1 removes only that prerequisite and retains the full native/UT path;
  • git diff --check passed.

The analyzed explicit config took 28.158s; the companion change avoids repeating the same phony prerequisite while preserving the proxy canary. Full critical-path analysis and follow-up constraints are tracked in #27705.

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

@XuPeng-SH

Copy link
Copy Markdown
Contributor Author

Self-review completed against origin/main (ff4270c844c4) through head 30324d147acf.

One blocking finding was found and fixed: the first implementation always passed -j1 when UT_PARALLEL had its default value, which overrode recursive make jobserver inheritance for ordinary make -jN and would regress developer/GPU builds. Commits 5151d48e2e and 30324d147a now pass -jN only for an explicit native/UT budget, preserve parent jobserver behavior otherwise, and reject zero before it can become unbounded make -j0.

Final evidence:

  • default, inherited make -j8, explicit UT_PARALLEL=8, explicit NATIVE_BUILD_JOBS=3, and zero-budget boundaries verified;
  • actual parent make -j8 cgo completed without jobserver/reset warnings;
  • exact-head clean parallel build using the CI prebuilt ONNX path: 17.92s;
  • CGo-transitive selected test passed with -count=1; CGo-direct package linked;
  • native artifact formats verified; failure propagation and serial/parallel hash equivalence remain valid;
  • no test file, UT runner, package selection, race flag, coverage path, assertion, timeout, or fixture changed;
  • git diff --check passed.

Code review result: PASS, no remaining code blocker. Latest-head platform CI is still the merge gate.

@XuPeng-SH
XuPeng-SH merged commit d57f99a into main Aug 27, 2026
38 checks passed
@XuPeng-SH
XuPeng-SH deleted the codex/systematic-ut-job-perf branch August 27, 2026 03:22
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## 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:

issue matrixorigin#27705

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

The UT runner already receives an explicit `UT_PARALLEL` CPU budget, but
native third-party/CGo preparation ignored it and built serially before
race testing began. The analyzed job spent about 5m03s in this phase
(about 4m22s in third parties and 33s in CGo).

This change:

- reuses the existing bounded UT CPU budget for third-party and CGo
compilation;
- makes the third-party dependency graph safe for parallel make by
declaring generated-header and install-directory prerequisites;
- keeps ordinary developer builds serial by default;
- adds an opt-in for CI to attest that the exact checkout already passed
the separately timed `config` canary, avoiding duplicate package-graph
verification;
- reduces archive extraction log volume.

No Go test, package selection, race flag, coverage path, assertion,
timeout, or fixture is changed. Native compilation completes before race
tests, so this does not raise the race phase process or memory budget.

The companion workflow change is matrixorigin/CI#433. It is
backward-compatible with older MatrixOne branches, which ignore the new
variable and retain the duplicate verification.

### Validation

Same commit, clean native build:

- baseline serial: 80.43s wall;
- candidate parallel run 1: 18.92s wall;
- candidate parallel run 2: 17.75s wall;
- reduction: 76.5% to 77.9%.

Correctness checks:

- default `NATIVE_BUILD_JOBS=1` path completed successfully;
- serial and parallel `libmo.so` / `libmo.a` SHA256 hashes are
identical;
- forced compiler failure propagates through recursive make with
non-zero status;
- native library/archive formats and exported `libmo` symbols verified;
- deterministic CGo-transitive external-link test passed with
`-count=1`;
- CGo-direct package compiled and linked successfully;
- default `make -n ut` retains one config verification, while
`UT_CONFIGURED=1` removes only that prerequisite and retains the full
native/UT path;
- `git diff --check` passed.

The analyzed explicit config took 28.158s; the companion change avoids
repeating the same phony prerequisite while preserving the proxy canary.
Full critical-path analysis and follow-up constraints are tracked in
matrixorigin#27705.
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## 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:

issue matrixorigin#27705

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

The UT runner already receives an explicit `UT_PARALLEL` CPU budget, but
native third-party/CGo preparation ignored it and built serially before
race testing began. The analyzed job spent about 5m03s in this phase
(about 4m22s in third parties and 33s in CGo).

This change:

- reuses the existing bounded UT CPU budget for third-party and CGo
compilation;
- makes the third-party dependency graph safe for parallel make by
declaring generated-header and install-directory prerequisites;
- keeps ordinary developer builds serial by default;
- adds an opt-in for CI to attest that the exact checkout already passed
the separately timed `config` canary, avoiding duplicate package-graph
verification;
- reduces archive extraction log volume.

No Go test, package selection, race flag, coverage path, assertion,
timeout, or fixture is changed. Native compilation completes before race
tests, so this does not raise the race phase process or memory budget.

The companion workflow change is matrixorigin/CI#433. It is
backward-compatible with older MatrixOne branches, which ignore the new
variable and retain the duplicate verification.

### Validation

Same commit, clean native build:

- baseline serial: 80.43s wall;
- candidate parallel run 1: 18.92s wall;
- candidate parallel run 2: 17.75s wall;
- reduction: 76.5% to 77.9%.

Correctness checks:

- default `NATIVE_BUILD_JOBS=1` path completed successfully;
- serial and parallel `libmo.so` / `libmo.a` SHA256 hashes are
identical;
- forced compiler failure propagates through recursive make with
non-zero status;
- native library/archive formats and exported `libmo` symbols verified;
- deterministic CGo-transitive external-link test passed with
`-count=1`;
- CGo-direct package compiled and linked successfully;
- default `make -n ut` retains one config verification, while
`UT_CONFIGURED=1` removes only that prerequisite and retains the full
native/UT path;
- `git diff --check` passed.

The analyzed explicit config took 28.158s; the companion change avoids
repeating the same phony prerequisite while preserving the proxy canary.
Full critical-path analysis and follow-up constraints are tracked in
matrixorigin#27705.
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## 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:

issue matrixorigin#27705

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

The UT runner already receives an explicit `UT_PARALLEL` CPU budget, but
native third-party/CGo preparation ignored it and built serially before
race testing began. The analyzed job spent about 5m03s in this phase
(about 4m22s in third parties and 33s in CGo).

This change:

- reuses the existing bounded UT CPU budget for third-party and CGo
compilation;
- makes the third-party dependency graph safe for parallel make by
declaring generated-header and install-directory prerequisites;
- keeps ordinary developer builds serial by default;
- adds an opt-in for CI to attest that the exact checkout already passed
the separately timed `config` canary, avoiding duplicate package-graph
verification;
- reduces archive extraction log volume.

No Go test, package selection, race flag, coverage path, assertion,
timeout, or fixture is changed. Native compilation completes before race
tests, so this does not raise the race phase process or memory budget.

The companion workflow change is matrixorigin/CI#433. It is
backward-compatible with older MatrixOne branches, which ignore the new
variable and retain the duplicate verification.

### Validation

Same commit, clean native build:

- baseline serial: 80.43s wall;
- candidate parallel run 1: 18.92s wall;
- candidate parallel run 2: 17.75s wall;
- reduction: 76.5% to 77.9%.

Correctness checks:

- default `NATIVE_BUILD_JOBS=1` path completed successfully;
- serial and parallel `libmo.so` / `libmo.a` SHA256 hashes are
identical;
- forced compiler failure propagates through recursive make with
non-zero status;
- native library/archive formats and exported `libmo` symbols verified;
- deterministic CGo-transitive external-link test passed with
`-count=1`;
- CGo-direct package compiled and linked successfully;
- default `make -n ut` retains one config verification, while
`UT_CONFIGURED=1` removes only that prerequisite and retains the full
native/UT path;
- `git diff --check` passed.

The analyzed explicit config took 28.158s; the companion change avoids
repeating the same phony prerequisite while preserving the proxy canary.
Full critical-path analysis and follow-up constraints are tracked in
matrixorigin#27705.

This branch was previously deployed

1 inactive deployment
ci — 30324d14 Deployed Aug 27, 2026 by XuPeng-SH via Matrixone Utils CI / Coverage #48550
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.

2 participants