feat(python): add stack-advanced gate scenarios for 3.14/3.15 (PROF-15511) - #171
Conversation
c8d1687 to
551bc6b
Compare
ac2451e to
7c1ccac
Compare
551bc6b to
c486a46
Compare
7c1ccac to
eccfe2a
Compare
c486a46 to
ea82843
Compare
eccfe2a to
2bd7cb6
Compare
ea82843 to
4c68fa7
Compare
2bd7cb6 to
ecce3c0
Compare
4c68fa7 to
fc29e5a
Compare
ecce3c0 to
e6cda80
Compare
fc29e5a to
f59c64e
Compare
e6cda80 to
487a0c5
Compare
f59c64e to
43654d5
Compare
487a0c5 to
8278b7d
Compare
43654d5 to
bb334c5
Compare
0eef449 to
4762625
Compare
86ac60a to
7773030
Compare
4762625 to
70fe079
Compare
7773030 to
74afe9d
Compare
70fe079 to
4b7d147
Compare
74afe9d to
62a75c4
Compare
4b7d147 to
bd38b6a
Compare
62a75c4 to
cb6eff5
Compare
049c680 to
f933f01
Compare
c7de3d5 to
6b3751e
Compare
f933f01 to
44cdbbf
Compare
6b3751e to
b3bfcec
Compare
44cdbbf to
9e24148
Compare
b3bfcec to
3d96d17
Compare
9e24148 to
1784656
Compare
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.
There was a problem hiding this comment.
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, andpython_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.
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).
There was a problem hiding this comment.
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.
Align asyncio task-duration comments with EXECUTION_TIME_SEC and clarify native_cpu shared-data comment (single process, no workers).
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.
Prev: #169 (merged) | Next: #172 | Base:
mainSummary
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.15symlinkexpected_profile.json, real Dockerfiles (3.14 PyPI / 3.15 wheel-only). Alloc 3.15 uses separateprofile_3.15.json.3.14 burn-in (CI 32796204349)
3.15
All BLOCKED until manylinux cp315 wheel (
DDTRACE_INSTALL_URL). Alloc 3.15 profile not re-burned-in.Test plan