Skip to content

Skip test_highly_nested_objects_decoding during the PGO profile task.#151460

Open
gpshead wants to merge 1 commit into
python:mainfrom
gpshead:json-pgo-nesting-build-nerf
Open

Skip test_highly_nested_objects_decoding during the PGO profile task.#151460
gpshead wants to merge 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review 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 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