Skip to content

Investigate semaphore worker joins in the 6000.5 IL2CPP suite #1150

Open

Description

DISCLOSURE: LLM-GENERATED TEXT

PR #1145 at ef83cc7 fails two existing SemaphoreLeaseTests.ConcurrentIndependentSemaphoresPreserveLeaseOwnership cases in the Unity 6000.5.2f1 job. The semaphore implementation and fixture were unchanged in this PR when it failed.

The cases with 2 and 8 workers fail with Expected True / False after 20.022940 s and 31.578619 s. Release IL2CPP omits source line information, so the original message cannot distinguish the allJoined and allReady assertions. The fixture at Tests/Runtime/Threading/SemaphoreLeaseTests.cs:268 uses a five-second ready/start handshake and a ten-second Join per worker, then checks ownership loss and all 5,000 iterations per worker. Do not assume a timeout is the only cause without diagnostics.

The failed standalone artifact is 13638933600, SHA-256 4d764dc2998a7220905d97b201fb1a52afa0bfc6ece46b61aa8676ee9b6ebaaa. It reports 18,635 passes, two failures and 1,765 skips. EditMode and PlayMode have zero failures; WProto-only standalone passes all 82 tests. License return and cleanup gates pass. The later acceptance-step failures propagate the main standalone failure.

On the same head, the 6000.6.0f1 player passes those two cases in 0.005993 s and 0.020733 s. Its artifact 13639132842 has SHA-256 bd0d3e4b135a897ad14a3653dfc8f3f50b6867c5a8d0b6f3ea0f9c1d337b7d14. A separate local Release IL2CPP 6000.5.2f1 probe using the real lease implementation also completes every operation with zero ownership loss, including forced-GC controls. It does not reproduce the CI stall and is not a fix. Repeated worker creation under allocation pressure is being investigated.

Acceptance:

  • Identify which original assertion and worker phase fail, retaining the original result and process evidence.
  • Reproduce the relevant mechanism with a controlled negative case; classify production, fixture or runtime coordination behavior before editing the contract.
  • Preserve the 2/8-worker ownership, permit-count and complete-iteration assertions. Do not skip the cases, add retries, or treat a passing rerun as a remedy.
  • Fix the identified mechanism, verify worker drainage and rerun the affected native lane plus current-head required CI.

Investigation is active in #1145; no root cause or remedy is claimed yet.

Activity

  1. wallstop commented on Nov 8, 2026

    @wallstop
    CollaboratorAuthor

    DISCLOSURE: LLM-GENERATED TEXT

    Controlled Release IL2CPP 6000.5.2f1 results now identify a fixture weakness. Adding a two-millisecond delay to each OS-yield return makes the original join assertion fail for both worker counts. After drainage, all 10,000/40,000 acquisitions complete with zero ownership loss. This reproduces a false failure from scheduling latency; it does not reconstruct the original CI host's precise scheduling history.

    A candidate uses 50 rendezvous rounds of 100 acquisitions per worker. Each worker holds a lease at the round boundary. It keeps all 5,000 acquisition/held/permit checks per worker and the existing ready/start/join deadlines. In the native probe it passes both worker counts with every operation complete and zero loss. The same protocol against the actual pre-3bd6676b SINGLE_THREADED disposal-store source fails both cases: 2 and 8 ownership losses, respectively. All workers drain. This checks that the change preserves detection of the historical race rather than merely removing stress.

    Earlier forced-GC and repeated-allocation probes did not reproduce the original stall. The latter completed 400 cases and ten million acquisitions without loss or join failures. Those are narrowing controls, not a remedy. The proposed fixture change is now in the working tree; the actual NUnit fixture is being run before publication. Full current-head native CI will still be required.

  2. wallstop commented on Nov 8, 2026

    @wallstop
    CollaboratorAuthor

    DISCLOSURE: LLM-GENERATED TEXT

    ca36a2a publishes the fixture correction in #1145. The actual Unity 6000.5.2f1 PlayMode NUnit fixture passes all 23 tests with zero skips. The two corrected cases pass in 0.007641 s and 0.006984 s in this local run; these are not full-suite or cross-host performance claims. The final run uses a clean test project after removing the temporary probe startup component; an earlier contaminated local run is excluded.

    Worker exceptions now become explicit NUnit failures, and join failures include ready/completed/lost/round-timeout counters. Production code is unchanged. Test-source compilation has zero warnings/errors. Preflight/fix, full spelling and pre-push checks pass. Fresh current-head native CI is running. The original CI host's precise scheduling history remains unobserved; the retained negative controls establish the fixture's yield/deadline false-failure mechanism and continued detection of the historical ownership race.

  3. wallstop commented on Nov 9, 2026

    @wallstop
    CollaboratorAuthor

    DISCLOSURE: LLM-GENERATED TEXT

    Metric correction for the controlled-probe note: the unsafe-store probe's counts of 2 and 8 are combined ownership/rendezvous failures. That counter also includes peers timing out after another worker stops. They are not separate counts of lost semaphore permits. Both historical unsafe-store controls fail, all workers drain, and the safe controls complete every acquisition with zero combined failures. The attempted edit to the earlier note did not apply, so this comment supplies the correction.

  4. wallstop commented on Nov 9, 2026

    @wallstop
    CollaboratorAuthor

    DISCLOSURE: LLM-GENERATED TEXT

    The corrected Unity 6000.5 lane passes on ca36a2a. Its retained player artifact 13640317649 has SHA-256 66ee80d2d6d5b17fe71d1544c702a60698b57da65d4d17e974b9b1fe9b4bf8f6. The XML reports 18,637 passes, zero failures, 1,765 skips and 31 inconclusive cases. The 2/8-worker cases both pass, in 1.206917 s and 1.569924 s. These CI durations are separate from the earlier local observations; no cross-host percentage is claimed.

    This is current-head verification of the changed fixture protocol, supported by the controlled false-failure and historical unsafe-store controls above. It is not a bare rerun offered as a remedy. The full remaining native matrix is still pending. The original failed run's exact worker/scheduling trace remains unavailable, so this issue stays open for that qualification.

  5. wallstop commented on Nov 12, 2026

    @wallstop
    CollaboratorAuthor

    DISCLOSURE: LLM-GENERATED TEXT

    Related, distinct worker-join failure in PR #1189's Unity 6000.5.2f1 job, head f928b87: unchanged PurgeBufferTests.ScratchBuffersRemainIsolatedAcrossThreads fails its five-second Thread.Join assertion (5.002565 seconds, 20:05:06–20:05:11 UTC). The retained standalone XML has 19,231 passes, this one failure, 31 inconclusive and 1,860 skips. Artifact 13979766798 is 2,774,581 bytes, SHA-256 445308848c58289784155bdf8a604229510a994c11d8b80c7394b5e95d365b06.

    This worker performs one thread-local scratch-list rent/add/return/reuse/return, with no yield loop or semaphore. The earlier controlled OS-yield scheduling mechanism above therefore does not explain this case. Production scratch buffers and this fixture were unchanged in the PR. The original result does not distinguish worker startup, managed work or native thread teardown; no cause or remedy is claimed.

    Investigation retains the original five-second deadline and every isolation/reuse assertion while adding progress-stage diagnostics. A first local native attempt never ran tests: MSVC 14.51 crashed compiling generated C++ (C1001). A second probe uses CI's Release/High-stripping configuration. A passing focused probe will only narrow the failure, not resolve it. PR landing remains blocked pending investigation.

  6. wallstop commented on Nov 12, 2026

    @wallstop
    CollaboratorAuthor

    DISCLOSURE: LLM-GENERATED TEXT

    Further narrowing, not a remedy: a local Unity 6000.5.2f1 High-stripping player built with Release C# and Debug IL2CPP C++ passes all 35 selected scratch-buffer/semaphore cases. The scratch case logs joined=True, final worker stage 7 and Stopped. An isolated diagnostic repetition campaign then completes all 10,000 repetitions with every original five-second join and isolation/reuse assertion. XML output contains exactly 10,000 joined=True/stage=7 records. Temporary repetition/progress code is removed; published f554adb retains diagnostics only.

    A broader Debug player attempt exits 3 without NUnit XML. Its final output does not identify the active test; it cannot establish that repetitions ran, and no matching Windows Application event was observed. A local-only callback trace is being used to identify that failure's subject. These are separate failed/limited probes, not Release qualification or native-process-health acceptance. The two local Release attempts did not run tests because MSVC 14.51.36231 crashed compiling generated test C++.

    No cause for the original Release five-second join failure is established. The current PR Release lane is pending; even a passing run will only narrow this investigation.

  7. wallstop commented on Nov 12, 2026

    @wallstop
    CollaboratorAuthor

    DISCLOSURE: LLM-GENERATED TEXT

    Current diagnostic head f554adb passes the fresh 6000.5.2f1 Release/High player: 19,232 passes, zero failures, 31 inconclusive and 1,860 skips. Artifact 13982604833 is 2,754,971 bytes, SHA-256 4a2735f4559dfed47be97a9a13fbfd535f7fa53bf68e9bcffd5ca9f1b4561e26. The scratch case passes in 0.000444 seconds with joined=True, final worker stage 7 and Background/Stopped. Its original five-second join and all isolation/reuse assertions remain intact.

    This is current-head verification and a narrowing observation, not a remedy for the original timeout. The original failed worker phase was not recorded and its cause remains unproven. Keep this investigation open. Local temporary repetitions/progress markers are removed and the owned probe project is deleted; no production scratch-buffer change was made.

  8. wallstop commented on Nov 15, 2026

    @wallstop
    CollaboratorAuthor

    DISCLOSURE: LLM-GENERATED TEXT

    Another recurrence on unchanged fixture and production sources in #1207, head b8eec5d: Unity 6000.6 standalone job. Artifact 14157190257, ZIP SHA-256 842555c18c02cc043b3fb9486cb4169470e60de805b2d93e57cb7b455297ae7e, contains the failed XML.

    ConcurrentIndependentSemaphoresPreserveLeaseOwnership(2) takes 20.046175 seconds and fails allJoined with ready=True, completed=10000, lost=0, roundTimeouts=0. The eight-worker case passes in 8.973374 seconds. ConcurrentLeasesSerializeTheCriticalSection passes in 12.106744 seconds. Main standalone totals: 19,455 passed, one failed, 1,905 skipped. Other mode results and license return/cleanup pass.

    An isolated CoreCLR Release probe using actual production sources and real NUnit passes the original and reduced-workload variants; the reduced variant still detects the actual pre-3bd6676b SINGLE_THREADED store. Removing unsynchronized acquisitions barely changes CoreCLR time. These probes do not reproduce the native stall, prove a remedy, or justify removing the existing 5,000-iteration assertions. No C# source changed.

    The connected local Unity 6000.6.7f1 host has compilation errors in other packages. Its requested PlayMode test never entered Play Mode and still has an active runner request; it supplies no passing fixture evidence. Head 1bb0092 subsequently passes the hosted 6000.6 native lane, which only narrows this investigation. Preserve this issue as unresolved; follow the existing phase-diagnostic and drainage acceptance before changing deadlines or workload.

  9. wallstop commented on Nov 25, 2026

    @wallstop
    CollaboratorAuthor

    DISCLOSURE: LLM-GENERATED TEXT

    The two-worker case recurred in #1351 at a50d8803c6d77264f6198a47a3a99e7e4cf8a163 on DAD-MACHINE, Unity 6000.6.0f1 Release IL2CPP. The first selected job returned an ordinary Standalone NUnit report with one failure among 18,919 cases. The join assertion failed after 10.678321 seconds with ready=True, completed=10000, lost=0, roundTimeouts=0. The eight-worker case passed in 0.046324 seconds. Neither the fixture nor the lease source differs from the PR base.

    The first Standalone artifact was retained and verified with SHA-256 e8c5a976032c4fc90dda6746f56aabaf0f20b0b2b28dbbcbd75edd8d01223046. The run independently hit the mode controller deadline, with other mode reports missing. License return and lock release succeeded. The counters show every lease iteration completed before failure reporting. They do not identify when the worker finished disposing its semaphore or when the native thread terminated. The issue stays open for that distinction and a controlled remedy.

  10. wallstop commented on Nov 25, 2026

    @wallstop
    CollaboratorAuthor

    DISCLOSURE: LLM-GENERATED TEXT

    The exact-head ELI retry passed both the two- and eight-worker cases. A separate Unity 6000.6.7f1 Windows Release/High IL2CPP diagnostic used the unchanged lease protocol and recorded loop completion, semaphore disposal, managed return and a duplicated native thread handle. The 200 unrestricted and 200 one-core repetitions all drained normally.

    Holding one worker after its semaphore was disposed reproduced the original timeout shape under controlled conditions. The 10-second join returned false with 10,000 acquisitions, zero lost leases and zero round timeouts. The native handle still reported WAIT_TIMEOUT. After release, both workers returned and drained. The controlled delay shows that those counters alone cannot identify where the hosted worker stalled. Keep this open until a recurring hosted failure captures the worker phase or yields a deterministic real trigger. No test or production changes landed for this issue.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions