Skip to content

fix looper concurrency safety - #3008

Merged
Qubitium merged 3 commits into
mainfrom
agent/fix-looper-concurrency-safety
Aug 6, 2026
Merged

fix looper concurrency safety#3008
Qubitium merged 3 commits into
mainfrom
agent/fix-looper-concurrency-safety

Conversation

@Qubitium

@Qubitium Qubitium commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • synchronize mutable looper task, input-cache, result, progress, timing, and device-monitor state shared by parallel workers
  • resolve every submitted quantization worker before propagating a submission or worker failure
  • preserve submission-order result collection and raise the first relevant error after workers are drained
  • add synthetic concurrency coverage for worker failures, task-map snapshots, cache replacement, shared accessors, and device-handle cleanup

Root cause

Parallel quantization workers can access processor-owned state while the orchestration thread updates or clears it. In addition, result collection previously stopped at the first failed future, allowing later submitted workers to remain active while the subset stage unwound.

Impact

Worker failures no longer leave sibling quantization work running during stage teardown. Shared looper state is protected for parallel and free-threaded execution. This does not change quantization math, checkpoint formats, or user configuration.

Validation

  • python -m pytest -q tests/test_looper_concurrency.py tests/test_weight_only_looper.py tests/test_moe_expert_batching.py — 25 passed under Python 3.14t with the GIL disabled
  • Ruff checks passed for all changed code, excluding only pre-existing diagnostics in the two edited modules
  • ty reported no diagnostics on changed lines; the repository retains pre-existing diagnostics outside this patch
  • git diff --check passed

@Qubitium
Qubitium marked this pull request as ready for review August 6, 2026 13:21
github-code-quality[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

github-code-quality[bot]

This comment was marked as resolved.

@Qubitium
Qubitium merged commit 4d19208 into main Aug 6, 2026
6 checks passed
@Qubitium
Qubitium deleted the agent/fix-looper-concurrency-safety branch August 6, 2026 14:06
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.

1 participant