Skip to content

test: allow the fixed cost of copying a Vue component's data in the frame budget - #436

Merged
JuroOravec merged 1 commit into
mainfrom
fix/frame-budget-json-direct
Oct 27, 2026
Merged

JuroOravec merged 1 commit into
mainfrom
fix/frame-budget-json-direct

Conversation

@JuroOravec

Copy link
Copy Markdown
Member

Fixes the frame-budget failure on main's Linux 3.11 job (run 40502014569): test_frame_budget_rust.py reported {'every_shorthand[vue]': (128, 34, 80)}.

Why it failed

The frames do not grow with depth; the test compared two depths that straddle a fixed cost. Since #391, the data a Vue component sends the browser is copied with direct calls for its first 32 levels (_DIRECT_JSON_DEPTH in citry/_vue/json_data.py), and with a loop below that. The every_shorthand fixture's data only gets that deep between depth 128, where the test takes its comparison for Vue, and the limit of 256. On 3.11 each directly copied level is two frames, because a comprehension runs in a frame of its own there, so the stack grew by 46 frames against the 20 allowed. On 3.12 and later it is one frame per level, which stayed within 20.

I confirmed it on 3.14 by capturing the deepest stack: at 256 it holds 33 _json_plain frames, and none at 128.

The fix

With Vue, the test now also allows VUE_DIRECT_JSON_FRAMES: _DIRECT_JSON_DEPTH frames, or twice that on 3.11. The number comes from the code's own constant, so it stays right if that changes. Moving the comparison depth would not work: at 192 the fixture's data is still not deep enough on 3.14 (36 frames at 192, 51 at 256).

Checks

  • test_frame_budget_rust.py passes locally on 3.14 (every_shorthand[vue]: 36 at 128, 48 at 256).
  • Not run locally on 3.11 (no 3.11 build here). The CI numbers fit: 80 − 34 = 46 frames, within the new allowance of 20 + 64.
  • The other failures in that run (test_deep_json_data.py on 3.11, and test_citry_ui_type_check.py) are unrelated to this test.

🤖 Generated with Claude Code

…rame budget

The frame budget test failed on Python 3.11 for every_shorthand with Vue:
80 frames at 256 against 34 at 128. The data a Vue component sends the
browser is copied with direct calls for its first 32 levels
(_DIRECT_JSON_DEPTH in _vue/json_data.py) and with a loop below that, a
fixed cost. This fixture's data only gets that deep between depth 128 and
256, so the cost shows between the two depths the test compares. On 3.11
each of those levels is two frames, because a comprehension runs in a
frame of its own there, so the growth was 46 frames against the 20
allowed. With Vue, the test now also allows that named cost.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JuroOravec
JuroOravec merged commit 38a1526 into main Oct 27, 2026
14 of 28 checks passed
@JuroOravec
JuroOravec deleted the fix/frame-budget-json-direct branch October 27, 2026 13:23
JuroOravec added a commit that referenced this pull request Oct 28, 2026
A PR merged while its checks were still queued kept those runs, and
they ran in full after the merge: about 300 to 400 job-minutes each for
#430, #435, #436 and #437, while the merge's own run on main tested the
same change again. Every check workflow that runs on pull requests now
also starts on the PR's `closed` event. That run joins the PR's
concurrency group, whose cancel-in-progress cancels the PR's queued and
running checks, and every job skips on that event, so the cancelling run
itself needs no runner.

The notification and relock workflows are left out because they run no
checks. A test checks each check workflow's trigger types and that every
job that can start a run skips on `closed`.

This is step 1 of the #405 proposal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant