Proposal: implement complete synctest bubble semantics
Nobody has claimed this yet.
- Dominant language
- LLVM
- Stars
- 758
- Forks
- 49
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 138
Description
Background
LLGo currently provides minimal internal/synctest hooks that report no active bubble. PR #2098 adds the Go 1.26 acquire, release, and inBubble hooks with the same no-bubble behavior so ordinary standard-library code can link and run. This is sufficient when no testing/synctest bubble is active, but it is not an implementation of synctest.
What a synctest bubble means
A bubble is an isolated logical test environment containing related goroutines, timers, and synchronization objects. The Go runtime uses it to make concurrent tests deterministic:
- bubble time is fake and advances only when all bubble goroutines are durably blocked
Waitreturns only after the bubble reaches a stable blocked state- goroutines and supported synchronization objects are associated with one bubble
- operations that improperly cross bubble boundaries are rejected
acquireandreleasekeep a bubble active across asynchronous workinBubbletemporarily executes a callback in the captured bubble
Returning nil from acquire is correct only for code running outside a bubble. It cannot support testing/synctest.Run or Wait semantics.
Proposal
Design the LLGo equivalent around its scheduler and timer model:
- per-goroutine bubble identity and lifetime
- active and durably-blocked accounting
- fake-clock ownership and timer advancement
- block and wake classification for channels, mutexes, condition variables, timers, sleep, and supported I/O paths
- association metadata and cross-bubble checks for synchronization objects
- propagation through async callbacks using
acquire,release, andinBubble - cancellation, panic, nested-call, and cleanup semantics matching the supported Go version
LLGo uses a different execution model from the Go g/m/p scheduler, so copying only the public hook bodies is insufficient. The proposal must identify equivalent scheduler transition points before implementation.
Versioning
The implementation and compatibility tests must be pinned to the supported Go toolchain version because internal/synctest is private and can change between Go releases. Upgrades should update the implementation and tests together.
Acceptance criteria
- run representative
testing/synctesttests for fake time, durable blocking, andWait - cover channel, mutex, condition, timer, sleep, and callback propagation behavior
- cover invalid cross-bubble operations and cleanup after panic
- keep the no-bubble fast path behavior used by ordinary programs and C libraries
- add platform coverage wherever LLGo scheduler or timer behavior differs
Related: #2088, #2098
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating LLGo’s internal/synctest hooks and the scheduler and timer transition points that correspond to bubble state, blocking, waking, and time advancement. Compare these with the supported Go toolchain’s testing/synctest behavior, then run representative fake-time, durable-blocking, Wait, cross-bubble, callback, and panic-cleanup tests to verify the acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100