Repository navigation
docs: add sequence diagrams and per-audience mental models - #454
mvandeberg wants to merge 1 commit into
Conversation
|
An automated preview of the documentation is available at https://454.capy.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-10-17 14:04:13 UTC |
|
GCOVR code coverage report https://454.capy.prtest3.cppalliance.org/gcovr/index.html Build time: 2026-10-17 14:18:17 UTC |
38e905f to
cb981c5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #454 +/- ##
===========================================
+ Coverage 98.09% 98.33% +0.24%
===========================================
Files 130 137 +7
Lines 6289 7316 +1027
===========================================
+ Hits 6169 7194 +1025
- Misses 120 122 +2
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
204f03a to
4574848
Compare
The Boost review asked for up-front mental models for each kind of reader and for sequence diagrams of the component interactions (cppalliance#399). Protocol anatomy and diagrams: - The introduction (index.adoc) ends with a Protocol Anatomy section in place of its Next Steps list. It has a sequence diagram of a task starting, suspending on I/O and resuming through the executor. A short model and reading path follow for each of the three audiences that P4172R1 section 3 defines: application developers (with a subsection for protocol libraries on streams), framework authors and I/O library authors. Each audience gets the facilities the paper assigns it, and the paths name example programs where they exist. - 4f gains "The Cancellation Sequence": a sequence diagram of a stop request reaching a suspended task, the race between the stop callback and normal completion, and a warning about that race. - Each diagram has a numbered step list that matches its arrows, plus mermaid accTitle/accDescr, so the content survives without JS. - partials/diagram-style.adoc puts a <style> block in each page with a diagram or a collapsible. Style in the page body applies page-wide and works on boost.org, which uses neither our playbook nor our CSS; Corosio's inlined benchmark SVGs style the page the same way. The diagrams use the palette and font of Corosio's benchmark charts, switched on html.dark, and every text and mark pair passes WCAG AA in both themes. The rules need !important because mermaid scopes its own rules to the diagram's id, and mermaid 10 drops themeCSS from diagram directives. The partial also spaces diagrams and collapsible blocks, and gives collapsible titles the theme's text color in dark mode, which boostlook does not yet do. - The prose follows chain ownership: the environment carries the chain's owner, a launcher owns the chain it starts, an I/O awaitable copies the owner into its continuation, an execution context abandons queued work on teardown, and stopping is distinguished from abandoning. The audience sections link to Lifetime and Ownership. The examples follow the same rules: read_op, racy_read and the trace program's awaitable copy the owner into their continuation, and the trace program's executor abandons queued work when it is destroyed. - The 4c execution model, 4f and the examples intro link to it. Stoppable awaitables: - The "correct pattern" snippet on 4e and 4f posted the coroutine from the stop callback unconditionally, so it resumed twice when the operation also completed. The Dangerous Pattern now shows that mistake. Inline resume is covered by a link to 4e. - The replacement, read_op in 4f_cancellation.cpp, races the stop callback and the completion on one atomic claim. An arrival count makes the winner wait for the end of await_suspend, so the coroutine cannot resume and free the awaiter or its await_context while await_suspend still runs, even on a thread_pool. 4e links to it instead of keeping its own copy. - The test races complete() against request_stop() from the moment the wait is armed, on a two-thread pool. It is TSan-clean, and TSan reports each mutation that drops a claim or the arrival count. Tests and lint: - index_page_trace.cpp runs the How a Task Runs sequence on a recording executor and exits non-zero if the order differs from the diagram's 13 arrows. - doc-lint exempts [mermaid] blocks from B2 and SHAPE, unless they are also [source,...]. The selftest covers both properties. - 4f_cancellation.cpp suppresses a GCC -O3 maybe-uninitialized false positive on std::optional<std::stop_callback> in a coroutine frame. Also fixes the gated wording findings on index.adoc and the doc-audit findings on lines this branch changed. Closes cppalliance#399
4574848 to
bcf6c95
Compare
The Boost review asked for up-front mental models for each kind of reader and for sequence diagrams of the component interactions (#399).
Mental models and diagrams:
Stoppable awaitables:
Tests and lint:
Also fixes the gated wording findings on index.adoc and the doc-audit findings on lines this branch changed.
Closes #399