Repository navigation
Conversation
…le (host-pool slice 2) From fable/host-pool (3cf8a4e, b1d78ee, ae8b419; Codex's reviews folded in), as its final form: an engine module owns its thread (std::jthread, stop by token), takes move-only jobs as tickets with a completion ring (a job system, not a promise library), wakes only on work or stop, publishes an immutable snapshot readers copy without waiting on its work, refuses typed (std::expected<..., module_refusal>), and a module's stop cancels queued jobs typed and releases their captures. No call sites yet: the server target moves to C++23 in the slice that wires the first module; only this test needs it now. Receipt (M5, Apple clang 21): test-server-module ok from the cmake build, and standalone at -std=c++23 -Wall -Wextra -Werror under -fsanitize=thread: ok, 0 reports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Review exact5e5505e5ca2f276922efd7c826c100413dd75296: BLOCK pending job/completion contract corrections.
Stack remains dependent on blocked134. No build or runtime failure reproduction performed; findings are source-level contracts. |
… typed fault, snapshots read with no lock (Codex's review of #135) - inplace_job<Bytes, Args...>: a move-only callable stored INLINE in the ring (a fixed capture size, checked at compile time; nothrow-move; never a heap allocation, never a copyable target). std::function is gone. - A run or cancel call that throws is contained: recorded as module_fault {ticket, during, what} and counted in stats.faulted; its ticket still completes and the worker lives on (it terminated before). - snapshot_cell is a seqlock over atomic words: the writer never waits; a reader copies by value and retries only when a publish overlapped its copy; Snapshot must be trivially copyable (counters and ids), enforced. snapshot() returns the value, not a shared_ptr behind a mutex. - cancel_queued takes one job at a time with no allocation and no lock held across a call. Tests (one regression each): a throwing job is a typed fault, the next job runs, the faulted ticket completes; a throwing cancel during stop is typed and no waiter hangs; a job owning a unique_ptr queues, runs once and releases it; a reader racing 200,000 publishes never sees a torn value. Receipt (M5, Apple clang 21): test-server-module ok; -std=c++23 -Wall -Wextra -Werror under -fsanitize=thread 3 of 3 ok, under -fsanitize=address,undefined ok. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Re-review exactaec424d36a791a5bf071257bddb66461d8ada7b2: inline move-only capture and contained exceptions improve prior findings, but BLOCK remains.
The snapshot implementation is lock-free in form but retries/spins while publication is odd; it is not a bounded/no-wait read if writer is descheduled. State this limitation and measure contention rather than claim it never waits. No runtime reproduction performed; source-level review. |
…e, no string; empty jobs refused; the seqlock is described as it is (Codex's re-review of #135; Joel: strings, allocation and locking are the enemy) - job_outcome {pending, ran, run_faulted, cancelled, cancel_faulted}: submit(job, &outcome) takes the owner's storage and the module writes how the job ended there. Nothing is lost when several jobs fault, and the catch allocates nothing and cannot throw (module_fault and its std::string are gone; job_outcome_name renders text only at an export edge). stats.faulted is an atomic counter. - submit refuses an empty or moved-from job (module_refusal::empty): it is never queued or called. - snapshot_cell: reads take no lock but are NOT wait-free; a writer descheduled mid-publish stalls readers, who yield after a few retries instead of spinning. Said so in the header. - stopping(): owners (and tests) observe a requested stop. Tests: two faulting jobs each keep their own run_faulted while the next job runs; a throwing cancel during stop ends cancel_faulted and no waiter hangs (the blocker is released only after the stop is observed, so the run is deterministic); an empty and a moved-from job are refused typed while the moved-to job runs. Receipt (M5, Apple clang 21): -std=c++23 -Wall -Wextra -Werror under -fsanitize=thread 5 of 5 ok and under -fsanitize=address,undefined 5 of 5 ok. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Independent identity_crypto_review sourceAPPROVE revisedoutcomehandling exact478fe7c8dce518cf0784b86beb440e7f124d2205 conditional exactCI. Eachacceptedjob runs/cancelsonce, typedfaultoutcomes/capturedestruction/ticketcompletionordered; nointernalcatchallocation; inlinecapture/emptyrefusal sound. Caller mustretainoutcome/results untilticketcompletion (terminaloutcomealone precedescapturedestroy), distinctstorageperconcurrentjob, serializedshutdown. Snapshotreadretry limitationdocumented; test reads>0 needsstartupbarrier toavoid schedulingflakiness. UbuntuCIred stillblocksmerge; no builds. |
…mit), not the C++23 library type the grid lacks (Codex's CI read of #135) Ubuntu 22.04's libstdc++ has no <expected> (both ubuntu jobs failed at server-module.h). submit returns module_submit {ticket, refusal}: queued under a ticket (from 1), or refused (ticket 0) with the typed reason. No look-alike of the library type, no fallback: a plain struct this API owns. The test builds at C++20 (the server's standard). Also from the re-review: the outcome storage must stay valid until the owner observes the ticket's completion (said in submit's contract); the torn-read test starts the writer only once the reader runs, so it always overlaps; the faulting test jobs throw only on run (no noreturn warnings). Receipt (M5, Apple clang 21): cmake build 0 warnings, test-server-module ok; -std=c++20 -Wall -Wextra -Werror under -fsanitize=thread 3 of 3 ok and under -fsanitize=address,undefined 3 of 3 ok. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Slice 2 of the unmerged
fable/host-poolwork, stacked on #134. This is the job-system pattern every engine module will use (Joel, 2026-11-16: "build a servicemodule/runtimemodule equivalent base class there too").What it adds (header and test only, no call sites yet)
engine_module<Snapshot>:std::jthread, stopped by its stop token.std::expected<..., module_refusal>.stop_and_join()aborts loudly.The test needs C++23 (
std::expected,jthread). The server target moves to C++23 in the slice that wires the first module; that also supersedes #129's bump to C++20.Measured (M5, Apple clang 21, 2026-11-16)
test-server-module: ok.-std=c++23 -Wall -Wextra -Werrorunder ThreadSanitizer: ok, 0 reports.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo