Feature adapt swift6 - #37
Open
pbk20191 wants to merge 76 commits into
Open
Conversation
pbk20191
commented
Dec 21, 2024
Owner
- Adapt Swift 6 Concurrency
- Full Typed Throw
- New Actor Isolation model
Conflicts: Sources/Tetra/Combine/ExperimentalMapTask.swift
Conflicts: Sources/Tetra/Combine/CompatAsyncThrowingPublisher.swift
Conflicts: Sources/Tetra/Combine/Combine+Concurrency.swift Sources/Tetra/Concurrency/AsyncTypedSequence.swift
…ehavior change in swift 6 which cause test fail
Fix Escaping Function Block crash in Debug mode # Conflicts: # Sources/Tetra/Concurrency/CoreDataStack+Concurrency.swift
# Conflicts: # Sources/Tetra/Concurrency/CoreDataStack+Concurrency.swift
# Conflicts: # Sources/Tetra/Concurrency/CoreDataStack+Concurrency.swift
# Conflicts: # Sources/Tetra/Combine/ExperimentalMapTask.swift # Sources/Tetra/Combine/Publishers+MapTask.swift # Sources/Tetra/Combine/Publishers+TryMapTask.swift
pbk20191
force-pushed
the
feature/swift6
branch
from
January 27, 2025 17:49
3ad7b35 to
fc27252
Compare
pbk20191
force-pushed
the
feature/swift6
branch
from
January 27, 2025 17:58
fc27252 to
f8d202d
Compare
pbk20191
force-pushed
the
feature/swift6
branch
3 times, most recently
from
January 30, 2025 14:40
9f6c8b8 to
df57fdc
Compare
pbk20191
force-pushed
the
feature/swift6
branch
from
January 31, 2025 07:25
df57fdc to
8f68ec4
Compare
- StackBoundRunLoopExecutor (SerialExecutor facade) + KQScheduler engine over the ported SlicedJobQueue, wrapping a kqueue in a CFFileDescriptor run-loop source. Facade owns the run frame; stack-bound engine lifetime, pendingJobPop wake elision, producerGate quiescence. - KQueueSelector (EVFILT_USER wake + 3-clock-domain EVFILT_TIMER) and SerialExecutorRef (current-executor peek via swift_task_getCurrentExecutor). - Timer path: owning-thread ThreeArray<Timestamp?> armed set with arm-if-earlier; QoS-once boost release; per-lane drain fairness cap in runBatch. - Gate SchedulingExecutor/RunLoopExecutor/MainExecutor SPI conformances behind the opt-in `SchedulingExecutorSPI` package trait (off by default so release toolchains build; TaskExecutor stays unconditional). - Fix ThreeArray init precondition (5 -> 3) and SlicedJobQueue QoS-override install condition (was inverted). - Tests: 14 (executor behavior, kqueue selector, engine lifetime/dealloc). Also carries in-progress swift6 branch changes (CoreData/Combine/SwiftUI). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Syscall and protocol work on the kqueue run-loop engine, ported from swift-platform-executors' StackBoundRunLoopExecutor2: * Drop the per-lane thread QoS floor in the drain (platform convention: effective priority is thread base + producer overrides, as in libdispatch runloop queues; jobs are never demoted below the thread's base). Removes up to 6 __bsdthread_ctl traps per pump pass; background chain throughput improved ~3x in A/B measurement. * Producer-arms timer protocol: enqueueTimer arms EVFILT_TIMER directly under the timer lock (armIfEarlierLocked) — no EVFILT_USER wake per timer enqueue, and the inPump owning-thread special case is gone. * Merge armed deadlines into the TimerState lock (heaps + armed + FIFO sequence behind one createCheckedStateLock), replacing the unlocked owning-thread-only armed record. * timerCount fast path: skip the fire/arm passes (no lock, no clock reads) when no timers exist; clock reads are lazy per non-empty heap. * Move fired timer jobs into the ready lanes outside the timer lock via a reused dueBuffer, with thread:nil so the pump installs no override for jobs it is about to drain itself. * Equal-deadline timers now pop in enqueue (FIFO) order via a sequence tie-break in TimestampJob. * Priority->lane mapping uses the reference's inclusive band boundaries (>= 33/25/21/17); named priorities are unchanged. * Wrap the drain pass in an explicit autoreleasepool (defensive for the bare-thread run loops on older OS floors). * Move the capped lane drain from SlicedJobQueue.runBatch into the engine (drainReadyJobs/processLane), leaving SlicedJobQueue as a pure lanes+boost container; inline ThreeElement/FiveElement replace the rawLayout arrays. Behavior pins in DrainSyscallDisciplineTests: QoS discipline, mid-pump re-arm without producer wake, autorelease draining per pass, FIFO tie-break, and the lane band mapping. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.