Skip to content

test(ast/estree): check span offsets are converted in ascending order in ESTree conformance tests#10887

Merged
graphite-app[bot] merged 1 commit intomainfrom
05-08-refactor_ast_estree_add_debug_assertions_for_span_offset_conversion_visitation_order
May 14, 2025
Merged

test(ast/estree): check span offsets are converted in ascending order in ESTree conformance tests#10887
graphite-app[bot] merged 1 commit intomainfrom
05-08-refactor_ast_estree_add_debug_assertions_for_span_offset_conversion_visitation_order

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented May 8, 2025

Add a Cargo feature conformance to oxc_ast_visit crate.

When this feature is enabled, it exposes a method Utf8ToUtf16::convert_program_with_ascending_order_checks which panics if span offsets are converted out of order.

Use this feature and method in ESTree conformance tests. This ensures:

  1. Utf8ToUtf16Converter visitor is functioning as intended.
  2. All AST types have their fields ordered in order they appear in source code.

Copy link
Member Author

overlookmotel commented May 8, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added A-parser Area - Parser C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels May 8, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented May 8, 2025

CodSpeed Instrumentation Performance Report

Merging #10887 will create unknown performance changes

Comparing 05-08-refactor_ast_estree_add_debug_assertions_for_span_offset_conversion_visitation_order (a05361e) with main (282420c)

Summary

🆕 36 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 codegen[checker.ts] N/A 22.8 ms N/A
🆕 codegen_sourcemap[checker.ts] N/A 67 ms N/A
🆕 formatter[antd.js] N/A 715.9 ms N/A
🆕 formatter[react.development.js] N/A 8.1 ms N/A
🆕 formatter[typescript.js] N/A 1.1 s N/A
🆕 isolated-declarations[vue-id.ts] N/A 58.5 ms N/A
🆕 lexer[RadixUIAdoptionSection.jsx] N/A 21.7 µs N/A
🆕 lexer[antd.js] N/A 25 ms N/A
🆕 lexer[cal.com.tsx] N/A 6.1 ms N/A
🆕 lexer[checker.ts] N/A 14.9 ms N/A
🆕 lexer[pdf.mjs] N/A 4 ms N/A
🆕 linter[RadixUIAdoptionSection.jsx] N/A 2.8 ms N/A
🆕 linter[cal.com.tsx] N/A 1.2 s N/A
🆕 linter[checker.ts] N/A 3.1 s N/A
🆕 mangler[antd.js] N/A 16 ms N/A
🆕 mangler[react.development.js] N/A 294.1 µs N/A
🆕 mangler[typescript.js] N/A 39.6 ms N/A
🆕 minifier[antd.js] N/A 164.4 ms N/A
🆕 minifier[react.development.js] N/A 1.8 ms N/A
🆕 minifier[typescript.js] N/A 288.8 ms N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@overlookmotel overlookmotel force-pushed the 05-08-refactor_ast_estree_add_debug_assertions_for_span_offset_conversion_visitation_order branch from 022f50c to a71fdce Compare May 8, 2025 11:05
@overlookmotel overlookmotel changed the base branch from main to graphite-base/10887 May 13, 2025 11:28
@overlookmotel overlookmotel force-pushed the 05-08-refactor_ast_estree_add_debug_assertions_for_span_offset_conversion_visitation_order branch from a71fdce to a7b64c9 Compare May 13, 2025 11:28
@overlookmotel overlookmotel changed the base branch from graphite-base/10887 to 05-12-fix_ast_visit_fix_visitation_order_for_bindingpattern_in_utf8toutf16converter_ May 13, 2025 11:28
@github-actions github-actions bot added the A-ast-tools Area - AST tools label May 13, 2025
@overlookmotel overlookmotel changed the base branch from 05-12-fix_ast_visit_fix_visitation_order_for_bindingpattern_in_utf8toutf16converter_ to graphite-base/10887 May 13, 2025 14:23
@overlookmotel overlookmotel force-pushed the 05-08-refactor_ast_estree_add_debug_assertions_for_span_offset_conversion_visitation_order branch from 9b30a40 to e1bc381 Compare May 13, 2025 14:23
@overlookmotel overlookmotel force-pushed the graphite-base/10887 branch from 8133e5e to 35caa35 Compare May 13, 2025 14:23
@overlookmotel overlookmotel changed the base branch from graphite-base/10887 to 05-13-fix_ast_visit_fix_visitation_order_for_tstemplateliteraltype_in_utf8toutf16converter_ May 13, 2025 14:23
@overlookmotel overlookmotel changed the base branch from 05-13-fix_ast_visit_fix_visitation_order_for_tstemplateliteraltype_in_utf8toutf16converter_ to graphite-base/10887 May 13, 2025 17:09
@overlookmotel overlookmotel force-pushed the graphite-base/10887 branch from 35caa35 to cc8948c Compare May 13, 2025 17:09
@overlookmotel overlookmotel force-pushed the 05-08-refactor_ast_estree_add_debug_assertions_for_span_offset_conversion_visitation_order branch from e1bc381 to 5154db5 Compare May 13, 2025 17:09
@overlookmotel overlookmotel changed the base branch from graphite-base/10887 to 05-13-fix_ast_visit_fix_visitation_order_for_formalparameters_in_utf8toutf16converter_ May 13, 2025 17:10
@overlookmotel overlookmotel changed the title refactor(ast/estree): add debug assertions for span offset conversion visitation order test(ast/estree): check span offsets are converted in ascending order in ESTree conformance tests May 13, 2025
@github-actions github-actions bot added the C-test Category - Testing. Code is missing test cases, or a PR is adding them label May 13, 2025
@overlookmotel overlookmotel marked this pull request as ready for review May 13, 2025 17:26
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label May 14, 2025
Copy link
Member

Boshen commented May 14, 2025

Merge activity

… in ESTree conformance tests (#10887)

Add a Cargo feature `conformance` to `oxc_ast_visit` crate.

When this feature is enabled, it exposes a method `Utf8ToUtf16::convert_program_with_ascending_order_checks` which panics if span offsets are converted out of order.

Use this feature and method in ESTree conformance tests. This ensures:

1. `Utf8ToUtf16Converter` visitor is functioning as intended.
2. All AST types have their fields ordered in order they appear in source code.
@graphite-app graphite-app bot force-pushed the 05-13-fix_ast_visit_fix_visitation_order_for_formalparameters_in_utf8toutf16converter_ branch from cc8948c to 2bdb338 Compare May 14, 2025 01:24
@graphite-app graphite-app bot force-pushed the 05-08-refactor_ast_estree_add_debug_assertions_for_span_offset_conversion_visitation_order branch from 5154db5 to a05361e Compare May 14, 2025 01:24
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label May 14, 2025
Base automatically changed from 05-13-fix_ast_visit_fix_visitation_order_for_formalparameters_in_utf8toutf16converter_ to main May 14, 2025 01:31
@graphite-app graphite-app bot merged commit a05361e into main May 14, 2025
27 checks passed
@graphite-app graphite-app bot deleted the 05-08-refactor_ast_estree_add_debug_assertions_for_span_offset_conversion_visitation_order branch May 14, 2025 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast-tools Area - AST tools A-parser Area - Parser C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior C-test Category - Testing. Code is missing test cases, or a PR is adding them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants