Repository navigation
Commit bd401b4
committed
fix(gc): D-559 — the safepoint park honors the fabrication region (ADR-0150 am1)
ADR-0150's contract ("a mid-builder stop-the-world collect is DEFERRED") was only
implemented for the SAME-thread torture/auto collect: the alloc-prologue safepoint
park ran before the fabrication_depth gate, so a peer's stopWorld parked a worker
MID-BRACKET — its in-progress builder nodes (raw *TailNode/*HamtNode/*Cons in
unrooted Zig locals) were invisible to the collect and swept; the resumed builder's
memcpy aliased recycled memory (the nested-cross-agent `@memcpy arguments alias`
crash, exit 134, ~3-7% under alloc-torture + the D-418 window injection).
Fix (JVM-GCLocker shape, web-grounded; Boehm per-worker stack scan rejected as
wasm-unportable — DA fork verbatim in ADR-0150 am1 + private/notes/D559-da-critique.md):
skip the park while fabrication_depth > 0; the thread parks at its next safepoint
OUTSIDE any bracket. Bracket-boundary parks are unsound at BOTH entry (fold partial
accumulators) and exit (unpublished result) — recorded so nobody optimizes one in.
No deadlock: a waiting stopWorld holds no lock a bracket needs.
DA-mandated hardening, all landed: fabrication_depth moved to root_set.zig;
safepoint.park + enterBlocked assert depth==0 (the chokepoint for all 6 park sites
and the enterBlocked side door); safepoint.max_stopworld_wait_ns makes the
fold-chain rendezvous delay observable (the accepted cost, tracked as D-560 with
the publish-roots flip as its trigger-gated discharge shape); mark_sweep's false
"bracket-covered" comment rewritten.
Verified: pre-fix ~3-7% crash → post-fix 100/100 clean (50+50 runs, both repros);
gc_torture 81/81 incl. the new deterministic alloc-agent/nested_xagent guard;
clj oracle confirms [1 2 2]. D-559 DISCHARGED; D-560 opened.
Smell-audited: 2: ADR-0150 amendment 1 (DA fork verbatim in Alternatives; Alt-3 publish-roots recorded as D-560's discharge shape rather than pre-emptively re-opening the Accepted F-006 premise).1 parent b86dd03 commit bd401b4
7 files changed
Lines changed: 187 additions & 60 deletions
File tree
- .dev
- decisions
- src/runtime
- concurrency
- gc
- test/e2e
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
55 | 45 | | |
56 | | - | |
| 46 | + | |
57 | 47 | | |
58 | 48 | | |
59 | 49 | | |
| |||
2334 | 2324 | | |
2335 | 2325 | | |
2336 | 2326 | | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
2337 | 2332 | | |
2338 | 2333 | | |
2339 | 2334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
210 | 282 | | |
211 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
212 | 289 | | |
213 | 290 | | |
214 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
31 | 41 | | |
32 | 42 | | |
33 | 43 | | |
| |||
53 | 63 | | |
54 | 64 | | |
55 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
56 | 74 | | |
57 | 75 | | |
58 | 76 | | |
| |||
72 | 90 | | |
73 | 91 | | |
74 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
75 | 99 | | |
76 | 100 | | |
77 | 101 | | |
| |||
109 | 133 | | |
110 | 134 | | |
111 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
112 | 142 | | |
113 | 143 | | |
114 | 144 | | |
| |||
0 commit comments