Skip to content

feat(fuzz): add structural reduction - #1195

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:feat/fuzz-reduce-1019
Oct 7, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:feat/fuzz-reduce-1019

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

Character-only minimization can leave unrelated HTML elements or CSS declarations in saved findings. This adds subtree and attribute deletion for HTML, declaration deletion within parsed CSS rules, and JavaScript AST reduction for #1019.

The JavaScript reducer forks the pinned UglifyJS reducer with UglifyJS 3.19.3 and checks candidates through the original finding predicate. CSS reduction uses tinycss2 1.5.1 block parsing. Structural and character reduction share the 600-comparison limit across JSON fields. MSan and operation-VM TSan remain requirements for completing #1019.

Character deletion can leave unrelated language constructs in saved
findings. Use DOM subtree and attribute deletion, parsed CSS declarations
and a pinned UglifyJS AST fork before character reduction.

Keep the original finding predicate and share the 600-comparison limit
across structural reduction and separate JSON fields.

Refs tox-dev#1019
@gaborbernat gaborbernat added the enhancement New feature or request label Oct 7, 2026
@codspeed

codspeed Bot commented Oct 7, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 6.2%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 5 regressed benchmarks
✅ 576 untouched benchmarks
⏩ 32 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ test_feature[prune-shared-single] 88.7 µs 96.1 µs -7.7%
❌ test_feature[text-content] 2.6 ms 2.8 ms -6.21%
❌ test_feature[select-relative-sibling] 42.6 µs 45.3 µs -6.1%
❌ test_feature[serialize-inner] 5.1 ms 5.4 ms -5.64%
❌ test_feature[serialize-inner-indent] 5.5 ms 5.9 ms -5.32%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing gaborbernat:feat/fuzz-reduce-1019 (e7a31c3) with main (59b515e)

Open in CodSpeed

Footnotes

  1. 32 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@gaborbernat
gaborbernat merged commit 83bd497 into tox-dev:main Oct 7, 2026
55 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant