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

Test: make shared GC attribution witnesses stable under full unit sharding #839

Closed

Description

@chrisbbreuer

Parent: #476. Related: #673 and #838 (observed while validating that compiler fix; no affected loop/suspension test failed in these runs).

Two consecutive zig build test-parallel runs on current main plus the #838 candidate each accounted for all 2,233 tests with 2,231 pass / 1 skip / 1 failure, but the single failure moved between unrelated GC-attribution witnesses:

  1. parallel_js: cooperative shared nursery rendezvous bounds object churn
    • failed only because ctx.gc_cooperative_attempts == 0
    • all JS work completed; no crash, race report, leak, or wrong result
    • immediately passed 3/3 when run with the exact test filter
  2. enable_gc: requested GC runs between microtasks after joined threads
    • failed because the final collected witness was not true
    • immediately passed 3/3 when run with the exact test filter

The earlier full run before the final storage-policy correction passed both of these witnesses and instead caught the now-fixed loop/suspension regressions, so neither predicate is deterministically broken by #838. The failures appear only under the full 10-shard load and move between collection-attribution boundaries.

Diagnose why the requested/cooperative collection can complete the workload without recording the expected witness under sharded load. Preserve the production tranche, collection requirements, and exact assertions: no sleeps, larger timeouts, forced extra drains/collections, relaxed predicates, disabled GC, or shard serialization. The test should observe the engine's real request/attempt publication deterministically, and the engine should make progress if the missing event is genuine.

Activity

  1. chrisbbreuer commented on Sep 1, 2026

    @chrisbbreuer
    MemberAuthor

    Landed on main in 0b6f4d96.

    Two independent causes were corrected:

    • synchronous Thread.join now remains parked until the worker has left its active interpreter and native stack; result publication alone no longer lets join return while Context GC must still treat the thread as live
    • the cooperative nursery witness now has either lane independently cross the unchanged 512 KiB tranche while its peer remains registered, making the existing attempt/collection/peer-park assertions scheduler-independent

    No sleeps, larger timeouts, forced collections, relaxed predicates, disabled GC, or shard serialization were added.

    Validation:

    • cooperative nursery witness: 10/10
    • requested microtask GC after join: 10/10
    • all 11 join-focused unit tests: pass
    • the same 11 tests under unsuppressed TSan: pass, no sanitizer report
    • full test-parallel: 2,232 passed, 1 skipped, 0 failed, 0 leaked across 10 shards

    Thread is a non-standard host API, so test262 is not applicable to this change.

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