Repository navigation
Commit 09ced53
integration: a runtime block leaves only while it is the one in force -- debug builds hold the LIFO order D2-C's install/uninstall relies on
internal::uninstall_runtime_ambient (R5 lane D2-C) copies the block's
values into the block it covered and makes that one current again. That
is right only while blocks leave in the reverse order they came: the
block removed must be the calling thread's block in force. PumpScope
guarantees it by construction -- the outermost scope of the pump that
installed a block ends on the thread that installed it, and a pump
nested inside (another engine run from a callback) has handed its own
block back before -- but nothing checked it. Debug builds (NDEBUG
undefined: the debug and sanitizers CI profiles build Debug) now
abort when tl_runtime_ambient.installed is not &block, the kernel's own
idiom for such checks (native_execution_consumer.cpp's #ifndef NDEBUG
std::abort blocks). Release builds compile nothing: no cost, no
behaviour change, no value moves.
What could violate it: a consumer whose first pump_ambient() of a pump
comes while another consumer's block, installed inside that same pump,
is still in force -- its block would then cover the inner one and the
inner pump's end would remove a block that is not in force. No caller
does that: every scope asks its own consumer's block (the host's
publication and suppressed tail, both request.security warm-up scopes,
dispatch_security_eval), and D2-C's witnesses -- two streams
interleaved input by input on one thread, a run nested in another
host's calculation (the outer host installs its block before it runs
the inner one), two threads at once -- all install and remove in
stack order; the debug and sanitizer profiles run every test under the
check.
Rule 2 (ADR-0001): no behaviour change -- a debug-build check of the
library's own per-thread state.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>1 parent 9bb1f7c commit 09ced53
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
40 | 47 | | |
41 | 48 | | |
42 | 49 | | |
| |||
0 commit comments