Skip to content

test(allocator): improve unit tests for Arena::try_alloc_layout_fast#23256

Merged
graphite-app[bot] merged 1 commit into
mainfrom
om/06-10-test_allocator_improve_unit_tests_for_arena_try_alloc_layout_fast_
Jun 11, 2026
Merged

test(allocator): improve unit tests for Arena::try_alloc_layout_fast#23256
graphite-app[bot] merged 1 commit into
mainfrom
om/06-10-test_allocator_improve_unit_tests_for_arena_try_alloc_layout_fast_

Conversation

@overlookmotel

@overlookmotel overlookmotel commented Jun 10, 2026

Copy link
Copy Markdown
Member

Improve the unit tests for Arena::try_alloc_layout_fast (which purely does maths, no actual allocations).

  1. Add more assertions that ensure test cases are correct.
  2. Remove integer to pointer casts which Miri rejects under strict provenance rules.

The latter enables running Miri with strict provenance enabled (#23258).

@github-actions github-actions Bot added the A-allocator Area - Allocator label Jun 10, 2026

overlookmotel commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

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 changes, fast-track this PR to the front of the merge queue

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.

Copilot AI 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.

Pull request overview

Improves the oxc_allocator unit tests for Arena::try_alloc_layout_fast by strengthening test-case invariants and updating fake-pointer construction to be compatible with Miri’s strict provenance mode.

Changes:

  • Add additional assertions in TestArena::new to validate test inputs (e.g., non-zero start and cursor alignment to MIN_ALIGN).
  • Replace integer-to-pointer casts with std::ptr::without_provenance_mut to satisfy strict provenance requirements.

Comment thread crates/oxc_allocator/src/arena/tests_alloc.rs
@codspeed-hq

codspeed-hq Bot commented Jun 10, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 9 skipped benchmarks1


Comparing om/06-10-test_allocator_improve_unit_tests_for_arena_try_alloc_layout_fast_ (db17dc0) with main (127fb2c)

Open in CodSpeed

Footnotes

  1. 9 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.

@overlookmotel overlookmotel self-assigned this Jun 10, 2026
@overlookmotel overlookmotel added the C-test Category - Testing. Code is missing test cases, or a PR is adding them label Jun 10, 2026
@graphite-app graphite-app Bot added the 0-merge Merge with Graphite Merge Queue label Jun 11, 2026
@graphite-app

graphite-app Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Merge activity

#23256)

Improve the unit tests for `Arena::try_alloc_layout_fast` (which purely does maths, no actual allocations).

1. Add more assertions that ensure test cases are correct.
2. Remove integer to pointer casts which Miri rejects under strict provenance rules.

The latter enables running Miri with strict provenance enabled (#23258).
@graphite-app graphite-app Bot force-pushed the om/06-10-test_allocator_improve_unit_tests_for_arena_try_alloc_layout_fast_ branch from db17dc0 to d32b622 Compare June 11, 2026 00:16
@graphite-app graphite-app Bot merged commit d32b622 into main Jun 11, 2026
31 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jun 11, 2026
@graphite-app graphite-app Bot deleted the om/06-10-test_allocator_improve_unit_tests_for_arena_try_alloc_layout_fast_ branch June 11, 2026 00:21
camc314 pushed a commit that referenced this pull request Jul 3, 2026
#23256)

Improve the unit tests for `Arena::try_alloc_layout_fast` (which purely does maths, no actual allocations).

1. Add more assertions that ensure test cases are correct.
2. Remove integer to pointer casts which Miri rejects under strict provenance rules.

The latter enables running Miri with strict provenance enabled (#23258).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-allocator Area - Allocator 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