Skip to content

ci(testrunner): rebuild 3.15-dev and pin Cython<3.3 on the 3.15 cache (PROF-14439) - #19907

Open
vlad-scherbich wants to merge 9 commits into
vlad/py315-pyo3-contextvarfrom
vlad/py315-testrunner-cython-pin
Open

ci(testrunner): rebuild 3.15-dev and pin Cython<3.3 on the 3.15 cache (PROF-14439)#19907
vlad-scherbich wants to merge 9 commits into
vlad/py315-pyo3-contextvarfrom
vlad/py315-testrunner-cython-pin

Conversation

@vlad-scherbich

@vlad-scherbich vlad-scherbich commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Description

Delta vs #19903.

docker/Dockerfile: pyenv v2.6.31v2.8.4. A docker/** push to main retriggers .github/workflows/testrunner.yml and recompiles 3.15-dev. Does not pin a 3.15.0 interpreter or the GitLab TESTRUNNER_IMAGE digest.

.cached_testrunner EXT_CACHE_VENV: pip install … 'Cython<3.3' when PYTHON_VERSION=3.15; other versions stay unpinned Cython.

If this merges and nothing else new lands: the next testrunner image rebuilds with pyenv 2.8.4, and the 3.15 cache venv gets Cython 3.2.x. GitLab jobs keep the old digest until a follow-up pins it.

Testing

Image rebuild is the testrunner workflow after merge to main. After publish, pin .gitlab/testrunner.yml. Confirm the generated 3.15 build_base_venvs before_script installs Cython<3.3.

Risks

Pyenv 2.8.4 also reinstalls 3.8–3.14 (patch-level bumps possible). Cython pin is 3.15-only.

Additional Notes

Does not duplicate #19861 (pyproject.toml unchanged). No release note: CI chore, changelog/no-changelog.

Base: #19903. Next: #19904.

@vlad-scherbich vlad-scherbich added the changelog/no-changelog A changelog entry is not required for this PR. label Aug 27, 2026
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codeowners resolved as

Resolved from the full PR diff against vlad/py315-pyo3-contextvar using the target branch CODEOWNERS file.
CODEOWNERS team requests not listed below are not required by the current file set.

.gitlab/scripts/prune-unsupported-wheels.sh                             @DataDog/python-guild @DataDog/apm-core-python
.gitlab/templates/cached-testrunner.yml                                 @DataDog/python-guild @DataDog/apm-core-python
docker/Dockerfile                                                       @DataDog/python-guild
hooks/pre-commit/05-run-bandit                                          @DataDog/python-guild
hooks/scripts/run-mypy.sh                                               @DataDog/python-guild
pyproject.toml                                                          @DataDog/python-guild
tests/internal/test_py315_import_degrade.py                             @DataDog/apm-core-python

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 27, 2026

Copy link
Copy Markdown

Dependency direction analysis

⚠️ Existing dependency direction violations

There are 240 dependency direction violations that already exist on the base branch and have not been changed by this PR.

Show existing violations (showing 5 of 240 highest severity)
ddtrace.internal.tracemethods -×-> ddtrace.trace  (internal-core -> product:tracing, score=135)
ddtrace.profiling.scheduler -×-> ddtrace.trace  (product:profiling -> product:tracing, score=133)
ddtrace.llmobs._integrations.bedrock -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=133)
ddtrace.profiling.collector.pytorch -×-> ddtrace.trace  (product:profiling -> product:tracing, score=133)
ddtrace.llmobs._integrations.pydantic_ai -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=133)

To see all violations, download the layers-base.json and layers-pr.json artifacts from this CI job and run:

uv run --script scripts/import-analysis/layers.py compare layers-base.json layers-pr.json

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Circular import analysis

⚠️ Existing circular imports

There are 3 circular imports that already exist on the base branch and have not been changed by this PR.

ddtrace.errortracking._handled_exceptions.bytecode_injector -> ddtrace.errortracking._handled_exceptions.callbacks -> ddtrace.errortracking._handled_exceptions.collector -> ddtrace.errortracking._handled_exceptions.bytecode_reporting -> ddtrace.errortracking._handled_exceptions.bytecode_injector
ddtrace.llmobs -> ddtrace.llmobs._evaluators -> ddtrace.llmobs._evaluators.format -> ddtrace.llmobs._experiment -> ddtrace.llmobs
ddtrace.appsec._asm_request_context -> ddtrace.appsec._iast._iast_request_context_base -> ddtrace.appsec._iast._iast_env -> ddtrace.appsec._iast.reporter -> ddtrace.appsec._exploit_prevention.stack_traces -> ddtrace.appsec._asm_request_context

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 3 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-py | rust ci — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

DataDog/apm-reliability/dd-trace-py | core/internal 6/6

View more details · View in GitLab

DataDog/apm-reliability/dd-trace-py | download_dependency_wheels: [3.15.0rc1, 3.15]

View more details · View in GitLab

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 81124a4 | Docs | View more details | Give us feedback!

@pr-commenter

pr-commenter Bot commented Aug 27, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-30 03:21:29

Comparing candidate commit 81124a4 in PR branch vlad/py315-testrunner-cython-pin with baseline commit c2e9f4f in branch vlad/py315-pyo3-contextvar.

📊 Benchmarking dashboard

Found 0 performance improvements and 6 performance regressions! Performance is the same for 579 metrics, 11 unstable metrics, 3 known flaky benchmarks, 15 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:httppropagationinject-ids_only

  • 🟥 execution_time [+2.489µs; +2.619µs] or [+15.065%; +15.853%]

scenario:iastaspects-add_aspect

  • 🟥 execution_time [+9.791µs; +12.286µs] or [+9.919%; +12.446%]

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+134.958µs; +140.108µs] or [+32.763%; +34.013%]

scenario:iastaspectssplit-rsplit_aspect

  • 🟥 execution_time [+39.426µs; +44.940µs] or [+28.017%; +31.935%]

scenario:telemetryaddmetric-1-count-metric-1-times

  • 🟥 execution_time [+696.064ns; +733.897ns] or [+25.672%; +27.068%]

scenario:tracer-small

  • 🟥 execution_time [+30.281µs; +32.652µs] or [+9.337%; +10.068%]

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:coreapiscenario-context_with_data_listeners

  • unstable execution_time [-738.483ns; +724.330ns] or [-6.732%; +6.603%]

scenario:coreapiscenario-core_dispatch_1_listener

  • unstable execution_time [-39.130ns; +26.925ns] or [-6.356%; +4.374%]

scenario:coreapiscenario-core_dispatch_50_listeners

  • unstable execution_time [-1381.880ns; +1887.488ns] or [-8.237%; +11.250%]

scenario:coreapiscenario-core_dispatch_exception_listeners

  • unstable execution_time [-610.146ns; +1944.294ns] or [-4.743%; +15.115%]

scenario:coreapiscenario-core_dispatch_listeners

  • unstable execution_time [-261.862ns; +383.185ns] or [-7.248%; +10.606%]

scenario:coreapiscenario-core_dispatch_no_args_listeners

  • unstable execution_time [-190.992ns; +314.447ns] or [-6.649%; +10.947%]

scenario:coreapiscenario-core_dispatch_with_results_1_listener

  • unstable execution_time [-76.194ns; +71.982ns] or [-6.442%; +6.086%]

scenario:coreapiscenario-core_dispatch_with_results_50_listeners

  • unstable execution_time [-3936.060ns; +4048.357ns] or [-9.628%; +9.903%]

scenario:coreapiscenario-core_dispatch_with_results_listeners

  • unstable execution_time [-932.163ns; +618.117ns] or [-11.370%; +7.539%]

scenario:flasksimple-appsec-get

  • unstable execution_time [-132.017µs; +392.597µs] or [-3.830%; +11.390%]

scenario:packagesupdateimporteddependencies-import_many_stdlib_cached

  • unstable execution_time [-55.773µs; +61.625µs] or [-8.943%; +9.881%]

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:iastaspects-casefold_noaspect

  • 🟥 execution_time [+65.055µs; +71.731µs] or [+25.985%; +28.652%]

scenario:iastaspects-translate_aspect

  • 🟥 execution_time [+88.319µs; +98.628µs] or [+20.236%; +22.598%]

scenario:span-start

  • 🟥 execution_time [+1.222ms; +1.484ms] or [+8.833%; +10.732%]

Known flaky benchmarks without significant changes:

  • scenario:errortrackingflasksqli-baseline
  • scenario:flasksimple-iast-get
  • scenario:iastaspects-casefold_aspect
  • scenario:iastaspects-index_aspect
  • scenario:iastaspects-ljust_noaspect
  • scenario:iastaspects-lower_aspect
  • scenario:iastaspects-replace_aspect
  • scenario:iastaspects-swapcase_aspect
  • scenario:iastaspects-title_noaspect
  • scenario:iastaspects-translate_noaspect
  • scenario:iastaspects-upper_noaspect
  • scenario:packagespackageforrootmodulemapping-cache_off
  • scenario:packagespackageforrootmodulemapping-cache_on
  • scenario:sethttpmeta-all-enabled
  • scenario:telemetryaddmetric-record-100-metrics

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the GitLab CI build_base_venvs template (.cached_testrunner) to avoid installing Cython 3.3.x into the EXT_CACHE_VENV when running the Python 3.15 arm, because Cython 3.3.0’s cp315 wheel can segfault on pre-rc1 Python 3.15 interpreters. This keeps the base-venv cache bootstrapping stable on 3.15 while leaving 3.9–3.14 behavior unchanged.

Changes:

  • Add a PYTHON_VERSION == 3.15 conditional in .cached_testrunner to install Cython<3.3 only for the 3.15 venv cache.
  • Preserve the existing unpinned Cython install path for Python 3.9–3.14.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@vlad-scherbich
vlad-scherbich force-pushed the vlad/py315-testrunner-rebuild branch from 496f6a1 to 994180a Compare August 28, 2026 14:08
@vlad-scherbich
vlad-scherbich force-pushed the vlad/py315-testrunner-cython-pin branch from 992d101 to d872a18 Compare August 28, 2026 14:08
@vlad-scherbich
vlad-scherbich force-pushed the vlad/py315-testrunner-rebuild branch from 994180a to be14e88 Compare August 28, 2026 14:57
@vlad-scherbich
vlad-scherbich force-pushed the vlad/py315-testrunner-cython-pin branch from d872a18 to 8b2e454 Compare August 28, 2026 14:57
@vlad-scherbich
vlad-scherbich force-pushed the vlad/py315-testrunner-rebuild branch from be14e88 to 45a74e6 Compare August 28, 2026 15:51
@vlad-scherbich
vlad-scherbich force-pushed the vlad/py315-testrunner-cython-pin branch from 8b2e454 to 5785062 Compare August 28, 2026 15:51
@vlad-scherbich
vlad-scherbich force-pushed the vlad/py315-testrunner-rebuild branch from 45a74e6 to cc7c1ae Compare August 28, 2026 16:07
@vlad-scherbich
vlad-scherbich force-pushed the vlad/py315-testrunner-cython-pin branch from 5785062 to 7e222d3 Compare August 28, 2026 16:07
Bump pyenv v2.6.31 to v2.8.4 so a docker/** push to main rebuilds the
testrunner image. The pinned image still has 3.15.0b3+dev (Jun 30),
which rejects rc1-built cp315 wheels.
EXT_CACHE_VENV installs Cython outside pyproject.toml, so PR 19861
does not cover it. Cython 3.3.0 cp315 wheels SIGSEGV on pre-rc1 3.15.
@vlad-scherbich
vlad-scherbich force-pushed the vlad/py315-testrunner-rebuild branch from cc7c1ae to 001ea1e Compare August 28, 2026 18:34
@vlad-scherbich
vlad-scherbich force-pushed the vlad/py315-testrunner-cython-pin branch from 7e222d3 to 639f7b7 Compare August 28, 2026 18:34
@vlad-scherbich vlad-scherbich changed the title ci(testrunner): pin Cython<3.3 on the 3.15 venv cache ci(testrunner): rebuild 3.15-dev and pin Cython<3.3 on the 3.15 cache Aug 28, 2026
@vlad-scherbich
vlad-scherbich changed the base branch from vlad/py315-testrunner-rebuild to vlad/py315-pyo3-contextvar August 28, 2026 19:19
@vlad-scherbich
vlad-scherbich requested a lite review from Copilot August 28, 2026 19:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Drop it once the testrunner 3.15 interpreter is 3.15.0rc1+, when Cython 3.3 cp315 wheels no longer SIGSEGV.
@vlad-scherbich
vlad-scherbich marked this pull request as ready for review August 28, 2026 19:34
@vlad-scherbich
vlad-scherbich requested review from a team as code owners August 28, 2026 19:34
@vlad-scherbich
vlad-scherbich requested review from Yun-Kim and emmettbutler and removed request for a team August 28, 2026 19:34
@vlad-scherbich vlad-scherbich changed the title ci(testrunner): rebuild 3.15-dev and pin Cython<3.3 on the 3.15 cache ci(testrunner): rebuild 3.15-dev and pin Cython<3.3 on the 3.15 cache (PROF-14439) Aug 28, 2026
#19861 only makes cp315 optional in the package validator. Un-prune after
IMAGE_TAG can build a correct wheel, and only once 3.15 is supported.

(cherry picked from commit 703428b)
Monitoring inject_hook already works. The wrap raise tests are skipif
below NEXT and would demand a raise after wrap lift; they do not pin
this PR error-string change.

(cherry picked from commit 08c8693)
The SSI max bump does not need a bandit/mypy skip of lib-injection/.

(cherry picked from commit 0cf5c73)
Lint extra bytecode==0.18.1 on 3.15 is not the runtime dep
bytecode>=0.19.0. Leave both; they are different extras.

(cherry picked from commit 5bd7d37)
Lint extra bytecode==0.18.1 conflicts with runtime bytecode>=0.19.0
when uv resolves extras for requires-python that includes 3.15.

(cherry picked from commit cac61ca)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog A changelog entry is not required for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants