Skip to content

test(memory): the adversarial-screen budget clears the slowest CI runner (#4113) - #4116

Merged
vybe merged 1 commit into
devfrom
fix/4113-ent419-screen-budget
Oct 30, 2026
Merged

vybe merged 1 commit into
devfrom
fix/4113-ent419-screen-budget

Conversation

@trinity-ability

Copy link
Copy Markdown
Contributor

Refs #4113. That issue closes itself on the next green dev-ci, so this PR carries no closing keyword.

Why dev is red

backend-unit-test has failed on every completed dev run since d2e30d8de, always on one test: test_the_screen_is_bounded_on_adversarial_input[0], 2.04–2.16s against a 2.0s limit.

No commit caused it, so there is nothing to revert:

  • user_memory_guard.py and its local dependency did not change across the boundary.
  • The guard is linear on this input: 0.05s, 0.10s, 0.20s and 0.39s at 1k, 2k, 4k and 8k characters. ﷺ expands to 18 characters under NFKC, so the 8k input becomes 144k.
  • Across 36 unit runs on 2026-10-30 the timing falls into discrete clusters of about 0.9–1.1s, 1.4s, 1.75s and 2.05s, which track the runner rather than the code. A run without the suspect commits hit 2.053s (feature/3618 at 12:47), and runs with them hit 0.893s and 1.077s (fix/4058 and fix/4055 at 13:56).

Five dev pushes in a row landing on the slow cluster made this look like a regression. The same-hour re-run of the last green SHA passed at 1.58s and the tip failed at 2.055s, which fits runner variation but does not prove it alone; the cluster data above is the evidence.

The change

One assertion goes from 2.0s to 10.0s. That is about 5× the slowest runner's cost.

  • Still caught: an exponential regex on any input, and a quadratic on the 144k expanded input (extrapolated at about 26s from a measured quadratic regex on 8k plain text).
  • Not caught, before or after: a quadratic on 8k plain text, which costs about 0.08s.

Verification

pytest unit/test_ent419_memory_poisoning_gates.py -k screen_is_bounded -p no:randomly: 16 passed locally. The real proof is the next dev-ci run on a slow runner.

🤖 Generated with Claude Code

…ner (#4113)

test_the_screen_is_bounded_on_adversarial_input[0] asserted 2.0s of wall
clock. Its cost is linear, and across 36 unit runs on 2026-10-30 it fell into
discrete clusters by runner (about 0.9s, 1.4s, 1.75s and 2.05s) regardless of
the code under test, so the slowest cluster failed it and held dev-ci red.

10s stays far below what a quadratic screen costs on the 144k NFKC-expanded
input, and an exponential regex still fails on any input.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

merge-train Phase 0a: test-only budget fix for the #4113 red; Tier 1 green. Merges alone.

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.

2 participants