Commit 663bc79
guard: say which road the stopped run hole came by
The hole this guard is about had two roads to it and the guard could not
tell them apart. drain asks about cancellation AFTER taking an index, so
the writer holding index zero can lose the processor in between, come
back to a cancelled context and return without ever reaching its
generator. Same hole, same manifest, weaker proof - a file that never
started is not a file cut off half way.
Measured with tools/probes/stoprace -held before changing anything:
never entered 0 times in 50 idle runs and 0 in 25 starved ones. So the
second road is one the construction allows and the machine does not
take, and that number decided the shape of this change.
The cancellation condition is therefore NOT rebuilt. Requiring the
generator to have started before cancelling would be a change with no
measured effect that carries its own risk, since a generator that never
started would end the run in success. What is added instead is a net:
the generator records that it was reached and the guard asserts it, as a
fourth assertion beside the three it already makes about its own reach.
This turns "measured once, did not happen" into "cannot happen
unnoticed", which matters because the sizes and the cancellation
condition above it are both things a later change can move.
Measured after: 50 runs including 30 under CPU starvation, zero
failures, the prefix mutation still reddens it, race detector clean.
The assertion has no mutation of its own and that is deliberate - no
mutation of product code reddens it alone.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 1f6f004 commit 663bc79
2 files changed
Lines changed: 33 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
31 | 49 | | |
32 | 50 | | |
33 | 51 | | |
| |||
53 | 71 | | |
54 | 72 | | |
55 | 73 | | |
56 | | - | |
| 74 | + | |
| 75 | + | |
57 | 76 | | |
58 | 77 | | |
59 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
| 266 | + | |
| 267 | + | |
267 | 268 | | |
268 | 269 | | |
269 | 270 | | |
| |||
315 | 316 | | |
316 | 317 | | |
317 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
318 | 329 | | |
319 | 330 | | |
320 | 331 | | |
| |||
0 commit comments