Skip to content

Skip test_highly_nested_objects_decoding during the PGO profile task.#151460

Merged
gpshead merged 1 commit into
python:mainfrom
gpshead:json-pgo-nesting-build-nerf
Jun 14, 2026
Merged

Skip test_highly_nested_objects_decoding during the PGO profile task.#151460
gpshead merged 1 commit into
python:mainfrom
gpshead:json-pgo-nesting-build-nerf

Conversation

@gpshead

@gpshead gpshead commented Jun 14, 2026

Copy link
Copy Markdown
Member

One line change to disable test_json.test_highly_nested_objects_decoding during PGO training.

Since the recursion guard tracks real C-stack bounds (gh-91079), this test asserts that 500k nesting levels overflow the stack margin. On a 64 MiB stack (some Nix build envs use one that large), the optimized interpreter uses ~160 bytes/level (raises at ~420k levels) so the assertion holds with only ~16% margin; the PGO instrumented stage inlines less, its per-level scanner frames are smaller, and the 500k-deep decode completes -- "RecursionError not raised" fails the profile run and aborts make profile-opt. Upstream's skip_if_unlimited_stack_size (gh-143460) only covers RLIM_INFINITY, not large-finite stacks like ours.

We could also keep playing whack a mole and raise the 500k to a much larger number... but there's little value in PGO training on this test anyways.

Since the recursion guard tracks real C-stack bounds (pythongh-91079), this test
asserts that 500k nesting levels overflow the stack margin. On a 64 MiB stack
(some Nix build envs use one that large), the optimized interpreter uses ~160
bytes/level (raises at ~420k levels) so the assertion holds with only ~16%
margin; the PGO *instrumented* stage inlines less, its per-level scanner frames
are smaller, and the 500k-deep decode completes -- "RecursionError not raised"
fails the profile run and aborts `make profile-opt`. Upstream's
skip_if_unlimited_stack_size (pythongh-143460) only covers RLIM_INFINITY, not
large-finite stacks like ours.

We could also keep playing whack a mole and raise the 500k to a much larger
number... but there's little value in PGO training on this test anyways.
@gpshead gpshead self-assigned this Jun 14, 2026
@gpshead gpshead added tests Tests in the Lib/test dir skip issue build The build process and cross-build needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jun 14, 2026
@gpshead gpshead enabled auto-merge (squash) June 14, 2026 00:53
@gpshead gpshead merged commit e91f68a into python:main Jun 14, 2026
140 of 144 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @gpshead for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jun 14, 2026

Copy link
Copy Markdown

GH-151468 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jun 14, 2026
@bedevere-app

bedevere-app Bot commented Jun 14, 2026

Copy link
Copy Markdown

GH-151469 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build The build process and cross-build skip issue skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant