chore(wave11): plan execution-path backfill, reserve error codes, update area plans
- Audit roadmap vs TASKS (D-033); scope Wave 11 to M-FUNCTIONAL-03, M-TIME-03,
M-ASYNC-04/05, S-IO-03/04, S-RUNTIME-02/03 (D-034..D-036)
- Schedule VoidForge upstream requests after Wave 11 (D-037)
- Persist planner output, PREFLIGHT findings and contract addendum (D-038)
- Add AsyncErrorCode::closed, IoErrorCode::sync_failed,
RuntimeErrorCode::{self_join, shutdown_incomplete}
- Update Functional/IO/Runtime area plans and MIGRATION per C-13
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
38436b18c8
commit
7f95f89d52
16 files changed
+1856
-40
No files matched your search
@@ -58,7 +58,7 @@ the explicit path when a backward-compatible downgrade is impossible.
|
||||
| Core/Functional | Error categories, formatting adapters, foundation dependency cleanup | Existing representations and error chains; minimal consumer with optional packages absent |
|
||||
| Containers/Memory | Allocator-aware variants and changed invalidation/ownership | Move-only values, allocator lifetime, stable-handle/invalidation examples, old default behavior |
|
||||
| Data/Binary/Text | Exact integers, checked conversions, Unicode/limit policies | Large identifiers round-trip; overflow errors; old strict signed documents remain accepted/rejected identically |
|
||||
| Async/IO | Borrowed queued handles and detached work toward structured ownership | Cancellation/parked destruction and explicit join; blocking bridge cannot deadlock its own executor |
|
||||
| Async/IO | Borrowed queued handles and detached work toward structured ownership | Cancellation/parked destruction and explicit join; blocking bridge cannot deadlock its own executor. Recorded W11 changes: `Driver::shutdown_and_join` blocks for in-flight syscalls and joins file workers; `validate_limits` rejects `max_file_queue == 0`; Sync EventBus and Observable/Signal dispatch over snapshots (subscription changes take effect next pass); nested Observable/Signal updates for copyable types are queued FIFO; legacy `parallel_for` waits for all tasks before rethrowing; Async-mode EventBus handler exceptions are counted instead of terminating; legacy `retry` zero-attempt result kept until Wave C |
|
||||
| Net | Secure TLS defaults, total deadlines, redirect and streaming/session APIs | Private-CA correct-host tests; wrong-host failure; explicit legacy override if offered; no fallback to insecure mode |
|
||||
| Service/Plugin | Reference convenience versus owning handles; new C ABI | Acquired old generation survives replacement; C/C++ paths have separate ABI tests and destruction ownership |
|
||||
| Fsm/Scheduler | Terminal-state consistency and supervised children | Faulted termination, race loser cleanup, state checkpoint restore; no coroutine-frame serialization |
|
||||
|
||||
@@ -92,18 +92,22 @@ immutable and bounded; destructor traversal must not recurse through unbounded c
|
||||
|
||||
## Pure retry and callable ownership
|
||||
|
||||
NEW `RetryState::next(now, last_error)` returns either `stop`, `attempt`, or an absolute
|
||||
next-attempt time. Defaults: three total attempts and a 30-second total budget; explicit
|
||||
NEW `RetryState` exposes `begin(now)`, `next(now, outcome)` and `resume(now)`: `next`
|
||||
returns `stop` or `wait_until(absolute time)`; `begin`/`resume` return `attempt` or `stop`.
|
||||
Callers map their error to `AttemptOutcome` with a supplied classifier. Defaults: three total attempts and a 30-second total budget; explicit
|
||||
`no_deadline` is required for unlimited time. Zero attempts is invalid. Backoff arithmetic
|
||||
saturates at a configured cap before overflow, rejects negative durations/nonfinite
|
||||
multipliers, and accepts an injected URBG for reproducible jitter. A stop request or
|
||||
multipliers, and accepts an injected URBG for reproducible jitter; the default engine is seeded from
|
||||
`std::random_device`. A stop request or
|
||||
expired admission deadline prevents the next attempt; the policy cannot interrupt an
|
||||
already-running callback or reverse its side effects. Retryability is a supplied
|
||||
predicate and retrying writes still requires the caller's idempotency contract.
|
||||
|
||||
Retain the synchronous `retry` adapter temporarily, explicitly named as blocking. A
|
||||
Time-clock/sleeper adapter belongs in a separate Time-dependent header; Async supplies
|
||||
its own awaiting adapter. This prevents foundational retry code from importing execution.
|
||||
Retain 1.x `retry`/`retry_while` unchanged, including the zero-attempt default-result
|
||||
defect (recorded for Wave C). NEW `retry_blocking` takes injected `now`/`sleep` callables,
|
||||
so Functional stays standard-library-only and no Time-dependent retry header exists.
|
||||
Async supplies `Async::retry_async` over `TimerQueue`. This prevents foundational retry
|
||||
code from importing execution (W11 decision D-038).
|
||||
|
||||
Memoization becomes per-instance with an explicit key/result signature, default 1,024
|
||||
entries and FIFO eviction. Recursive calls mark an entry as computing; a repeated key
|
||||
|
||||
@@ -74,9 +74,11 @@ semantics avoid requiring every dispatch to drain a descriptor completely; the f
|
||||
budget can yield while data remains ready. This follows the
|
||||
[Linux epoll interface](https://man7.org/linux/man-pages/man7/epoll.7.html).
|
||||
|
||||
One driver thread owns interest updates and descriptor generations. Producers submit
|
||||
bounded control messages and wake it through eventfd; an embedder may drive bounded
|
||||
`poll_once` turns instead. Dispatch up to 64 ready descriptors and 64 KiB/direction per
|
||||
The Driver owns no thread. One thread at a time runs a `poll_once` turn (the poll owner)
|
||||
and owns interest updates and generations; a concurrent caller gets `busy` without
|
||||
touching descriptors. Producers submit bounded control messages and wake the owner
|
||||
through eventfd. Runtime or the embedder supplies the thread (`Driver::run`,
|
||||
`pump_until`). Dispatch up to 64 ready descriptors and 64 KiB/direction per
|
||||
descriptor per turn before yielding. Enable writable interest only with pending writes
|
||||
to avoid idle busy loops. HUP/ERR still trigger final read/error inspection. Async
|
||||
completion tickets transfer continuations to the supplied executor outside driver locks.
|
||||
@@ -89,7 +91,10 @@ integer directly. Socket connect completion checks the socket error state; accep
|
||||
obey the same fairness/admission budget. Platform-specific endpoint conversion remains
|
||||
an IO/Net adapter detail until the Net endpoint contract is integrated.
|
||||
|
||||
Files initially use a bounded native blocking worker pool. Positional pread/pwrite
|
||||
Files initially use a bounded native blocking worker pool, started explicitly by
|
||||
`start_file_workers()` or stepped by `run_file_work()`. Workers run only the syscall (or
|
||||
an injected syscall shim, the single documented exception) and queue its result;
|
||||
completions are delivered only by a poll turn. Positional pread/pwrite
|
||||
avoids shared offset races; default writes/syncs for one file are serialized in admission
|
||||
order, and reads expose explicit offsets. Worker ownership retains descriptor and buffer
|
||||
until the syscall returns. Cancelled queued work is removed before execution; an active
|
||||
@@ -116,8 +121,12 @@ Only terminal delivery is arbitrated once; no callback is delivered merely becau
|
||||
arrived while backend access or outcome classification was still pending.
|
||||
|
||||
Driver shutdown closes admission, cancels queued requests, asks active requests to
|
||||
stop, drains readiness/control/completion lanes, joins file workers, then releases
|
||||
descriptors/wake resources. It must keep the executor alive until all completion tickets
|
||||
stop, waits for the poll owner and in-flight syscalls, drains readiness/control/completion
|
||||
lanes, joins file workers, then closes operation descriptors. Epoll and wake descriptors
|
||||
close in the backend destructor. Blocking teardown runs in `Driver::~Driver`; destruction
|
||||
on a file worker or inside a poll turn is a programmer error. `File::close_and_join`
|
||||
returns `incomplete_shutdown` on expiry and retains the fd and buffers; a dropped File
|
||||
closes its fd after its last in-flight request drains. It must keep the executor alive until all completion tickets
|
||||
drain. `close_and_join` cannot free buffers when its own deadline expires; return an
|
||||
incomplete-shutdown report through the owning driver and retain work. Blocking joins
|
||||
are off-driver/off-worker operations; embedded drivers pump until their scopes join.
|
||||
@@ -151,7 +160,7 @@ are not owned by this document.
|
||||
| S-IO-01 | P1 / Async operation ownership and Time clock gates | Portable transfer/error/driver API, buffer leases, descriptor and quota ownership | Mock backend completes/stops in every ordering with exactly one result and no borrowed-buffer escape / astra_implementer |
|
||||
| S-IO-02 | P1 / S-IO-01 | Level-triggered epoll driver, wake/control path, generation-safe close and stream operations | Fragmentation/EAGAIN/EINTR/HUP/fd reuse and full queues do not lose completion or busy-spin / astra_implementer |
|
||||
| S-IO-03 | P2 / S-IO-01 | Bounded positional file workers, serialization, sync and active-cancel handling | Short writes preserve progress; active timeout retains buffers; sync success/failure after stop remains authoritative in the sole result / astra_implementer |
|
||||
| S-IO-04 | P2 / S-IO-02, S-IO-03 | Embedded pumping, joined shutdown, optional System/Net adapters | Shutdown during pending socket/file work retains resources; no IO→Runtime/Net dependency / sol_implementer |
|
||||
| S-IO-04 | P2 / S-IO-02, S-IO-03 | Embedded pumping, joined shutdown, SystemAsync conformance (Net adapter deferred: Net has no IO use) | Shutdown during pending socket/file work retains resources; no IO→Runtime/Net dependency / sol_implementer |
|
||||
| S-IO-05 | P3 / S-IO-04; performance harness | Optional io_uring capability/backend gate and portability conformance specification | Same tests pass; denied/unsupported capability falls back only before submission; profile evidence justifies enablement / astra_implementer |
|
||||
|
||||
## Validation, measurements and migration
|
||||
|
||||
@@ -45,10 +45,13 @@ struct Options {
|
||||
class Host { // owns managed resources
|
||||
public:
|
||||
static Result<Host> create(Options); // validates, starts no workers
|
||||
Result<void> start(); // explicit startup transaction
|
||||
Async::Executor& executor();
|
||||
IO::Driver& io();
|
||||
Coro::Task<Result<ShutdownReport>> shutdown(Async::OperationOptions);
|
||||
Result<void> start(StartOptions); // explicit startup transaction
|
||||
Async::Executor* executor();
|
||||
IO::Driver* io();
|
||||
Result<ShutdownReport> shutdown_blocking(Async::OperationOptions);
|
||||
Result<ShutdownReport> poll_shutdown(); // non-blocking step
|
||||
Result<ShutdownReport> shutdown_pumping(Async::ManualExecutor&, Async::OperationOptions);
|
||||
// No awaited shutdown Task on the host's own executor: it would self-join (D-038).
|
||||
};
|
||||
// NEW EmbeddedResources borrows executor, IO driver, Time clock and Memory budget.
|
||||
}
|
||||
@@ -70,11 +73,13 @@ constructors remain inert; start is explicit and errors return before publicatio
|
||||
|
||||
Use a lifecycle graph of explicit resources, with required/optional dependencies and
|
||||
deterministic topological ordering. Default core order: validate limits/capabilities →
|
||||
establish signal handling on the designated owner thread → allocate budgets and queues →
|
||||
install the injected `SignalGate` on the designated owner thread (Runtime has no System
|
||||
dependency; a System-backed adapter is optional) → allocate budgets and queues →
|
||||
start CPU executor → start IO driver/file workers → start optional service/admission
|
||||
adapters → report ready. SignalWatcher is created before worker threads as required by
|
||||
[its contract](../../../include/Void/System/SignalWatcher.hpp), and is destroyed on
|
||||
the same creating thread after workers join.
|
||||
the same creating thread after workers join; off-owner teardown calls `uninstall(false)`,
|
||||
which closes the gate's descriptor but cannot restore the owner's mask.
|
||||
|
||||
Each start step returns a retained cleanup action. A failed step aborts its partial
|
||||
resources and unwinds previously successful starts in reverse dependency order.
|
||||
@@ -111,19 +116,23 @@ idempotent; callers join one retained result rather than issue competing stop pa
|
||||
data and requests cooperative cancellation, but all admitted backend activity must
|
||||
still quiesce. Expiry of the total shutdown budget returns shutdown_incomplete with
|
||||
exporter owners and their execution resources retained; a later join continues them.
|
||||
6. Only after cleanup/export callbacks and backend references retire, stop reactor and
|
||||
CPU/file workers and release budgets/descriptors/signal masks in reverse creation
|
||||
order. Observation failure cannot suppress cleanup or convert a failed operation
|
||||
6. After cleanup/export callbacks and backend references retire, drop component/exporter
|
||||
references, then stop owned IO, the reactor and CPU/file workers, and release budgets,
|
||||
descriptors and the signal gate in reverse creation order. Borrowed executor, driver,
|
||||
clock and memory are never shut down or joined by the Host. Observation failure cannot suppress cleanup or convert a failed operation
|
||||
into success. A timed-out flush is not evidence that its resources are releasable.
|
||||
|
||||
Default total shutdown observation budget is 30 seconds, shortened by caller options.
|
||||
Each shutdown call observes min(caller deadline, now + total_timeout) for remaining work;
|
||||
drain-grace and flush deadlines are fixed at first entry to their phase. An incomplete
|
||||
phase stops the sequence and the next call resumes there.
|
||||
Expiry produces `shutdown_incomplete` containing pending owner IDs/counts and phase;
|
||||
the Host remains in joining with resources retained. It can be waited again or the
|
||||
application can choose explicit process termination. There is no forced thread kill,
|
||||
buffer release or dlclose. Borrowed resources must outlive final cleanup, not merely
|
||||
the first timed-out shutdown call. Destruction blocks to join only on an allowed
|
||||
off-worker owner thread; on a runtime worker, callers must await shutdown before
|
||||
destroying Host. Self-join misuse is detected as a programmer error. Process-level
|
||||
the first timed-out shutdown call. Destruction blocks to join only off Runtime threads;
|
||||
destruction on a Runtime worker, reactor or IO file-worker thread is a programmer error
|
||||
that terminates after a diagnostic. Process-level
|
||||
hard-stop policy belongs to the application, not a hidden destructor timeout.
|
||||
|
||||
Uncaught task exceptions reach explicit scope/error sinks. Default failure policy
|
||||
@@ -156,8 +165,8 @@ Every row is PLANNED.
|
||||
| ID | Phase / depends on | Intended scope | Acceptance / recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| S-RUNTIME-01 | P1 / Async ownership, IO driver, Time/Memory ports | Inert Host options, borrowed/owned resource graph, dependency validation | No constructor starts workers; invalid bounds/cycles fail before external admission / sol_implementer |
|
||||
| S-RUNTIME-02 | P2 / S-RUNTIME-01; System signal gate | Explicit start, readiness and reverse failed-start cleanup | Failure at every creation/start step leaves no worker/descriptors; signal-mask ownership retained / astra_implementer |
|
||||
| S-RUNTIME-03 | P2 / S-RUNTIME-02 | Structured shutdown, repeated join, exporter-before-executor ordering and budget accounting | Full queues deliver completion; in-flight export retains IO/workers through flush expiry; stalled work reports incomplete without freeing resources / astra_implementer |
|
||||
| S-RUNTIME-02 | P2 / S-RUNTIME-01, M-ASYNC-04, S-IO-03; signal gate (injected port) | Explicit start, readiness and reverse failed-start cleanup | Failure at every creation/start step leaves no worker/descriptors; signal-mask ownership retained / astra_implementer |
|
||||
| S-RUNTIME-03 | P2 / S-RUNTIME-02, S-IO-04 | Structured shutdown, repeated join, exporter-before-executor ordering and budget accounting | Full queues deliver completion; in-flight export retains IO/workers through flush expiry; stalled work reports incomplete without freeing resources / astra_implementer |
|
||||
| S-RUNTIME-04 | P3 / S-RUNTIME-03; Service/Configuration transaction gates | Optional managed adapters, transactional resize/reload and embedded examples | Same workload runs embedded/managed; failed resource prepare keeps active generation / sol_implementer |
|
||||
| S-RUNTIME-05 | P3 / S-RUNTIME-04; profile harness | Latency/throughput/footprint presets, inspection and tuning gates | Limits remain invariant per preset; measured p99/RSS/build cost reported with environment / astra_implementer |
|
||||
|
||||
|
||||
Reference in new issue
Block a user