镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

ABI fixture: make shared-memfd test reliable under parallel build load #379

Closed

Description

@chrisbbreuer

Parent: #163
Related: #376
Roadmap: #134

A combined Home/Bun build linked every focused private-ABI fixture against the single library selected by -Dprivate-abi-consumer. With bun selected, the Home fixture passed Home's pinned ArrayBuffer and Uint8Array tags (48 and 50) to a Bun-tagged library. ArrayBuffer__fromSharedMemfd correctly rejected that profile mismatch as an empty value, which the fixture only reported later as shared memfd ArrayBuffer pointer lookup failed.

The installed/importable zig-js library still follows the requested consumer profile. Focused Home and Bun fixtures now link profile-specific libraries, so mixed invocations are hermetic in either direction. The dedicated gate runs two Home value fixtures and two Bun FetchHeaders fixtures concurrently.

Reproduction covered:

zig build test-private-abi-mixed-profiles -Dprivate-abi-consumer=bun
zig build test-private-abi-mixed-profiles -Dprivate-abi-consumer=bun -Doptimize=ReleaseSafe
zig build test-private-abi-mixed-profiles -Dprivate-abi-consumer=home

Acceptance:

  • Identify whether descriptor sizing, mmap, allocation pressure, or build-run concurrency makes ArrayBuffer__fromSharedMemfd return an empty value. It was none of these: the library used the wrong private JSType profile.
  • Make the fixture report the failing native stage/error instead of collapsing it into a later pointer lookup failure.
  • Keep exact private writable mapping, byte-slice, and descriptor non-consumption assertions.
  • Add a deterministic parallel-load/repetition gate that passes in Debug and ReleaseSafe.
  • Do not serialize unrelated ABI fixtures unless the underlying API is intentionally process-global.

Implemented by 8270d17.

Activity

  1. chrisbbreuer commented on Jul 20, 2026

    @chrisbbreuer
    MemberAuthor

    Fixed and pushed to main in 8270d17. The mixed-profile gate passed with two concurrent Home 388/388 runs and two concurrent Bun FetchHeaders 25/25 runs in Bun-selected Debug, Bun-selected ReleaseSafe, and inverse Home-selected Debug configurations. The underlying memfd mapping assertions remain intact; the build now prevents the Home fixture from linking a Bun-tagged private ABI library (and vice versa).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions