Skip to content

feat(python): add stack-advanced gate scenarios for 3.14/3.15 (PROF-15511) - #171

Merged
vlad-scherbich merged 19 commits into
mainfrom
vlad/python-stack-advanced-gate
Aug 25, 2026
Merged

feat(python): add stack-advanced gate scenarios for 3.14/3.15 (PROF-15511)#171
vlad-scherbich merged 19 commits into
mainfrom
vlad/python-stack-advanced-gate

Conversation

@vlad-scherbich

@vlad-scherbich vlad-scherbich commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Prev: #169 (merged) | Next: #172 | Base: main

Summary

Adds 4 families × 2 versions (8 dirs): alloc, asyncio, native_cpu, deep_stack.

Layout: canonical scenarios/python_{family}/ (main.py, profile.json); *_3.14/*_3.15 symlink expected_profile.json, real Dockerfiles (3.14 PyPI / 3.15 wheel-only). Alloc 3.15 uses separate profile_3.15.json.

3.14 burn-in (CI 32796204349)

Scenario Expected (±margin) Observed
alloc samples/space 32/43/29/39 ±5 32–35 / 42–44 / 29 / 39
asyncio wall-time 30/61 ±5 30–31 / 61
native_cpu (×5, cpu+wall) 20 ±5 each ~19–21%
deep_stack cpu-time 99 ±5 98–99%

3.15

All BLOCKED until manylinux cp315 wheel (DDTRACE_INSTALL_URL). Alloc 3.15 profile not re-burned-in.

Test plan

  • Schema validation; 3.14 scenarios PASS (burn-in above)
  • 3.15 + downstream gate when wheel lands
  • CI green on branch tip

@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from c8d1687 to 551bc6b Compare July 27, 2026 19:20
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-stack-advanced-gate branch from ac2451e to 7c1ccac Compare July 27, 2026 19:20
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from 551bc6b to c486a46 Compare July 27, 2026 19:33
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-stack-advanced-gate branch from 7c1ccac to eccfe2a Compare July 27, 2026 19:33
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from c486a46 to ea82843 Compare July 27, 2026 19:38
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-stack-advanced-gate branch from eccfe2a to 2bd7cb6 Compare July 27, 2026 19:38
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from ea82843 to 4c68fa7 Compare July 27, 2026 21:41
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-stack-advanced-gate branch from 2bd7cb6 to ecce3c0 Compare July 27, 2026 21:41
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from 4c68fa7 to fc29e5a Compare July 27, 2026 21:45
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-stack-advanced-gate branch from ecce3c0 to e6cda80 Compare July 27, 2026 21:45
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from fc29e5a to f59c64e Compare July 27, 2026 22:01
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-stack-advanced-gate branch from e6cda80 to 487a0c5 Compare July 27, 2026 22:01
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from f59c64e to 43654d5 Compare July 27, 2026 22:05
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-stack-advanced-gate branch from 487a0c5 to 8278b7d Compare July 27, 2026 22:05
@vlad-scherbich vlad-scherbich changed the title feat(python): add stack-advanced gate scenarios for 3.14/3.15 feat(python): add stack-advanced gate scenarios for 3.14/3.15 (PROF-15511) Jul 27, 2026
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from 43654d5 to bb334c5 Compare July 27, 2026 22:29
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-stack-advanced-gate branch 2 times, most recently from 0eef449 to 4762625 Compare July 28, 2026 02:02
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from 86ac60a to 7773030 Compare July 28, 2026 02:38
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-stack-advanced-gate branch from 4762625 to 70fe079 Compare July 28, 2026 02:38
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from 7773030 to 74afe9d Compare August 16, 2026 13:43
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-stack-advanced-gate branch from 70fe079 to 4b7d147 Compare August 16, 2026 13:43
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from 74afe9d to 62a75c4 Compare August 16, 2026 20:14
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-stack-advanced-gate branch from 4b7d147 to bd38b6a Compare August 16, 2026 20:14
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from 62a75c4 to cb6eff5 Compare August 16, 2026 20:21
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from 049c680 to f933f01 Compare August 22, 2026 07:41
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-stack-advanced-gate branch from c7de3d5 to 6b3751e Compare August 22, 2026 07:41
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from f933f01 to 44cdbbf Compare August 24, 2026 11:42
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-stack-advanced-gate branch from 6b3751e to b3bfcec Compare August 24, 2026 11:42
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from 44cdbbf to 9e24148 Compare August 24, 2026 16:39
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-stack-advanced-gate branch from b3bfcec to 3d96d17 Compare August 24, 2026 16:39
@vlad-scherbich
vlad-scherbich force-pushed the vlad/python-alloc-gate-scenarios branch from 9e24148 to 1784656 Compare August 24, 2026 17:55
Add paired python_alloc scenarios asserting alloc-space and alloc-samples
with thread-name labels, reusing the python_basic_memory workload. Gate
grows from 12 to 14 scenarios.
Python 3.14 alloc profiles use Target.method stack frames and numeric thread
IDs, so drop MainThread label assertions and update stack regexes.
Match live-heap gate brevity: compact downstream README table,
one-liner alloc/cpu scenario READMEs.
Add paired asyncio (task name labels), native_cpu (C-extension frames),
and deep_stack (deep unwinding) scenarios. Gate grows from 14 to 20.
Match live-heap gate brevity: compact downstream README table,
one-liner scenario READMEs.
Re-baseline alloc, asyncio, native_cpu, and deep_stack expectations from
local runs and green CI run 32796204349 using observed ±5–10 pp margins.
Align stack-advanced gate READMEs with canonical workload paths,
profile.json burn-in margins, and 3.15 profile_3.15.json expectations.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds new Python 3.14/3.15 “stack-advanced” gate scenario families to broaden downstream profiling correctness coverage (alloc, asyncio task labels, native CPU attribution, deep recursive stacks), and updates downstream-gate documentation to include them.

Changes:

  • Introduce canonical scenario implementations + profiles for python_alloc, python_asyncio, python_native_cpu, and python_deep_stack.
  • Add 3.14 (PyPI install) and 3.15 (wheel-only) scenario wrappers with per-version Dockerfiles/READMEs.
  • Expand the documented downstream gate default regexp and scenario set to include the new families.

Reviewed changes

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

Show a summary per file
File Description
scenarios/python_native_cpu/profile.json Adds cpu-time and wall-time stack expectations for native CPU attribution workload.
scenarios/python_native_cpu/main.py Implements native-CPU workload calling C-extension-heavy stdlib functions.
scenarios/python_native_cpu_3.15/README.md Documents 3.15 wheel-only run instructions for native-cpu scenario.
scenarios/python_native_cpu_3.15/Dockerfile Defines wheel-only 3.15 image for native-cpu scenario.
scenarios/python_native_cpu_3.14/README.md Documents 3.14 baseline expectations and local run instructions for native-cpu scenario.
scenarios/python_native_cpu_3.14/Dockerfile Defines 3.14 image installing requirements for native-cpu scenario.
scenarios/python_deep_stack/profile.json Adds cpu-time expectation for deep recursive stack + omitted-frames marker.
scenarios/python_deep_stack/main.py Implements deep recursive stack workload to exercise stack truncation/omission behavior.
scenarios/python_deep_stack_3.15/README.md Documents 3.15 wheel-only run instructions for deep-stack scenario.
scenarios/python_deep_stack_3.15/Dockerfile Defines wheel-only 3.15 image for deep-stack scenario.
scenarios/python_deep_stack_3.14/README.md Documents 3.14 baseline expectations and local run instructions for deep-stack scenario.
scenarios/python_deep_stack_3.14/Dockerfile Defines 3.14 image installing requirements for deep-stack scenario.
scenarios/python_asyncio/profile.json Adds wall-time expectations with thread/task-name labels for asyncio tasks.
scenarios/python_asyncio/main.py Implements asyncio task workload with named and unnamed tasks.
scenarios/python_asyncio_3.15/README.md Documents 3.15 wheel-only run instructions for asyncio-labels scenario.
scenarios/python_asyncio_3.15/Dockerfile Defines wheel-only 3.15 image for asyncio-labels scenario (ddtrace-run).
scenarios/python_asyncio_3.14/README.md Documents 3.14 baseline expectations and local run instructions for asyncio-labels scenario.
scenarios/python_asyncio_3.14/Dockerfile Defines 3.14 image installing requirements for asyncio-labels scenario (ddtrace-run).
scenarios/python_alloc/profile.json Adds alloc-samples and alloc-space expectations for 3.14 baseline alloc scenario.
scenarios/python_alloc/profile_3.15.json Adds separate 3.15 alloc expectations (stack formatting + labels differ).
scenarios/python_alloc/main.py Implements allocation workload with two allocation sites (1:3 byte ratio).
scenarios/python_alloc_3.15/README.md Documents 3.15 wheel-only expectations and run instructions for alloc scenario.
scenarios/python_alloc_3.15/Dockerfile Defines wheel-only 3.15 image for alloc scenario (stack/lock collectors off).
scenarios/python_alloc_3.14/README.md Documents 3.14 baseline expectations and local run instructions for alloc scenario.
scenarios/python_alloc_3.14/Dockerfile Defines 3.14 image installing requirements for alloc scenario (stack/lock collectors off).
scenarios/python_downstream_gate/README.md Updates downstream gate docs/default regexp to include new scenario families.
README.md Updates downstream workflow input docs for the expanded migration gate.

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

Comment thread scenarios/python_asyncio/main.py Outdated
Comment thread README.md Outdated
The typing refactor added a main() entrypoint, shifting alloc stacks from
<module>;Target.run to <module>;main;Target.run. Use .* like cpu_gate.
Correct asyncio comment grammar and update root README migration gate
count to 18 scenarios (9 families × 2 versions).

Copilot AI left a comment

Copy link
Copy Markdown

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 39 out of 39 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

scenarios/python_native_cpu/main.py:14

  • This comment says the data is "shared across workers", but this scenario runs in a single process/thread (no workers are created). Clarifying this avoids confusion when interpreting the scenario’s intent.

Comment thread scenarios/python_asyncio/main.py Outdated
Align asyncio task-duration comments with EXECUTION_TIME_SEC and clarify
native_cpu shared-data comment (single process, no workers).
Comment thread scenarios/python_alloc/main.py
Replace implicit memory[-1] gate with index-based bounds check and
document the two-site 1:3 byte ratio intent for profile attribution.
Replace while index < len with for _ in range(len // 2) so two-allocs-
per-iteration is explicit and OOB-safe without relying on even capacity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants