Skip to content

test(provider): stop the unloaded-deletion epoch test hanging the SSD suites - #1653

Merged
Gajesh2007 merged 1 commit into
Layr-Labs:masterfrom
javiech1:test/flaky-ssd-tests
Oct 28, 2026
Merged

Gajesh2007 merged 1 commit into
Layr-Labs:masterfrom
javiech1:test/flaky-ssd-tests

Conversation

@javiech1

@javiech1 javiech1 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The test "unloaded deletion blocks reopen and keeps the epoch and sequence" (SSDCacheEpochStoreTests) sometimes hangs the whole test run. Its Task.detached holds SSDCacheEpochStore.recordLock, a process-wide lock, and blocks a cooperative-pool thread on release.wait() until the test signals it. Other suites running in parallel block on the same lock and can occupy every pool thread, so the test's own continuation never runs, release.signal() never happens, and nothing finishes. In a hung run every test of the filter has started and none has passed.

The lock holder and the reopen now run on GCD threads (onGCD), the holder releases the lock after 50 ms by itself, and the reopen proves it waited by checking that the deletion had already finished when it got the lock. The assertions are the same: the epoch stays unchanged during the deletion, the reopen waits for it, and the sequence continues at 2. Nothing outside the test changes.

Linked issue

None.

Test plan

  • swift build --build-tests (provider-swift)
  • swift test --skip-build --filter SSDCacheEpochStore, 60 runs each with a 45 s timeout, same Mac (M5 Max) and build:
Runs that hang Runs that fail
master 4 / 60 0
this PR 0 / 60 0
  • swift test --skip-build --filter "SSD|Checkpoint|PrefixCache" --skip "NativeDiffusionCheckpointStoreTests|SSDNativeCheckpointOracleTests|MiMoV26DiscoveryLoadFootprintTests|GPTOSS": 6 runs, 590 tests each, all pass. SSDCheckpointStageReservationTests ("release while a budget resize awaits…", 5 s entry deadline) had failed once in this filter while the pool was starved; it passed in all 6.
  • make docs-impact-check BASE=origin/master: OK.

Components touched

  • provider-swift (Swift CLI), tests only

Protocol / interface changes

  • No protocol/interface changes

Documentation impact

  • No documentation needed — reason: test-only change.

Changelog

  • No user-visible change.

Notes for reviewers

The same pattern (a blocking wait on a pool thread while holding a process-wide lock) would hang any other test that does it; this is the only one I found in the SSD suites (DispatchSemaphore waits inside Task bodies under SSDCacheEpochStore's lock).

Before And After

flowchart LR
  subgraph Before
    B1["Task.detached holds recordLock<br/>and waits on release (pool thread)"] --> B2["parallel suites block on recordLock<br/>and fill the cooperative pool"]
    B2 --> B3["test never resumes to signal release:<br/>whole run hangs"]
  end
  subgraph After
    A1["GCD thread holds recordLock<br/>for 50 ms, then releases it"] --> A2["reopen on GCD waits for the lock<br/>and checks the deletion finished"]
    A2 --> A3["pool threads waiting on the lock<br/>resume; run completes"]
  end
Loading

Refactor Pass

The EpochOpenState actor, the AsyncStream and the polling sleep are gone; one 6-line helper replaces them. Net −7 lines, single file.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…tive pool

"unloaded deletion blocks reopen and keeps the epoch and sequence" held
SSDCacheEpochStore's process-wide record lock on a cooperative-pool
thread until the test itself signalled a semaphore. Parallel suites
blocked on that lock can fill the pool, so the signal never ran and the
run hung (4 of 60 runs of the SSDCacheEpochStore filter on master).

The lock holder and the reopen now run on GCD, the holder releases the
lock after 50 ms on its own, and the reopen proves it waited for the
deletion. 0 of 60 runs hang.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 28, 2026

Copy link
Copy Markdown

@javiech1 is attempting to deploy a commit to the EigenLabs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Threat model review — advisory

Reviewed head 4542447162ab against base 8effff7f7067.

Reviewers: anthropic/claude-sonnet-5.5: first pass completed; anthropic/claude-opus-5.5: not needed by escalation policy; openai/gpt-6.1-sol: not needed by escalation policy

No actionable findings in the reviewed text. This is not a security approval.

Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging.

Scan completed.

Coverage: 4/4 source units; cross-file integration complete. 0 selected depth batch(es) pending. All threat definitions indexed; relevant full definitions selected. Unchanged callers are not scanned.

Cost this run: $0.1568 reported, $0.0000 reserved with unknown cost; 2 paid request(s), 0 reused batch(es), 0 provider cache-hit tokens.

Saved findings and earlier report · Historical findings are not confirmed resolved.

@Gajesh2007
Gajesh2007 merged commit f4dc31b into Layr-Labs:master Oct 28, 2026
4 of 9 checks passed
davidtai added a commit that referenced this pull request Oct 28, 2026
The merge adds #1566, #1591, #1602, #1605, #1606, #1607, #1612, #1621,
#1622, #1623, #1625, #1629, #1630, #1631, #1632 (provider 0.10.4),
#1633, #1644, #1652 and #1653 to this branch.

Conflicts and resolutions:
- CoordinatorClient+Connection.swift: #1606 moves the transport setup
  out of connectAndRun into the static function connectionParameters(for:),
  and puts the connectAndRun header below it. This branch adds the
  session parameter to the same header. The merge keeps the layout of
  master. The moved header has the signature of this branch:
  connectAndRun(_ session: CoordinatorSessionRecorder). Git merged the
  other changes without a conflict: the bounded handshake of master
  (CoordinatorConnectionHandshake.start) and the session recorder of
  this branch (markOpened after register, the session parameter of
  sessionLoop and receiveLoop, and the close-code read).
- docs/provider/cli-reference.md: the runtime constants table. The merge
  keeps the three reconnect rows and the ping/pong row of this branch.
  It adds the handshake deadline row of master after the ping/pong row,
  where master has it.
- docs/provider/troubleshooting.md: only the "Last updated" stamp had a
  conflict (2026-10-26 on this branch, 2026-10-27 on master). The merge
  keeps one stamp, 2026-10-27. Git merged the rows: the backoff citation
  of this branch and the new rows of master.

Each decision has one owner after the merge:
- CoordinatorReconnectPolicy chooses the wait before the next connection
  attempt, after each end of a session or of an attempt.
- CoordinatorConnectionHandshake (#1606) cancels a handshake that does
  not complete in 30 s. runLoop catches the timeout error. That attempt
  did not send register, so the policy gives the next backoff range, as
  on master.
- UnauthorizedConnectionRecovery (#1607, #1633) decides when to start a
  re-registration of a connection that the coordinator refuses. Its
  retry backoff counts re-registrations, not connection attempts, and an
  authorized verdict sets that count to zero. The re-registration closes
  the session. Then the policy chooses the wait, as for each other end.

Checks: against master, the merge has only the changes of this branch,
in its 15 files. The troubleshooting stamp is the one exception: it has
the date of master. Against this branch, the merge has only the changes
of master, in 651 files. The one exception is the connectAndRun header,
which has the session parameter. The gitlinks do not change: libs/mlx
31f550af, libs/mlx-swift 4926d3d9, libs/mlx-swift-lm aee6ebb6.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Gajesh2007 added a commit that referenced this pull request Oct 30, 2026
* chore(release): prepare provider 0.10.5

Set ProviderCore.version to 0.10.5 and mark v0.10.4 as published on 2026-10-28 (tag target 8effff7).

Open the v0.10.5 candidate entry with its upgrade and rollout notes: the MLX pins move to SDK main (mlx 72dffa2d, mlx-swift c633d221, mlx-swift-lm 2beb401f; twelve Metal backend files change, so the metallib hash changes and complete SSD checkpoints are not carried across the upgrade; the 0.10.2 NAX head-dim split fix is in the new mlx pin), no coordinator change or version floor, the platform snapshot after the tag (only ProviderCore.swift changes among its 34 inputs), darkbloom sandbox's add-on contract, and the entries that build no provider artifact.

Render the 19 pending fragments verbatim (python3 scripts/changelog.py render --version 0.10.5 --date 2026-10-30, without its heading line) below those notes and remove exactly those fragments.

Update the release runbook: the 0.10.5 scope, the pin and metallib checks before tagging, the rollout order and post-tag platform snapshot, platform evidence inspected on 2026-10-30, and the published history.

* chore(release): correct the 0.10.5 notes from the review pass

- The pins move to their forks' main (SDK means mlx-swift-lm here).
- #1644, #1653 and #1676 have no changelog entry; the dev-branch lane does build artifacts, so the CI and release-qualification entries change no provider artifact.
- The platform evidence row links the manifest at cb31f6b4 (darkbloom-platform#549, source_revision 8effff7) rather than a moving master.
- The published history keeps four releases, as 0.10.4's did.
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.

2 participants