Skip to content

Add impact-based partial CI test selection - #622

Open
yuecideng wants to merge 3 commits into
mainfrom
codex/ci-partial-test-selection
Open

Add impact-based partial CI test selection#622
yuecideng wants to merge 3 commits into
mainfrom
codex/ci-partial-test-selection

Conversation

@yuecideng

@yuecideng yuecideng commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Description

PR tests previously installed gensim and cuRobo on every run and collected the entire suite in each resource lane. This change builds an explainable test plan from the cumulative PR diff, selecting affected test files and contract checks for mapped changes while falling back to broader validation when impact cannot be established safely.

  • Add a versioned impact manifest and planner using explicit rules, existing MAP topics, and a bounded reverse-import graph. Global CI/fixture/dependency changes, missing mappings, graph errors, and shared-fixture consumers expand the plan to all non-slow PR tests.
  • Execute the plan with mutually exclusive fast/sim/GPU markers, serial simulation/GPU runs, and isolated distributed tests. Documentation tests run in a small Ubuntu job; docs-only plans skip the CUDA test container. Install gensim/cuRobo only when needed and use the shared pip cache.
  • Keep a small NMS boundary smoke test in PR validation and mark the 24-case reference matrix plus two heavy-suppression cases as slow. Changed slow files get narrow slow-* lanes rather than promoting the entire PR to the complete slow suite. Nightly runs at 02:00 UTC and manual full runs still cover every slow test.
  • Align pytest's process-wide DexSim initialization with SimulationManagerCfg.cpu_num=1. The previous native automatic worker setting produced a different contact result in the scoop integration test; all three seeds pass after the fixture fix.
  • Publish the plan, selection reasons, lane counts, lane elapsed time, and the 20 slowest tests. Validate the analyzer before planning and expose a stable Test gate result. CI script changes no longer trigger an unrelated Sphinx build.

Dependencies: Python 3.11 and pytest for planning, with optional PyYAML for MAP routing and a conservative manifest-only fallback. Runtime requirements are unchanged.

The first implementation selects test files rather than coverage-derived node IDs. Native code, resource/configuration dependencies, and dynamic consumers rely on explicit rules and full fallbacks. Source changes do not automatically promote every impacted slow node into PR validation; the complete slow matrix remains covered by nightly/manual full runs. Design and rollout details are in design/ci-partial-test-selection.md.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which improves an existing functionality)

Validation

  • Planner/runner and docs tests: 59 passed (python -m pytest -q tests/ci tests/docs --confcutdir=tests/docs), including mixed CPU/GPU slow files, parameter-level slow marks, unrelated GPU markers, slow-only lanes, docs-only slow tests, and full-mode boundaries.
  • Scoop integration file: 8 passed, including all three slow seeds (--run-gpu -m 'slow or not slow' --renderer fast-rt). Before the fixture change, the local physical cases failed with zero retained ice cubes.
  • Non-slow simulation group: 327 passed, 4 skipped in 24m26s after the fixture fix. The previous remote group took 45m19s; environments differ, so this is directional rather than a benchmark.
  • Non-slow GPU group: 162 passed, 3 skipped in 16m23s after the same fixture fix.
  • NMS exhaustive slow checks: 26 passed in 205 seconds. Existing non-slow partial-plan validation passed 65 fast tests and 3 GPU tests; direct non-slow CPU NMS checks passed 9 tests.
  • Whole-repository black==26.3.1 formatting, actionlint on the workflow, Python compilation, manifest selector resolution, and context-map checks passed. Public API docs: 2067/2067 exports documented.

The prior remote test job took about 108 minutes: dependency installation ~23 minutes, fast 13m35s, sim 45m19s, distributed 24s, and GPU 23m56s. It also waited about 108 minutes for a runner. Its full plan exposed the unrelated slow scoop failure. This PR's CI/fixture changes still select full-pr, with extra slow selectors limited to the changed NMS file. Actual overall runtime savings require the new remote run; dependency installation and runner queue time remain separate costs.

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation.
  • Public API changes are reflected in the API docs, if applicable (no packaged public API changes; coverage gate passed).
  • I have added tests that prove the feature works.
  • Dependencies have been updated, if applicable (CI installation updated; runtime requirements unchanged).

@yuecideng yuecideng added enhancement New feature or request ci labels Sep 13, 2026
@greptile-apps

greptile-apps Bot commented Sep 13, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, or repository-rule failures remain.

Summary

  • Adds a versioned test-impact manifest with explicit mappings, topic contracts, reverse-import analysis, and conservative fallbacks.
  • Adds fast, simulation, distributed, GPU, documentation, and impacted-slow execution lanes.
  • Pins newly used GitHub Actions, computes PR changes from the merge base, and publishes test-plan artifacts and summaries.
  • Moves exhaustive NMS cases behind the slow marker while retaining representative PR smoke coverage.
  • Stabilizes simulation initialization by matching the process-wide worker count to the manager default.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    D[PR merge-base diff] --> P[Impact planner]
    M[Impact manifest and MAP topics] --> P
    G[Bounded reverse-import graph] --> P
    P -->|Mapped impact| J[test-plan.json]
    P -->|Unknown or global risk| F[Full-pr or full plan]
    F --> J
    J --> A[Fast lane]
    J --> S[Simulation lane]
    J --> R[Distributed GPU lane]
    J --> U[GPU lane]
    J --> O[Documentation lane]
    J --> L[Impacted slow lanes]
    A --> T[Test gate]
    S --> T
    R --> T
    U --> T
    O --> T
    L --> T
Loading

Reviews (3) · Last reviewed commit: "fix(ci): narrow slow lanes and stabilize..."

Comment thread .ci/test-impact.toml
Comment thread scripts/ci/select_tests.py
Comment thread .github/workflows/main.yml Outdated
Cover the dataset functor consumer, diff pull requests from their merge base, and pin workflow actions to immutable revisions.
Run changed slow nodes in resource-specific lanes instead of promoting the whole PR to the complete slow suite. Align the process-wide DexSim worker setting with SimulationManagerCfg so contact outcomes and runtime remain stable in CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant