Skip to content

test(codegen): fix typed_array_rmw_8692 PERRY_NATIVE_REPS_DIR race (flaky e2e-scoped) - #11339

Merged
proggeramlug merged 2 commits into
mainfrom
fix/typed-array-rmw-test-env-race
Sep 25, 2026
Merged

proggeramlug merged 2 commits into
mainfrom
fix/typed-array-rmw-test-env-race

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes a flaky test that has been reddening e2e-scoped on unrelated PRs (#11224, #11251, #11253, #11264, #11337 among others):

specialized_uint32_dynamic_index_rmw_has_a_call_free_fast_arm_and_fallback ... FAILED
module compiles: failed to write native reps at /tmp/perry_typed_array_rmw_8692_<pid>_<n>/perry_native_reps_….json
Caused by: No such file or directory

Cause: in crates/perry-codegen/tests/typed_array_rmw_8692.rs, compile_artifact() holds artifact_env_lock() while it points the process-global PERRY_NATIVE_REPS_DIR at a temp dir that it deletes on drop. compile_ir() took no lock, so a compile running in parallel could write its native-reps record into another test's dir just as that dir was removed.

Fix: compile_ir() takes the same lock. Test-only change. The file passed 5/5 consecutive runs locally.

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability when compiling multiple modules concurrently. Intermittent missing-file errors caused by overlapping compilation activity are now avoided, helping builds and related test workflows complete more consistently. This change affects compilation reliability without changing the behavior or output of successfully compiled modules.

Ralph Küpper added 2 commits September 25, 2026 19:38
…artifact compiles

compile_artifact() holds artifact_env_lock() while it points the process-global
PERRY_NATIVE_REPS_DIR at a temp dir that it deletes on drop. compile_ir() took no
lock, so a parallel compile could write its native-reps record into that dir as
it was removed: 'module compiles: failed to write native reps at
/tmp/perry_typed_array_rmw_8692_…: No such file or directory'. That failure
reddened e2e-scoped on many unrelated PRs. Take the same lock in compile_ir().
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 96579aee-960f-4ee2-9f4a-36c5bb453156

📥 Commits

Reviewing files that changed from the base of the PR and between 50e182a and ad286ad.

📒 Files selected for processing (2)
  • changelog.d/11339-typed-array-rmw-test-env-race.md
  • crates/perry-codegen/tests/typed_array_rmw_8692.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The typed-array test now acquires artifact_env_lock() during compile_ir(). The changelog describes a race involving concurrent writes to the process-global native-representations directory.

Changes

Typed-array test compilation

Layer / File(s) Summary
Lock IR compilation
crates/perry-codegen/tests/typed_array_rmw_8692.rs, changelog.d/11339-typed-array-rmw-test-env-race.md
compile_ir() now holds artifact_env_lock() during compilation. The changelog describes the race this change addresses.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to ad286

The reported compilation race is addressed, and the changelog’s omitted validation detail has no demonstrated operational impact.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the codegen test fix and the PERRY_NATIVE_REPS_DIR race. It is concise and related to the main change.
Description check ✅ Passed The description clearly explains the flaky test, failure cause, fix, scope, related issues, and local validation. It does not use the template headings or include the checklist, but the critical infor…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug
proggeramlug merged commit d97339f into main Sep 25, 2026
53 of 55 checks passed
@proggeramlug
proggeramlug deleted the fix/typed-array-rmw-test-env-race branch September 25, 2026 19:02
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