fix: stabilize Hermes external memory tests - #1529
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
馃挕 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 68fbf4699a
鈩癸笍 About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 馃憤.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (externalMemoryDelta === expectedSize) { | ||
| return externalMemoryDelta |
There was a problem hiding this comment.
Reject samples that span garbage collection
When Hermes runs a GC between these snapshots, an exact net delta is still contaminated: the immediately preceding ArrayBuffer test leaves an eligible 1 KiB native buffer, so a new allocation over-reported by 1 KiB could coincide with that buffer's collection and produce the expected delta. Because garbageCollections is only logged, this condition would accept the sample and mask the accounting regression; require both the exact delta and zero intervening collections, otherwise retry.
Useful? React with 馃憤聽/ 馃憥.
Summary
Root cause
The failed iOS ASan job expected a 1 MiB increase but observed 1 MiB minus 1 KiB. The immediately preceding test creates a 1 KiB native ArrayBuffer and releases it. ASan changed timing enough for Hermes to collect that unrelated buffer between the global
js_externalBytessnapshots. This was a test measurement race, not an AddressSanitizer violation or missing Nitro accounting.Validation
bun typecheckbun --cwd example lint-ci